Page 1 of 1

Graphic lumps localization?

Posted: Mon Jun 06, 2022 1:04 am
by Bilbö Bägginson
Is there any possibility to change shown pic according to chosen language.
I want to localize patchItems in main menu and "read this" page.

Re: Graphic lumps localization?

Posted: Mon Jun 06, 2022 4:45 am
by Enjay
I don't know about graphics (I *think* the answer is probably no, but I don't know for sure). However, it is possible to redefine the menus using text instead of graphics lumps (in MENUDEF) and these could then probably be localised.

Re: Graphic lumps localization?

Posted: Mon Jun 06, 2022 10:00 pm
by Bilbö Bägginson
Ok, I think I could set my pics as symbols of custom font or something. But what about info-page localisation? Because it is just a single image and you can`t add any text there, as I know.

Re: Graphic lumps localization?

Posted: Tue Jun 07, 2022 12:37 am
by Graf Zahl
There is an option for this, but with one caveat: The replacement graphic needs to be the same size as the original. The feature also hasn't seen much testing.
You have to put the localized versions of your graphics into "localized/textures/{texturename}.{languageid}.{extension}, e.g. 'localized/textures/titlepic.de.png'.
The whole feature is also under user control, if the 'cl_gfxlocalization' CVAR is set to 0, it will force use of the original graphic and there's other settings here when it comes to graphical menu entries - of course these are strongly discouraged when making a localization-aware mod.

The feature was never officially announced because it didn't really work as well as we wanted - but for text containing fullscreen graphics or in-game textures it should be ok.

Re: Graphic lumps localization?

Posted: Tue Jun 14, 2022 3:37 am
by Bilbö Bägginson
It could translate full-screen credit image, but not the patches. But it`s ok, I could replace them with text. Thanks

Re: Graphic lumps localization?

Posted: Tue Dec 13, 2022 7:11 am
by Bilbö Bägginson
Graf Zahl wrote: Tue Jun 07, 2022 12:37 am There is an option for this, but with one caveat: The replacement graphic needs to be the same size as the original. The feature also hasn't seen much testing.
You have to put the localized versions of your graphics into "localized/textures/{texturename}.{languageid}.{extension}, e.g. 'localized/textures/titlepic.de.png'.
Is there some way to use the feature with pictures defined in TEXTURES?
I need to scale them.

Re: Graphic lumps localization?

Posted: Mon Sep 18, 2023 3:06 pm
by N00b
Sorry for bumping an old thread, just came across this feature (have dreamt for it for quite a long time). It does not seem to work for me however (I'm using g4.11-pre195). I attach a sample file with a 'localized' wall texture, the variant with a window should be shown by default, but a plain wall if the language is Russian. However I can never see the second behaviour, no matter how I change the 'cl_gfxlocalization' and 'language' CVARs or restart the level or game.
I just hope this problem occurs because of my wrongdoing or a code oversight, would be a great loss if it is discontinued... I'm able to trigger this warning by using a 4-letter code, so that gives me hope the localization code is not completely cut off.
I also tried this with PNG textures for BoA (which is my main incentive to use this feature), to no avail.

Re: Graphic lumps localization?

Posted: Mon Sep 18, 2023 3:46 pm
by AFADoomer
I'm pretty sure the localized texture lookup for in-map textures was commented out in this commit.

Re: Graphic lumps localization?

Posted: Tue Sep 19, 2023 6:07 am
by N00b
Thank you very much, AFADoomer!
Graf, is there any possibility this gets reinstated in a not so distant future? Was it removed during debugging (or the feature caused problems in Raze)?

Re: Graphic lumps localization?

Posted: Tue Sep 19, 2023 8:52 am
by ramon.dexter
This would be actually pretty useful feature to have :)

Re: Graphic lumps localization?

Posted: Fri Sep 22, 2023 5:00 am
by Sir Robin
I haven't tried this out yet but I think you could also use the canvas feature to draw directly on a texture. It allows you to draw on a texture, so you could draw the texture as a blank without any localization and then draw the localization onto it in-game. Use an event handler to watch for a language change and update your textures there.

Re: Graphic lumps localization?

Posted: Fri Sep 22, 2023 7:49 am
by N00b
Thanks! The canvas might be a useful feature. I've also considered doing the replacement through a ZScript handler, just for modified copies of textures (because the English fonts that were originally used for them are most likely to have been lost, and adding a new in-game font for DrawText() would increase the burden on the already heavy BoA ZScript font system).
Even ACS has ReplaceTextures for "quite" a while. However I'm hesitant because 1) BoA is already bloated with handlers (around 30 so far), and 2) the handler will have to independently process every single image file in the localized/ directory; I doubt this would be anywhere near the native code in terms of speed.
I'll try this handler approach anyway. With ZScript pretty much everything is possible - if you are willing to pay with performance; hopefully in this case the price won't be too large.

Edit. Plus, of course, the textures will get replaced for all players, no matter the language setting they have; and we plan coop support.
Edit2. And GetFilesInFolder is not exported to ZScript, so I'll have to use a separate lump with all the filenames.

Re: Graphic lumps localization?

Posted: Sun Oct 22, 2023 2:37 pm
by Tormentor667
@Graf Zahl, do you consider readding this feature again? I'd really like to test it for The City of the Damned 2 Remaster and also as N00b has already stated for Blade of Agony.

Re: Graphic lumps localization?

Posted: Sun Oct 22, 2023 2:41 pm
by wildweasel
Tormentor667 wrote: Sun Oct 22, 2023 2:37 pm @Graf Zahl, do you consider readding this feature again? I'd really like to test it for The City of the Damned 2 Remaster and also as N00b has already stated for Blade of Agony.
If you'd really like the devs' attention you might try starting a ticket thread in Feature Suggestions.

Re: Graphic lumps localization?

Posted: Sun Oct 22, 2023 3:44 pm
by Tormentor667
I will just do that, thank you