Add custom language support for zscript\menu\playermenu.txt

Moderator: GZDoom Developers

Post Reply
User avatar
Kostov
 
 
Posts: 2020
Joined: Thu Dec 26, 2013 3:26 pm
Location: Sweden
Contact:

Add custom language support for zscript\menu\playermenu.txt

Post by Kostov »

There's this little piece of code in the aforementioned file, which translates to "PRESS SPACE TO SEE FRONT/BACK" in the player setup menu:

Code: Select all

	override void Drawer ()
	{
		Super.Drawer();
		String str = "PRESS " .. TEXTCOLOR_WHITE .. "SPACE";
		screen.DrawText (SmallFont, Font.CR_GOLD, 320 - 32 - 32 - SmallFont.StringWidth (str)/2, 50 + 48 + 70, str, DTA_Clean, true);
		str = mRotation ? "TO SEE FRONT" : "TO SEE BACK";
		screen.DrawText (SmallFont, Font.CR_GOLD, 320 - 32 - 32 - SmallFont.StringWidth (str)/2, 50 + 48 + 70 + SmallFont.GetHeight (), str, DTA_Clean, true);

	}
	
}
I tried modifying it and including it in a .pk3 for a translation I'm making. I got this error, though:

Code: Select all

File C:/Doom/GZDoom/gzdoom.pk3 is overriding core lump zscript/menu/playermenu.txt.
Is it possible to replace this part of the code so that the text can derive from the language.enu file instead, and thus make it possible to modify?
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Add custom language support for zscript\menu\playermenu.

Post by Major Cooke »

Already in. (Don't try overriding the default menus by the way, that won't work.)

First, set up the LANGUAGE lump. e.g.

Code: Select all

[en default]
QUITMSG = "Leave me. I have work to be done.";
Then use Stringtable.Localize like this:

Code: Select all

String quitmessage = Stringtable.Localize("$QUITMSG");
This will get you the specific language version.
User avatar
Rachael
Posts: 13542
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Add custom language support for zscript\menu\playermenu.

Post by Rachael »

Major Cooke wrote:Already in.
With the code snippet he quoted, it's not.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Add custom language support for zscript\menu\playermenu.

Post by Major Cooke »

Ah, you mean in the base version. Okay.
User avatar
Kostov
 
 
Posts: 2020
Joined: Thu Dec 26, 2013 3:26 pm
Location: Sweden
Contact:

Re: Add custom language support for zscript\menu\playermenu.

Post by Kostov »

Yeah. Best case scenario would be if this could be implemented in future versions of GZDoom.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Add custom language support for zscript\menu\playermenu.

Post by _mental_ »

Added in 19d25b0.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”