feat: PerkStat localization

This commit is contained in:
GenZmeY 2020-09-01 07:38:15 +03:00
parent 074115876c
commit 4d473f5aa4
2 changed files with 9 additions and 4 deletions

Binary file not shown.

View File

@ -9,11 +9,19 @@ var int StatIndex,OldValue,CurrentCost,MaxStatValue;
var string ProgressStr; var string ProgressStr;
var bool bCostDirty; var bool bCostDirty;
var localized string AddButtonToolTip;
var localized string CountBoxToolTip;
var localized string CostText;
function InitMenu() function InitMenu()
{ {
InfoText = KFGUI_TextLable(FindComponentID('Info')); InfoText = KFGUI_TextLable(FindComponentID('Info'));
StatCountBox = KFGUI_NumericBox(FindComponentID('CountBox')); StatCountBox = KFGUI_NumericBox(FindComponentID('CountBox'));
AddButton = KFGUI_Button(FindComponentID('AddBox')); AddButton = KFGUI_Button(FindComponentID('AddBox'));
AddButton.ToolTip=AddButtonToolTip;
StatCountBox.ToolTip=CountBoxToolTip;
Super.InitMenu(); Super.InitMenu();
} }
@ -43,7 +51,7 @@ function Timer()
bCostDirty = false; bCostDirty = false;
OldValue = MyPerk.PerkStats[StatIndex].CurrentValue; OldValue = MyPerk.PerkStats[StatIndex].CurrentValue;
if(CurrentCost != 0) if(CurrentCost != 0)
InfoText.SetText(MyPerk.GetStatUIStr(StatIndex)$" ["$OldValue$"/"$MaxStatValue$", Cost "$CurrentCost$", "$ProgressStr$"%]:"); InfoText.SetText(MyPerk.GetStatUIStr(StatIndex)$" ["$OldValue$"/"$MaxStatValue$", "$CostText$" "$CurrentCost$", "$ProgressStr$"%]:");
else else
InfoText.SetText(MyPerk.GetStatUIStr(StatIndex)$" ["$OldValue$"/"$MaxStatValue$", "$ProgressStr$"%]:"); InfoText.SetText(MyPerk.GetStatUIStr(StatIndex)$" ["$OldValue$"/"$MaxStatValue$", "$ProgressStr$"%]:");
} }
@ -118,7 +126,6 @@ final function string ChopExtraDigits( float Value )
defaultproperties defaultproperties
{ {
// TODO: localize
Begin Object Class=KFGUI_TextLable Name=InfoLable Begin Object Class=KFGUI_TextLable Name=InfoLable
ID="Info" ID="Info"
XPosition=0 XPosition=0
@ -136,7 +143,6 @@ defaultproperties
XSize=0.18 XSize=0.18
YSize=0.8 YSize=0.8
OnTextChange=EditBoxChange OnTextChange=EditBoxChange
ToolTip="Here you can specify how many stat points to buy"
MaxValue=100 MaxValue=100
MinValue=1 MinValue=1
bScaleByFontSize=false bScaleByFontSize=false
@ -148,7 +154,6 @@ defaultproperties
XSize=0.08 XSize=0.08
YSize=0.8 YSize=0.8
ButtonText="+" ButtonText="+"
ToolTip="Click here to buy stats for this perk"
OnClickLeft=BuyStatPoint OnClickLeft=BuyStatPoint
OnClickRight=BuyStatPoint OnClickRight=BuyStatPoint
End Object End Object