feat: MidGameMenu localization

This commit is contained in:
GenZmeY 2020-08-12 14:32:24 +03:00
parent f02a77156d
commit d07c52ea4c
2 changed files with 27 additions and 13 deletions

Binary file not shown.

View File

@ -9,6 +9,23 @@ var transient KFGUI_Button PrevButton;
var transient int NumButtons,NumButtonRows; var transient int NumButtons,NumButtonRows;
var transient bool bInitSpectate,bOldSpectate,bInitSkipTrader; var transient bool bInitSpectate,bOldSpectate,bInitSkipTrader;
var localized string MapVoteButtonText;
var localized string MapVoteButtonToolTip;
var localized string SettingsButtonText;
var localized string SettingsButtonToolTip;
var localized string SkipTraderButtonText;
var localized string SkipTraderButtonToolTip;
var localized string SpectateButtonText;
var localized string SpectateButtonToolTip;
var localized string CloseButtonText;
var localized string CloseButtonToolTip;
var localized string DisconnectButtonText;
var localized string DisconnectButtonToolTip;
var localized string ExitButtonText;
var localized string ExitButtonToolTip;
var localized string JoinButtonText;
var localized string JoinButtonToolTip;
function InitMenu() function InitMenu()
{ {
local int i; local int i;
@ -17,14 +34,13 @@ function InitMenu()
PageSwitcher = KFGUI_SwitchMenuBar(FindComponentID('Pager')); PageSwitcher = KFGUI_SwitchMenuBar(FindComponentID('Pager'));
Super(KFGUI_Page).InitMenu(); Super(KFGUI_Page).InitMenu();
// TODO: localize AddMenuButton('Mapvote',MapVoteButtonText,MapVoteButtonToolTip);
AddMenuButton('Mapvote',"Map Vote","Show mapvote menu"); AddMenuButton('Settings',SettingsButtonText,SettingsButtonToolTip);
AddMenuButton('Settings',"Settings","Enter the game settings"); SkipTraderButton = AddMenuButton('SkipTrader',SkipTraderButtonText,SkipTraderButtonToolTip);
SkipTraderButton = AddMenuButton('SkipTrader',"Skip Trader","start voting for skip trader"); SpectateButton = AddMenuButton('Spectate',SpectateButtonText,SpectateButtonToolTip);
SpectateButton = AddMenuButton('Spectate',"",""); AddMenuButton('Close',CloseButtonText,CloseButtonToolTip);
AddMenuButton('Close',"Close","Close this menu"); AddMenuButton('Disconnect',DisconnectButtonText,DisconnectButtonToolTip);
AddMenuButton('Disconnect',"Disconnect","Disconnect from this server"); AddMenuButton('Exit',ExitButtonText,ExitButtonToolTip);
AddMenuButton('Exit',"Exit","Exit this game");
for( i=0; i<Pages.Length; ++i ) for( i=0; i<Pages.Length; ++i )
{ {
@ -47,8 +63,8 @@ function Timer()
{ {
bInitSpectate = true; bInitSpectate = true;
bOldSpectate = PRI.bOnlySpectator; bOldSpectate = PRI.bOnlySpectator;
SpectateButton.ButtonText = (bOldSpectate ? "Join" : "Spectate"); // TODO: localize SpectateButton.ButtonText = (bOldSpectate ? JoinButtonText : SpectateButtonText);
SpectateButton.ChangeToolTip(bOldSpectate ? "Click to become an active player" : "Click to become a spectator"); // TODO: localize SpectateButton.ChangeToolTip(bOldSpectate ? JoinButtonToolTip : SpectateButtonToolTip);
} }
} }
@ -80,7 +96,6 @@ function ShowMenu()
SkipTraderButton.SetDisabled(false); SkipTraderButton.SetDisabled(false);
if( GetPlayer().WorldInfo.GRI!=None ) if( GetPlayer().WorldInfo.GRI!=None )
WindowTitle = GetPlayer().WorldInfo.GRI.ServerName; WindowTitle = GetPlayer().WorldInfo.GRI.ServerName;
//KFGFxHudWrapper(GetPlayer().MyHUD).SetVisible(false);
// Update spectate button info text. // Update spectate button info text.
Timer(); Timer();
@ -89,7 +104,6 @@ function ShowMenu()
function CloseMenu() function CloseMenu()
{ {
Super.CloseMenu(); Super.CloseMenu();
//KFGFxHudWrapper(GetPlayer().MyHUD).SetVisible(true);
} }
function ButtonClicked( KFGUI_Button Sender ) function ButtonClicked( KFGUI_Button Sender )
{ {
@ -159,7 +173,7 @@ final function KFGUI_Button AddMenuButton( name ButtonID, string Text, optional
defaultproperties defaultproperties
{ {
WindowTitle="Killing Floor 2 - Survival" // TODO: wtf? WindowTitle="RPG"
XPosition=0.1 XPosition=0.1
YPosition=0.1 YPosition=0.1
XSize=0.8 XSize=0.8