2017-10-20 02:00:49 +00:00
|
|
|
Class UI_AdminPerkLevel extends KFGUI_FloatingWindow;
|
|
|
|
|
|
|
|
var KFGUI_NumericBox LevelBox;
|
|
|
|
var int PlayerID,BaseValue;
|
2020-09-01 04:18:49 +00:00
|
|
|
var KFGUI_Button YesButton;
|
|
|
|
var KFGUI_Button NoButton;
|
|
|
|
|
|
|
|
var localized string WindowTitleSetLevel;
|
|
|
|
var localized string WindowTitleSetPrestigeLevel;
|
|
|
|
var localized string WindowTitleSetLevelOf;
|
|
|
|
var localized string WindowTitleSetPrestigeLevelOf;
|
|
|
|
var localized string YesButtonText;
|
|
|
|
var localized string YesButtonToolTip;
|
|
|
|
var localized string NoButtonText;
|
|
|
|
var localized string NoButtonToolTip;
|
|
|
|
var localized string LevelBoxToolTip;
|
2017-10-20 02:00:49 +00:00
|
|
|
|
|
|
|
function InitMenu()
|
|
|
|
{
|
|
|
|
Super.InitMenu();
|
|
|
|
|
|
|
|
LevelBox = KFGUI_NumericBox(FindComponentID('Edit'));
|
2020-09-01 04:18:49 +00:00
|
|
|
YesButton = KFGUI_Button(FindComponentID('Yes'));
|
|
|
|
NoButton = KFGUI_Button(FindComponentID('No'));
|
|
|
|
|
|
|
|
YesButton.ButtonText=YesButtonText;
|
|
|
|
YesButton.Tooltip=YesButtonToolTip;
|
|
|
|
NoButton.ButtonText=NoButtonText;
|
|
|
|
NoButton.Tooltip=NoButtonToolTip;
|
|
|
|
LevelBox.Tooltip=LevelBoxToolTip;
|
2017-10-20 02:00:49 +00:00
|
|
|
}
|
2020-09-01 04:18:49 +00:00
|
|
|
|
2020-11-28 20:04:55 +00:00
|
|
|
final function InitPage(int UserID, byte Mode)
|
2017-10-20 02:00:49 +00:00
|
|
|
{
|
|
|
|
local PlayerReplicationInfo PRI;
|
|
|
|
|
|
|
|
PlayerID = UserID;
|
|
|
|
|
|
|
|
// Find matching player by ID
|
|
|
|
foreach GetPlayer().WorldInfo.GRI.PRIArray(PRI)
|
|
|
|
{
|
2020-11-28 20:04:55 +00:00
|
|
|
if (PRI.PlayerID==UserID)
|
2017-10-20 02:00:49 +00:00
|
|
|
break;
|
|
|
|
}
|
2020-11-28 20:12:58 +00:00
|
|
|
if (ExtPlayerReplicationInfo(PRI)==None)
|
2017-10-20 02:00:49 +00:00
|
|
|
{
|
2020-09-01 04:18:49 +00:00
|
|
|
WindowTitle = Mode==1 ? WindowTitleSetLevel : WindowTitleSetPrestigeLevel;
|
2017-10-20 02:00:49 +00:00
|
|
|
return;
|
|
|
|
}
|
2020-09-01 04:18:49 +00:00
|
|
|
WindowTitle = (Mode==1 ? WindowTitleSetLevelOf : WindowTitleSetPrestigeLevelOf)$" "$PRI.GetHumanReadableName();
|
2017-10-20 02:00:49 +00:00
|
|
|
LevelBox.ChangeValue(string(Mode==1 ? ExtPlayerReplicationInfo(PRI).ECurrentPerkLevel : ExtPlayerReplicationInfo(PRI).ECurrentPerkPrestige));
|
|
|
|
BaseValue = (Mode==1 ? 100 : 100000);
|
|
|
|
}
|
2020-11-28 21:54:57 +00:00
|
|
|
|
2020-11-28 20:04:55 +00:00
|
|
|
function ButtonClicked(KFGUI_Button Sender)
|
2017-10-20 02:00:49 +00:00
|
|
|
{
|
2020-11-28 20:12:58 +00:00
|
|
|
switch (Sender.ID)
|
2017-10-20 02:00:49 +00:00
|
|
|
{
|
|
|
|
case 'Yes':
|
|
|
|
ExtPlayerController(GetPlayer()).AdminRPGHandle(PlayerID,BaseValue+LevelBox.GetValueInt());
|
|
|
|
DoClose();
|
|
|
|
break;
|
|
|
|
case 'No':
|
|
|
|
DoClose();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
defaultproperties
|
|
|
|
{
|
|
|
|
XPosition=0.35
|
|
|
|
YPosition=0.4
|
|
|
|
XSize=0.4
|
|
|
|
YSize=0.15
|
|
|
|
bAlwaysTop=true
|
|
|
|
bOnlyThisFocus=true
|
|
|
|
|
|
|
|
Begin Object Class=KFGUI_Button Name=YesButten
|
|
|
|
ID="Yes"
|
|
|
|
XPosition=0.4
|
|
|
|
YPosition=0.5
|
|
|
|
XSize=0.09
|
|
|
|
YSize=0.4
|
|
|
|
ExtravDir=1
|
|
|
|
OnClickLeft=ButtonClicked
|
|
|
|
OnClickRight=ButtonClicked
|
|
|
|
End Object
|
|
|
|
Begin Object Class=KFGUI_Button Name=NoButten
|
|
|
|
ID="No"
|
|
|
|
XPosition=0.5
|
|
|
|
YPosition=0.5
|
|
|
|
XSize=0.09
|
|
|
|
YSize=0.4
|
|
|
|
OnClickLeft=ButtonClicked
|
|
|
|
OnClickRight=ButtonClicked
|
|
|
|
End Object
|
|
|
|
Begin Object Class=KFGUI_NumericBox Name=EditBox
|
|
|
|
ID="Edit"
|
|
|
|
XPosition=0.05
|
|
|
|
YPosition=0.2
|
|
|
|
XSize=0.9
|
|
|
|
YSize=0.3
|
|
|
|
MaxValue=99999
|
|
|
|
End Object
|
|
|
|
|
|
|
|
Components.Add(YesButten)
|
|
|
|
Components.Add(NoButten)
|
|
|
|
Components.Add(EditBox)
|
|
|
|
}
|