From 52d64df7821fdf008d5119ae908ac177f8475c25 Mon Sep 17 00:00:00 2001 From: GenZmeY Date: Wed, 12 Aug 2020 17:12:44 +0300 Subject: [PATCH] feat: AdminMenu localization --- Localization/INT/ServerExt.int | Bin 36232 -> 37552 bytes ServerExt/Classes/UIP_AdminMenu.uc | 98 +++++++++++++++++++++-------- 2 files changed, 73 insertions(+), 25 deletions(-) diff --git a/Localization/INT/ServerExt.int b/Localization/INT/ServerExt.int index e82e1ea84838bbfe8ff2c90c94160818fbbc6492..064e9ebda388280d3f6fd4c2b2166376b256c7c2 100644 GIT binary patch delta 1232 zcma)6Jx{_=6g^=wCQeKam=^~VqXQ;RCJYrAj1W;UajjB;P|(ndve?B$7N?HRI^#d| z-1lgCd>PX;?Yr-sbMHO(wd2ps$B3{b!>$|&Is4V*x6 zwS`U8(Z&Ow8TW9DC$zZV$30_$Pj;2HuTq3jaG0x!BXn`Ye8O@f9a0P)BCju{H|Gg? zo02l}YdJ%<(#IVOt?7oksPH-D?VGgJFqlX{DupQvm~`!Fcf^-PnL4@Qzt{sJ17bUL z&9ib8B5hqFGY?xX=9*pkG~8wV4&Qv*9&!~@T72|?XIH#Fx}r_&;U#k$$zA(J7~t2Z`=Dx zOreSk;!D$lllT;i)7W{>9VAgj2ii<52Umt7XKTP!mCt~ei&pIBvKuA7ji~qwfM(RE delta 9 Qcmdn6l&NDj(}s>-02NyVLI3~& diff --git a/ServerExt/Classes/UIP_AdminMenu.uc b/ServerExt/Classes/UIP_AdminMenu.uc index 51230e0..e3d2fd1 100644 --- a/ServerExt/Classes/UIP_AdminMenu.uc +++ b/ServerExt/Classes/UIP_AdminMenu.uc @@ -1,20 +1,92 @@ Class UIP_AdminMenu extends KFGUI_MultiComponent; var KFGUI_ColumnList PlayersList; +var KFGUI_Button MotdButton; var editinline export KFGUI_RightClickMenu PlayerContext; var int SelectedID; +var localized string EditPlayer; +var localized string ShowDebugInfo; +var localized string Add1kXP; +var localized string Add10kXP; +var localized string AdvancePerkLevel; +var localized string SetPerkLevel; +var localized string SetPrestigeLevel; +var localized string UnloadAllStats; +var localized string UnloadAllTraits; +var localized string Remove1kXP; +var localized string Remove10kXP; +var localized string ResetAllStats; +var localized string ResetCurrentPerkStats; +var localized string ColumnPlayer; +var localized string ColumnTotalKills; +var localized string ColumnTotalExp; +var localized string ColumnTotalPlayTime; +var localized string EditMotdButtonText; +var localized string EditMotdButtonToolTip; + +function FRowItem newFRowItem(string Text, int Value, bool isSplitter) +{ + local FRowItem newItem; + + newItem.Text=Text; + newItem.Value=Value; + newItem.bSplitter=isSplitter; + + return newItem; +} + +function FColumnItem newFColumnItem(string Text, float Width) +{ + local FColumnItem newItem; + + newItem.Text=Text; + newItem.Width=Width; + + return newItem; +} + function InitMenu() { PlayersList = KFGUI_ColumnList(FindComponentID('Players')); + MotdButton = KFGUI_Button(FindComponentID('MOTD')); + + PlayerContext.ItemRows.AddItem(newFRowItem("",-1,false)); + PlayerContext.ItemRows.AddItem(newFRowItem(ShowDebugInfo,9,false)); + PlayerContext.ItemRows.AddItem(newFRowItem("",0,true)); + PlayerContext.ItemRows.AddItem(newFRowItem(Add1kXP,2,false)); + PlayerContext.ItemRows.AddItem(newFRowItem(Add10kXP,3,false)); + PlayerContext.ItemRows.AddItem(newFRowItem(AdvancePerkLevel,4,false)); + PlayerContext.ItemRows.AddItem(newFRowItem(SetPerkLevel,-1,false)); + PlayerContext.ItemRows.AddItem(newFRowItem(SetPrestigeLevel,-2,false)); + PlayerContext.ItemRows.AddItem(newFRowItem("",0,true)); + PlayerContext.ItemRows.AddItem(newFRowItem(UnloadAllStats,5,false)); + PlayerContext.ItemRows.AddItem(newFRowItem(UnloadAllTraits,6,false)); + PlayerContext.ItemRows.AddItem(newFRowItem("",0,true)); + PlayerContext.ItemRows.AddItem(newFRowItem(Remove1kXP,7,false)); + PlayerContext.ItemRows.AddItem(newFRowItem(Remove10kXP,8,false)); + PlayerContext.ItemRows.AddItem(newFRowItem("",0,true)); + PlayerContext.ItemRows.AddItem(newFRowItem(ResetAllStats,0,false)); + PlayerContext.ItemRows.AddItem(newFRowItem(ResetCurrentPerkStats,1,false)); + + PlayersList.Columns.AddItem(newFColumnItem(ColumnPlayer,0.55)); + PlayersList.Columns.AddItem(newFColumnItem(ColumnTotalKills,0.15)); + PlayersList.Columns.AddItem(newFColumnItem(ColumnTotalExp,0.15)); + PlayersList.Columns.AddItem(newFColumnItem(ColumnTotalPlayTime,0.15)); + + MotdButton.ButtonText=EditMotdButtonText; + MotdButton.Tooltip=EditMotdButtonToolTip; + Super.InitMenu(); } + function ShowMenu() { Super.ShowMenu(); SetTimer(2,true); Timer(); } + function CloseMenu() { Super.CloseMenu(); @@ -30,7 +102,7 @@ function SelectedRow( KFGUI_ListItem Item, int Row, bool bRight, bool bDblClick { if( bRight || bDblClick ) { - PlayerContext.ItemRows[0].Text = "-- EDIT: "$Item.Columns[0]; // TODO: localize? + PlayerContext.ItemRows[0].Text = EditPlayer$" "$Item.Columns[0]; // TODO: localize? SelectedID = Item.Value; PlayerContext.OpenMenu(Self); } @@ -56,33 +128,13 @@ function ButtonClicked( KFGUI_Button Sender ) defaultproperties { - // TODO: localize Begin Object Class=KFGUI_RightClickMenu Name=PlayerContextMenu - ItemRows.Add((Text="",Value=-1)) - ItemRows.Add((Text="Show Debug Info",Value=9)) - ItemRows.Add((bSplitter=true)) - ItemRows.Add((Text="Add 1,000 XP",Value=2)) - ItemRows.Add((Text="Add 10,000 XP",Value=3)) - ItemRows.Add((Text="Advance Perk Level",Value=4)) - ItemRows.Add((Text="Set Perk Level",Value=-1)) - ItemRows.Add((Text="Set Prestige Level",Value=-2)) - ItemRows.Add((bSplitter=true)) - ItemRows.Add((Text="Unload all stats",Value=5)) - ItemRows.Add((Text="Unload all traits",Value=6)) - ItemRows.Add((bSplitter=true)) - ItemRows.Add((Text="Remove 1,000 XP",Value=7)) - ItemRows.Add((Text="Remove 10,000 XP",Value=8)) - ItemRows.Add((bSplitter=true)) - ItemRows.Add((Text="Reset ALL Stats",Value=0)) - ItemRows.Add((Text="Reset Current Perk Stats",Value=1)) OnSelectedItem=SelectedRCItem End Object PlayerContext=PlayerContextMenu Begin Object Class=KFGUI_Button Name=EditMOTDButton ID="MOTD" - ButtonText="Edit MOTD" - Tooltip="Edit the server Message of the Day" XPosition=0.2 YPosition=0.997 XSize=0.1 @@ -98,10 +150,6 @@ defaultproperties YPosition=0.05 XSize=0.9 YSize=0.92 - Columns.Add((Text="Player",Width=0.55)) - Columns.Add((Text="Total Kills",Width=0.15)) - Columns.Add((Text="Total EXP",Width=0.15)) - Columns.Add((Text="Total PlayTime",Width=0.15)) OnSelectedRow=SelectedRow End Object Components.Add(PlayerList)