|
|
|
@ -1,87 +1,87 @@
|
|
|
|
|
class NiceGUIBuyMenu extends UT2k4MainPage;
|
|
|
|
|
//The "Header"
|
|
|
|
|
var automated GUIImage HeaderBG_Left;
|
|
|
|
|
var automated GUIImage HeaderBG_Center;
|
|
|
|
|
var automated GUIImage HeaderBG_Right;
|
|
|
|
|
var automated GUILabel CurrentPerkLabel;
|
|
|
|
|
var automated GUILabel TimeLeftLabel;
|
|
|
|
|
var automated GUILabel WaveLabel;
|
|
|
|
|
var automated GUILabel HeaderBG_Left_Label;
|
|
|
|
|
var automated KFQuickPerkSelect QuickPerkSelect;
|
|
|
|
|
var automated GUIImage HeaderBG_Left;
|
|
|
|
|
var automated GUIImage HeaderBG_Center;
|
|
|
|
|
var automated GUIImage HeaderBG_Right;
|
|
|
|
|
var automated GUILabel CurrentPerkLabel;
|
|
|
|
|
var automated GUILabel TimeLeftLabel;
|
|
|
|
|
var automated GUILabel WaveLabel;
|
|
|
|
|
var automated GUILabel HeaderBG_Left_Label;
|
|
|
|
|
var automated KFQuickPerkSelect QuickPerkSelect;
|
|
|
|
|
var automated KFBuyMenuFilter BuyMenuFilter;
|
|
|
|
|
var automated GUIButton StoreTabButton;
|
|
|
|
|
var automated GUIButton PerkTabButton;
|
|
|
|
|
var automated GUIButton StoreTabButton;
|
|
|
|
|
var automated GUIButton PerkTabButton;
|
|
|
|
|
//The "Footer"
|
|
|
|
|
var automated GUIImage WeightBG;
|
|
|
|
|
var automated GUIImage WeightIcon;
|
|
|
|
|
var automated GUIImage WeightIconBG;
|
|
|
|
|
var automated KFWeightBar WeightBar;
|
|
|
|
|
var automated GUIImage WeightBG;
|
|
|
|
|
var automated GUIImage WeightIcon;
|
|
|
|
|
var automated GUIImage WeightIconBG;
|
|
|
|
|
var automated KFWeightBar WeightBar;
|
|
|
|
|
//const BUYLIST_CATS =7;
|
|
|
|
|
var() editconst noexport float SavedPitch;
|
|
|
|
|
var color RedColor;
|
|
|
|
|
var color GreenGreyColor;
|
|
|
|
|
var() UT2K4TabPanel ActivePanel;
|
|
|
|
|
var localized string CurrentPerk;
|
|
|
|
|
var localized string NoActivePerk;
|
|
|
|
|
var localized string TraderClose;
|
|
|
|
|
var localized string WaveString;
|
|
|
|
|
var localized string LvAbbrString;
|
|
|
|
|
var() editconst noexport float SavedPitch;
|
|
|
|
|
var color RedColor;
|
|
|
|
|
var color GreenGreyColor;
|
|
|
|
|
var() UT2K4TabPanel ActivePanel;
|
|
|
|
|
var localized string CurrentPerk;
|
|
|
|
|
var localized string NoActivePerk;
|
|
|
|
|
var localized string TraderClose;
|
|
|
|
|
var localized string WaveString;
|
|
|
|
|
var localized string LvAbbrString;
|
|
|
|
|
function InitComponent(GUIController MyC, GUIComponent MyO)
|
|
|
|
|
{
|
|
|
|
|
local int i;
|
|
|
|
|
super.InitComponent(MyC, MyO);
|
|
|
|
|
c_Tabs.BackgroundImage = none;
|
|
|
|
|
c_Tabs.BackgroundStyle = none;
|
|
|
|
|
InitTabs();
|
|
|
|
|
for ( i = 0; i < c_Tabs.TabStack.Length; i++ )
|
|
|
|
|
{
|
|
|
|
|
c_Tabs.TabStack[i].bVisible = false;
|
|
|
|
|
}
|
|
|
|
|
UpdateWeightBar();
|
|
|
|
|
local int i;
|
|
|
|
|
super.InitComponent(MyC, MyO);
|
|
|
|
|
c_Tabs.BackgroundImage = none;
|
|
|
|
|
c_Tabs.BackgroundStyle = none;
|
|
|
|
|
InitTabs();
|
|
|
|
|
for ( i = 0; i < c_Tabs.TabStack.Length; i++ )
|
|
|
|
|
{
|
|
|
|
|
c_Tabs.TabStack[i].bVisible = false;
|
|
|
|
|
}
|
|
|
|
|
UpdateWeightBar();
|
|
|
|
|
}
|
|
|
|
|
function InitTabs()
|
|
|
|
|
{
|
|
|
|
|
local int i;
|
|
|
|
|
for ( i = 0; i < PanelCaption.Length && i < PanelClass.Length && i < PanelHint.Length; i++ )
|
|
|
|
|
{
|
|
|
|
|
c_Tabs.AddTab(PanelCaption[i], PanelClass[i],, PanelHint[i]);
|
|
|
|
|
}
|
|
|
|
|
local int i;
|
|
|
|
|
for ( i = 0; i < PanelCaption.Length && i < PanelClass.Length && i < PanelHint.Length; i++ )
|
|
|
|
|
{
|
|
|
|
|
c_Tabs.AddTab(PanelCaption[i], PanelClass[i],, PanelHint[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function UpdateWeightBar()
|
|
|
|
|
{
|
|
|
|
|
if ( KFHumanPawn(PlayerOwner().Pawn) != none )
|
|
|
|
|
{
|
|
|
|
|
WeightBar.MaxBoxes = KFHumanPawn(PlayerOwner().Pawn).MaxCarryWeight;
|
|
|
|
|
WeightBar.CurBoxes = KFHumanPawn(PlayerOwner().Pawn).CurrentWeight;
|
|
|
|
|
}
|
|
|
|
|
if ( KFHumanPawn(PlayerOwner().Pawn) != none )
|
|
|
|
|
{
|
|
|
|
|
WeightBar.MaxBoxes = KFHumanPawn(PlayerOwner().Pawn).MaxCarryWeight;
|
|
|
|
|
WeightBar.CurBoxes = KFHumanPawn(PlayerOwner().Pawn).CurrentWeight;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
event Opened(GUIComponent Sender)
|
|
|
|
|
{
|
|
|
|
|
local rotator PlayerRot;
|
|
|
|
|
super.Opened(Sender);
|
|
|
|
|
c_Tabs.ActivateTabByName(PanelCaption[0], true);
|
|
|
|
|
// Tell the controller that he is on a shopping spree
|
|
|
|
|
local rotator PlayerRot;
|
|
|
|
|
super.Opened(Sender);
|
|
|
|
|
c_Tabs.ActivateTabByName(PanelCaption[0], true);
|
|
|
|
|
// Tell the controller that he is on a shopping spree
|
|
|
|
|
if ( KFPlayerController(PlayerOwner()) != none )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
KFPlayerController(PlayerOwner()).bShopping = true;
|
|
|
|
|
}
|
|
|
|
|
if ( KFWeapon(KFHumanPawn(PlayerOwner().Pawn).Weapon).bAimingRifle )
|
|
|
|
|
{
|
|
|
|
|
KFWeapon(KFHumanPawn(PlayerOwner().Pawn).Weapon).IronSightZoomOut();
|
|
|
|
|
}
|
|
|
|
|
// Set camera's pitch to zero when menu initialised (otherwise spinny weap goes kooky)
|
|
|
|
|
PlayerRot = PlayerOwner().Rotation;
|
|
|
|
|
SavedPitch = PlayerRot.Pitch;
|
|
|
|
|
PlayerRot.Yaw = PlayerRot.Yaw % 65536;
|
|
|
|
|
PlayerRot.Pitch = 0;
|
|
|
|
|
PlayerRot.Roll = 0;
|
|
|
|
|
PlayerOwner().SetRotation(PlayerRot);
|
|
|
|
|
SetTimer(0.05f, true);
|
|
|
|
|
{
|
|
|
|
|
KFWeapon(KFHumanPawn(PlayerOwner().Pawn).Weapon).IronSightZoomOut();
|
|
|
|
|
}
|
|
|
|
|
// Set camera's pitch to zero when menu initialised (otherwise spinny weap goes kooky)
|
|
|
|
|
PlayerRot = PlayerOwner().Rotation;
|
|
|
|
|
SavedPitch = PlayerRot.Pitch;
|
|
|
|
|
PlayerRot.Yaw = PlayerRot.Yaw % 65536;
|
|
|
|
|
PlayerRot.Pitch = 0;
|
|
|
|
|
PlayerRot.Roll = 0;
|
|
|
|
|
PlayerOwner().SetRotation(PlayerRot);
|
|
|
|
|
SetTimer(0.05f, true);
|
|
|
|
|
}
|
|
|
|
|
function Timer()
|
|
|
|
|
{
|
|
|
|
|
UpdateHeader();
|
|
|
|
|
UpdateWeightBar();
|
|
|
|
|
UpdateHeader();
|
|
|
|
|
UpdateWeightBar();
|
|
|
|
|
}
|
|
|
|
|
function InternalOnClose(optional bool bCanceled)
|
|
|
|
|
{
|
|
|
|
@ -94,81 +94,81 @@ function InternalOnClose(optional bool bCanceled)
|
|
|
|
|
}
|
|
|
|
|
function UpdateHeader()
|
|
|
|
|
{
|
|
|
|
|
local int TimeLeftMin, TimeLeftSec;
|
|
|
|
|
local string TimeString;
|
|
|
|
|
if ( KFPlayerController(PlayerOwner()) == none || PlayerOwner().PlayerReplicationInfo == none ||
|
|
|
|
|
PlayerOwner().GameReplicationInfo == none )
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// Current Perk
|
|
|
|
|
if ( KFPlayerController(PlayerOwner()).SelectedVeterancy != none )
|
|
|
|
|
local int TimeLeftMin, TimeLeftSec;
|
|
|
|
|
local string TimeString;
|
|
|
|
|
if ( KFPlayerController(PlayerOwner()) == none || PlayerOwner().PlayerReplicationInfo == none ||
|
|
|
|
|
PlayerOwner().GameReplicationInfo == none )
|
|
|
|
|
{
|
|
|
|
|
CurrentPerkLabel.Caption = CurrentPerk$":" @ KFPlayerController(PlayerOwner()).SelectedVeterancy.default.VeterancyName @ LvAbbrString$KFPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo).ClientVeteranSkillLevel;
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// Current Perk
|
|
|
|
|
if ( KFPlayerController(PlayerOwner()).SelectedVeterancy != none )
|
|
|
|
|
{
|
|
|
|
|
CurrentPerkLabel.Caption = CurrentPerk$":" @ KFPlayerController(PlayerOwner()).SelectedVeterancy.default.VeterancyName @ LvAbbrString$KFPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo).ClientVeteranSkillLevel;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
CurrentPerkLabel.Caption = CurrentPerk$":" @ NoActivePerk;
|
|
|
|
|
}
|
|
|
|
|
// Trader time left
|
|
|
|
|
TimeLeftMin = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).TimeToNextWave / 60;
|
|
|
|
|
TimeLeftSec = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).TimeToNextWave % 60;
|
|
|
|
|
if ( TimeLeftMin < 1 )
|
|
|
|
|
{
|
|
|
|
|
TimeString = "00:";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
TimeString = "0" $ TimeLeftMin $ ":";
|
|
|
|
|
}
|
|
|
|
|
if ( TimeLeftSec >= 10 )
|
|
|
|
|
{
|
|
|
|
|
TimeString = TimeString $ TimeLeftSec;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
TimeString = TimeString $ "0" $ TimeLeftSec;
|
|
|
|
|
}
|
|
|
|
|
TimeLeftLabel.Caption = TraderClose @ TimeString;
|
|
|
|
|
if ( KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).TimeToNextWave < 10 )
|
|
|
|
|
{
|
|
|
|
|
TimeLeftLabel.TextColor = RedColor;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
TimeLeftLabel.TextColor = GreenGreyColor;
|
|
|
|
|
}
|
|
|
|
|
// Wave Counter
|
|
|
|
|
WaveLabel.Caption = WaveString$":" @ (KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).WaveNumber + 1)$"/"$KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).FinalWave;
|
|
|
|
|
{
|
|
|
|
|
CurrentPerkLabel.Caption = CurrentPerk$":" @ NoActivePerk;
|
|
|
|
|
}
|
|
|
|
|
// Trader time left
|
|
|
|
|
TimeLeftMin = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).TimeToNextWave / 60;
|
|
|
|
|
TimeLeftSec = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).TimeToNextWave % 60;
|
|
|
|
|
if ( TimeLeftMin < 1 )
|
|
|
|
|
{
|
|
|
|
|
TimeString = "00:";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
TimeString = "0" $ TimeLeftMin $ ":";
|
|
|
|
|
}
|
|
|
|
|
if ( TimeLeftSec >= 10 )
|
|
|
|
|
{
|
|
|
|
|
TimeString = TimeString $ TimeLeftSec;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
TimeString = TimeString $ "0" $ TimeLeftSec;
|
|
|
|
|
}
|
|
|
|
|
TimeLeftLabel.Caption = TraderClose @ TimeString;
|
|
|
|
|
if ( KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).TimeToNextWave < 10 )
|
|
|
|
|
{
|
|
|
|
|
TimeLeftLabel.TextColor = RedColor;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
TimeLeftLabel.TextColor = GreenGreyColor;
|
|
|
|
|
}
|
|
|
|
|
// Wave Counter
|
|
|
|
|
WaveLabel.Caption = WaveString$":" @ (KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).WaveNumber + 1)$"/"$KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).FinalWave;
|
|
|
|
|
}
|
|
|
|
|
function KFBuyMenuClosed(optional bool bCanceled)
|
|
|
|
|
{
|
|
|
|
|
local rotator NewRot;
|
|
|
|
|
// Reset player
|
|
|
|
|
NewRot = PlayerOwner().Rotation;
|
|
|
|
|
NewRot.Pitch = SavedPitch;
|
|
|
|
|
PlayerOwner().SetRotation(NewRot);
|
|
|
|
|
Super.OnClose(bCanceled);
|
|
|
|
|
if ( KFPlayerController(PlayerOwner()) != none )
|
|
|
|
|
{
|
|
|
|
|
local rotator NewRot;
|
|
|
|
|
// Reset player
|
|
|
|
|
NewRot = PlayerOwner().Rotation;
|
|
|
|
|
NewRot.Pitch = SavedPitch;
|
|
|
|
|
PlayerOwner().SetRotation(NewRot);
|
|
|
|
|
Super.OnClose(bCanceled);
|
|
|
|
|
if ( KFPlayerController(PlayerOwner()) != none )
|
|
|
|
|
{
|
|
|
|
|
KFPlayerController(PlayerOwner()).bShopping = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function CloseSale(bool savePurchases)
|
|
|
|
|
{
|
|
|
|
|
Controller.CloseMenu(!savePurchases);
|
|
|
|
|
Controller.CloseMenu(!savePurchases);
|
|
|
|
|
}
|
|
|
|
|
function bool ButtonClicked(GUIComponent Sender)
|
|
|
|
|
{
|
|
|
|
|
if ( Sender == PerkTabButton )
|
|
|
|
|
if ( Sender == PerkTabButton )
|
|
|
|
|
{
|
|
|
|
|
HandleParameters(PanelCaption[1], "OhHi!");
|
|
|
|
|
}
|
|
|
|
|
if ( Sender == StoreTabButton )
|
|
|
|
|
HandleParameters(PanelCaption[1], "OhHi!");
|
|
|
|
|
}
|
|
|
|
|
if ( Sender == StoreTabButton )
|
|
|
|
|
{
|
|
|
|
|
HandleParameters(PanelCaption[0], "OhHi!");
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
HandleParameters(PanelCaption[0], "OhHi!");
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
defaultproperties
|
|
|
|
|
{
|
|
|
|
|