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
|
|
|
|
2017-10-20 02:00:49 +00:00
|
|
|
final function InitPage( int UserID, byte Mode )
|
|
|
|
{
|
|
|
|
local PlayerReplicationInfo PRI;
|
|
|
|
|
|
|
|
PlayerID = UserID;
|
|
|
|
|
|
|
|
// Find matching player by ID
|
|
|
|
foreach GetPlayer().WorldInfo.GRI.PRIArray(PRI)
|
|
|
|
{
|
|
|
|
if ( PRI.PlayerID==UserID )
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if( ExtPlayerReplicationInfo(PRI)==None )
|
|
|
|
{
|
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);
|
|
|
|
}
|
|
|
|
function ButtonClicked( KFGUI_Button Sender )
|
|
|
|
{
|
|
|
|
switch( Sender.ID )
|
|
|
|
{
|
|
|
|
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)
|
|
|
|
}
|