Zed fixes #16
@ -1,34 +1,37 @@
|
||||
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 KFBuyMenuFilter BuyMenuFilter;
|
||||
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;
|
||||
//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;
|
||||
|
||||
// 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 KFBuyMenuFilter BuyMenuFilter;
|
||||
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;
|
||||
// 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;
|
||||
|
||||
function InitComponent(GUIController MyC, GUIComponent MyO)
|
||||
{
|
||||
local int i;
|
||||
|
||||
super.InitComponent(MyC, MyO);
|
||||
c_Tabs.BackgroundImage = none;
|
||||
c_Tabs.BackgroundStyle = none;
|
||||
@ -39,14 +42,17 @@ function InitComponent(GUIController MyC, GUIComponent MyO)
|
||||
}
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
||||
function UpdateWeightBar()
|
||||
{
|
||||
if ( KFHumanPawn(PlayerOwner().Pawn) != none )
|
||||
@ -55,9 +61,11 @@ function UpdateWeightBar()
|
||||
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
|
||||
@ -78,29 +86,37 @@ event Opened(GUIComponent Sender)
|
||||
PlayerOwner().SetRotation(PlayerRot);
|
||||
SetTimer(0.05f, true);
|
||||
}
|
||||
|
||||
function Timer()
|
||||
{
|
||||
UpdateHeader();
|
||||
UpdateWeightBar();
|
||||
}
|
||||
|
||||
function InternalOnClose(optional bool bCanceled)
|
||||
{
|
||||
local rotator NewRot;
|
||||
|
||||
// Reset player
|
||||
NewRot = PlayerOwner().Rotation;
|
||||
NewRot.Pitch = SavedPitch;
|
||||
PlayerOwner().SetRotation(NewRot);
|
||||
Super.OnClose(bCanceled);
|
||||
super.OnClose(bCanceled);
|
||||
}
|
||||
|
||||
function UpdateHeader()
|
||||
{
|
||||
local int TimeLeftMin, TimeLeftSec;
|
||||
local string TimeString;
|
||||
local KFGameReplicationInfo KFGRI;
|
||||
|
||||
if ( KFPlayerController(PlayerOwner()) == none || PlayerOwner().PlayerReplicationInfo == none ||
|
||||
PlayerOwner().GameReplicationInfo == none )
|
||||
{
|
||||
return;
|
||||
}
|
||||
KFGRI = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo);
|
||||
|
||||
// Current Perk
|
||||
if ( KFPlayerController(PlayerOwner()).SelectedVeterancy != none )
|
||||
{
|
||||
@ -110,9 +126,10 @@ function UpdateHeader()
|
||||
{
|
||||
CurrentPerkLabel.Caption = CurrentPerk$":" @ NoActivePerk;
|
||||
}
|
||||
|
||||
// Trader time left
|
||||
TimeLeftMin = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).TimeToNextWave / 60;
|
||||
TimeLeftSec = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).TimeToNextWave % 60;
|
||||
TimeLeftMin = KFGRI.TimeToNextWave / 60;
|
||||
TimeLeftSec = KFGRI.TimeToNextWave % 60;
|
||||
if ( TimeLeftMin < 1 )
|
||||
{
|
||||
TimeString = "00:";
|
||||
@ -121,6 +138,7 @@ function UpdateHeader()
|
||||
{
|
||||
TimeString = "0" $ TimeLeftMin $ ":";
|
||||
}
|
||||
|
||||
if ( TimeLeftSec >= 10 )
|
||||
{
|
||||
TimeString = TimeString $ TimeLeftSec;
|
||||
@ -129,8 +147,9 @@ function UpdateHeader()
|
||||
{
|
||||
TimeString = TimeString $ "0" $ TimeLeftSec;
|
||||
}
|
||||
|
||||
TimeLeftLabel.Caption = TraderClose @ TimeString;
|
||||
if ( KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).TimeToNextWave < 10 )
|
||||
if ( KFGRI.TimeToNextWave < 10 )
|
||||
{
|
||||
TimeLeftLabel.TextColor = RedColor;
|
||||
}
|
||||
@ -138,26 +157,31 @@ function UpdateHeader()
|
||||
{
|
||||
TimeLeftLabel.TextColor = GreenGreyColor;
|
||||
}
|
||||
|
||||
// Wave Counter
|
||||
WaveLabel.Caption = WaveString$":" @ (KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).WaveNumber + 1)$"/"$KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).FinalWave;
|
||||
WaveLabel.Caption = WaveString $ ":" @ (KFGRI.WaveNumber + 1) $ "/" $ KFGRI.FinalWave;
|
||||
}
|
||||
|
||||
function KFBuyMenuClosed(optional bool bCanceled)
|
||||
{
|
||||
local rotator NewRot;
|
||||
|
||||
// Reset player
|
||||
NewRot = PlayerOwner().Rotation;
|
||||
NewRot.Pitch = SavedPitch;
|
||||
PlayerOwner().SetRotation(NewRot);
|
||||
Super.OnClose(bCanceled);
|
||||
super.OnClose(bCanceled);
|
||||
if ( KFPlayerController(PlayerOwner()) != none )
|
||||
{
|
||||
KFPlayerController(PlayerOwner()).bShopping = false;
|
||||
}
|
||||
}
|
||||
|
||||
function CloseSale(bool savePurchases)
|
||||
{
|
||||
Controller.CloseMenu(!savePurchases);
|
||||
}
|
||||
|
||||
function bool ButtonClicked(GUIComponent Sender)
|
||||
{
|
||||
if ( Sender == PerkTabButton )
|
||||
@ -170,6 +194,7 @@ function bool ButtonClicked(GUIComponent Sender)
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Begin Object Class=GUIImage Name=HBGLeft
|
||||
|
Loading…
Reference in New Issue
Block a user