Zed fixes #16
@ -1,34 +1,37 @@
|
|||||||
class NiceGUIBuyMenu extends UT2k4MainPage;
|
class NiceGUIBuyMenu extends UT2k4MainPage;
|
||||||
//The "Header"
|
|
||||||
var automated GUIImage HeaderBG_Left;
|
// The "Header"
|
||||||
var automated GUIImage HeaderBG_Center;
|
var automated GUIImage HeaderBG_Left;
|
||||||
var automated GUIImage HeaderBG_Right;
|
var automated GUIImage HeaderBG_Center;
|
||||||
var automated GUILabel CurrentPerkLabel;
|
var automated GUIImage HeaderBG_Right;
|
||||||
var automated GUILabel TimeLeftLabel;
|
var automated GUILabel CurrentPerkLabel;
|
||||||
var automated GUILabel WaveLabel;
|
var automated GUILabel TimeLeftLabel;
|
||||||
var automated GUILabel HeaderBG_Left_Label;
|
var automated GUILabel WaveLabel;
|
||||||
var automated KFQuickPerkSelect QuickPerkSelect;
|
var automated GUILabel HeaderBG_Left_Label;
|
||||||
var automated KFBuyMenuFilter BuyMenuFilter;
|
var automated KFQuickPerkSelect QuickPerkSelect;
|
||||||
var automated GUIButton StoreTabButton;
|
var automated KFBuyMenuFilter BuyMenuFilter;
|
||||||
var automated GUIButton PerkTabButton;
|
var automated GUIButton StoreTabButton;
|
||||||
//The "Footer"
|
var automated GUIButton PerkTabButton;
|
||||||
var automated GUIImage WeightBG;
|
// The "Footer"
|
||||||
var automated GUIImage WeightIcon;
|
var automated GUIImage WeightBG;
|
||||||
var automated GUIImage WeightIconBG;
|
var automated GUIImage WeightIcon;
|
||||||
var automated KFWeightBar WeightBar;
|
var automated GUIImage WeightIconBG;
|
||||||
//const BUYLIST_CATS =7;
|
var automated KFWeightBar WeightBar;
|
||||||
var() editconst noexport float SavedPitch;
|
// const BUYLIST_CATS =7;
|
||||||
var color RedColor;
|
var() editconst noexport float SavedPitch;
|
||||||
var color GreenGreyColor;
|
var color RedColor;
|
||||||
var() UT2K4TabPanel ActivePanel;
|
var color GreenGreyColor;
|
||||||
var localized string CurrentPerk;
|
var() UT2K4TabPanel ActivePanel;
|
||||||
var localized string NoActivePerk;
|
var localized string CurrentPerk;
|
||||||
var localized string TraderClose;
|
var localized string NoActivePerk;
|
||||||
var localized string WaveString;
|
var localized string TraderClose;
|
||||||
var localized string LvAbbrString;
|
var localized string WaveString;
|
||||||
|
var localized string LvAbbrString;
|
||||||
|
|
||||||
function InitComponent(GUIController MyC, GUIComponent MyO)
|
function InitComponent(GUIController MyC, GUIComponent MyO)
|
||||||
{
|
{
|
||||||
local int i;
|
local int i;
|
||||||
|
|
||||||
super.InitComponent(MyC, MyO);
|
super.InitComponent(MyC, MyO);
|
||||||
c_Tabs.BackgroundImage = none;
|
c_Tabs.BackgroundImage = none;
|
||||||
c_Tabs.BackgroundStyle = none;
|
c_Tabs.BackgroundStyle = none;
|
||||||
@ -39,14 +42,17 @@ function InitComponent(GUIController MyC, GUIComponent MyO)
|
|||||||
}
|
}
|
||||||
UpdateWeightBar();
|
UpdateWeightBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
function InitTabs()
|
function InitTabs()
|
||||||
{
|
{
|
||||||
local int i;
|
local int i;
|
||||||
|
|
||||||
for ( i = 0; i < PanelCaption.Length && i < PanelClass.Length && i < PanelHint.Length; i++ )
|
for ( i = 0; i < PanelCaption.Length && i < PanelClass.Length && i < PanelHint.Length; i++ )
|
||||||
{
|
{
|
||||||
c_Tabs.AddTab(PanelCaption[i], PanelClass[i],, PanelHint[i]);
|
c_Tabs.AddTab(PanelCaption[i], PanelClass[i],, PanelHint[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function UpdateWeightBar()
|
function UpdateWeightBar()
|
||||||
{
|
{
|
||||||
if ( KFHumanPawn(PlayerOwner().Pawn) != none )
|
if ( KFHumanPawn(PlayerOwner().Pawn) != none )
|
||||||
@ -55,9 +61,11 @@ function UpdateWeightBar()
|
|||||||
WeightBar.CurBoxes = KFHumanPawn(PlayerOwner().Pawn).CurrentWeight;
|
WeightBar.CurBoxes = KFHumanPawn(PlayerOwner().Pawn).CurrentWeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
event Opened(GUIComponent Sender)
|
event Opened(GUIComponent Sender)
|
||||||
{
|
{
|
||||||
local rotator PlayerRot;
|
local rotator PlayerRot;
|
||||||
|
|
||||||
super.Opened(Sender);
|
super.Opened(Sender);
|
||||||
c_Tabs.ActivateTabByName(PanelCaption[0], true);
|
c_Tabs.ActivateTabByName(PanelCaption[0], true);
|
||||||
// Tell the controller that he is on a shopping spree
|
// Tell the controller that he is on a shopping spree
|
||||||
@ -78,29 +86,37 @@ event Opened(GUIComponent Sender)
|
|||||||
PlayerOwner().SetRotation(PlayerRot);
|
PlayerOwner().SetRotation(PlayerRot);
|
||||||
SetTimer(0.05f, true);
|
SetTimer(0.05f, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Timer()
|
function Timer()
|
||||||
{
|
{
|
||||||
UpdateHeader();
|
UpdateHeader();
|
||||||
UpdateWeightBar();
|
UpdateWeightBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
function InternalOnClose(optional bool bCanceled)
|
function InternalOnClose(optional bool bCanceled)
|
||||||
{
|
{
|
||||||
local rotator NewRot;
|
local rotator NewRot;
|
||||||
|
|
||||||
// Reset player
|
// Reset player
|
||||||
NewRot = PlayerOwner().Rotation;
|
NewRot = PlayerOwner().Rotation;
|
||||||
NewRot.Pitch = SavedPitch;
|
NewRot.Pitch = SavedPitch;
|
||||||
PlayerOwner().SetRotation(NewRot);
|
PlayerOwner().SetRotation(NewRot);
|
||||||
Super.OnClose(bCanceled);
|
super.OnClose(bCanceled);
|
||||||
}
|
}
|
||||||
|
|
||||||
function UpdateHeader()
|
function UpdateHeader()
|
||||||
{
|
{
|
||||||
local int TimeLeftMin, TimeLeftSec;
|
local int TimeLeftMin, TimeLeftSec;
|
||||||
local string TimeString;
|
local string TimeString;
|
||||||
|
local KFGameReplicationInfo KFGRI;
|
||||||
|
|
||||||
if ( KFPlayerController(PlayerOwner()) == none || PlayerOwner().PlayerReplicationInfo == none ||
|
if ( KFPlayerController(PlayerOwner()) == none || PlayerOwner().PlayerReplicationInfo == none ||
|
||||||
PlayerOwner().GameReplicationInfo == none )
|
PlayerOwner().GameReplicationInfo == none )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
KFGRI = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo);
|
||||||
|
|
||||||
// Current Perk
|
// Current Perk
|
||||||
if ( KFPlayerController(PlayerOwner()).SelectedVeterancy != none )
|
if ( KFPlayerController(PlayerOwner()).SelectedVeterancy != none )
|
||||||
{
|
{
|
||||||
@ -110,9 +126,10 @@ function UpdateHeader()
|
|||||||
{
|
{
|
||||||
CurrentPerkLabel.Caption = CurrentPerk$":" @ NoActivePerk;
|
CurrentPerkLabel.Caption = CurrentPerk$":" @ NoActivePerk;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trader time left
|
// Trader time left
|
||||||
TimeLeftMin = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).TimeToNextWave / 60;
|
TimeLeftMin = KFGRI.TimeToNextWave / 60;
|
||||||
TimeLeftSec = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).TimeToNextWave % 60;
|
TimeLeftSec = KFGRI.TimeToNextWave % 60;
|
||||||
if ( TimeLeftMin < 1 )
|
if ( TimeLeftMin < 1 )
|
||||||
{
|
{
|
||||||
TimeString = "00:";
|
TimeString = "00:";
|
||||||
@ -121,6 +138,7 @@ function UpdateHeader()
|
|||||||
{
|
{
|
||||||
TimeString = "0" $ TimeLeftMin $ ":";
|
TimeString = "0" $ TimeLeftMin $ ":";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( TimeLeftSec >= 10 )
|
if ( TimeLeftSec >= 10 )
|
||||||
{
|
{
|
||||||
TimeString = TimeString $ TimeLeftSec;
|
TimeString = TimeString $ TimeLeftSec;
|
||||||
@ -129,8 +147,9 @@ function UpdateHeader()
|
|||||||
{
|
{
|
||||||
TimeString = TimeString $ "0" $ TimeLeftSec;
|
TimeString = TimeString $ "0" $ TimeLeftSec;
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeLeftLabel.Caption = TraderClose @ TimeString;
|
TimeLeftLabel.Caption = TraderClose @ TimeString;
|
||||||
if ( KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).TimeToNextWave < 10 )
|
if ( KFGRI.TimeToNextWave < 10 )
|
||||||
{
|
{
|
||||||
TimeLeftLabel.TextColor = RedColor;
|
TimeLeftLabel.TextColor = RedColor;
|
||||||
}
|
}
|
||||||
@ -138,26 +157,31 @@ function UpdateHeader()
|
|||||||
{
|
{
|
||||||
TimeLeftLabel.TextColor = GreenGreyColor;
|
TimeLeftLabel.TextColor = GreenGreyColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wave Counter
|
// 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)
|
function KFBuyMenuClosed(optional bool bCanceled)
|
||||||
{
|
{
|
||||||
local rotator NewRot;
|
local rotator NewRot;
|
||||||
|
|
||||||
// Reset player
|
// Reset player
|
||||||
NewRot = PlayerOwner().Rotation;
|
NewRot = PlayerOwner().Rotation;
|
||||||
NewRot.Pitch = SavedPitch;
|
NewRot.Pitch = SavedPitch;
|
||||||
PlayerOwner().SetRotation(NewRot);
|
PlayerOwner().SetRotation(NewRot);
|
||||||
Super.OnClose(bCanceled);
|
super.OnClose(bCanceled);
|
||||||
if ( KFPlayerController(PlayerOwner()) != none )
|
if ( KFPlayerController(PlayerOwner()) != none )
|
||||||
{
|
{
|
||||||
KFPlayerController(PlayerOwner()).bShopping = false;
|
KFPlayerController(PlayerOwner()).bShopping = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function CloseSale(bool savePurchases)
|
function CloseSale(bool savePurchases)
|
||||||
{
|
{
|
||||||
Controller.CloseMenu(!savePurchases);
|
Controller.CloseMenu(!savePurchases);
|
||||||
}
|
}
|
||||||
|
|
||||||
function bool ButtonClicked(GUIComponent Sender)
|
function bool ButtonClicked(GUIComponent Sender)
|
||||||
{
|
{
|
||||||
if ( Sender == PerkTabButton )
|
if ( Sender == PerkTabButton )
|
||||||
@ -170,6 +194,7 @@ function bool ButtonClicked(GUIComponent Sender)
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
Begin Object Class=GUIImage Name=HBGLeft
|
Begin Object Class=GUIImage Name=HBGLeft
|
||||||
|
Loading…
Reference in New Issue
Block a user