Prepare fixtures
This commit is contained in:
parent
797e5ea192
commit
9c94356263
6021 changed files with 722805 additions and 22 deletions
73
kf_sources/KFGui/Classes/BuyableAmmo.uc
Normal file
73
kf_sources/KFGui/Classes/BuyableAmmo.uc
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
class BuyableAmmo extends GUIBuyable;
|
||||
|
||||
var bool bHasAmmo;
|
||||
var int maxAmmoCount;
|
||||
var class<Ammunition> ammoType;
|
||||
|
||||
// Function to initialise values when player is buying a new gun,
|
||||
// but has not completed purchase, therefore the weapon is not in the players
|
||||
// inventory (and therefore InitOwnedQuantity is useless)
|
||||
/*
|
||||
function InitNewPurchase( Pawn P )
|
||||
{
|
||||
bHasAmmo = ShowMe(p,SALE_Ammo,None);
|
||||
}
|
||||
|
||||
function int BuyMoreClips()
|
||||
{
|
||||
Return 0;
|
||||
}
|
||||
function int NumClips()
|
||||
{
|
||||
Return 0;
|
||||
}
|
||||
|
||||
function string GetBuyCaption(eSaleCat index)
|
||||
{
|
||||
return "Clip";
|
||||
}
|
||||
|
||||
//Consider ourselves bought
|
||||
function BuyMe( KFPawn P )
|
||||
{
|
||||
P.ServerBuyAmmo(ammoType,True);
|
||||
}
|
||||
|
||||
//Consider ourselves sold
|
||||
function SellMe( KFPawn P )
|
||||
{
|
||||
P.ServerSellAmmo(ammoType);
|
||||
}
|
||||
|
||||
//Fill up the weapon
|
||||
function FillMe( KFPawn P )
|
||||
{
|
||||
P.ServerBuyAmmo(ammoType,False);
|
||||
}
|
||||
|
||||
|
||||
function bool ShowMe(Pawn p, eSaleCat index, GuiBuyMenu ParentMenu )
|
||||
{
|
||||
local Inventory I;
|
||||
|
||||
if(index != SALE_Ammo)
|
||||
return false;
|
||||
|
||||
For( I=P.Inventory; I!=None; I=I.Inventory )
|
||||
{
|
||||
if( I.Class==relatedInventory )
|
||||
Return True;
|
||||
else if( Weapon(I)!=None && (Weapon(I).AmmoClass[0]==ammoType || Weapon(I).AmmoClass[1]==ammoType) )
|
||||
Return True;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
defaultproperties
|
||||
{
|
||||
/* InfoPanel=Class'KFGui.GUIBuyAmmoInfoPanel'
|
||||
infoDrawRotation=(Pitch=0,Yaw=-35000,Roll=0)
|
||||
infoDrawOffset=(X=50.000000,Y=0.000000,Z=-5.000000)
|
||||
infoDrawScale=0.800000
|
||||
*/
|
||||
}
|
||||
12
kf_sources/KFGui/Classes/BuyableFirstAidKit.uc
Normal file
12
kf_sources/KFGui/Classes/BuyableFirstAidKit.uc
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
//-----------------------------------------------------------
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
class BuyableFirstAidKit extends BuyablePowerup;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
ItemImage=texture'KillingFloorHUD.Trader_Weapon_Images.Trader_First_Aid'
|
||||
ItemCost=150
|
||||
ItemName="First Aid Kit"
|
||||
ItemDescription="Contains morphine, bandages, anti-biotics, and a variety of other goodies to bring a wounded soldier back up to speed."
|
||||
}
|
||||
29
kf_sources/KFGui/Classes/BuyablePowerup.uc
Normal file
29
kf_sources/KFGui/Classes/BuyablePowerup.uc
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
class BuyablePowerup extends GUIBuyable
|
||||
abstract;
|
||||
|
||||
/*
|
||||
function bool ShowMe(Pawn p, eSaleCat index, GUIBuyMenu ParentMenu)
|
||||
{
|
||||
if(index != SALE_Equipment)
|
||||
return false;
|
||||
return CanUseThis(p);
|
||||
}
|
||||
|
||||
function bool CanBuyMe(PlayerController pc)
|
||||
{
|
||||
return Super.CanBuyMe(pc) && CanUseThis(pc.pawn);
|
||||
}
|
||||
|
||||
function bool CanUseThis(pawn aPawn)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
defaultproperties
|
||||
{
|
||||
/* InfoPanel=Class'KFGui.GUIBuyDescInfoPanel'
|
||||
infoDrawRotation=(Pitch=0,Yaw=-35000,Roll=0)
|
||||
infoDrawOffset=(X=50.000000,Y=0.000000,Z=-20.000000)
|
||||
infoDrawScale=0.750000
|
||||
*/
|
||||
}
|
||||
15
kf_sources/KFGui/Classes/BuyableVest.uc
Normal file
15
kf_sources/KFGui/Classes/BuyableVest.uc
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
//-----------------------------------------------------------
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
class BuyableVest extends BuyablePowerup;
|
||||
|
||||
var int CorrespondingPerkIndex;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
ItemImage=texture'KillingFloorHUD.Trader_Weapon_Images.Trader_Vest'
|
||||
ItemCost=300
|
||||
ItemName="Combat armour"
|
||||
ItemDescription="Kevlar vest. Affords the wearer limited protection from most forms of attack." ARMOUR + 50"
|
||||
CorrespondingPerkIndex=0
|
||||
}
|
||||
90
kf_sources/KFGui/Classes/BuyableWeapon.uc
Normal file
90
kf_sources/KFGui/Classes/BuyableWeapon.uc
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
class BuyableWeapon extends GUIBuyable;
|
||||
|
||||
var int PowerValue;
|
||||
var int SpeedValue;
|
||||
var int RangeValue;
|
||||
|
||||
/*
|
||||
var bool bHideSale,bInitalInit,bHasThisGun;
|
||||
|
||||
function bool CanBuyMe(PlayerController p)
|
||||
{
|
||||
return Super.CanBuyMe(p) && !HasMe(p.Pawn);
|
||||
}
|
||||
function bool HasMe(Pawn p)
|
||||
{
|
||||
if( bInitalInit )
|
||||
Return bHasThisGun;
|
||||
bHasThisGun = Super.HasMe(p);
|
||||
bInitalInit = True;
|
||||
Return bHasThisGun;
|
||||
}
|
||||
|
||||
function bool ShowMe(Pawn p, eSaleCat index, GUIBuyMenu ParentMenu)
|
||||
{
|
||||
local bool hasThis,melee;
|
||||
local class<Weapon> stuf;
|
||||
|
||||
//cost *= 10;
|
||||
|
||||
hasThis = HasMe(p);
|
||||
stuf = class<Weapon>(relatedInventory);
|
||||
melee = stuf.Default.bMeleeWeapon;
|
||||
|
||||
switch(index)
|
||||
{
|
||||
case SALE_Personal:
|
||||
return hasThis && !bHideSale;
|
||||
case SALE_Melee:
|
||||
return melee && !hasThis;
|
||||
case SALE_Power:
|
||||
return !melee && IsPowerWeapon() && !hasThis;
|
||||
case SALE_Speed:
|
||||
return !melee && IsSpeedWeapon() && !hasThis;
|
||||
case SALE_Range:
|
||||
return !melee && IsRangeWeapon() && !hasThis;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function bool IsPowerWeapon()
|
||||
{
|
||||
return (PowerValue >= 65 || IsPrimaryAtt(PowerValue));
|
||||
}
|
||||
|
||||
function bool IsSpeedWeapon()
|
||||
{
|
||||
return (SpeedValue >= 65 || IsPrimaryAtt(SpeedValue));
|
||||
}
|
||||
|
||||
function bool IsRangeWeapon()
|
||||
{
|
||||
return (RangeValue >= 65 || IsPrimaryAtt(RangeValue));
|
||||
}
|
||||
|
||||
function bool IsPrimaryAtt(int att)
|
||||
{
|
||||
return (att >= RangeValue && att >=PowerValue && att >=SpeedValue);
|
||||
}
|
||||
|
||||
//Consider ourselves bought
|
||||
function BuyMe( KFPawn P )
|
||||
{
|
||||
bHasThisGun = True;
|
||||
P.ServerBuyWeapon(Class<Weapon>(relatedInventory));
|
||||
}
|
||||
|
||||
//Consider ourselves sold
|
||||
function SellMe( KFPawn P )
|
||||
{
|
||||
bHasThisGun = False;
|
||||
P.ServerSellWeapon(Class<Weapon>(relatedInventory));
|
||||
}
|
||||
|
||||
*/
|
||||
defaultproperties
|
||||
{
|
||||
// InfoPanel=Class'KFGui.GUIBuyWeaponInfoPanel'
|
||||
}
|
||||
78
kf_sources/KFGui/Classes/GUIBuyAmmoInfoPanel.uc
Normal file
78
kf_sources/KFGui/Classes/GUIBuyAmmoInfoPanel.uc
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
class GUIBuyAmmoInfoPanel extends GUIBuyInfoPanel;
|
||||
|
||||
var automated GUIWeaponImage i_weapBG; //Picture of ammo!
|
||||
var automated GUILabel l_name,l_clipcost,l_fillcost,l_clips;
|
||||
|
||||
function Display(GUIBuyable newWeapon)
|
||||
{
|
||||
/* local BuyableAmmo b;
|
||||
b = BuyableAmmo(newWeapon);
|
||||
if(b == None)
|
||||
{
|
||||
l_name.Caption = "";
|
||||
l_clipcost.Caption="";
|
||||
l_fillcost.Caption="";
|
||||
l_clips.Caption="";
|
||||
} else
|
||||
{
|
||||
l_name.Caption = b.ItemName;
|
||||
l_clipcost.Caption = "Clip cost:"@(b.Cost);
|
||||
l_fillcost.Caption = "Full Ammo:"@(b.Cost*B.BuyMoreClips());
|
||||
l_clips.Caption = "Have:"@B.NumClips()@"clips";
|
||||
}
|
||||
i_weapBG.ChangeToWeapon(b);
|
||||
*/
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
/*
|
||||
Begin Object Class=GUIWeaponImage Name=WeaponBack
|
||||
Image=Texture'Engine.WhiteSquareTexture'
|
||||
ImageColor=(B=0,G=0,R=0)
|
||||
ImageStyle=ISTY_Stretched
|
||||
ImageRenderStyle=MSTY_Normal
|
||||
WinHeight=1.000000
|
||||
OnRendered=WeaponBack.PostRenderBuyMenu
|
||||
End Object
|
||||
i_weapBG=GUIWeaponImage'KFGui.GUIBuyAmmoInfoPanel.WeaponBack'
|
||||
|
||||
Begin Object Class=GUILabel Name=nameLabel
|
||||
TextColor=(B=200,G=200,R=200,A=100)
|
||||
WinTop=0.010000
|
||||
WinLeft=0.010000
|
||||
WinHeight=0.070000
|
||||
End Object
|
||||
l_name=GUILabel'KFGui.GUIBuyAmmoInfoPanel.nameLabel'
|
||||
|
||||
Begin Object Class=GUILabel Name=clipcost
|
||||
TextColor=(B=200,G=200,R=200,A=100)
|
||||
WinTop=0.900000
|
||||
WinLeft=0.010000
|
||||
WinHeight=0.070000
|
||||
End Object
|
||||
l_clipcost=GUILabel'KFGui.GUIBuyAmmoInfoPanel.clipcost'
|
||||
|
||||
Begin Object Class=GUILabel Name=fillcost
|
||||
TextAlign=TXTA_Right
|
||||
TextColor=(B=200,G=200,R=200,A=100)
|
||||
WinTop=0.900000
|
||||
WinLeft=0.010000
|
||||
WinWidth=0.950000
|
||||
WinHeight=0.070000
|
||||
End Object
|
||||
l_fillcost=GUILabel'KFGui.GUIBuyAmmoInfoPanel.fillcost'
|
||||
|
||||
Begin Object Class=GUILabel Name=clips
|
||||
TextAlign=TXTA_Right
|
||||
TextColor=(B=200,G=200,R=200,A=100)
|
||||
WinTop=0.600000
|
||||
WinLeft=0.350000
|
||||
WinWidth=0.500000
|
||||
WinHeight=0.070000
|
||||
End Object
|
||||
l_clips=GUILabel'KFGui.GUIBuyAmmoInfoPanel.clips'
|
||||
|
||||
i_back=None
|
||||
*/
|
||||
}
|
||||
56
kf_sources/KFGui/Classes/GUIBuyDescInfoPanel.uc
Normal file
56
kf_sources/KFGui/Classes/GUIBuyDescInfoPanel.uc
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
class GUIBuyDescInfoPanel extends GUIBuyInfoPanel;
|
||||
|
||||
//var automated GUIWeaponImage i_weapBG; //Love my black background
|
||||
//var automated GUILabel l_name, l_desc; //Weapon's name, description
|
||||
|
||||
|
||||
function Display(GUIBuyable newWeapon)
|
||||
{
|
||||
/* local GUIBuyable b;
|
||||
b =newWeapon;
|
||||
if(b == None)
|
||||
{
|
||||
l_name.Caption = "";
|
||||
l_desc.Caption = "";
|
||||
} else
|
||||
{
|
||||
l_name.Caption = b.ItemName;
|
||||
l_desc.Caption = b.Description;
|
||||
}
|
||||
i_weapBG.ChangeToWeapon(b);
|
||||
*/
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
/* Begin Object Class=GUIWeaponImage Name=WeaponBack
|
||||
Image=Texture'Engine.WhiteSquareTexture'
|
||||
ImageColor=(B=0,G=0,R=0)
|
||||
ImageStyle=ISTY_Stretched
|
||||
ImageRenderStyle=MSTY_Normal
|
||||
WinHeight=1.000000
|
||||
OnRendered=WeaponBack.PostRenderBuyMenu
|
||||
End Object
|
||||
i_weapBG=GUIWeaponImage'KFGui.GUIBuyDescInfoPanel.WeaponBack'
|
||||
|
||||
Begin Object Class=GUILabel Name=nameLabel
|
||||
TextColor=(B=50,G=50,R=255,A=255)
|
||||
WinTop=0.010000
|
||||
WinLeft=0.010000
|
||||
WinHeight=0.070000
|
||||
End Object
|
||||
l_name=GUILabel'KFGui.GUIBuyDescInfoPanel.nameLabel'
|
||||
|
||||
Begin Object Class=GUILabel Name=descLabel
|
||||
TextColor=(B=200,G=200,R=200,A=200)
|
||||
TextFont="UT2SmallFont"
|
||||
bMultiLine=True
|
||||
WinTop=0.110000
|
||||
WinLeft=0.010000
|
||||
WinHeight=1.000000
|
||||
End Object
|
||||
l_desc=GUILabel'KFGui.GUIBuyDescInfoPanel.descLabel'
|
||||
|
||||
i_back=None
|
||||
*/
|
||||
}
|
||||
355
kf_sources/KFGui/Classes/GUIBuyForSalePanel.uc
Normal file
355
kf_sources/KFGui/Classes/GUIBuyForSalePanel.uc
Normal file
|
|
@ -0,0 +1,355 @@
|
|||
//-----------------------------------------------------------
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
class GUIBuyForSalePanel extends GUIPanel;
|
||||
|
||||
var automated GUIForSaleHeaderPanel PanelForSaleHeader; // for Sale list list header
|
||||
var array<GUIForSaleBodyPanel> ForSaleBodyPanelArray; // The Item rows
|
||||
|
||||
var KFLevelRules KFLR;
|
||||
var KFLevelRules KFLRit;
|
||||
|
||||
var bool bNeedsUpdate;
|
||||
|
||||
var color RedColor;
|
||||
var color DarkRedColor;
|
||||
var color GreenColor;
|
||||
var color GrayColor;
|
||||
|
||||
var sound SellSound;
|
||||
var sound BuySound;
|
||||
|
||||
/*
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
super.InitComponent(Mycontroller, MyOwner);
|
||||
}
|
||||
|
||||
function InternalOnCreateComponent(GUIComponent NewComp, GUIComponent Sender)
|
||||
{
|
||||
}
|
||||
|
||||
function UpDateCheck(GUIComponent Sender)
|
||||
{
|
||||
if ( bNeedsUpdate )
|
||||
{
|
||||
Update();
|
||||
}
|
||||
}
|
||||
|
||||
function Update()
|
||||
{
|
||||
local float OldX, GameDifficulty;
|
||||
local GUIForSaleBodyPanel NewForSalePanel;
|
||||
local int i, j;
|
||||
local class<KFVeterancyTypes> PlayerVeterancy;
|
||||
local KFSteamStatsAndAchievements KFStatsAndAchievements;
|
||||
|
||||
OldX = PanelForSaleHeader.WinTop + 0.00100;
|
||||
|
||||
// Remove any old items from the components list
|
||||
for ( i = 0; i < ForSaleBodyPanelArray.Length; i++ )
|
||||
{
|
||||
RemoveComponent(ForSaleBodyPanelArray[i]);
|
||||
}
|
||||
|
||||
// Clear the component array
|
||||
ForSaleBodyPanelArray.Remove(0, ForSaleBodyPanelArray.Length);
|
||||
|
||||
// We need the difficulty to calculate the price
|
||||
if ( PlayerOwner().GameReplicationInfo != none )
|
||||
{
|
||||
GameDifficulty = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).GameDiff;
|
||||
}
|
||||
|
||||
// Grab the items for sale
|
||||
foreach PlayerOwner().DynamicActors(class'KFLevelRules', KFLRit)
|
||||
{
|
||||
KFLR = KFLRit;
|
||||
Break;
|
||||
}
|
||||
|
||||
// Grab Players Veterancy for quick reference
|
||||
if ( KFPlayerController(PlayerOwner()) != none && KFPlayerController(PlayerOwner()).SelectedVeterancy != none )
|
||||
{
|
||||
PlayerVeterancy = KFPlayerController(PlayerOwner()).SelectedVeterancy;
|
||||
KFStatsAndAchievements = KFSteamStatsAndAchievements(KFPlayerController(PlayerOwner()).SteamStatsAndAchievements);
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerVeterancy = class'KFVeterancyTypes';
|
||||
KFStatsAndAchievements = KFSteamStatsAndAchievements(PlayerOwner().PlayerReplicationInfo.SteamStatsAndAchievements);
|
||||
}
|
||||
|
||||
// Let's build the list of buyable items
|
||||
for ( i = 0; i < KFLR.MAX_CATEGORY; ++i )
|
||||
{
|
||||
// Categroy header
|
||||
NewForSalePanel = GUIForSaleBodyPanel(AddComponent("KFGUI.GUIForSaleBodyPanel"));
|
||||
NewForSalePanel.bBoundToParent = true;
|
||||
NewForSalePanel.bScaleToParent = true;
|
||||
NewForSalePanel.WinHeight = 0.040000;
|
||||
NewForSalePanel.WinTop = OldX + 0.0500000;
|
||||
NewForSalePanel.bVisible = true;
|
||||
|
||||
GUILabel(NewForSalePanel.Controls[0]).Caption = " " $ KFLR.EquipmentCategories[i].EquipmentCategoryName;
|
||||
GUILabel(NewForSalePanel.Controls[0]).ShadowOffsetX = 1.5;
|
||||
GUILabel(NewForSalePanel.Controls[0]).ShadowOffsetY = 1.5;
|
||||
GUILabel(NewForSalePanel.Controls[0]).ShadowColor = DarkRedColor;
|
||||
GUILabel(NewForSalePanel.Controls[0]).BackColor = GrayColor;
|
||||
GUILabel(NewForSalePanel.Controls[0]).bTransparent = false;
|
||||
GUILabel(NewForSalePanel.Controls[0]).WinWidth = 1.00000;
|
||||
GUILabel(NewForSalePanel.Controls[1]).BackColor = GrayColor;
|
||||
|
||||
NewForSalePanel.Controls[1].bVisible = false;
|
||||
NewForSalePanel.Controls[2].bVisible = false;
|
||||
NewForSalePanel.Controls[2].bAcceptsInput = false;
|
||||
|
||||
ForSaleBodyPanelArray.Insert(0, 1);
|
||||
ForSaleBodyPanelArray[0] = NewForSalePanel;
|
||||
|
||||
OldX = NewForSalePanel.WinTop - 0.001000;
|
||||
|
||||
// Add category's items
|
||||
for ( j = 0; j < KFLR.MAX_BUYITEMS; j++ )
|
||||
{
|
||||
if ( KFLR.ItemForSale[j] != none )
|
||||
{
|
||||
// Let's see if it is a vest or aid kit (both are no weapon pickup)
|
||||
if ( (class<Vest>(KFLR.ItemForSale[j]) != none || class<FirstAidKit>(KFLR.ItemForSale[j]) != none) &&
|
||||
(class'Vest'.default.EquipmentCategoryID == KFLR.EquipmentCategories[i].EquipmentCategoryID ||
|
||||
class'FirstAidKit'.default.EquipmentCategoryID == KFLR.EquipmentCategories[i].EquipmentCategoryID) )
|
||||
{
|
||||
NewForSalePanel = GUIForSaleBodyPanel(AddComponent("KFGUI.GUIForSaleBodyPanel"));
|
||||
NewForSalePanel.bBoundToParent = true;
|
||||
NewForSalePanel.bScaleToParent = true;
|
||||
NewForSalePanel.WinHeight = 0.039000;
|
||||
NewForSalePanel.WinTop = OldX + 0.041000;
|
||||
|
||||
GUISaleLabel(NewForSalePanel.Controls[0]).bAcceptsInput = true;
|
||||
|
||||
// Vest
|
||||
if ( class<Vest>(KFLR.ItemForSale[j]) != none )
|
||||
{
|
||||
GUISaleLabel(NewForSalePanel.Controls[0]).Caption = class'BuyableVest'.default.ItemName;
|
||||
GUILabel(NewForSalePanel.Controls[1]).TextColor = GreenColor;
|
||||
GUILabel(NewForSalePanel.Controls[1]).Caption = "£" $ string(int(class'BuyableVest'.default.Cost * PlayerVeterancy.static.GetCostScaling(KFStatsAndAchievements, class'Vest')));
|
||||
|
||||
if ( PlayerOwner().PlayerReplicationInfo.Score < class'BuyableVest'.default.Cost * PlayerVeterancy.static.GetCostScaling(KFStatsAndAchievements, class'Vest') )
|
||||
{
|
||||
GUILabel(NewForSalePanel.Controls[1]).TextColor = RedColor;
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).Caption = "Low Cash";
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).bAcceptsInput = false;
|
||||
}
|
||||
else if ( KFHumanPawn(PlayerOwner().Pawn).CurrentWeight + class'BuyableVest'.default.Weight > KFHumanPawn(PlayerOwner().Pawn).MaxCarryWeight )
|
||||
{
|
||||
GUILabel(NewForSalePanel.Controls[1]).TextColor = RedColor;
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).Caption = "Weight";
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).bAcceptsInput = false;
|
||||
}
|
||||
else if ( KFPawn(PlayerOwner().Pawn).ShieldStrength == 100 )
|
||||
{
|
||||
GUILabel(NewForSalePanel.Controls[1]).TextColor = RedColor;
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).Caption = "100% Armor";
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).bAcceptsInput = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).Caption = "Buy";
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).OnClick = DoBuyKevlar;
|
||||
}
|
||||
|
||||
GUISaleLabel(NewForSalePanel.Controls[0]).SaleItemInfo = new class'BuyableVest';
|
||||
GUISaleLabel(NewForSalePanel.Controls[0]).SaleItemInfo.cost = int(class'BuyableVest'.default.Cost * PlayerVeterancy.static.GetCostScaling(KFStatsAndAchievements, class'Vest'));
|
||||
}
|
||||
|
||||
// First Aid kit
|
||||
if ( class<FirstAidKit>(KFLR.ItemForSale[j]) != none )
|
||||
{
|
||||
GUISaleLabel(NewForSalePanel.Controls[0]).Caption = class'BuyableFirstAidKit'.default.ItemName;
|
||||
GUILabel(NewForSalePanel.Controls[1]).TextColor = GreenColor;
|
||||
GUILabel(NewForSalePanel.Controls[1]).Caption = "£" $ string(int(class'BuyableFirstAidKit'.default.Cost * PlayerVeterancy.static.GetCostScaling(KFStatsAndAchievements, class'FirstAidKit')));
|
||||
|
||||
if ( PlayerOwner().PlayerReplicationInfo.Score < class'BuyableFirstAidKit'.default.Cost * PlayerVeterancy.static.GetCostScaling(KFStatsAndAchievements, class'FirstAidKit') )
|
||||
{
|
||||
GUILabel(NewForSalePanel.Controls[1]).TextColor = RedColor;
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).Caption = "Low Cash";
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).bAcceptsInput = false;
|
||||
}
|
||||
else if ( KFHumanPawn(PlayerOwner().Pawn).CurrentWeight + class'BuyableFirstAidKit'.default.Weight > KFHumanPawn(PlayerOwner().Pawn).MaxCarryWeight )
|
||||
{
|
||||
GUILabel(NewForSalePanel.Controls[1]).TextColor = RedColor;
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).Caption = "To Heavy";
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).bAcceptsInput = false;
|
||||
}
|
||||
else if ( KFPawn(PlayerOwner().Pawn).Health == 100 )
|
||||
{
|
||||
GUILabel(NewForSalePanel.Controls[1]).TextColor = RedColor;
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).Caption = "100% Health";
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).bAcceptsInput = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).Caption = "Buy";
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).OnClick = DoBuyFirstAid;
|
||||
}
|
||||
|
||||
GUISaleLabel(NewForSalePanel.Controls[0]).SaleItemInfo = new class'BuyableFirstAidKit';
|
||||
GUISaleLabel(NewForSalePanel.Controls[0]).SaleItemInfo.cost = int(class'BuyableFirstAidKit'.default.Cost * PlayerVeterancy.static.GetCostScaling(KFStatsAndAchievements, class'FirstAidKit'));
|
||||
}
|
||||
|
||||
OldX = NewForSalePanel.WinTop;
|
||||
|
||||
GUISaleLabel(NewForSalePanel.Controls[0]).OnClick = UpdateInfo;
|
||||
|
||||
ForSaleBodyPanelArray.Insert(0, 1);
|
||||
ForSaleBodyPanelArray[0] = NewForSalePanel;
|
||||
}
|
||||
|
||||
// Now the actual weapons and not ammo, vest or aid kit
|
||||
if ( class<KFWeapon>(KFLR.ItemForSale[j].default.InventoryType) == none || KFLR.ItemForSale[j].IsA('KFAmmunition') || class<KFWeapon>(KFLR.ItemForSale[j].default.InventoryType).default.bKFNeverThrow ||
|
||||
IsInInventory(KFLR.ItemForSale[j]) || class<KFWeaponPickup>(KFLR.ItemForSale[j]).default.EquipmentCategoryID != KFLR.EquipmentCategories[i].EquipmentCategoryID )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
NewForSalePanel = GUIForSaleBodyPanel(AddComponent("KFGUI.GUIForSaleBodyPanel"));
|
||||
NewForSalePanel.bBoundToParent = true;
|
||||
NewForSalePanel.bScaleToParent = true;
|
||||
NewForSalePanel.WinHeight = 0.039000;
|
||||
NewForSalePanel.WinTop = OldX + 0.0410000;
|
||||
|
||||
GUISaleLabel(NewForSalePanel.Controls[0]).bAcceptsInput = true;
|
||||
GUISaleLabel(NewForSalePanel.Controls[0]).Caption = class<KFWeaponPickup>(KFLR.ItemForSale[j]).default.ItemName;
|
||||
|
||||
GUILabel(NewForSalePanel.Controls[1]).TextColor = GreenColor;
|
||||
GUILabel(NewForSalePanel.Controls[1]).Caption = "£" $ string(int(class<KFWeaponPickup>(KFLR.ItemForSale[j]).default.Cost * PlayerVeterancy.static.GetCostScaling(KFStatsAndAchievements, KFLR.ItemForSale[j])));
|
||||
|
||||
if ( PlayerOwner().PlayerReplicationInfo.Score < class<KFWeaponPickup>(KFLR.ItemForSale[j]).default.Cost * PlayerVeterancy.static.GetCostScaling(KFStatsAndAchievements, KFLR.ItemForSale[j]) )
|
||||
{
|
||||
GUILabel(NewForSalePanel.Controls[1]).TextColor = RedColor;
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).Caption = "Low Cash";
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).bAcceptsInput = false;
|
||||
}
|
||||
else if ( KFHumanPawn(PlayerOwner().Pawn).CurrentWeight + class<KFWeaponPickup>(KFLR.ItemForSale[j]).default.Weight > KFHumanPawn(PlayerOwner().Pawn).MaxCarryWeight )
|
||||
{
|
||||
GUILabel(NewForSalePanel.Controls[1]).TextColor = RedColor;
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).Caption = "To Heavy";
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).bAcceptsInput = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).Caption = "Buy";
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).Inv = KFLR.ItemForSale[j].default.InventoryType;
|
||||
GUIInvButton(NewForSalePanel.Controls[2]).OnClick = DoBuy;
|
||||
}
|
||||
|
||||
// Add the relevant info for the info panel
|
||||
GUISaleLabel(NewForSalePanel.Controls[0]).SaleItemInfo = new class'BuyableWeapon';
|
||||
GUISaleLabel(NewForSalePanel.Controls[0]).SaleItemInfo.cost = int(class<KFWeaponPickup>(KFLR.ItemForSale[j]).default.Cost * PlayerVeterancy.static.GetCostScaling(KFStatsAndAchievements, KFLR.ItemForSale[j]));
|
||||
BuyableWeapon(GUISaleLabel(NewForSalePanel.Controls[0]).SaleItemInfo).PowerValue = class<KFWeaponPickup>(KFLR.ItemForSale[j]).default.PowerValue;
|
||||
BuyableWeapon(GUISaleLabel(NewForSalePanel.Controls[0]).SaleItemInfo).RangeValue = class<KFWeaponPickup>(KFLR.ItemForSale[j]).default.RangeValue;
|
||||
BuyableWeapon(GUISaleLabel(NewForSalePanel.Controls[0]).SaleItemInfo).SpeedValue = class<KFWeaponPickup>(KFLR.ItemForSale[j]).default.SpeedValue;
|
||||
GUISaleLabel(NewForSalePanel.Controls[0]).SaleItemInfo.Description = class<KFWeaponPickup>(KFLR.ItemForSale[j]).default.Description;
|
||||
GUISaleLabel(NewForSalePanel.Controls[0]).SaleItemInfo.ItemName = class<KFWeaponPickup>(KFLR.ItemForSale[j]).default.ItemName;
|
||||
GUISaleLabel(NewForSalePanel.Controls[0]).SaleItemInfo.showMesh = class<KFWeaponPickup>(KFLR.ItemForSale[j]).default.ShowMesh;
|
||||
GUISaleLabel(NewForSalePanel.Controls[0]).SaleItemInfo.relatedInventory = class<KFWeaponPickup>(KFLR.ItemForSale[j]).default.InventoryType;
|
||||
|
||||
GUISaleLabel(NewForSalePanel.Controls[0]).OnClick = UpdateInfo;
|
||||
|
||||
OldX = NewForSalePanel.WinTop;
|
||||
ForSaleBodyPanelArray.Insert(0, 1);
|
||||
ForSaleBodyPanelArray[0] = NewForSalePanel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bNeedsUpdate = false;
|
||||
}
|
||||
|
||||
// Sends new item to the info pane;
|
||||
function bool UpdateInfo(GUIComponent Sender)
|
||||
{
|
||||
// GUIBuyMenu(OwnerPage()).NewInfo(GUISaleLabel(Sender).SaleItemInfo);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function bool IsInInventory(class<Pickup> Item)
|
||||
{
|
||||
local Inventory CurInv;
|
||||
|
||||
for ( CurInv = PlayerOwner().Pawn.Inventory; CurInv != none; CurInv = CurInv.Inventory )
|
||||
{
|
||||
if ( CurInv.default.PickupClass == Item )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function bool DoBuy(GUIComponent Sender)
|
||||
{
|
||||
if ( KFPawn(PlayerOwner().Pawn) != none )
|
||||
{
|
||||
KFPawn(PlayerOwner().Pawn).ServerBuyWeapon(Class<Weapon>(GUIInvButton(Sender).Inv));
|
||||
BuySound = GUIInvButton(Sender).Inv.default.PickupClass.default.PickupSound;
|
||||
PlayerOwner().Pawn.PlaySound(BuySound,SLOT_Interface,255.0,,120);
|
||||
}
|
||||
|
||||
bNeedsUpdate = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function bool DoBuyKevlar(GUIComponent Sender)
|
||||
{
|
||||
if ( KFPawn(PlayerOwner().Pawn) != none )
|
||||
{
|
||||
KFPawn(PlayerOwner().Pawn).ServerBuyKevlar();
|
||||
}
|
||||
|
||||
bNeedsUpdate = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function bool DoBuyFirstAid(GUIComponent Sender)
|
||||
{
|
||||
if ( KFPawn(PlayerOwner().Pawn) != none )
|
||||
{
|
||||
KFPawn(PlayerOwner().Pawn).ServerBuyFirstAid();
|
||||
}
|
||||
|
||||
bNeedsUpdate = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
defaultproperties
|
||||
{
|
||||
/*
|
||||
RedColor=(R=255,G=0,B=0,A=255)
|
||||
DarkRedColor=(R=128,G=0,B=0,A=255)
|
||||
GreenColor=(R=0,G=255,B=0,A=255)
|
||||
GrayColor=(R=48,G=48,B=48,A=128)
|
||||
|
||||
Begin Object Class=GUIForSaleHeaderPanel Name=ForSaleHeaderPanel
|
||||
WinTop=0.000000
|
||||
WinLeft=0.000000
|
||||
WinWidth=1.00000
|
||||
WinHeight=0.04000
|
||||
bBoundToParent=true
|
||||
bScaleToParent=true
|
||||
End Object
|
||||
PanelForSaleHeader=ForSaleHeaderPanel
|
||||
|
||||
SellSound=Sound'KF_InventorySnd.Cash_Pickup'
|
||||
BuySound=Sound'KFWeaponSound.GunPickupKF'
|
||||
|
||||
OnTimer=GUIBuyForSalePanel.UpdateCheck
|
||||
*/
|
||||
}
|
||||
|
||||
18
kf_sources/KFGui/Classes/GUIBuyInfoPanel.uc
Normal file
18
kf_sources/KFGui/Classes/GUIBuyInfoPanel.uc
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
class GUIBuyInfoPanel extends GUIPanel;
|
||||
|
||||
//var automated GUIImage i_back;
|
||||
|
||||
function Display(GUIBuyable item);
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
/* Begin Object Class=GUIImage Name=Background
|
||||
Image=Texture'Engine.WhiteSquareTexture'
|
||||
ImageColor=(B=0,G=0,R=0)
|
||||
ImageStyle=ISTY_Stretched
|
||||
ImageRenderStyle=MSTY_Normal
|
||||
WinHeight=1.000000
|
||||
End Object
|
||||
i_back=GUIImage'KFGui.GUIBuyInfoPanel.Background'
|
||||
*/
|
||||
}
|
||||
32
kf_sources/KFGui/Classes/GUIBuyItemsBox.uc
Normal file
32
kf_sources/KFGui/Classes/GUIBuyItemsBox.uc
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
class GUIBuyItemsBox extends GUIListBoxBase;
|
||||
|
||||
var GUIBuyItemsList List;
|
||||
|
||||
function InitComponent( GUIController MyController, GUIComponent MyOwner )
|
||||
{
|
||||
Super.InitComponent(MyController,MyOwner);
|
||||
|
||||
if (DefaultListClass != "")
|
||||
{
|
||||
List = GUIBuyItemsList(AddComponent(DefaultListClass));
|
||||
if (List == None)
|
||||
{
|
||||
log(Class$".InitComponent - Could not create default list ["$DefaultListClass$"]");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (List == None)
|
||||
{
|
||||
Warn("Could not initialize list!");
|
||||
return;
|
||||
}
|
||||
InitBaseList(List);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
SectionStyleName="ItemBoxInfo"
|
||||
DefaultListClass="KFGUI.GUIBuyItemsList"
|
||||
}
|
||||
202
kf_sources/KFGui/Classes/GUIBuyItemsList.uc
Normal file
202
kf_sources/KFGui/Classes/GUIBuyItemsList.uc
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
class GUIBuyItemsList extends GUIVertList;
|
||||
|
||||
var array<GUIBuyable> Elements;
|
||||
|
||||
/*
|
||||
event InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
OnDrawItem = DrawBuyItem;
|
||||
Super.InitComponent(MyController, MyOwner);
|
||||
}
|
||||
|
||||
function Clear()
|
||||
{
|
||||
if ( Elements.Length == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Elements.Remove(0, Elements.Length);
|
||||
ItemCount = 0;
|
||||
IndexChanged(self);
|
||||
Super.Clear();
|
||||
}
|
||||
|
||||
function Add(GUIBuyable Item)
|
||||
{
|
||||
local int NewIndex, PointValue, ComparePointValue;
|
||||
|
||||
PointValue=Item.cost;
|
||||
|
||||
if (Elements.Length > 0)
|
||||
{
|
||||
while ( NewIndex < Elements.Length )
|
||||
{
|
||||
ComparePointValue=Elements[NewIndex].cost;
|
||||
|
||||
if ( ComparePointValue >= PointValue )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
NewIndex++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NewIndex = Elements.Length;
|
||||
}
|
||||
|
||||
Elements.Insert(NewIndex, 1);
|
||||
Elements[NewIndex] = Item;
|
||||
|
||||
ItemCount = Elements.Length;
|
||||
|
||||
if ( NewIndex == 0 )
|
||||
{
|
||||
SetIndex(0);
|
||||
}
|
||||
else if ( bNotify )
|
||||
{
|
||||
CheckLinkedObjects(Self);
|
||||
}
|
||||
|
||||
if ( MyScrollBar != none )
|
||||
{
|
||||
MyScrollBar.AlignThumb();
|
||||
}
|
||||
}
|
||||
|
||||
function string GetItemAtIndex( int idx )
|
||||
{
|
||||
return Elements[idx].ItemName;
|
||||
}
|
||||
|
||||
function SelectNewItem(GUIComponent Sender)
|
||||
{
|
||||
if ( GUIBuyMenu(PageOwner) == none )
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ( Elements.Length <= 0 )
|
||||
{
|
||||
// GUIBuyMenu(PageOwner).NewInfo(None);
|
||||
}
|
||||
else
|
||||
{
|
||||
// GUIBuyMenu(PageOwner).NewInfo(Elements[Index]);
|
||||
}
|
||||
}
|
||||
|
||||
function bool OnDblClick(GUIComponent Sender)
|
||||
{
|
||||
// HAHAH typecasting nightmare.
|
||||
// All we're doing here is hacking the Items in the buymenu list so when you
|
||||
// double clickem, it runs a quick check to see if you can buy / sell this, and acts
|
||||
// like you had clicked the footer.
|
||||
// Because the Sender (the actual button we're double clicking) has fuck all to do with the GUIBuyable itself,
|
||||
// we've gotta route everything back through the BuyMenu...
|
||||
// Care of Alex
|
||||
return False;
|
||||
}
|
||||
|
||||
function DrawBuyItem(Canvas c, int Item, float X, float Y, float W, float HT, bool bSelected, bool bPending)
|
||||
{
|
||||
local string tString;
|
||||
local float Iheight, Itop, Ileft, Iwidth, StringHeight, StringWidth;
|
||||
local eMenuState drawState;
|
||||
local int AdjustedValue;
|
||||
local float GameDifficulty;
|
||||
|
||||
if ( PlayerOwner().Level.Game != none )
|
||||
{
|
||||
GameDifficulty = KFGameType(PlayerOwner().Level.Game).GetDifficulty();
|
||||
}
|
||||
|
||||
if ( !bSelected )
|
||||
{
|
||||
drawState = MSAT_Blurry;
|
||||
}
|
||||
else
|
||||
{
|
||||
drawState = MSAT_Watched;
|
||||
}
|
||||
|
||||
tString = GetItemAtIndex(Item);
|
||||
c.StrLen(tString, StringWidth, StringHeight);
|
||||
|
||||
FontScale = FNS_Medium;
|
||||
|
||||
//Iheight = HT * 0.808917;
|
||||
Iheight = StringHeight * FontScale + 4;
|
||||
//Itop = Y + Iheight) / 2;
|
||||
Itop = Y + (Iheight - StringHeight) / 2;
|
||||
Ileft = X;
|
||||
Iwidth = W;
|
||||
|
||||
SectionStyle.Draw(c, drawState, Ileft, Itop, Iwidth, Iheight);
|
||||
|
||||
Ileft = X * 1.05;
|
||||
Iwidth = W - ((ILeft - X) * 2);
|
||||
|
||||
if ( Elements[Item].HasMe(PlayerOwner().Pawn) )
|
||||
{
|
||||
AdjustedValue =int(Elements[Item].cost / GameDifficulty);
|
||||
}
|
||||
else
|
||||
{
|
||||
AdjustedValue = Elements[Item].cost;
|
||||
}
|
||||
|
||||
c.StrLen(tString, StringWidth, StringHeight);
|
||||
|
||||
//Draw our nickname
|
||||
|
||||
SectionStyle.DrawText(c, MSAT_Blurry, Ileft, Itop, Iwidth, Itop - (Iheight / 2), TXTA_Left, tString, FNS_Medium);
|
||||
Ileft = ILeft + StringWidth + 20;
|
||||
|
||||
|
||||
//Draw cost string Added to account for whether it is an item that's in myinventory (and therefore can only be sold)
|
||||
//tString = "Cost:"@Elements[Item].cost;
|
||||
if ( Elements[Item].cost == AdjustedValue )
|
||||
{
|
||||
tString = "Cost:" @ AdjustedValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
tString = "Sale Value:" @ AdjustedValue;
|
||||
}
|
||||
|
||||
SectionStyle.DrawText(c, MSAT_Blurry, ILeft, Itop, Iwidth, Iheight / 2, TXTA_Left, tString, FNS_small);
|
||||
|
||||
c.StrLen(tString, StringWidth, StringHeight);
|
||||
Ileft = ILeft + StringWidth + 20;
|
||||
|
||||
//Draw Weight string
|
||||
tString = "Weight:" @ Elements[item].weight;
|
||||
SectionStyle.DrawText(c, MSAT_Blurry, Ileft, Itop, Iwidth, Iheight / 2, TXTA_Left, tString, FNS_small);
|
||||
}
|
||||
|
||||
function float BuyItemHeight(Canvas c)
|
||||
{
|
||||
if ( GUIBuyItemsBox(MenuOwner) != none )
|
||||
{
|
||||
return MenuOwner.ActualHeight() * 0.25;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
/* GetItemHeight=GUIBuyItemsList.BuyItemHeight
|
||||
StyleName="ItemBoxInfo"
|
||||
OnChange=GUIBuyItemsList.SelectNewItem
|
||||
OnDblClick=GUIBuyItemsList.OnDblClick
|
||||
bMouseOverSound=true
|
||||
OnClickSound=CS_Click
|
||||
*/
|
||||
}
|
||||
445
kf_sources/KFGui/Classes/GUIBuyMenu.uc
Normal file
445
kf_sources/KFGui/Classes/GUIBuyMenu.uc
Normal file
|
|
@ -0,0 +1,445 @@
|
|||
//=============================================================================
|
||||
// The Trader menu with a tab for the store and the perks
|
||||
//=============================================================================
|
||||
// Killing Floor Source
|
||||
// Copyright (C) 2009 Tripwire Interactive LLC
|
||||
// Christian "schneidzekk" Schneider
|
||||
//=============================================================================
|
||||
|
||||
|
||||
class GUIBuyMenu 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;
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
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 )
|
||||
{
|
||||
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
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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 )
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
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 )
|
||||
{
|
||||
KFPlayerController(PlayerOwner()).bShopping = false;
|
||||
}
|
||||
}
|
||||
|
||||
function CloseSale(bool savePurchases)
|
||||
{
|
||||
Controller.CloseMenu(!savePurchases);
|
||||
}
|
||||
|
||||
function bool ButtonClicked(GUIComponent Sender)
|
||||
{
|
||||
if ( Sender == PerkTabButton )
|
||||
{
|
||||
HandleParameters(PanelCaption[1], "OhHi!");
|
||||
}
|
||||
|
||||
if ( Sender == StoreTabButton )
|
||||
{
|
||||
HandleParameters(PanelCaption[0], "OhHi!");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
PanelClass(0)="KFGUI.KFTab_BuyMenu"
|
||||
PanelClass(1)="KFGUI.KFTab_Perks"
|
||||
|
||||
PanelCaption(0)="Store"
|
||||
PanelCaption(1)="Perks"
|
||||
|
||||
PanelHint(0)="Trade equipment and ammunition"
|
||||
PanelHint(1)="Select your current Perk"
|
||||
|
||||
OnClose=KFBuyMenuClosed
|
||||
|
||||
bAllowedAsLast=true
|
||||
|
||||
WhiteColor=(R=255,G=255,B=255,A=255)
|
||||
RedColor=(R=255,G=0,B=0,A=255)
|
||||
GreenGreyColor=(R=175,G=176,B=158,A=255)
|
||||
|
||||
CurrentPerk="Current Perk"
|
||||
NoActivePerk="No Active Perk!"
|
||||
TraderClose="Trader Closes in"
|
||||
WaveString="Wave"
|
||||
LvAbbrString="Lv"
|
||||
|
||||
Begin Object class=GUIImage Name=HBGLeft
|
||||
WinWidth=0.33230
|
||||
WinHeight=0.10000
|
||||
WinLeft=0.00100
|
||||
WinTop=0.00100
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Thin_border'
|
||||
ImageStyle=ISTY_Stretched
|
||||
Hint="Perk Quick Select"
|
||||
RenderWeight=0.1
|
||||
End Object
|
||||
HeaderBG_Left=HBGLeft
|
||||
|
||||
Begin Object class=GUIImage Name=HBGCenter
|
||||
WinWidth=0.331023
|
||||
WinHeight=0.10000
|
||||
WinLeft=0.33400
|
||||
WinTop=0.00100
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Thin_border'
|
||||
ImageStyle=ISTY_Stretched
|
||||
Hint="Trading Time Left"
|
||||
End Object
|
||||
HeaderBG_Center=HBGCenter
|
||||
|
||||
Begin Object class=GUIImage Name=HBGRight
|
||||
WinWidth=0.33200
|
||||
WinHeight=0.10000
|
||||
WinLeft=0.66600
|
||||
WinTop=0.00100
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Thin_border'
|
||||
ImageStyle=ISTY_Stretched
|
||||
Hint="Current Perk"
|
||||
End Object
|
||||
HeaderBG_Right=HBGRight
|
||||
|
||||
Begin Object Class=GUILabel Name=HBGLL
|
||||
WinTop=0.007238
|
||||
WinLeft=0.024937
|
||||
WinWidth=0.329761
|
||||
WinHeight=0.019524
|
||||
Caption="Quick Perk Select"
|
||||
TextAlign=TXTA_Center
|
||||
TextFont="UT2ServerListFont"
|
||||
TextColor=(R=175,G=176,B=158,A=255)
|
||||
End Object
|
||||
HeaderBG_Left_Label=HBGLL
|
||||
|
||||
Begin Object class=KFQuickPerkSelect Name=QS
|
||||
WinTop=0.011906
|
||||
WinLeft=0.008008
|
||||
WinWidth=0.316601
|
||||
WinHeight=0.082460
|
||||
End Object
|
||||
QuickPerkSelect=QS
|
||||
|
||||
Begin Object class=KFBuyMenuFilter Name=Filter
|
||||
WinTop=0.051
|
||||
WinLeft=0.67
|
||||
WinWidth=0.305
|
||||
WinHeight=0.082460
|
||||
RenderWeight=0.5
|
||||
End Object
|
||||
BuyMenuFilter=Filter
|
||||
|
||||
Begin Object class=GUIButton Name=PerkTabB
|
||||
StyleName="SquareButton"
|
||||
WinTop=0.072762
|
||||
WinLeft=0.127234
|
||||
WinWidth=0.050000
|
||||
WinHeight=0.022000
|
||||
Caption="Perk"
|
||||
FontScale=FNS_Small
|
||||
OnClick=ButtonClicked
|
||||
End Object
|
||||
PerkTabButton=PerkTabB
|
||||
|
||||
Begin Object class=GUIButton Name=StoreTabB
|
||||
StyleName="SquareButton"
|
||||
WinTop=0.072762
|
||||
WinLeft=0.202801
|
||||
WinWidth=0.050000
|
||||
WinHeight=0.022000
|
||||
FontScale=FNS_Small
|
||||
Caption="Store"
|
||||
OnClick=ButtonClicked
|
||||
End Object
|
||||
StoreTabButton=StoreTabB
|
||||
|
||||
Begin Object Class=GUILabel Name=Perk
|
||||
WinTop=0.01
|
||||
WinLeft=0.665000
|
||||
WinWidth=0.329761
|
||||
WinHeight=0.050000
|
||||
Caption=""
|
||||
TextAlign=TXTA_Center
|
||||
TextFont="UT2MenuFont"
|
||||
TextColor=(R=175,G=176,B=158,A=255)
|
||||
End Object
|
||||
CurrentPerkLabel=Perk
|
||||
|
||||
Begin Object Class=GUILabel Name=Time
|
||||
WinTop=0.020952
|
||||
WinLeft=0.335000
|
||||
WinWidth=0.330000
|
||||
WinHeight=0.035000
|
||||
Caption="Trader closes in 00:31"
|
||||
TextAlign=TXTA_center
|
||||
TextFont="UT2LargeFont"
|
||||
TextColor=(R=175,G=176,B=158,A=255)
|
||||
End Object
|
||||
TimeLeftLabel=Time
|
||||
|
||||
Begin Object Class=GUILabel Name=Wave
|
||||
WinTop=0.052857
|
||||
WinLeft=0.336529
|
||||
WinWidth=0.327071
|
||||
WinHeight=0.035000
|
||||
Caption="Wave: 7/10"
|
||||
TextAlign=TXTA_Center
|
||||
TextFont="UT2MenuFont"
|
||||
TextColor=(R=175,G=176,B=158,A=255)
|
||||
End Object
|
||||
WaveLabel=Wave
|
||||
|
||||
Begin Object Class=GUITabControl Name=PageTabs
|
||||
WinWidth=0.99
|
||||
WinLeft=0.005
|
||||
WinTop=0.07800
|
||||
WinHeight=0.025
|
||||
TabHeight=0.025
|
||||
TabOrder=0
|
||||
RenderWeight=0.49
|
||||
bFillSpace=False
|
||||
bAcceptsInput=True
|
||||
bDockPanels=True
|
||||
OnChange=InternalOnChange
|
||||
BackgroundStyleName="TabBackground"
|
||||
End Object
|
||||
c_Tabs=PageTabs
|
||||
|
||||
Begin Object Class=BackgroundImage Name=PageBackground
|
||||
Image=material'Engine.WhiteSquareTexture'
|
||||
ImageStyle=ISTY_Tiled
|
||||
ImageColor=(R=20,G=20,B=20,A=255)
|
||||
WinWidth=1
|
||||
WinHeight=1
|
||||
WinTop=0
|
||||
WinLeft=0
|
||||
RenderWeight=0.001
|
||||
End Object
|
||||
i_Background=PageBackground
|
||||
|
||||
Begin Object class=GUIImage Name=Weight
|
||||
WinWidth=0.663086
|
||||
WinHeight=0.065828
|
||||
WinLeft=0.001
|
||||
WinTop=0.934206
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Thin_border'
|
||||
ImageStyle=ISTY_Stretched
|
||||
Hint=""
|
||||
End Object
|
||||
WeightBG=Weight
|
||||
|
||||
Begin Object class=GUIImage Name=WeightIco
|
||||
WinTop=0.946166
|
||||
WinLeft=0.009961
|
||||
WinWidth=0.033672
|
||||
WinHeight=0.048992
|
||||
RenderWeight=0.46
|
||||
Image=Texture'KillingFloorHUD.HUD.Hud_Weight'
|
||||
ImageStyle=ISTY_Scaled
|
||||
End Object
|
||||
WeightIcon=WeightIco
|
||||
|
||||
Begin Object class=GUIImage Name=WeightIcoBG
|
||||
WinTop=0.942416
|
||||
WinLeft=0.006055
|
||||
WinWidth=0.041484
|
||||
WinHeight=0.054461
|
||||
RenderWeight=0.45
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Perk_box_unselected'
|
||||
ImageStyle=ISTY_Scaled
|
||||
End Object
|
||||
WeightIconBG=WeightIcoBG
|
||||
|
||||
Begin Object class=KFWeightBar Name=WeightB
|
||||
WinTop=0.945302
|
||||
WinLeft=0.055266
|
||||
WinWidth=0.443888
|
||||
WinHeight=0.053896
|
||||
End Object
|
||||
WeightBar=WeightB
|
||||
}
|
||||
358
kf_sources/KFGui/Classes/GUIBuyMenuFooter.uc
Normal file
358
kf_sources/KFGui/Classes/GUIBuyMenuFooter.uc
Normal file
|
|
@ -0,0 +1,358 @@
|
|||
class GUIBuyMenuFooter extends ButtonFooter;
|
||||
|
||||
var localized string CashString;
|
||||
var localized string WeightString;
|
||||
|
||||
var automated GUIButton b_Cancel;
|
||||
var automated GUIButton spacer1,spacer2;
|
||||
var automated GUILabel l_score, l_weight;
|
||||
|
||||
function PositionButtons (Canvas C)
|
||||
{
|
||||
/*
|
||||
local int i;
|
||||
local GUIButton b;
|
||||
local float x;
|
||||
|
||||
for ( i = 0; i < Controls.Length; i++ )
|
||||
{
|
||||
b = GUIButton(Controls[i]);
|
||||
if ( b != None)
|
||||
{
|
||||
if ( x == 0 )
|
||||
x = ButtonLeft;
|
||||
else x += GetSpacer();
|
||||
b.WinLeft = b.RelativeLeft( x, True );
|
||||
x += b.ActualWidth();
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
function SetPlayerStats(int score, float weight)
|
||||
{
|
||||
if( l_score!=None )
|
||||
l_score.Caption = CashString$":" @ score;
|
||||
if( l_weight!=None )
|
||||
l_weight.Caption = WeightString$":" @ int(weight) $ "/" $ int(KFHumanPawn(PlayerOwner().Pawn).MaxCarryWeight);
|
||||
}
|
||||
|
||||
function SetBuyMode(string buyCaption,bool buyEnabled,bool fillVisible,bool fillEnabled)
|
||||
{
|
||||
/* local bool AutoAmmoEnabled;
|
||||
AutoAmmoEnabled = GUIBuyMenu(PageOwner).CanAutoAmmo();
|
||||
b_buy.Caption = buyCaption;
|
||||
if(buyEnabled && b_buy.MenuState == MSAT_Disabled)
|
||||
{
|
||||
b_buy.MenuState = MSAT_Blurry; // GUIBuyMenu(PageOwner).ItemsBox.List.Elements[GUIBuyMenu(PageOwner).ItemsBox.List.Index] //
|
||||
// GUIBuyMenu(PageOwner).ItemsBox.List.MenuState = MSAT_Blurry;
|
||||
}
|
||||
else if(!buyEnabled)
|
||||
{
|
||||
b_buy.MenuState = MSAT_Disabled;
|
||||
// GUIBuyMenu(PageOwner).ItemsBox.List.MenuState = MSAT_Disabled;
|
||||
}
|
||||
|
||||
if(fillEnabled && b_fill.MenuState == MSAT_Disabled)
|
||||
b_fill.MenuState = MSAT_Blurry;
|
||||
else if(!fillEnabled)
|
||||
b_fill.MenuState = MSAT_Disabled;
|
||||
b_fill.bVisible = fillVisible;
|
||||
|
||||
if(AutoAmmoEnabled && b_AutoAll.MenuState == MSAT_Disabled)
|
||||
b_AutoAll.MenuState = MSAT_Blurry;
|
||||
else if(!AutoAmmoEnabled)
|
||||
b_AutoAll.MenuState = MSAT_Disabled;
|
||||
*/
|
||||
}
|
||||
|
||||
function bool ButtonsSized(Canvas C)
|
||||
{
|
||||
/* local int i;
|
||||
local GUIButton b;
|
||||
local bool bResult;
|
||||
local string str;
|
||||
local float T, AH, AT;
|
||||
|
||||
if ( !bPositioned )
|
||||
return false;
|
||||
|
||||
bResult = true;
|
||||
str = GetLongestCaption(C);
|
||||
|
||||
AH = ActualHeight();
|
||||
AT = ActualTop();
|
||||
|
||||
for (i = 0; i < Controls.Length; i++ )
|
||||
{
|
||||
b = GUIButton(Controls[i]);
|
||||
if ( b != None )
|
||||
{
|
||||
if ( bAutoSize && bFixedWidth )
|
||||
{
|
||||
if(b.Caption == "")
|
||||
b.SizingCaption = Left(str,Len(str)/2);
|
||||
else
|
||||
b.SizingCaption = str;
|
||||
}
|
||||
else b.SizingCaption = "";
|
||||
|
||||
bResult = bResult && b.bPositioned;
|
||||
if ( bFullHeight )
|
||||
b.WinHeight = b.RelativeHeight(AH,true);
|
||||
else b.WinHeight = b.RelativeHeight(ActualHeight(ButtonHeight),true);
|
||||
|
||||
switch ( Justification )
|
||||
{
|
||||
case TXTA_Left:
|
||||
T = ClientBounds[1];
|
||||
break;
|
||||
|
||||
case TXTA_Center:
|
||||
T = (AT + AH / 2) - (b.ActualHeight() / 2);
|
||||
break;
|
||||
|
||||
case TXTA_Right:
|
||||
T = ClientBounds[3] - b.ActualHeight();
|
||||
break;
|
||||
}
|
||||
|
||||
b.WinTop = b.RelativeTop(T, True );
|
||||
}
|
||||
}
|
||||
|
||||
return bResult;
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
|
||||
function float GetButtonLeft()
|
||||
{
|
||||
/* local int i;
|
||||
local GUIButton b;
|
||||
local float TotalWidth, AW, AL;
|
||||
local float FooterMargin;
|
||||
|
||||
AL = ActualLeft();
|
||||
AW = ActualWidth();
|
||||
FooterMargin = GetMargin();
|
||||
|
||||
for (i = 0; i < Controls.Length; i++ )
|
||||
{
|
||||
b = GUIButton(Controls[i]);
|
||||
if ( b != None )
|
||||
{
|
||||
if ( TotalWidth > 0 )
|
||||
TotalWidth += GetSpacer();
|
||||
|
||||
TotalWidth += b.ActualWidth();
|
||||
}
|
||||
}
|
||||
|
||||
if ( Alignment == TXTA_Center )
|
||||
return (AL + AW) / 2 - FooterMargin / 2 - TotalWidth / 2;
|
||||
|
||||
if ( Alignment == TXTA_Right )
|
||||
return (AL + AW - FooterMargin / 2) - TotalWidth;
|
||||
|
||||
return AL + (FooterMargin / 2);
|
||||
*/
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
// Finds the longest caption of all the buttons
|
||||
function string GetLongestCaption(Canvas C)
|
||||
{
|
||||
/*
|
||||
local int i;
|
||||
local float XL, YL, LongestW;
|
||||
local string str;
|
||||
local GUIButton b;
|
||||
|
||||
if ( C == None )
|
||||
return "";
|
||||
|
||||
for ( i = 0; i < Controls.Length; i++ )
|
||||
{
|
||||
b = GUIButton(Controls[i]);
|
||||
if ( b != None )
|
||||
{
|
||||
if ( b.Style != None )
|
||||
b.Style.TextSize(C, b.MenuState, b.Caption, XL, YL, b.FontScale);
|
||||
else C.StrLen( b.Caption, XL, YL );
|
||||
|
||||
if ( LongestW == 0 || XL > LongestW )
|
||||
{
|
||||
str = b.Caption;
|
||||
LongestW = XL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return str;
|
||||
*/
|
||||
return "";
|
||||
}
|
||||
|
||||
function bool OnFooterClick(GUIComponent Sender)
|
||||
{
|
||||
if(Sender == b_Cancel)
|
||||
{
|
||||
// GUIBuyMenu(PageOwner).CloseSale(false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
CashString="Cash"
|
||||
WeightString="Weight"
|
||||
|
||||
/* Begin Object Class=GUIButton Name=Purchase
|
||||
Caption="Buy"
|
||||
StyleName="FooterButton"
|
||||
Hint="Buy currently selected weapon"
|
||||
WinWidth=0.112219
|
||||
WinHeight=0.057242
|
||||
WinLeft=0.236407
|
||||
WinTop=-0.001953
|
||||
|
||||
|
||||
RenderWeight=2.000000
|
||||
TabOrder=3
|
||||
bBoundToParent=True
|
||||
OnClick=GUIBuyMenuFooter.OnFooterClick
|
||||
OnKeyEvent=Purchase.InternalOnKeyEvent
|
||||
End Object
|
||||
b_Buy=GUIButton'KFGui.GUIBuyMenuFooter.Purchase'
|
||||
*/
|
||||
Begin Object Class=GUIButton Name=Cancel
|
||||
Caption="Done"
|
||||
StyleName="FooterButton"
|
||||
Hint="Exit Trader Menu"
|
||||
WinWidth=0.056777
|
||||
WinHeight=0.053711
|
||||
WinLeft=0.942383
|
||||
WinTop=0.940755
|
||||
RenderWeight=2.000000
|
||||
TabOrder=5
|
||||
bVisible=true
|
||||
OnClick=GUIBuyMenuFooter.OnFooterClick
|
||||
OnKeyEvent=Cancel.InternalOnKeyEvent
|
||||
End Object
|
||||
b_Cancel=GUIButton'KFGui.GUIBuyMenuFooter.Cancel'
|
||||
/*
|
||||
Begin Object Class=GUIButton Name=Complete
|
||||
Caption="Complete"
|
||||
StyleName="FooterButton"
|
||||
Hint="Purchase weapons and save changes."
|
||||
WinWidth=0.092022
|
||||
WinHeight=0.051756
|
||||
WinLeft=0.787105
|
||||
WinTop=0.015971
|
||||
|
||||
RenderWeight=2.000000
|
||||
TabOrder=6
|
||||
bBoundToParent=True
|
||||
OnClick=GUIBuyMenuFooter.OnFooterClick
|
||||
OnKeyEvent=Complete.InternalOnKeyEvent
|
||||
End Object
|
||||
b_Complete=GUIButton'KFGui.GUIBuyMenuFooter.Complete'
|
||||
|
||||
Begin Object Class=GUIButton Name=AutoAmmo
|
||||
Caption="AutoAmmo"
|
||||
StyleName="FooterButton"
|
||||
Hint="Fill ammo for all weapons."
|
||||
WinWidth=0.112219
|
||||
WinHeight=0.058023
|
||||
WinLeft=0.006149
|
||||
WinTop=-0.014645
|
||||
|
||||
RenderWeight=2.000000
|
||||
TabOrder=0
|
||||
bBoundToParent=True
|
||||
OnClick=GUIBuyMenuFooter.OnFooterClick
|
||||
OnKeyEvent=AutoAmmo.InternalOnKeyEvent
|
||||
End Object
|
||||
b_AutoAll=GUIButton'KFGui.GUIBuyMenuFooter.AutoAmmo'
|
||||
|
||||
Begin Object Class=GUIButton Name=Fill
|
||||
Caption="Fill Up"
|
||||
StyleName="FooterButton"
|
||||
Hint="Fill up on currently selected ammo."
|
||||
WinTop=0.966146
|
||||
WinLeft=0.250000
|
||||
WinWidth=0.120000
|
||||
RenderWeight=2.000000
|
||||
TabOrder=2
|
||||
bBoundToParent=True
|
||||
bVisible=False
|
||||
OnClick=GUIBuyMenuFooter.OnFooterClick
|
||||
OnKeyEvent=Fill.InternalOnKeyEvent
|
||||
End Object
|
||||
b_Fill=GUIButton'KFGui.GUIBuyMenuFooter.Fill'
|
||||
|
||||
Begin Object Class=GUIButton Name=sp
|
||||
StyleName="Footerbutton"
|
||||
WinTop=0.966146
|
||||
WinLeft=0.220000
|
||||
WinWidth=0.120000
|
||||
RenderWeight=2.000000
|
||||
TabOrder=1
|
||||
bBoundToParent=True
|
||||
bVisible=False
|
||||
OnKeyEvent=sp.InternalOnKeyEvent
|
||||
End Object
|
||||
spacer1=GUIButton'KFGui.GUIBuyMenuFooter.sp'
|
||||
|
||||
Begin Object Class=GUIButton Name=sp2
|
||||
StyleName="Footerbutton"
|
||||
WinTop=0.966146
|
||||
WinLeft=0.330000
|
||||
WinWidth=0.120000
|
||||
RenderWeight=2.000000
|
||||
TabOrder=4
|
||||
bBoundToParent=True
|
||||
bVisible=False
|
||||
OnKeyEvent=sp2.InternalOnKeyEvent
|
||||
End Object
|
||||
spacer2=GUIButton'KFGui.GUIBuyMenuFooter.sp2'
|
||||
|
||||
Begin Object Class=GUILabel Name=PlayerScore
|
||||
Caption="Cash: 0"
|
||||
StyleName="FooterButton"
|
||||
WinTop=0.966146
|
||||
WinLeft=0.010000
|
||||
WinHeight=0.033203
|
||||
End Object
|
||||
// l_score=GUILabel'KFGui.GUIBuyMenuFooter.PlayerScore'
|
||||
*/
|
||||
Begin Object Class=GUILabel Name=playerweight
|
||||
Caption="Weight: 0.0"
|
||||
StyleName="FooterButton"
|
||||
WinTop=0.950120
|
||||
WinLeft=0.460000
|
||||
WinHeight=0.040000
|
||||
WinWidth=0.200000
|
||||
bVisible=true
|
||||
End Object
|
||||
l_weight=GUILabel'KFGui.GUIBuyMenuFooter.playerweight'
|
||||
|
||||
//WinWidth=0.299826
|
||||
//WinHeight=0.058023
|
||||
//WinLeft=0.70000
|
||||
//WinTop=0.943197
|
||||
//StyleName = "EditBox"
|
||||
// WinTop=0.941977
|
||||
// WinLeft=0.908755
|
||||
// WinWidth=0.091250
|
||||
// WinHeight=0.058023
|
||||
WinTop=0.941977
|
||||
WinLeft=1.940006
|
||||
WinWidth=0.057500
|
||||
WinHeight=0.058023
|
||||
RenderWeight=0.300000
|
||||
bVisible=false
|
||||
TabOrder=8
|
||||
}
|
||||
|
||||
442
kf_sources/KFGui/Classes/GUIBuyPlayerInventoryPanel.uc
Normal file
442
kf_sources/KFGui/Classes/GUIBuyPlayerInventoryPanel.uc
Normal file
|
|
@ -0,0 +1,442 @@
|
|||
//-----------------------------------------------------------
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
class GUIBuyPlayerInventoryPanel extends GUIPanel;
|
||||
|
||||
var automated GUIInvHeaderTabPanel TabPanelInventoryHeader; // Innventory list header
|
||||
var array<GUIInvBodyTabPanel> InvBodyTabPanelArray; // The Item rows
|
||||
var array<KFAmmunition> FillAllAmmoAmmunitions; // List of ammo we need for filling up all ammotypes
|
||||
var KFLevelRules KFLR;
|
||||
var KFLevelRules KFLRit;
|
||||
var bool bNeedsUpdate;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
super.InitComponent(Mycontroller, MyOwner);
|
||||
}
|
||||
|
||||
function InternalOnCreateComponent(GUIComponent NewComp, GUIComponent Sender)
|
||||
{
|
||||
}
|
||||
|
||||
function UpDateCheck(GUIComponent Sender)
|
||||
{
|
||||
if ( bNeedsUpdate )
|
||||
{
|
||||
Update();
|
||||
}
|
||||
}
|
||||
|
||||
function Update()
|
||||
{
|
||||
local float OldX, CurAmmo, MaxAmmo, GameDifficulty, FillCost, FillAllAmmoCost;
|
||||
local Inventory CurInv;
|
||||
local GUIInvBodyTabPanel NewInvTabPanel;
|
||||
local class<Ammunition> AmmoClass;
|
||||
local class<KFWeaponPickUp> WeaponItem;
|
||||
local bool bHasDual;
|
||||
local int i;
|
||||
|
||||
OldX = TabPanelInventoryHeader.WinTop + 0.017000;
|
||||
|
||||
if ( PlayerOwner().Pawn.Inventory == none )
|
||||
{
|
||||
log("Inventory is none!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove any old items from the components list
|
||||
for ( i = 0; i < InvBodyTabPanelArray.Length; i++ )
|
||||
{
|
||||
RemoveComponent(InvBodyTabPanelArray[i]);
|
||||
}
|
||||
|
||||
// Clear the component array
|
||||
InvBodyTabPanelArray.Remove(0, InvBodyTabPanelArray.Length);
|
||||
|
||||
// Clear the FillAllAmmo weapons array
|
||||
FillAllAmmoAmmunitions.Remove(0, FillAllAmmoAmmunitions.Length);
|
||||
|
||||
// We need the difficulty to calculate the price
|
||||
if ( PlayerOwner().GameReplicationInfo != none )
|
||||
{
|
||||
GameDifficulty = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).GameDiff;
|
||||
}
|
||||
|
||||
// Let's build the list of the stiff we already have in our inevntory
|
||||
for ( CurInv = PlayerOwner().Pawn.Inventory; CurInv != none; CurInv = CurInv.Inventory )
|
||||
{
|
||||
if ( CurInv.IsA('KFAmmunition') )
|
||||
{
|
||||
// Store the weapon for later use (FillAllAmmoButton)
|
||||
FillAllAmmoAmmunitions.Insert(0, 1);
|
||||
FillAllAmmoAmmunitions[0] = KFAmmunition(CurInv);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// We do not want ammunition to be a seperate item in the list
|
||||
if ( CurInv.IsA('KFWeapon') )
|
||||
{
|
||||
// if we already own dualies, we do not need the single 9mm in the list
|
||||
if ( bHasDual && KFWeapon(CurInv).ItemName == "9mm Tactical" )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
NewInvTabPanel = GUIInvBodyTabPanel(AddComponent("KFGUI.GUIInvBodyTabPanel"));
|
||||
NewInvTabPanel.WinHeight = 0.080000;
|
||||
NewInvTabPanel.bBoundToParent = true;
|
||||
NewInvTabPanel.bScaleToParent = true;
|
||||
|
||||
GUILabel(NewInvTabPanel.Controls[0]).Caption = CurInv.ItemName;
|
||||
GUILabel(NewInvTabPanel.Controls[0]).TextAlign = TXTA_Left;
|
||||
GUILabel(NewInvTabPanel.Controls[0]).TextFont = "UT2SmallFont";
|
||||
GUILabel(NewInvTabPanel.Controls[0]).FontScale = FNS_Small;
|
||||
|
||||
// Melee weapons do not use ammo, so no need for the buy clip / fill ammo buttons
|
||||
if ( !CurInv.IsA('KFMeleeGun') )
|
||||
{
|
||||
KFWeapon(CurInv).GetAmmoCount(MaxAmmo, CurAmmo);
|
||||
AmmoClass = KFWeapon(CurInv).default.FireModeClass[0].default.AmmoClass;
|
||||
|
||||
GUILabel(NewInvTabPanel.Controls[1]).Caption = int(CurAmmo) $ "/" $ int(MaxAmmo);
|
||||
GUILabel(NewInvTabPanel.Controls[1]).TextFont = "UT2SmallFont";
|
||||
GUILabel(NewInvTabPanel.Controls[1]).FontScale = FNS_Small;
|
||||
|
||||
foreach PlayerOwner().DynamicActors(class'KFLevelRules', KFLRit)
|
||||
{
|
||||
KFLR = KFLRit;
|
||||
Break;
|
||||
}
|
||||
|
||||
for( i = 0; i < KFLR.MAX_BUYITEMS; ++i )
|
||||
{
|
||||
if ( KFLR.ItemForSale[i] != none )
|
||||
{
|
||||
// If we got the weapon in the inventory, store the corresponding weapon pickup for later use
|
||||
if ( KFWeapon(CurInv).default.PickupClass == class<KFWeaponPickup>(KFLR.ItemForSale[i]) )
|
||||
{
|
||||
WeaponItem = class<KFWeaponPickup>(KFLR.ItemForSale[i]);
|
||||
|
||||
// Dualies?
|
||||
if ( WeaponItem.default.ItemName == "Dual 9mms" )
|
||||
{
|
||||
bHasDual = true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Single Clip Button
|
||||
if ( CurAmmo >= MaxAmmo )
|
||||
{
|
||||
// Ammo is at 100%
|
||||
GUIInvButton(NewInvTabPanel.Controls[2]).Caption = "100%";
|
||||
GUIInvButton(NewInvTabPanel.Controls[2]).bAcceptsInput = false;
|
||||
}
|
||||
else if ( PlayerOwner().PlayerReplicationInfo.Score < WeaponItem.default.AmmoCost )
|
||||
{
|
||||
// Not enough money
|
||||
GUIInvButton(NewInvTabPanel.Controls[2]).Caption = "Low Cash";
|
||||
GUIInvButton(NewInvTabPanel.Controls[2]).bAcceptsInput = false;
|
||||
|
||||
// If we do not even have enough money to buy a single clip we do not want to show the Fill Up All Button
|
||||
FillAllAmmoCost = -100000.f;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set the ammo clip price and store the ammopickup class
|
||||
GUIInvButton(NewInvTabPanel.Controls[2]).Caption = "£" $ string(WeaponItem.default.AmmoCost);
|
||||
GUIInvButton(NewInvTabPanel.Controls[2]).Inv = KFWeapon(CurInv).GetAmmoClass(0);
|
||||
GUIInvButton(NewInvTabPanel.Controls[2]).OnClick = DoBuyClip;
|
||||
}
|
||||
|
||||
// Fill Up Ammo
|
||||
FillCost = (MaxAmmo - CurAmmo) * ((WeaponItem.default.AmmoCost) / KFWeapon(CurInv).default.MagCapacity);
|
||||
|
||||
if ( CurAmmo >= MaxAmmo )
|
||||
{
|
||||
// Ammo is at 100%
|
||||
GUIInvButton(NewInvTabPanel.Controls[3]).Caption = "100%";
|
||||
GUIInvButton(NewInvTabPanel.Controls[3]).bAcceptsInput = false;
|
||||
}
|
||||
else if ( PlayerOwner().PlayerReplicationInfo.Score >= int(FillCost) )
|
||||
{
|
||||
// Enough money
|
||||
GuiInvButton(NewInvTabPanel.Controls[3]).Caption = "£" $ string(int(FillCost));
|
||||
GuiInvButton(NewInvTabPanel.Controls[3]).Inv = KFWeapon(CurInv).GetAmmoClass(0);
|
||||
GuiInvButton(NewInvTabPanel.Controls[3]).OnClick = DoFillOneAmmo;
|
||||
FillAllAmmoCost += FillCost;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Not enough money to fill up ammo for this weapon.
|
||||
GUIInvButton(NewInvTabPanel.Controls[3]).Caption = "Low Cash";
|
||||
GUIInvButton(NewInvTabPanel.Controls[3]).bAcceptsInput = false;
|
||||
|
||||
// If we do not have enough money to fill up a single weapons we do not want to show the Fill Up All Button
|
||||
FillAllAmmoCost = -100000.f;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Melees don't have ammo
|
||||
GUILabel(NewInvTabPanel.Controls[1]).Caption = "";
|
||||
}
|
||||
|
||||
// Default Inventory can't be sold
|
||||
if ( KFWeapon(CurInv).default.bKFNeverThrow )
|
||||
{
|
||||
GUILabel(NewInvTabPanel.Controls[4]).bVisible = false;
|
||||
GUILabel(NewInvTabPanel.Controls[4]).bAcceptsInput = false;
|
||||
GUIInvButton(NewInvTabPanel.Controls[5]).bVisible = false;
|
||||
GUIInvButton(NewInvTabPanel.Controls[5]).bAcceptsInput = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach PlayerOwner().DynamicActors(class'KFLevelRules', KFLRit)
|
||||
{
|
||||
KFLR = KFLRit;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
for( i = 0; i < KFLR.MAX_BUYITEMS; ++i )
|
||||
{
|
||||
if ( KFLR.ItemForSale[i] != none )
|
||||
{
|
||||
// If we got the weapon in the inventory, store the corresponding weapon pickup for later use
|
||||
if ( KFWeapon(CurInv).default.PickupClass == class<KFWeaponPickup>(KFLR.ItemForSale[i]) )
|
||||
{
|
||||
WeaponItem = class<KFWeaponPickup>(KFLR.ItemForSale[i]);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GUILabel(NewInvTabPanel.Controls[4]).Caption = "£" $ string(int(WeaponItem.default.Cost * 0.75));
|
||||
GUIInvButton(NewInvTabPanel.Controls[5]).Caption = "Sell";
|
||||
GUIInvButton(NewInvTabPanel.Controls[5]).Inv = CurInv.class;
|
||||
GUIInvButton(NewInvTabPanel.Controls[5]).OnClick = DoSellItem;
|
||||
}
|
||||
|
||||
// No ammo buttons for the melees
|
||||
if ( CurInv.IsA('KFMeleeGun') )
|
||||
{
|
||||
for ( i = 1; i <= 3; i++ )
|
||||
{
|
||||
NewInvTabPanel.Controls[i].bVisible = false;
|
||||
NewInvTabPanel.Controls[i].bAcceptsInput = false;
|
||||
}
|
||||
}
|
||||
|
||||
NewInvTabPanel.WinTop = OldX + 0.080000;
|
||||
NewInvTabPanel.WinLeft = TabPanelInventoryHeader.WinLeft;
|
||||
NewInvTabPanel.WinHeight = TabPanelInventoryHeader.WinHeight;
|
||||
NewInvTabPanel.WinWidth = TabPanelInventoryHeader.WinWidth;
|
||||
|
||||
OldX = NewInvTabPanel.WinTop;
|
||||
|
||||
InvBodyTabPanelArray.Insert(0, 1);
|
||||
InvBodyTabPanelArray[0] = NewInvTabPanel;
|
||||
}
|
||||
}
|
||||
|
||||
bNeedsUpdate = false;
|
||||
|
||||
//SetFocus(TabPanelInventoryHeader);
|
||||
|
||||
// Fill All Ammo
|
||||
if ( FillAllAmmoCost < 1 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
NewInvTabPanel = GUIInvBodyTabPanel(AddComponent("KFGUI.GUIInvBodyTabPanel"));
|
||||
NewInvTabPanel.bBoundToParent = true;
|
||||
NewInvTabPanel.bScaleToParent = true;
|
||||
NewInvTabPanel.WinTop = OldX + 0.130000;
|
||||
NewInvTabPanel.WinLeft = TabPanelInventoryHeader.WinLeft;
|
||||
NewInvTabPanel.WinHeight = TabPanelInventoryHeader.WinHeight;
|
||||
NewInvTabPanel.WinWidth = TabPanelInventoryHeader.WinWidth;
|
||||
GUILabel(NewInvTabPanel.Controls[0]).TextAlign = TXTA_Left;
|
||||
GUILabel(NewInvTabPanel.Controls[0]).TextFont = "UT2SmallFont";
|
||||
GUILabel(NewInvTabPanel.Controls[0]).FontScale = FNS_Small;
|
||||
GUILabel(NewInvTabPanel.Controls[0]).Caption = "Fill Up Ammo";
|
||||
GUILabel(NewInvTabPanel.Controls[1]).bVisible = false;
|
||||
GUIButton(NewInvTabPanel.Controls[2]).bVisible = false;
|
||||
GUIButton(NewInvTabPanel.Controls[2]).bAcceptsInput = false;
|
||||
|
||||
if ( PlayerOwner().PlayerReplicationInfo.Score >= int(FillAllAmmoCost) )
|
||||
{
|
||||
GUIButton(NewInvTabPanel.Controls[3]).Caption = "£" $ string(int(FillAllAmmoCost));
|
||||
GUIButton(NewInvTabPanel.Controls[3]).OnClick = DoFillAllAmmo;
|
||||
}
|
||||
else if ( PlayerOwner().PlayerReplicationInfo.Score >= FindCheapestAmmo() )
|
||||
{
|
||||
GUIButton(NewInvTabPanel.Controls[3]).Caption = "Auto Fill";
|
||||
GUIButton(NewInvTabPanel.Controls[3]).OnClick = DoFillAllAmmo;
|
||||
}
|
||||
else
|
||||
{
|
||||
GUIButton(NewInvTabPanel.Controls[3]).Caption = "Low Cash";
|
||||
GUIButton(NewInvTabPanel.Controls[3]).bAcceptsInput = false;
|
||||
}
|
||||
|
||||
// Just filling up all weapons, can't sell
|
||||
GUILabel(NewInvTabPanel.Controls[4]).bVisible = false;
|
||||
GUIButton(NewInvTabPanel.Controls[5]).bVisible = false;
|
||||
GUIButton(NewInvTabPanel.Controls[5]).bAcceptsInput = false;
|
||||
|
||||
// Add this last tab bar to the component list
|
||||
InvBodyTabPanelArray.Insert(0, 1);
|
||||
InvBodyTabPanelArray[0] = NewInvTabPanel;
|
||||
}
|
||||
|
||||
// Fills the ammo of all weapons in the inv to the max
|
||||
function bool DoFillAllAmmo(GUIComponent Sender)
|
||||
{
|
||||
local int i, j, CheapestAmmo;
|
||||
local bool bAlreadyBoughtFrag;
|
||||
|
||||
CheapestAmmo = FindCheapestAmmo();
|
||||
|
||||
for ( i = 0; i < 999; i++ )
|
||||
{
|
||||
for ( j = 0; j < FillAllAmmoAmmunitions.Length; j++ )
|
||||
{
|
||||
// We do not want to set the priority on grenades, so let's just buy one every other buy cycle
|
||||
if ( FillAllAmmoAmmunitions[j].IsA('FragAmmo') && bAlreadyBoughtFrag )
|
||||
{
|
||||
bAlreadyBoughtFrag = false;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( PlayerOwner().PlayerReplicationInfo.Score >= FindAmmoCost(FillAllAmmoAmmunitions[j].Class) )
|
||||
{
|
||||
KFPawn(PlayerOwner().Pawn).ServerBuyAmmo(FillAllAmmoAmmunitions[j].Class, false);
|
||||
|
||||
if ( FillAllAmmoAmmunitions[j].IsA('FragAmmo') )
|
||||
{
|
||||
bAlreadyBoughtFrag = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ( PlayerOwner().PlayerReplicationInfo.Score < CheapestAmmo )
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// refresh the menu
|
||||
bNeedsUpdate = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function int FindCheapestAmmo()
|
||||
{
|
||||
local Inventory CurInv;
|
||||
local int CurrentCheapest, CurrentCost;
|
||||
|
||||
CurrentCheapest = 99999;
|
||||
|
||||
for ( CurInv = PlayerOwner().Pawn.Inventory; CurInv != none; CurInv = CurInv.Inventory )
|
||||
{
|
||||
if ( CurInv.IsA('KFAmmunition') )
|
||||
{
|
||||
CurrentCost = FindAmmoCost(KFAmmunition(CurInv).Class);
|
||||
}
|
||||
|
||||
if ( CurrentCost < CurrentCheapest )
|
||||
{
|
||||
CurrentCheapest = CurrentCost;
|
||||
}
|
||||
}
|
||||
|
||||
return CurrentCheapest;
|
||||
}
|
||||
|
||||
function int FindAmmoCost(Class<Ammunition> AClass)
|
||||
{
|
||||
local Inventory CurInv;
|
||||
local Ammunition MyAmmo;
|
||||
local KFWeapon MyWeapon;
|
||||
|
||||
for ( CurInv = PlayerOwner().Pawn.Inventory; CurInv != none; CurInv = CurInv.Inventory )
|
||||
{
|
||||
if( CurInv.Class == AClass )
|
||||
{
|
||||
MyAmmo = Ammunition(CurInv);
|
||||
}
|
||||
else if ( MyWeapon == None && KFWeapon(CurInv) != None && (Weapon(CurInv).AmmoClass[0]==AClass || Weapon(CurInv).AmmoClass[1]==AClass) )
|
||||
{
|
||||
MyWeapon = KFWeapon(CurInv);
|
||||
}
|
||||
}
|
||||
|
||||
return Class<KFWeaponPickup>(MyWeapon.PickupClass).Default.AmmoCost;
|
||||
}
|
||||
|
||||
function bool DoFillOneAmmo(GUIComponent Sender)
|
||||
{
|
||||
if ( KFPawn(PlayerOwner().Pawn) != none )
|
||||
{
|
||||
KFPawn(PlayerOwner().Pawn).ServerBuyAmmo(class<Ammunition>(GUIInvButton(Sender).Inv), false);
|
||||
|
||||
// refresh the menu
|
||||
bNeedsUpdate = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function bool DoBuyClip(GUIComponent Sender)
|
||||
{
|
||||
if ( KFPawn(PlayerOwner().Pawn) != none )
|
||||
{
|
||||
KFPawn(PlayerOwner().Pawn).ServerBuyAmmo(class<Ammunition>(GUIInvButton(Sender).Inv), true);
|
||||
|
||||
// refresh the menu
|
||||
bNeedsUpdate = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function bool DoSellItem(GUIComponent Sender)
|
||||
{
|
||||
if ( KFPawn(PlayerOwner().Pawn) != none )
|
||||
{
|
||||
KFPawn(PlayerOwner().Pawn).ServerSellWeapon(class<Weapon>(GUIInvButton(Sender).Inv));
|
||||
|
||||
// refresh the menu
|
||||
bNeedsUpdate = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Begin Object Class=GUIInvHeaderTabPanel Name=InventoryHeaderTabPanel
|
||||
WinTop=0.000000
|
||||
WinLeft=0.000000
|
||||
WinWidth=1.00000
|
||||
WinHeight=0.08000
|
||||
bBoundToParent=true
|
||||
bScaleToParent=true
|
||||
End Object
|
||||
TabPanelInventoryHeader=InventoryHeaderTabPanel
|
||||
}
|
||||
|
||||
313
kf_sources/KFGui/Classes/GUIBuyWeaponInfoPanel.uc
Normal file
313
kf_sources/KFGui/Classes/GUIBuyWeaponInfoPanel.uc
Normal file
|
|
@ -0,0 +1,313 @@
|
|||
//=============================================================================
|
||||
// Selected weapon info in the trader menu
|
||||
//=============================================================================
|
||||
// Killing Floor Source
|
||||
// Copyright (C) 2009 Tripwire Interactive LLC
|
||||
// Christian "schneidzekk" Schneider
|
||||
//=============================================================================
|
||||
class GUIBuyWeaponInfoPanel extends GUIBuyDescInfoPanel;
|
||||
|
||||
var automated GUILabel ItemName, WeightLabel;
|
||||
var automated GUIImage ItemImage, ItemNameBG, WeightLabelBG;
|
||||
|
||||
var automated GUILabel ItemPower,ItemRange,ItemSpeed; //Weapon stats captions
|
||||
var automated GUIWeaponBar b_power,b_range,b_speed; //Weapon stats bars
|
||||
|
||||
var automated localized String Weight;
|
||||
var class<Pickup> OldPickupClass;
|
||||
|
||||
var automated GUIButton FavoriteButton;
|
||||
|
||||
var bool bFavorited;
|
||||
|
||||
var localized string FavoriteString;
|
||||
var localized string UnfavoriteString;
|
||||
|
||||
// cache it!
|
||||
var KFLevelRules KFLR;
|
||||
|
||||
function InitComponent( GUIController MyController, GUIComponent MyOwner )
|
||||
{
|
||||
Super.InitComponent(MyController,MyOwner);
|
||||
|
||||
b_power.SetValue(0);
|
||||
b_power.SetVisibility(false);
|
||||
b_speed.SetValue(0);
|
||||
b_speed.SetVisibility(false);
|
||||
b_range.SetValue(0);
|
||||
b_range.SetVisibility(false);
|
||||
|
||||
ItemPower.SetVisibility(false);
|
||||
ItemRange.SetVisibility(false);
|
||||
ItemSpeed.SetVisibility(false);
|
||||
}
|
||||
|
||||
function Opened( GUIComponent Sender )
|
||||
{
|
||||
super.Opened( Sender );
|
||||
|
||||
foreach PlayerOwner().DynamicActors(class'KFLevelRules', KFLR)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function Display(GUIBuyable NewBuyable)
|
||||
{
|
||||
if ( NewBuyable == none || NewBuyable.bIsFirstAidKit || NewBuyable.bIsVest )
|
||||
{
|
||||
b_power.SetValue(0);
|
||||
b_power.SetVisibility(false);
|
||||
b_speed.SetValue(0);
|
||||
b_speed.SetVisibility(false);
|
||||
b_range.SetValue(0);
|
||||
b_range.SetVisibility(false);
|
||||
|
||||
ItemPower.SetVisibility(false);
|
||||
ItemRange.SetVisibility(false);
|
||||
ItemSpeed.SetVisibility(false);
|
||||
|
||||
WeightLabel.SetVisibility(false);
|
||||
WeightLabelBG.SetVisibility(false);
|
||||
|
||||
FavoriteButton.SetVisibility(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
b_power.SetValue(NewBuyable.ItemPower);
|
||||
b_speed.SetValue(NewBuyable.ItemSpeed);
|
||||
b_range.SetValue(NewBuyable.ItemRange);
|
||||
|
||||
b_power.SetVisibility(true);
|
||||
b_speed.SetVisibility(true);
|
||||
b_range.SetVisibility(true);
|
||||
|
||||
ItemPower.SetVisibility(true);
|
||||
ItemRange.SetVisibility(true);
|
||||
ItemSpeed.SetVisibility(true);
|
||||
|
||||
WeightLabel.SetVisibility(true);
|
||||
WeightLabelBG.SetVisibility(true);
|
||||
|
||||
if( NewBuyable.bSaleList )
|
||||
{
|
||||
FavoriteButton.SetVisibility(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
FavoriteButton.SetVisibility(false);
|
||||
}
|
||||
bFavorited = KFLR.IsFavorited( NewBuyable.ItemPickupClass );
|
||||
RefreshFavoriteButton();
|
||||
}
|
||||
|
||||
if ( NewBuyable != none )
|
||||
{
|
||||
ItemName.Caption = NewBuyable.ItemName;
|
||||
ItemNameBG.bVisible = true;
|
||||
ItemImage.Image = NewBuyable.ItemImage;
|
||||
WeightLabel.Caption = Repl(Weight, "%i", int(NewBuyable.ItemWeight));
|
||||
|
||||
OldPickupClass = NewBuyable.ItemPickupClass;
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemName.Caption = "";
|
||||
ItemNameBG.bVisible = false;
|
||||
ItemImage.Image = none;
|
||||
WeightLabel.Caption = "";
|
||||
}
|
||||
|
||||
Super.Display(NewBuyable);
|
||||
}
|
||||
|
||||
function RefreshFavoriteButton()
|
||||
{
|
||||
if( bFavorited )
|
||||
{
|
||||
FavoriteButton.Caption = UnfavoriteString;
|
||||
}
|
||||
else
|
||||
{
|
||||
FavoriteButton.Caption = FavoriteString;
|
||||
}
|
||||
}
|
||||
|
||||
function bool InternalOnClick( GUIComponent Sender )
|
||||
{
|
||||
if( Sender == FavoriteButton )
|
||||
{
|
||||
if( OldPickupClass != none )
|
||||
{
|
||||
if( bFavorited )
|
||||
{
|
||||
KFLR.RemoveFromFavorites( OldPickupClass );
|
||||
}
|
||||
else
|
||||
{
|
||||
KFLR.AddToFavorites( OldPickupClass );
|
||||
}
|
||||
|
||||
bFavorited = !bFavorited;
|
||||
RefreshFavoriteButton();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Weight="Weight: %i blocks"
|
||||
FavoriteString="Favorite"
|
||||
UnfavoriteString="Un-favorite"
|
||||
|
||||
Begin Object Class=GUILabel Name=IName
|
||||
TextFont="UT2LargeFont"
|
||||
Caption=""
|
||||
TextColor=(R=175,G=176,B=158,A=255)
|
||||
WinTop=0.005236
|
||||
WinLeft=0.035800
|
||||
WinWidth=0.928366
|
||||
WinHeight=0.070000
|
||||
bScaleToParent=true
|
||||
bBoundToParent=true
|
||||
bAcceptsInput=false
|
||||
bNeverFocus=true
|
||||
TextAlign=TXTA_Center
|
||||
End Object
|
||||
ItemName=GUILabel'KFGui.GUIBuyWeaponInfoPanel.IName'
|
||||
|
||||
Begin Object class=GUIImage Name=INameBG
|
||||
WinTop=-0.015493
|
||||
WinLeft=0.035800
|
||||
WinWidth=0.928366
|
||||
WinHeight=0.105446
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Innerborder_transparent'
|
||||
ImageStyle=ISTY_Stretched
|
||||
End Object
|
||||
ItemNameBG=INameBG
|
||||
|
||||
Begin Object Class=GUILabel Name=LWeight
|
||||
Caption=""
|
||||
TextColor=(R=175,G=176,B=158,A=255)
|
||||
WinTop=0.879874
|
||||
WinLeft=0.058031
|
||||
WinWidth=0.885273
|
||||
WinHeight=0.093913
|
||||
bScaleToParent=true
|
||||
bBoundToParent=true
|
||||
bAcceptsInput=false
|
||||
bNeverFocus=true
|
||||
TextFont="UT2LargeFont"
|
||||
TextAlign=TXTA_Center
|
||||
End Object
|
||||
WeightLabel=GUILabel'KFGui.GUIBuyWeaponInfoPanel.LWeight'
|
||||
|
||||
Begin Object class=GUIImage Name=LWeightBG
|
||||
WinTop=0.873124
|
||||
WinLeft=0.112600
|
||||
WinWidth=0.765905
|
||||
WinHeight=0.108400
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Innerborder_transparent'
|
||||
ImageStyle=ISTY_Stretched
|
||||
End Object
|
||||
WeightLabelBG=LWeightBG
|
||||
|
||||
Begin Object Class=GUIButton Name=FavoriteB
|
||||
WinTop=1
|
||||
WinLeft=0.25
|
||||
WinWidth=0.5
|
||||
WinHeight=0.08
|
||||
Caption="Favorite"
|
||||
RenderWeight=0.9
|
||||
OnClick=InternalOnClick
|
||||
End Object
|
||||
FavoriteButton=FavoriteB
|
||||
|
||||
Begin Object Class=GUIImage Name=IImage
|
||||
WinTop=0.113025
|
||||
WinLeft=0.237005
|
||||
WinWidth=0.524539
|
||||
WinHeight=0.574359
|
||||
bScaleToParent=true
|
||||
bBoundToParent=true
|
||||
RenderWeight=2.0
|
||||
ImageStyle=ISTY_Justified
|
||||
End Object
|
||||
ItemImage=GUIImage'KFGUI.GUIBuyWeaponInfoPanel.IImage'
|
||||
|
||||
Begin Object Class=GUILabel Name=PowerCap
|
||||
Caption="Power:"
|
||||
TextColor=(R=175,G=176,B=158,A=255)
|
||||
WinTop=0.588943
|
||||
WinLeft=0.131552
|
||||
WinWidth=0.739260
|
||||
WinHeight=0.070000
|
||||
bScaleToParent=true
|
||||
bBoundToParent=true
|
||||
FontScale=FNS_Large
|
||||
End Object
|
||||
ItemPower=GUILabel'KFGui.GUIBuyWeaponInfoPanel.PowerCap'
|
||||
|
||||
Begin Object Class=GUILabel Name=RangeCap
|
||||
Caption="Range:"
|
||||
TextColor=(R=175,G=176,B=158,A=255)
|
||||
WinTop=0.688943
|
||||
WinLeft=0.131552
|
||||
WinWidth=0.739260
|
||||
WinHeight=0.070000
|
||||
bScaleToParent=true
|
||||
bBoundToParent=true
|
||||
FontScale=FNS_Large
|
||||
End Object
|
||||
ItemRange=GUILabel'KFGui.GUIBuyWeaponInfoPanel.RangeCap'
|
||||
|
||||
Begin Object Class=GUILabel Name=SpeedCap
|
||||
Caption="Speed:"
|
||||
TextColor=(R=175,G=176,B=158,A=255)
|
||||
WinTop=0.788943
|
||||
WinLeft=0.131552
|
||||
WinWidth=0.739260
|
||||
WinHeight=0.070000
|
||||
bScaleToParent=true
|
||||
bBoundToParent=true
|
||||
FontScale=FNS_Large
|
||||
End Object
|
||||
ItemSpeed=GUILabel'KFGui.GUIBuyWeaponInfoPanel.SpeedCap'
|
||||
|
||||
Begin Object Class=GUIWeaponBar Name=PowerBar
|
||||
WinTop=0.598943
|
||||
WinLeft=0.366433
|
||||
WinWidth=0.471784
|
||||
WinHeight=0.050000
|
||||
bScaleToParent=true
|
||||
bBoundToParent=true
|
||||
BorderSize=3.0
|
||||
End Object
|
||||
b_power=GUIWeaponBar'KFGui.GUIBuyWeaponInfoPanel.PowerBar'
|
||||
|
||||
Begin Object Class=GUIWeaponBar Name=RangeBar
|
||||
Value=-5.000000
|
||||
WinTop=0.698943
|
||||
WinLeft=0.366433
|
||||
WinWidth=0.471784
|
||||
WinHeight=0.050000
|
||||
bScaleToParent=true
|
||||
bBoundToParent=true
|
||||
BorderSize=3.0
|
||||
End Object
|
||||
b_range=GUIWeaponBar'KFGui.GUIBuyWeaponInfoPanel.RangeBar'
|
||||
|
||||
Begin Object Class=GUIWeaponBar Name=SpeedBar
|
||||
WinTop=0.798943
|
||||
WinLeft=0.366433
|
||||
WinWidth=0.471784
|
||||
WinHeight=0.050000
|
||||
bScaleToParent=true
|
||||
bBoundToParent=true
|
||||
BorderSize=3.0
|
||||
End Object
|
||||
b_speed=GUIWeaponBar'KFGui.GUIBuyWeaponInfoPanel.SpeedBar'
|
||||
}
|
||||
|
||||
65
kf_sources/KFGui/Classes/GUIBuyable.uc
Normal file
65
kf_sources/KFGui/Classes/GUIBuyable.uc
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
//=============================================================================
|
||||
// GUIBuyable
|
||||
// Stores all the information of a certain item in the trader menu
|
||||
//=============================================================================
|
||||
// Killing Floor Source
|
||||
// Copyright (C) 2009 Tripwire Interactive LLC
|
||||
// Christian "schneidzekk" Schneider
|
||||
//=============================================================================
|
||||
|
||||
class GUIBuyable extends Object;
|
||||
|
||||
var localized string ItemName; //Sale name of object
|
||||
var localized string ItemDescription; //Short item Description
|
||||
var localized string ItemCategorie;
|
||||
|
||||
var texture ItemImage; //Image to show in Info
|
||||
|
||||
var class<KFWeapon> ItemWeaponClass; //Weapon class used for buying/selling
|
||||
var class<Ammunition> ItemAmmoClass; //Ammo class used for buying/selling
|
||||
var class<KFWeaponPickup> ItemPickupClass; //Pickup class
|
||||
|
||||
var float ItemCost; //Cost to buy
|
||||
var float ItemAmmoCost; //Single clip cost
|
||||
var float ItemFillAmmoCost; //Fill up cost
|
||||
|
||||
var float ItemWeight; //Heaviness
|
||||
var float ItemPower; //Progressbar power
|
||||
var float ItemRange; //Progressbar range
|
||||
var float ItemSpeed; //Progressbar speed
|
||||
|
||||
var float ItemAmmoCurrent; //Current ammo count
|
||||
var float ItemAmmoMax; //Max ammo
|
||||
|
||||
var bool bSaleList; //Inventory or sale?
|
||||
var bool bSellable; //Can't sell Default weapons
|
||||
var bool bMelee; //Melee weapons
|
||||
var bool bIsVest; //Vest?
|
||||
var bool bIsFirstAidKit; //First Aid?
|
||||
var byte ItemPerkIndex; //Corresponding perk
|
||||
|
||||
var int ItemSellValue; //Value at which this item can be sold
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
ItemName="Buyable Item Name"
|
||||
ItemDescription"Buyable Item Description"
|
||||
ItemImage=texture'KillingFloorHUD.Trader_Weapon_Images.Trader_9mm'
|
||||
ItemWeaponClass=class'Single'
|
||||
ItemAmmoClass=class'SingleAmmo'
|
||||
ItemCost="123456789"
|
||||
ItemAmmoCost="123456789"
|
||||
ItemFillAmmoCost="123456789"
|
||||
ItemWeight="123456789"
|
||||
ItemPower="12345679"
|
||||
ItemRange="12345679"
|
||||
ItemSpeed="12345679"
|
||||
ItemAmmoCurrent="123456789"
|
||||
ItemAmmoMax="123456789"
|
||||
bSellable=false
|
||||
bMelee=false
|
||||
bIsVest=false
|
||||
bIsFirstAidKit=false
|
||||
bSaleList=false
|
||||
}
|
||||
|
||||
18
kf_sources/KFGui/Classes/GUIClassInfoPanel.uc
Normal file
18
kf_sources/KFGui/Classes/GUIClassInfoPanel.uc
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
class GUIClassInfoPanel extends GUIPanel;
|
||||
|
||||
var automated GUIImage i_back;
|
||||
|
||||
function Display(GUIClassSelectable item);
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Begin Object Class=GUIImage Name=Background
|
||||
Image=Texture'Engine.WhiteSquareTexture'
|
||||
ImageColor=(B=0,G=0,R=0)
|
||||
ImageStyle=ISTY_Stretched
|
||||
ImageRenderStyle=MSTY_Normal
|
||||
WinHeight=1.000000
|
||||
End Object
|
||||
i_back=GUIImage'KFGui.GUIClassInfoPanel.Background'
|
||||
|
||||
}
|
||||
305
kf_sources/KFGui/Classes/GUIClassMenu.uc
Normal file
305
kf_sources/KFGui/Classes/GUIClassMenu.uc
Normal file
|
|
@ -0,0 +1,305 @@
|
|||
class GUIClassMenu extends UT2k4MainPage;
|
||||
const BUYLIST_CATS=7;
|
||||
var automated GUIPanel p_Info;
|
||||
var automated GUISelectClassesBox CategoryBox;
|
||||
var automated GUISelectClassesBox ItemsBox;
|
||||
var automated GUISectionBackground CategoryBG,ItemBG,InfoBG;
|
||||
var GUISelectClassList myItems;
|
||||
//var KFBuyItemsList myItems;
|
||||
var editconst noexport float SavedPitch;
|
||||
|
||||
var array<string> BuyListHeaders;
|
||||
var array<string> BuyListItemNames;
|
||||
|
||||
//Use these values to modify/test
|
||||
var int playerscore;
|
||||
var float playerweight;
|
||||
var float maxweight;
|
||||
|
||||
var array < GUIClassSelectable > AllSelectableClasses;
|
||||
|
||||
function InitComponent( GUIController MyController, GUIComponent MyOwner )
|
||||
{
|
||||
Super.InitComponent( MyController, MyOwner );
|
||||
|
||||
ItemBG.ManageComponent(ItemsBox);
|
||||
myItems = ItemsBox.List;
|
||||
}
|
||||
|
||||
event HandleParameters(string Param1, string Param2)
|
||||
{
|
||||
|
||||
local int i;
|
||||
local int maxitems;
|
||||
local class<GUIClassSelectable> newitem;
|
||||
|
||||
|
||||
maxitems = 3;
|
||||
|
||||
AllSelectableClasses.Remove(0,AllSelectableClasses.Length);
|
||||
//Lets split the delimited replication string and get the array out
|
||||
|
||||
//Split(KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).ClassListClassNames,",",ClassListClassNames);
|
||||
|
||||
for(i=0;i<maxitems;i++)
|
||||
{
|
||||
|
||||
// newitem = class<GUIClassSelectable>(DynamicLoadObject(ClassListClassNames[i],class'Class'));
|
||||
newitem = class 'SelectPlayerSoldier';
|
||||
AllSelectableClasses.Insert(0,1);
|
||||
AllSelectableClasses[0] = New newitem;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//GUIBuyMenuFooter(t_Footer).SetPlayerStats(playerscore,playerweight);
|
||||
ClassChange(self);
|
||||
|
||||
}
|
||||
|
||||
function KFClassMenuClosed(optional Bool bCanceled)
|
||||
{
|
||||
local rotator NewRot;
|
||||
local int i;
|
||||
|
||||
// Reset player
|
||||
NewRot = PlayerOwner().Rotation;
|
||||
NewRot.Pitch = SavedPitch;
|
||||
PlayerOwner().SetRotation(NewRot);
|
||||
|
||||
//Reset purchased items.
|
||||
for(i=0;i<AllSelectableClasses.length;i++)
|
||||
{
|
||||
AllSelectableClasses[i].PurchasedQuantity=0;
|
||||
}
|
||||
Super.OnClose(bCanceled);
|
||||
|
||||
|
||||
}
|
||||
|
||||
event Opened(GUIComponent Sender)
|
||||
{
|
||||
local rotator PlayerRot;
|
||||
local int i; //,j;
|
||||
local int maxitems;
|
||||
local class<GUIClassSelectable> newitem;
|
||||
|
||||
Super.Opened(Sender);
|
||||
|
||||
maxitems = 3;
|
||||
AllSelectableClasses.Remove(0,AllSelectableClasses.Length);
|
||||
|
||||
for(i=0;i<maxitems;i++)
|
||||
{
|
||||
|
||||
// newitem = class<GUIClassSelectable>(DynamicLoadObject(ClassListClassNames[i],class'Class'));
|
||||
newitem = class 'SelectPlayerSoldier';
|
||||
AllSelectableClasses.Insert(0,1);
|
||||
AllSelectableClasses[0] = New newitem;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 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);
|
||||
playerscore = PlayerOwner().PlayerReplicationInfo.Score;
|
||||
}
|
||||
|
||||
function NewInfo(GUIClassSelectable b)
|
||||
{
|
||||
if(p_Info != None)
|
||||
{
|
||||
RemoveComponent(p_Info,true);
|
||||
InfoBG.UnmanageComponent(p_Info);
|
||||
p_Info.Closed(p_Info,false);
|
||||
p_Info.free();
|
||||
p_Info = None;
|
||||
}
|
||||
if(b != None)
|
||||
{
|
||||
// p_Info = new b.GetPanelType(eClasscat(myCategories.Index));;
|
||||
//GUIBuyMenuFooter(t_Footer).SetBuyMode(b.GetBuyCaption(eClasscat(myCategories.Index)),CanAfford(b)&&b.CanButtonMe(PlayerOwner(),myCategories.Index != 0),b.IsA('BuyableAmmo') && myCategories.Index !=0,b.Isa('BuyableAmmo') && BuyableAmmo(b).BuyMoreClips()*b.cost < playerscore);
|
||||
} else
|
||||
{
|
||||
p_Info = new class'GUIClassInfoPanel';
|
||||
//GUIBuyMenuFooter(t_Footer).SetBuyMode("Buy",false,false,false);
|
||||
}
|
||||
p_Info.WinLeft=0;
|
||||
p_Info.WinTop=0;
|
||||
p_Info.WinWidth=1;
|
||||
p_Info.WinHeight=1;
|
||||
AppendComponent(p_Info,true);
|
||||
InfoBG.ManageComponent(p_Info);
|
||||
if(p_Info.IsA('GUIClassInfoPanel'))
|
||||
GUIClassInfoPanel(p_Info).Display(b);
|
||||
}
|
||||
|
||||
function bool CanAfford(GUIClassSelectable b)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
function ClassChange(GUIComponent Sender)
|
||||
{
|
||||
local int j;
|
||||
|
||||
myItems.Clear();
|
||||
//i = myCategories.Index;
|
||||
|
||||
for(j=0;j<AllSelectableClasses.length;j++)
|
||||
{
|
||||
// if(AllSelectableClasses[j].ShowMe(PlayerOwner().Pawn,eClassCat(i)))
|
||||
myItems.Add(AllSelectableClasses[j]);
|
||||
}
|
||||
myItems.OnChange(myItems);
|
||||
|
||||
}
|
||||
|
||||
function CloseSale(bool savePurchases)
|
||||
{
|
||||
local int i;
|
||||
if(savePurchases && PlayerOwner().Pawn.IsA('KFHumanPawn'))
|
||||
{
|
||||
for(i=0;i<AllSelectableClasses.length;i++)
|
||||
{
|
||||
AllSelectableClasses[i].ProcessComplete(PlayerOwner());
|
||||
}
|
||||
|
||||
//PlayerOwner().pawn.nextWeapon();
|
||||
}
|
||||
Controller.CloseMenu(!savePurchases);
|
||||
|
||||
|
||||
// Increment the number of players that are class-ready
|
||||
// If We don't meet the number of players in the level, then put the player in "Waiting mode" again.
|
||||
if (AllSelectableClasses.length > 0)
|
||||
KFGameReplicationInfo(PlayerOwner().Level.Game.GameReplicationInfo).NumPlayersClassSelected ++;
|
||||
|
||||
if ( KFGameReplicationInfo(PlayerOwner().Level.Game.GameReplicationInfo).NumPlayersClassSelected >= PlayerOwner().level.game.NumPlayers)
|
||||
{
|
||||
KFPlayerController(PlayerOwner()).bClassChosen = true;
|
||||
//PlayerOwner().ServerRestartPlayer();
|
||||
Log("Number of CLASS SELECT READY players == NUMPLAYERS.");
|
||||
}
|
||||
else
|
||||
PlayerOwner().GotoState('PlayerWaiting');
|
||||
|
||||
}
|
||||
|
||||
// We've got our player class selected, now "Buy" it.
|
||||
|
||||
function BuyCurrent()
|
||||
{
|
||||
local GUIClassSelectable b;
|
||||
local int i;
|
||||
|
||||
b = myItems.Elements[myItems.Index];
|
||||
|
||||
b.BuyMe(playerscore,playerweight, playerOwner().Pawn);
|
||||
|
||||
// myCategories.IndexChanged(myCategories); //update lists
|
||||
//Only refresh if we're out of whatever we bought.
|
||||
for(i=0;i<myItems.Elements.Length;i++)
|
||||
{
|
||||
if(myItems.Elements[i] == b)
|
||||
myItems.SetIndex(i);
|
||||
}
|
||||
|
||||
|
||||
//GUIBuyMenuFooter(t_Footer).SetPlayerStats(playerscore,playerweight); //update footer
|
||||
}
|
||||
|
||||
function BuyFill()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function bool CanAutoAmmo()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
function DoAutoAmmo()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Begin Object Class=GUISelectClassesBox Name=itmbox
|
||||
bVisibleWhenEmpty=True
|
||||
bSorted=True
|
||||
OnCreateComponent=itmbox.InternalOnCreateComponent
|
||||
Hint="Available Classes"
|
||||
WinHeight=1.000000
|
||||
TabOrder=1
|
||||
bBoundToParent=True
|
||||
bScaleToParent=True
|
||||
End Object
|
||||
ItemsBox=GUISelectClassesBox'KFGui.GUIClassMenu.itmbox'
|
||||
|
||||
Begin Object Class=AltSectionBackground Name=itmbg
|
||||
Caption="Player Classes"
|
||||
WinTop=0.060215
|
||||
WinLeft=0.480000
|
||||
WinWidth=0.500000
|
||||
WinHeight=0.880000
|
||||
OnPreDraw=itmbg.InternalPreDraw
|
||||
End Object
|
||||
ItemBG=AltSectionBackground'KFGui.GUIClassMenu.itmbg'
|
||||
|
||||
Begin Object Class=AltSectionBackground Name=infbg
|
||||
Caption="Class Info"
|
||||
WinTop=0.454030
|
||||
WinLeft=0.010000
|
||||
WinWidth=0.440000
|
||||
WinHeight=0.486185
|
||||
OnPreDraw=infbg.InternalPreDraw
|
||||
End Object
|
||||
InfoBG=AltSectionBackground'KFGui.GUIClassMenu.infbg'
|
||||
|
||||
Begin Object Class=GUITabControl Name=PageTabs
|
||||
bDockPanels=True
|
||||
TabHeight=0.040000
|
||||
WinLeft=0.010000
|
||||
WinWidth=0.980000
|
||||
WinHeight=0.040000
|
||||
RenderWeight=0.490000
|
||||
TabOrder=3
|
||||
bAcceptsInput=True
|
||||
OnActivate=PageTabs.InternalOnActivate
|
||||
End Object
|
||||
c_Tabs=GUITabControl'KFGui.GUIClassMenu.PageTabs'
|
||||
|
||||
Begin Object Class=GUIHeader Name=GamePageHeader
|
||||
Caption="Select Class"
|
||||
RenderWeight=0.300000
|
||||
End Object
|
||||
t_Header=GUIHeader'KFGui.GUIClassMenu.GamePageHeader'
|
||||
|
||||
Begin Object Class=GUIClassMenuFooter Name=BuyFooter
|
||||
WinTop=0.957943
|
||||
RenderWeight=0.300000
|
||||
TabOrder=8
|
||||
OnPreDraw=BuyFooter.InternalOnPreDraw
|
||||
End Object
|
||||
t_Footer=GUIClassMenuFooter'KFGui.GUIClassMenu.BuyFooter'
|
||||
|
||||
Begin Object Class=BackgroundImage Name=KFBackground
|
||||
Image=Texture'KillingFloor2HUD.menu.menuBackground'
|
||||
ImageStyle=ISTY_PartialScaled
|
||||
RenderWeight=0.010000
|
||||
bBoundToParent=True
|
||||
bScaleToParent=True
|
||||
End Object
|
||||
i_Background=BackgroundImage'KFGui.GUIClassMenu.KFBackground'
|
||||
|
||||
bRenderWorld=True
|
||||
bAllowedAsLast=True
|
||||
OnClose=GUIClassMenu.KFClassMenuClosed
|
||||
}
|
||||
259
kf_sources/KFGui/Classes/GUIClassMenuFooter.uc
Normal file
259
kf_sources/KFGui/Classes/GUIClassMenuFooter.uc
Normal file
|
|
@ -0,0 +1,259 @@
|
|||
class GUIClassMenuFooter extends ButtonFooter;
|
||||
|
||||
var automated GUIButton b_Buy,b_Cancel,b_Complete,b_AutoAll,b_Fill;
|
||||
var automated GUIButton spacer1,spacer2;
|
||||
var automated GUILabel l_score,l_weight;
|
||||
|
||||
function PositionButtons (Canvas C)
|
||||
{
|
||||
local int i;
|
||||
local GUIButton b;
|
||||
local float x;
|
||||
|
||||
for ( i = 0; i < Controls.Length; i++ )
|
||||
{
|
||||
b = GUIButton(Controls[i]);
|
||||
if ( b != None)
|
||||
{
|
||||
if ( x == 0 )
|
||||
x = ButtonLeft;
|
||||
else x += GetSpacer();
|
||||
b.WinLeft = b.RelativeLeft( x, True );
|
||||
x += b.ActualWidth();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function SetPlayerStats(int score, float weight)
|
||||
{
|
||||
l_score.Caption = "Score:"@score;
|
||||
l_weight.Caption = "Weight:"@weight;
|
||||
}
|
||||
|
||||
function SetBuyMode(string buyCaption,bool buyEnabled,bool fillVisible,bool fillEnabled)
|
||||
{
|
||||
local bool AutoAmmoEnabled;
|
||||
// AutoAmmoEnabled = GUIBuyMenu(PageOwner).CanAutoAmmo();
|
||||
b_buy.Caption = buyCaption;
|
||||
if(buyEnabled && b_buy.MenuState == MSAT_Disabled)
|
||||
b_buy.MenuState = MSAT_Blurry;
|
||||
else if(!buyEnabled)
|
||||
b_buy.MenuState = MSAT_Disabled;
|
||||
|
||||
if(fillEnabled && b_fill.MenuState == MSAT_Disabled)
|
||||
b_fill.MenuState = MSAT_Blurry;
|
||||
else if(!fillEnabled)
|
||||
b_fill.MenuState = MSAT_Disabled;
|
||||
b_fill.bVisible = fillVisible;
|
||||
|
||||
if(AutoAmmoEnabled && b_AutoAll.MenuState == MSAT_Disabled)
|
||||
b_AutoAll.MenuState = MSAT_Blurry;
|
||||
else if(!AutoAmmoEnabled)
|
||||
b_AutoAll.MenuState = MSAT_Disabled;
|
||||
}
|
||||
|
||||
function bool ButtonsSized(Canvas C)
|
||||
{
|
||||
local int i;
|
||||
local GUIButton b;
|
||||
local bool bResult;
|
||||
local string str;
|
||||
local float T, AH, AT;
|
||||
|
||||
if ( !bPositioned )
|
||||
return false;
|
||||
|
||||
bResult = true;
|
||||
str = GetLongestCaption(C);
|
||||
|
||||
AH = ActualHeight();
|
||||
AT = ActualTop();
|
||||
|
||||
for (i = 0; i < Controls.Length; i++ )
|
||||
{
|
||||
b = GUIButton(Controls[i]);
|
||||
if ( b != None )
|
||||
{
|
||||
if ( bAutoSize && bFixedWidth )
|
||||
{
|
||||
if(b.Caption == "")
|
||||
b.SizingCaption = Left(str,Len(str)/2);
|
||||
else
|
||||
b.SizingCaption = str;
|
||||
}
|
||||
else b.SizingCaption = "";
|
||||
|
||||
bResult = bResult && b.bPositioned;
|
||||
if ( bFullHeight )
|
||||
b.WinHeight = b.RelativeHeight(AH,true);
|
||||
else b.WinHeight = b.RelativeHeight(ActualHeight(ButtonHeight),true);
|
||||
|
||||
switch ( Justification )
|
||||
{
|
||||
case TXTA_Left:
|
||||
T = ClientBounds[1];
|
||||
break;
|
||||
|
||||
case TXTA_Center:
|
||||
T = (AT + AH / 2) - (b.ActualHeight() / 2);
|
||||
break;
|
||||
|
||||
case TXTA_Right:
|
||||
T = ClientBounds[3] - b.ActualHeight();
|
||||
break;
|
||||
}
|
||||
|
||||
// b.WinTop = b.RelativeTop(T, True );
|
||||
b.WinTop = b.RelativeTop(T, true ) + ((WinHeight - ButtonHeight) / 2);
|
||||
}
|
||||
}
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
function float GetButtonLeft()
|
||||
{
|
||||
local int i;
|
||||
local GUIButton b;
|
||||
local float TotalWidth, AW, AL;
|
||||
local float FooterMargin;
|
||||
|
||||
AL = ActualLeft();
|
||||
AW = ActualWidth();
|
||||
FooterMargin = GetMargin();
|
||||
|
||||
for (i = 0; i < Controls.Length; i++ )
|
||||
{
|
||||
b = GUIButton(Controls[i]);
|
||||
if ( b != None )
|
||||
{
|
||||
if ( TotalWidth > 0 )
|
||||
TotalWidth += GetSpacer();
|
||||
|
||||
TotalWidth += b.ActualWidth();
|
||||
}
|
||||
}
|
||||
|
||||
if ( Alignment == TXTA_Center )
|
||||
return (AL + AW) / 2 - FooterMargin / 2 - TotalWidth / 2;
|
||||
|
||||
if ( Alignment == TXTA_Right )
|
||||
return (AL + AW - FooterMargin / 2) - TotalWidth;
|
||||
|
||||
return AL + (FooterMargin / 2);
|
||||
}
|
||||
|
||||
// Finds the longest caption of all the buttons
|
||||
function string GetLongestCaption(Canvas C)
|
||||
{
|
||||
local int i;
|
||||
local float XL, YL, LongestW;
|
||||
local string str;
|
||||
local GUIButton b;
|
||||
|
||||
if ( C == None )
|
||||
return "";
|
||||
|
||||
for ( i = 0; i < Controls.Length; i++ )
|
||||
{
|
||||
b = GUIButton(Controls[i]);
|
||||
if ( b != None )
|
||||
{
|
||||
if ( b.Style != None )
|
||||
b.Style.TextSize(C, b.MenuState, b.Caption, XL, YL, b.FontScale);
|
||||
else C.StrLen( b.Caption, XL, YL );
|
||||
|
||||
if ( LongestW == 0 || XL > LongestW )
|
||||
{
|
||||
str = b.Caption;
|
||||
LongestW = XL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
// DONE, let's enter the game.
|
||||
|
||||
function bool OnFooterClick(GUIComponent Sender)
|
||||
{
|
||||
if(Sender == b_Complete)
|
||||
{
|
||||
GUIClassMenu(PageOwner).CloseSale(false);
|
||||
} else if(Sender == b_Buy)
|
||||
{
|
||||
GUIClassMenu(PageOwner).BuyCurrent();
|
||||
}
|
||||
|
||||
if(Sender == b_Cancel)
|
||||
{
|
||||
Controller.CloseAll(false,True);
|
||||
PlayerOwner().GoToState('Spectating');
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Begin Object Class=GUIButton Name=SpectateButton
|
||||
Caption="SPECTATE"
|
||||
StyleName="FooterButton"
|
||||
Hint="Choose to Spectate the game."
|
||||
WinTop=0.966146
|
||||
WinLeft=0.350000
|
||||
WinWidth=0.120000
|
||||
WinHeight=0.033203
|
||||
RenderWeight=2.000000
|
||||
TabOrder=5
|
||||
bBoundToParent=True
|
||||
OnClick=GUIClassMenuFooter.OnFooterClick
|
||||
OnKeyEvent=SpectateButton.InternalOnKeyEvent
|
||||
End Object
|
||||
b_Cancel=GUIButton'KFGui.GUIClassMenuFooter.SpectateButton'
|
||||
|
||||
Begin Object Class=GUIButton Name=Complete
|
||||
Caption="ENTER GAME"
|
||||
StyleName="FooterButton"
|
||||
Hint="choose this class, and start the game."
|
||||
WinTop=0.966146
|
||||
WinLeft=0.380000
|
||||
WinWidth=0.120000
|
||||
WinHeight=0.033203
|
||||
RenderWeight=2.000000
|
||||
TabOrder=6
|
||||
bBoundToParent=True
|
||||
OnClick=GUIClassMenuFooter.OnFooterClick
|
||||
OnKeyEvent=Complete.InternalOnKeyEvent
|
||||
End Object
|
||||
b_Complete=GUIButton'KFGui.GUIClassMenuFooter.Complete'
|
||||
|
||||
Begin Object Class=GUIButton Name=sp
|
||||
StyleName="Footerbutton"
|
||||
WinTop=0.966146
|
||||
WinLeft=0.220000
|
||||
WinWidth=0.120000
|
||||
RenderWeight=2.000000
|
||||
TabOrder=1
|
||||
bBoundToParent=True
|
||||
bVisible=False
|
||||
OnKeyEvent=sp.InternalOnKeyEvent
|
||||
End Object
|
||||
spacer1=GUIButton'KFGui.GUIClassMenuFooter.sp'
|
||||
|
||||
Begin Object Class=GUIButton Name=sp2
|
||||
StyleName="Footerbutton"
|
||||
WinTop=0.966146
|
||||
WinLeft=0.330000
|
||||
WinWidth=0.120000
|
||||
RenderWeight=2.000000
|
||||
TabOrder=4
|
||||
bBoundToParent=True
|
||||
bVisible=False
|
||||
OnKeyEvent=sp2.InternalOnKeyEvent
|
||||
End Object
|
||||
spacer2=GUIButton'KFGui.GUIClassMenuFooter.sp2'
|
||||
|
||||
}
|
||||
141
kf_sources/KFGui/Classes/GUIClassSelectable.uc
Normal file
141
kf_sources/KFGui/Classes/GUIClassSelectable.uc
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
class GUIClassSelectable extends Object;
|
||||
|
||||
var Mesh showMesh; //Mesh to show in Info
|
||||
var StaticMesh myShowMesh; //Actual staticmesh to show in info
|
||||
var int cost; //Cost to buy
|
||||
var float weight; //Heaviness
|
||||
var class<GUIPanel> InfoPanel; //Panel to show Info in- should actually be KFInfoPanel
|
||||
var class<Inventory> relatedInventory; //For inventory sellables,
|
||||
//the associated class.
|
||||
|
||||
var rotator infoDrawRotation; //Rotation in the Info panel
|
||||
var vector infoDrawOffset; //Offset in the info panel
|
||||
var float infoDrawScale; //Generally, size
|
||||
var int infoSpinRate; //rate our weapon spins at. 0 by default.
|
||||
//alex, change the damn default.
|
||||
|
||||
var string ItemName; //Sale name of object
|
||||
var string Description; //Flavor text, etc.
|
||||
|
||||
var int PurchasedQuantity; //Have we bought one of these?
|
||||
var int OwnedQuantity; //Amount player already has
|
||||
|
||||
|
||||
|
||||
enum eClasscat
|
||||
{
|
||||
CLASS_Soldier,
|
||||
CLASS_Medic,
|
||||
CLASS_Engineer
|
||||
};
|
||||
|
||||
|
||||
|
||||
//We might want different panel types for different
|
||||
//categories.
|
||||
function class<GUIPanel> GetPanelType(eClasscat category)
|
||||
{
|
||||
return InfoPanel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function bool CanButtonMe(PlayerController pc,bool buying)
|
||||
{
|
||||
return CanBuyMe(pc);
|
||||
}
|
||||
|
||||
function bool CanBuyMe(PlayerController pc)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
function string GetBuyCaption(eClasscat index)
|
||||
{
|
||||
if(index == CLASS_Soldier)
|
||||
return "Sell";
|
||||
else
|
||||
return "Buy";
|
||||
}
|
||||
|
||||
function ProcessComplete(PlayerController pc)
|
||||
{
|
||||
|
||||
|
||||
if(PurchasedQuantity > 0)
|
||||
{
|
||||
GiveMe(pc);
|
||||
return;
|
||||
} else if(PurchasedQuantity < 0)
|
||||
{
|
||||
TakeMe(pc);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//Hand it over to the player (once he hits complete)
|
||||
function GiveMe(PlayerController pc)
|
||||
{
|
||||
}
|
||||
|
||||
//The slink giveth, the slink taketh away
|
||||
function TakeMe(PlayerController pc)
|
||||
{
|
||||
}
|
||||
|
||||
//Consider ourselves bought
|
||||
function BuyMe(out int score, out float oweight, pawn servUpdatePawn)
|
||||
{
|
||||
score -= cost;
|
||||
oweight += weight;
|
||||
PurchasedQuantity++;
|
||||
// (KFPawn(servUpdatePawn)).setCreds(score) ;
|
||||
}
|
||||
|
||||
|
||||
//Subclasses should return true if the buyable
|
||||
//should show up under the index'th list for pawn p.
|
||||
//This implementation just returns whether or not the pawn
|
||||
//already has an item of class relatedInventory.
|
||||
function bool ShowMe(Pawn p, eClasscat index)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//returns the combined weight of all owned items of type
|
||||
function float InitOwnedQuantity(Pawn p)
|
||||
{
|
||||
local Inventory inv;
|
||||
local int quant;
|
||||
|
||||
//log("INITOWNEDQUANTITY",'KFMessage');
|
||||
|
||||
if(p == None)
|
||||
return 0;
|
||||
for(inv = p.Inventory;inv != None;inv = inv.Inventory)
|
||||
{
|
||||
if(inv.IsA(relatedInventory.Name))
|
||||
{
|
||||
quant++;
|
||||
}
|
||||
}
|
||||
OwnedQuantity=quant;
|
||||
return weight*OwnedQuantity;
|
||||
}
|
||||
|
||||
function bool HasMe(Pawn p)
|
||||
{
|
||||
return (OwnedQuantity+PurchasedQuantity>0);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
myShowMesh=StaticMesh'KillingFloorStatics.DeagleAmmo'
|
||||
InfoPanel=Class'XInterface.GUIPanel'
|
||||
infoDrawRotation=(Pitch=-5461,Yaw=-16384,Roll=32768)
|
||||
infoDrawOffset=(X=100.000000,Y=-20.000000,Z=-10.000000)
|
||||
infoDrawScale=0.700000
|
||||
infoSpinRate=20000
|
||||
ItemName="Buyable Object"
|
||||
Description="This object appears to be for sale."
|
||||
}
|
||||
73
kf_sources/KFGui/Classes/GUIForSaleBodyPanel.uc
Normal file
73
kf_sources/KFGui/Classes/GUIForSaleBodyPanel.uc
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
//-----------------------------------------------------------
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
class GUIForSaleBodyPanel extends GUIPanel;
|
||||
|
||||
var automated GUIImage BG;
|
||||
var() GUIBuyable SaleItemInfo;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
Super.Initcomponent(MyController, MyOwner);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Begin Object Class=GUISaleLabel Name=ItemText
|
||||
Caption="Available In Shop"
|
||||
TextAlign=TXTA_Left
|
||||
bMultiline=False
|
||||
VertAlign=TXTA_Center
|
||||
FontScale=FNS_Small
|
||||
TextColor=(R=255,G=255,B=255,A=255)
|
||||
WinTop=0.000000
|
||||
WinLeft=0.000000
|
||||
WinWidth=0.500000
|
||||
WinHeight=0.800000
|
||||
bBoundToParent=true
|
||||
bScaleToParent=true
|
||||
End Object
|
||||
Controls(0)=GUILabel'ItemText'
|
||||
|
||||
Begin Object Class=GUILabel Name=ItemPrice
|
||||
Caption="Price"
|
||||
TextAlign=TXTA_Center
|
||||
bMultiline=False
|
||||
VertAlign=TXTA_Center
|
||||
FontScale=FNS_Small
|
||||
TextColor=(R=255,G=255,B=255,A=255)
|
||||
WinTop=0.000000
|
||||
WinLeft=0.500000
|
||||
WinWidth=0.250000
|
||||
WinHeight=1.000000
|
||||
bBoundToParent=true
|
||||
bScaleToParent=true
|
||||
End Object
|
||||
Controls(1)=GUILabel'ItemPrice'
|
||||
|
||||
Begin Object Class=GUIInvButton Name=BuyButton
|
||||
Caption="Buy"
|
||||
FontScale=FNS_Small
|
||||
WinTop=0.000000
|
||||
WinLeft=0.750000
|
||||
WinWidth=0.250000
|
||||
WinHeight=0.800000
|
||||
bBoundToParent=true
|
||||
bScaleToParent=true
|
||||
ToolTip=none
|
||||
End Object
|
||||
Controls(2)=GUIInvButton'BuyButton'
|
||||
|
||||
/*
|
||||
Begin Object Class=GUIImage Name=Background
|
||||
Image=Texture'Engine.WhiteSquareTexture'
|
||||
ImageColor=(B=128,G=128,R=128)
|
||||
ImageStyle=ISTY_Stretched
|
||||
ImageRenderStyle=MSTY_Normal
|
||||
WinHeight=1.000000
|
||||
WinWidth=1.000000
|
||||
End Object
|
||||
BG=Background
|
||||
*/
|
||||
}
|
||||
|
||||
61
kf_sources/KFGui/Classes/GUIForSaleHeaderPanel.uc
Normal file
61
kf_sources/KFGui/Classes/GUIForSaleHeaderPanel.uc
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
//-----------------------------------------------------------
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
class GUIForSaleHeaderPanel extends GUIPanel;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
Super.Initcomponent(MyController, MyOwner);
|
||||
}
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
Begin Object Class=GUILabel Name=ItemText
|
||||
Caption="Available In Shop"
|
||||
TextAlign=TXTA_Left
|
||||
bMultiline=False
|
||||
VertAlign=TXTA_Center
|
||||
FontScale=FNS_Small
|
||||
TextColor=(R=255,G=255,B=255,A=255)
|
||||
WinTop=0.000000
|
||||
WinLeft=0.000000
|
||||
WinWidth=0.500000
|
||||
WinHeight=1.000000
|
||||
bBoundToParent=true
|
||||
bScaleToParent=true
|
||||
End Object
|
||||
Controls(0)=GUILabel'ItemText'
|
||||
|
||||
Begin Object Class=GUILabel Name=ItemPrice
|
||||
Caption="Price"
|
||||
TextAlign=TXTA_Center
|
||||
bMultiline=False
|
||||
VertAlign=TXTA_Center
|
||||
FontScale=FNS_Small
|
||||
TextColor=(R=255,G=255,B=255,A=255)
|
||||
WinTop=0.000000
|
||||
WinLeft=0.500000
|
||||
WinWidth=0.250000
|
||||
WinHeight=1.000000
|
||||
bBoundToParent=true
|
||||
bScaleToParent=true
|
||||
End Object
|
||||
Controls(1)=GUILabel'ItemPrice'
|
||||
|
||||
Begin Object Class=GUILabel Name=BuyText
|
||||
Caption="Buy"
|
||||
TextAlign=TXTA_Center
|
||||
bMultiline=False
|
||||
VertAlign=TXTA_Center
|
||||
FontScale=FNS_Small
|
||||
TextColor=(R=255,G=255,B=255,A=255)
|
||||
WinTop=0.000000
|
||||
WinLeft=0.750000
|
||||
WinWidth=0.250000
|
||||
WinHeight=1.000000
|
||||
bBoundToParent=true
|
||||
bScaleToParent=true
|
||||
End Object
|
||||
Controls(2)=GUILabel'BuyText'
|
||||
}
|
||||
|
||||
111
kf_sources/KFGui/Classes/GUIInvBodyTabPanel.uc
Normal file
111
kf_sources/KFGui/Classes/GUIInvBodyTabPanel.uc
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
//-----------------------------------------------------------
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
class GUIInvBodyTabPanel extends GUIPanel;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
Super.Initcomponent(MyController, MyOwner);
|
||||
}
|
||||
|
||||
//function InitPanel()
|
||||
//{
|
||||
// super.InitPanel();
|
||||
//}
|
||||
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
Begin Object Class=GUILabel Name=ItemName
|
||||
Caption=""
|
||||
TextAlign=TXTA_Center
|
||||
bMultiline=False
|
||||
VertAlign=TXTA_Center
|
||||
FontScale=FNS_Small
|
||||
TextColor=(R=255,G=255,B=255,A=255)
|
||||
WinTop=0.000000
|
||||
WinLeft=0.000000
|
||||
WinWidth=0.230000
|
||||
WinHeight=1.000000
|
||||
bBoundToParent=true
|
||||
bScaleToParent=true
|
||||
End Object
|
||||
Controls(0)=GUILabel'ItemName'
|
||||
|
||||
Begin Object Class=GUILabel Name=Ammo
|
||||
Caption=""
|
||||
TextAlign=TXTA_Center
|
||||
bMultiline=False
|
||||
VertAlign=TXTA_Center
|
||||
FontScale=FNS_Small
|
||||
TextColor=(R=255,G=255,B=255,A=255)
|
||||
WinTop=0.000000
|
||||
WinLeft=0.230000
|
||||
WinWidth=0.140000
|
||||
WinHeight=1.000000
|
||||
bBoundToParent=true
|
||||
bScaleToParent=true
|
||||
End Object
|
||||
Controls(1)=GUILabel'Ammo'
|
||||
|
||||
Begin Object Class=GUIInvButton Name=ClipButton
|
||||
Caption=""
|
||||
CaptionAlign=TXTA_Center
|
||||
FontScale=FNS_Small
|
||||
WinTop=0.000000
|
||||
WinLeft=0.370000
|
||||
WinWidth=0.160000
|
||||
WinHeight=0.800000
|
||||
bBoundToParent=true
|
||||
bScaleToParent=true
|
||||
bHasFocus=false
|
||||
ToolTip=none
|
||||
End Object
|
||||
Controls(2)=GUIInvButton'ClipButton'
|
||||
|
||||
Begin Object Class=GUIInvButton Name=FillButton
|
||||
Caption=""
|
||||
FontScale=FNS_Small
|
||||
WinTop=0.000000
|
||||
WinLeft=0.54000
|
||||
WinWidth=0.160000
|
||||
WinHeight=0.800000
|
||||
bBoundToParent=true
|
||||
bScaleToParent=true
|
||||
bHasFocus=false
|
||||
ToolTip=none
|
||||
End Object
|
||||
Controls(3)=GUIInvButton'FillButton'
|
||||
|
||||
Begin Object Class=GUILabel Name=ItemPrice
|
||||
Caption=""
|
||||
TextAlign=TXTA_Center
|
||||
bMultiline=False
|
||||
VertAlign=TXTA_Center
|
||||
FontScale=FNS_Small
|
||||
TextColor=(R=255,G=255,B=255,A=255)
|
||||
WinTop=0.000000
|
||||
WinLeft=0.700000
|
||||
WinWidth=0.140000
|
||||
WinHeight=1.000000
|
||||
bBoundToParent=true
|
||||
bScaleToParent=true
|
||||
End Object
|
||||
Controls(4)=GUILabel'ItemPrice'
|
||||
|
||||
Begin Object Class=GUIInvButton Name=SellButton
|
||||
Caption=""
|
||||
FontScale=FNS_Small
|
||||
WinTop=0.000000
|
||||
WinLeft=0.840000
|
||||
WinWidth=0.160000
|
||||
WinHeight=0.800000
|
||||
bBoundToParent=true
|
||||
bScaleToParent=true
|
||||
bHasFocus=false
|
||||
ToolTip=none
|
||||
End Object
|
||||
Controls(5)=GUIInvButton'SellButton'
|
||||
|
||||
}
|
||||
|
||||
16
kf_sources/KFGui/Classes/GUIInvButton.uc
Normal file
16
kf_sources/KFGui/Classes/GUIInvButton.uc
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
//-----------------------------------------------------------
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
class GUIInvButton extends GUIButton;
|
||||
|
||||
var class<Inventory> Inv;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
Super.InitComponent(MyController, MyOwner);
|
||||
}
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
bFocusOnWatch = false;
|
||||
}
|
||||
121
kf_sources/KFGui/Classes/GUIInvHeaderTabPanel.uc
Normal file
121
kf_sources/KFGui/Classes/GUIInvHeaderTabPanel.uc
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
//-----------------------------------------------------------
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
class GUIInvHeaderTabPanel extends GUIPanel;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
Super.Initcomponent(MyController, MyOwner);
|
||||
}
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
Begin Object Class=GUILabel Name=InventoryText
|
||||
Caption="Inventory"
|
||||
TextAlign=TXTA_Left
|
||||
bMultiline=False
|
||||
VertAlign=TXTA_Center
|
||||
FontScale=FNS_Small
|
||||
//TextFont="UT2MediumFont"
|
||||
TextColor=(R=255,G=255,B=255,A=255)
|
||||
WinTop=0.000000
|
||||
WinLeft=0.000000
|
||||
WinWidth=0.230000
|
||||
WinHeight=1.000000
|
||||
bBoundToParent=true
|
||||
bScaleToParent=true
|
||||
//WinHeight=0.070000
|
||||
End Object
|
||||
Controls(0)=GUILabel'InventoryText'
|
||||
|
||||
Begin Object Class=GUILabel Name=AmmoText
|
||||
Caption="Ammo"
|
||||
TextAlign=TXTA_Center
|
||||
bMultiline=False
|
||||
VertAlign=TXTA_Center
|
||||
FontScale=FNS_Small
|
||||
//TextFont="UT2MediumFont"
|
||||
TextColor=(R=255,G=255,B=255,A=255)
|
||||
WinTop=0.000000
|
||||
WinLeft=0.230000
|
||||
WinWidth=0.140000
|
||||
WinHeight=1.000000
|
||||
bBoundToParent=true
|
||||
bScaleToParent=true
|
||||
//WinHeight=0.070000
|
||||
End Object
|
||||
Controls(1)=GUILabel'AmmoText'
|
||||
|
||||
Begin Object Class=GUILabel Name=ClipText
|
||||
Caption="Buy Clip"
|
||||
TextAlign=TXTA_Center
|
||||
bMultiline=False
|
||||
VertAlign=TXTA_Center
|
||||
FontScale=FNS_Small
|
||||
//TextFont="UT2MediumFont"
|
||||
TextColor=(R=255,G=255,B=255,A=255)
|
||||
WinTop=0.000000
|
||||
WinLeft=0.370000
|
||||
WinWidth=0.160000
|
||||
WinHeight=1.000000
|
||||
bBoundToParent=true
|
||||
bScaleToParent=true
|
||||
//WinHeight=0.070000
|
||||
End Object
|
||||
Controls(2)=GUILabel'ClipText'
|
||||
|
||||
Begin Object Class=GUILabel Name=FillText
|
||||
Caption="Fill Up"
|
||||
TextAlign=TXTA_Center
|
||||
bMultiline=False
|
||||
VertAlign=TXTA_Center
|
||||
FontScale=FNS_Small
|
||||
//TextFont="UT2MediumFont"
|
||||
TextColor=(R=255,G=255,B=255,A=255)
|
||||
WinTop=0.000000
|
||||
WinLeft=0.54000
|
||||
WinWidth=0.160000
|
||||
WinHeight=1.000000
|
||||
bBoundToParent=true
|
||||
bScaleToParent=true
|
||||
//WinHeight=0.070000
|
||||
End Object
|
||||
Controls(3)=GUILabel'FillText'
|
||||
|
||||
Begin Object Class=GUILabel Name=PriceText
|
||||
Caption="Price"
|
||||
TextAlign=TXTA_Center
|
||||
bMultiline=False
|
||||
VertAlign=TXTA_Center
|
||||
FontScale=FNS_Small
|
||||
//TextFont="UT2MediumFont"
|
||||
TextColor=(R=255,G=255,B=255,A=255)
|
||||
WinTop=0.000000
|
||||
WinLeft=0.700000
|
||||
WinWidth=0.140000
|
||||
WinHeight=1.000000
|
||||
bBoundToParent=true
|
||||
bScaleToParent=true
|
||||
//WinHeight=0.070000
|
||||
End Object
|
||||
Controls(4)=GUILabel'PriceText'
|
||||
|
||||
Begin Object Class=GUILabel Name=SellText
|
||||
Caption="Sell"
|
||||
TextAlign=TXTA_Center
|
||||
bMultiline=False
|
||||
VertAlign=TXTA_Center
|
||||
FontScale=FNS_Small
|
||||
//TextFont="UT2MediumFont"
|
||||
TextColor=(R=255,G=255,B=255,A=255)
|
||||
WinTop=0.000000
|
||||
WinLeft=0.840000
|
||||
WinWidth=0.160000
|
||||
WinHeight=1.000000
|
||||
bBoundToParent=true
|
||||
bScaleToParent=true
|
||||
//WinHeight=0.070000
|
||||
End Object
|
||||
Controls(5)=GUILabel'SellText'
|
||||
}
|
||||
|
||||
18
kf_sources/KFGui/Classes/GUILibInfoPanel.uc
Normal file
18
kf_sources/KFGui/Classes/GUILibInfoPanel.uc
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
class GUILibInfoPanel extends GUIPanel;
|
||||
|
||||
var automated GUIImage i_back;
|
||||
|
||||
function Display(GUIShowable item);
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
/* Begin Object Class=GUIImage Name=Background
|
||||
Image=Texture'Engine.WhiteSquareTexture'
|
||||
ImageColor=(B=0,G=0,R=0)
|
||||
ImageStyle=ISTY_Stretched
|
||||
ImageRenderStyle=MSTY_Normal
|
||||
WinHeight=1.000000
|
||||
End Object
|
||||
i_back=GUIImage'KFGui.GUIBuyInfoPanel.Background'
|
||||
*/
|
||||
}
|
||||
32
kf_sources/KFGui/Classes/GUILibraryItemsBox.uc
Normal file
32
kf_sources/KFGui/Classes/GUILibraryItemsBox.uc
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
class GUILibraryItemsBox extends GUIListBoxBase;
|
||||
|
||||
var GUIShowLibList List;
|
||||
|
||||
function InitComponent( GUIController MyController, GUIComponent MyOwner )
|
||||
{
|
||||
Super.InitComponent(MyController,MyOwner);
|
||||
|
||||
if (DefaultListClass != "")
|
||||
{
|
||||
List = GUIShowLibList(AddComponent(DefaultListClass));
|
||||
if (List == None)
|
||||
{
|
||||
log(Class$".InitComponent - Could not create default list ["$DefaultListClass$"]");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (List == None)
|
||||
{
|
||||
Warn("Could not initialize list!");
|
||||
return;
|
||||
}
|
||||
InitBaseList(List);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
SectionStyleName="ItemBoxInfo"
|
||||
DefaultListClass="KFGUI.GUIShowLibList"
|
||||
}
|
||||
287
kf_sources/KFGui/Classes/GUILibraryMenu.uc
Normal file
287
kf_sources/KFGui/Classes/GUILibraryMenu.uc
Normal file
|
|
@ -0,0 +1,287 @@
|
|||
class GUILibraryMenu extends UT2k4MainPage;
|
||||
const LIBLIST_CATS=3;
|
||||
var automated GUIPanel p_Info;
|
||||
var automated GUIListBox CategoryBox;
|
||||
var automated GUILibraryItemsBox ItemsBox;
|
||||
var automated GUISectionBackground CategoryBG,ItemBG,InfoBG;
|
||||
var GUIList myCategories;
|
||||
var GUIShowLibList myItems;
|
||||
|
||||
var GUILabel TimerBox;
|
||||
//var KFBuyItemsList myItems;
|
||||
var editconst noexport float SavedPitch;
|
||||
|
||||
var array<string> BuyListHeaders;
|
||||
var array<string> BuyListItemNames;
|
||||
|
||||
//Use these values to modify/test
|
||||
var int playerscore;
|
||||
var float playerweight;
|
||||
var float maxweight;
|
||||
var float GameDifficulty;
|
||||
|
||||
var Sound SellSound,BuySound;
|
||||
|
||||
|
||||
var array < GUIShowable > AllBuyableItems;
|
||||
|
||||
function InitComponent( GUIController MyController, GUIComponent MyOwner )
|
||||
{
|
||||
local int i;
|
||||
Super.InitComponent( MyController, MyOwner );
|
||||
|
||||
|
||||
CategoryBG.ManageComponent(CategoryBox);
|
||||
ItemBG.ManageComponent(ItemsBox);
|
||||
myCategories = CategoryBox.List;
|
||||
|
||||
for(i=0;i<LIBLIST_CATS;i++)
|
||||
myCategories.Add(KFPlayerController(PlayerOwner()).LibraryListHeaders[i]);
|
||||
|
||||
//myCategories = CategoryBox.List;
|
||||
myItems = ItemsBox.List;
|
||||
}
|
||||
|
||||
event HandleParameters(string Param1, string Param2)
|
||||
{
|
||||
CategoryChange(self);
|
||||
}
|
||||
|
||||
function KFBuyMenuClosed(optional Bool bCanceled)
|
||||
{
|
||||
local rotator NewRot;
|
||||
|
||||
// Reset player
|
||||
NewRot = PlayerOwner().Rotation;
|
||||
NewRot.Pitch = SavedPitch;
|
||||
PlayerOwner().SetRotation(NewRot);
|
||||
Super.OnClose(bCanceled);
|
||||
}
|
||||
|
||||
event Opened(GUIComponent Sender)
|
||||
{
|
||||
local rotator PlayerRot;
|
||||
|
||||
Super.Opened(Sender);
|
||||
// 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);
|
||||
playerscore = PlayerOwner().PlayerReplicationInfo.Score;
|
||||
|
||||
//Indicate that we're buying things.
|
||||
//KFPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo).bBuyingStuff = true;
|
||||
}
|
||||
|
||||
function NewInfo(GUIShowable b)
|
||||
{
|
||||
if(p_Info != None)
|
||||
{
|
||||
RemoveComponent(p_Info,true);
|
||||
InfoBG.UnmanageComponent(p_Info);
|
||||
p_Info.Closed(p_Info,false);
|
||||
p_Info.free();
|
||||
p_Info = None;
|
||||
}
|
||||
if(b != None)
|
||||
{
|
||||
p_Info = new b.GetPanelType(eLibCat(myCategories.Index));;
|
||||
// GUILibraryMenuFooter(t_Footer).SetBuyMode(b.GetBuyCaption(eLibCat(myCategories.Index)),CanAfford(b)&&b.CanButtonMe(PlayerOwner(),myCategories.Index != 0),b.IsA('BuyableAmmo') && myCategories.Index !=0,b.Isa('BuyableAmmo') );
|
||||
} else
|
||||
{
|
||||
p_Info = new class'GUILibInfoPanel';
|
||||
GUILibraryMenuFooter(t_Footer).SetBuyMode("Buy",false,false,false);
|
||||
}
|
||||
p_Info.WinLeft=0;
|
||||
p_Info.WinTop=0;
|
||||
p_Info.WinWidth=1;
|
||||
p_Info.WinHeight=1;
|
||||
AppendComponent(p_Info,true);
|
||||
InfoBG.ManageComponent(p_Info);
|
||||
if(p_Info.IsA('GUILibInfoPanel'))
|
||||
GUILibInfoPanel(p_Info).Display(b);
|
||||
}
|
||||
|
||||
function bool CanAfford(GUIShowable b)
|
||||
{
|
||||
return myCategories.Index == 0 || (playerscore-b.cost >=0 && playerweight+b.weight <= maxweight);
|
||||
}
|
||||
|
||||
function CategoryChange(GUIComponent Sender)
|
||||
{
|
||||
local int i,j;
|
||||
|
||||
myItems.Clear();
|
||||
i = myCategories.Index;
|
||||
|
||||
for(j=0;j<allBuyableItems.length;j++)
|
||||
{
|
||||
if(AllBuyableItems[j].ShowMe(PlayerOwner().Pawn,eLibCat(i),self))
|
||||
myItems.Add(AllBuyableItems[j]);
|
||||
}
|
||||
myItems.OnChange(myItems);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function BuyCurrent()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function BuyFill()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function bool CanAutoAmmo()
|
||||
{
|
||||
Return False;
|
||||
}
|
||||
|
||||
function DoAutoAmmo()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function GUIShowable FindWeapon(class<Inventory> WeaponType)
|
||||
{
|
||||
Return None;
|
||||
}
|
||||
|
||||
function InitAmmoForNewGun(class<Inventory> WeaponType)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function CloseSale(bool savePurchases)
|
||||
{
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Begin Object Class=GUIListBox Name=BoxForCategories
|
||||
bVisibleWhenEmpty=True
|
||||
OnCreateComponent=BoxForCategories.InternalOnCreateComponent
|
||||
Hint="Choose among these categories of equipment."
|
||||
WinTop=0.110215
|
||||
WinLeft=0.020000
|
||||
WinWidth=0.400000
|
||||
WinHeight=0.500000
|
||||
TabOrder=1
|
||||
bBoundToParent=True
|
||||
bScaleToParent=True
|
||||
OnChange=GUILibraryMenu.CategoryChange
|
||||
End Object
|
||||
CategoryBox=GUIListBox'KFGui.GUILibraryMenu.BoxForCategories'
|
||||
|
||||
Begin Object Class=GUILibraryItemsBox Name=itmbox
|
||||
bVisibleWhenEmpty=True
|
||||
bSorted=True
|
||||
OnCreateComponent=itmbox.InternalOnCreateComponent
|
||||
Hint="Equipment in this category"
|
||||
WinHeight=1.000000
|
||||
TabOrder=1
|
||||
bBoundToParent=True
|
||||
bScaleToParent=True
|
||||
End Object
|
||||
ItemsBox=GUILibraryItemsBox'KFGui.GUILibraryMenu.itmbox'
|
||||
|
||||
Begin Object Class=AltSectionBackground Name=catbg
|
||||
Caption="Categories"
|
||||
WinTop=0.060215
|
||||
WinLeft=0.010000
|
||||
WinWidth=0.440000
|
||||
WinHeight=0.383940
|
||||
OnPreDraw=catbg.InternalPreDraw
|
||||
End Object
|
||||
CategoryBG=AltSectionBackground'KFGui.GUILibraryMenu.catbg'
|
||||
|
||||
Begin Object Class=AltSectionBackground Name=itmbg
|
||||
Caption="Items"
|
||||
WinTop=0.060215
|
||||
WinLeft=0.480000
|
||||
WinWidth=0.500000
|
||||
WinHeight=0.880000
|
||||
OnPreDraw=itmbg.InternalPreDraw
|
||||
End Object
|
||||
ItemBG=AltSectionBackground'KFGui.GUILibraryMenu.itmbg'
|
||||
|
||||
Begin Object Class=AltSectionBackground Name=infbg
|
||||
Caption="Info"
|
||||
WinTop=0.454030
|
||||
WinLeft=0.010000
|
||||
WinWidth=0.440000
|
||||
WinHeight=0.486185
|
||||
OnPreDraw=infbg.InternalPreDraw
|
||||
End Object
|
||||
InfoBG=AltSectionBackground'KFGui.GUILibraryMenu.infbg'
|
||||
|
||||
Begin Object Class=GUITabControl Name=PageTabs
|
||||
bDockPanels=True
|
||||
TabHeight=0.040000
|
||||
WinLeft=0.010000
|
||||
WinWidth=0.980000
|
||||
WinHeight=0.040000
|
||||
RenderWeight=0.490000
|
||||
TabOrder=3
|
||||
bAcceptsInput=True
|
||||
OnActivate=PageTabs.InternalOnActivate
|
||||
End Object
|
||||
c_Tabs=GUITabControl'KFGui.GUILibraryMenu.PageTabs'
|
||||
|
||||
/*
|
||||
Begin Object Class=GUIHeader Name=GamePageHeader
|
||||
Caption="Buy Equipment"
|
||||
RenderWeight=0.300000
|
||||
End Object
|
||||
t_Header=GUIHeader'KFGui.GUILibraryMenu.GamePageHeader'
|
||||
*/
|
||||
|
||||
Begin Object Class=GUILibraryMenuFooter Name=LibFooter
|
||||
WinTop=0.957943
|
||||
RenderWeight=0.300000
|
||||
TabOrder=8
|
||||
OnPreDraw=BuyFooter.InternalOnPreDraw
|
||||
End Object
|
||||
t_Footer=GUILibraryMenuFooter'KFGui.GUILibraryMenu.LibFooter'
|
||||
|
||||
Begin Object Class=BackgroundImage Name=KFBackground
|
||||
Image=Texture'2K4Menus.Controls.LockerBG'
|
||||
ImageStyle=ISTY_Tiled
|
||||
RenderWeight=0.010000
|
||||
bBoundToParent=True
|
||||
bScaleToParent=True
|
||||
End Object
|
||||
i_Background=BackgroundImage'KFGui.GUILibraryMenu.KFBackground'
|
||||
|
||||
Begin Object Class=GUILabel Name=TimerTextBox
|
||||
|
||||
//OnCreateComponent=lbChat.InternalOnCreateComponent
|
||||
FontScale=FNS_Medium
|
||||
WinTop=0.25
|
||||
WinLeft=0.10000
|
||||
WinWidth=0.2
|
||||
WinHeight=0.2
|
||||
//bBoundToParent=True
|
||||
//bScaleToParent=True
|
||||
bNeverFocus=True
|
||||
Caption="SHOP CLOSES IN: "
|
||||
//StyleName="none"
|
||||
End Object
|
||||
TimerBox=GUILabel'KFGui.GUILibraryMenu.TimerTextBox'
|
||||
|
||||
bAllowedAsLast=True
|
||||
// OnClose=GUILibraryMenu.KFBuyMenuClosed
|
||||
|
||||
SellSound=Sound'KF_InventorySnd.Cash_Pickup'
|
||||
BuySound = Sound 'PatchSounds.slide1-5'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
329
kf_sources/KFGui/Classes/GUILibraryMenuFooter.uc
Normal file
329
kf_sources/KFGui/Classes/GUILibraryMenuFooter.uc
Normal file
|
|
@ -0,0 +1,329 @@
|
|||
class GUILibraryMenuFooter extends ButtonFooter;
|
||||
|
||||
var automated GUIButton b_Buy,b_Cancel,b_Complete,b_AutoAll,b_Fill;
|
||||
var automated GUIButton spacer1,spacer2;
|
||||
var automated GUILabel l_score,l_weight;
|
||||
|
||||
function PositionButtons (Canvas C)
|
||||
{
|
||||
local int i;
|
||||
local GUIButton b;
|
||||
local float x;
|
||||
|
||||
for ( i = 0; i < Controls.Length; i++ )
|
||||
{
|
||||
b = GUIButton(Controls[i]);
|
||||
if ( b != None)
|
||||
{
|
||||
if ( x == 0 )
|
||||
x = ButtonLeft;
|
||||
else x += GetSpacer();
|
||||
b.WinLeft = b.RelativeLeft( x, True );
|
||||
x += b.ActualWidth();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function SetPlayerStats(int score, float weight)
|
||||
{
|
||||
l_score.Caption = "Cash:"@score;
|
||||
l_weight.Caption = "Weight:"@weight;
|
||||
}
|
||||
|
||||
function SetBuyMode(string buyCaption,bool buyEnabled,bool fillVisible,bool fillEnabled)
|
||||
{
|
||||
local bool AutoAmmoEnabled;
|
||||
AutoAmmoEnabled = GUILibraryMenu(PageOwner).CanAutoAmmo();
|
||||
b_buy.Caption = buyCaption;
|
||||
if(buyEnabled && b_buy.MenuState == MSAT_Disabled)
|
||||
{
|
||||
b_buy.MenuState = MSAT_Blurry; // GUILibraryMenu(PageOwner).ItemsBox.List.Elements[GUILibraryMenu(PageOwner).ItemsBox.List.Index] //
|
||||
// GUILibraryMenu(PageOwner).ItemsBox.List.MenuState = MSAT_Blurry;
|
||||
}
|
||||
else if(!buyEnabled)
|
||||
{
|
||||
b_buy.MenuState = MSAT_Disabled;
|
||||
// GUILibraryMenu(PageOwner).ItemsBox.List.MenuState = MSAT_Disabled;
|
||||
}
|
||||
|
||||
if(fillEnabled && b_fill.MenuState == MSAT_Disabled)
|
||||
b_fill.MenuState = MSAT_Blurry;
|
||||
else if(!fillEnabled)
|
||||
b_fill.MenuState = MSAT_Disabled;
|
||||
b_fill.bVisible = fillVisible;
|
||||
|
||||
if(AutoAmmoEnabled && b_AutoAll.MenuState == MSAT_Disabled)
|
||||
b_AutoAll.MenuState = MSAT_Blurry;
|
||||
else if(!AutoAmmoEnabled)
|
||||
b_AutoAll.MenuState = MSAT_Disabled;
|
||||
}
|
||||
|
||||
function bool ButtonsSized(Canvas C)
|
||||
{
|
||||
local int i;
|
||||
local GUIButton b;
|
||||
local bool bResult;
|
||||
local string str;
|
||||
local float T, AH, AT;
|
||||
|
||||
if ( !bPositioned )
|
||||
return false;
|
||||
|
||||
bResult = true;
|
||||
str = GetLongestCaption(C);
|
||||
|
||||
AH = ActualHeight();
|
||||
AT = ActualTop();
|
||||
|
||||
for (i = 0; i < Controls.Length; i++ )
|
||||
{
|
||||
b = GUIButton(Controls[i]);
|
||||
if ( b != None )
|
||||
{
|
||||
if ( bAutoSize && bFixedWidth )
|
||||
{
|
||||
if(b.Caption == "")
|
||||
b.SizingCaption = Left(str,Len(str)/2);
|
||||
else
|
||||
b.SizingCaption = str;
|
||||
}
|
||||
else b.SizingCaption = "";
|
||||
|
||||
bResult = bResult && b.bPositioned;
|
||||
if ( bFullHeight )
|
||||
b.WinHeight = b.RelativeHeight(AH,true);
|
||||
else b.WinHeight = b.RelativeHeight(ActualHeight(ButtonHeight),true);
|
||||
|
||||
switch ( Justification )
|
||||
{
|
||||
case TXTA_Left:
|
||||
T = ClientBounds[1];
|
||||
break;
|
||||
|
||||
case TXTA_Center:
|
||||
T = (AT + AH / 2) - (b.ActualHeight() / 2);
|
||||
break;
|
||||
|
||||
case TXTA_Right:
|
||||
T = ClientBounds[3] - b.ActualHeight();
|
||||
break;
|
||||
}
|
||||
|
||||
// b.WinTop = b.RelativeTop(T, True );
|
||||
b.WinTop = b.RelativeTop(T, true ) + ((WinHeight - ButtonHeight) / 2);
|
||||
}
|
||||
}
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
function float GetButtonLeft()
|
||||
{
|
||||
local int i;
|
||||
local GUIButton b;
|
||||
local float TotalWidth, AW, AL;
|
||||
local float FooterMargin;
|
||||
|
||||
AL = ActualLeft();
|
||||
AW = ActualWidth();
|
||||
FooterMargin = GetMargin();
|
||||
|
||||
for (i = 0; i < Controls.Length; i++ )
|
||||
{
|
||||
b = GUIButton(Controls[i]);
|
||||
if ( b != None )
|
||||
{
|
||||
if ( TotalWidth > 0 )
|
||||
TotalWidth += GetSpacer();
|
||||
|
||||
TotalWidth += b.ActualWidth();
|
||||
}
|
||||
}
|
||||
|
||||
if ( Alignment == TXTA_Center )
|
||||
return (AL + AW) / 2 - FooterMargin / 2 - TotalWidth / 2;
|
||||
|
||||
if ( Alignment == TXTA_Right )
|
||||
return (AL + AW - FooterMargin / 2) - TotalWidth;
|
||||
|
||||
return AL + (FooterMargin / 2);
|
||||
}
|
||||
|
||||
// Finds the longest caption of all the buttons
|
||||
function string GetLongestCaption(Canvas C)
|
||||
{
|
||||
local int i;
|
||||
local float XL, YL, LongestW;
|
||||
local string str;
|
||||
local GUIButton b;
|
||||
|
||||
if ( C == None )
|
||||
return "";
|
||||
|
||||
for ( i = 0; i < Controls.Length; i++ )
|
||||
{
|
||||
b = GUIButton(Controls[i]);
|
||||
if ( b != None )
|
||||
{
|
||||
if ( b.Style != None )
|
||||
b.Style.TextSize(C, b.MenuState, b.Caption, XL, YL, b.FontScale);
|
||||
else C.StrLen( b.Caption, XL, YL );
|
||||
|
||||
if ( LongestW == 0 || XL > LongestW )
|
||||
{
|
||||
str = b.Caption;
|
||||
LongestW = XL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
function bool OnFooterClick(GUIComponent Sender)
|
||||
{
|
||||
if(Sender == b_Complete)
|
||||
{
|
||||
GUILibraryMenu(PageOwner).CloseSale(true);
|
||||
} else if(Sender == b_Cancel)
|
||||
{
|
||||
GUILibraryMenu(PageOwner).CloseSale(false);
|
||||
} else if(Sender == b_Buy)
|
||||
{
|
||||
GUILibraryMenu(PageOwner).BuyCurrent();
|
||||
} else if(Sender == b_Fill)
|
||||
{
|
||||
GUILibraryMenu(PageOwner).BuyFill();
|
||||
} else if(Sender == b_AutoAll)
|
||||
{
|
||||
GUILibraryMenu(PageOwner).DoAutoAmmo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Begin Object Class=GUIButton Name=Purchase
|
||||
Caption="Buy"
|
||||
StyleName="FooterButton"
|
||||
Hint="Buy currently selected weapon"
|
||||
WinTop=0.966146
|
||||
WinLeft=0.280000
|
||||
WinWidth=0.120000
|
||||
WinHeight=0.033203
|
||||
RenderWeight=2.000000
|
||||
TabOrder=3
|
||||
bBoundToParent=True
|
||||
OnClick=GUILibraryMenuFooter.OnFooterClick
|
||||
OnKeyEvent=Purchase.InternalOnKeyEvent
|
||||
End Object
|
||||
b_Buy=GUIButton'KFGui.GUILibraryMenuFooter.Purchase'
|
||||
|
||||
Begin Object Class=GUIButton Name=Cancel
|
||||
Caption="Cancel"
|
||||
StyleName="FooterButton"
|
||||
Hint="Don't buy these weapons."
|
||||
WinTop=0.966146
|
||||
WinLeft=0.350000
|
||||
WinWidth=0.120000
|
||||
WinHeight=0.033203
|
||||
RenderWeight=2.000000
|
||||
TabOrder=5
|
||||
bBoundToParent=True
|
||||
OnClick=GUILibraryMenuFooter.OnFooterClick
|
||||
OnKeyEvent=Cancel.InternalOnKeyEvent
|
||||
End Object
|
||||
b_Cancel=GUIButton'KFGui.GUILibraryMenuFooter.Cancel'
|
||||
|
||||
Begin Object Class=GUIButton Name=Complete
|
||||
Caption="Complete"
|
||||
StyleName="FooterButton"
|
||||
Hint="Purchase weapons and save changes."
|
||||
WinTop=0.966146
|
||||
WinLeft=0.380000
|
||||
WinWidth=0.120000
|
||||
WinHeight=0.033203
|
||||
RenderWeight=2.000000
|
||||
TabOrder=6
|
||||
bBoundToParent=True
|
||||
OnClick=GUILibraryMenuFooter.OnFooterClick
|
||||
OnKeyEvent=Complete.InternalOnKeyEvent
|
||||
End Object
|
||||
b_Complete=GUIButton'KFGui.GUILibraryMenuFooter.Complete'
|
||||
|
||||
Begin Object Class=GUIButton Name=AutoAmmo
|
||||
Caption="AutoAmmo"
|
||||
StyleName="FooterButton"
|
||||
Hint="Fill ammo for all weapons."
|
||||
WinTop=0.966146
|
||||
WinLeft=0.200000
|
||||
WinWidth=0.120000
|
||||
RenderWeight=2.000000
|
||||
TabOrder=0
|
||||
bBoundToParent=True
|
||||
OnClick=GUILibraryMenuFooter.OnFooterClick
|
||||
OnKeyEvent=AutoAmmo.InternalOnKeyEvent
|
||||
End Object
|
||||
b_AutoAll=GUIButton'KFGui.GUILibraryMenuFooter.AutoAmmo'
|
||||
|
||||
Begin Object Class=GUIButton Name=Fill
|
||||
Caption="Fill Up"
|
||||
StyleName="FooterButton"
|
||||
Hint="Fill up on currently selected ammo."
|
||||
WinTop=0.966146
|
||||
WinLeft=0.250000
|
||||
WinWidth=0.120000
|
||||
RenderWeight=2.000000
|
||||
TabOrder=2
|
||||
bBoundToParent=True
|
||||
bVisible=False
|
||||
OnClick=GUILibraryMenuFooter.OnFooterClick
|
||||
OnKeyEvent=Fill.InternalOnKeyEvent
|
||||
End Object
|
||||
b_Fill=GUIButton'KFGui.GUILibraryMenuFooter.Fill'
|
||||
|
||||
Begin Object Class=GUIButton Name=sp
|
||||
StyleName="Footerbutton"
|
||||
WinTop=0.966146
|
||||
WinLeft=0.220000
|
||||
WinWidth=0.120000
|
||||
RenderWeight=2.000000
|
||||
TabOrder=1
|
||||
bBoundToParent=True
|
||||
bVisible=False
|
||||
OnKeyEvent=sp.InternalOnKeyEvent
|
||||
End Object
|
||||
spacer1=GUIButton'KFGui.GUILibraryMenuFooter.sp'
|
||||
|
||||
Begin Object Class=GUIButton Name=sp2
|
||||
StyleName="Footerbutton"
|
||||
WinTop=0.966146
|
||||
WinLeft=0.330000
|
||||
WinWidth=0.120000
|
||||
RenderWeight=2.000000
|
||||
TabOrder=4
|
||||
bBoundToParent=True
|
||||
bVisible=False
|
||||
OnKeyEvent=sp2.InternalOnKeyEvent
|
||||
End Object
|
||||
spacer2=GUIButton'KFGui.GUILibraryMenuFooter.sp2'
|
||||
|
||||
Begin Object Class=GUILabel Name=PlayerScore
|
||||
Caption="Cash: 0"
|
||||
StyleName="FooterButton"
|
||||
WinTop=0.966146
|
||||
WinLeft=0.010000
|
||||
WinHeight=0.033203
|
||||
End Object
|
||||
l_score=GUILabel'KFGui.GUILibraryMenuFooter.PlayerScore'
|
||||
|
||||
Begin Object Class=GUILabel Name=playerweight
|
||||
Caption="Weight: 0.0"
|
||||
StyleName="FooterButton"
|
||||
WinTop=0.966146
|
||||
WinLeft=0.130000
|
||||
WinHeight=0.033203
|
||||
End Object
|
||||
l_weight=GUILabel'KFGui.GUILibraryMenuFooter.playerweight'
|
||||
|
||||
}
|
||||
11
kf_sources/KFGui/Classes/GUISaleLabel.uc
Normal file
11
kf_sources/KFGui/Classes/GUISaleLabel.uc
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
//-----------------------------------------------------------
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
class GUISaleLabel extends GUILabel;
|
||||
|
||||
var() GUIBuyable SaleItemInfo;
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
FocusedTextColor=(B=0,G=255,R=255)
|
||||
}
|
||||
121
kf_sources/KFGui/Classes/GUISelectClassList.uc
Normal file
121
kf_sources/KFGui/Classes/GUISelectClassList.uc
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
class GUISelectClassList extends GUIVertList;
|
||||
|
||||
var array< GUIClassSelectable > Elements;
|
||||
|
||||
event InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
OnDrawItem=DrawBuyItem;
|
||||
Super.InitComponent(MyController,MyOwner);
|
||||
}
|
||||
|
||||
function Clear()
|
||||
{
|
||||
if (Elements.Length == 0)
|
||||
return;
|
||||
|
||||
Elements.Remove(0,Elements.Length);
|
||||
ItemCount = 0;
|
||||
IndexChanged(self);
|
||||
Super.Clear();
|
||||
}
|
||||
|
||||
function Add(GUIClassSelectable Item)
|
||||
{
|
||||
local int NewIndex,PointValue,ComparePointValue;
|
||||
|
||||
PointValue=Item.cost;
|
||||
|
||||
|
||||
if (Elements.Length > 0)
|
||||
{
|
||||
while (NewIndex < Elements.Length)
|
||||
{
|
||||
ComparePointValue=Elements[NewIndex].cost;
|
||||
if(ComparePointValue >= PointValue)
|
||||
break;
|
||||
NewIndex++;
|
||||
}
|
||||
}
|
||||
else NewIndex = Elements.Length;
|
||||
|
||||
Elements.Insert(NewIndex, 1);
|
||||
Elements[NewIndex] = Item;
|
||||
|
||||
ItemCount = Elements.Length;
|
||||
|
||||
if (NewIndex == 0)
|
||||
SetIndex(0);
|
||||
else if ( bNotify )
|
||||
CheckLinkedObjects(Self);
|
||||
|
||||
if (MyScrollBar != None)
|
||||
MyScrollBar.AlignThumb();
|
||||
|
||||
}
|
||||
|
||||
function string GetItemAtIndex( int idx )
|
||||
{
|
||||
return Elements[idx].ItemName;
|
||||
}
|
||||
|
||||
function SelectNewItem(GUIComponent Sender)
|
||||
{
|
||||
if(GUIClassMenu(PageOwner) == None)
|
||||
return;
|
||||
if(Elements.Length <= 0)
|
||||
GUIClassMenu(PageOwner).NewInfo(None);
|
||||
else
|
||||
GUIClassMenu(PageOwner).NewInfo(Elements[Index]);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function DrawBuyItem(Canvas c, int Item, float X, float Y, float W, float HT, bool bSelected, bool bPending)
|
||||
{
|
||||
local string tString;
|
||||
local float Iheight,Itop,Ileft,Iwidth;
|
||||
local eMenuState drawState;
|
||||
|
||||
if(!bSelected)
|
||||
drawState = MSAT_Blurry;
|
||||
else
|
||||
drawState = MSAT_Watched;
|
||||
|
||||
Iheight = HT*0.808917;
|
||||
Itop = Y+(HT-Iheight)/2;
|
||||
Ileft = X;
|
||||
Iwidth = W;
|
||||
|
||||
SectionStyle.Draw(c,drawState,Ileft,Itop,Iwidth,Iheight);
|
||||
|
||||
Ileft = X*1.05;
|
||||
Iwidth = W-((ILeft-X)*2);
|
||||
|
||||
//Draw our nickname
|
||||
tString = GetItemAtIndex(Item);
|
||||
SectionStyle.DrawText(c,MSAT_Blurry,Ileft,Itop,Iwidth,(Iheight/2),TXTA_Center,tString,FNS_Medium);
|
||||
|
||||
//Draw cost string
|
||||
tString = "Cost:"@Elements[Item].cost;
|
||||
SectionStyle.DrawText(c,MSAT_Blurry,Ileft,Itop+(Iheight/2),Iwidth,Iheight/2,TXTA_Left,tString,FNS_Medium);
|
||||
|
||||
//Draw Weight string
|
||||
tString = "Weight:"@Elements[item].weight;
|
||||
SectionStyle.DrawText(c,MSAT_Blurry,Ileft,Itop+(Iheight/2),Iwidth,Iheight/2,TXTA_Right,tString,FNS_Medium);
|
||||
}
|
||||
|
||||
function float BuyItemHeight(Canvas c)
|
||||
{
|
||||
if(GUIBuyItemsBox(MenuOwner) != None)
|
||||
return MenuOwner.ActualHeight() * 0.25;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
GetItemHeight=GUISelectClassList.BuyItemHeight
|
||||
StyleName="ItemBoxInfo"
|
||||
OnChange=GUISelectClassList.SelectNewItem
|
||||
}
|
||||
32
kf_sources/KFGui/Classes/GUISelectClassesBox.uc
Normal file
32
kf_sources/KFGui/Classes/GUISelectClassesBox.uc
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
class GUISelectClassesBox extends GUIListBoxBase;
|
||||
|
||||
var GUISelectClassList List;
|
||||
|
||||
function InitComponent( GUIController MyController, GUIComponent MyOwner )
|
||||
{
|
||||
Super.InitComponent(MyController,MyOwner);
|
||||
|
||||
if (DefaultListClass != "")
|
||||
{
|
||||
List = GUISelectClassList(AddComponent(DefaultListClass));
|
||||
if (List == None)
|
||||
{
|
||||
log(Class$".InitComponent - Could not create default list ["$DefaultListClass$"]");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (List == None)
|
||||
{
|
||||
Warn("Could not initialize list!");
|
||||
return;
|
||||
}
|
||||
InitBaseList(List);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
SectionStyleName="ItemBoxInfo"
|
||||
DefaultListClass="KFGUI.GUISelectClassList"
|
||||
}
|
||||
155
kf_sources/KFGui/Classes/GUIShowLibList.uc
Normal file
155
kf_sources/KFGui/Classes/GUIShowLibList.uc
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
class GUIShowLibList extends GUIVertList;
|
||||
|
||||
var array< GUIShowable > Elements;
|
||||
|
||||
|
||||
event InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
OnDrawItem=DrawBuyItem;
|
||||
Super.InitComponent(MyController,MyOwner);
|
||||
}
|
||||
|
||||
function Clear()
|
||||
{
|
||||
if (Elements.Length == 0)
|
||||
return;
|
||||
|
||||
Elements.Remove(0,Elements.Length);
|
||||
ItemCount = 0;
|
||||
IndexChanged(self);
|
||||
Super.Clear();
|
||||
}
|
||||
|
||||
function Add(GUIshowable Item)
|
||||
{
|
||||
local int NewIndex,PointValue,ComparePointValue;
|
||||
|
||||
PointValue=Item.cost;
|
||||
|
||||
|
||||
if (Elements.Length > 0)
|
||||
{
|
||||
while (NewIndex < Elements.Length)
|
||||
{
|
||||
ComparePointValue=Elements[NewIndex].cost;
|
||||
if(ComparePointValue >= PointValue)
|
||||
break;
|
||||
NewIndex++;
|
||||
}
|
||||
}
|
||||
else NewIndex = Elements.Length;
|
||||
|
||||
Elements.Insert(NewIndex, 1);
|
||||
Elements[NewIndex] = Item;
|
||||
|
||||
ItemCount = Elements.Length;
|
||||
|
||||
if (NewIndex == 0)
|
||||
SetIndex(0);
|
||||
else if ( bNotify )
|
||||
CheckLinkedObjects(Self);
|
||||
|
||||
if (MyScrollBar != None)
|
||||
MyScrollBar.AlignThumb();
|
||||
|
||||
}
|
||||
|
||||
function string GetItemAtIndex( int idx )
|
||||
{
|
||||
return Elements[idx].ItemName;
|
||||
}
|
||||
|
||||
function SelectNewItem(GUIComponent Sender)
|
||||
{
|
||||
if(GUILibraryMenu(PageOwner) == None)
|
||||
return;
|
||||
if(Elements.Length <= 0)
|
||||
GUILibraryMenu(PageOwner).NewInfo(None);
|
||||
else
|
||||
GUILibraryMenu(PageOwner).NewInfo(Elements[Index]);
|
||||
}
|
||||
|
||||
function bool OnDblClick(GUIComponent Sender)
|
||||
{
|
||||
// HAHAH typecasting nightmare.
|
||||
// All we're doing here is hacking the Items in the buymenu list so when you
|
||||
// double clickem, it runs a quick check to see if you can buy / sell this, and acts
|
||||
// like you had clicked the footer.
|
||||
|
||||
// Because the Sender (the actual button we're double clicking) has fuck all to do with the GUIshowable itself,
|
||||
// we've gotta route everything back through the BuyMenu...
|
||||
// Care of Alex
|
||||
if (GUILibraryMenu(PageOwner).CanAfford(GUILibraryMenu(PageOwner).ItemsBox.List.Elements[GUILibraryMenu(PageOwner).ItemsBox.List.Index] )
|
||||
&& GUILibraryMenu(PageOwner).ItemsBox.List.Elements[GUILibraryMenu(PageOwner).ItemsBox.List.Index].CanButtonMe(PlayerOwner()
|
||||
,GUILibraryMenu(PageOwner).myCategories.Index!=0) )
|
||||
GUILibraryMenuFooter(GUILibraryMenu(PageOwner).t_Footer).OnFooterClick(GUILibraryMenuFooter(GUILibraryMenu(PageOwner).t_Footer).b_Buy);
|
||||
Return False;
|
||||
}
|
||||
|
||||
|
||||
function DrawBuyItem(Canvas c, int Item, float X, float Y, float W, float HT, bool bSelected, bool bPending)
|
||||
{
|
||||
local string tString;
|
||||
local float Iheight,Itop,Ileft,Iwidth;
|
||||
local eMenuState drawState;
|
||||
local int AdjustedValue;
|
||||
local float GameDifficulty;
|
||||
|
||||
if (PlayerOwner().Level.Game != none)
|
||||
GameDifficulty = KFGameType(PlayerOwner().Level.Game).GetDifficulty();
|
||||
|
||||
if(!bSelected)
|
||||
drawState = MSAT_Blurry;
|
||||
else
|
||||
drawState = MSAT_Watched;
|
||||
|
||||
Iheight = HT*0.808917;
|
||||
Itop = Y+(HT-Iheight)/2;
|
||||
Ileft = X;
|
||||
Iwidth = W;
|
||||
|
||||
SectionStyle.Draw(c,drawState,Ileft,Itop,Iwidth,Iheight);
|
||||
|
||||
Ileft = X*1.05;
|
||||
Iwidth = W-((ILeft-X)*2);
|
||||
|
||||
|
||||
if (Elements[Item].HasMe(PlayerOwner().Pawn))
|
||||
AdjustedValue =int(Elements[Item].cost / GameDifficulty);
|
||||
else
|
||||
AdjustedValue = Elements[Item].cost;
|
||||
|
||||
//Draw our nickname
|
||||
tString = GetItemAtIndex(Item);
|
||||
SectionStyle.DrawText(c,MSAT_Blurry,Ileft,Itop,Iwidth,(Iheight/2),TXTA_Center,tString,FNS_Medium);
|
||||
|
||||
//Draw cost string Added to account for whether it is an item that's in myinventory (and therefore can only be sold)
|
||||
//tString = "Cost:"@Elements[Item].cost;
|
||||
if(Elements[Item].cost == AdjustedValue)
|
||||
tString = "Cost:"@AdjustedValue;
|
||||
else
|
||||
tString = "Sale Value:"@AdjustedValue;
|
||||
SectionStyle.DrawText(c,MSAT_Blurry,Ileft,Itop,Iwidth,(Iheight),TXTA_Center,tString,FNS_small);
|
||||
|
||||
//Draw Weight string
|
||||
tString = "Weight:"@Elements[item].weight;
|
||||
SectionStyle.DrawText(c,MSAT_Blurry,Ileft,Itop,Iwidth,(Iheight+(Iheight /2)),TXTA_Center,tString,FNS_small);
|
||||
}
|
||||
|
||||
function float BuyItemHeight(Canvas c)
|
||||
{
|
||||
if(GUIBuyItemsBox(MenuOwner) != None)
|
||||
return MenuOwner.ActualHeight() * 0.25;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
// GetItemHeight=GUIBuyItemsList.BuyItemHeight
|
||||
StyleName="ItemBoxInfo"
|
||||
// OnChange=GUIBuyItemsList.SelectNewItem
|
||||
// OnDblClick=GUIBuyItemsList.OnDblClick
|
||||
bMouseOverSound=true
|
||||
OnClickSound=CS_Click
|
||||
}
|
||||
189
kf_sources/KFGui/Classes/GUIShowable.uc
Normal file
189
kf_sources/KFGui/Classes/GUIShowable.uc
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
class GUIShowable extends Object;
|
||||
|
||||
var Mesh showMesh; //Mesh to show in Info
|
||||
var StaticMesh myShowMesh; //Actual staticmesh to show in info
|
||||
var int cost; //Cost to buy
|
||||
var float weight; //Heaviness
|
||||
var class<GUIPanel> InfoPanel; //Panel to show Info in- should actually be KFInfoPanel
|
||||
var class<Inventory> relatedInventory; //For inventory sellables,
|
||||
//the associated class.
|
||||
|
||||
var rotator infoDrawRotation; //Rotation in the Info panel
|
||||
var vector infoDrawOffset; //Offset in the info panel
|
||||
var float infoDrawScale; //Generally, size
|
||||
var int infoSpinRate; //rate our weapon spins at. 0 by default.
|
||||
//alex, change the damn default.
|
||||
|
||||
var string ItemName; //Sale name of object
|
||||
var string Description; //Flavor text, etc.
|
||||
|
||||
var int PurchasedQuantity; //Have we bought one of these?
|
||||
var int OwnedQuantity; //Amount player already has
|
||||
|
||||
var float GameDifficulty;
|
||||
|
||||
|
||||
|
||||
|
||||
enum eLibCat
|
||||
{
|
||||
Lib_Story,
|
||||
Lib_Enemy,
|
||||
Lib_Equipment,
|
||||
};
|
||||
|
||||
|
||||
|
||||
//We might want different panel types for different
|
||||
//categories.
|
||||
function class<GUIPanel> GetPanelType(eLibCat category)
|
||||
{
|
||||
return InfoPanel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function bool CanButtonMe(PlayerController pc,bool buying)
|
||||
{
|
||||
if(buying)
|
||||
return CanBuyMe(pc);
|
||||
else
|
||||
return CanSellMe(pc);
|
||||
}
|
||||
|
||||
function bool CanBuyMe(PlayerController pc)
|
||||
{
|
||||
if(KFPlayerController(pc) == None || KFHumanPawn(pc.Pawn) == None)
|
||||
{
|
||||
Log ("PC == none or PC.pawn == none");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function bool CanSellMe(PlayerController pc)
|
||||
{
|
||||
if(KFPlayerController(pc) == None || KFHumanPawn(pc.Pawn) == None)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
function string GetBuyCaption(eLibCat index)
|
||||
{
|
||||
Return "";
|
||||
}
|
||||
|
||||
function ProcessComplete(PlayerController pc)
|
||||
{
|
||||
|
||||
|
||||
if(PurchasedQuantity > 0)
|
||||
{
|
||||
GiveMe(pc);
|
||||
return;
|
||||
} else if(PurchasedQuantity < 0)
|
||||
{
|
||||
TakeMe(pc);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//Hand it over to the player (once he hits complete)
|
||||
function GiveMe(PlayerController pc)
|
||||
{
|
||||
}
|
||||
|
||||
//The slink giveth, the slink taketh away
|
||||
function TakeMe(PlayerController pc)
|
||||
{
|
||||
}
|
||||
|
||||
//Consider ourselves bought
|
||||
function BuyMe(out int score, out float oweight, pawn servUpdatePawn)
|
||||
{
|
||||
score -= cost;
|
||||
oweight += weight;
|
||||
PurchasedQuantity++;
|
||||
|
||||
// (KFPawn(servUpdatePawn)).setCreds(score) ;
|
||||
}
|
||||
|
||||
//Consider ourselves sold
|
||||
function SellMe(out int score, out float oweight, pawn servUpdatePawn)
|
||||
{
|
||||
if (PlayerController(servUpdatePawn.Controller).GameReplicationInfo != none)
|
||||
{
|
||||
GameDifficulty = KFGameReplicationInfo(PlayerController(servUpdatePawn.Controller).GameReplicationInfo).GameDiff;
|
||||
// Log(KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).GameDiff);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(PurchasedQuantity > 0)
|
||||
score += cost;
|
||||
else
|
||||
score += (cost / GameDifficulty);
|
||||
oweight -= weight;
|
||||
PurchasedQuantity--;
|
||||
|
||||
|
||||
|
||||
|
||||
// (KFPawn(servUpdatePawn)).setCreds(score) ;
|
||||
|
||||
}
|
||||
|
||||
//Subclasses should return true if the buyable
|
||||
//should show up under the index'th list for pawn p.
|
||||
//This implementation just returns whether or not the pawn
|
||||
//already has an item of class relatedInventory.
|
||||
|
||||
// ParentMenu parameter is a kludge so ammo can find out if any stuff
|
||||
// has been bought and sold in the main buy menu. It is a relatively
|
||||
// well contained kludge however, so I won't panic
|
||||
function bool ShowMe(Pawn p, eLibCat index, GUILibraryMenu ParentMenu)
|
||||
{
|
||||
//cost *= 10;
|
||||
return true;
|
||||
}
|
||||
|
||||
//returns the combined weight of all owned items of type
|
||||
function float InitOwnedQuantity(Pawn p)
|
||||
{
|
||||
local Inventory inv;
|
||||
local int quant;
|
||||
|
||||
//log("INITOWNEDQUANTITY",'KFMessage');
|
||||
|
||||
if(p == None)
|
||||
return 0;
|
||||
for(inv = p.Inventory;inv != None;inv = inv.Inventory)
|
||||
{
|
||||
if(inv.IsA(relatedInventory.Name))
|
||||
{
|
||||
quant++;
|
||||
}
|
||||
}
|
||||
OwnedQuantity=quant;
|
||||
return weight*OwnedQuantity;
|
||||
}
|
||||
|
||||
function bool HasMe(Pawn p)
|
||||
{
|
||||
return (OwnedQuantity+PurchasedQuantity>0);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
myShowMesh=StaticMesh'KillingFloorStatics.DeagleAmmo'
|
||||
InfoPanel=Class'XInterface.GUIPanel'
|
||||
infoDrawRotation=(Pitch=-5461,Yaw=-16384,Roll=32768)
|
||||
infoDrawOffset=(X=100.000000,Y=-20.000000,Z=-10.000000)
|
||||
infoDrawScale=0.700000
|
||||
infoSpinRate=20000
|
||||
ItemName="Buyable Object"
|
||||
Description="This object appears to be for sale."
|
||||
|
||||
|
||||
}
|
||||
53
kf_sources/KFGui/Classes/GUIVetToolTipMOStyle.uc
Normal file
53
kf_sources/KFGui/Classes/GUIVetToolTipMOStyle.uc
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
class GUIVetToolTipMOStyle extends GUI2Styles;
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
KeyName="VetToolTipStyle"
|
||||
|
||||
FontNames(0)="UT2SmallFont"
|
||||
FontNames(1)="UT2SmallFont"
|
||||
FontNames(2)="UT2SmallFont"
|
||||
FontNames(3)="UT2SmallFont"
|
||||
FontNames(4)="UT2SmallFont"
|
||||
FontNames(5)="UT2SmallFont"
|
||||
FontNames(6)="UT2SmallFont"
|
||||
FontNames(7)="UT2SmallFont"
|
||||
FontNames(8)="UT2SmallFont"
|
||||
FontNames(9)="UT2SmallFont"
|
||||
FontNames(10)="UT2SmallFont"
|
||||
FontNames(11)="UT2SmallFont"
|
||||
FontNames(12)="UT2SmallFont"
|
||||
FontNames(13)="UT2SmallFont"
|
||||
FontNames(14)="UT2SmallFont"
|
||||
|
||||
FontColors(0)=(R=255,G=25,B=25,A=255)
|
||||
FontColors(1)=(R=255,G=25,B=25,A=255)
|
||||
FontColors(2)=(R=255,G=25,B=25,A=255)
|
||||
FontColors(3)=(R=255,G=25,B=25,A=255)
|
||||
FontColors(4)=(R=255,G=25,B=25,A=255)
|
||||
/*
|
||||
|
||||
Images(0)=Material'2K4Menus.Controls.editboxsquare_b'
|
||||
Images(1)=Material'2K4Menus.Controls.editboxsquare_b'
|
||||
Images(2)=Material'2K4Menus.Controls.editboxsquare_b'
|
||||
Images(3)=Material'2K4Menus.Controls.editboxsquare_b'
|
||||
Images(4)=Material'2K4Menus.Controls.editboxsquare_d'
|
||||
*/
|
||||
|
||||
Images(0)=Material'2K4Menus.NewControls.editboxblurry'
|
||||
Images(1)=Material'2K4Menus.NewControls.editboxwatched'
|
||||
Images(2)=Material'2K4Menus.NewControls.editboxfocused'
|
||||
Images(3)=Material'2K4Menus.NewControls.editboxpressed'
|
||||
Images(4)=Material'2K4Menus.NewControls.editBoxdisabled'
|
||||
|
||||
ImgColors(0)=(R=221,G=221,B=221,A=128)
|
||||
ImgColors(1)=(R=221,G=221,B=221,A=128)
|
||||
ImgColors(2)=(R=221,G=221,B=221,A=128)
|
||||
ImgColors(3)=(R=221,G=221,B=221,A=128)
|
||||
ImgColors(4)=(R=221,G=221,B=221,A=128)
|
||||
|
||||
BorderOffsets(0)=6
|
||||
BorderOffsets(1)=8
|
||||
BorderOffsets(2)=6
|
||||
BorderOffsets(3)=6
|
||||
}
|
||||
71
kf_sources/KFGui/Classes/GUIVeterancyButton.uc
Normal file
71
kf_sources/KFGui/Classes/GUIVeterancyButton.uc
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
class GUIVeterancyButton extends GUIButton;
|
||||
|
||||
#exec obj load file="UT2003Fonts.utx"
|
||||
|
||||
var Material PerksIcon;
|
||||
var bool bNoSelectMe;
|
||||
|
||||
function MakeMeUnavailable()
|
||||
{
|
||||
OnClickSound = CS_None;
|
||||
bNoSelectMe = True;
|
||||
bMouseOverSound = False;
|
||||
}
|
||||
function bool RenderPerkIcon(Canvas Canvas, eMenuState MenuState, float left, float top, float width, float height)
|
||||
{
|
||||
local Material T;
|
||||
local float TX,TY,XL,YL;
|
||||
|
||||
TX = Canvas.ClipX;
|
||||
TY = Canvas.ClipY;
|
||||
Canvas.OrgX = left;
|
||||
Canvas.OrgY = top;
|
||||
Canvas.ClipX = width;
|
||||
Canvas.ClipY = height;
|
||||
Canvas.CurX = 0;
|
||||
Canvas.CurY = 0;
|
||||
|
||||
if( bNoSelectMe )
|
||||
MenuState = MSAT_Disabled;
|
||||
T = Style.Images[MenuState];
|
||||
if( T!=None )
|
||||
Canvas.DrawTile(T,width,height,0,0,T.MaterialUSize(),T.MaterialVSize());
|
||||
if( PerksIcon!=None )
|
||||
{
|
||||
Canvas.CurX = 0;
|
||||
Canvas.CurY = 0;
|
||||
Canvas.DrawColor.A = 255;
|
||||
if( MenuState==MSAT_Disabled )
|
||||
Canvas.SetDrawColor(120,120,120,180);
|
||||
Canvas.DrawTile(PerksIcon,width,height,0,0,PerksIcon.MaterialUSize(),PerksIcon.MaterialVSize());
|
||||
}
|
||||
if( Len(Caption)>0 )
|
||||
{
|
||||
if( MenuState==MSAT_Disabled )
|
||||
Canvas.SetDrawColor(120,120,120,200);
|
||||
else Canvas.SetDrawColor(250,100,100,225);
|
||||
Canvas.Font = class'ROHUD'.Static.GetSmallMenuFont(Canvas);//Font'ROFonts.ROBtsrmVr9';
|
||||
Canvas.TextSize(Caption,XL,YL);
|
||||
Canvas.CurX = Canvas.ClipX/2-XL/2;
|
||||
Canvas.CurY = Canvas.ClipY-YL-1;
|
||||
Canvas.DrawTextClipped(Caption,False);
|
||||
}
|
||||
Canvas.OrgX = 0;
|
||||
Canvas.OrgY = 0;
|
||||
Canvas.ClipX = TX;
|
||||
Canvas.ClipY = TY;
|
||||
Canvas.SetDrawColor(255,255,255,255);
|
||||
Return True;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Begin Object Class=GUIVeterancyToolTip Name=GUIVetToolTip
|
||||
End Object
|
||||
ToolTip=GUIVetToolTip
|
||||
Begin Object Class=VetButtonStyles Name=GUIVetButStyle
|
||||
OnDraw=RenderPerkIcon
|
||||
End Object
|
||||
Style=GUIVetButStyle
|
||||
StyleName="VeterancyButtonStyle"
|
||||
}
|
||||
14
kf_sources/KFGui/Classes/GUIVeterancyToolTip.uc
Normal file
14
kf_sources/KFGui/Classes/GUIVeterancyToolTip.uc
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
class GUIVeterancyToolTip extends GUIToolTip;
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
bRequiresStyle=True
|
||||
bVisible=false
|
||||
bMultiLine=true
|
||||
|
||||
MaxWidth=0.3
|
||||
ExpirationSeconds=0.0
|
||||
InitialDelay=0.0
|
||||
|
||||
StyleName="VetToolTipStyle"
|
||||
}
|
||||
31
kf_sources/KFGui/Classes/GUIWeaponBar.uc
Normal file
31
kf_sources/KFGui/Classes/GUIWeaponBar.uc
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
class GUIWeaponBar extends GUIProgressBar;
|
||||
|
||||
function ResetColor()
|
||||
{
|
||||
BarColor.R=255;
|
||||
BarColor.G=255;
|
||||
BarColor.B=255;
|
||||
BarColor.A=255;
|
||||
}
|
||||
|
||||
function SetValue(float val)
|
||||
{
|
||||
Value=val+20;
|
||||
ResetColor();
|
||||
}
|
||||
|
||||
function float GetValue()
|
||||
{
|
||||
return Value-20;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
BarBack=Texture'KF_InterfaceArt_tex.Menu.Innerborder_transparent'
|
||||
BarTop=Texture'InterfaceArt_tex.Menu.progress_bar'
|
||||
Low=20.000000
|
||||
High=120.000000
|
||||
CaptionWidth=0.000000
|
||||
ValueRightWidth=0.000000
|
||||
bShowValue=False
|
||||
}
|
||||
111
kf_sources/KFGui/Classes/GUIWeaponImage.uc
Normal file
111
kf_sources/KFGui/Classes/GUIWeaponImage.uc
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
class GUIWeaponImage extends GUIImage;
|
||||
|
||||
var float nFov;
|
||||
var() editinline editconst noexport SpinnyWeap InfoWeapon; // MUST be set to null when you leave the window
|
||||
var vector offset;
|
||||
|
||||
/*
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
Super.InitComponent(MyController,MyOwner);
|
||||
//Show us a spinning shotgun!
|
||||
if(InfoWeapon == None)
|
||||
InfoWeapon = PlayerOwner().Spawn(class'XInterface.SpinnyWeap');
|
||||
InfoWeapon.bPlayCrouches = false;
|
||||
InfoWeapon.bPlayRandomAnims = false;
|
||||
InfoWeapon.SpinRate=0; //Oh, wait, don't.
|
||||
InfoWeapon.bHidden = true;
|
||||
}
|
||||
|
||||
function ChangeToWeapon(GUIBuyable newWeapon)
|
||||
{
|
||||
if(newWeapon == None)
|
||||
{
|
||||
InfoWeapon.bHidden = true;
|
||||
return;
|
||||
}
|
||||
if(newWeapon.showMesh != None)
|
||||
{
|
||||
InfoWeapon.SetDrawType(DT_Mesh);
|
||||
InfoWeapon.LinkMesh(newWeapon.showMesh);
|
||||
} else
|
||||
{
|
||||
InfoWeapon.SetDrawType(DT_StaticMesh);
|
||||
InfoWeapon.SetStaticMesh(newWeapon.myShowMesh);
|
||||
}
|
||||
offset = newWeapon.infoDrawOffset;
|
||||
//log("offset:"@offset,'KFMessage');
|
||||
InfoWeapon.SetDrawScale(newWeapon.infoDrawScale);
|
||||
InfoWeapon.SpinRate = newWeapon.infoSpinRate; //Okay, you can if you want to.
|
||||
ResetWeaponRotation(newWeapon.infoDrawRotation);
|
||||
}
|
||||
|
||||
function ResetWeaponRotation(rotator thing)
|
||||
{
|
||||
local rotator temp;
|
||||
if ( InfoWeapon != None )
|
||||
{
|
||||
temp.Yaw = PlayerOwner().Rotation.Yaw + thing.Yaw;
|
||||
temp.Roll = PlayerOwner().Rotation.Roll + thing.Roll;
|
||||
temp.Pitch = PlayerOwner().Rotation.Pitch + thing.Pitch;
|
||||
InfoWeapon.SetRotation(temp);
|
||||
InfoWeapon.bHidden = false;
|
||||
}
|
||||
}
|
||||
|
||||
function PostRenderBuyMenu(Canvas Canvas)
|
||||
{
|
||||
local float oOrgX,oOrgY;
|
||||
local float oClipX,oClipY;
|
||||
local vector CamPos,X,Y,Z;
|
||||
local rotator CamRot;
|
||||
|
||||
oOrgX = Canvas.OrgX;
|
||||
oOrgY = Canvas.OrgY;
|
||||
oClipX = Canvas.ClipX;
|
||||
oClipY = Canvas.ClipY;
|
||||
|
||||
Canvas.OrgX = ActualLeft();
|
||||
Canvas.OrgY = ActualTop();
|
||||
Canvas.ClipX = ActualWidth();
|
||||
Canvas.ClipY = ActualHeight();
|
||||
|
||||
canvas.GetCameraLocation(CamPos, CamRot);
|
||||
GetAxes(CamRot, X, Y, Z);
|
||||
|
||||
|
||||
InfoWeapon.SetLocation(CamPos + (X*offset.X)+(Y*offset.Y)+(Z*offset.Z));
|
||||
|
||||
canvas.DrawActorClipped(InfoWeapon, false, ActualLeft(), ActualTop(), ActualWidth(), ActualHeight(), true, nFov);
|
||||
|
||||
Canvas.OrgX = oOrgX;
|
||||
Canvas.OrgY = oOrgY;
|
||||
Canvas.ClipX = oClipX;
|
||||
Canvas.ClipY = oClipY;
|
||||
}
|
||||
|
||||
event Closed(GUIComponent Sender, bool bCancelled)
|
||||
{
|
||||
Super.Closed(Sender, bCancelled);
|
||||
if ( InfoWeapon != None )
|
||||
InfoWeapon.bHidden = true;
|
||||
}
|
||||
|
||||
function Free()
|
||||
{
|
||||
Super.Free();
|
||||
|
||||
if ( InfoWeapon != None )
|
||||
InfoWeapon.Destroy();
|
||||
|
||||
InfoWeapon = None;
|
||||
}
|
||||
|
||||
*/
|
||||
defaultproperties
|
||||
{
|
||||
/*
|
||||
nfov=65.000000
|
||||
OnRendered=GUIWeaponImage.PostRenderBuyMenu
|
||||
*/
|
||||
}
|
||||
151
kf_sources/KFGui/Classes/KFAchievementsList.uc
Normal file
151
kf_sources/KFGui/Classes/KFAchievementsList.uc
Normal file
|
|
@ -0,0 +1,151 @@
|
|||
class KFAchievementsList extends GUIVertList;
|
||||
|
||||
// Settings
|
||||
var() float OuterBorder;
|
||||
var() float ItemBorder;
|
||||
var() float TextTopOffset;
|
||||
var() float ItemSpacing;
|
||||
var() float IconToNameSpacing;
|
||||
var() float NameToDescriptionSpacing;
|
||||
var() float ProgressBarWidth;
|
||||
var() float ProgressBarHeight;
|
||||
var() float ProgressTextSpacing;
|
||||
var() float TextHeight;
|
||||
|
||||
// Display
|
||||
var texture ItemBackground;
|
||||
var texture ProgressBarBackground;
|
||||
var texture ProgressBarForeground;
|
||||
|
||||
// State
|
||||
var KFSteamStatsAndAchievements KFStatsAndAchievements;
|
||||
|
||||
event InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
OnDrawItem = DrawAchievement;
|
||||
Super.InitComponent(MyController, MyOwner);
|
||||
}
|
||||
|
||||
event Closed(GUIComponent Sender, bool bCancelled)
|
||||
{
|
||||
KFStatsAndAchievements = none;
|
||||
|
||||
super.Closed(Sender, bCancelled);
|
||||
}
|
||||
|
||||
function InitList(KFSteamStatsAndAchievements StatsAndAchievements)
|
||||
{
|
||||
// Hold onto our reference
|
||||
KFStatsAndAchievements = StatsAndAchievements;
|
||||
|
||||
// Update all the Progress percentages of the Achievements
|
||||
KFStatsAndAchievements.UpdateAchievementProgress();
|
||||
|
||||
// Update the ItemCount and select the first item
|
||||
ItemCount = KFStatsAndAchievements.Achievements.Length;
|
||||
SetIndex(0);
|
||||
|
||||
if ( bNotify )
|
||||
{
|
||||
CheckLinkedObjects(Self);
|
||||
}
|
||||
|
||||
if ( MyScrollBar != none )
|
||||
{
|
||||
MyScrollBar.AlignThumb();
|
||||
}
|
||||
}
|
||||
|
||||
function DrawAchievement(Canvas Canvas, int Index, float X, float Y, float Width, float Height, bool bSelected, bool bPending)
|
||||
{
|
||||
local float TempX, TempY;
|
||||
local float IconSize;
|
||||
local string ProgressString;
|
||||
|
||||
// Offset for the Background
|
||||
TempX = X + OuterBorder * Width;
|
||||
TempY = Y + ItemSpacing / 2.0;
|
||||
|
||||
// Initialize the Canvas
|
||||
Canvas.Style = 1;
|
||||
Canvas.SetDrawColor(255, 255, 255, 192);
|
||||
|
||||
// Draw Item Background
|
||||
Canvas.SetPos(TempX, TempY);
|
||||
Canvas.DrawTileStretched(ItemBackground, Width - (OuterBorder * Width * 2.0), Height - ItemSpacing);
|
||||
Canvas.SetDrawColor(255, 255, 255, 255);
|
||||
|
||||
// Offset and Calculate Icon's Size
|
||||
TempX += ItemBorder * Height;
|
||||
TempY += ItemBorder * Height;
|
||||
IconSize = Height - ItemSpacing - (ItemBorder * Height * 2.0);
|
||||
|
||||
// Draw Icon
|
||||
Canvas.SetPos(TempX, TempY);
|
||||
if ( KFStatsAndAchievements.Achievements[Index].bCompleted == 1 )
|
||||
{
|
||||
Canvas.DrawTile(KFStatsAndAchievements.Achievements[Index].Icon, IconSize, IconSize, 0, 0, 64, 64);
|
||||
}
|
||||
else
|
||||
{
|
||||
Canvas.DrawTile(KFStatsAndAchievements.Achievements[Index].LockedIcon, IconSize, IconSize, 0, 0, 64, 64);
|
||||
}
|
||||
|
||||
TempX += IconSize + IconToNameSpacing * Width;
|
||||
TempY += TextTopOffset * Height;
|
||||
|
||||
//Draw the Display Name
|
||||
SectionStyle.DrawText(Canvas, MSAT_Blurry, TempX, TempY, Width - TempX, TextHeight * Height, TXTA_Left, KFStatsAndAchievements.Achievements[Index].DisplayName, FNS_Medium);
|
||||
|
||||
//Draw the Description
|
||||
SectionStyle.DrawText(Canvas, MSAT_Blurry, TempX, TempY + (TextHeight * Height) + (NameToDescriptionSpacing * Height), Width - TempX, TextHeight * Height, TXTA_Left, KFStatsAndAchievements.Achievements[Index].Description, FNS_Small);
|
||||
|
||||
if ( KFStatsAndAchievements.Achievements[Index].bShowProgress == 1 )
|
||||
{
|
||||
TempX = X + Width - (OuterBorder * Width) - (ItemBorder * Height * 2.0) - (ProgressBarWidth * Width);
|
||||
TempY = Y + (Height / 2.0) - (ProgressBarHeight * Height / 2.0);
|
||||
|
||||
// Draw Progress Bar
|
||||
Canvas.SetPos(TempX, TempY);
|
||||
Canvas.DrawTileStretched(ProgressBarBackground, ProgressBarWidth * Width, ProgressBarHeight * Height);
|
||||
Canvas.SetPos(TempX + 3.0, TempY + 3.0);
|
||||
if ( KFStatsAndAchievements.Achievements[Index].ProgressNumerator < KFStatsAndAchievements.Achievements[Index].ProgressDenominator )
|
||||
{
|
||||
Canvas.DrawTileStretched(ProgressBarForeground, ((ProgressBarWidth * Width) - 6.0) * (float(KFStatsAndAchievements.Achievements[Index].ProgressNumerator) / float(KFStatsAndAchievements.Achievements[Index].ProgressDenominator)), ProgressBarHeight * Height - 6.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
Canvas.DrawTileStretched(ProgressBarForeground, ProgressBarWidth * Width - 6.0, ProgressBarHeight * Height - 6.0);
|
||||
}
|
||||
|
||||
// Draw Progress Text
|
||||
ProgressString = KFStatsAndAchievements.Achievements[Index].ProgressNumerator$"/"$KFStatsAndAchievements.Achievements[Index].ProgressDenominator;
|
||||
SectionStyle.DrawText(Canvas, MSAT_Blurry, TempX - 150 - (ProgressTextSpacing * Width), TempY, 150, (TextHeight * Height), TXTA_Right, ProgressString, FNS_Medium);
|
||||
}
|
||||
}
|
||||
|
||||
function float AchievementHeight(Canvas c)
|
||||
{
|
||||
return (MenuOwner.ActualHeight() / 6.0) - 1.0;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
OuterBorder=0.015
|
||||
ItemBorder=0.05
|
||||
TextTopOffset=0.082
|
||||
ItemSpacing=5.0
|
||||
IconToNameSpacing=0.018
|
||||
ProgressBarWidth=0.227
|
||||
ProgressBarHeight=0.225
|
||||
NameToDescriptionSpacing=0.125
|
||||
ProgressTextSpacing=0.009
|
||||
TextHeight=0.225
|
||||
|
||||
ItemBackground=Texture'KF_InterfaceArt_tex.Menu.Thin_border_SlightTransparent'
|
||||
ProgressBarBackground=Texture'KF_InterfaceArt_tex.Menu.Innerborder'
|
||||
ProgressBarForeground=Texture'InterfaceArt_tex.Menu.progress_bar'
|
||||
|
||||
FontScale=FNS_Medium
|
||||
GetItemHeight=KFAchievementsList.AchievementHeight
|
||||
}
|
||||
31
kf_sources/KFGui/Classes/KFAchievementsListBox.uc
Normal file
31
kf_sources/KFGui/Classes/KFAchievementsListBox.uc
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
class KFAchievementsListBox extends GUIListBoxBase;
|
||||
|
||||
var KFAchievementsList List;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
Super.InitComponent(MyController,MyOwner);
|
||||
|
||||
if ( DefaultListClass != "" )
|
||||
{
|
||||
List = KFAchievementsList(AddComponent(DefaultListClass));
|
||||
if ( List == none )
|
||||
{
|
||||
log(Class$".InitComponent - Could not create default list ["$DefaultListClass$"]");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( List == none )
|
||||
{
|
||||
Warn("Could not initialize list!");
|
||||
return;
|
||||
}
|
||||
|
||||
InitBaseList(List);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
DefaultListClass="KFGUI.KFAchievementsList"
|
||||
}
|
||||
47
kf_sources/KFGui/Classes/KFAddBotButton.uc
Normal file
47
kf_sources/KFGui/Classes/KFAddBotButton.uc
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
class KFAddBotButton extends moButton;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
local KFGameReplicationInfo KFGRI;
|
||||
|
||||
Super.InitComponent(MyController, MyOwner);
|
||||
|
||||
KFGRI = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo);
|
||||
|
||||
if ( KFGRI == none || KFGRI.TempBotName=="" )
|
||||
{
|
||||
DisableMe();
|
||||
}
|
||||
}
|
||||
function bool InternalOnClick(GUIComponent Sender)
|
||||
{
|
||||
local int PendingBots;
|
||||
local KFGameReplicationInfo KFGRI;
|
||||
local String BotName;
|
||||
|
||||
KFGRI = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo);
|
||||
|
||||
if (KFGRI == none)
|
||||
return false;
|
||||
|
||||
PendingBots = KFGRI.PendingBots;
|
||||
if (KFGRI.TempBotName != "")
|
||||
BotName = KFGRI.TempBotName;
|
||||
|
||||
if(BotName != "")
|
||||
{
|
||||
if ((PlayerOwner().GameReplicationInfo.PRIArray.length + PendingBots) < 6)
|
||||
{
|
||||
PendingBots ++;
|
||||
KFPlayerController(PlayerOwner()).ServerSetGRIPendingBots(PendingBots,BotName);
|
||||
PlayerOwner().ClientMessage("Bot "$KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).LastBotName[PendingBots]$" added to BotList");
|
||||
PlayerOwner().ClientMessage("Number of Bots to spawn: "$KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).PendingBots);
|
||||
}
|
||||
else Warn("No Valid KF Bot selected");
|
||||
}
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
ButtonCaption="Add Bot"
|
||||
}
|
||||
873
kf_sources/KFGui/Classes/KFAudioSettingsTab.uc
Normal file
873
kf_sources/KFGui/Classes/KFAudioSettingsTab.uc
Normal file
|
|
@ -0,0 +1,873 @@
|
|||
class KFAudioSettingsTab extends Settings_Tabs;
|
||||
|
||||
var localized string AudioModes[4],
|
||||
VoiceModes[3];
|
||||
|
||||
|
||||
var automated GUISectionBackground i_BG1, i_BG2, i_BG3;
|
||||
var automated moSlider sl_MusicVol, sl_EffectsVol, sl_VOIP;
|
||||
var automated moComboBox co_Mode, co_Announce;
|
||||
var automated moCheckbox ch_ReverseStereo, ch_MessageBeep, ch_LowDetail, ch_Default, ch_VoiceChat;
|
||||
|
||||
var automated moCheckBox ch_AJPublic, ch_AutoSpeak, ch_Dampen;
|
||||
var automated moEditBox ed_Active;
|
||||
var automated moEditBox ed_ChatPassword;
|
||||
var automated moComboBox co_Quality, co_LANQuality;
|
||||
|
||||
var float fMusic, fEffects, fVOIP;
|
||||
var int iVoice, iMode, iVoiceMode;
|
||||
var bool bRev, bBeep, bLow, bCompat, b3DSound, bEAX, bDefault, bVoiceChat, bDampen;
|
||||
|
||||
var bool bAJPublic, bAutoSpeak;
|
||||
var string sPwd, sCodec, sLANCodec, sActive;
|
||||
var float fVoice;
|
||||
|
||||
var class<VoiceChatReplicationInfo> VoiceChatClass;
|
||||
var string VoiceChatClassName;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
local int i;
|
||||
local bool bIsWin32;
|
||||
local string CName, CDesc;
|
||||
local class<VoiceChatReplicationInfo> Cls;
|
||||
local array<string> InstalledCodecs;
|
||||
|
||||
bIsWin32 = ( ( PlatformIsWindows() ) && ( !PlatformIs64Bit() ) );
|
||||
|
||||
Super.InitComponent(MyController, MyOwner);
|
||||
|
||||
if ( bIsWin32 )
|
||||
{
|
||||
for(i = 0;i < ArrayCount(AudioModes);i++)
|
||||
co_Mode.AddItem(AudioModes[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
co_Mode.AddItem("OpenAL");
|
||||
}
|
||||
|
||||
// Need to load TeamVoiceReplicationInfo to get team channel names
|
||||
Cls = class<VoiceChatReplicationInfo>( DynamicLoadObject( VoiceChatClassName, class'Class') );
|
||||
if ( Cls != None )
|
||||
VoiceChatClass = Cls;
|
||||
|
||||
VoiceChatClass.static.GetInstalledCodecs( InstalledCodecs );
|
||||
for ( i = 0; i < InstalledCodecs.Length; i++ )
|
||||
{
|
||||
VoiceChatClass.static.GetCodecInfo( InstalledCodecs[i], CName, CDesc );
|
||||
co_Quality.AddItem( CName,, InstalledCodecs[i] );
|
||||
co_LANQuality.AddItem( CName,, InstalledCodecs[i] );
|
||||
}
|
||||
|
||||
ed_ChatPassword.MaskText(True);
|
||||
|
||||
|
||||
i_BG1.ManageComponent(sl_MusicVol);
|
||||
i_BG1.ManageComponent(sl_EffectsVol);
|
||||
i_BG1.ManageComponent(sl_VOIP);
|
||||
i_BG1.ManageComponent(co_Mode);
|
||||
i_BG1.ManageComponent(ch_LowDetail);
|
||||
i_BG1.ManageComponent(ch_Default);
|
||||
i_BG1.ManageComponent(ch_reverseStereo);
|
||||
i_BG1.ManageComponent(ch_MessageBeep);
|
||||
|
||||
i_BG3.ManageComponent(ch_VoiceChat);
|
||||
i_BG3.ManageComponent(ch_Dampen);
|
||||
i_BG3.ManageComponent(ch_AJPublic);
|
||||
i_BG3.ManageComponent(ch_AutoSpeak);
|
||||
i_BG3.ManageComponent(ed_Active);
|
||||
i_BG3.ManageComponent(ed_ChatPassword);
|
||||
i_BG3.ManageComponent(co_Quality);
|
||||
i_BG3.ManageComponent(co_LANQuality);
|
||||
|
||||
|
||||
// !!! FIXME: Might use a preinstalled system OpenAL in the future on
|
||||
// !!! FIXME: Mac or Unix, but for now, we don't... --ryan.
|
||||
if ( !PlatformIsWindows() )
|
||||
ch_Default.DisableMe();
|
||||
}
|
||||
|
||||
function ResetClicked()
|
||||
{
|
||||
local class<AudioSubSystem> A;
|
||||
local PlayerController PC;
|
||||
local int i;
|
||||
|
||||
Super.ResetClicked();
|
||||
|
||||
PC = PlayerOwner();
|
||||
|
||||
A = class<AudioSubSystem>(DynamicLoadObject(GetNativeClassName("Engine.Engine.AudioDevice"), Class'Class'));
|
||||
A.static.ResetConfig();
|
||||
|
||||
class'Hud'.static.ResetConfig("bMessageBeep");
|
||||
class'LevelInfo'.static.ResetConfig("bLowSoundDetail");
|
||||
|
||||
class'PlayerController'.static.ResetConfig("bNoVoiceTaunts");
|
||||
class'PlayerController'.static.ResetConfig("bNoVoiceMessages");
|
||||
|
||||
A.static.ResetConfig("VoiceVolume");
|
||||
|
||||
class'Engine.PlayerController'.static.ResetConfig("VoiceChatCodec");
|
||||
class'Engine.PlayerController'.static.ResetConfig("VoiceChatLANCodec");
|
||||
class'Engine.PlayerController'.static.ResetConfig("AutoJoinMask");
|
||||
class'Engine.PlayerController'.static.ResetConfig("ChatPassword");
|
||||
class'Engine.PlayerController'.static.ResetConfig("DefaultActiveChannel");
|
||||
class'Engine.PlayerController'.static.ResetConfig("bEnableInitialChatRoom");
|
||||
|
||||
for (i = 0; i < Components.Length; i++)
|
||||
Components[i].LoadINI();
|
||||
}
|
||||
|
||||
function InternalOnLoadINI(GUIComponent Sender, string s)
|
||||
{
|
||||
local PlayerController PC;
|
||||
local bool bIsWin32;
|
||||
|
||||
PC = PlayerOwner();
|
||||
|
||||
switch (Sender)
|
||||
{
|
||||
case sl_MusicVol:
|
||||
fMusic = float(PC.ConsoleCommand("get ini:Engine.Engine.AudioDevice MusicVolume"));
|
||||
sl_MusicVol.SetComponentValue(fMusic,true);
|
||||
break;
|
||||
|
||||
case sl_EffectsVol:
|
||||
fEffects = float(PC.ConsoleCommand("get ini:Engine.Engine.AudioDevice SoundVolume"));
|
||||
sl_EffectsVol.SetComponentValue(fEffects,true);
|
||||
break;
|
||||
|
||||
case co_Mode:
|
||||
iMode = 1;
|
||||
bIsWin32 = ( ( PlatformIsWindows() ) && ( !PlatformIs64Bit() ) );
|
||||
if ( !bIsWin32 )
|
||||
{
|
||||
bCompat = False;
|
||||
b3DSound = True;
|
||||
iMode = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( bool(PC.ConsoleCommand("get ini:Engine.Engine.AudioDevice CompatibilityMode")) )
|
||||
{
|
||||
bCompat = True;
|
||||
iMode = 0;
|
||||
}
|
||||
|
||||
if ( bool(PC.ConsoleCommand("get ini:Engine.Engine.AudioDevice Use3DSound")) )
|
||||
{
|
||||
b3DSound = True;
|
||||
iMode = 2;
|
||||
}
|
||||
|
||||
if ( bool(PC.ConsoleCommand("get ini:Engine.Engine.AudioDevice UseEAX" )) )
|
||||
{
|
||||
bEAX = True;
|
||||
iMode = 3;
|
||||
}
|
||||
}
|
||||
co_Mode.SilentSetIndex(iMode);
|
||||
break;
|
||||
|
||||
case ch_ReverseStereo:
|
||||
bRev = bool(PC.ConsoleCommand("get ini:Engine.Engine.AudioDevice ReverseStereo"));
|
||||
ch_ReverseStereo.SetComponentValue(bRev,true);
|
||||
break;
|
||||
|
||||
case ch_Default:
|
||||
bDefault = bool(PC.ConsoleCommand("get ini:Engine.Engine.AudioDevice UseDefaultDriver"));
|
||||
ch_Default.SetComponentValue(bDefault,true);
|
||||
break;
|
||||
|
||||
case ch_MessageBeep:
|
||||
bBeep = class'HUD'.default.bMessageBeep;
|
||||
ch_MessageBeep.SetComponentValue(bBeep,true);
|
||||
break;
|
||||
|
||||
case ch_LowDetail:
|
||||
bLow = PC.Level.bLowSoundDetail;
|
||||
|
||||
// Make sure both are the same - LevelInfo.bLowSoundDetail take priority
|
||||
if ( bLow != bool(PC.ConsoleCommand("get ini:Engine.Engine.AudioDevice LowQualitySound" )) )
|
||||
{
|
||||
PC.ConsoleCommand("set ini:Engine.Engine.AudioDevice LowQualitySound"@bLow);
|
||||
PC.ConsoleCommand("SOUND_REBOOT");
|
||||
|
||||
// Restart music.
|
||||
if( PC.Level.Song != "" && PC.Level.Song != "None" )
|
||||
PC.ClientSetMusic( PC.Level.Song, MTRAN_Instant );
|
||||
|
||||
else PC.ClientSetMusic( class'ROMainMenu'.default.MenuSong, MTRAN_Instant );
|
||||
}
|
||||
|
||||
ch_LowDetail.SetComponentValue(bLow,true);
|
||||
break;
|
||||
|
||||
case ch_VoiceChat:
|
||||
bVoiceChat = bool(PC.ConsoleCommand("get ini:Engine.Engine.AudioDevice UseVoIP"));
|
||||
ch_VoiceChat.SetComponentValue(bVoiceChat,true);
|
||||
UpdateVOIPControlsState();
|
||||
break;
|
||||
|
||||
case ed_ChatPassword:
|
||||
sPwd = PC.ChatPassword;
|
||||
ed_ChatPassword.SetComponentValue(sPwd, True);
|
||||
break;
|
||||
|
||||
case sl_VOIP:
|
||||
fVoice = float(PC.ConsoleCommand("get ini:Engine.Engine.AudioDevice VoiceVolume"));
|
||||
sl_VOIP.SetComponentValue(fVoice, True);
|
||||
break;
|
||||
|
||||
case co_Quality:
|
||||
sCodec = PC.VoiceChatCodec;
|
||||
co_Quality.SetExtra(sCodec,true);
|
||||
break;
|
||||
|
||||
case co_LANQuality:
|
||||
sLANCodec = PC.VoiceChatLANCodec;
|
||||
co_LANQuality.SetExtra(sLANCodec,true);
|
||||
break;
|
||||
|
||||
case ch_Dampen:
|
||||
bDampen = bool(PC.ConsoleCommand("get ini:Engine.Engine.AudioDevice DampenWithVoIP"));
|
||||
ch_Dampen.SetComponentValue(bDampen,true);
|
||||
break;
|
||||
|
||||
case ch_AJPublic:
|
||||
bAJPublic = bool(PC.AutoJoinMask & 1);
|
||||
ch_AJPublic.SetComponentValue(bAJPublic,True);
|
||||
break;
|
||||
|
||||
case ch_AutoSpeak:
|
||||
bAutoSpeak = PC.bEnableInitialChatRoom;
|
||||
if ( bAutoSpeak )
|
||||
EnableComponent(ed_Active);
|
||||
else DisableComponent(ed_Active);
|
||||
|
||||
ch_AutoSpeak.SetComponentValue(bAutoSpeak, True);
|
||||
break;
|
||||
|
||||
case ed_Active:
|
||||
sActive = PC.DefaultActiveChannel;
|
||||
ed_Active.SetComponentValue(sActive, True);
|
||||
break;
|
||||
|
||||
default:
|
||||
log(Name@"Unknown component calling LoadINI:"$ GUIMenuOption(Sender).Caption);
|
||||
GUIMenuOption(Sender).SetComponentValue(s,true);
|
||||
}
|
||||
}
|
||||
|
||||
function InternalOnChange(GUIComponent Sender)
|
||||
{
|
||||
local PlayerController PC;
|
||||
local bool bIsWin32;
|
||||
|
||||
bIsWin32 = ( ( PlatformIsWindows() ) && ( !PlatformIs64Bit() ) );
|
||||
|
||||
Super.InternalOnChange(Sender);
|
||||
PC = PlayerOwner();
|
||||
|
||||
switch(Sender)
|
||||
{
|
||||
case sl_MusicVol:
|
||||
fMusic = sl_MusicVol.GetValue();
|
||||
PC.ConsoleCommand("set ini:Engine.Engine.AudioDevice MusicVolume"@fMusic);
|
||||
PC.ConsoleCommand("SetMusicVolume"@fMusic);
|
||||
|
||||
if( PC.Level.Song != "" && PC.Level.Song != "None" )
|
||||
PC.ClientSetMusic( PC.Level.Song, MTRAN_Instant );
|
||||
else PC.ClientSetMusic( class'ROMainMenu'.default.MenuSong, MTRAN_Instant );
|
||||
break;
|
||||
|
||||
case sl_EffectsVol:
|
||||
fEffects = sl_EffectsVol.GetValue();
|
||||
PC.ConsoleCommand("set ini:Engine.Engine.AudioDevice SoundVolume"@fEffects);
|
||||
PC.ConsoleCommand("stopsounds");
|
||||
break;
|
||||
|
||||
case co_Mode:
|
||||
if ( !bIsWin32 ) // Simple OpenAL abstraction... --ryan.
|
||||
break;
|
||||
|
||||
iMode = co_Mode.GetIndex();
|
||||
if (iMode > 1)
|
||||
ShowPerformanceWarning();
|
||||
|
||||
bCompat = iMode < 1;
|
||||
b3DSound = iMode > 1;
|
||||
bEAX = iMode > 2;
|
||||
PC.ConsoleCommand("set ini:Engine.Engine.AudioDevice CompatibilityMode"@bCompat);
|
||||
PC.ConsoleCommand("set ini:Engine.Engine.AudioDevice Use3DSound"@b3DSound);
|
||||
PC.ConsoleCommand("set ini:Engine.Engine.AudioDevice UseEAX"@bEAX);
|
||||
PC.ConsoleCommand("SOUND_REBOOT");
|
||||
|
||||
// Restart music.
|
||||
if( PC.Level.Song != "" && PC.Level.Song != "None" )
|
||||
PC.ClientSetMusic( PC.Level.Song, MTRAN_Instant );
|
||||
else PC.ClientSetMusic( class'ROMainMenu'.default.MenuSong, MTRAN_Instant );
|
||||
break;
|
||||
|
||||
case ch_ReverseStereo:
|
||||
bRev = ch_ReverseStereo.IsChecked();
|
||||
break;
|
||||
|
||||
case ch_MessageBeep:
|
||||
bBeep = ch_MessageBeep.IsChecked();
|
||||
break;
|
||||
|
||||
case ch_Default:
|
||||
bDefault = ch_Default.IsChecked();
|
||||
PC.ConsoleCommand("set ini:Engine.Engine.AudioDevice UseDefaultDriver"@bDefault);
|
||||
PC.ConsoleCommand("SOUND_REBOOT");
|
||||
break;
|
||||
|
||||
case ch_LowDetail:
|
||||
bLow = ch_LowDetail.IsChecked();
|
||||
|
||||
PC.Level.bLowSoundDetail = bLow;
|
||||
PC.Level.SaveConfig();
|
||||
|
||||
PC.ConsoleCommand("set ini:Engine.Engine.AudioDevice LowQualitySound"@bLow);
|
||||
PC.ConsoleCommand("SOUND_REBOOT");
|
||||
|
||||
// Restart music.
|
||||
if( PC.Level.Song != "" && PC.Level.Song != "None" )
|
||||
PC.ClientSetMusic( PC.Level.Song, MTRAN_Instant );
|
||||
else PC.ClientSetMusic( class'ROMainMenu'.default.MenuSong, MTRAN_Instant );
|
||||
break;
|
||||
|
||||
case ch_VoiceChat:
|
||||
bVoiceChat = ch_VoiceChat.IsChecked();
|
||||
UpdateVOIPControlsState();
|
||||
break;
|
||||
|
||||
case ch_Dampen:
|
||||
bDampen = ch_Dampen.IsChecked();
|
||||
break;
|
||||
|
||||
case ed_ChatPassword:
|
||||
sPwd = ed_ChatPassword.GetText();
|
||||
break;
|
||||
|
||||
case sl_VOIP:
|
||||
fVoice = sl_VOIP.GetValue();
|
||||
break;
|
||||
|
||||
case co_Quality:
|
||||
sCodec = co_Quality.GetExtra();
|
||||
break;
|
||||
|
||||
case co_LANQuality:
|
||||
sLANCodec = co_LANQuality.GetExtra();
|
||||
break;
|
||||
|
||||
case ch_AJPublic:
|
||||
bAJPublic = ch_AJPublic.IsChecked();
|
||||
break;
|
||||
|
||||
case ch_AutoSpeak:
|
||||
bAutoSpeak = ch_AutoSpeak.IsChecked();
|
||||
if ( bAutoSpeak )
|
||||
EnableComponent(ed_Active);
|
||||
else DisableComponent(ed_Active);
|
||||
break;
|
||||
|
||||
case ed_Active:
|
||||
sActive = ed_Active.GetText();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function SaveSettings()
|
||||
{
|
||||
local PlayerController PC;
|
||||
local bool bSave, bReboot;
|
||||
|
||||
Super.SaveSettings();
|
||||
PC = PlayerOwner();
|
||||
|
||||
if (PC.bNoAutoTaunts != iVoiceMode > 0)
|
||||
{
|
||||
PC.bNoAutoTaunts = iVoiceMode > 0;
|
||||
PC.default.bNoAutoTaunts = PC.bNoAutoTaunts;
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
if (PC.bNoVoiceTaunts != iVoiceMode > 0)
|
||||
{
|
||||
PC.bNoVoiceTaunts = iVoiceMode > 0;
|
||||
PC.default.bNoVoiceTaunts = PC.bNoVoiceTaunts;
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
if (PC.bNoVoiceMessages != iVoiceMode == 2)
|
||||
{
|
||||
PC.bNoVoiceMessages = iVoiceMode == 2;
|
||||
PC.default.bNoVoiceMessages = PC.bNoVoiceMessages;
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
if (fMusic != sl_MusicVol.GetValue())
|
||||
PC.ConsoleCommand("set ini:Engine.Engine.AudioDevice MusicVolume"@fMusic);
|
||||
|
||||
if (fEffects != sl_EffectsVol.GetValue())
|
||||
PC.ConsoleCommand("set ini:Engine.Engine.AudioDevice SoundVolume"@fEffects);
|
||||
|
||||
if (bool(PC.ConsoleCommand("get ini:Engine.Engine.AudioDevice ReverseStereo")) != bRev)
|
||||
PC.ConsoleCommand("set ini:Engine.Engine.AudioDevice ReverseStereo"@bRev);
|
||||
|
||||
if (bool(PC.ConsoleCommand("get ini:Engine.Engine.AudioDevice DampenWithVoIP")) != bDampen)
|
||||
PC.ConsoleCommand("set ini:Engine.Engine.AudioDevice DampenWithVoIP"@bDampen);
|
||||
|
||||
if (bDefault != bool(PC.ConsoleCommand("get ini:Engine.Engine.AudioDevice UseDefaultDriver")))
|
||||
{
|
||||
PC.ConsoleCommand("set ini:Engine.Engine.AudioDevice UseDefaultDriver"@bDefault);
|
||||
bReboot = True;
|
||||
}
|
||||
|
||||
if( PC.MyHud != None )
|
||||
{
|
||||
if ( PC.myHUD.bMessageBeep != bBeep )
|
||||
{
|
||||
PC.myHUD.bMessageBeep = bBeep;
|
||||
PC.myHUD.SaveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if ( class'HUD'.default.bMessageBeep != bBeep )
|
||||
{
|
||||
class'HUD'.default.bMessageBeep = bBeep;
|
||||
class'HUD'.static.StaticSaveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
if ( bAJPublic != bool(PC.AutoJoinMask & 1) )
|
||||
{
|
||||
if ( bAJPublic )
|
||||
PC.AutoJoinMask = PC.AutoJoinMask | 1;
|
||||
else PC.AutoJoinMask = PC.AutoJoinMask & ~1;
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
if ( fVoice != float(PC.ConsoleCommand("get ini:Engine.Engine.AudioDevice VoiceVolume")) )
|
||||
PC.ConsoleCommand("set ini:Engine.Engine.AudioDevice VoiceVolume"@fVoice);
|
||||
|
||||
if ( sCodec != PC.VoiceChatCodec )
|
||||
{
|
||||
PC.VoiceChatCodec = sCodec;
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
if ( sLANCodec != PC.VoiceChatLANCodec )
|
||||
{
|
||||
PC.VoiceChatLANCodec = sLANCodec;
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
if ( PC.bEnableInitialChatRoom != bAutoSpeak )
|
||||
{
|
||||
PC.bEnableInitialChatRoom = bAutoSpeak;
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
if ( !(PC.DefaultActiveChannel ~= sActive) )
|
||||
{
|
||||
PC.DefaultActiveChannel = sActive;
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
if (PC.ChatPassword != sPwd)
|
||||
{
|
||||
PC.SetChatPassword(sPwd);
|
||||
bSave = False;
|
||||
}
|
||||
|
||||
if (bVoiceChat != bool(PC.ConsoleCommand("get ini:Engine.Engine.AudioDevice UseVoIP")))
|
||||
{
|
||||
if (bVoiceChat)
|
||||
PC.EnableVoiceChat();
|
||||
else
|
||||
PC.DisableVoiceChat();
|
||||
|
||||
bReboot = False;
|
||||
}
|
||||
|
||||
if (bSave)
|
||||
PC.SaveConfig();
|
||||
|
||||
if (bReboot)
|
||||
PC.ConsoleCommand("SOUND_REBOOT");
|
||||
}
|
||||
|
||||
function UpdateVOIPControlsState()
|
||||
{
|
||||
if (bVoiceChat)
|
||||
{
|
||||
//ch_AJLocal.EnableMe();
|
||||
sl_VOIP.EnableMe();
|
||||
//ch_AJLocal.EnableMe();
|
||||
ch_AJPublic.EnableMe();
|
||||
//ch_AJTeam.EnableMe();
|
||||
ed_Active.EnableMe();
|
||||
ed_ChatPassword.EnableMe();
|
||||
co_Quality.EnableMe();
|
||||
co_LANQuality.EnableMe();
|
||||
ch_AutoSpeak.EnableMe();
|
||||
}
|
||||
else
|
||||
{
|
||||
//ch_AJLocal.DisableMe();
|
||||
sl_VOIP.DisableMe();
|
||||
//ch_AJLocal.DisableMe();
|
||||
ch_AJPublic.DisableMe();
|
||||
//ch_AJTeam.DisableMe();
|
||||
ed_Active.DisableMe();
|
||||
ed_ChatPassword.DisableMe();
|
||||
co_Quality.DisableMe();
|
||||
co_LANQuality.DisableMe();
|
||||
ch_AutoSpeak.DisableMe();
|
||||
}
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Begin Object class=GUISectionBackground Name=AudioBK1
|
||||
WinWidth=0.485000
|
||||
WinHeight=0.65
|
||||
WinLeft=0.000948
|
||||
WinTop=0.1
|
||||
Caption="Sound System"
|
||||
End Object
|
||||
i_BG1=AudioBK1
|
||||
|
||||
Begin Object class=GUISectionBackground Name=AudioBK3
|
||||
WinWidth=0.502751
|
||||
WinHeight=0.65
|
||||
WinLeft=0.495826
|
||||
WinTop=0.1
|
||||
Caption="Voice Chat"
|
||||
End Object
|
||||
i_BG3=AudioBK3
|
||||
|
||||
Begin Object class=moSlider Name=AudioEffectsVolumeSlider
|
||||
WinWidth=0.450000
|
||||
WinLeft=0.524024
|
||||
WinTop=0.070522
|
||||
MinValue=0.0
|
||||
MaxValue=0.5//1.0
|
||||
Caption="Effects Volume"
|
||||
Hint="Adjusts the volume of all in game sound effects."
|
||||
LabelJustification=TXTA_Left
|
||||
ComponentJustification=TXTA_Right
|
||||
CaptionWidth=0.5
|
||||
ComponentWidth=-1
|
||||
bAutoSizeCaption=True
|
||||
OnLoadINI=InternalOnLoadINI
|
||||
OnChange=InternalOnChange
|
||||
INIOption="@Internal"
|
||||
INIDefault="0.35"
|
||||
TabOrder=1
|
||||
End Object
|
||||
sl_EffectsVol=AudioEffectsVolumeSlider
|
||||
|
||||
Begin Object class=moSlider Name=AudioMusicVolume
|
||||
WinWidth=0.450000
|
||||
WinLeft=0.018164
|
||||
WinTop=0.070522
|
||||
Caption="Music Volume"
|
||||
LabelJustification=TXTA_Left
|
||||
ComponentJustification=TXTA_Right
|
||||
CaptionWidth=0.5
|
||||
ComponentWidth=-1
|
||||
bAutoSizeCaption=True
|
||||
MinValue=0.0
|
||||
MaxValue=0.5//1.0
|
||||
OnLoadINI=InternalOnLoadINI
|
||||
OnChange=InternalOnChange
|
||||
INIOption="@Internal"
|
||||
INIDefault="0.25"
|
||||
Hint="Adjusts the volume of the background music."
|
||||
TabOrder=2
|
||||
End Object
|
||||
sl_MusicVol=AudioMusicVolume
|
||||
|
||||
Begin Object Class=moSlider Name=VoiceVolume
|
||||
WinWidth=0.408907
|
||||
WinLeft=0.518507
|
||||
WinTop=0.142484
|
||||
Caption="Voice Chat Volume"
|
||||
Hint="Adjusts the volume of other players' voice chat communication."
|
||||
IniOption="@Internal"
|
||||
INIDefault="1.0"
|
||||
OnLoadINI=InternalOnLoadINI
|
||||
OnChange=InternalOnChange
|
||||
RenderWeight=1.04
|
||||
TabOrder=3
|
||||
MinValue=1.0
|
||||
MaxValue=10.0
|
||||
CaptionWidth=0.5
|
||||
ComponentWidth=-1
|
||||
bAutoSizeCaption=True
|
||||
ComponentJustification=TXTA_Right
|
||||
LabelJustification=TXTA_Left
|
||||
End Object
|
||||
sl_VOIP=VoiceVolume
|
||||
|
||||
Begin Object class=moComboBox Name=AudioMode
|
||||
WinWidth=0.450000
|
||||
WinLeft=0.018164
|
||||
WinTop=0.149739
|
||||
Caption="Audio Mode"
|
||||
INIOption="@Internal"
|
||||
INIDefault="Software 3D Audio"
|
||||
OnLoadINI=InternalOnLoadINI
|
||||
OnChange=InternalOnChange
|
||||
Hint="Changes the audio system mode."
|
||||
CaptionWidth=0.5
|
||||
LabelJustification=TXTA_Left
|
||||
ComponentJustification=TXTA_Right
|
||||
bReadOnly=true
|
||||
TabOrder=4
|
||||
End Object
|
||||
co_Mode=AudioMode
|
||||
|
||||
Begin Object class=moCheckBox Name=AudioLowDetail
|
||||
WinWidth=0.45
|
||||
WinLeft=0.018164
|
||||
WinTop=0.235052
|
||||
Caption="Low Sound Detail"
|
||||
INIOption="@Internal"
|
||||
INIDefault="False"
|
||||
OnLoadINI=InternalOnLoadINI
|
||||
OnChange=InternalOnChange
|
||||
Hint="Lowers quality of sound."
|
||||
CaptionWidth=0.94
|
||||
bSquare=true
|
||||
ComponentJustification=TXTA_Left
|
||||
TabOrder=5
|
||||
End Object
|
||||
ch_LowDetail=AudioLowDetail
|
||||
|
||||
Begin Object class=moCheckBox Name=AudioDefaultDriver
|
||||
WinWidth=0.45
|
||||
WinLeft=0.018164
|
||||
WinTop=0.320365
|
||||
Caption="System Driver"
|
||||
Hint="Use system installed OpenAL driver"
|
||||
INIOption="@Internal"
|
||||
INIDefault="False"
|
||||
OnLoadINI=InternalOnLoadINI
|
||||
OnChange=InternalOnChange
|
||||
CaptionWidth=0.94
|
||||
ComponentJustification=TXTA_Left
|
||||
TabOrder=6
|
||||
End Object
|
||||
ch_Default=AudioDefaultDriver
|
||||
|
||||
Begin Object class=moCheckBox Name=AudioReverseStereo
|
||||
WinWidth=0.45
|
||||
WinLeft=0.018164
|
||||
WinTop=0.405678
|
||||
Caption="Reverse Stereo"
|
||||
Hint="Reverses the left and right audio channels."
|
||||
INIOption="@Internal"
|
||||
INIDefault="False"
|
||||
OnLoadINI=InternalOnLoadINI
|
||||
OnChange=InternalOnChange
|
||||
CaptionWidth=0.94
|
||||
ComponentJustification=TXTA_Left
|
||||
TabOrder=7
|
||||
End Object
|
||||
ch_ReverseStereo=AudioReverseStereo
|
||||
|
||||
Begin Object class=moCheckBox Name=AudioMessageBeep
|
||||
WinWidth=0.45
|
||||
WinLeft=0.524024
|
||||
WinTop=0.405678
|
||||
Caption="Message Beep"
|
||||
Hint="Enables a beep when receiving a text message from other players."
|
||||
INIOption="@Internal"
|
||||
INIDefault="True"
|
||||
OnLoadINI=InternalOnLoadINI
|
||||
OnChange=InternalOnChange
|
||||
CaptionWidth=0.94
|
||||
bSquare=true
|
||||
ComponentJustification=TXTA_Left
|
||||
TabOrder=9
|
||||
End Object
|
||||
ch_MessageBeep=AudioMessageBeep
|
||||
|
||||
Begin Object class=moCheckBox Name=EnableVoiceChat
|
||||
WinWidth=0.461134
|
||||
WinLeft=0.527734
|
||||
WinTop=0.834777
|
||||
INIOption="@Internal"
|
||||
OnLoadINI=InternalOnLoadINI
|
||||
OnChange=InternalOnChange
|
||||
Hint="Enables the voice chat system during online matches."
|
||||
Caption="Enable Voice Chat"
|
||||
CaptionWidth=-1
|
||||
bSquare=true
|
||||
TabOrder=20
|
||||
ComponentJustification=TXTA_Right
|
||||
End Object
|
||||
ch_VoiceChat=EnableVoiceChat
|
||||
|
||||
Begin Object Class=moCheckBox Name=Dampen
|
||||
WinWidth=0.826652
|
||||
WinLeft=0.086280
|
||||
WinTop=0.145784
|
||||
Caption="Dampen Game Volume When Using VOIP"
|
||||
Hint="Dampens the volume of the game when receiving VOIP communications."
|
||||
IniOption="@Internal"
|
||||
OnLoadINI=InternalOnLoadIni
|
||||
OnChange=InternalOnChange
|
||||
bSquare=True
|
||||
ComponentJustification=TXTA_Right
|
||||
LabelJustification=TXTA_Left
|
||||
ComponentWidth=-1
|
||||
CaptionWidth=0.94
|
||||
TabOrder=21
|
||||
End Object
|
||||
ch_Dampen=Dampen
|
||||
|
||||
Begin Object Class=moCheckBox Name=AutoJoinPublic
|
||||
WinWidth=0.826652
|
||||
WinLeft=0.086280
|
||||
WinTop=0.145784
|
||||
Caption="Autojoin Public Channel"
|
||||
Hint="Automatically join the 'Public' channel upon connecting to a server."
|
||||
IniOption="@Internal"
|
||||
OnLoadINI=InternalOnLoadIni
|
||||
OnChange=InternalOnChange
|
||||
bSquare=True
|
||||
ComponentJustification=TXTA_Right
|
||||
LabelJustification=TXTA_Left
|
||||
ComponentWidth=-1
|
||||
CaptionWidth=0.94
|
||||
TabOrder=23
|
||||
End Object
|
||||
ch_AJPublic=AutoJoinPublic
|
||||
|
||||
Begin Object Class=moCheckBox Name=AutoSpeakCheckbox
|
||||
WinWidth=0.442638
|
||||
WinHeight=0.060000
|
||||
WinLeft=0.039812
|
||||
WinTop=0.603526
|
||||
Caption="Auto-select Active Channel"
|
||||
Hint="Automatically set an active channel when you join a server. The default channel is determined by the gametype, but you can specify your own using the editbox below"
|
||||
IniOption="@Internal"
|
||||
OnLoadINI=InternalOnLoadIni
|
||||
OnChange=InternalOnChange
|
||||
bSquare=True
|
||||
ComponentJustification=TXTA_Right
|
||||
LabelJustification=TXTA_Left
|
||||
ComponentWidth=-1
|
||||
CaptionWidth=0.8
|
||||
TabOrder=24
|
||||
bBoundToParent=True
|
||||
bScaleToParent=True
|
||||
End Object
|
||||
ch_AutoSpeak=AutoSpeakCheckbox
|
||||
|
||||
Begin Object Class=moEditBox Name=DefaultActiveChannelEditBox
|
||||
WinWidth=0.420403
|
||||
WinLeft=0.032569
|
||||
WinTop=0.757277
|
||||
Hint="Enter the name of the channel to speak on by default when you join the server. To use the default chatroom for whichever gametype you're playing, leave this field empty"
|
||||
Caption="Default Channel Name"
|
||||
IniOption="@Internal"
|
||||
OnLoadIni=InternalOnLoadIni
|
||||
OnChange=InternalOnChange
|
||||
ComponentJustification=TXTA_Right
|
||||
LabelJustification=TXTA_Left
|
||||
CaptionWidth=0.6
|
||||
ComponentWidth=-1
|
||||
TabOrder=25
|
||||
End Object
|
||||
ed_Active=DefaultActiveChannelEditBox
|
||||
|
||||
Begin Object Class=moEditBox Name=ChatPasswordEdit
|
||||
WinWidth=0.420403
|
||||
WinLeft=0.032569
|
||||
WinTop=0.332828
|
||||
Hint="Set a password on your personal chat room to limit who is allowed to join"
|
||||
Caption="Chat Password"
|
||||
IniOption="@Internal"
|
||||
OnLoadIni=InternalOnLoadIni
|
||||
OnChange=InternalOnChange
|
||||
ComponentJustification=TXTA_Right
|
||||
LabelJustification=TXTA_Left
|
||||
CaptionWidth=0.6
|
||||
ComponentWidth=-1
|
||||
bAutoSizeCaption=True
|
||||
TabOrder=26
|
||||
End Object
|
||||
ed_ChatPassword=ChatPasswordEdit
|
||||
|
||||
Begin Object class=moComboBox Name=VoiceQuality
|
||||
WinWidth=0.408907
|
||||
WinLeft=0.523390
|
||||
WinTop=0.241391
|
||||
Caption="Internet Quality"
|
||||
Hint="Determines the codec used to transmit voice chat to and from internet servers."
|
||||
IniOption="@Internal"
|
||||
OnLoadINI=InternalOnLoadINI
|
||||
OnChange=InternalOnChange
|
||||
TabOrder=27
|
||||
bReadOnly=True
|
||||
CaptionWidth=0.6
|
||||
ComponentWidth=-1
|
||||
bAutoSizeCaption=True
|
||||
ComponentJustification=TXTA_Right
|
||||
LabelJustification=TXTA_Left
|
||||
End Object
|
||||
co_Quality=VoiceQuality
|
||||
|
||||
Begin Object class=moComboBox Name=VoiceQualityLAN
|
||||
WinWidth=0.408907
|
||||
WinLeft=0.523390
|
||||
WinTop=0.333786
|
||||
Caption="LAN Quality"
|
||||
Hint="Determines the codec used to transmit voice chat to and from LAN servers."
|
||||
IniOption="@Internal"
|
||||
OnLoadINI=InternalOnLoadINI
|
||||
OnChange=InternalOnChange
|
||||
TabOrder=28
|
||||
bReadOnly=True
|
||||
CaptionWidth=0.6
|
||||
ComponentWidth=-1
|
||||
bAutoSizeCaption=True
|
||||
ComponentJustification=TXTA_Right
|
||||
LabelJustification=TXTA_Left
|
||||
End Object
|
||||
co_LANQuality=VoiceQualityLAN
|
||||
|
||||
VoiceChatClassName="UnrealGame.TeamVoiceReplicationInfo"
|
||||
VoiceChatClass=class'Engine.VoiceChatReplicationInfo'
|
||||
|
||||
WinTop=0.15
|
||||
WinLeft=0
|
||||
WinWidth=1
|
||||
WinHeight=0.74
|
||||
bAcceptsInput=false
|
||||
|
||||
AudioModes[0]="Safe Mode"
|
||||
AudioModes[1]="3D Audio"
|
||||
AudioModes[2]="H/W 3D Audio"
|
||||
AudioModes[3]="H/W 3D + EAX"
|
||||
|
||||
VoiceModes[0]="All"
|
||||
VoiceModes[1]="No taunts"
|
||||
VoiceModes[2]="None"
|
||||
|
||||
PanelCaption="Audio"
|
||||
}
|
||||
|
||||
|
||||
6
kf_sources/KFGui/Classes/KFBotComboBox.uc
Normal file
6
kf_sources/KFGui/Classes/KFBotComboBox.uc
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
class KFBotComboBox extends moComboBox;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
ComponentClassName="KFGUI.KFGUIComboBox"
|
||||
}
|
||||
140
kf_sources/KFGui/Classes/KFBrowser_Footer.uc
Normal file
140
kf_sources/KFGui/Classes/KFBrowser_Footer.uc
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
class KFBrowser_Footer extends UT2K4Browser_Footer;
|
||||
|
||||
var localized string StopCaption;
|
||||
|
||||
function UpdateActiveButtons(UT2K4Browser_Page CurrentPanel)
|
||||
{
|
||||
if (CurrentPanel == None)
|
||||
return;
|
||||
|
||||
UpdateButtonState( b_Join, CurrentPanel.IsJoinAvailable( b_Join.Caption ) );
|
||||
UpdateButtonState( b_Refresh, CurrentPanel.IsRefreshAvailable( b_Refresh.Caption ) );
|
||||
//UpdateButtonState( b_Spectate, CurrentPanel.IsSpectateAvailable( b_Spectate.Caption ) );
|
||||
//UpdateButtonState( b_Filter, CurrentPanel.IsFilterAvailable( b_Filter.Caption ) );
|
||||
}
|
||||
|
||||
function bool InternalOnClick(GUIComponent Sender)
|
||||
{
|
||||
if (GUIButton(Sender) == None)
|
||||
return false;
|
||||
|
||||
if (Sender == b_Back)
|
||||
{
|
||||
Controller.CloseMenu(False);
|
||||
if ( PlayerOwner().Level.NetMode != NM_Client )
|
||||
{
|
||||
Controller.CloseAll(true, true);
|
||||
Controller.OpenMenu(Controller.GetMainMenuClass());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( Sender == b_Join )
|
||||
{
|
||||
p_Anchor.JoinClicked();
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( Sender == b_Spectate )
|
||||
{
|
||||
p_Anchor.SpectateClicked();
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( Sender == b_Refresh )
|
||||
{
|
||||
p_Anchor.RefreshClicked();
|
||||
|
||||
if( KFServerListPageInternet( p_Anchor .c_Tabs.ActiveTab.MyPanel ) != none )
|
||||
{
|
||||
if( KFServerListPageInternet( p_Anchor .c_Tabs.ActiveTab.MyPanel ).bQueryRunning )
|
||||
{
|
||||
b_refresh.Caption = StopCaption;
|
||||
}
|
||||
else
|
||||
{
|
||||
b_refresh.Caption = KFServerListPageInternet( p_Anchor .c_Tabs.ActiveTab.MyPanel ).RefreshCaption;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*if ( Sender == b_Filter )
|
||||
{
|
||||
p_Anchor.FilterClicked();
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function UpdateButtonState( GUIButton But, bool Active )
|
||||
{
|
||||
if ( Active )
|
||||
EnableComponent(But);
|
||||
else DisableComponent(But);
|
||||
}
|
||||
|
||||
function PositionButtons( Canvas C )
|
||||
{
|
||||
// local bool b;
|
||||
|
||||
/* b = b_Filter.bVisible;
|
||||
b_Filter.bVisible = false;
|
||||
*/
|
||||
super(ButtonFooter).PositionButtons(C);
|
||||
|
||||
/* b_Filter.bVisible = b;
|
||||
b_Filter.WinLeft = GetMargin();
|
||||
*/
|
||||
}
|
||||
|
||||
function float GetButtonLeft()
|
||||
{
|
||||
// local bool bWasVisible;
|
||||
local float Result;
|
||||
|
||||
/* bWasVisible = b_Filter.bVisible;
|
||||
b_Filter.bVisible = False;
|
||||
|
||||
|
||||
b_Filter.bVisible = bWasVisible;
|
||||
*/
|
||||
Result = super(ButtonFooter).GetButtonLeft();
|
||||
return Result;
|
||||
}
|
||||
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
WinHeight=0.05
|
||||
ButtonHeight=0.035
|
||||
ButtonWidth=0.12
|
||||
WinLeft=0.000000
|
||||
WinTop=0.95000
|
||||
|
||||
Padding=0.40
|
||||
|
||||
Begin Object class=GUITitleBar name=BrowserStatus
|
||||
WinLeft=0.0
|
||||
WinTop=0.3
|
||||
WinWidth=0.5
|
||||
WinHeight=0.4
|
||||
StyleName="TextLabel"
|
||||
Caption=""
|
||||
bUseTextHeight=false
|
||||
Justification=TXTA_Left
|
||||
bBoundToParent=True
|
||||
bScaleToParent=True
|
||||
FontScale=FNS_Small
|
||||
End Object
|
||||
t_StatusBar=BrowserStatus
|
||||
|
||||
b_Filter=none
|
||||
b_Spectate=none
|
||||
|
||||
StopCaption="STOP"
|
||||
}
|
||||
36
kf_sources/KFGui/Classes/KFBrowser_RulesList.uc
Normal file
36
kf_sources/KFGui/Classes/KFBrowser_RulesList.uc
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
class KFBrowser_RulesList extends Browser_RulesList;
|
||||
|
||||
var localized string LateJoinersString;
|
||||
|
||||
function string LocalizeRules( string code )
|
||||
{
|
||||
switch( caps(code) )
|
||||
{
|
||||
case "TRUE": return TrueString;
|
||||
case "FALSE": return FalseString;
|
||||
case "SERVERMODE": return ServerModeString;
|
||||
case "DEDICATED": return DedicatedString;
|
||||
case "NON-DEDICATED": return NonDedicatedString;
|
||||
case "ADMINNAME": return AdminNameString;
|
||||
case "ADMINEMAIL": return AdminEmailString;
|
||||
case "PASSWORD": return PasswordString;
|
||||
case "GAMESTATS": return GameStatsString;
|
||||
case "GAMESPEED": return GameSpeedString;
|
||||
case "MUTATOR": return MutatorString;
|
||||
case "BALANCETEAMS": return BalanceTeamsString;
|
||||
case "PLAYERSBALANCETEAMS": return PlayersBalanceTeamsString;
|
||||
case "FRIENDLYFIRE": return FriendlyFireString;
|
||||
case "GOALSCORE": return GoalScoreString;
|
||||
case "TIMELIMIT": return TimeLimitString;
|
||||
case "MINPLAYERS": return MinPlayersString;
|
||||
case "bNoLateJoiners": return LateJoinersString;
|
||||
// case "TRANSLOCATOR": return TranslocatorString;
|
||||
//case "WEAPONSTAY": return WeaponStayString;
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
LateJoinersString = "No Late Joiners"
|
||||
}
|
||||
483
kf_sources/KFGui/Classes/KFBuyMenuFilter.uc
Normal file
483
kf_sources/KFGui/Classes/KFBuyMenuFilter.uc
Normal file
|
|
@ -0,0 +1,483 @@
|
|||
//=============================================================================
|
||||
// Buy Menu Filter for the trader
|
||||
//=============================================================================
|
||||
// Killing Floor Source
|
||||
// Copyright (C) 2013 Tripwire Interactive LLC
|
||||
// Jeff "Captain Mallard" Robinson
|
||||
//=============================================================================
|
||||
class KFBuyMenuFilter extends GUIMultiComponent;
|
||||
|
||||
var texture CurPerkBack;
|
||||
var texture NoPerkIcon;
|
||||
var texture FavoritesIcon;
|
||||
|
||||
var automated GUIImage PerkBack0;
|
||||
var automated GUIImage PerkBack1;
|
||||
var automated GUIImage PerkBack2;
|
||||
var automated GUIImage PerkBack3;
|
||||
var automated GUIImage PerkBack4;
|
||||
var automated GUIImage PerkBack5;
|
||||
var automated GUIImage PerkBack6;
|
||||
var automated GUIImage PerkBack7;
|
||||
var automated GUIImage PerkBack8;
|
||||
|
||||
var automated KFIndexedGUIImage PerkSelectIcon0;
|
||||
var automated KFIndexedGUIImage PerkSelectIcon1;
|
||||
var automated KFIndexedGUIImage PerkSelectIcon2;
|
||||
var automated KFIndexedGUIImage PerkSelectIcon3;
|
||||
var automated KFIndexedGUIImage PerkSelectIcon4;
|
||||
var automated KFIndexedGUIImage PerkSelectIcon5;
|
||||
var automated KFIndexedGUIImage PerkSelectIcon6;
|
||||
var automated KFIndexedGUIImage PerkSelectIcon7;
|
||||
var automated KFIndexedGUIImage PerkSelectIcon8;
|
||||
|
||||
const NUM_FILTERS = 9;
|
||||
var GUIImage PerkSelectBacks[9];
|
||||
var GUIImage PerkSelectIcons[9];
|
||||
|
||||
var int MaxPerks;
|
||||
var int CurPerk;
|
||||
var bool bPerkChange;
|
||||
|
||||
var float CurX;
|
||||
var float CurY;
|
||||
var float BoxSizeX;
|
||||
var float BoxSizeY;
|
||||
var float SpacerX;
|
||||
var float SpacerY;
|
||||
|
||||
var KFSteamStatsAndAchievements KFStatsAndAchievements;
|
||||
var bool bResized;
|
||||
|
||||
event InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
Super.InitComponent(MyController, MyOwner);
|
||||
}
|
||||
|
||||
event Opened(GUIComponent Sender)
|
||||
{
|
||||
super.Opened( Sender );
|
||||
CheckPerks(KFStatsAndAchievements);
|
||||
}
|
||||
|
||||
event Closed(GUIComponent Sender, bool bCancelled)
|
||||
{
|
||||
super.Closed(Sender, bCancelled);
|
||||
}
|
||||
|
||||
event ResolutionChanged( int ResX, int ResY )
|
||||
{
|
||||
super.ResolutionChanged(ResX, ResY);
|
||||
}
|
||||
|
||||
function bool MyOnDraw(Canvas C)
|
||||
{
|
||||
local int i;
|
||||
|
||||
super.OnDraw(C);
|
||||
|
||||
// make em square
|
||||
if ( !bResized )
|
||||
{
|
||||
ResizeIcons(C);
|
||||
RealignIcons();
|
||||
}
|
||||
|
||||
// Draw the available perks
|
||||
for ( i = 0; i < NUM_FILTERS; i++ )
|
||||
{
|
||||
// no icon for non-perk weapons, what to do?
|
||||
if( i < MaxPerks )
|
||||
{
|
||||
PerkSelectIcons[i].Image = class'KFGameType'.default.LoadedSkills[i].default.OnHUDIcon;
|
||||
}
|
||||
else if( i == MaxPerks ) // No-perk
|
||||
{
|
||||
PerkSelectIcons[i].Image = NoPerkIcon;
|
||||
}
|
||||
else if( i == MaxPerks + 1 ) // favorites
|
||||
{
|
||||
PerkSelectIcons[i].Image = FavoritesIcon;
|
||||
}
|
||||
|
||||
if ( i != CurPerk )
|
||||
{
|
||||
PerkSelectIcons[i].ImageColor.A = 95;
|
||||
}
|
||||
else
|
||||
{
|
||||
PerkSelectIcons[i].ImageColor.A = 255;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function bool InternalOnClick(GUIComponent Sender)
|
||||
{
|
||||
local PlayerController PC;
|
||||
|
||||
// Grab the Player Controller for later use
|
||||
PC = PlayerOwner();
|
||||
|
||||
if ( Sender.IsA('KFIndexedGUIImage') )
|
||||
{
|
||||
if ( KFPlayerController(PC) != none )
|
||||
{
|
||||
CurPerk = KFIndexedGUIImage(Sender).Index;
|
||||
KFPlayerController(PC).BuyMenuFilterIndex = KFIndexedGUIImage(Sender).Index;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function ResizeIcons(Canvas C)
|
||||
{
|
||||
local float sizeX, sizeY;
|
||||
|
||||
sizeX = (C.ClipY / C.ClipX) * BoxSizeX;
|
||||
sizeY = (C.ClipY / C.ClipX) * BoxSizeY;
|
||||
|
||||
PerkBack0.WinWidth = sizeX;
|
||||
PerkSelectBacks[0] = PerkBack0;
|
||||
PerkBack1.WinWidth = sizeX;
|
||||
PerkSelectBacks[1] = PerkBack1;
|
||||
PerkBack2.WinWidth = sizeX;
|
||||
PerkSelectBacks[2] = PerkBack2;
|
||||
PerkBack3.WinWidth = sizeX;
|
||||
PerkSelectBacks[3] = PerkBack3;
|
||||
PerkBack4.WinWidth = sizeX;
|
||||
PerkSelectBacks[4] = PerkBack4;
|
||||
PerkBack5.WinWidth = sizeX;
|
||||
PerkSelectBacks[5] = PerkBack5;
|
||||
PerkBack6.WinWidth = sizeX;
|
||||
PerkSelectBacks[6] = PerkBack6;
|
||||
PerkBack7.WinWidth = sizeX;
|
||||
PerkSelectBacks[7] = PerkBack7;
|
||||
PerkBack8.WinWidth = sizeX;
|
||||
PerkSelectBacks[8] = PerkBack8;
|
||||
|
||||
PerkSelectIcon0.WinWidth = sizeY;
|
||||
PerkSelectIcons[0] = PerkSelectIcon0;
|
||||
PerkSelectIcon1.WinWidth = sizeY;
|
||||
PerkSelectIcons[1] = PerkSelectIcon1;
|
||||
PerkSelectIcon2.WinWidth = sizeY;
|
||||
PerkSelectIcons[2] = PerkSelectIcon2;
|
||||
PerkSelectIcon3.WinWidth = sizeY;
|
||||
PerkSelectIcons[3] = PerkSelectIcon3;
|
||||
PerkSelectIcon4.WinWidth = sizeY;
|
||||
PerkSelectIcons[4] = PerkSelectIcon4;
|
||||
PerkSelectIcon5.WinWidth = sizeY;
|
||||
PerkSelectIcons[5] = PerkSelectIcon5;
|
||||
PerkSelectIcon6.WinWidth = sizeY;
|
||||
PerkSelectIcons[6] = PerkSelectIcon6;
|
||||
PerkSelectIcon7.WinWidth = sizeY;
|
||||
PerkSelectIcons[7] = PerkSelectIcon7;
|
||||
PerkSelectIcon8.WinWidth = sizeY;
|
||||
PerkSelectIcons[8] = PerkSelectIcon8;
|
||||
|
||||
bResized = true;
|
||||
}
|
||||
|
||||
function RealignIcons()
|
||||
{
|
||||
local int i;
|
||||
local float IconWidth, TotalWidth, WidthLeft, WidthLeftForEachIcon, IconPadding;
|
||||
|
||||
IconWidth = PerkSelectIcons[0].WinWidth;
|
||||
TotalWidth = IconWidth * 9.f;
|
||||
WidthLeft = 1.f - TotalWidth;
|
||||
WidthLeftForEachIcon = WidthLeft / 9.f;
|
||||
IconPadding = WidthLeftForEachIcon / 2.f;
|
||||
for( i = 0; i < 9; ++i ) // size of PerkSelectIcons
|
||||
{
|
||||
PerkSelectIcons[i].WinLeft = IconPadding + (IconPadding + IconWidth + IconPadding) * i;
|
||||
PerkSelectBacks[i].WinLeft = IconPadding + (IconPadding + IconWidth + IconPadding) * i;
|
||||
}
|
||||
}
|
||||
|
||||
function CheckPerks(KFSteamStatsAndAchievements StatsAndAchievements)
|
||||
{
|
||||
local int i;
|
||||
local KFPlayerController KFPC;
|
||||
|
||||
// Grab the Player Controller for later use
|
||||
KFPC = KFPlayerController(PlayerOwner());
|
||||
|
||||
// Hold onto our reference
|
||||
KFStatsAndAchievements = StatsAndAchievements;
|
||||
|
||||
// Update the ItemCount and select the first item
|
||||
MaxPerks = class'KFGameType'.default.LoadedSkills.Length;
|
||||
|
||||
for ( i = 0; i < MaxPerks; i++ )
|
||||
{
|
||||
if ( (KFPC != none && class'KFGameType'.default.LoadedSkills[i] == KFPC.SelectedVeterancy) ||
|
||||
(KFPC == none && class'KFGameType'.default.LoadedSkills[i] == class'KFPlayerController'.default.SelectedVeterancy) )
|
||||
{
|
||||
CurPerk = i;
|
||||
KFPC.BuyMenuFilterIndex = CurPerk;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
OnDraw=MyOnDraw
|
||||
|
||||
BoxSizeX=0.04
|
||||
BoxSizeY=0.04
|
||||
SpacerX=0.001
|
||||
SpacerY=0.004
|
||||
|
||||
MaxPerks=6
|
||||
|
||||
CurPerkBack=Texture'KF_InterfaceArt_tex.Menu.Perk_box'
|
||||
NoPerkIcon=Texture'KillingFloor2HUD.PerkIcons.No_Perk_Icon'
|
||||
FavoritesIcon=Texture'KillingFloor2HUD.PerkIcons.Favorite_Perk_Icon'
|
||||
|
||||
Begin Object class=GUIImage Name=PB0
|
||||
WinWidth=0.04
|
||||
WinHeight=0.04
|
||||
WinLeft=0.7
|
||||
WinTop=0.05
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Perk_box_unselected'
|
||||
ImageStyle=ISTY_Scaled
|
||||
Renderweight=0.5
|
||||
bBoundToParent=true
|
||||
End Object
|
||||
PerkBack0=PB0
|
||||
|
||||
Begin Object class=GUIImage Name=PB1
|
||||
WinWidth=0.04
|
||||
WinHeight=0.04
|
||||
WinLeft=0.735
|
||||
WinTop=0.05
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Perk_box_unselected'
|
||||
ImageStyle=ISTY_Scaled
|
||||
Renderweight=0.5
|
||||
bBoundToParent=true
|
||||
End Object
|
||||
PerkBack1=PB1
|
||||
|
||||
Begin Object class=GUIImage Name=PB2
|
||||
WinWidth=0.04
|
||||
WinHeight=0.04
|
||||
WinLeft=0.77
|
||||
WinTop=0.05
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Perk_box_unselected'
|
||||
ImageStyle=ISTY_Scaled
|
||||
Renderweight=0.5
|
||||
bBoundToParent=true
|
||||
End Object
|
||||
PerkBack2=PB2
|
||||
|
||||
Begin Object class=GUIImage Name=PB3
|
||||
WinWidth=0.04
|
||||
WinHeight=0.04
|
||||
WinLeft=0.805
|
||||
WinTop=0.05
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Perk_box_unselected'
|
||||
ImageStyle=ISTY_Scaled
|
||||
Renderweight=0.5
|
||||
bBoundToParent=true
|
||||
End Object
|
||||
PerkBack3=PB3
|
||||
|
||||
Begin Object class=GUIImage Name=PB4
|
||||
WinWidth=0.04
|
||||
WinHeight=0.04
|
||||
WinLeft=0.84
|
||||
WinTop=0.05
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Perk_box_unselected'
|
||||
ImageStyle=ISTY_Scaled
|
||||
Renderweight=0.5
|
||||
bBoundToParent=true
|
||||
End Object
|
||||
PerkBack4=PB4
|
||||
|
||||
Begin Object class=GUIImage Name=PB5
|
||||
WinWidth=0.04
|
||||
WinHeight=0.04
|
||||
WinLeft=0.875
|
||||
WinTop=0.05
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Perk_box_unselected'
|
||||
ImageStyle=ISTY_Scaled
|
||||
Renderweight=0.5
|
||||
bBoundToParent=true
|
||||
End Object
|
||||
PerkBack5=PB5
|
||||
|
||||
Begin Object class=GUIImage Name=PB6
|
||||
WinWidth=0.04
|
||||
WinHeight=0.04
|
||||
WinLeft=0.91
|
||||
WinTop=0.05
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Perk_box_unselected'
|
||||
ImageStyle=ISTY_Scaled
|
||||
Renderweight=0.5
|
||||
bBoundToParent=true
|
||||
End Object
|
||||
PerkBack6=PB6
|
||||
|
||||
Begin Object class=GUIImage Name=PB7
|
||||
WinWidth=0.04
|
||||
WinHeight=0.04
|
||||
WinLeft=0.945
|
||||
WinTop=0.05
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Perk_box_unselected'
|
||||
ImageStyle=ISTY_Scaled
|
||||
Renderweight=0.5
|
||||
bBoundToParent=true
|
||||
End Object
|
||||
PerkBack7=PB7
|
||||
|
||||
Begin Object class=GUIImage Name=PB8
|
||||
WinWidth=0.04
|
||||
WinHeight=0.04
|
||||
WinLeft=0.98
|
||||
WinTop=0.05
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Perk_box_unselected'
|
||||
ImageStyle=ISTY_Scaled
|
||||
Renderweight=0.5
|
||||
bBoundToParent=true
|
||||
End Object
|
||||
PerkBack8=PB8
|
||||
|
||||
Begin Object class=KFIndexedGUIImage Name=PSI0
|
||||
WinWidth=0.040
|
||||
WinHeight=0.040
|
||||
WinLeft=0.7
|
||||
WinTop=0.052
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Perk_box_unselected'
|
||||
ImageStyle=ISTY_Scaled
|
||||
Renderweight=0.6
|
||||
OnClick=InternalOnClick
|
||||
Hint="Medic"
|
||||
Index=0
|
||||
bBoundToParent=true
|
||||
End Object
|
||||
PerkSelectIcon0=PSI0
|
||||
|
||||
Begin Object class=KFIndexedGUIImage Name=PSI1
|
||||
WinWidth=0.040
|
||||
WinHeight=0.040
|
||||
WinLeft=0.735
|
||||
WinTop=0.052
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Perk_box_unselected'
|
||||
ImageStyle=ISTY_Scaled
|
||||
Renderweight=0.6
|
||||
OnClick=InternalOnClick
|
||||
Hint="Support"
|
||||
Index=1
|
||||
bBoundToParent=true
|
||||
End Object
|
||||
PerkSelectIcon1=PSI1
|
||||
|
||||
Begin Object class=KFIndexedGUIImage Name=PSI2
|
||||
WinWidth=0.040
|
||||
WinHeight=0.040
|
||||
WinLeft=0.770
|
||||
WinTop=0.052
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Perk_box_unselected'
|
||||
ImageStyle=ISTY_Scaled
|
||||
Renderweight=0.6
|
||||
OnClick=InternalOnClick
|
||||
Hint="Sharpshooter"
|
||||
Index=2
|
||||
bBoundToParent=true
|
||||
End Object
|
||||
PerkSelectIcon2=PSI2
|
||||
|
||||
Begin Object class=KFIndexedGUIImage Name=PSI3
|
||||
WinWidth=0.040
|
||||
WinHeight=0.040
|
||||
WinLeft=0.805
|
||||
WinTop=0.052
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Perk_box_unselected'
|
||||
ImageStyle=ISTY_Scaled
|
||||
Renderweight=0.6
|
||||
OnClick=InternalOnClick
|
||||
Hint="Commando"
|
||||
Index=3
|
||||
bBoundToParent=true
|
||||
End Object
|
||||
PerkSelectIcon3=PSI3
|
||||
|
||||
Begin Object class=KFIndexedGUIImage Name=PSI4
|
||||
WinWidth=0.040
|
||||
WinHeight=0.040
|
||||
WinLeft=0.840
|
||||
WinTop=0.052
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Perk_box_unselected'
|
||||
ImageStyle=ISTY_Scaled
|
||||
Renderweight=0.6
|
||||
OnClick=InternalOnClick
|
||||
Hint="Berserker"
|
||||
Index=4
|
||||
bBoundToParent=true
|
||||
End Object
|
||||
PerkSelectIcon4=PSI4
|
||||
|
||||
Begin Object class=KFIndexedGUIImage Name=PSI5
|
||||
WinWidth=0.040
|
||||
WinHeight=0.040
|
||||
WinLeft=0.875
|
||||
WinTop=0.052
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Perk_box_unselected'
|
||||
ImageStyle=ISTY_Scaled
|
||||
Renderweight=0.6
|
||||
OnClick=InternalOnClick
|
||||
Hint="Firebug"
|
||||
Index=5
|
||||
bBoundToParent=true
|
||||
End Object
|
||||
PerkSelectIcon5=PSI5
|
||||
|
||||
Begin Object class=KFIndexedGUIImage Name=PSI6
|
||||
WinWidth=0.040
|
||||
WinHeight=0.040
|
||||
WinLeft=0.91
|
||||
WinTop=0.052
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Perk_box_unselected'
|
||||
ImageStyle=ISTY_Scaled
|
||||
Renderweight=0.6
|
||||
OnClick=InternalOnClick
|
||||
Hint="Demolitions"
|
||||
Index=6
|
||||
bBoundToParent=true
|
||||
End Object
|
||||
PerkSelectIcon6=PSI6
|
||||
|
||||
Begin Object class=KFIndexedGUIImage Name=PSI7
|
||||
WinWidth=0.040
|
||||
WinHeight=0.040
|
||||
WinLeft=0.945
|
||||
WinTop=0.052
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Perk_box_unselected'
|
||||
ImageStyle=ISTY_Scaled
|
||||
Renderweight=0.6
|
||||
OnClick=InternalOnClick
|
||||
Hint="Non-perk"
|
||||
Index=7
|
||||
bBoundToParent=true
|
||||
End Object
|
||||
PerkSelectIcon7=PSI7
|
||||
|
||||
Begin Object class=KFIndexedGUIImage Name=PSI8
|
||||
WinWidth=0.040
|
||||
WinHeight=0.040
|
||||
WinLeft=0.98
|
||||
WinTop=0.052
|
||||
Image=Texture'KF_InterfaceArt_tex.Menu.Perk_box_unselected'
|
||||
ImageStyle=ISTY_Scaled
|
||||
Renderweight=0.6
|
||||
OnClick=InternalOnClick
|
||||
Hint="Favorites"
|
||||
Index=8
|
||||
bBoundToParent=true
|
||||
End Object
|
||||
PerkSelectIcon8=PSI8
|
||||
}
|
||||
|
||||
808
kf_sources/KFGui/Classes/KFBuyMenuInvList.uc
Normal file
808
kf_sources/KFGui/Classes/KFBuyMenuInvList.uc
Normal file
|
|
@ -0,0 +1,808 @@
|
|||
//=============================================================================
|
||||
// The trader menu's list with player's current inventory
|
||||
//=============================================================================
|
||||
// Killing Floor Source
|
||||
// Copyright (C) 2009 Tripwire Interactive LLC
|
||||
// Dayle "Xienen" Flowers
|
||||
//=============================================================================
|
||||
class KFBuyMenuInvList extends GUIVertList;
|
||||
|
||||
// Settings
|
||||
var float ItemBGWidthScale;
|
||||
var float AmmoBGWidthScale;
|
||||
var float ClipButtonWidthScale;
|
||||
var float AmmoBGHeightScale;
|
||||
var float ButtonBGHeightScale;
|
||||
var float EquipmentBGWidthScale;
|
||||
var float EquipmentBGHeightScale;
|
||||
var float ItemBGYOffset;
|
||||
var float AmmoSpacing;
|
||||
var float ItemNameSpacing;
|
||||
var float ButtonSpacing;
|
||||
var float EquipmentBGXOffset;
|
||||
var float EquipmentBGYOffset;
|
||||
|
||||
// Strings
|
||||
var localized string EquipmentString;
|
||||
var localized string BuyString;
|
||||
var localized string PurchasedString;
|
||||
var localized string RepairString;
|
||||
|
||||
// Display
|
||||
var texture ItemBackgroundLeft;
|
||||
var texture ItemBackgroundRight;
|
||||
var texture SelectedItemBackgroundLeft;
|
||||
var texture SelectedItemBackgroundRight;
|
||||
var texture DisabledItemBackgroundLeft;
|
||||
var texture DisabledItemBackgroundRight;
|
||||
var texture AmmoBackground;
|
||||
var texture ButtonBackground;
|
||||
var texture HoverButtonBackground;
|
||||
var texture DisabledButtonBackground;
|
||||
|
||||
var array<string> NameStrings;
|
||||
var array<string> AmmoStrings;
|
||||
var array<string> ClipPriceStrings;
|
||||
var array<string> FillPriceStrings;
|
||||
var array<texture> PerkTextures;
|
||||
|
||||
// state
|
||||
var array<GUIBuyable> MyBuyables;
|
||||
var int MouseOverIndex;
|
||||
var int MouseOverXIndex;
|
||||
|
||||
var bool bNeedsUpdate;
|
||||
var int UpdateCounter;
|
||||
var float AutoFillCost;
|
||||
|
||||
delegate OnBuyClipClick(GUIBuyable Buyable);
|
||||
delegate OnFillAmmoClick(GUIBuyable Buyable);
|
||||
delegate OnBuyVestClick();
|
||||
|
||||
event InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
Super.InitComponent(MyController, MyOwner);
|
||||
OnDrawItem = DrawInvItem;
|
||||
UpdateMyBuyables();
|
||||
}
|
||||
|
||||
event Opened(GUIComponent Sender)
|
||||
{
|
||||
super.Opened(Sender);
|
||||
UpdateMyBuyables();
|
||||
}
|
||||
|
||||
event Closed(GUIComponent Sender, bool bCancelled)
|
||||
{
|
||||
NameStrings.Remove(0, NameStrings.Length);
|
||||
AmmoStrings.Remove(0, AmmoStrings.Length);
|
||||
ClipPriceStrings.Remove(0, ClipPriceStrings.Length);
|
||||
FillPriceStrings.Remove(0, FillPriceStrings.Length);
|
||||
PerkTextures.Remove(0, PerkTextures.Length);
|
||||
MyBuyables.Remove(0, MyBuyables.Length);
|
||||
|
||||
super.Closed(Sender, bCancelled);
|
||||
}
|
||||
|
||||
function UpdateMyBuyables()
|
||||
{
|
||||
local class<KFVeterancyTypes> PlayerVeterancy;
|
||||
local KFPlayerReplicationInfo KFPRI;
|
||||
local GUIBuyable MyBuyable, KnifeBuyable, FragBuyable, SecondaryAmmoBuyable;
|
||||
local Inventory CurInv;
|
||||
local KFLevelRules KFLR;
|
||||
local bool bHasDual, bHasDualCannon, bHasDual44, bhasDualM23, bHasDualFlareGuns, bHasGoldDualCannon;
|
||||
local float CurAmmo, MaxAmmo;
|
||||
local class<KFWeaponPickup> MyPickup, MyPrimaryPickup;
|
||||
local int DualDivider, NumInvItems;
|
||||
|
||||
//Let's start with our current inventory
|
||||
if ( PlayerOwner().Pawn.Inventory == none )
|
||||
{
|
||||
log("Inventory is none!");
|
||||
return;
|
||||
}
|
||||
|
||||
DualDivider = 1;
|
||||
AutoFillCost = 0.00000;
|
||||
|
||||
//Clear the MyBuyables array
|
||||
MyBuyables.Remove(0, MyBuyables.Length);
|
||||
|
||||
// Grab Players Veterancy for quick reference
|
||||
if ( KFPlayerController(PlayerOwner()) != none && KFPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo).ClientVeteranSkill != none )
|
||||
{
|
||||
PlayerVeterancy = KFPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo).ClientVeteranSkill;
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerVeterancy = class'KFVeterancyTypes';
|
||||
}
|
||||
|
||||
KFPRI = KFPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo);
|
||||
|
||||
//Check if we have dualies or dual hand cannons
|
||||
for ( CurInv = PlayerOwner().Pawn.Inventory; CurInv != none; CurInv = CurInv.Inventory )
|
||||
{
|
||||
if ( KFWeapon(CurInv) != none )
|
||||
{
|
||||
if ( KFWeapon(CurInv).default.PickupClass == class'DualDeaglePickup' )
|
||||
{
|
||||
bHasDualCannon = true;
|
||||
}
|
||||
|
||||
if ( KFWeapon(CurInv).default.PickupClass == class'GoldenDualDeaglePickup' )
|
||||
{
|
||||
bHasGoldDualCannon = true;
|
||||
}
|
||||
|
||||
if ( KFWeapon(CurInv).default.PickupClass == class'DualiesPickup' )
|
||||
{
|
||||
bHasDual = true;
|
||||
}
|
||||
|
||||
if ( KFWeapon(CurInv).default.PickupClass == class'Dual44MagnumPickup' )
|
||||
{
|
||||
bHasDual44 = true;
|
||||
}
|
||||
|
||||
if ( KFWeapon(CurInv).default.PickupClass == class'DualMK23Pickup' )
|
||||
{
|
||||
bhasDualM23 = true;
|
||||
}
|
||||
|
||||
if ( KFWeapon(CurInv).default.PickupClass == class'DualFlareRevolverPickup' )
|
||||
{
|
||||
bHasDualFlareGuns = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Grab the items for sale, we need the categories
|
||||
foreach PlayerOwner().DynamicActors(class'KFLevelRules', KFLR)
|
||||
break;
|
||||
|
||||
// Fill the Buyables
|
||||
NumInvItems = 0;
|
||||
for ( CurInv = PlayerOwner().Pawn.Inventory; CurInv != none; CurInv = CurInv.Inventory )
|
||||
{
|
||||
if ( CurInv.IsA('Ammunition') )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// No need for Syringe and Welder
|
||||
if ( CurInv.IsA('Welder') || CurInv.IsA('Syringe') )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( CurInv.IsA('DualDeagle') || CurInv.IsA('Dual44Magnum') || CurInv.IsA('DualMK23Pistol')
|
||||
|| CurInv.IsA('DualFlareRevolver') )
|
||||
{
|
||||
DualDivider = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
DualDivider = 1;
|
||||
}
|
||||
|
||||
MyPickup = class<KFWeaponPickup>(KFWeapon(CurInv).default.PickupClass);
|
||||
|
||||
// if we already own dualies, we do not need the single 9mm in the list
|
||||
if ( (bHasDual && MyPickup == class'SinglePickup') ||
|
||||
(bHasDualCannon && MyPickup == class'DeaglePickup') ||
|
||||
(bHasGoldDualCannon && MyPickup == class'GoldenDeaglePickup') ||
|
||||
(bHasDual44 && MyPickup == class'Magnum44Pickup') ||
|
||||
(bhasDualM23 && MyPickup == class'MK23Pickup') ||
|
||||
(bHasDualFlareGuns && MyPickup == class'FlareRevolverPickup'))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( CurInv.IsA('KFWeapon') )
|
||||
{
|
||||
KFWeapon(CurInv).GetAmmoCount(MaxAmmo, CurAmmo);
|
||||
|
||||
MyBuyable = new class'GUIBuyable';
|
||||
|
||||
// This is a rather ugly way to support Secondary Ammo because all of the needed Data is jumbled between the Weapon and it's 2 Pickup Classes
|
||||
if ( KFWeapon(CurInv).bHasSecondaryAmmo )
|
||||
{
|
||||
MyPrimaryPickup = MyPickup.default.PrimaryWeaponPickup;
|
||||
|
||||
MyBuyable.ItemName = MyPickup.default.ItemShortName;
|
||||
MyBuyable.ItemDescription = KFWeapon(CurInv).default.Description;
|
||||
MyBuyable.ItemCategorie = KFLR.EquipmentCategories[MyPickup.default.EquipmentCategoryID].EquipmentCategoryName;
|
||||
MyBuyable.ItemImage = KFWeapon(CurInv).default.TraderInfoTexture;
|
||||
MyBuyable.ItemWeaponClass = KFWeapon(CurInv).class;
|
||||
MyBuyable.ItemAmmoClass = KFWeapon(CurInv).default.FireModeClass[0].default.AmmoClass;
|
||||
MyBuyable.ItemPickupClass = MyPrimaryPickup;
|
||||
MyBuyable.ItemCost = (float(MyPickup.default.Cost) * PlayerVeterancy.static.GetCostScaling(KFPRI, MyPickup)) / DualDivider;
|
||||
MyBuyable.ItemAmmoCost = MyPrimaryPickup.default.AmmoCost * PlayerVeterancy.static.GetAmmoCostScaling(KFPRI, MyPrimaryPickup) * PlayerVeterancy.static.GetMagCapacityMod(KFPRI, KFWeapon(CurInv));
|
||||
MyBuyable.ItemFillAmmoCost = (int(((MaxAmmo - CurAmmo) * float(MyPrimaryPickup.default.AmmoCost)) / float(KFWeapon(CurInv).default.MagCapacity))) * PlayerVeterancy.static.GetAmmoCostScaling(KFPRI, MyPrimaryPickup);
|
||||
MyBuyable.ItemWeight = KFWeapon(CurInv).Weight;
|
||||
MyBuyable.ItemPower = MyPickup.default.PowerValue;
|
||||
MyBuyable.ItemRange = MyPickup.default.RangeValue;
|
||||
MyBuyable.ItemSpeed = MyPickup.default.SpeedValue;
|
||||
MyBuyable.ItemAmmoCurrent = CurAmmo;
|
||||
MyBuyable.ItemAmmoMax = MaxAmmo;
|
||||
MyBuyable.bMelee = (KFMeleeGun(CurInv) != none);
|
||||
MyBuyable.bSaleList = false;
|
||||
MyBuyable.ItemPerkIndex = MyPickup.default.CorrespondingPerkIndex;
|
||||
|
||||
if ( KFWeapon(CurInv) != none && KFWeapon(CurInv).SellValue != -1 )
|
||||
{
|
||||
MyBuyable.ItemSellValue = KFWeapon(CurInv).SellValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
MyBuyable.ItemSellValue = MyBuyable.ItemCost * 0.75;
|
||||
}
|
||||
|
||||
if ( !MyBuyable.bMelee && int(MaxAmmo) > int(CurAmmo))
|
||||
{
|
||||
AutoFillCost += MyBuyable.ItemFillAmmoCost;
|
||||
}
|
||||
|
||||
MyBuyable.bSellable = !KFWeapon(CurInv).default.bKFNeverThrow;
|
||||
|
||||
MyBuyables.Insert(0, 1);
|
||||
MyBuyables[0] = MyBuyable;
|
||||
|
||||
NumInvItems++;
|
||||
|
||||
KFWeapon(CurInv).GetSecondaryAmmoCount(MaxAmmo, CurAmmo);
|
||||
|
||||
MyBuyable = new class'GUIBuyable';
|
||||
|
||||
MyBuyable.ItemName = MyPickup.default.SecondaryAmmoShortName;
|
||||
MyBuyable.ItemDescription = KFWeapon(CurInv).default.Description;
|
||||
MyBuyable.ItemCategorie = KFLR.EquipmentCategories[MyPickup.default.EquipmentCategoryID].EquipmentCategoryName;
|
||||
MyBuyable.ItemImage = KFWeapon(CurInv).default.TraderInfoTexture;
|
||||
MyBuyable.ItemWeaponClass = KFWeapon(CurInv).class;
|
||||
MyBuyable.ItemAmmoClass = KFWeapon(CurInv).default.FireModeClass[1].default.AmmoClass;
|
||||
MyBuyable.ItemPickupClass = MyPickup;
|
||||
MyBuyable.ItemCost = (float(MyPickup.default.Cost) * PlayerVeterancy.static.GetCostScaling(KFPRI, MyPickup)) / DualDivider;
|
||||
MyBuyable.ItemAmmoCost = MyPickup.default.AmmoCost * PlayerVeterancy.static.GetAmmoCostScaling(KFPRI, MyPickup) * PlayerVeterancy.static.GetMagCapacityMod(KFPRI, KFWeapon(CurInv));
|
||||
MyBuyable.ItemFillAmmoCost = (int(((MaxAmmo - CurAmmo) * float(MyPickup.default.AmmoCost)) /* Secondary Mags always have a Mag Capacity of 1? / float(KFWeapon(CurInv).default.MagCapacity)*/)) * PlayerVeterancy.static.GetAmmoCostScaling(KFPRI, MyPickup);
|
||||
MyBuyable.ItemWeight = KFWeapon(CurInv).Weight;
|
||||
MyBuyable.ItemPower = MyPickup.default.PowerValue;
|
||||
MyBuyable.ItemRange = MyPickup.default.RangeValue;
|
||||
MyBuyable.ItemSpeed = MyPickup.default.SpeedValue;
|
||||
MyBuyable.ItemAmmoCurrent = CurAmmo;
|
||||
MyBuyable.ItemAmmoMax = MaxAmmo;
|
||||
MyBuyable.bMelee = (KFMeleeGun(CurInv) != none);
|
||||
MyBuyable.bSaleList = false;
|
||||
MyBuyable.ItemPerkIndex = MyPickup.default.CorrespondingPerkIndex;
|
||||
|
||||
if ( KFWeapon(CurInv) != none && KFWeapon(CurInv).SellValue != -1 )
|
||||
{
|
||||
MyBuyable.ItemSellValue = KFWeapon(CurInv).SellValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
MyBuyable.ItemSellValue = MyBuyable.ItemCost * 0.75;
|
||||
}
|
||||
|
||||
if ( !MyBuyable.bMelee && int(MaxAmmo) > int(CurAmmo))
|
||||
{
|
||||
AutoFillCost += MyBuyable.ItemFillAmmoCost;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MyBuyable.ItemName = MyPickup.default.ItemShortName;
|
||||
MyBuyable.ItemDescription = KFWeapon(CurInv).default.Description;
|
||||
MyBuyable.ItemCategorie = KFLR.EquipmentCategories[MyPickup.default.EquipmentCategoryID].EquipmentCategoryName;
|
||||
MyBuyable.ItemImage = KFWeapon(CurInv).default.TraderInfoTexture;
|
||||
MyBuyable.ItemWeaponClass = KFWeapon(CurInv).class;
|
||||
MyBuyable.ItemAmmoClass = KFWeapon(CurInv).default.FireModeClass[0].default.AmmoClass;
|
||||
MyBuyable.ItemPickupClass = MyPickup;
|
||||
MyBuyable.ItemCost = (float(MyPickup.default.Cost) * PlayerVeterancy.static.GetCostScaling(KFPRI, MyPickup)) / DualDivider;
|
||||
MyBuyable.ItemAmmoCost = MyPickup.default.AmmoCost * PlayerVeterancy.static.GetAmmoCostScaling(KFPRI, MyPickup) * PlayerVeterancy.static.GetMagCapacityMod(KFPRI, KFWeapon(CurInv));
|
||||
if( MyPickup == class'HuskGunPickup' )
|
||||
{
|
||||
MyBuyable.ItemFillAmmoCost = (int(((MaxAmmo - CurAmmo) * float(MyPickup.default.AmmoCost)) / float(MyPickup.default.BuyClipSize))) * PlayerVeterancy.static.GetAmmoCostScaling(KFPRI, MyPickup);
|
||||
}
|
||||
else
|
||||
{
|
||||
MyBuyable.ItemFillAmmoCost = (int(((MaxAmmo - CurAmmo) * float(MyPickup.default.AmmoCost)) / float(KFWeapon(CurInv).default.MagCapacity))) * PlayerVeterancy.static.GetAmmoCostScaling(KFPRI, MyPickup);
|
||||
}
|
||||
MyBuyable.ItemWeight = KFWeapon(CurInv).Weight;
|
||||
MyBuyable.ItemPower = MyPickup.default.PowerValue;
|
||||
MyBuyable.ItemRange = MyPickup.default.RangeValue;
|
||||
MyBuyable.ItemSpeed = MyPickup.default.SpeedValue;
|
||||
MyBuyable.ItemAmmoCurrent = CurAmmo;
|
||||
MyBuyable.ItemAmmoMax = MaxAmmo;
|
||||
MyBuyable.bMelee = (KFMeleeGun(CurInv) != none);
|
||||
MyBuyable.bSaleList = false;
|
||||
MyBuyable.ItemPerkIndex = MyPickup.default.CorrespondingPerkIndex;
|
||||
|
||||
if ( KFWeapon(CurInv) != none && KFWeapon(CurInv).SellValue != -1 )
|
||||
{
|
||||
MyBuyable.ItemSellValue = KFWeapon(CurInv).SellValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
MyBuyable.ItemSellValue = MyBuyable.ItemCost * 0.75;
|
||||
}
|
||||
|
||||
if ( !MyBuyable.bMelee && int(MaxAmmo) > int(CurAmmo))
|
||||
{
|
||||
AutoFillCost += MyBuyable.ItemFillAmmoCost;
|
||||
}
|
||||
}
|
||||
|
||||
if ( KFWeapon(CurInv).bHasSecondaryAmmo )
|
||||
{
|
||||
MyBuyable.bSellable = false;
|
||||
SecondaryAmmoBuyable = MyBuyable;
|
||||
}
|
||||
else if ( CurInv.IsA('Knife') )
|
||||
{
|
||||
MyBuyable.bSellable = false;
|
||||
KnifeBuyable = MyBuyable;
|
||||
}
|
||||
else if ( CurInv.IsA('Frag') )
|
||||
{
|
||||
MyBuyable.bSellable = false;
|
||||
FragBuyable = MyBuyable;
|
||||
}
|
||||
else if ( NumInvItems < 7 )
|
||||
{
|
||||
MyBuyable.bSellable = !KFWeapon(CurInv).default.bKFNeverThrow;
|
||||
|
||||
MyBuyables.Insert(0, 1);
|
||||
MyBuyables[0] = MyBuyable;
|
||||
|
||||
NumInvItems++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MyBuyable = new class'GUIBuyable';
|
||||
|
||||
MyBuyable.ItemName = class'BuyableVest'.default.ItemName;
|
||||
MyBuyable.ItemDescription = class'BuyableVest'.default.ItemDescription;
|
||||
MyBuyable.ItemCategorie = "";
|
||||
MyBuyable.ItemImage = class'BuyableVest'.default.ItemImage;
|
||||
MyBuyable.ItemAmmoCurrent = PlayerOwner().Pawn.ShieldStrength;
|
||||
MyBuyable.ItemAmmoMax = 100;
|
||||
MyBuyable.ItemCost = int(class'BuyableVest'.default.ItemCost * PlayerVeterancy.static.GetCostScaling(KFPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo), class'Vest'));
|
||||
MyBuyable.ItemAmmoCost = MyBuyable.ItemCost / 100;
|
||||
MyBuyable.ItemFillAmmoCost = int((100.0 - MyBuyable.ItemAmmoCurrent) * MyBuyable.ItemAmmoCost);
|
||||
MyBuyable.bIsVest = true;
|
||||
MyBuyable.bMelee = false;
|
||||
MyBuyable.bSaleList = false;
|
||||
MyBuyable.bSellable = false;
|
||||
MyBuyable.ItemPerkIndex = class'BuyableVest'.default.CorrespondingPerkIndex;
|
||||
|
||||
MyBuyables[7] = none;
|
||||
|
||||
if ( SecondaryAmmoBuyable != none )
|
||||
{
|
||||
MyBuyables[8] = SecondaryAmmoBuyable;
|
||||
}
|
||||
else
|
||||
{
|
||||
MyBuyables[8] = KnifeBuyable;
|
||||
}
|
||||
|
||||
MyBuyables[9] = FragBuyable;
|
||||
MyBuyables[10] = MyBuyable;
|
||||
|
||||
//Now Update the list
|
||||
UpdateList();
|
||||
}
|
||||
|
||||
function UpdateList()
|
||||
{
|
||||
local int i;
|
||||
|
||||
if ( MyBuyables.Length < 1 )
|
||||
{
|
||||
bNeedsUpdate = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// Clear the arrays
|
||||
NameStrings.Remove(0, NameStrings.Length);
|
||||
AmmoStrings.Remove(0, AmmoStrings.Length);
|
||||
ClipPriceStrings.Remove(0, ClipPriceStrings.Length);
|
||||
FillPriceStrings.Remove(0, FillPriceStrings.Length);
|
||||
PerkTextures.Remove(0, PerkTextures.Length);
|
||||
|
||||
// Update the ItemCount and select the first item
|
||||
ItemCount = MyBuyables.Length;
|
||||
|
||||
// Update the players inventory list
|
||||
for ( i = 0; i < ItemCount; i++ )
|
||||
{
|
||||
if ( MyBuyables[i] == none )
|
||||
continue;
|
||||
|
||||
NameStrings[i] = MyBuyables[i].ItemName; //@ "(" $ MyBuyables[i].ItemCategorie $ ")";
|
||||
|
||||
if ( !MyBuyables[i].bIsVest )
|
||||
{
|
||||
AmmoStrings[i] = int(MyBuyables[i].ItemAmmoCurrent)$"/"$int(MyBuyables[i].ItemAmmoMax);
|
||||
|
||||
if ( MyBuyables[i].ItemAmmoCurrent < MyBuyables[i].ItemAmmoMax )
|
||||
{
|
||||
if ( MyBuyables[i].ItemAmmoCost > MyBuyables[i].ItemFillAmmoCost )
|
||||
{
|
||||
ClipPriceStrings[i] = "£" @ int(MyBuyables[i].ItemFillAmmoCost);
|
||||
}
|
||||
else
|
||||
{
|
||||
ClipPriceStrings[i] = "£" @ int(MyBuyables[i].ItemAmmoCost);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClipPriceStrings[i] = "£ 0";
|
||||
}
|
||||
|
||||
FillPriceStrings[i] = "£" @ int(MyBuyables[i].ItemFillAmmoCost);
|
||||
}
|
||||
else
|
||||
{
|
||||
AmmoStrings[i] = int((MyBuyables[i].ItemAmmoCurrent / MyBuyables[i].ItemAmmoMax) * 100.0)$"%";
|
||||
|
||||
if ( MyBuyables[i].ItemAmmoCurrent == 0 )
|
||||
{
|
||||
FillPriceStrings[i] = BuyString @ ": £" @ int(MyBuyables[i].ItemFillAmmoCost);
|
||||
}
|
||||
else if ( MyBuyables[i].ItemAmmoCurrent == 100 )
|
||||
{
|
||||
FillPriceStrings[i] = PurchasedString;
|
||||
}
|
||||
else
|
||||
{
|
||||
FillPriceStrings[i] = RepairString @ ": £" @ int(MyBuyables[i].ItemFillAmmoCost);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(MyBuyables[i].ItemPerkIndex == 7 )
|
||||
{
|
||||
PerkTextures[i] = class'KFBuyMenuSaleList'.default.NoPerkIcon;
|
||||
}
|
||||
else
|
||||
{
|
||||
PerkTextures[i] = class'KFGameType'.default.LoadedSkills[MyBuyables[i].ItemPerkIndex].default.OnHUDIcon;
|
||||
}
|
||||
}
|
||||
|
||||
if ( bNotify )
|
||||
{
|
||||
CheckLinkedObjects(Self);
|
||||
}
|
||||
|
||||
if ( MyScrollBar != none )
|
||||
{
|
||||
MyScrollBar.AlignThumb();
|
||||
}
|
||||
}
|
||||
|
||||
function bool InternalOnClick(GUIComponent Sender)
|
||||
{
|
||||
local int NewIndex;
|
||||
local float RelativeMouseX;
|
||||
|
||||
if ( IsInClientBounds() )
|
||||
{
|
||||
// Figure out which Item we're clicking on
|
||||
NewIndex = CalculateIndex();
|
||||
RelativeMouseX = Controller.MouseX - ClientBounds[0];
|
||||
if ( RelativeMouseX < ActualWidth() * ItemBGWidthScale )
|
||||
{
|
||||
if ( MyBuyables[NewIndex] != none )
|
||||
{
|
||||
SetIndex(NewIndex);
|
||||
MouseOverXIndex = 0;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RelativeMouseX -= ActualWidth() * (ItemBGWidthScale + AmmoBGWidthScale);
|
||||
|
||||
if ( RelativeMouseX > 0 )
|
||||
{
|
||||
if ( MyBuyables[NewIndex].bIsVest )
|
||||
{
|
||||
if ( (PlayerOwner().Pawn.ShieldStrength > 0 && PlayerOwner().PlayerReplicationInfo.Score >= MyBuyables[NewIndex].ItemAmmoCost) || PlayerOwner().PlayerReplicationInfo.Score >= MyBuyables[NewIndex].ItemCost )
|
||||
{
|
||||
OnBuyVestClick();
|
||||
}
|
||||
}
|
||||
else if ( RelativeMouseX < ActualWidth() * (1.0 - ItemBGWidthScale - AmmoBGWidthScale) * ClipButtonWidthScale )
|
||||
{
|
||||
// Buy Clip
|
||||
OnBuyClipClick(MyBuyables[NewIndex]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fill Ammo
|
||||
OnFillAmmoClick(MyBuyables[NewIndex]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function bool PreDraw(Canvas Canvas)
|
||||
{
|
||||
local float RelativeMouseX;
|
||||
|
||||
if ( IsInClientBounds() )
|
||||
{
|
||||
// Figure out which Item we're clicking on
|
||||
MouseOverIndex = Top + ((Controller.MouseY - ClientBounds[1]) / ItemHeight);
|
||||
if ( MouseOverIndex >= ItemCount )
|
||||
{
|
||||
MouseOverIndex = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
RelativeMouseX = Controller.MouseX - ClientBounds[0];
|
||||
if ( RelativeMouseX < ActualWidth() * ItemBGWidthScale )
|
||||
{
|
||||
MouseOverXIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
RelativeMouseX -= ActualWidth() * (ItemBGWidthScale + AmmoBGWidthScale);
|
||||
|
||||
if ( RelativeMouseX > 0 )
|
||||
{
|
||||
if ( RelativeMouseX < ActualWidth() * (1.0 - ItemBGWidthScale - AmmoBGWidthScale) * ClipButtonWidthScale )
|
||||
{
|
||||
MouseOverXIndex = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
MouseOverXIndex = 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MouseOverXIndex = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MouseOverIndex = -1;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function DrawInvItem(Canvas Canvas, int CurIndex, float X, float Y, float Width, float Height, bool bSelected, bool bPending)
|
||||
{
|
||||
local float IconBGSize, ItemBGWidth, AmmoBGWidth, ClipButtonWidth, FillButtonWidth;
|
||||
local float TempX, TempY;
|
||||
local float StringHeight, StringWidth;
|
||||
|
||||
OnClickSound=CS_Click;
|
||||
|
||||
// Initialize the Canvas
|
||||
Canvas.Style = 1;
|
||||
// Canvas.Font = class'ROHUD'.Static.GetSmallMenuFont(Canvas);
|
||||
Canvas.SetDrawColor(255, 255, 255, 255);
|
||||
|
||||
if ( MyBuyables[CurIndex] == none )
|
||||
{
|
||||
if ( CurIndex < 7 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Canvas.SetPos(X + EquipmentBGXOffset, Y + Height - EquipmentBGYOffset - EquipmentBGHeightScale * Height);
|
||||
Canvas.DrawTileStretched(AmmoBackground, EquipmentBGWidthScale * Width, EquipmentBGHeightScale * Height);
|
||||
|
||||
Canvas.SetDrawColor(175, 176, 158, 255);
|
||||
Canvas.StrLen(EquipmentString, StringWidth, StringHeight);
|
||||
Canvas.SetPos(X + EquipmentBGXOffset + ((EquipmentBGWidthScale * Width - StringWidth) / 2.0), Y + Height - EquipmentBGYOffset - EquipmentBGHeightScale * Height + ((EquipmentBGHeightScale * Height - StringHeight) / 2.0));
|
||||
Canvas.DrawText(EquipmentString);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Calculate Widths for all components
|
||||
IconBGSize = Height;
|
||||
ItemBGWidth = (Width * ItemBGWidthScale) - IconBGSize;
|
||||
AmmoBGWidth = Width * AmmoBGWidthScale;
|
||||
|
||||
if ( !MyBuyables[CurIndex].bIsVest )
|
||||
{
|
||||
FillButtonWidth = ((1.0 - ItemBGWidthScale - AmmoBGWidthScale) * Width) - ButtonSpacing;
|
||||
ClipButtonWidth = FillButtonWidth * ClipButtonWidthScale;
|
||||
FillButtonWidth -= ClipButtonWidth;
|
||||
}
|
||||
else
|
||||
{
|
||||
FillButtonWidth = ((1.0 - ItemBGWidthScale - AmmoBGWidthScale) * Width);
|
||||
}
|
||||
|
||||
// Offset for the Background
|
||||
TempX = X;
|
||||
TempY = Y;
|
||||
|
||||
// Draw Item Background
|
||||
Canvas.SetPos(TempX, TempY);
|
||||
|
||||
if ( bSelected )
|
||||
{
|
||||
Canvas.DrawTileStretched(SelectedItemBackgroundLeft, IconBGSize, IconBGSize);
|
||||
Canvas.SetPos(TempX + 4, TempY + 4);
|
||||
Canvas.DrawTile(PerkTextures[CurIndex], IconBGSize - 8, IconBGSize - 8, 0, 0, 256, 256);
|
||||
|
||||
TempX += IconBGSize;
|
||||
Canvas.SetPos(TempX, TempY + ItemBGYOffset);
|
||||
Canvas.DrawTileStretched(SelectedItemBackgroundRight, ItemBGWidth, IconBGSize - (2.0 * ItemBGYOffset));
|
||||
}
|
||||
else
|
||||
{
|
||||
Canvas.DrawTileStretched(ItemBackgroundLeft, IconBGSize, IconBGSize);
|
||||
Canvas.SetPos(TempX + 4, TempY + 4);
|
||||
Canvas.DrawTile(PerkTextures[CurIndex], IconBGSize - 8, IconBGSize - 8, 0, 0, 256, 256);
|
||||
|
||||
TempX += IconBGSize;
|
||||
Canvas.SetPos(TempX, TempY + ItemBGYOffset);
|
||||
Canvas.DrawTileStretched(ItemBackgroundRight, ItemBGWidth, IconBGSize - (2.0 * ItemBGYOffset));
|
||||
}
|
||||
|
||||
// Select Text color
|
||||
if ( CurIndex == MouseOverIndex && MouseOverXIndex == 0 )
|
||||
{
|
||||
Canvas.SetDrawColor(255, 255, 255, 255);
|
||||
}
|
||||
else
|
||||
{
|
||||
Canvas.SetDrawColor(0, 0, 0, 255);
|
||||
}
|
||||
|
||||
// Draw the item's name
|
||||
Canvas.StrLen(NameStrings[CurIndex], StringWidth, StringHeight);
|
||||
Canvas.SetPos(TempX + ItemNameSpacing, Y + ((Height - StringHeight) / 2.0));
|
||||
Canvas.DrawText(NameStrings[CurIndex]);
|
||||
|
||||
// Draw the item's ammo status if it is not a melee weapon
|
||||
if ( !MyBuyables[CurIndex].bMelee )
|
||||
{
|
||||
TempX += ItemBGWidth + AmmoSpacing;
|
||||
|
||||
Canvas.SetDrawColor(255, 255, 255, 255);
|
||||
Canvas.SetPos(TempX, TempY + ((Height - AmmoBGHeightScale * Height) / 2.0));
|
||||
Canvas.DrawTileStretched(AmmoBackground, AmmoBGWidth, AmmoBGHeightScale * Height);
|
||||
|
||||
Canvas.SetDrawColor(175, 176, 158, 255);
|
||||
Canvas.StrLen(AmmoStrings[CurIndex], StringWidth, StringHeight);
|
||||
Canvas.SetPos(TempX + ((AmmoBGWidth - StringWidth) / 2.0), TempY + ((Height - StringHeight) / 2.0));
|
||||
Canvas.DrawText(AmmoStrings[CurIndex]);
|
||||
|
||||
TempX += AmmoBGWidth + AmmoSpacing;
|
||||
|
||||
Canvas.SetDrawColor(255, 255, 255, 255);
|
||||
Canvas.SetPos(TempX, TempY + ((Height - ButtonBGHeightScale * Height) / 2.0));
|
||||
|
||||
if ( !MyBuyables[CurIndex].bIsVest )
|
||||
{
|
||||
if ( MyBuyables[CurIndex].ItemAmmoCurrent >= MyBuyables[CurIndex].ItemAmmoMax ||
|
||||
(PlayerOwner().PlayerReplicationInfo.Score < MyBuyables[CurIndex].ItemFillAmmoCost && PlayerOwner().PlayerReplicationInfo.Score < MyBuyables[CurIndex].ItemAmmoCost) )
|
||||
{
|
||||
Canvas.DrawTileStretched(DisabledButtonBackground, ClipButtonWidth, ButtonBGHeightScale * Height);
|
||||
Canvas.SetDrawColor(0, 0, 0, 255);
|
||||
}
|
||||
else if ( CurIndex == MouseOverIndex && MouseOverXIndex == 1 )
|
||||
{
|
||||
Canvas.DrawTileStretched(HoverButtonBackground, ClipButtonWidth, ButtonBGHeightScale * Height);
|
||||
}
|
||||
else
|
||||
{
|
||||
Canvas.DrawTileStretched(ButtonBackground, ClipButtonWidth, ButtonBGHeightScale * Height);
|
||||
Canvas.SetDrawColor(0, 0, 0, 255);
|
||||
}
|
||||
|
||||
Canvas.StrLen(ClipPriceStrings[CurIndex], StringWidth, StringHeight);
|
||||
Canvas.SetPos(TempX + ((ClipButtonWidth - StringWidth) / 2.0), TempY + ((Height - StringHeight) / 2.0));
|
||||
Canvas.DrawText(ClipPriceStrings[CurIndex]);
|
||||
|
||||
TempX += ClipButtonWidth + ButtonSpacing;
|
||||
|
||||
Canvas.SetDrawColor(255, 255, 255, 255);
|
||||
Canvas.SetPos(TempX, TempY + ((Height - ButtonBGHeightScale * Height) / 2.0));
|
||||
|
||||
if ( MyBuyables[CurIndex].ItemAmmoCurrent >= MyBuyables[CurIndex].ItemAmmoMax ||
|
||||
(PlayerOwner().PlayerReplicationInfo.Score < MyBuyables[CurIndex].ItemFillAmmoCost && PlayerOwner().PlayerReplicationInfo.Score < MyBuyables[CurIndex].ItemAmmoCost) )
|
||||
{
|
||||
Canvas.DrawTileStretched(DisabledButtonBackground, FillButtonWidth, ButtonBGHeightScale * Height);
|
||||
Canvas.SetDrawColor(0, 0, 0, 255);
|
||||
}
|
||||
else if ( CurIndex == MouseOverIndex && MouseOverXIndex == 2 )
|
||||
{
|
||||
Canvas.DrawTileStretched(HoverButtonBackground, FillButtonWidth, ButtonBGHeightScale * Height);
|
||||
}
|
||||
else
|
||||
{
|
||||
Canvas.DrawTileStretched(ButtonBackground, FillButtonWidth, ButtonBGHeightScale * Height);
|
||||
Canvas.SetDrawColor(0, 0, 0, 255);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( (PlayerOwner().Pawn.ShieldStrength > 0 && PlayerOwner().PlayerReplicationInfo.Score < MyBuyables[CurIndex].ItemAmmoCost) ||
|
||||
(PlayerOwner().Pawn.ShieldStrength <= 0 && PlayerOwner().PlayerReplicationInfo.Score < MyBuyables[CurIndex].ItemCost) ||
|
||||
MyBuyables[CurIndex].ItemAmmoCurrent >= MyBuyables[CurIndex].ItemAmmoMax )
|
||||
{
|
||||
Canvas.DrawTileStretched(DisabledButtonBackground, FillButtonWidth, ButtonBGHeightScale * Height);
|
||||
Canvas.SetDrawColor(0, 0, 0, 255);
|
||||
}
|
||||
else if ( CurIndex == MouseOverIndex && MouseOverXIndex >= 1 )
|
||||
{
|
||||
Canvas.DrawTileStretched(HoverButtonBackground, FillButtonWidth, ButtonBGHeightScale * Height);
|
||||
}
|
||||
else
|
||||
{
|
||||
Canvas.DrawTileStretched(ButtonBackground, FillButtonWidth, ButtonBGHeightScale * Height);
|
||||
Canvas.SetDrawColor(0, 0, 0, 255);
|
||||
}
|
||||
}
|
||||
|
||||
Canvas.StrLen(FillPriceStrings[CurIndex], StringWidth, StringHeight);
|
||||
Canvas.SetPos(TempX + ((FillButtonWidth - StringWidth) / 2.0), TempY + ((Height - StringHeight) / 2.0));
|
||||
Canvas.DrawText(FillPriceStrings[CurIndex]);
|
||||
}
|
||||
|
||||
Canvas.SetDrawColor(255, 255, 255, 255);
|
||||
}
|
||||
}
|
||||
|
||||
function float InvItemHeight(Canvas c)
|
||||
{
|
||||
return (MenuOwner.ActualHeight() / 11) - 1.0;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
ItemBGWidthScale=0.51
|
||||
AmmoBGWidthScale=0.19
|
||||
ClipButtonWidthScale=0.45
|
||||
AmmoBGHeightScale=0.5
|
||||
ButtonBGHeightScale=0.5
|
||||
EquipmentBGWidthScale=0.35
|
||||
EquipmentBGHeightScale=0.60
|
||||
ItemBGYOffset=6.0
|
||||
AmmoSpacing=1.0
|
||||
ItemNameSpacing=10.0
|
||||
ButtonSpacing=3.0
|
||||
EquipmentBGXOffset=3.0
|
||||
EquipmentBGYOffset=6.0
|
||||
|
||||
EquipmentString="Equipment"
|
||||
BuyString="Buy"
|
||||
PurchasedString="Purchased"
|
||||
RepairString="Repair"
|
||||
|
||||
OnPreDraw=PreDraw
|
||||
|
||||
ItemBackgroundLeft=Texture'KF_InterfaceArt_tex.Menu.Item_box_box'
|
||||
ItemBackgroundRight=Texture'KF_InterfaceArt_tex.Menu.Item_box_bar'
|
||||
SelectedItemBackgroundLeft=Texture'KF_InterfaceArt_tex.Menu.Item_box_box_Highlighted'
|
||||
SelectedItemBackgroundRight=Texture'KF_InterfaceArt_tex.Menu.Item_box_bar_Highlighted'
|
||||
DisabledItemBackgroundLeft=Texture'KF_InterfaceArt_tex.Menu.Item_box_box_disabled'
|
||||
DisabledItemBackgroundRight=Texture'KF_InterfaceArt_tex.Menu.Item_box_bar_disabled'
|
||||
AmmoBackground=Texture'KF_InterfaceArt_tex.Menu.Innerborder_transparent'
|
||||
ButtonBackground=Texture'KF_InterfaceArt_tex.Menu.Button'
|
||||
HoverButtonBackground=Texture'KF_InterfaceArt_tex.Menu.button_Highlight'
|
||||
DisabledButtonBackground=Texture'KF_InterfaceArt_tex.Menu.button_disabled'
|
||||
|
||||
FontScale=FNS_Medium
|
||||
GetItemHeight=KFBuyMenuInvList.InvItemHeight
|
||||
}
|
||||
43
kf_sources/KFGui/Classes/KFBuyMenuInvListBox.uc
Normal file
43
kf_sources/KFGui/Classes/KFBuyMenuInvListBox.uc
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
//-----------------------------------------------------------
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
class KFBuyMenuInvListBox extends GUIListBoxBase;
|
||||
|
||||
var KFBuyMenuInvList List;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
Super.InitComponent(MyController,MyOwner);
|
||||
|
||||
if ( DefaultListClass != "" )
|
||||
{
|
||||
List = KFBuyMenuInvList(AddComponent(DefaultListClass));
|
||||
|
||||
if (List == None)
|
||||
{
|
||||
log(Class$".InitComponent - Could not create default list ["$DefaultListClass$"]");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( List == none )
|
||||
{
|
||||
Warn("Could not initialize list!");
|
||||
return;
|
||||
}
|
||||
|
||||
InitBaseList(List);
|
||||
}
|
||||
|
||||
function GUIBuyable GetSelectedBuyable()
|
||||
{
|
||||
if ( List.MyBuyables[List.Index] != none )
|
||||
{
|
||||
return List.MyBuyables[List.Index];
|
||||
}
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
DefaultListClass="KFGUI.KFBuyMenuInvList"
|
||||
}
|
||||
306
kf_sources/KFGui/Classes/KFBuyMenuOptionsList.uc
Normal file
306
kf_sources/KFGui/Classes/KFBuyMenuOptionsList.uc
Normal file
|
|
@ -0,0 +1,306 @@
|
|||
//-----------------------------------------------------------
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
class KFBuyMenuOptionsList extends GUIVertList;
|
||||
|
||||
// Settings
|
||||
var float ItemBorder; // Percent of Height to leave blank inside Item Background
|
||||
var float TextTopOffset; // Percent of Height to offset top of Text
|
||||
var float ItemSpacing; // Number of Pixels between Items
|
||||
|
||||
// Display
|
||||
var texture ItemBackground;
|
||||
var texture SelectedItemBackground;
|
||||
var array<string> PrimaryStrings;
|
||||
var array<string> SecondaryStrings;
|
||||
|
||||
// state
|
||||
var GUIBuyable TheBuyable;
|
||||
var int MouseOverIndex;
|
||||
|
||||
var bool bNeedsUpdate;
|
||||
var bool bNoAutoFill;
|
||||
var int UpdateCounter;
|
||||
|
||||
var localized string BuyString;
|
||||
var localized string SellString;
|
||||
var localized string BuyClipString;
|
||||
var localized string FillString;
|
||||
var localized string AutoFillString;
|
||||
var localized string ExitString;
|
||||
|
||||
var int AutoFillCost;
|
||||
|
||||
event InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
Super.InitComponent(MyController, MyOwner);
|
||||
OnDrawItem = DrawInvItem;
|
||||
}
|
||||
|
||||
event Closed(GUIComponent Sender, bool bCancelled)
|
||||
{
|
||||
PrimaryStrings.Remove(0, PrimaryStrings.Length);
|
||||
SecondaryStrings.Remove(0, SecondaryStrings.Length);
|
||||
TheBuyable = none;
|
||||
|
||||
super.Closed(Sender, bCancelled);
|
||||
}
|
||||
|
||||
function UpdateList(GUIBuyable Buyable)
|
||||
{
|
||||
// Clear the arrays
|
||||
PrimaryStrings.Remove(0, PrimaryStrings.Length);
|
||||
SecondaryStrings.Remove(0, SecondaryStrings.Length);
|
||||
|
||||
//Reset item count
|
||||
ItemCount = 6;
|
||||
|
||||
TheBuyable = Buyable;
|
||||
|
||||
if ( TheBuyable != none )
|
||||
{
|
||||
// First we have to check if the item is inv or sale
|
||||
if ( !TheBuyable.bSaleList )
|
||||
{
|
||||
//Ok, this item is already in our inventory, now let's see if we can sell it or not
|
||||
if ( TheBuyable.bSellable )
|
||||
{
|
||||
// Now we have to check if it is a melee weapon && Check if we already have full ammo
|
||||
if ( !TheBuyable.bMelee && int(TheBuyable.ItemAmmoCurrent) < int(TheBuyable.ItemAmmoMax))
|
||||
{
|
||||
// Sell Button
|
||||
PrimaryStrings[0] = SellString;
|
||||
SecondaryStrings[0] = "£" $ int(TheBuyable.ItemCost * 0.75) ;
|
||||
|
||||
// Single Clip
|
||||
PrimaryStrings[1] = BuyClipString;
|
||||
SecondaryStrings[1] = "£" $ int(TheBuyable.ItemAmmoCost);
|
||||
|
||||
// Fill up
|
||||
PrimaryStrings[2] = FillString;
|
||||
SecondaryStrings[2] = "£" $ int(TheBuyable.ItemFillAmmoCost);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Sell Button
|
||||
PrimaryStrings[2] = SellString;
|
||||
SecondaryStrings[2] = "£" $ int(TheBuyable.ItemCost * 0.75) ;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Check if it is a melee weapon
|
||||
if ( !TheBuyable.bMelee )
|
||||
{
|
||||
//Check if we already have full ammo
|
||||
if ( int(TheBuyable.ItemAmmoCurrent) < int(TheBuyable.ItemAmmoMax) )
|
||||
{
|
||||
// Single Clip
|
||||
PrimaryStrings[1] = BuyClipString;
|
||||
SecondaryStrings[1] = "£" $ int(TheBuyable.ItemAmmoCost);
|
||||
|
||||
// Fill up
|
||||
PrimaryStrings[2] = FillString;
|
||||
SecondaryStrings[2] = "£" $ int(TheBuyable.ItemFillAmmoCost);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Too heavy? Too expensive?
|
||||
if ( TheBuyable.ItemWeight + KFHumanPawn(PlayerOwner().Pawn).CurrentWeight <= KFHumanPawn(PlayerOwner().Pawn).MaxCarryWeight &&
|
||||
TheBuyable.ItemCost <= PlayerOwner().PlayerReplicationInfo.Score && PlayerOwner().SteamStatsAndAchievements.PlayerOwnsWeaponDLC(TheBuyable.ItemWeaponClass.Default.AppID) )
|
||||
{
|
||||
//This is an for sale item
|
||||
PrimaryStrings[2] = BuyString;
|
||||
SecondaryStrings[2] = "£" $ int(TheBuyable.ItemCost);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
PrimaryStrings[4] = AutoFillString;
|
||||
SecondaryStrings[4] = "£" $ AutoFillCost;
|
||||
PrimaryStrings[5] = ExitString;
|
||||
SecondaryStrings[5] = "";
|
||||
|
||||
if ( bNotify )
|
||||
{
|
||||
CheckLinkedObjects(Self);
|
||||
}
|
||||
|
||||
if ( MyScrollBar != none )
|
||||
{
|
||||
MyScrollBar.AlignThumb();
|
||||
}
|
||||
}
|
||||
|
||||
function int FindCheapestAmmo()
|
||||
{
|
||||
local Inventory CurInv;
|
||||
local int CurrentCheapest, CurrentCost;
|
||||
|
||||
CurrentCheapest = 99999;
|
||||
|
||||
for ( CurInv = PlayerOwner().Pawn.Inventory; CurInv != none; CurInv = CurInv.Inventory )
|
||||
{
|
||||
if ( CurInv.IsA('KFAmmunition') )
|
||||
{
|
||||
CurrentCost = FindAmmoCost(KFAmmunition(CurInv).Class);
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( CurrentCost < CurrentCheapest )
|
||||
{
|
||||
CurrentCheapest = CurrentCost;
|
||||
}
|
||||
}
|
||||
|
||||
return CurrentCheapest;
|
||||
}
|
||||
|
||||
function int FindAmmoCost(Class<Ammunition> AClass)
|
||||
{
|
||||
local Inventory CurInv;
|
||||
local KFWeapon MyWeapon;
|
||||
|
||||
for ( CurInv = PlayerOwner().Pawn.Inventory; CurInv != none; CurInv = CurInv.Inventory )
|
||||
{
|
||||
//if( CurInv.Class == AClass )
|
||||
//{
|
||||
// MyAmmo = Ammunition(CurInv);
|
||||
//}
|
||||
if ( KFWeapon(CurInv) != None && (Weapon(CurInv).AmmoClass[0]==AClass || Weapon(CurInv).AmmoClass[1]==AClass) )
|
||||
{
|
||||
MyWeapon = KFWeapon(CurInv);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( MyWeapon != none )
|
||||
{
|
||||
return Class<KFWeaponPickup>(MyWeapon.PickupClass).Default.AmmoCost;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 999999;
|
||||
}
|
||||
}
|
||||
|
||||
function bool PreDraw(Canvas Canvas)
|
||||
{
|
||||
if ( Controller.MouseX >= ClientBounds[0] && Controller.MouseX <= ClientBounds[2] && Controller.MouseY >= ClientBounds[1] )
|
||||
{
|
||||
// Figure out which Item we're clicking on
|
||||
MouseOverIndex = Top + ((Controller.MouseY - ClientBounds[1]) / ItemHeight);
|
||||
if ( MouseOverIndex >= ItemCount )
|
||||
{
|
||||
MouseOverIndex = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MouseOverIndex = -1;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function DrawInvItem(Canvas Canvas, int CurIndex, float X, float Y, float Width, float Height, bool bSelected, bool bPending)
|
||||
{
|
||||
local float TempX, TempY;
|
||||
local float StringHeight, StringWidth;
|
||||
|
||||
if ( PrimaryStrings[CurIndex] == "" )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
OnClickSound=CS_Click;
|
||||
|
||||
// Offset for the Background
|
||||
TempX = X;
|
||||
TempY = Y + ItemSpacing / 2.0;
|
||||
|
||||
// Initialize the Canvas
|
||||
Canvas.Style = 1;
|
||||
|
||||
// Draw Item Background
|
||||
Canvas.SetPos(TempX, TempY);
|
||||
|
||||
if ( CurIndex == MouseOverIndex )
|
||||
{
|
||||
Canvas.SetDrawColor(210, 210, 210, 255);
|
||||
Canvas.DrawTileStretched(SelectedItemBackground, Width, Height - ItemSpacing);
|
||||
}
|
||||
else
|
||||
{
|
||||
Canvas.SetDrawColor(255, 255, 255, 255);
|
||||
Canvas.DrawTileStretched(ItemBackground, Width, Height - ItemSpacing);
|
||||
}
|
||||
|
||||
// Select Text color
|
||||
if ( CurIndex == MouseOverIndex )
|
||||
{
|
||||
Canvas.SetDrawColor(189, 73, 74, 255);
|
||||
}
|
||||
else
|
||||
{
|
||||
Canvas.SetDrawColor(255, 255, 255, 255);
|
||||
}
|
||||
|
||||
if ( CurIndex == 4 )
|
||||
{
|
||||
if ( PlayerOwner().PlayerReplicationInfo.Score < FindCheapestAmmo() )
|
||||
{
|
||||
Canvas.SetDrawColor(128, 128, 128, 255);
|
||||
bNoAutoFill = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
bNoAutoFill = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Draw the function(Buy, Sell, etc.)
|
||||
Canvas.StrLen(PrimaryStrings[CurIndex], StringWidth, StringHeight);
|
||||
Canvas.SetPos(TempX+ (0.2 * Height), TempY + ((Height - ItemSpacing - StringHeight) / 2));
|
||||
Canvas.DrawText(PrimaryStrings[CurIndex]);
|
||||
|
||||
// Draw the price(if any)
|
||||
Canvas.StrLen(SecondaryStrings[CurIndex], StringWidth, StringHeight);
|
||||
Canvas.SetPos(TempX + Width - (StringWidth + (0.2 * Height)), TempY + ((Height - ItemSpacing - StringHeight) / 2));
|
||||
Canvas.DrawText(SecondaryStrings[CurIndex]);
|
||||
Canvas.SetDrawColor(255, 255, 255, 255);
|
||||
}
|
||||
|
||||
function float SaleItemHeight(Canvas c)
|
||||
{
|
||||
return ((MenuOwner.ActualHeight() / 6.0) - 1.0);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
ItemBorder=0.03
|
||||
TextTopOffset=0.05
|
||||
ItemSpacing=6.0
|
||||
|
||||
OnPreDraw=PreDraw
|
||||
|
||||
BuyString="Purchase"
|
||||
SellString="Sell Weapon"
|
||||
BuyClipString="Buy Single Clip"
|
||||
FillString="Fill Selected Ammo"
|
||||
AutoFillString="Auto Fill Ammo"
|
||||
ExitString="Exit Trader Menu"
|
||||
|
||||
ItemBackground=Texture'InterfaceArt_tex.Menu.DownTickBlurry'
|
||||
SelectedItemBackground=Texture'InterfaceArt_tex.Menu.DownTickWatched'
|
||||
|
||||
FontScale=FNS_Medium
|
||||
GetItemHeight=KFBuyMenuOptionsList.SaleItemHeight
|
||||
}
|
||||
46
kf_sources/KFGui/Classes/KFBuyMenuOptionsListBox.uc
Normal file
46
kf_sources/KFGui/Classes/KFBuyMenuOptionsListBox.uc
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
//-----------------------------------------------------------
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
class KFBuyMenuOptionsListBox extends GUIListBoxBase;
|
||||
|
||||
var KFBuyMenuOptionsList List;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
Super.InitComponent(MyController,MyOwner);
|
||||
|
||||
if ( DefaultListClass != "" )
|
||||
{
|
||||
List = KFBuyMenuOptionsList(AddComponent(DefaultListClass));
|
||||
|
||||
if (List == None)
|
||||
{
|
||||
log(Class$".InitComponent - Could not create default list ["$DefaultListClass$"]");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( List == none )
|
||||
{
|
||||
Warn("Could not initialize list!");
|
||||
return;
|
||||
}
|
||||
|
||||
InitBaseList(List);
|
||||
}
|
||||
|
||||
function int GetIndex()
|
||||
{
|
||||
return List.Index;
|
||||
}
|
||||
|
||||
function UpdateList(GUIBuyable Buyable)
|
||||
{
|
||||
List.UpdateList(Buyable);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
DefaultListClass="KFGUI.KFBuyMenuOptionsList"
|
||||
}
|
||||
|
||||
684
kf_sources/KFGui/Classes/KFBuyMenuSaleList.uc
Normal file
684
kf_sources/KFGui/Classes/KFBuyMenuSaleList.uc
Normal file
|
|
@ -0,0 +1,684 @@
|
|||
//=============================================================================
|
||||
// The trader menu's list with items for sale
|
||||
//=============================================================================
|
||||
// Killing Floor Source
|
||||
// Copyright (C) 2009 Tripwire Interactive LLC
|
||||
// Christian "schneidzekk" Schneider
|
||||
//=============================================================================
|
||||
class KFBuyMenuSaleList extends GUIVertList;
|
||||
|
||||
#exec OBJ LOAD FILE=Potato_T.utx
|
||||
|
||||
// Settings
|
||||
var float ItemBorder; // Percent of Height to leave blank inside Item Background
|
||||
var float TextTopOffset; // Percent of Height to offset top of Text
|
||||
var float ItemSpacing; // Number of Pixels between Items
|
||||
|
||||
// Display
|
||||
var texture ItemBackgroundLeft;
|
||||
var texture ItemBackgroundRight;
|
||||
var texture SelectedItemBackgroundLeft;
|
||||
var texture SelectedItemBackgroundRight;
|
||||
var texture DisabledItemBackgroundLeft;
|
||||
var texture DisabledItemBackgroundRight;
|
||||
|
||||
var texture NoPerkIcon;
|
||||
|
||||
var array<string> PrimaryStrings;
|
||||
var array<string> SecondaryStrings;
|
||||
var array<byte> CanBuys;
|
||||
var array<byte> ItemPerkIndexes;
|
||||
|
||||
var color DarkRedColor;
|
||||
|
||||
// Sounds
|
||||
var SoundGroup TraderSoundTooExpensive;
|
||||
var SoundGroup TraderSoundTooHeavy;
|
||||
|
||||
// state
|
||||
var array<GUIBuyable> ForSaleBuyables;
|
||||
var int MouseOverIndex;
|
||||
|
||||
var bool bNeedsUpdate;
|
||||
var int UpdateCounter;
|
||||
|
||||
var localized string WeaponDLCMessage;
|
||||
|
||||
var int CurrFilterIndex;
|
||||
var int CurrFilterItemCount;
|
||||
|
||||
var GUIBuyable BuyableToDisplay;
|
||||
|
||||
var KFLevelRules KFLR;
|
||||
|
||||
event InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
Super.InitComponent(MyController, MyOwner);
|
||||
OnDrawItem = DrawInvItem;
|
||||
SetTimer(0.05, true);
|
||||
}
|
||||
|
||||
function Timer()
|
||||
{
|
||||
UpdateForSaleBuyables();
|
||||
}
|
||||
|
||||
event Opened(GUIComponent Sender)
|
||||
{
|
||||
super.Opened(Sender);
|
||||
|
||||
SetIndex( -1 );
|
||||
|
||||
// Grab the items for sale
|
||||
foreach PlayerOwner().DynamicActors(class'KFLevelRules', KFLR)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
FilterBuyablesList();
|
||||
UpdateForSaleBuyables();
|
||||
}
|
||||
|
||||
event Closed(GUIComponent Sender, bool bCancelled)
|
||||
{
|
||||
PrimaryStrings.Remove(0, PrimaryStrings.Length);
|
||||
SecondaryStrings.Remove(0, SecondaryStrings.Length);
|
||||
CanBuys.Remove(0, CanBuys.Length);
|
||||
ItemPerkIndexes.Remove(0, ItemPerkIndexes.Length);
|
||||
ForSaleBuyables.Remove(0, ForSaleBuyables.Length);
|
||||
|
||||
SetIndex( -1 );
|
||||
BuyableToDisplay = none;
|
||||
|
||||
super.Closed(Sender, bCancelled);
|
||||
}
|
||||
|
||||
function int PopulateBuyables()
|
||||
{
|
||||
local class<KFVeterancyTypes> PlayerVeterancy;
|
||||
local KFPlayerReplicationInfo KFPRI;
|
||||
local GUIBuyable ForSaleBuyable;
|
||||
local class<KFWeaponPickup> ForSalePickup;
|
||||
local int currentIndex, i, j, DualDivider;
|
||||
local bool bZeroWeight;
|
||||
|
||||
DualDivider = 1;
|
||||
|
||||
// Grab Players Veterancy for quick reference
|
||||
if ( KFPlayerController(PlayerOwner()) != none && KFPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo).ClientVeteranSkill != none )
|
||||
{
|
||||
PlayerVeterancy = KFPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo).ClientVeteranSkill;
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerVeterancy = class'KFVeterancyTypes';
|
||||
}
|
||||
|
||||
KFPRI = KFPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo);
|
||||
|
||||
//Grab the perk's weapons first
|
||||
for ( j = 0; j < KFLR.ItemForSale.Length; j++ )
|
||||
{
|
||||
if ( KFLR.ItemForSale[j] != none )
|
||||
{
|
||||
ForSalePickup = class<KFWeaponPickup>(KFLR.ItemForSale[j]);
|
||||
|
||||
if( ForSalePickup != class'KFMod.Potato' )
|
||||
{
|
||||
//Let's see if this is a vest, first aid kit, ammo or stuff we already have
|
||||
if ( class<Vest>(KFLR.ItemForSale[j]) != none || class<FirstAidKit>(KFLR.ItemForSale[j]) != none ||
|
||||
class<KFWeapon>(KFLR.ItemForSale[j].default.InventoryType) == none || KFLR.ItemForSale[j].IsA('Ammunition') ||
|
||||
class<KFWeapon>(KFLR.ItemForSale[j].default.InventoryType).default.bKFNeverThrow ||
|
||||
IsVariantInInventory(ForSalePickup) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ( class<Deagle>(ForSalePickup.default.InventoryType) != none )
|
||||
{
|
||||
if ( IsVariantInInventory(class'DualDeaglePickup') )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ( class<Magnum44Pistol>(ForSalePickup.default.InventoryType) != none )
|
||||
{
|
||||
if ( IsInInventory(class'Dual44MagnumPickup') )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ( class<MK23Pistol>(ForSalePickup.default.InventoryType) != none )
|
||||
{
|
||||
if ( IsInInventory(class'DualMK23Pickup') )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ( class<FlareRevolver>(ForSalePickup.default.InventoryType) != none )
|
||||
{
|
||||
if ( IsInInventory(class'DualFlareRevolverPickup') )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// reduce displayed price of dualies if player owns single
|
||||
if ( ForSalePickup.default.InventoryType == class'DualDeagle' &&
|
||||
IsInInventory(class'DeaglePickup') )
|
||||
{
|
||||
DualDivider = 2;
|
||||
}
|
||||
else if( ForSalePickup.default.InventoryType == class'GoldenDualDeagle' &&
|
||||
IsInInventory(class'GoldenDeaglePickup') )
|
||||
{
|
||||
DualDivider = 2;
|
||||
}
|
||||
else if( class<Dual44Magnum>(ForSalePickup.default.InventoryType) != none &&
|
||||
IsInInventory(class'Magnum44Pickup') )
|
||||
{
|
||||
DualDivider = 2;
|
||||
}
|
||||
else if( class<DualMK23Pistol>(ForSalePickup.default.InventoryType) != none &&
|
||||
IsInInventory(class'MK23Pickup') )
|
||||
{
|
||||
DualDivider = 2;
|
||||
}
|
||||
else if( class<DualFlareRevolver>(ForSalePickup.default.InventoryType) != none &&
|
||||
IsInInventory(class'FlareRevolverPickup') )
|
||||
{
|
||||
DualDivider = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
DualDivider = 1;
|
||||
bZeroWeight = false;
|
||||
}
|
||||
|
||||
if ( currentIndex >= ForSaleBuyables.Length )
|
||||
{
|
||||
ForSaleBuyable = new class'GUIBuyable';
|
||||
ForSaleBuyables[ForSaleBuyables.Length] = ForSaleBuyable;
|
||||
}
|
||||
else
|
||||
{
|
||||
ForSaleBuyable = ForSaleBuyables[currentIndex];
|
||||
}
|
||||
|
||||
currentIndex++;
|
||||
|
||||
ForSaleBuyable.ItemName = ForSalePickup.default.ItemName;
|
||||
ForSaleBuyable.ItemDescription = ForSalePickup.default.Description;
|
||||
ForSaleBuyable.ItemCategorie = KFLR.EquipmentCategories[i].EquipmentCategoryName;
|
||||
if( ForSalePickup == class'KFMod.Potato' )
|
||||
{
|
||||
ForSaleBuyable.ItemImage = Texture'Potato_T.ui_potato';
|
||||
ForSaleBuyable.ItemAmmoClass = none;
|
||||
}
|
||||
else
|
||||
{
|
||||
ForSaleBuyable.ItemImage = class<KFWeapon>(ForSalePickup.default.InventoryType).default.TraderInfoTexture;
|
||||
ForSaleBuyable.ItemAmmoClass = class<KFWeapon>(ForSalePickup.default.InventoryType).default.FireModeClass[0].default.AmmoClass;
|
||||
}
|
||||
ForSaleBuyable.ItemWeaponClass = class<KFWeapon>(ForSalePickup.default.InventoryType);
|
||||
ForSaleBuyable.ItemPickupClass = ForSalePickup;
|
||||
ForSaleBuyable.ItemCost = int((float(ForSalePickup.default.Cost)
|
||||
* PlayerVeterancy.static.GetCostScaling(KFPRI, ForSalePickup)) / DualDivider);
|
||||
ForSaleBuyable.ItemAmmoCost = 0;
|
||||
ForSaleBuyable.ItemFillAmmoCost = 0;
|
||||
|
||||
if ( bZeroWeight)
|
||||
{
|
||||
ForSaleBuyable.ItemWeight = 1.f;
|
||||
}
|
||||
else if ( (ForSalePickup == class'DualDeaglePickup' || ForSalePickup == class'GoldenDualDeaglePickup')
|
||||
&& (IsInInventory(class'DeaglePickup') || IsInInventory(class'GoldenDeaglePickup')) )
|
||||
{
|
||||
ForSaleBuyable.ItemWeight= ForSalePickup.default.Weight / 2;
|
||||
}
|
||||
else if ( ForSalePickup == class'Dual44MagnumPickup' && IsInInventory(class'Magnum44Pickup') )
|
||||
{
|
||||
ForSaleBuyable.ItemWeight= ForSalePickup.default.Weight / 2;
|
||||
}
|
||||
else if ( ForSalePickup == class'DualMK23Pickup' && IsInInventory(class'MK23Pickup') )
|
||||
{
|
||||
ForSaleBuyable.ItemWeight= ForSalePickup.default.Weight / 2;
|
||||
}
|
||||
else if ( ForSalePickup == class'DualFlareRevolverPickup' && IsInInventory(class'FlareRevolverPickup') )
|
||||
{
|
||||
ForSaleBuyable.ItemWeight= ForSalePickup.default.Weight / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
ForSaleBuyable.ItemWeight = ForSalePickup.default.Weight;
|
||||
}
|
||||
|
||||
ForSaleBuyable.ItemPower = ForSalePickup.default.PowerValue;
|
||||
ForSaleBuyable.ItemRange = ForSalePickup.default.RangeValue;
|
||||
ForSaleBuyable.ItemSpeed = ForSalePickup.default.SpeedValue;
|
||||
ForSaleBuyable.ItemAmmoCurrent = 0;
|
||||
ForSaleBuyable.ItemAmmoMax = 0;
|
||||
ForSaleBuyable.ItemPerkIndex = ForSalePickup.default.CorrespondingPerkIndex;
|
||||
|
||||
// Make sure we mark the list as a sale list
|
||||
ForSaleBuyable.bSaleList = true;
|
||||
|
||||
bZeroWeight = false;
|
||||
}
|
||||
}
|
||||
return currentIndex;
|
||||
}
|
||||
|
||||
function FilterBuyablesList()
|
||||
{
|
||||
CurrFilterIndex = KFPlayerController( PlayerOwner() ).BuyMenuFilterIndex;
|
||||
|
||||
switch( CurrFilterIndex )
|
||||
{
|
||||
case 0:
|
||||
KFLR.ItemForSale = KFLR.MediItemForSale;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
KFLR.ItemForSale = KFLR.SuppItemForSale;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
KFLR.ItemForSale = KFLR.ShrpItemForSale;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
KFLR.ItemForSale = KFLR.CommItemForSale;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
KFLR.ItemForSale = KFLR.BersItemForSale;
|
||||
break;
|
||||
|
||||
case 5:
|
||||
KFLR.ItemForSale = KFLR.FireItemForSale;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
KFLR.ItemForSale = KFLR.DemoItemForSale;
|
||||
break;
|
||||
|
||||
case 7:
|
||||
KFLR.ItemForSale = KFLR.NeutItemForSale;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
KFLR.ItemForSale = KFLR.FaveItemForSale;
|
||||
break;
|
||||
};
|
||||
|
||||
CurrFilterItemCount = KFLR.ItemForSale.Length;
|
||||
}
|
||||
|
||||
function UpdateForSaleBuyables()
|
||||
{
|
||||
local class<KFVeterancyTypes> PlayerVeterancy;
|
||||
local KFPlayerReplicationInfo KFPRI;
|
||||
local int ForSaleArrayIndex;
|
||||
local bool bFiltered;
|
||||
|
||||
// Grab Players Veterancy for quick reference
|
||||
if ( KFPlayerController(PlayerOwner()) != none && KFPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo).ClientVeteranSkill != none )
|
||||
{
|
||||
PlayerVeterancy = KFPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo).ClientVeteranSkill;
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerVeterancy = class'KFVeterancyTypes';
|
||||
}
|
||||
|
||||
KFPRI = KFPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo);
|
||||
|
||||
if( KFPlayerController(PlayerOwner()) != none && CurrFilterIndex != KFPlayerController(PlayerOwner()).BuyMenuFilterIndex )
|
||||
{
|
||||
FilterBuyablesList();
|
||||
bFiltered = true;
|
||||
}
|
||||
|
||||
ForSaleArrayIndex = PopulateBuyables();
|
||||
|
||||
if ( ForSaleArrayIndex < ForSaleBuyables.Length )
|
||||
{
|
||||
ForSaleBuyables.Remove(ForSaleArrayIndex, ForSaleBuyables.Length - ForSaleArrayIndex);
|
||||
}
|
||||
|
||||
//Now Update the list
|
||||
UpdateList();
|
||||
|
||||
if( bFiltered )
|
||||
{
|
||||
SetIndex( GetDisplayedBuyableIndex() );
|
||||
if( self.Index < 0 )
|
||||
{
|
||||
SetTopItem( 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function int GetDisplayedBuyableIndex()
|
||||
{
|
||||
local int i;
|
||||
|
||||
if( BuyableToDisplay != none && BuyableToDisplay.bSaleList )
|
||||
{
|
||||
for( i = 0; i < ForSaleBuyables.Length; ++i )
|
||||
{
|
||||
if( BuyableToDisplay.ItemName == ForSaleBuyables[i].ItemName )
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
function UpdateList()
|
||||
{
|
||||
local int i;
|
||||
local bool unlockedByAchievement, unlockedByApp;
|
||||
|
||||
// Clear the arrays
|
||||
if ( ForSaleBuyables.Length < ItemPerkIndexes.Length )
|
||||
{
|
||||
ItemPerkIndexes.Remove(ForSaleBuyables.Length, ItemPerkIndexes.Length - ForSaleBuyables.Length);
|
||||
PrimaryStrings.Remove(ForSaleBuyables.Length, PrimaryStrings.Length - ForSaleBuyables.Length);
|
||||
SecondaryStrings.Remove(ForSaleBuyables.Length, SecondaryStrings.Length - ForSaleBuyables.Length);
|
||||
CanBuys.Remove(ForSaleBuyables.Length, CanBuys.Length - ForSaleBuyables.Length);
|
||||
}
|
||||
|
||||
// Update the ItemCount and select the first item
|
||||
ItemCount = ForSaleBuyables.Length;
|
||||
|
||||
// Update the players inventory list
|
||||
for ( i = 0; i < ItemCount; i++ )
|
||||
{
|
||||
PrimaryStrings[i] = ForSaleBuyables[i].ItemName;
|
||||
SecondaryStrings[i] = "£" @ int(ForSaleBuyables[i].ItemCost);
|
||||
|
||||
//controls which icon to put up
|
||||
ItemPerkIndexes[i] = ForSaleBuyables[i].ItemPerkIndex;
|
||||
|
||||
|
||||
if ( ForSaleBuyables[i].ItemCost > PlayerOwner().PlayerReplicationInfo.Score ||
|
||||
ForSaleBuyables[i].ItemWeight + KFHumanPawn(PlayerOwner().Pawn).CurrentWeight > KFHumanPawn(PlayerOwner().Pawn).MaxCarryWeight )
|
||||
{
|
||||
CanBuys[i] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
CanBuys[i] = 1;
|
||||
}
|
||||
|
||||
if( ForSaleBuyables[i].ItemPickupClass == class'KFMod.Potato' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
unlockedByAchievement = false;
|
||||
unlockedByApp = false;
|
||||
|
||||
if( KFSteamStatsAndAchievements(PlayerOwner().SteamStatsAndAchievements) != none )
|
||||
{
|
||||
if( ForSaleBuyables[i].ItemWeaponClass.Default.UnlockedByAchievement != -1 )
|
||||
{
|
||||
|
||||
unlockedByAchievement = KFSteamStatsAndAchievements(PlayerOwner().SteamStatsAndAchievements).Achievements[ForSaleBuyables[i].ItemWeaponClass.Default.UnlockedByAchievement].bCompleted == 1;
|
||||
}
|
||||
if( ForSaleBuyables[i].ItemWeaponClass.Default.AppID > 0 )
|
||||
{
|
||||
|
||||
unlockedByApp = PlayerOwner().SteamStatsAndAchievements.PlayerOwnsWeaponDLC(ForSaleBuyables[i].ItemWeaponClass.Default.AppID);
|
||||
}
|
||||
}
|
||||
//lock the weapon if it requires an achievement that they don't have.
|
||||
if ( ForSaleBuyables[i].ItemWeaponClass.Default.UnlockedByAchievement != -1 )
|
||||
{
|
||||
if( !unlockedByAchievement && !unlockedByApp)
|
||||
{
|
||||
CanBuys[i] = 0;
|
||||
SecondaryStrings[i] = "LOCKED";
|
||||
}
|
||||
}
|
||||
else if ( ForSaleBuyables[i].ItemWeaponClass.Default.AppID > 0 && !unlockedByApp )
|
||||
{
|
||||
if( !unlockedByAchievement )
|
||||
{
|
||||
CanBuys[i] = 0;
|
||||
SecondaryStrings[i] = "DLC";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( bNotify )
|
||||
{
|
||||
CheckLinkedObjects(Self);
|
||||
}
|
||||
|
||||
if ( MyScrollBar != none )
|
||||
{
|
||||
MyScrollBar.AlignThumb();
|
||||
}
|
||||
|
||||
bNeedsUpdate = false;
|
||||
}
|
||||
|
||||
function bool IsInInventory(class<Pickup> Item)
|
||||
{
|
||||
return KFPlayerController( PlayerOwner() ).IsInInventory( Item, true, false );
|
||||
}
|
||||
|
||||
function bool IsVariantInInventory(class<Pickup> PickupForSale)
|
||||
{
|
||||
return KFPlayerController( PlayerOwner() ).IsInInventory( PickupForSale, true, true );
|
||||
}
|
||||
|
||||
function bool PreDraw(Canvas Canvas)
|
||||
{
|
||||
if ( Controller.MouseX >= ClientBounds[0] && Controller.MouseX <= ClientBounds[2] && Controller.MouseY >= ClientBounds[1] )
|
||||
{
|
||||
// Figure out which Item we're clicking on
|
||||
MouseOverIndex = Top + ((Controller.MouseY - ClientBounds[1]) / ItemHeight);
|
||||
|
||||
if ( MouseOverIndex >= ItemCount )
|
||||
{
|
||||
MouseOverIndex = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MouseOverIndex = -1;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function DrawInvItem(Canvas Canvas, int CurIndex, float X, float Y, float Width, float Height, bool bSelected, bool bPending)
|
||||
{
|
||||
local float TempX, TempY, TempHeight;
|
||||
local float StringHeight, StringWidth;
|
||||
|
||||
OnClickSound=CS_Click;
|
||||
|
||||
// Offset for the Background
|
||||
TempX = X;
|
||||
TempY = Y + ItemSpacing / 2.0;
|
||||
|
||||
// Initialize the Canvas
|
||||
Canvas.Style = 1;
|
||||
//Canvas.Font = class'ROHUD'.Static.GetSmallMenuFont(Canvas);
|
||||
Canvas.SetDrawColor(255, 255, 255, 255);
|
||||
|
||||
// Draw Item Background
|
||||
Canvas.SetPos(TempX, TempY);
|
||||
|
||||
if ( CanBuys[CurIndex] < 1 )
|
||||
{
|
||||
Canvas.DrawTileStretched(DisabledItemBackgroundLeft, Height - ItemSpacing, Height - ItemSpacing);
|
||||
|
||||
TempX += ((Height - ItemSpacing) - 1);
|
||||
TempHeight = Height - 12;
|
||||
TempY += 6;//(Height - TempHeight) / 2;
|
||||
|
||||
Canvas.SetPos(TempX, TempY);
|
||||
|
||||
Canvas.DrawTileStretched(DisabledItemBackgroundRight, Width - (Height - ItemSpacing), Height - 12);
|
||||
}
|
||||
else if ( bSelected )
|
||||
{
|
||||
Canvas.DrawTileStretched(SelectedItemBackgroundLeft, Height - ItemSpacing, Height - ItemSpacing);
|
||||
|
||||
TempX += ((Height - ItemSpacing) - 1);
|
||||
TempHeight = Height - 12;
|
||||
TempY += 6;//(Height - TempHeight) / 2;
|
||||
|
||||
Canvas.SetPos(TempX, TempY);
|
||||
|
||||
Canvas.DrawTileStretched(SelectedItemBackgroundRight, Width - (Height - ItemSpacing), Height - 12);
|
||||
}
|
||||
else
|
||||
{
|
||||
Canvas.DrawTileStretched(ItemBackgroundLeft, Height - ItemSpacing, Height - ItemSpacing);
|
||||
|
||||
TempX += ((Height - ItemSpacing) - 1);
|
||||
TempHeight = Height - 12;
|
||||
TempY += 6;//(Height - TempHeight) / 2;
|
||||
|
||||
Canvas.SetPos(TempX, TempY);
|
||||
|
||||
Canvas.DrawTileStretched(ItemBackgroundRight, Width - (Height - ItemSpacing), Height - 12);
|
||||
}
|
||||
|
||||
Canvas.SetPos(X + 4, Y + 4);
|
||||
//controls the icon
|
||||
if(ItemPerkIndexes[CurIndex] != 7 )
|
||||
{
|
||||
Canvas.DrawTile(class'KFGameType'.default.LoadedSkills[ItemPerkIndexes[CurIndex]].default.OnHUDIcon, Height - 8, Height - 8, 0, 0, 256, 256);
|
||||
}
|
||||
else if( ForSaleBuyables.Length > CurIndex && ForSaleBuyables[CurIndex].ItemPickupClass == class'KFMod.Potato' )
|
||||
{
|
||||
Canvas.DrawTile(Texture'Potato_T.ui_potato', Height - 8, Height - 8, 0, 0, 256, 256);
|
||||
}
|
||||
else
|
||||
{
|
||||
Canvas.DrawTile(NoPerkIcon, Height - 8, Height - 8, 0, 0, 256, 256);
|
||||
}
|
||||
|
||||
// Select Text color
|
||||
if ( CurIndex == MouseOverIndex )
|
||||
{
|
||||
Canvas.SetDrawColor(255, 255, 255, 255);
|
||||
}
|
||||
else
|
||||
{
|
||||
Canvas.SetDrawColor(0, 0, 0, 255);
|
||||
}
|
||||
|
||||
// Draw the item's name and categorie
|
||||
Canvas.StrLen(PrimaryStrings[CurIndex], StringWidth, StringHeight);
|
||||
Canvas.SetPos(TempX + (0.2 * Height), TempY + ((TempHeight - StringHeight) / 2));
|
||||
Canvas.DrawText(PrimaryStrings[CurIndex]);
|
||||
|
||||
// Draw the item's price
|
||||
Canvas.StrLen(SecondaryStrings[CurIndex], StringWidth, StringHeight);
|
||||
Canvas.SetPos((TempX - Height) + Width - (StringWidth + (0.2 * Height)), TempY + ((TempHeight - StringHeight) / 2));
|
||||
Canvas.DrawText(SecondaryStrings[CurIndex]);
|
||||
|
||||
Canvas.SetDrawColor(255, 255, 255, 255);
|
||||
}
|
||||
|
||||
function float SaleItemHeight(Canvas c)
|
||||
{
|
||||
return (MenuOwner.ActualHeight() / 10 - 1);
|
||||
}
|
||||
|
||||
function IndexChanged(GUIComponent Sender)
|
||||
{
|
||||
if( Index >= 0 )
|
||||
{
|
||||
// used to cache the current selection so it can be displayed in the center
|
||||
// even when it isn't in the list (like when another perk filter is set)
|
||||
BuyableToDisplay = new class'GUIBuyable';
|
||||
BuyableToDisplay.ItemName = ForSaleBuyables[Index].ItemName;
|
||||
BuyableToDisplay.ItemDescription = ForSaleBuyables[Index].ItemDescription;
|
||||
BuyableToDisplay.ItemCategorie = ForSaleBuyables[Index].ItemCategorie;
|
||||
BuyableToDisplay.ItemImage = ForSaleBuyables[Index].ItemImage;
|
||||
BuyableToDisplay.ItemWeaponClass = ForSaleBuyables[Index].ItemWeaponClass;
|
||||
BuyableToDisplay.ItemAmmoClass = ForSaleBuyables[Index].ItemAmmoClass;
|
||||
BuyableToDisplay.ItemPickupClass = ForSaleBuyables[Index].ItemPickupClass;
|
||||
BuyableToDisplay.ItemCost = ForSaleBuyables[Index].ItemCost;
|
||||
BuyableToDisplay.ItemAmmoCost = 0;
|
||||
BuyableToDisplay.ItemFillAmmoCost = 0;
|
||||
BuyableToDisplay.ItemWeight = ForSaleBuyables[Index].ItemWeight;
|
||||
BuyableToDisplay.ItemPower = ForSaleBuyables[Index].ItemPower;
|
||||
BuyableToDisplay.ItemRange = ForSaleBuyables[Index].ItemRange;
|
||||
BuyableToDisplay.ItemSpeed = ForSaleBuyables[Index].ItemSpeed;
|
||||
BuyableToDisplay.ItemAmmoCurrent = 0;
|
||||
BuyableToDisplay.ItemAmmoMax = 0;
|
||||
BuyableToDisplay.ItemPerkIndex = ForSaleBuyables[Index].ItemPerkIndex;
|
||||
BuyableToDisplay.bSaleList = true;
|
||||
|
||||
if ( CanBuys[Index] == 0 )
|
||||
{
|
||||
if ( ForSaleBuyables[Index].ItemWeaponClass.Default.AppID > 0 &&
|
||||
KFSteamStatsAndAchievements(PlayerOwner().SteamStatsAndAchievements) != none &&
|
||||
!PlayerOwner().SteamStatsAndAchievements.PlayerOwnsWeaponDLC(ForSaleBuyables[Index].ItemWeaponClass.Default.AppID) )
|
||||
{
|
||||
// TODO: Play "Purchase DLC" voice clip?
|
||||
}
|
||||
else if ( ForSaleBuyables[Index].ItemWeaponClass.Default.UnlockedByAchievement != -1 &&
|
||||
KFSteamStatsAndAchievements(PlayerOwner().SteamStatsAndAchievements) != none &&
|
||||
KFSteamStatsAndAchievements(PlayerOwner().SteamStatsAndAchievements).Achievements[ForSaleBuyables[index].ItemWeaponClass.Default.UnlockedByAchievement].bCompleted == 1)
|
||||
{
|
||||
|
||||
}
|
||||
else if ( ForSaleBuyables[Index].ItemCost > PlayerOwner().PlayerReplicationInfo.Score )
|
||||
{
|
||||
PlayerOwner().Pawn.DemoPlaySound(TraderSoundTooExpensive, SLOT_Interface, 2.0);
|
||||
}
|
||||
else if ( ForSaleBuyables[Index].ItemWeight + KFHumanPawn(PlayerOwner().Pawn).CurrentWeight > KFHumanPawn(PlayerOwner().Pawn).MaxCarryWeight )
|
||||
{
|
||||
PlayerOwner().Pawn.DemoPlaySound(TraderSoundTooHeavy, SLOT_Interface, 2.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
super.IndexChanged(Sender);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
ItemBorder=0.00
|
||||
TextTopOffset=0.05
|
||||
ItemSpacing=0.0
|
||||
|
||||
DarkRedColor=(R=96,G=96,B=96,A=255)
|
||||
WhiteColor=(R=255,G=255,B=255,A=255)
|
||||
|
||||
OnPreDraw=PreDraw
|
||||
|
||||
ItemBackgroundLeft=Texture'KF_InterfaceArt_tex.Menu.Item_box_box'
|
||||
ItemBackgroundRight=Texture'KF_InterfaceArt_tex.Menu.Item_box_bar'
|
||||
SelectedItemBackgroundLeft=Texture'KF_InterfaceArt_tex.Menu.Item_box_box_Highlighted'
|
||||
SelectedItemBackgroundRight=Texture'KF_InterfaceArt_tex.Menu.Item_box_bar_Highlighted'
|
||||
DisabledItemBackgroundLeft=Texture'KF_InterfaceArt_tex.Menu.Item_box_box_disabled'
|
||||
DisabledItemBackgroundRight=Texture'KF_InterfaceArt_tex.Menu.Item_box_bar_disabled'
|
||||
|
||||
NoPerkIcon= Texture'KillingFloor2HUD.Perk_Icons.No_Perk_Icon'
|
||||
|
||||
TraderSoundTooHeavy=Sound'KF_Trader.TooHeavy'
|
||||
TraderSoundTooExpensive=Sound'KF_Trader.TooExpensive'
|
||||
|
||||
FontScale=FNS_Medium
|
||||
GetItemHeight=KFBuyMenuSaleList.SaleItemHeight
|
||||
}
|
||||
40
kf_sources/KFGui/Classes/KFBuyMenuSaleListBox.uc
Normal file
40
kf_sources/KFGui/Classes/KFBuyMenuSaleListBox.uc
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
//-----------------------------------------------------------
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
class KFBuyMenuSaleListBox extends GUIListBoxBase;
|
||||
|
||||
var KFBuyMenuSaleList List;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
Super.InitComponent(MyController,MyOwner);
|
||||
|
||||
if ( DefaultListClass != "" )
|
||||
{
|
||||
List = KFBuyMenuSaleList(AddComponent(DefaultListClass));
|
||||
|
||||
if (List == None)
|
||||
{
|
||||
log(Class$".InitComponent - Could not create default list ["$DefaultListClass$"]");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( List == none )
|
||||
{
|
||||
Warn("Could not initialize list!");
|
||||
return;
|
||||
}
|
||||
|
||||
InitBaseList(List);
|
||||
}
|
||||
|
||||
function GUIBuyable GetSelectedBuyable()
|
||||
{
|
||||
return List.BuyableToDisplay;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
DefaultListClass="KFGUI.KFBuyMenuSaleList"
|
||||
}
|
||||
10
kf_sources/KFGui/Classes/KFCacheManager.uc
Normal file
10
kf_sources/KFGui/Classes/KFCacheManager.uc
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
class KFCacheManager extends CacheManager;
|
||||
/*
|
||||
DefaultProperties
|
||||
{
|
||||
DefaultContent(0)=(Classes=("UTClassic.MutUTClassic","UnrealGame.MutLowGrav","UnrealGame.MutBigHead","XGame.xTeamGame","XGame.xDeathMatch","XGame.xCTFGame","XGame.InstagibCTF","XGame.xVehicleCTFGame","XGame.xDoubleDom","XGame.xBombingRun","XGame.MutRegen","XGame.MutInstaGib","XGame.MutQuadJump","XGame.MutSpeciesStats","XGame.MutVampire","XGame.MutSlomoDeath","XGame.MutNoAdrenaline","XGame.MutZoomInstagib","XWeapons.MutArena","KFMod.Axe","KFMod.Flamethrower","KFMod.Bat","KFMod.Vest","KFMod.BoomStick","KFMod.Deagle","KFMod.Shotgun","KFMod.Frag","KFMod.Syringe","KFMod.Welder","KFMod.LAW","KFMod.Knife","KFMod.Winchester","KFMod.Crossbow","KFMod.Dualies","KFMod.Single","KFMod.Bullpup"),Maps=("BR-Anubis","BR-Bifrost","BR-Disclosure","BR-IceFields","BR-Skyline","BR-Slaughterhouse","BR-TwinTombs","CTF-Chrome","CTF-Citadel","CTF-December","CTF-Face3","CTF-Geothermal","CTF-Lostfaith","CTF-Magma","CTF-Maul","CTF-Orbital2","DM-Antalus","DM-Asbestos","DM-Compressed","DM-Flux2","DM-Gael","DM-Inferno","DM-Insidious","DM-Leviathan","DM-Oceanic","DM-Phobos2","DM-Plunge","DM-1on1-Serpentine","DM-TokaraForest","DM-TrainingDay","DOM-Core","DOM-OutRigger","DOM-Ruination","DOM-ScorchedEarth","DOM-SepukkuGorge","DOM-Suntemple","TUT-BR","TUT-CTF","TUT-DM","TUT-DOM2"))
|
||||
DefaultContent(1)=(Classes=("BonusPack.xLastManStandingGame","BonusPack.xMutantGame","BonusPack.MutCrateCombo","SkaarjPack.Invasion"),Maps=("BR-Canyon","CTF-Avaris","CTF-DoubleDammage","DM-1on1-Crash","DM-1on1-Mixer","DM-Icetomb","DM-Injector","DM-IronDeity","DM-Rustatorium","DOM-Junkyard","BR-DE-ElecFields","CTF-DE-ElecFields","CTF-DE-LavaGiant2","DM-DE-GrendelKeep","DM-DE-Ironic","DM-DE-Osiris2"))
|
||||
DefaultContent(2)=none//(Classes=("XInterface.DefaultCrosshairs","Onslaught.ONSCrosshairs","UTClassic.MutUseSniper","UTClassic.MutUseLightning","Onslaught.ONSOnslaughtGame","Onslaught.MutOnslaughtWeapons","Onslaught.ONSAVRiL","Onslaught.ONSGrenadeLauncher","Onslaught.ONSMineLayer","Onslaught.MutLightweightVehicles","UT2k4Assault.ASGameInfo","UTClassic.ClassicSniperRifle","UnrealGame.FemaleAnnouncer","UnrealGame.MaleAnnouncer","UnrealGame.SexyFemaleAnnouncer"),Maps=("KF-WestLondon","KFS-Crash","KF-Offices","KF-Manor","KF-BioticsLab"))
|
||||
DefaultContent(3)=none//(Classes=("OnslaughtFull.MutVehicleArena","OnslaughtFull.ONSBomber","OnslaughtFull.ONSPainter","OnslaughtFull.ONSMobileAssaultStation","UT2k4AssaultFull.ASVehicle_SpaceFighter_Human","UT2k4AssaultFull.ASVehicle_SpaceFighter_Skaarj","XGame.MutUDamageReward","UTV2004s.utvMutator"),Maps=("MOV-UT2004-Intro","Mov-UT2-intro"))
|
||||
}
|
||||
*/
|
||||
96
kf_sources/KFGui/Classes/KFConfirmSPpage.uc
Normal file
96
kf_sources/KFGui/Classes/KFConfirmSPpage.uc
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
// ====================================================================
|
||||
// ====================================================================
|
||||
|
||||
class KFConfirmSPPage extends UT2K4QuitPage;
|
||||
|
||||
var bool bMovingOnSP;
|
||||
|
||||
event Timer()
|
||||
{
|
||||
Log("Timer is firing!");
|
||||
if (bMovingOnSP)
|
||||
{
|
||||
Log("Moving on is True!");
|
||||
bMovingOnSP = false;
|
||||
Controller.ConsoleCommand("OPEN KFS-Intro?Game=KFmod.KFSPGameType");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
event Opened(GUIComponent Sender)
|
||||
{
|
||||
Timer();
|
||||
|
||||
if ( bCaptureInput )
|
||||
FadeIn();
|
||||
|
||||
Super.Opened(Sender);
|
||||
}
|
||||
|
||||
|
||||
function bool InternalOnClick(GUIComponent Sender)
|
||||
{
|
||||
if (Sender==Controls[1])
|
||||
{
|
||||
if(PlayerOwner().Level.IsDemoBuild())
|
||||
Controller.ReplaceMenu("XInterface.UT2DemoQuitPage");
|
||||
else{
|
||||
Controller.ConsoleCommand( "DISCONNECT" );
|
||||
bMovingOnSP = true;
|
||||
SetTimer(0.5,false);
|
||||
}
|
||||
}
|
||||
else
|
||||
Controller.CloseMenu(false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Begin Object Class=GUIButton Name=QuitBackground
|
||||
StyleName="SquareBar"
|
||||
WinHeight=1.000000
|
||||
bBoundToParent=True
|
||||
bScaleToParent=True
|
||||
bAcceptsInput=False
|
||||
bNeverFocus=True
|
||||
OnKeyEvent=QuitBackground.InternalOnKeyEvent
|
||||
End Object
|
||||
Controls(0)=GUIButton'KFGui.KFConfirmSPpage.QuitBackground'
|
||||
|
||||
Begin Object Class=GUIButton Name=YesButton
|
||||
Caption="YES"
|
||||
WinTop=0.750000
|
||||
WinLeft=0.125000
|
||||
WinWidth=0.200000
|
||||
bBoundToParent=True
|
||||
OnClick=KFConfirmSPpage.InternalOnClick
|
||||
OnKeyEvent=YesButton.InternalOnKeyEvent
|
||||
End Object
|
||||
Controls(1)=GUIButton'KFGui.KFConfirmSPpage.YesButton'
|
||||
|
||||
Begin Object Class=GUIButton Name=NoButton
|
||||
Caption="NO"
|
||||
WinTop=0.750000
|
||||
WinLeft=0.650000
|
||||
WinWidth=0.200000
|
||||
bBoundToParent=True
|
||||
OnClick=KFConfirmSPpage.InternalOnClick
|
||||
OnKeyEvent=NoButton.InternalOnKeyEvent
|
||||
End Object
|
||||
Controls(2)=GUIButton'KFGui.KFConfirmSPpage.NoButton'
|
||||
|
||||
Begin Object Class=GUILabel Name=QuitDesc
|
||||
Caption="Are you sure you wish to start a new Single Player game?"
|
||||
TextAlign=TXTA_Center
|
||||
TextColor=(B=255,R=255,G=255)
|
||||
TextFont="UT2HeaderFont"
|
||||
WinTop=0.400000
|
||||
WinHeight=32.000000
|
||||
End Object
|
||||
Controls(3)=GUILabel'KFGui.KFConfirmSPpage.QuitDesc'
|
||||
|
||||
WinTop=0.375000
|
||||
WinHeight=0.250000
|
||||
}
|
||||
240
kf_sources/KFGui/Classes/KFControlBinder.uc
Normal file
240
kf_sources/KFGui/Classes/KFControlBinder.uc
Normal file
|
|
@ -0,0 +1,240 @@
|
|||
class KFControlBinder extends KeyBindMenu;
|
||||
|
||||
var localized string BindingLabel[150];
|
||||
|
||||
function LoadCommands()
|
||||
{
|
||||
local int i;
|
||||
|
||||
Super.LoadCommands();
|
||||
|
||||
// Update the MultiColumnList's sortdata array to reflect the indexes of our Bindings array
|
||||
for (i = 0; i < Bindings.Length; i++)
|
||||
li_Binds.AddedItem();
|
||||
}
|
||||
|
||||
function MapBindings()
|
||||
{
|
||||
LoadCustomBindings();
|
||||
Super.MapBindings();
|
||||
}
|
||||
|
||||
protected function LoadCustomBindings()
|
||||
{
|
||||
local int i;
|
||||
local array<string> KeyBindClasses;
|
||||
local class<GUIUserKeyBinding> CustomKeyBindClass;
|
||||
|
||||
// Load custom keybinds from .int files
|
||||
PlayerOwner().GetAllInt("XInterface.GUIUserKeyBinding",KeyBindClasses);
|
||||
for (i = 0; i < KeyBindClasses.Length; i++)
|
||||
{
|
||||
CustomKeyBindClass = class<GUIUserKeyBinding>(DynamicLoadObject(KeyBindClasses[i],class'Class'));
|
||||
if (CustomKeyBindClass != None)
|
||||
AddCustomBindings( CustomKeyBindClass.default.KeyData );
|
||||
}
|
||||
}
|
||||
|
||||
function AddCustomBindings( array<GUIUserKeyBinding.KeyInfo> KeyData )
|
||||
{
|
||||
local int i;
|
||||
|
||||
for ( i = 0; i < KeyData.Length; i++ )
|
||||
CreateAliasMapping( KeyData[i].Alias, KeyData[i].KeyLabel, KeyData[i].bIsSection );
|
||||
}
|
||||
|
||||
function ClearBindings()
|
||||
{
|
||||
local int i, max;
|
||||
|
||||
Super.ClearBindings();
|
||||
Bindings = default.Bindings;
|
||||
max = Min(Bindings.Length, ArrayCount(BindingLabel));
|
||||
for ( i = 0; i < max; i++ )
|
||||
{
|
||||
if ( BindingLabel[i] != "" )
|
||||
Bindings[i].KeyLabel = BindingLabel[i];
|
||||
}
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
PageCaption="Configure Keys"
|
||||
Headings(0)="Action"
|
||||
Bindings(0)=(bIsSectionLabel=true,KeyLabel="Movement")
|
||||
BindingLabel(0)="Movement"
|
||||
Bindings(1)=(KeyLabel="Forward",Alias="MoveForward")
|
||||
BindingLabel(1)="Forward"
|
||||
Bindings(2)=(KeyLabel="Backward",Alias="MoveBackward")
|
||||
BindingLabel(2)="Backward"
|
||||
Bindings(3)=(KeyLabel="Strafe Left",Alias="StrafeLeft")
|
||||
BindingLabel(3)="Strafe Left"
|
||||
Bindings(4)=(KeyLabel="Strafe Right",Alias="StrafeRight")
|
||||
BindingLabel(4)="Strafe Right"
|
||||
Bindings(5)=(KeyLabel="Jump",Alias="Jump")
|
||||
BindingLabel(5)="Jump"
|
||||
Bindings(6)=(KeyLabel="Walk",Alias="Walking")
|
||||
BindingLabel(6)="Walk"
|
||||
Bindings(7)=(KeyLabel="Crouch",Alias="Duck")
|
||||
BindingLabel(7)="Crouch"
|
||||
Bindings(8)=(KeyLabel="Strafe Toggle",Alias="Strafe")
|
||||
BindingLabel(8)="Strafe Toggle"
|
||||
|
||||
Bindings(9)=(bIsSectionLabel=true,KeyLabel="Looking")
|
||||
BindingLabel(9)="Looking"
|
||||
Bindings(10)=(KeyLabel="Turn Left",Alias="TurnLeft")
|
||||
BindingLabel(10)="Turn Left"
|
||||
Bindings(11)=(KeyLabel="Turn Right",Alias="TurnRight")
|
||||
BindingLabel(11)="Turn Right"
|
||||
Bindings(12)=(KeyLabel="Look Up",Alias="LookUp")
|
||||
BindingLabel(12)="Look Up"
|
||||
Bindings(13)=(KeyLabel="Look Down",Alias="LookDown")
|
||||
BindingLabel(13)="Look Down"
|
||||
Bindings(14)=(KeyLabel="Center View",Alias="CenterView")
|
||||
BindingLabel(14)="Center View"
|
||||
Bindings(15)=(KeyLabel="Toggle 'BehindView'",Alias="ToggleBehindView")
|
||||
BindingLabel(15)="Toggle 'BehindView'"
|
||||
Bindings(16)=(KeyLabel="Toggle Camera Mode",Alias="ToggleFreeCam")
|
||||
BindingLabel(16)="Toggle Camera Mode"
|
||||
|
||||
Bindings(17)=(bIsSectionLabel=true,KeyLabel="Weapons")
|
||||
BindingLabel(17)="Weapons"
|
||||
Bindings(18)=(KeyLabel="Fire",Alias="Fire")
|
||||
BindingLabel(18)="Fire"
|
||||
Bindings(19)=(KeyLabel="Alt-Fire/Flashlight",Alias="AltFire")
|
||||
BindingLabel(19)="Alt-Fire"
|
||||
BindingLabel(20)="Aiming"
|
||||
Bindings(20)=(KeyLabel="Aiming",Alias="Aiming")
|
||||
BindingLabel(21)="Toggle Aiming"
|
||||
Bindings(21)=(KeyLabel="Toggle Aiming",Alias="ToggleAiming")
|
||||
BindingLabel(22)="Reload"
|
||||
Bindings(22)=(KeyLabel="Reload Weapon",Alias="ReloadWeapon")
|
||||
Bindings(23)=(KeyLabel="Throw Weapon",Alias="ThrowWeapon")
|
||||
BindingLabel(23)="Throw Weapon"
|
||||
Bindings(24)=(KeyLabel="Best Weapon",Alias="SwitchToBestWeapon")
|
||||
BindingLabel(24)="Best Weapon"
|
||||
|
||||
BindingLabel(25)="Switch to Knife"
|
||||
Bindings(25)=(KeyLabel="Switch to Knife",Alias="SwitchToBestMeleeWeapon")
|
||||
|
||||
Bindings(26)=(KeyLabel="Next Weapon",Alias="NextWeapon")
|
||||
BindingLabel(26)="Next Weapon"
|
||||
|
||||
Bindings(27)=(KeyLabel="Prev Weapon",Alias="PrevWeapon")
|
||||
BindingLabel(27)="Prev Weapon"
|
||||
Bindings(28)=(KeyLabel="Last Weapon",Alias="SwitchToLastWeapon")
|
||||
BindingLabel(28)="Last Weapon"
|
||||
|
||||
Bindings(29)=(KeyLabel="Throw Grenade",Alias="ThrowNade")
|
||||
BindingLabel(29)="Throw Grenade"
|
||||
|
||||
Bindings(30)=(bIsSectionLabel=true,KeyLabel="Communication")
|
||||
BindingLabel(30)="Communication"
|
||||
Bindings(31)=(KeyLabel="Say",Alias="Talk")
|
||||
BindingLabel(31)="Say"
|
||||
Bindings(32)=(KeyLabel="Team Say",Alias="TeamTalk")
|
||||
BindingLabel(32)="Team Say"
|
||||
Bindings(33)=(KeyLabel="In Game Chat",Alias="InGameChat")
|
||||
BindingLabel(33)="In Game Chat"
|
||||
Bindings(34)=(KeyLabel="Perks Menu",Alias="OpenVeterancyMenu")
|
||||
BindingLabel(34)="Perks Menu"
|
||||
Bindings(35)=(KeyLabel="Activate Microphone",Alias="VoiceTalk")
|
||||
BindingLabel(35)="Activate Microphone"
|
||||
Bindings(36)=(KeyLabel="Speak in Public Channel",Alias="Speak Public")
|
||||
BindingLabel(36)="Speak in Public Channel"
|
||||
Bindings(37)=(KeyLabel="Speak in local Channel",Alias="Speak Local")
|
||||
BindingLabel(37)="Speak in local Channel"
|
||||
Bindings(38)=(KeyLabel="Speak in Team Channel",Alias="Speak Team")
|
||||
BindingLabel(38)="Speak in Team Channel"
|
||||
Bindings(39)=(KeyLabel="Toggle Public Chatroom",Alias="TogglePublicChat")
|
||||
BindingLabel(39)="Toggle Public Channel"
|
||||
Bindings(40)=(KeyLabel="Toggle local Chatroom",Alias="ToggleLocalChat")
|
||||
BindingLabel(40)="Toggle local Channel"
|
||||
Bindings(41)=(KeyLabel="Toggle Team Chatroom",Alias="ToggleTeamChat")
|
||||
BindingLabel(41)="Toggle Team Channel"
|
||||
|
||||
BindingLabel(42)="ShoutSupport"
|
||||
Bindings(42)=(KeyLabel="Shout: Need Support",Alias="ShoutSupport")
|
||||
BindingLabel(43)="ShoutFormUp"
|
||||
Bindings(43)=(KeyLabel="Shout: Form Up On Me",Alias="ShoutFormUp")
|
||||
BindingLabel(44)="ShoutTakeThis"
|
||||
Bindings(44)=(KeyLabel="Shout: Take This",Alias="ShoutTakeThis")
|
||||
BindingLabel(45)="ShoutTrading"
|
||||
Bindings(45)=(KeyLabel="Shout: I'm Going Trading",Alias="ShoutTrading")
|
||||
BindingLabel(46)="ShoutMedic"
|
||||
Bindings(46)=(KeyLabel="Shout: MEDIC!",Alias="ShoutMedic")
|
||||
BindingLabel(47)="ShoutWelding"
|
||||
Bindings(47)=(KeyLabel="I'm Welding!",Alias="ShoutWelding")
|
||||
BindingLabel(48)="ShoutCovering"
|
||||
Bindings(48)=(KeyLabel="I'll Cover You!",Alias="ShoutCovering")
|
||||
|
||||
|
||||
Bindings(49)=(bIsSectionLabel=true,KeyLabel="Taunts")
|
||||
BindingLabel(49)="Taunts"
|
||||
Bindings(50)=(KeyLabel="Pelvic Thrust",Alias="taunt pthrust")
|
||||
BindingLabel(50)="Pelvic Thrust"
|
||||
Bindings(51)=(KeyLabel="Ass Smack",Alias="taunt asssmack")
|
||||
BindingLabel(51)="Ass Smack"
|
||||
Bindings(52)=(KeyLabel="Throat Cut",Alias="taunt throatcut")
|
||||
BindingLabel(52)="Throat Cut"
|
||||
Bindings(53)=(KeyLabel="Brag",Alias="taunt gesture_point")
|
||||
BindingLabel(53)="Brag"
|
||||
|
||||
Bindings(54)=(bIsSectionLabel=true,KeyLabel="Hud")
|
||||
BindingLabel(54)="Hud"
|
||||
Bindings(55)=(KeyLabel="Grow Hud",Alias="GrowHud")
|
||||
BindingLabel(55)="Grow Hud"
|
||||
Bindings(56)=(KeyLabel="Shrink Hud",Alias="ShrinkHud")
|
||||
BindingLabel(56)="Shrink Hud"
|
||||
|
||||
Bindings(57)=(bIsSectionLabel=true,KeyLabel="Game")
|
||||
BindingLabel(57)="Game"
|
||||
Bindings(58)=(KeyLabel="Use",Alias="use")
|
||||
BindingLabel(58)="Use"
|
||||
Bindings(59)=(KeyLabel="Pause",Alias="Pause")
|
||||
BindingLabel(59)="Pause"
|
||||
Bindings(60)=(KeyLabel="Screenshot",Alias="shot")
|
||||
BindingLabel(60)="Screenshot"
|
||||
Bindings(61)=(KeyLabel="Drop Cash",Alias="TossCash")
|
||||
BindingLabel(61)="Drop Cash"
|
||||
|
||||
Bindings(62)=(KeyLabel="Show Personal Stats",Alias="ShowStats")
|
||||
BindingLabel(62)="Show Personal Stats"
|
||||
Bindings(63)=(KeyLabel="View Next Player's Stats",Alias="NextStats")
|
||||
BindingLabel(63)="View Next Player's Stats"
|
||||
Bindings(64)=(KeyLabel="Server Info",Alias="ServerInfo")
|
||||
BindingLabel(64)="Server Info"
|
||||
|
||||
Bindings(65)=(bIsSectionLabel=true,KeyLabel="Miscellaneous")
|
||||
BindingLabel(65)="Miscellaneous"
|
||||
|
||||
Bindings(66)=(KeyLabel="Show Objectives",Alias="ShowScores")
|
||||
BindingLabel(66)="Show Objectives"
|
||||
|
||||
Bindings(67)=(KeyLabel="Menu",Alias="ShowMenu")
|
||||
BindingLabel(67)="Menu"
|
||||
Bindings(68)=(KeyLabel="Music Player",Alias="MusicMenu")
|
||||
BindingLabel(68)="Music Player"
|
||||
Bindings(69)=(KeyLabel="Voting Menu",Alias="ShowVoteMenu")
|
||||
BindingLabel(69)="Voting Menu"
|
||||
Bindings(70)=(KeyLabel="Toggle Console",Alias="ConsoleToggle")
|
||||
BindingLabel(70)="Toggle Console"
|
||||
Bindings(71)=(KeyLabel="View Connection Status",Alias="Stat Net")
|
||||
BindingLabel(71)="View Connection Status"
|
||||
Bindings(72)=(KeyLabel="Cancel Pending Connection",Alias="Cancel")
|
||||
BindingLabel(72)="Cancel Pending Connection"
|
||||
|
||||
Bindings(73)=(KeyLabel="Select Melee",Alias="SwitchWeapon 1")
|
||||
BindingLabel(73)="Select Melee"
|
||||
Bindings(74)=(KeyLabel="Select Pistol/Bullpup",Alias="SwitchWeapon 2")
|
||||
BindingLabel(74)="Select Pistol/Bullpup"
|
||||
Bindings(75)=(KeyLabel="Select Handcannon/Shotgun",Alias="SwitchWeapon 3")
|
||||
BindingLabel(75)="Select Handcannon/Shotgun"
|
||||
Bindings(76)=(KeyLabel="Select LAW/Crossbow/Rifle",Alias="SwitchWeapon 4")
|
||||
BindingLabel(76)="Select LAW/Crossbow/Rifle"
|
||||
Bindings(77)=(KeyLabel="Select Syringe/Welder",Alias="SwitchWeapon 6")
|
||||
BindingLabel(77)="Select Syringe/Welder"
|
||||
Bindings(78)=(KeyLabel="Quick Self-Heal",Alias="QuickHeal")
|
||||
BindingLabel(78)="Quick Self-Heal"
|
||||
}
|
||||
|
||||
5
kf_sources/KFGui/Classes/KFCreditPage.uc
Normal file
5
kf_sources/KFGui/Classes/KFCreditPage.uc
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
class KFCreditPage extends UT2K4ServerLoading;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
}
|
||||
189
kf_sources/KFGui/Classes/KFDCOptionPage.uc
Normal file
189
kf_sources/KFGui/Classes/KFDCOptionPage.uc
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
//==============================================================================
|
||||
// KFDCOptionPage
|
||||
//==============================================================================
|
||||
class KFDCOptionPage extends UT2K4DisconnectOptionPage;
|
||||
|
||||
function bool InternalOnClick(GUIComponent Sender)
|
||||
{
|
||||
local GUIController C;
|
||||
|
||||
if ( GUIButton(Sender) == None )
|
||||
return false;
|
||||
|
||||
C = Controller;
|
||||
switch (GUIButton(Sender).Caption)
|
||||
{
|
||||
case b_MainMenu.Caption:
|
||||
UT2K4GUIController(C).ReturnToMainMenu();
|
||||
return true;
|
||||
|
||||
case b_ServerBrowser.Caption:
|
||||
// If we still have a pending connection, do not close this menu when opening the server browser
|
||||
// or the player will be stuck in the menus if the connection succeeds, since the server browser
|
||||
// isn't allowed as last (closing the server browser would then cause the main menu to appear)
|
||||
if ( PlayerOwner().Level.IsPendingConnection() )
|
||||
C.OpenMenu( C.GetServerBrowserPage() );
|
||||
else
|
||||
{
|
||||
// Clear the controller's restore menu array or things will get very messy
|
||||
C.CloseAll(true,true);
|
||||
|
||||
C.RestoreMenus.Length = 0;
|
||||
C.OpenMenu( C.GetServerBrowserPage() );
|
||||
// Controller.ReplaceMenu( Controller.GetServerBrowserPage() );
|
||||
}
|
||||
return true;
|
||||
|
||||
case b_Quit.Caption:
|
||||
C.OpenMenu(C.GetQuitPage());
|
||||
return true;
|
||||
|
||||
case b_Reconnect.Caption:
|
||||
C.ViewportOwner.Console.DelayedConsoleCommand("Reconnect");
|
||||
C.CloseMenu(false);
|
||||
return True;
|
||||
// Controller.CloseAll(false,true);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function UpdateStatus(string NewStatus)
|
||||
{
|
||||
l_Status.Caption = NewStatus;
|
||||
}
|
||||
|
||||
function bool InternalOnPreDraw(Canvas C)
|
||||
{
|
||||
local int i;
|
||||
local float X, width;
|
||||
|
||||
for ( i = 0; i < Components.Length; i++ )
|
||||
if ( GUIButton(Components[i]) != None )
|
||||
width += Components[i].ActualWidth();
|
||||
|
||||
width += 30;
|
||||
X = ((ActualLeft() + ActualWidth()) / 2) - (width / 2);
|
||||
|
||||
for ( i = 0; i < Components.Length; i++ )
|
||||
{
|
||||
if ( GUIButton(Components[i]) != None )
|
||||
{
|
||||
Components[i].WinLeft = RelativeLeft(X);
|
||||
X += Components[i].ActualWidth() + 10;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function bool InternalOnKeyEvent(out byte Key, out byte State, float delta)
|
||||
{
|
||||
if ( Key == 0x0D && State == 3 ) // Enter
|
||||
return InternalOnClick( GUIButton(FocusedControl) );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
event bool NotifyLevelChange()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
function bool CanClose( bool bCancelled )
|
||||
{
|
||||
// Only allow this menu to be closed (using escape) if we are currently connected
|
||||
// to a server, or we still have a pending connection, unless we were in some other menu
|
||||
if ( bCancelled && Controller.KeyPressed(IK_Escape) && !PlayerOwner().Level.IsPendingConnection() && PlayerOwner().Level.IsEntry() )
|
||||
return Controller.Count() > 1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function bool AllowOpen(string MenuClass)
|
||||
{
|
||||
if (MenuClass~= "GUI2k4.UT2K4DisconnectOptionPage")
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
OnKeyEvent=InternalOnKeyEvent
|
||||
OnPreDraw=InternalOnPreDraw
|
||||
OnCanClose=CanClose
|
||||
|
||||
Begin Object Class=GUILabel Name=cNetStatLabel
|
||||
Caption="Select an option"
|
||||
TextALign=TXTA_Center
|
||||
StyleName="TextLabel"
|
||||
FontScale=FNS_Large
|
||||
WinWidth=1.000000
|
||||
WinHeight=0.099922
|
||||
WinLeft=0.000000
|
||||
WinTop=0.314687
|
||||
bMultiLine=true
|
||||
bBoundToParent=true
|
||||
VertAlign=TXTA_Left
|
||||
End Object
|
||||
l_Status=cNetStatLabel
|
||||
|
||||
Begin Object Class=GUIButton Name=ReconnectButton
|
||||
Caption="RECONNECT"
|
||||
StyleName="SquareButton"
|
||||
OnClick=InternalOnClick
|
||||
TabOrder=0
|
||||
WinWidth=0.132806
|
||||
WinHeight=0.040000
|
||||
WinLeft=0.345702
|
||||
WinTop=0.548235
|
||||
bAutoSize=True
|
||||
End Object
|
||||
b_Reconnect=ReconnectButton
|
||||
|
||||
Begin Object Class=GUIButton Name=MainMenuButton
|
||||
Caption="MAIN MENU"
|
||||
StyleName="SquareButton"
|
||||
OnClick=InternalOnClick
|
||||
TabOrder=1
|
||||
WinWidth=0.132806
|
||||
WinHeight=0.040000
|
||||
WinLeft=0.157811
|
||||
WinTop=0.548235
|
||||
bAutoSize=True
|
||||
End Object
|
||||
b_MainMenu=MainMenuButton
|
||||
|
||||
Begin Object Class=GUIButton Name=ServerBrowserButton
|
||||
Caption="SERVER BROWSER"
|
||||
StyleName="SquareButton"
|
||||
OnClick=InternalOnClick
|
||||
TabOrder=2
|
||||
WinWidth=0.223632
|
||||
WinHeight=0.040000
|
||||
WinLeft=0.398437
|
||||
WinTop=0.548235
|
||||
bAutoSize=True
|
||||
End Object
|
||||
b_ServerBrowser=ServerBrowserButton
|
||||
|
||||
Begin Object Class=GUIButton Name=QuitButton
|
||||
Caption="EXIT UT2004"
|
||||
StyleName="SquareButton"
|
||||
OnClick=InternalOnClick
|
||||
TabOrder=3
|
||||
WinWidth=0.223632
|
||||
WinHeight=0.040000
|
||||
WinLeft=0.627929
|
||||
WinTop=0.548235
|
||||
bAutoSize=True
|
||||
End Object
|
||||
b_Quit=QuitButton
|
||||
|
||||
OpenSound=sound'KF_MenuSnd.msfxEdit'
|
||||
// bDisconnectOnOpen=true
|
||||
bReconnectAllowed=True
|
||||
bAllowedAsLast=true
|
||||
}
|
||||
337
kf_sources/KFGui/Classes/KFDLCList.uc
Normal file
337
kf_sources/KFGui/Classes/KFDLCList.uc
Normal file
|
|
@ -0,0 +1,337 @@
|
|||
class KFDLCList extends GUIVertList;
|
||||
|
||||
// Settings
|
||||
var() float HorizontalSpacing;
|
||||
var() float VerticalSpacing;
|
||||
var() array<string> CharacterNames;
|
||||
var() array<texture> CharacterUnownedTextures;
|
||||
var() array<texture> CharacterOwnedTextures;
|
||||
var() array<int> WeaponAppIDs;
|
||||
var() array<texture> WeaponUnownedTextures;
|
||||
var() array<texture> WeaponOwnedTextures;
|
||||
var() texture OverlayTexture;
|
||||
var() texture HoverTexture;
|
||||
|
||||
// Display
|
||||
var array<int> bItemIsCharacter;
|
||||
var array<int> bItemOwned;
|
||||
var array<string> ItemAppID;
|
||||
var array<texture> ItemBackground;
|
||||
var int IgnoreWeaponItem;
|
||||
var int IgnoreCharacterItem;
|
||||
|
||||
// State
|
||||
var int ItemHoverIndex;
|
||||
var PlayerController MyPCOwner;
|
||||
var SteamStatsAndAchievementsBase MyStatsAndAchievements;
|
||||
|
||||
event Closed(GUIComponent Sender, bool bCancelled)
|
||||
{
|
||||
MyPCOwner = none;
|
||||
MyStatsAndAchievements = none;
|
||||
|
||||
super.Closed(Sender, bCancelled);
|
||||
}
|
||||
|
||||
function InitList(PlayerController PCOwner, SteamStatsAndAchievementsBase StatsAndAchievements, bool bShowCharacters, bool bShowWeapons)
|
||||
{
|
||||
local int i, j;
|
||||
|
||||
OnDrawItem = DrawDLCItem;
|
||||
|
||||
// Hold onto our references
|
||||
MyPCOwner = PCOwner;
|
||||
MyStatsAndAchievements = StatsAndAchievements;
|
||||
|
||||
if ( ItemBackground.Length == 0 )
|
||||
{
|
||||
// Set up the Unowned Weapon DLC items
|
||||
if ( bShowWeapons )
|
||||
{
|
||||
// Show newest items first
|
||||
for ( i = WeaponAppIDs.Length - 1; i >= 0; i-- )
|
||||
{
|
||||
if( i == IgnoreWeaponItem )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( !MyStatsAndAchievements.PlayerOwnsWeaponDLC(WeaponAppIDs[i]) )
|
||||
{
|
||||
bItemIsCharacter[bItemIsCharacter.Length] = 0;
|
||||
bItemOwned[bItemOwned.Length] = 0;
|
||||
ItemAppID[ItemAppID.Length] = string(WeaponAppIDs[i]);
|
||||
ItemBackground[ItemBackground.Length] = WeaponUnownedTextures[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set up the Unowned Character DLC items
|
||||
if ( bShowCharacters )
|
||||
{
|
||||
// Show newest items first
|
||||
for ( i = CharacterNames.Length - 1; i >= 0; i-- )
|
||||
{
|
||||
if( i == IgnoreCharacterItem )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( !MyPCOwner.CharacterAvailable(CharacterNames[i]) )
|
||||
{
|
||||
bItemIsCharacter[bItemIsCharacter.Length] = 1;
|
||||
bItemOwned[bItemOwned.Length] = 0;
|
||||
ItemAppID[ItemAppID.Length] = CharacterNames[i];
|
||||
ItemBackground[ItemBackground.Length] = CharacterUnownedTextures[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set up the Owned Weapon DLC items
|
||||
if ( bShowWeapons )
|
||||
{
|
||||
// Show newest items first
|
||||
for ( i = WeaponAppIDs.Length - 1; i >= 0; i-- )
|
||||
{
|
||||
if( i == IgnoreWeaponItem )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( MyStatsAndAchievements.PlayerOwnsWeaponDLC(WeaponAppIDs[i]) )
|
||||
{
|
||||
bItemIsCharacter[bItemIsCharacter.Length] = 0;
|
||||
bItemOwned[bItemOwned.Length] = 1;
|
||||
ItemAppID[ItemAppID.Length] = string(WeaponAppIDs[i]);
|
||||
ItemBackground[ItemBackground.Length] = WeaponOwnedTextures[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set up the Owned Character DLC items
|
||||
if ( bShowCharacters )
|
||||
{
|
||||
// Show newest items first
|
||||
for ( i = CharacterNames.Length - 1; i >= 0; i-- )
|
||||
{
|
||||
if( i == IgnoreCharacterItem )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( MyPCOwner.CharacterAvailable(CharacterNames[i]) )
|
||||
{
|
||||
bItemIsCharacter[bItemIsCharacter.Length] = 1;
|
||||
bItemOwned[bItemOwned.Length] = 1;
|
||||
ItemAppID[ItemAppID.Length] = CharacterNames[i];
|
||||
ItemBackground[ItemBackground.Length] = CharacterOwnedTextures[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update the ItemCount and select the first item
|
||||
ItemCount = Ceil(float(ItemBackground.Length) / 3.0);
|
||||
SetIndex(0);
|
||||
|
||||
if ( bNotify )
|
||||
{
|
||||
CheckLinkedObjects(Self);
|
||||
}
|
||||
|
||||
if ( MyScrollBar != none )
|
||||
{
|
||||
MyScrollBar.AlignThumb();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function DrawDLCItem(Canvas Canvas, int Index, float X, float Y, float Width, float Height, bool bSelected, bool bPending)
|
||||
{
|
||||
local float ThisItemWidth, ThisItemHeight;
|
||||
local int HoverIndex, ItemIndex, i;
|
||||
|
||||
ItemIndex = Index * 3;
|
||||
ThisItemWidth = (Width - (2 * HorizontalSpacing)) / 3.0;
|
||||
ThisItemHeight = Height - VerticalSpacing;
|
||||
|
||||
// Setup our cheat for Mouse Click reaction
|
||||
if ( Index == Top )
|
||||
{
|
||||
ItemHoverIndex = -1;
|
||||
}
|
||||
|
||||
// Determine if the Mouse is hovering over this row
|
||||
HoverIndex = -1;
|
||||
if ( Controller.MouseY - Y >= 0.0 && Controller.MouseY - Y <= ThisItemHeight )
|
||||
{
|
||||
if ( Controller.MouseX - X >= 0.0 && Controller.MouseX - X <= Width )
|
||||
{
|
||||
if ( Controller.MouseX - X <= ThisItemWidth )
|
||||
{
|
||||
HoverIndex = 0;
|
||||
ItemHoverIndex = ItemIndex;
|
||||
}
|
||||
else if ( Controller.MouseX - X >= ThisItemWidth + HorizontalSpacing && Controller.MouseX - X <= ThisItemWidth * 2 + HorizontalSpacing )
|
||||
{
|
||||
HoverIndex = 1;
|
||||
ItemHoverIndex = ItemIndex + 1;
|
||||
}
|
||||
else if ( Controller.MouseX - X >= ThisItemWidth * 2 + HorizontalSpacing * 2 )
|
||||
{
|
||||
HoverIndex = 2;
|
||||
ItemHoverIndex = ItemIndex + 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Draw this row of items
|
||||
for ( i = 0; i < 3 && ItemIndex < ItemBackground.Length; i++ )
|
||||
{
|
||||
// Initialize the Canvas
|
||||
Canvas.Style = 1;
|
||||
Canvas.SetDrawColor(255, 255, 255, 255);
|
||||
|
||||
// Draw the Item Background
|
||||
Canvas.SetPos(X, Y);
|
||||
Canvas.DrawTile(ItemBackground[ItemIndex], ThisItemWidth, ThisItemHeight, 0, 0, 256, 128);
|
||||
|
||||
// Draw an Overlay, if necessary
|
||||
if ( bItemOwned[ItemIndex] == 0 )
|
||||
{
|
||||
Canvas.SetPos(X, Y);
|
||||
|
||||
// Draw Hover overlay if mouse is within item
|
||||
if ( i == HoverIndex )
|
||||
{
|
||||
Canvas.DrawTile(HoverTexture, ThisItemWidth, ThisItemHeight, 0, 0, 256, 128);
|
||||
}
|
||||
else
|
||||
{
|
||||
Canvas.DrawTile(OverlayTexture, ThisItemWidth, ThisItemHeight, 0, 0, 256, 128);
|
||||
}
|
||||
}
|
||||
|
||||
X += ThisItemWidth + HorizontalSpacing;
|
||||
ItemIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
function float DLCItemHeight(Canvas c)
|
||||
{
|
||||
return (MenuOwner.ActualHeight() / 3.0) - 1.0;
|
||||
}
|
||||
|
||||
function bool InternalOnClick(GUIComponent Sender)
|
||||
{
|
||||
if ( !IsInClientBounds() || ItemsPerPage==0 )
|
||||
return false;
|
||||
|
||||
if ( bItemOwned[ItemHoverIndex] == 0 )
|
||||
{
|
||||
if ( bItemIsCharacter[ItemHoverIndex] == 1 )
|
||||
{
|
||||
MyPCOwner.PurchaseCharacter(ItemAppID[ItemHoverIndex]);
|
||||
}
|
||||
else
|
||||
{
|
||||
MyStatsAndAchievements.PurchaseWeaponDLC(int(ItemAppID[ItemHoverIndex]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
HorizontalSpacing=8.0
|
||||
VerticalSpacing=5.0
|
||||
|
||||
CharacterNames[0]="FoundryWorker_Aldridge"
|
||||
CharacterUnownedTextures[0]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Desat_Outbreak'
|
||||
CharacterOwnedTextures[0]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Owned_Outbreak'
|
||||
CharacterNames[1]="Mr_Foster"
|
||||
CharacterUnownedTextures[1]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Desat_Nightfall'
|
||||
CharacterOwnedTextures[1]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Owned_Nightfall'
|
||||
CharacterNames[2]="Harold_Hunt"
|
||||
CharacterUnownedTextures[2]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Desat_PostMortem'
|
||||
CharacterOwnedTextures[2]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Owned_PostMortem'
|
||||
CharacterNames[3]="Captian_Wiggins"
|
||||
CharacterUnownedTextures[3]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Desat_London'
|
||||
CharacterOwnedTextures[3]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Owned_London'
|
||||
CharacterNames[4]="Steampunk_Berserker"
|
||||
CharacterUnownedTextures[4]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Desat_Steampunk'
|
||||
CharacterOwnedTextures[4]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Owned_Steampunk'
|
||||
CharacterNames[5]="Steampunk_Commando"
|
||||
CharacterUnownedTextures[5]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Desat_SteamPTwo'
|
||||
CharacterOwnedTextures[5]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Owned_SteamPTwo'
|
||||
CharacterNames[6]="Dave_The_Butcher_Roberts"
|
||||
CharacterUnownedTextures[6]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Desat_UrbanNightmare'
|
||||
CharacterOwnedTextures[6]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Owned_UrbanNightmare'
|
||||
CharacterNames[7]="Harold_Lott"
|
||||
CharacterUnownedTextures[7]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Desat_MoneyMoney'
|
||||
CharacterOwnedTextures[7]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Owned_MoneyMoney'
|
||||
CharacterNames[8]="Ash_Harding"
|
||||
CharacterUnownedTextures[8]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Desat_Ash'
|
||||
CharacterOwnedTextures[8]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Owned_Ash'
|
||||
CharacterNames[9]="ChickenNator"
|
||||
CharacterUnownedTextures[9]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Desat_Chickenator'
|
||||
CharacterOwnedTextures[9]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Owned_Chickenator'
|
||||
CharacterNames[10]="DAR"
|
||||
CharacterUnownedTextures[10]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Desat_Robot'
|
||||
CharacterOwnedTextures[10]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Owned_Robot'
|
||||
CharacterNames[11]="Mrs_Foster"
|
||||
CharacterUnownedTextures[11]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Desat_MrsFoster'
|
||||
CharacterOwnedTextures[11]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Owned_MrsFoster'
|
||||
CharacterNames[12]="Reggie"
|
||||
CharacterUnownedTextures[12]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Desat_Reggie'
|
||||
CharacterOwnedTextures[12]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Owned_Reggie'
|
||||
CharacterNames[13]="Harchier_Spebbington_II"
|
||||
CharacterUnownedTextures[13]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Desat_NewHarchier'
|
||||
CharacterOwnedTextures[13]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Owned_NewHarchier'
|
||||
// MR. MAGMA & VOLTAGE PLACEHOLDER
|
||||
CharacterNames[14]="Mr_Magma"
|
||||
CharacterUnownedTextures[14]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Desat_SkullyFoster'
|
||||
CharacterOwnedTextures[14]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Owned_SkullyFoster'
|
||||
CharacterNames[15]="New_Bundles"
|
||||
CharacterUnownedTextures[15]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Desat_NewBundles'
|
||||
CharacterOwnedTextures[15]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Owned_NewBundles'
|
||||
|
||||
WeaponAppIDs[0]=210934
|
||||
WeaponUnownedTextures[0]=Texture'KF_DLC.Weapons.UI_KFDLC_Weapons_Desat_Community'
|
||||
WeaponOwnedTextures[0]=Texture'KF_DLC.Weapons.UI_KFDLC_Weapons_Owned_Community'
|
||||
|
||||
WeaponAppIDs[1]=210938
|
||||
WeaponUnownedTextures[1]=Texture'KF_DLC.Weapons.UI_KFDLC_Weapons_Desat_Gold-Pack'
|
||||
WeaponOwnedTextures[1]=Texture'KF_DLC.Weapons.UI_KFDLC_Weapons_Owned_Gold-Pack'
|
||||
|
||||
WeaponAppIDs[2]=210943
|
||||
WeaponUnownedTextures[2]=Texture'KF_DLC.Weapons.UI_KFDLC_Weapons_Desat_CommunitySteamP'
|
||||
WeaponOwnedTextures[2]=Texture'KF_DLC.Weapons.UI_KFDLC_Weapons_Owned_CommunitySteamP'
|
||||
|
||||
WeaponAppIDs[3]=210944
|
||||
WeaponUnownedTextures[3]=Texture'KF_DLC.Weapons.UI_KFDLC_Weapons_Desat_Gold-Pack2'
|
||||
WeaponOwnedTextures[3]=Texture'KF_DLC.Weapons.UI_KFDLC_Weapons_Owned_Gold-Pack2'
|
||||
|
||||
WeaponAppIDs[4]=258751
|
||||
WeaponUnownedTextures[4]=Texture'KF_DLC.Weapons.UI_KFDLC_Weapons_Desat_UsVSThemWeaponPack'
|
||||
WeaponOwnedTextures[4]=Texture'KF_DLC.Weapons.UI_KFDLC_Weapons_Owned_UsVSThemWeaponPack'
|
||||
|
||||
WeaponAppIDs[5]=258752
|
||||
WeaponUnownedTextures[5]=Texture'KF_DLC.Weapons.UI_KFDLC_Weapons_Desat_CamoWeaponPack'
|
||||
WeaponOwnedTextures[5]=Texture'KF_DLC.Weapons.UI_KFDLC_Weapons_Owned_CamoWeaponPack'
|
||||
|
||||
WeaponAppIDs[6]=309991
|
||||
WeaponUnownedTextures[6]=Texture'KF_DLC.Weapons.UI_KFDLC_Weapons_Desat_Neon'
|
||||
WeaponOwnedTextures[6]=Texture'KF_DLC.Weapons.UI_KFDLC_Weapons_Owned_Neon'
|
||||
|
||||
WeaponAppIDs[7]=326960
|
||||
WeaponUnownedTextures[7]=Texture'KF_DLC.Weapons.UI_KFDLC_Characters_Desat_ToyMaster'
|
||||
WeaponOwnedTextures[7]=Texture'KF_DLC.Characters.UI_KFDLC_Characters_Owned_ToyMaster'
|
||||
|
||||
OverlayTexture=Texture'KF_DLC.Characters.UI_KFDLC_Unselected_BuyNow'
|
||||
HoverTexture=Texture'KF_DLC.Characters.UI_KFDLC_MouseOver_BuyNow'
|
||||
|
||||
FontScale=FNS_Medium
|
||||
GetItemHeight=KFDLCList.DLCItemHeight
|
||||
|
||||
IgnoreWeaponItem=7
|
||||
IgnoreCharacterItem=15
|
||||
}
|
||||
33
kf_sources/KFGui/Classes/KFDLCListBox.uc
Normal file
33
kf_sources/KFGui/Classes/KFDLCListBox.uc
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
class KFDLCListBox extends GUIListBoxBase;
|
||||
|
||||
var KFDLCList List;
|
||||
var bool bShowCharacters;
|
||||
var bool bShowWeapons;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
Super.InitComponent(MyController,MyOwner);
|
||||
|
||||
if ( DefaultListClass != "" )
|
||||
{
|
||||
List = KFDLCList(AddComponent(DefaultListClass));
|
||||
if ( List == none )
|
||||
{
|
||||
log(Class$".InitComponent - Could not create default list ["$DefaultListClass$"]");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( List == none )
|
||||
{
|
||||
Warn("Could not initialize list!");
|
||||
return;
|
||||
}
|
||||
|
||||
InitBaseList(List);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
DefaultListClass="KFGUI.KFDLCList"
|
||||
}
|
||||
89
kf_sources/KFGui/Classes/KFDLCPage.uc
Normal file
89
kf_sources/KFGui/Classes/KFDLCPage.uc
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
class KFDLCPage extends UT2K4MainPage;
|
||||
|
||||
var() UT2K4TabPanel ActivePanel;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
local int i;
|
||||
|
||||
Super.InitComponent(MyController, MyOwner);
|
||||
|
||||
for ( i = 0; i < PanelCaption.Length && i < PanelClass.Length && i < PanelHint.Length; i++ )
|
||||
{
|
||||
log("KFDLCPage:" @ i @ c_Tabs.AddTab(PanelCaption[i], PanelClass[i],, PanelHint[i]));
|
||||
}
|
||||
|
||||
for ( i = 0; i < c_Tabs.TabStack.Length; i++ )
|
||||
{
|
||||
log("KFDLCPage:" @ i);
|
||||
}
|
||||
}
|
||||
|
||||
event Opened(GUIComponent Sender)
|
||||
{
|
||||
super.Opened(Sender);
|
||||
c_Tabs.ActivateTabByName(PanelCaption[0], true);
|
||||
}
|
||||
|
||||
function InternalOnChange(GUIComponent Sender)
|
||||
{
|
||||
Super.InternalOnChange(Sender);
|
||||
|
||||
if ( c_Tabs.ActiveTab == None )
|
||||
{
|
||||
ActivePanel = None;
|
||||
}
|
||||
else
|
||||
{
|
||||
ActivePanel = UT2K4TabPanel(c_Tabs.ActiveTab.MyPanel);
|
||||
}
|
||||
}
|
||||
|
||||
function BackButtonClicked()
|
||||
{
|
||||
c_Tabs.ActiveTab.OnDeActivate();
|
||||
Controller.CloseMenu(False);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Begin Object class=GUIHeader name=Header
|
||||
Caption="DLC Content"
|
||||
WinHeight=25
|
||||
RenderWeight=0.3
|
||||
End Object
|
||||
t_Header=GUIHeader'KFGui.KFDLCPage.Header'
|
||||
|
||||
Begin Object Class=KFDLCPage_Footer Name=Footer
|
||||
RenderWeight=0.3
|
||||
TabOrder=4
|
||||
End Object
|
||||
t_Footer=KFDLCPage_Footer'KFGui.KFDLCPage.Footer'
|
||||
|
||||
Begin Object Class=BackgroundImage Name=PageBackground
|
||||
Image=Texture'KillingFloor2HUD.menu.menuBackground'
|
||||
ImageStyle=ISTY_Justified
|
||||
ImageAlign=IMGA_Center
|
||||
RenderWeight=0.010000
|
||||
End Object
|
||||
i_Background=PageBackground
|
||||
|
||||
WinWidth=1.0
|
||||
WinHeight=1.0
|
||||
WinTop=0.0
|
||||
WinLeft=0.0
|
||||
|
||||
PanelCaption(0)="Show All"
|
||||
PanelCaption(1)="Characters"
|
||||
PanelCaption(2)="Weapons"
|
||||
|
||||
PanelClass(0)="KFGui.KFTab_DLCAll"
|
||||
PanelClass(1)="KFGui.KFTab_DLCCharacters"
|
||||
PanelClass(2)="KFGui.KFTab_DLCWeapons"
|
||||
|
||||
PanelHint(0)="View All DLC Packs"
|
||||
PanelHint(1)="Show only Character DLC Packs"
|
||||
PanelHint(2)="Show only Weapon DLC Packs"
|
||||
|
||||
BackgroundColor=(R=0,B=0,G=0,A=255)
|
||||
}
|
||||
24
kf_sources/KFGui/Classes/KFDLCPage_Footer.uc
Normal file
24
kf_sources/KFGui/Classes/KFDLCPage_Footer.uc
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
class KFDLCPage_Footer extends UT2K4Settings_Footer;
|
||||
|
||||
var KFDLCPage DLCPage;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
Super.InitComponent(MyController,MyOwner);
|
||||
DLCPage = KFDLCPage(MyOwner);
|
||||
b_Defaults.SetVisibility(false);
|
||||
}
|
||||
|
||||
function bool InternalOnClick(GUIComponent Sender)
|
||||
{
|
||||
if ( Sender == b_Back)
|
||||
{
|
||||
DLCPage.BackButtonClicked();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
}
|
||||
11
kf_sources/KFGui/Classes/KFDecrepitFont.uc
Normal file
11
kf_sources/KFGui/Classes/KFDecrepitFont.uc
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
class KFDecrepitFont extends GUIFont;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
KeyName="KFDecrepitFont"
|
||||
FontArrayNames(0)="KFFonts.Decrepit"
|
||||
FontArrayNames(1)="KFFonts.Decrepit"
|
||||
FontArrayNames(2)="KFFonts.Decrepit"
|
||||
FontArrayNames(3)="KFFonts.Decrepit"
|
||||
FontArrayNames(4)="KFFonts.Decrepit"
|
||||
}
|
||||
87
kf_sources/KFGui/Classes/KFDisconnectPage.uc
Normal file
87
kf_sources/KFGui/Classes/KFDisconnectPage.uc
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
// Fancy new in-game disconnect page
|
||||
|
||||
class KFDisconnectPage extends GUIPage;
|
||||
|
||||
var bool bIgnoreEsc;
|
||||
|
||||
var localized string LeaveMPButtonText;
|
||||
var localized string LeaveSPButtonText;
|
||||
|
||||
var float ButtonWidth;
|
||||
var float ButtonHeight;
|
||||
var float ButtonHGap;
|
||||
var float ButtonVGap;
|
||||
var float BarHeight;
|
||||
var float BarVPos;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
Super.InitComponent(Mycontroller, MyOwner);
|
||||
PlayerOwner().ClearProgressMessages();
|
||||
}
|
||||
|
||||
function bool InternalOnClick(GUIComponent Sender)
|
||||
{
|
||||
if ( Sender==Controls[1] ) // OK
|
||||
{
|
||||
Controller.OpenMenu("KFGui.KFServerBrowser");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
event HandleParameters(string Param1, string Param2)
|
||||
{
|
||||
GUILabel(Controls[2]).Caption = Param1$"|"$Param2;
|
||||
PlayerOwner().ClearProgressMessages();
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Begin Object Class=AltSectionBackground name=NetStatBackground
|
||||
bAcceptsInput=false
|
||||
bNeverFocus=true
|
||||
WinHeight=0.25
|
||||
WinWidth=0.75
|
||||
WinLeft=0.125
|
||||
WinTop=0.375
|
||||
End Object
|
||||
Controls(0)=AltSectionBackground'NetStatBackground'
|
||||
|
||||
Begin Object Class=GUIButton Name=NetStatOk
|
||||
Caption="OK"
|
||||
StyleName="MidGameButton"
|
||||
OnClick=InternalOnClick
|
||||
bBoundToParent=true
|
||||
WinWidth=0.250000
|
||||
WinHeight=0.050000
|
||||
WinLeft=0.375000
|
||||
WinTop=0.675000
|
||||
End Object
|
||||
Controls(1)=GUIButton'NetStatOK'
|
||||
|
||||
Begin Object Class=GUILabel Name=NetStatLabel
|
||||
Caption=""
|
||||
TextFont="UT2HeaderFont"
|
||||
TextALign=TXTA_Center
|
||||
TextColor=(R=255,G=255,B=255,A=255)
|
||||
WinWidth=1
|
||||
WinHeight=0.5
|
||||
WinLeft=0
|
||||
WinTop=0.125
|
||||
bMultiLine=true
|
||||
bBoundToParent=true
|
||||
End Object
|
||||
Controls(2)=GUILabel'NetStatLabel'
|
||||
|
||||
// Replaceme
|
||||
OpenSound=sound'ROMenuSounds.msfxEdit'
|
||||
|
||||
bIgnoreEsc=true
|
||||
bRequire640x480=false
|
||||
|
||||
WinTop=0.375;
|
||||
WinHeight=0.25;
|
||||
WinWidth=1.0;
|
||||
WinLeft=0.0;
|
||||
}
|
||||
211
kf_sources/KFGui/Classes/KFEULA.uc
Normal file
211
kf_sources/KFGui/Classes/KFEULA.uc
Normal file
|
|
@ -0,0 +1,211 @@
|
|||
class KFEULA extends LargeWindow;
|
||||
|
||||
const NUM_EULA_LINES = 86;
|
||||
|
||||
var localized string EULA_Text[NUM_EULA_LINES];
|
||||
|
||||
var automated GUIScrollTextBox lb_EULA;
|
||||
|
||||
var automated GUIButton b_Accept, b_Quit;
|
||||
|
||||
var bool bAgreedToEULA;
|
||||
|
||||
function bool InternalOnCanClose(optional bool bCanceled)
|
||||
{
|
||||
return bAgreedToEULA;
|
||||
}
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
local string temp;
|
||||
local int i;
|
||||
|
||||
Super.InitComponent(MyController,MyOwner);
|
||||
|
||||
temp = "";
|
||||
for (i = 0; i < NUM_EULA_LINES; i++)
|
||||
temp $= EULA_Text[i];
|
||||
|
||||
lb_EULA.SetContent(temp);
|
||||
b_ExitButton.OnClick = QuitClicked;
|
||||
}
|
||||
|
||||
function bool AcceptClicked(GUIComponent Sender)
|
||||
{
|
||||
local GUIPage page;
|
||||
|
||||
page = Controller.FindMenuByClass(Class'KFMainMenu');
|
||||
if (KFMainMenu(page) == none)
|
||||
warn("Unable to find KFMainMenu in menu stack! EULA cannot be marked as accepted.");
|
||||
else
|
||||
{
|
||||
KFMainMenu(page).AcceptedEULA = true;
|
||||
KFMainMenu(page).SaveConfig();
|
||||
}
|
||||
|
||||
bAgreedToEULA = true;
|
||||
Controller.RemoveMenu(self);
|
||||
return true;
|
||||
}
|
||||
|
||||
function bool QuitClicked(GUIComponent Sender)
|
||||
{
|
||||
PlayerOwner().ConsoleCommand("exit");
|
||||
return true;
|
||||
}
|
||||
|
||||
function bool NotifyLevelChange()
|
||||
{
|
||||
LevelChanged();
|
||||
return false;
|
||||
}
|
||||
|
||||
function bool InternalOnKeyEvent(out byte Key,out byte State,float delta)
|
||||
{
|
||||
if(Key == 0x1B && State == 1) // Escape pressed
|
||||
{
|
||||
QuitClicked(none);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
WindowName="End User License Agreement"
|
||||
//EULA_Text="Please read the following carefully and select a button.|'EULAs are bad m'kay'|'EULAs are bad m'kay'||'EULAs are bad m'kay'||'EULAs are bad m'kay'||'EULAs are bad m'kay'||'EULAs are bad m'kay'||'EULAs are bad m'kay'|'EULAs are bad m'kay'|'EULAs are bad m'kay'||'EULAs are bad m'kay'||'EULAs are bad m'kay'||Do you agree to the terms specified in this End User License Agreement?"
|
||||
EULA_Text(0)="Killing Floor EULA [END USER LICENSE AGREEMENT]|"
|
||||
EULA_Text(1)="|"
|
||||
EULA_Text(2)=" Tripwire Interactive would like to thank you for getting Killing Floor. We hope you enjoy the experience. But before you get started, we need to make some matters clear. When you paid for Killing Floor you did not actually buy the game. What you bought was a license to use the software that comprises the game and its related materials. And that license is subject to the terms of this EULA. This EULA is a binding contract between you and Tripwire Interactive and its licensors, licensees and suppliers. |"
|
||||
EULA_Text(3)="|"
|
||||
EULA_Text(4)=" We know you want to get the game installed and start playing it. But, please take the time to read through this agreement first because BY INSTALLING KILLING FLOOR YOU ARE ACKNOWLEDGING THAT YOU HAVE READ THIS EULA, AGREE TO ITS TERMS AND AGREE TO BE BOUND BY THEM. IF YOU DO NOT AGREE TO THESE TERMS, PROMPTLY DISCONTINUE THE INSTALLATION PROCESS AND CEASE ANY AND ALL USE OF THIS SOFTWARE.|"
|
||||
EULA_Text(5)="|"
|
||||
EULA_Text(6)="1. Limited Use License|"
|
||||
EULA_Text(7)="|"
|
||||
EULA_Text(8)=" Killing Floor software and any files that are provided with it by digital distribution or on tangible media, including the KF Editor, as well as any printed materials, patches or updates, (collectively referred to as 'KF') contains copyrighted material, trade secrets and other proprietary material of Tripwire Interactive and its licensors, licensees and suppliers. KF is licensed to you for your use. This license is a non exclusive limited license to install and use KF for yourself, including use over the internet or on a LAN. Your continuing license to use KF is conditioned on your compliance with this EULA. If you violate any of the terms of this EULA, all of your rights to use KF will immediately end, without any further notification from Tripwire Interactive or anyone else. Once your license is terminated, you will be obliged to immediately uninstall KF and all of its components.|"
|
||||
EULA_Text(9)="|"
|
||||
EULA_Text(10)="2. Permitted User Modifications and New Creations|"
|
||||
EULA_Text(11)="|"
|
||||
EULA_Text(12)=" The Killing Floor Editor ('KFEd') comes with KF. You can use KFEd to make mods or create new content to be played in KF. You agree that you will not distribute or share the KFEd because it is not shareware. You agree that any new creations or materials that you make for KF, with or without the KFEd, (collectively referred to as 'Mods') are subject to the following restrictions:|"
|
||||
EULA_Text(13)="|"
|
||||
EULA_Text(14)=" - Your Mods must only work with the full, registered copy of KF, not independently or with any other software.|"
|
||||
EULA_Text(15)=" |"
|
||||
EULA_Text(16)=" - Your Mods must not contain modifications to any executable file(s).|"
|
||||
EULA_Text(17)="|"
|
||||
EULA_Text(18)=" - Your Mods must not contain any libelous, defamatory, or other illegal material, material that is scandalous or invades the rights of privacy or publicity of any third party, nor may your Mods contain, or be used in conjunction with, any trademarks, copyright protected work, or other recognizable property of third parties without their written authority, nor may your Mods be used by you, or anyone else, for any commercial exploitation including, but not limited to in-game advertising, other advertising or marketing for any company, product or service.|"
|
||||
EULA_Text(19)="|"
|
||||
EULA_Text(20)=" - While we encourage folks to make Mods, Mods will not be supported by Tripwire Interactive and its licensors, licensees or suppliers, and if distributed pursuant to this license your Mods must include a statement to that effect.|"
|
||||
EULA_Text(21)="|"
|
||||
EULA_Text(22)=" - Your Mods must be distributed for free, period. Neither you, nor any other person or party, may sell them to anyone, commercially exploit them in any way, or charge anyone for receiving or using them without prior written consent from Tripwire Interactive. You may exchange them at no charge among other end users and distribute them to others over the Internet, on magazine cover disks, or otherwise for free.|"
|
||||
EULA_Text(23)="|"
|
||||
EULA_Text(24)=" - The prohibitions and restrictions in this section apply to anyone in possession of KF or any Mods.|"
|
||||
EULA_Text(25)="|"
|
||||
EULA_Text(26)=" Tripwire Interactive wholeheartedly supports the Modding of KF. But we need to retain all of our ownership rights in KF and any works derived from KF. That's just the way it is. So, go make some more cool stuff. But remember that you do not gain any ownership whatsoever in any KF content nor can you use any KF content outside the scope of the rights granted here. |"
|
||||
EULA_Text(27)="|"
|
||||
EULA_Text(28)="3. Commercial Exploitation|"
|
||||
EULA_Text(29)="|"
|
||||
EULA_Text(30)=" You may not use KF, or any Mods created for or from KF or using the KFEd or any other tools provided with this KF, for any commercial purposes without the prior written consent of Tripwire Interactive or its authorized licensees including, but not limited to, the following rules: 1. If you are the proprietor of an Internet cafe or gaming room, you may operate the KF in a 'pay for play' environment provided that all computers each have validly licensed KF installed, such KF having been properly purchased through one of our licensees. 2. You may not, without"
|
||||
EULA_Text(31)=" prior written consent from Tripwire Interactive, operate the KF in any gaming contest where (a) the cash value of all winnings and prizes paid throughout the entire competition is equal to or greater than US$10,000.00 or (b) the name of the event, or any individual contest therein, incorporates or approximates the name of a company, product or commercial service or (c) any company has provided, whether donated or as sponsorship any prizes, products or services worth with a fair market value of over US$20,000.00. |"
|
||||
EULA_Text(32)="|"
|
||||
EULA_Text(33)="4. Restrictions on Use|"
|
||||
EULA_Text(34)="|"
|
||||
EULA_Text(35)=" Just to make sure you understand what you can and can not do with KF, here is a list of restrictions to your use of KF under this EULA:|"
|
||||
EULA_Text(36)="|"
|
||||
EULA_Text(37)=" - You may not decompile, modify, reverse engineer, publicly display, prepare derivative works based on KF (except as permitted in Section 2, above), disassemble or otherwise reproduce KF.|"
|
||||
EULA_Text(38)="|"
|
||||
EULA_Text(39)=" - Except as set forth herein, you may not rent, sell, lease, barter, sublicense or distribute KF. ||"
|
||||
EULA_Text(40)=" - You may not delete the copyright notices or any other proprietary legends on the original copy of KF. |"
|
||||
EULA_Text(41)="|"
|
||||
EULA_Text(42)=" - You may not offer KF on a pay per play basis or otherwise commercially exploit KF or use KF for any commercial purpose except as described in this agreement. |"
|
||||
EULA_Text(43)="|"
|
||||
EULA_Text(44)=" - You may not electronically transmit KF from one computer to another or over a network except as described in this agreement. |"
|
||||
EULA_Text(45)="|"
|
||||
EULA_Text(46)="5. Export Controls|"
|
||||
EULA_Text(47)="|"
|
||||
EULA_Text(48)=" You may not ship or export KF to any country other than where you bought it, in violation of the U.S. Export Administration Act (or any other law governing such matters) and you will not utilize and will not authorize anyone to utilize KF in violation of any applicable law. KF may not be downloaded or otherwise exported into (or to a national or resident of) any country to which the U.S. has embargoed goods or to anyone or into any country who/which are prohibited by applicable law, from receiving it.|"
|
||||
EULA_Text(49)="|"
|
||||
EULA_Text(50)="6. Cheats and Cheating|"
|
||||
EULA_Text(51)="|"
|
||||
EULA_Text(52)=" KF was made for gamers by gamers. We hate cheaters and will not tolerate anyone cheating in KF or any KF Mods. It's as simple as that. If you are cheating in any way, including any attempt by you, either directly or indirectly, to circumvent or bypass any element of the KF or any KF servers to gain any advantage in multiplayer play of the KF or any KF Mods, you are in breach of this EULA. It is a breach of this EULA for you, whether directly or indirectly, to create, develop, copy, reproduce, distribute, or use any software program or any modification to KF or any KF Mods ('Cheats') that enable a player to gain an advantage or otherwise exploit another player when playing against other players on a local area network, any other network, or on the Internet."
|
||||
EULA_Text(53)=" Hacking into the executable of KF or any KF Mods or any other use of the KF or any KF Mods in connection with the creation, development, or use of any such unauthorized Cheats is prohibited under this EULA. Cheats include, but are not limited to, programs that allow players to see through walls or other level geometry (software or hardware 'wall hacks'); programs that let players change their rate of speed outside the allowable limits of KF ('speed hacks'); programs that crash any other players, PC clients, or network servers; 'aimbots' that automatically target other players or that automatically simulate any other player input to gain an advantage over other players; or any other program or modification that functions in a similar capacity or allows any prohibited conduct.|"
|
||||
EULA_Text(54)="|"
|
||||
EULA_Text(55)=" if we find you are a Cheater, we will revoke your CD key, ban you from the KF servers and tell your mom! Your license will automatically terminate, without notice, and you will have no right to play KF or any KF Mods against other players or make any other use of KF. End of story. |"
|
||||
EULA_Text(56)="|"
|
||||
EULA_Text(57)="7. Copyright. |"
|
||||
EULA_Text(58)="|"
|
||||
EULA_Text(59)=" KF and all copyrights, trademarks and all other conceivable intellectual property rights related to the KF are owned by Tripwire Interactive or its licensors, licensees or suppliers and are protected by United States copyrights laws, international treaty provisions, and all applicable laws, such as the Lanham Act. KF must be treated like any other copyrighted material, as required by 17 U.S.C. Sec.101 et seq. and other applicable law. Please do not make unauthorized copies. KF was created through the efforts of many people who earn their livelihood from its lawful use. Please don't make copies for others who have not paid for the right to use it. To report copyright violations to the Software Publishers Association, call 1 800 388 PIR8 or write: Software Publishers Association, 1101 Connecticut Ave., Suite 901, Washington, D.C. 20036.|"
|
||||
EULA_Text(60)="|"
|
||||
EULA_Text(61)="8. Massive Technology|"
|
||||
EULA_Text(62)=" This game incorporates technology of Massive Incorporated ("Massive"), a wholly-owned subsidiary of Microsoft Corporation (“Microsoft”), that enables ingame advertising, and the display of other similar in-game objects, which are downloaded temporarily to your personal computer or game console and replaced during online game play. As part of this process, Massive may collect some information about the game and the advertisements delivered to you, as well as standard information that is sent when your personal computer or game console connects to the Internet including your Internet protocol (IP) address. Massive will use this information to transmit and measure in-game advertising, as well as to improve the products and services of Massive and its affiliates. none of the information collected will be used to identify you.|"
|
||||
EULA_Text(63)="|"
|
||||
EULA_Text(64)=" For additional details regarding Massive’s in-game advertising practices, please see Massive's In-Game Advertising privacy statement at http://go.microsoft.com/fwlink/?LinkId=122085&clcid=0x409. The trademarks and copyrighted material contained in all in-game advertising are the property of the respective owners. Portions of this product are © 2009 Massive Incorporated. All rights reserved.|"
|
||||
EULA_Text(65)="9. Disclaimer of Warranty|"
|
||||
EULA_Text(66)="|"
|
||||
EULA_Text(67)=" You are aware and agree that use of KF and the media on which it is recorded, if any, is at your sole risk. KF is provided 'AS IS.' TRIPWIRE INTERACTIVE EXPRESSLY DISCLAIMS ALL OTHER WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. WE DO NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE SOFTWARE WILL MEET YOUR REQUIREMENTS. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY US OR ANY OF OUR AUTHORIZED REPRESENTATIVES SHALL CREATE A WARRANTY OR IN ANY WAY INCREASE THE SCOPE OF THIS WARRANTY. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSIONS MAY NOT APPLY TO YOU.|"
|
||||
EULA_Text(68)="|"
|
||||
EULA_Text(69)="10. Limitation of Liability|"
|
||||
EULA_Text(70)="|"
|
||||
EULA_Text(71)=" UNDER NO CIRCUMSTANCES, INCLUDING WILLFUL ACTS OR NEGLIGENCE, SHALL TRIPWIRE INTERACTIVE OR ANY OF ITS OFFICERS, EMPLOYEES, DIRECTORS, AGENTS, LICENSORS, LICENSEES, SUBLICENSEE, SUPPLIERS OR ASSIGNS BE LIABLE FOR ANY INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES THAT RESULT FROM THE USE OF OR INABILITY TO USE KF OR ITS RELATED DOCUMENTATION, EVEN IF SUCH PARTIES HAVE BEEN ADVISED OF THE POSSIBILITY OF THOSE DAMAGES. THERE WILL BE NO LIABILITY FOR ANY PERSONAL INJURY, EVEN SELF INFLICTED INJURY, OR FOR ANY INTENTIONAL TORT COMMITTED BY YOU OR ANY OTHER PERSON WHO PLAYS OR OBSERVES SOMEONE ELSE PLAYING KF. SOME JURISDICTIONS do NOT ALLOW THE LIMITATION OR EXCLUSION OF LIABILITY FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES SO THE ABOVE LIMITATION OR EXCLUSION MAY NOT APPLY TO YOU. In no event shall our total liability to you for all damages, losses, and causes of action (whether in contract, tort or otherwise) exceed the amount paid by you for KF.|"
|
||||
EULA_Text(72)="|"
|
||||
EULA_Text(73)="11. Controlling Law and Severability. |"
|
||||
EULA_Text(74)="|"
|
||||
EULA_Text(75)=" This license is governed by and construed in accordance with the laws of the State of Georgia, USA. Exclusive venue for all litigation shall be in Fulton County, Georgia. If any provision of this EULA is determined to be unenforceable by a court or other tribunal of competent jurisdiction, such provision will be enforced to the maximum extent permissible and the remaining portions of this EULA will remain in full force and effect.|"
|
||||
EULA_Text(76)="|"
|
||||
EULA_Text(77)="12. Complete Agreement. |"
|
||||
EULA_Text(78)="|"
|
||||
EULA_Text(79)=" This EULA constitutes the entire agreement between the parties with respect to the use of KF, KFEd, Mods and other related materials and software. Tripwire Interactive reserves the right to modify the terms of this EULA from time to time and will post notice of material changes somewhere within www.tripwireinteractive.com.|"
|
||||
EULA_Text(80)="|"
|
||||
EULA_Text(81)="13. Acceptance of Terms|"
|
||||
EULA_Text(82)="|"
|
||||
EULA_Text(83)=" By selecting the 'I Agree' choice during the installation and by installing KF, you agree to all the terms specified in this EULA. That's right, all of them. Now get on with the installation and enjoy KF... We hope you enjoy it as much as we enjoyed making it.|"
|
||||
EULA_Text(84)="|"
|
||||
EULA_Text(85)="GL & HF!"
|
||||
|
||||
bAgreedToEULA=false
|
||||
OnKeyEvent=InternalOnKeyEvent
|
||||
|
||||
Begin Object Class=GUIButton Name=ButtonAccept
|
||||
Caption="I ACCEPT"
|
||||
Hint="Click this button if you accept the terms of the End User License Agreement."
|
||||
WinWidth=0.200000
|
||||
WinHeight=0.036482
|
||||
WinLeft=0.2625
|
||||
WinTop=0.741666
|
||||
//RenderWeight=2.0001
|
||||
TabOrder=3
|
||||
bBoundToParent=false
|
||||
bScaleToParent=false
|
||||
OnClick=AcceptClicked
|
||||
End Object
|
||||
b_Accept=ButtonAccept
|
||||
|
||||
Begin Object Class=GUIButton Name=ButtonQuit
|
||||
Caption="I DO NOT ACCEPT"
|
||||
Hint="Click this button if you do not accept the terms of the End User License Agreement."
|
||||
WinWidth=0.200000
|
||||
WinHeight=0.036482
|
||||
WinLeft=0.537500
|
||||
WinTop=0.741666
|
||||
//RenderWeight=2.0001
|
||||
TabOrder=4
|
||||
bBoundToParent=false
|
||||
bScaleToParent=false
|
||||
OnClick=QuitClicked
|
||||
End Object
|
||||
b_Quit=ButtonQuit
|
||||
|
||||
Begin Object class=GUIScrollTextBox Name=EULABox
|
||||
WinWidth=0.540000
|
||||
WinHeight=0.480000
|
||||
WinLeft=0.230000
|
||||
WinTop=0.255000
|
||||
TabOrder=2
|
||||
bVisibleWhenEmpty=true
|
||||
bNoTeletype=true
|
||||
bScaleToParent=false
|
||||
bBoundToParent=false
|
||||
End Object
|
||||
lb_EULA=EULABox
|
||||
}
|
||||
|
||||
370
kf_sources/KFGui/Classes/KFFilterPanel.uc
Normal file
370
kf_sources/KFGui/Classes/KFFilterPanel.uc
Normal file
|
|
@ -0,0 +1,370 @@
|
|||
//-----------------------------------------------------------
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
class KFFilterPanel extends GUIPanel;
|
||||
|
||||
var automated AltSectionBackground sb_Options;
|
||||
var automated moEditBox eb_Name;
|
||||
var automated moCheckBox ck_Full, ck_Dedicated, ck_Empty, ck_Passworded, ck_VACOnly, ck_Perks;
|
||||
var automated moCheckBox ck_Hidden, ck_Hidden2;
|
||||
var automated moComboBox cb_Difficulty;
|
||||
|
||||
var automated GUIButton b_Ok, b_Cancel;
|
||||
|
||||
var int FilterIndex;
|
||||
var BrowserFilters FilterMaster;
|
||||
|
||||
//var UT2K4_FilterListPage FLP;
|
||||
|
||||
var bool bInitialized;
|
||||
|
||||
var localized string DifficultyOptions[6];
|
||||
|
||||
function InitComponent(GUIController MyC, GUIComponent MyO)
|
||||
{
|
||||
Super.InitComponent(MyC, MyO);
|
||||
|
||||
//FLP = UT2K4_FilterListPage(ParentPage);
|
||||
//FilterMaster = KFServerBrowser(Controller.TopPage()).FilterMaster;
|
||||
|
||||
sb_Options.ManageComponent(ck_Dedicated);
|
||||
sb_Options.ManageComponent(ck_Perks);
|
||||
sb_Options.ManageComponent(cb_Difficulty);
|
||||
sb_Options.ManageComponent(ck_Full);
|
||||
sb_Options.ManageComponent(ck_Empty);
|
||||
sb_Options.ManageComponent(ck_Passworded);
|
||||
sb_Options.ManageComponent(ck_VACOnly);
|
||||
sb_Options.ManageComponent(ck_Hidden);
|
||||
sb_Options.ManageComponent(ck_Hidden2);
|
||||
|
||||
cb_Difficulty.AddItem(DifficultyOptions[0]);
|
||||
cb_Difficulty.AddItem(DifficultyOptions[1]);
|
||||
cb_Difficulty.AddItem(DifficultyOptions[2]);
|
||||
cb_Difficulty.AddItem(DifficultyOptions[3]);
|
||||
cb_Difficulty.AddItem(DifficultyOptions[4]);
|
||||
cb_Difficulty.AddItem(DifficultyOptions[5]);
|
||||
|
||||
StartUp();
|
||||
}
|
||||
|
||||
function StartUp()
|
||||
{
|
||||
local int i;
|
||||
local array<CustomFilter.AFilterRule> Rules;
|
||||
local MasterServerClient.QueryData FilterItem;
|
||||
local string IdontCareString;
|
||||
|
||||
FilterIndex = 0;
|
||||
|
||||
/*eb_Name.SetComponentValue(Param2);
|
||||
|
||||
if (Param2~="Default")
|
||||
eb_Name.DisableMe();
|
||||
else
|
||||
eb_Name.EnableMe();
|
||||
*/
|
||||
//Get the custom filter
|
||||
|
||||
IdontCareString = "blah";
|
||||
KFServerBrowser(OwnerPage()).FilterMaster.InitCustomFilters();
|
||||
|
||||
if ( KFServerBrowser(OwnerPage()).FilterMaster.AllFilters.Length < 1 )
|
||||
{
|
||||
KFServerBrowser(OwnerPage()).FilterMaster.AddCustomFilter(IdontCareString);
|
||||
}
|
||||
|
||||
Rules = KFServerBrowser(OwnerPage()).FilterMaster.GetFilterRules(FilterIndex);
|
||||
|
||||
for ( i = 0; i < Rules.Length; i++)
|
||||
{
|
||||
FilterItem = Rules[i].FilterItem;
|
||||
|
||||
log(FilterItem.Key$"="$FilterItem.Value);
|
||||
|
||||
if ( FilterItem.Key~="currentplayers" && FilterItem.Value=="0" && FilterItem.QueryType==QT_GreaterThan )
|
||||
ck_Empty.Checked(true);
|
||||
|
||||
if ( FilterItem.Key~="password" && FilterItem.Value=="false" && FilterItem.QueryType==QT_Equals )
|
||||
ck_Passworded.Checked(true);
|
||||
|
||||
if ( FilterItem.Key~="freespace" && FilterItem.Value =="0" && FilterItem.QueryType==QT_GreaterThan )
|
||||
ck_Full.Checked(true);
|
||||
|
||||
if ( FilterItem.Key~="dedicated" && FilterItem.Value=="true" && FilterItem.QueryType==QT_Equals)
|
||||
ck_Dedicated.Checked(true);
|
||||
|
||||
if ( FilterItem.Key~="vacsecure" && FilterItem.Value=="true" && FilterItem.QueryType==QT_Equals)
|
||||
ck_VACOnly.Checked(true);
|
||||
|
||||
if ( FilterItem.Key~="perks" && FilterItem.Value=="true" && FilterItem.QueryType==QT_Equals)
|
||||
ck_Perks.Checked(true);
|
||||
|
||||
if ( FilterItem.Key~="difficulty" )
|
||||
cb_Difficulty.MyComboBox.SetIndex(int(FilterItem.Value));
|
||||
}
|
||||
|
||||
AdjustDifficultyForPerk();
|
||||
}
|
||||
|
||||
function AdjustDifficultyForPerk()
|
||||
{
|
||||
local int HPL;
|
||||
|
||||
HPL = class'KFServerBrowser'.static.CalcPlayerHighestPerkLevel( PlayerOwner() );
|
||||
if( HPL == 0 )
|
||||
{
|
||||
cb_Difficulty.MyComboBox.SetIndex(1); // beginner
|
||||
InternalOnChange( cb_Difficulty );
|
||||
}
|
||||
else if( HPL == 1 )
|
||||
{
|
||||
cb_Difficulty.MyComboBox.SetIndex(2); // normal
|
||||
InternalOnChange( cb_Difficulty );
|
||||
}
|
||||
}
|
||||
|
||||
function bool CancelClick(GUIComponent Sender)
|
||||
{
|
||||
//Controller.CloseMenu(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
function CustomFilter.AFilterRule BuildRule(string Key, string Value, MasterServerClient.EQueryType qType)
|
||||
{
|
||||
local CustomFilter.AFilterRule NewRule;
|
||||
|
||||
NewRule.FilterItem.Key = key;
|
||||
NewRule.FilterItem.Value = value;
|
||||
NewRule.FilterItem.QueryType = qtype;
|
||||
NewRule.FilterType = DT_Unique;
|
||||
NewRule.ItemName = Key;
|
||||
|
||||
return NewRule;
|
||||
}
|
||||
|
||||
function InternalOnChange(GUIComponent Sender)
|
||||
{
|
||||
local array<CustomFilter.AFilterRule> Rules;
|
||||
local int cnt;
|
||||
|
||||
cnt = 0;
|
||||
|
||||
// Build Query lists
|
||||
|
||||
if ( ck_Empty.IsChecked() )
|
||||
Rules[Cnt++] = BuildRule("currentplayers","0",QT_GreaterThan);
|
||||
|
||||
if ( ck_Full.IsChecked() )
|
||||
Rules[Cnt++] = BuildRule("freespace","0",QT_GreaterThan);
|
||||
|
||||
if ( ck_Passworded.IsChecked() )
|
||||
Rules[Cnt++] = BuildRule("password","false",QT_Equals);
|
||||
|
||||
if ( ck_Dedicated.IsChecked() )
|
||||
Rules[Cnt++] = BuildRule("dedicated","true", QT_Equals);
|
||||
|
||||
if ( ck_VACOnly.IsChecked() )
|
||||
Rules[Cnt++] = BuildRule("vacsecure","true", QT_Equals);
|
||||
|
||||
if ( ck_Perks.IsChecked() )
|
||||
Rules[Cnt++] = BuildRule("perks","true", QT_Equals);
|
||||
|
||||
Rules[Cnt++] = BuildRule("difficulty", string(cb_Difficulty.GetIndex()), QT_Equals);
|
||||
|
||||
KFServerBrowser(OwnerPage()).FilterMaster.PostEdit(FilterIndex,"blah",Rules);
|
||||
KFServerBrowser(OwnerPage()).FilterMaster.ActivateFilter(FilterIndex, true);
|
||||
KFServerBrowser(OwnerPage()).FilterMaster.RenameFilter(FilterIndex, "blah");
|
||||
KFServerBrowser(OwnerPage()).FilterMaster.SaveFilters();
|
||||
KFServerBrowser(OwnerPage()).RefreshClicked();
|
||||
}
|
||||
|
||||
function bool ebPreDraw(canvas Canvas)
|
||||
{
|
||||
// Reposition
|
||||
// eb_Name.WinTop = sb_Options.ActualTop() + 36;
|
||||
return true;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
PropagateVisibility=False
|
||||
|
||||
Begin Object class=moEditBox name=ebName
|
||||
WinWidth=0.654297
|
||||
WinHeight=0.030000
|
||||
WinLeft=0.184531
|
||||
WinTop=0.124114
|
||||
bStandardized=true
|
||||
Caption="Filter Name:"
|
||||
ComponentWidth=0.7
|
||||
TabOrder=0
|
||||
OnPreDraw=ebPreDraw
|
||||
End Object
|
||||
eb_Name=none
|
||||
|
||||
Begin Object Class=AltSectionBackground Name=sbOptions
|
||||
ImageOffset(1)=0.0
|
||||
ImageOffset(3)=0.0
|
||||
WinWidth=1.0
|
||||
WinHeight=1.0
|
||||
WinLeft=0.0
|
||||
WinTop=0.0
|
||||
// Caption="Filters"
|
||||
LeftPadding=0.00
|
||||
RightPadding=0.00
|
||||
TopPadding=0.07
|
||||
bFillClient=true
|
||||
BottomPadding=0.07
|
||||
NumColumns=3
|
||||
End Object
|
||||
sb_Options=sbOptions
|
||||
|
||||
Begin Object class=moCheckBox name=ckFull
|
||||
WinWidth=0.45
|
||||
WinLeft=0.0
|
||||
WinTop=0.1
|
||||
bStandardized=true
|
||||
CaptionWidth=0.4
|
||||
Caption="No Full Servers"
|
||||
ComponentWidth=0.1
|
||||
TabOrder=1
|
||||
OnChange=InternalOnChange
|
||||
bSquare=true
|
||||
StandardHeight=0.025
|
||||
End Object
|
||||
ck_Full=ckFull
|
||||
|
||||
Begin Object class=moCheckBox name=ckDedicated
|
||||
WinWidth=0.45
|
||||
WinLeft=0.0
|
||||
WinTop=0.2
|
||||
bStandardized=true
|
||||
Caption="Dedicated Only"
|
||||
ComponentWidth=0.1
|
||||
TabOrder=2
|
||||
OnChange=InternalOnChange
|
||||
StandardHeight=0.025
|
||||
End Object
|
||||
ck_Dedicated=ckDedicated
|
||||
|
||||
Begin Object class=moComboBox name=cbDifficulty
|
||||
// WinWidth=0.45
|
||||
// WinLeft=0.55
|
||||
// WinTop=0.1
|
||||
bStandardized=true
|
||||
Caption="Difficulty:"
|
||||
ComponentWidth=0.55
|
||||
TabOrder=3
|
||||
bReadOnly=true
|
||||
OnChange=InternalOnChange
|
||||
StandardHeight=0.025
|
||||
End Object
|
||||
cb_Difficulty=cbDifficulty
|
||||
|
||||
|
||||
Begin Object class=moCheckBox name=ckEmpty
|
||||
WinWidth=0.45
|
||||
WinLeft=0.0
|
||||
WinTop=0.2
|
||||
bStandardized=true
|
||||
Caption="No Empty Servers"
|
||||
ComponentWidth=0.1
|
||||
TabOrder=4
|
||||
OnChange=InternalOnChange
|
||||
StandardHeight=0.025
|
||||
End Object
|
||||
ck_Empty=ckEmpty
|
||||
|
||||
Begin Object class=moCheckBox name=ckPassworded
|
||||
WinWidth=0.45
|
||||
WinLeft=0.0
|
||||
WinTop=0.3
|
||||
bStandardized=true
|
||||
Caption="No Passworded Servers"
|
||||
ComponentWidth=0.1
|
||||
TabOrder=5
|
||||
OnChange=InternalOnChange
|
||||
StandardHeight=0.025
|
||||
End Object
|
||||
ck_Passworded=ckPassworded
|
||||
|
||||
Begin Object class=moCheckBox name=ckVACOnly
|
||||
WinWidth=0.45
|
||||
WinLeft=0.0
|
||||
WinTop=0.4
|
||||
bStandardized=true
|
||||
Caption="Valve Anti-Cheat Protected Only"
|
||||
ComponentWidth=0.1
|
||||
TabOrder=6
|
||||
OnChange=InternalOnChange
|
||||
StandardHeight=0.025
|
||||
End Object
|
||||
ck_VACOnly=ckVACOnly
|
||||
|
||||
Begin Object class=moCheckBox name=ckPerks
|
||||
WinWidth=0.45
|
||||
WinLeft=0.0
|
||||
WinTop=0.5
|
||||
bStandardized=true
|
||||
Caption="Perks Enabled"
|
||||
ComponentWidth=0.1
|
||||
TabOrder=7
|
||||
OnChange=InternalOnChange
|
||||
StandardHeight=0.025
|
||||
End Object
|
||||
ck_Perks=ckPerks
|
||||
|
||||
Begin Object class=moCheckBox name=ckHidden
|
||||
bStandardized=true
|
||||
Caption="Hidden"
|
||||
ComponentWidth=0.1
|
||||
TabOrder=8
|
||||
bVisible=false
|
||||
End Object
|
||||
ck_Hidden=ckHidden
|
||||
|
||||
Begin Object class=moCheckBox name=ckHidden2
|
||||
WinWidth=0.45
|
||||
WinLeft=0.55
|
||||
WinTop=0.0
|
||||
bStandardized=true
|
||||
Caption="Hidden"
|
||||
ComponentWidth=0.1
|
||||
TabOrder=9
|
||||
bVisible=false
|
||||
End Object
|
||||
ck_Hidden2=ckHidden2
|
||||
|
||||
Begin Object Class=GUIButton name=bOK
|
||||
WinWidth=0.168750
|
||||
WinHeight=0.050000
|
||||
WinLeft=0.55
|
||||
WinTop=0.3
|
||||
Caption="OK"
|
||||
//OnClick=OKClick
|
||||
End Object
|
||||
b_OK=none
|
||||
|
||||
Begin Object Class=GUIButton name=bCancel
|
||||
WinWidth=0.168750
|
||||
WinHeight=0.050000
|
||||
WinLeft=0.742814
|
||||
WinTop=0.3
|
||||
Caption="Cancel"
|
||||
//OnClick=CancelClick
|
||||
End Object
|
||||
b_Cancel=none
|
||||
|
||||
// WinWidth=0.90
|
||||
// WinHeight=0.57
|
||||
// WinLeft=0.01
|
||||
// WinTop=0.01
|
||||
// WindowName="Edit Filter Rules..."
|
||||
|
||||
DifficultyOptions(0)="Any Difficulty"
|
||||
DifficultyOptions(1)="Beginner"
|
||||
DifficultyOptions(2)="Normal"
|
||||
DifficultyOptions(3)="Hard"
|
||||
DifficultyOptions(4)="Suicidal"
|
||||
DifficultyOptions(5)="Hell on Earth"
|
||||
}
|
||||
105
kf_sources/KFGui/Classes/KFFirewallWarn.uc
Normal file
105
kf_sources/KFGui/Classes/KFFirewallWarn.uc
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
//-----------------------------------------------------------
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
class KFFirewallWarn extends UT2K4GenericMessageBox;
|
||||
|
||||
var automated moCheckbox ch_NeverShowAgain;
|
||||
var localized string WarnString;
|
||||
|
||||
function HandleParameters( string Param1, string Param2 )
|
||||
{
|
||||
local float f;
|
||||
|
||||
l_Text2.Caption = WarnString;
|
||||
|
||||
f = float(Param1);
|
||||
if ( f != 0.0 )
|
||||
SetTimer(f);
|
||||
}
|
||||
|
||||
function Timer()
|
||||
{
|
||||
Controller.CloseMenu(false);
|
||||
}
|
||||
|
||||
function bool InternalOnClick(GUIComponent Sender)
|
||||
{
|
||||
Controller.CloseMenu(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
function CheckBoxClick(GUIComponent Sender)
|
||||
{
|
||||
class'KFGamePageMP'.default.bExpert = ch_NeverShowAgain.IsChecked();
|
||||
class'KFGamePageMP'.static.StaticSaveConfig();
|
||||
}
|
||||
|
||||
function InternalOnLoadIni( GUIComponent Sender, string Value )
|
||||
{
|
||||
ch_NeverShowAgain.Checked(class'KFGamePageMP'.default.bExpert);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
WarnString="Please make sure Universal Plug and Play is enabled, or the ports 7707 UDP, 7708 UDP, 7717 UDP, 28852 TCP & UDP, 8075 TCP and 20560 TCP & UDP are opened on your router/firewall."
|
||||
|
||||
Begin Object Class=GUIButton Name=OkButton
|
||||
Caption="OK"
|
||||
WinWidth=0.121875
|
||||
WinHeight=0.040000
|
||||
WinLeft=0.439063
|
||||
WinTop=0.620000
|
||||
OnClick=InternalOnClick
|
||||
TabOrder=0
|
||||
// if _RO_
|
||||
// StyleName="SelectButton"
|
||||
// end if _RO_
|
||||
End Object
|
||||
b_Ok=OKButton
|
||||
|
||||
Begin Object class=GUILabel Name=DialogText
|
||||
Caption="WARNING"
|
||||
TextALign=TXTA_Center
|
||||
StyleName="TextLabel"
|
||||
FontScale=FNS_Large
|
||||
WinWidth=1
|
||||
WinLeft=0
|
||||
WinTop=0.34
|
||||
WinHeight=0.04
|
||||
End Object
|
||||
l_Text=DialogText
|
||||
|
||||
Begin Object class=GUILabel Name=DialogText2
|
||||
Caption=""
|
||||
TextAlign=TXTA_Center
|
||||
StyleName="TextLabel"
|
||||
WinWidth=0.65
|
||||
WinLeft=0.2
|
||||
WinTop=0.40
|
||||
WinHeight=0.3
|
||||
bMultiLine=true
|
||||
End Object
|
||||
l_Text2=DialogText2
|
||||
|
||||
Begin Object Class=moCheckBox Name=HideCheckbox
|
||||
WinWidth=0.25
|
||||
WinHeight=0.030000
|
||||
WinLeft=0.375
|
||||
WinTop=0.50
|
||||
Caption=" do not display this warning again"
|
||||
Hint="Check this to disable showing warning messages"
|
||||
IniOption="@Internal"
|
||||
OnLoadIni=InternalOnLoadIni
|
||||
OnChange=CheckBoxClick
|
||||
TabOrder=1
|
||||
CaptionWidth=0.99
|
||||
ComponentWidth=0.07
|
||||
bFlipped=True
|
||||
ComponentJustification=TXTA_Right
|
||||
LabelJustification=TXTA_Left
|
||||
FontScale=FNS_Small
|
||||
End Object
|
||||
ch_NeverShowAgain=HideCheckbox
|
||||
|
||||
OpenSound=sound'KF_MenuSnd.msfxEdit'
|
||||
}
|
||||
97
kf_sources/KFGui/Classes/KFGUIComboBox.uc
Normal file
97
kf_sources/KFGui/Classes/KFGUIComboBox.uc
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
class KFGUIComboBox extends GUIComboBox;
|
||||
|
||||
var String SoldierNameToAdd;
|
||||
var() array<xUtil.PlayerRecord> PlayerList;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
local int i;
|
||||
|
||||
Super.Initcomponent(MyController, MyOwner);
|
||||
|
||||
List = MyListBox.List;
|
||||
List.OnChange = ItemChanged;
|
||||
List.bHotTrack = true;
|
||||
List.bHotTrackSound = false;
|
||||
List.OnClickSound = CS_Click;
|
||||
List.OnClick = InternalListClick;
|
||||
List.OnInvalidate = InternalOnInvalidate;
|
||||
List.TextAlign = TXTA_Left;
|
||||
MyListBox.Hide();
|
||||
|
||||
Edit.OnChange = TextChanged;
|
||||
Edit.OnMousePressed = InternalEditPressed;
|
||||
Edit.INIOption = INIOption;
|
||||
Edit.INIDefault = INIDefault;
|
||||
Edit.bReadOnly = bReadOnly;
|
||||
|
||||
List.OnDeActivate = InternalListDeActivate;
|
||||
|
||||
MyShowListBtn.OnClick = ShowListBox;
|
||||
MyShowListBtn.FocusInstead = List;
|
||||
SetHint(Hint);
|
||||
|
||||
// Add KF bot choices
|
||||
/*
|
||||
List.Add("Soldier");
|
||||
List.Add("Soldier_Kara");
|
||||
List.Add("Soldier_Powers");
|
||||
List.Add("Soldier_Davin");
|
||||
List.Add("Soldier_Quick");
|
||||
*/
|
||||
|
||||
class'xUtil'.static.GetPlayerList(PlayerList);
|
||||
|
||||
for(i=0; i<PlayerList.Length; i++)
|
||||
{
|
||||
if (Playerlist[i].DefaultName == "Soldier_Black" ||
|
||||
Playerlist[i].DefaultName == "Soldier_Urban" ||
|
||||
Playerlist[i].DefaultName == "Soldier" ||
|
||||
Playerlist[i].DefaultName == "Soldier_Lewis" ||
|
||||
Playerlist[i].DefaultName == "Soldier_Davin" ||
|
||||
Playerlist[i].DefaultName == "Hazmat" ||
|
||||
Playerlist[i].DefaultName == "Soldier_Kara" ||
|
||||
Playerlist[i].DefaultName == "Soldier_Powers" ||
|
||||
Playerlist[i].DefaultName == "Stalker" ||
|
||||
Playerlist[i].DefaultName == "Soldier_Masterson")
|
||||
{
|
||||
List.Add(PlayerList[i].DefaultName);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// SoldierNameToAdd = List.Elements[0].Item;
|
||||
// SetSoldierToAdd();
|
||||
|
||||
}
|
||||
|
||||
function SetText(string NewText, optional bool bListItemsOnly)
|
||||
{
|
||||
local int i;
|
||||
|
||||
i = List.FindIndex(NewText);
|
||||
if ( (bReadOnly || bListItemsOnly) && i < 0 )
|
||||
return;
|
||||
|
||||
Edit.SetText(NewText);
|
||||
TextStr = Edit.TextStr;
|
||||
|
||||
if(TextStr != "")
|
||||
SoldierNameToAdd = TextStr;
|
||||
|
||||
SetSoldierToAdd();
|
||||
|
||||
}
|
||||
|
||||
function SetSoldierToAdd()
|
||||
{
|
||||
if(KFGameReplicationInfo(PlayerOwner().GameReplicationInfo) != none)
|
||||
KFPlayerController(PlayerOwner()).ServerSetTempBotName(SoldierNameToAdd);
|
||||
Log("adding temp bot name... :"$SoldierNameToAdd);
|
||||
Log("Was the Temp set on the server successfully? "$KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).TempBotName == SoldierNameToAdd);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
}
|
||||
144
kf_sources/KFGui/Classes/KFGUIController.uc
Normal file
144
kf_sources/KFGui/Classes/KFGUIController.uc
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
class KFGUIController extends UT2K4GUIController;
|
||||
|
||||
#exec OBJ LOAD FILE=KFInterfaceContent.utx
|
||||
#exec OBJ LOAD FILE=2K4MenuSounds.uax
|
||||
#exec OBJ LOAD FILE=2K4Menus.utx
|
||||
|
||||
|
||||
simulated event ResolutionChanged()
|
||||
{
|
||||
if( ViewportOwner.Actor != none && KFPlayerController(ViewportOwner.Actor) != none )
|
||||
{
|
||||
KFPlayerController(ViewportOwner.Actor).InitFOV();
|
||||
}
|
||||
}
|
||||
|
||||
event InitializeController()
|
||||
{
|
||||
Super.InitializeController();
|
||||
|
||||
// Enter the mp_lobby zone to get a new movie
|
||||
class'PlayerController'.static.Advertising_EnterZone("mp_lobby");
|
||||
}
|
||||
|
||||
function PurgeComponentClasses()
|
||||
{
|
||||
if ( RegisteredClasses.Length > 0 )
|
||||
RegisteredClasses.Remove(0, RegisteredClasses.Length);
|
||||
|
||||
Super.PurgeComponentClasses();
|
||||
}
|
||||
|
||||
function ReturnToMainMenu()
|
||||
{
|
||||
// Closing all the menus also force an Advertising_ExitZone
|
||||
CloseAll(true);
|
||||
|
||||
// Re-enter the mp_lobby zone to get a new movie
|
||||
if( ViewportOwner.Actor != none )
|
||||
{
|
||||
ViewportOwner.Actor.Advertising_EnterZone("mp_lobby");
|
||||
}
|
||||
|
||||
if ( MenuStack.Length == 0 )
|
||||
OpenMenu(GetMainMenuClass());
|
||||
}
|
||||
|
||||
static simulated function string GetServerBrowserPage()
|
||||
{
|
||||
return "KFGUI.KFServerBrowser";
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
//STYLE_NUM=67
|
||||
STYLE_NUM=63
|
||||
|
||||
MapVotingMenu="KFGUI.KFMapVotingPage"
|
||||
FilterMenu="KFGUI.KFUT2K4_FilterListPage"
|
||||
|
||||
// RO Styles
|
||||
DefaultStyleNames(1)="ROInterface.ROSTY_RoundScaledButton"
|
||||
DefaultStyleNames(4)="ROInterface.ROSTY2ScrollZone"
|
||||
DefaultStyleNames(8)="ROInterface.ROSTY_Footer"
|
||||
DefaultStyleNames(15)="ROInterface.ROSTY_ServerBrowserGridHeader"
|
||||
|
||||
DefaultStyleNames(21)="ROInterface.ROSTY_SquareBar"
|
||||
DefaultStyleNames(22)="ROInterface.ROSTY_MidGameButton"
|
||||
DefaultStyleNames(24)="ROInterface.ROSTY2ComboListBox"
|
||||
|
||||
DefaultStyleNames(26)="ROInterface.ROSTY2IRCText"
|
||||
DefaultStyleNames(27)="ROInterface.ROSTY2IRCEntry"
|
||||
|
||||
DefaultStyleNames(35)="ROInterface.ROSTY2CheckBox"
|
||||
//DefaultStyleNames(36)="ROInterface.STY2CheckBoxCheck"
|
||||
DefaultStyleNames(37)="ROInterface.ROSTY2SliderKnob"
|
||||
|
||||
DefaultStyleNames(40)="ROInterface.ROSTY2ItemOutline"
|
||||
|
||||
DefaultStyleNames(42)="ROInterface.ROSTY2MouseOverLabel"
|
||||
DefaultStyleNames(43)="ROInterface.ROSTY2SliderBar"
|
||||
|
||||
DefaultStyleNames(45)="ROInterface.ROSTY2TextButtonEffect"
|
||||
|
||||
DefaultStyleNames(50)="ROInterface.ROSTY2ComboButton"
|
||||
DefaultStyleNames(51)="ROInterface.ROSTY2VertUpButton"
|
||||
DefaultStyleNames(52)="ROInterface.ROSTY2VertDownButton"
|
||||
DefaultStyleNames(53)="ROInterface.ROSTY2_VertGrip"
|
||||
DefaultStyleNames(54)="ROInterface.ROSTY2Spinner"
|
||||
DefaultStyleNames(55)="ROInterface.ROSTY2SectionHeaderTop"
|
||||
DefaultStyleNames(56)="ROInterface.ROSTY2SectionHeaderBar"
|
||||
DefaultStyleNames(57)="ROInterface.ROSTY2CloseButton"
|
||||
|
||||
|
||||
|
||||
DefaultStyleNames(0)="KFGUI.KF_RoundButton"
|
||||
DefaultStyleNames(2)="KFGUI.KF_SquareButton"
|
||||
DefaultStyleNames(3)="KFGUI.KF_ListBox"
|
||||
DefaultStyleNames(5)="KFGUI.KF_TextButton"
|
||||
DefaultStyleNames(7)="KFGUI.KF_Header"
|
||||
DefaultStyleNames(9)="KFGUI.KF_TabButton"
|
||||
DefaultStyleNames(13)="KFGUI.KF_ServerBrowserGrid"
|
||||
DefaultStyleNames(14)="GUI2K4.STY2NoBackground"//"KFGUI.KF_NoBackground"
|
||||
DefaultStyleNames(23)="KFGUI.KF_TextLabel"
|
||||
DefaultStyleNames(29)="KFGUI.KF_ContextMenu"
|
||||
DefaultStyleNames(30)="KFGUI.KF_ServerListContextMenu"
|
||||
DefaultStyleNames(31)="KFGUI.KF_ListSelection"
|
||||
DefaultStyleNames(32)="ROInterface.ROSTY2TabBackground"
|
||||
DefaultStyleNames(33)="KFGUI.KF_BrowserListSel"
|
||||
DefaultStyleNames(34)="KFGUI.KF_EditBox"
|
||||
DefaultStyleNames(39)="KFGUI.KF_ListSectionHeader"
|
||||
DefaultStyleNames(41)="KFGUI.KF_ListHighlight"
|
||||
DefaultStyleNames(48)="KFGUI.KF_FooterButton"
|
||||
DefaultStyleNames(59)="GUI2K4.STY2AltComboButton"
|
||||
DefaultStyleNames(60)="KFGUI.KF_ItemBoxInfo"
|
||||
// Veterancy Styles
|
||||
|
||||
// Menu Tooltip style
|
||||
DefaultStyleNames(61)="KFGUI.GUIVetToolTipMOStyle"
|
||||
DefaultStyleNames(62)="KFGUI.KFSTY2NoBackground"
|
||||
|
||||
MainMenuOptions(2)="KFGUI.KFGamePageMP"
|
||||
MainMenuOptions(3)="KFGUI.KFGamePageSP"
|
||||
MainMenuOptions(5)="KFGUI.KFSettingsPage"
|
||||
MainMenuOptions(6)="KFGUI.KFQuitPage"
|
||||
|
||||
NetworkMsgMenu="KFGUI.KFNetworkStatusMsg"
|
||||
|
||||
MouseCursors(0)=material'InterfaceArt_tex.Cursors.Pointer' // Arrow
|
||||
MouseCursors(1)=material'InterfaceArt_tex.Cursors.ResizeAll' // SizeAll
|
||||
MouseCursors(2)=material'InterfaceArt_tex.Cursors.ResizeSWNE' // Size NE SW
|
||||
MouseCursors(3)=material'InterfaceArt_tex.Cursors.Resize' // Size NS
|
||||
MouseCursors(4)=material'InterfaceArt_tex.Cursors.ResizeNWSE' // Size NW SE
|
||||
MouseCursors(5)=material'InterfaceArt_tex.Cursors.ResizeHorz' // Size WE
|
||||
MouseCursors(6)=material'InterfaceArt_tex.Cursors.Pointer' // Wait
|
||||
|
||||
ImageList(0)=Texture'InterfaceArt_tex.Menu.checkBoxBall_b'
|
||||
ImageList(1)=Texture'InterfaceArt_tex.Menu.AltComboTickBlurry'
|
||||
ImageList(2)=Texture'KF_InterfaceArt_tex.Menu.LeftMark'
|
||||
ImageList(3)=Texture'KF_InterfaceArt_tex.Menu.RightMark'
|
||||
ImageList(4)=Texture'KF_InterfaceArt_tex.Menu.RightMark'
|
||||
ImageList(5)=Texture'KF_InterfaceArt_tex.Menu.RightMark'
|
||||
ImageList(6)=Texture'KF_InterfaceArt_tex.Menu.UpMark'
|
||||
ImageList(7)=Texture'KF_InterfaceArt_tex.Menu.DownMark'
|
||||
}
|
||||
1
kf_sources/KFGui/Classes/KFGUISectionBackground.uc
Normal file
1
kf_sources/KFGui/Classes/KFGUISectionBackground.uc
Normal file
|
|
@ -0,0 +1 @@
|
|||
class KFGUISectionBackground extends GUISectionBackground ;
|
||||
11
kf_sources/KFGui/Classes/KFGUIStyle.uc
Normal file
11
kf_sources/KFGui/Classes/KFGUIStyle.uc
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
class KFGUIStyle extends GUIStyles ;
|
||||
/*
|
||||
|
||||
var(Style) noexport string FontNames[16]; // Holds the names of the 5 fonts to use
|
||||
var(Style) noexport GUIFont Fonts[16];
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
FontNames(15)="KFDecrepitFont"
|
||||
}
|
||||
*/
|
||||
40
kf_sources/KFGui/Classes/KFGUIVertImageList.uc
Normal file
40
kf_sources/KFGui/Classes/KFGUIVertImageList.uc
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
class KFGUIVertImageList extends GUIVertImageList;
|
||||
|
||||
function int SetIndex(int NewIndex)
|
||||
{
|
||||
if ( Elements[NewIndex].Locked == 1 )
|
||||
{
|
||||
log(MenuOwner.MenuOwner);
|
||||
|
||||
if ( KFModelSelect(MenuOwner.MenuOwner) != none )
|
||||
{
|
||||
KFModelSelect(MenuOwner.MenuOwner).HandleLockedCharacterClicked(NewIndex);
|
||||
}
|
||||
|
||||
return Index;
|
||||
}
|
||||
|
||||
return super.SetIndex(NewIndex);
|
||||
}
|
||||
|
||||
function Add(Material Image, optional int Item, optional int Locked)
|
||||
{
|
||||
local int i;
|
||||
|
||||
if ( Image == None && !bAllowEmptyItems )
|
||||
return;
|
||||
|
||||
i = Elements.Length;
|
||||
Elements.Length = i + 1;
|
||||
Elements[i].Image = Image;
|
||||
Elements[i].Item = Item;
|
||||
Elements[i].Locked = Locked;
|
||||
ItemCount = Elements.Length;
|
||||
|
||||
if ( ItemCount != 1 || !bInitializeList )
|
||||
CheckLinkedObjects(Self);
|
||||
|
||||
if (MyScrollBar != None)
|
||||
MyScrollBar.AlignThumb();
|
||||
}
|
||||
|
||||
6
kf_sources/KFGui/Classes/KFGUIVertImageListBox.uc
Normal file
6
kf_sources/KFGui/Classes/KFGUIVertImageListBox.uc
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
class KFGUIVertImageListBox extends GUIVertImageListBox;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
DefaultListClass="KFGUI.KFGUIVertImageList"
|
||||
}
|
||||
52
kf_sources/KFGui/Classes/KFGameFooter.uc
Normal file
52
kf_sources/KFGui/Classes/KFGameFooter.uc
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
//==============================================================================
|
||||
//==============================================================================
|
||||
class KFGameFooter extends UT2K4GameFooter;
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
bFullHeight=False
|
||||
WinHeight=0.05
|
||||
ButtonHeight=0.035
|
||||
Justification=TXTA_Right
|
||||
WinWidth=1.000000
|
||||
|
||||
Begin Object Class=GUIButton Name=GamePrimaryButton
|
||||
//WinWidth=0.15
|
||||
WinHeight=0.033203
|
||||
WinTop=0.906146
|
||||
//WinLeft=0.88
|
||||
TabOrder=0
|
||||
bBoundToParent=True
|
||||
MenuState=MSAT_Disabled
|
||||
bAutoSize=true
|
||||
AutoSizePadding=(HorzPerc=0.4)
|
||||
End Object
|
||||
b_Primary=GamePrimaryButton
|
||||
|
||||
Begin Object Class=GUIButton Name=GameSecondaryButton
|
||||
//WinWidth=0.150000
|
||||
WinHeight=0.033203
|
||||
WinTop=0.906146
|
||||
//WinLeft=0.758125
|
||||
TabOrder=1
|
||||
bBoundToParent=True
|
||||
MenuState=MSAT_Disabled
|
||||
bAutoSize=true
|
||||
AutoSizePadding=(HorzPerc=0.4)
|
||||
End Object
|
||||
b_Secondary=GameSecondaryButton
|
||||
|
||||
Begin Object Class=GUIButton Name=GameBackButton
|
||||
Caption="BACK"
|
||||
Hint="Return to Previous Menu"
|
||||
//WinWidth=0.15
|
||||
WinHeight=0.033203
|
||||
WinTop=0.906146
|
||||
//WinLeft=0
|
||||
TabOrder=2
|
||||
bBoundToParent=True
|
||||
bAutoSize=true
|
||||
AutoSizePadding=(HorzPerc=0.4)
|
||||
End Object
|
||||
b_Back=GameBackButton
|
||||
}
|
||||
233
kf_sources/KFGui/Classes/KFGamePageMP.uc
Normal file
233
kf_sources/KFGui/Classes/KFGamePageMP.uc
Normal file
|
|
@ -0,0 +1,233 @@
|
|||
class KFGamePageMP extends UT2K4GamePageMP;
|
||||
|
||||
var config bool bExpert;
|
||||
var string FirewallWarning;
|
||||
|
||||
// Helper for Hack fix for selecting GameType tab
|
||||
var bool bFirstChangeCompleted;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
super(UT2K4MainPage).Initcomponent(MyController, MyOwner);
|
||||
|
||||
RuleInfo = new(None) class'Engine.PlayInfo';
|
||||
|
||||
p_Game = UT2K4Tab_GameTypeBase(c_Tabs.AddTab(PanelCaption[0],PanelClass[0],,PanelHint[0], true));
|
||||
p_Game.OnChangeGameType = ChangeGameType;
|
||||
|
||||
p_Main = UT2K4Tab_MainBase(c_Tabs.AddTab(PanelCaption[1],PanelClass[1],,PanelHint[1], true));
|
||||
p_Game.tp_Main = p_Main;
|
||||
|
||||
mcRules = KFIAMultiColumnRulesPanel(c_Tabs.AddTab(PanelCaption[2], "KFGUI.KFIAMultiColumnRulesPanel",, PanelHint[2], false));
|
||||
p_Mutators = UT2K4Tab_MutatorBase(c_Tabs.AddTab(PanelCaption[3],PanelClass[3],,PanelHint[3], false));
|
||||
mcServerRules = KFUT2K4Tab_ServerRulesPanel(c_Tabs.AddTab(PanelCaption[4], PanelClass[4],, PanelHint[4]));
|
||||
|
||||
b_Back = UT2K4GameFooter(t_Footer).b_Back;
|
||||
b_Secondary = UT2K4GameFooter(t_Footer).b_Secondary;
|
||||
b_Primary = UT2K4GameFooter(t_Footer).b_Primary;
|
||||
|
||||
EnableComponent(b_Secondary);
|
||||
EnableComponent(b_Primary);
|
||||
|
||||
// Disable the Sandbox Tab if we're not in Sandbox mode
|
||||
if ( class'KFGameType'.default.KFGameLength != 3 )
|
||||
{
|
||||
c_Tabs.TabStack[2].DisableMe();
|
||||
}
|
||||
}
|
||||
|
||||
function InternalOnOpen()
|
||||
{
|
||||
if ( Controller != None && !default.bExpert )
|
||||
{
|
||||
Controller.OpenMenu(FirewallWarning);
|
||||
}
|
||||
|
||||
ChangeGameType(False);
|
||||
}
|
||||
|
||||
function InternalOnChange(GUIComponent Sender)
|
||||
{
|
||||
// HACK: Switch back to the GameType tab if we have more than 1 GameType available
|
||||
if ( !bFirstChangeCompleted )
|
||||
{
|
||||
if ( p_Game.li_Games.Elements.Length > 0 )
|
||||
{
|
||||
if ( p_Game.li_Games.Elements.Length > 1 )
|
||||
{
|
||||
bFirstChangeCompleted = true;
|
||||
c_Tabs.ActivateTabByName(PanelCaption[0], True);
|
||||
}
|
||||
|
||||
p_Game.li_Games.SetIndex(0);
|
||||
}
|
||||
}
|
||||
|
||||
bFirstChangeCompleted = p_Game.li_Games.Elements.Length > 0;
|
||||
super.InternalOnChange(Sender);
|
||||
}
|
||||
|
||||
function StartGame(string GameURL, bool bAlt)
|
||||
{
|
||||
local GUIController C;
|
||||
|
||||
C = Controller;
|
||||
|
||||
if (bAlt)
|
||||
{
|
||||
if ( mcServerRules != None )
|
||||
GameURL $= mcServerRules.Play();
|
||||
|
||||
// Append optional server flags
|
||||
PlayerOwner().ConsoleCommand("relaunch"@GameURL@"-server -log=server.log");
|
||||
}
|
||||
else
|
||||
PlayerOwner().ClientTravel(GameURL $ "?Listen",TRAVEL_Absolute,False);
|
||||
|
||||
C.CloseAll(false,True);
|
||||
}
|
||||
|
||||
function UpdateBotSetting( string NewValue, moNumericEdit BotControl )
|
||||
{
|
||||
local GUITabButton BotTab;
|
||||
// local byte Value;
|
||||
|
||||
if ( BotControl == None || NewValue == "" )
|
||||
return;
|
||||
|
||||
BotTab = GetBotTab();
|
||||
|
||||
EnableComponent(BotControl);
|
||||
EnableComponent(BotTab);
|
||||
|
||||
}
|
||||
|
||||
function ChangeGameType(bool bIsCustom)
|
||||
{
|
||||
if ( GameTypeLocked() )
|
||||
return;
|
||||
|
||||
// We've changed the gametype, so the settings in PlayInfo may no longer be applicable
|
||||
// Re-initialize PlayInfo and refresh the applicable pages, then update the maplists
|
||||
// and bot configurations
|
||||
if ( p_Main != None )
|
||||
{
|
||||
p_Main.InitGameType();
|
||||
if ( p_Mutators != None )
|
||||
p_Mutators.SetCurrentGame(p_Main.CurrentGameType);
|
||||
}
|
||||
|
||||
SetRuleInfo();
|
||||
|
||||
KFMapPage(p_Main).RefreshOptions();
|
||||
|
||||
// We use the bIsCustom flag to denote whether or not we should move on to the Maps tab
|
||||
if ( bIsCustom )
|
||||
{
|
||||
c_Tabs.ActivateTabByName(PanelCaption[1], True);
|
||||
}
|
||||
|
||||
if ( p_BotConfig != none )
|
||||
p_BotConfig.SetupBotLists(p_Main.GetIsTeamGame());
|
||||
}
|
||||
|
||||
// Forces the player to choose a gametype if none has been chosen - prevents having to load any gametypes until one is chosen, and speeds the page load
|
||||
function bool GameTypeLocked()
|
||||
{
|
||||
local int i;
|
||||
local GUITabButton tb;
|
||||
|
||||
// Don't lock if we don't have a gametype tab (for whatever reason)
|
||||
if ( p_Game == None )
|
||||
return false;
|
||||
|
||||
if ( Controller.LastGameType == "" )
|
||||
{
|
||||
for ( i = 0; i < c_Tabs.TabStack.Length; i++ )
|
||||
{
|
||||
tb = c_Tabs.TabStack[i];
|
||||
if ( tb != None && tb != p_Game.MyButton )
|
||||
DisableComponent(tb);
|
||||
}
|
||||
|
||||
DisableComponent(b_Primary);
|
||||
DisableComponent(b_Secondary);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
for ( i = 0; i < c_Tabs.TabStack.Length; i++ )
|
||||
{
|
||||
tb = c_Tabs.TabStack[i];
|
||||
if ( tb != None )
|
||||
{
|
||||
if ( tb.MyPanel == p_Mutators && class'LevelInfo'.static.IsDemoBuild() )
|
||||
DisableComponent(tb);
|
||||
else EnableComponent(tb);
|
||||
}
|
||||
}
|
||||
|
||||
EnableComponent(b_Primary);
|
||||
EnableComponent(b_Secondary);
|
||||
// Update the botmode stuff (tab button & minplayers property control)
|
||||
if ( RuleInfo != None && mcRules != None )
|
||||
{
|
||||
i = RuleInfo.FindIndex("BotMode");
|
||||
if ( i != -1 )
|
||||
mcRules.UpdateBotSetting(i);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
PageCaption=""
|
||||
Begin Object Class=KFGameFooter Name=SPFooter
|
||||
PrimaryCaption="LISTEN"
|
||||
PrimaryHint="Start a listen server..."
|
||||
SecondaryCaption="DEDICATED"
|
||||
SecondaryHint="Start a dedicated server..."
|
||||
Justification=TXTA_Center
|
||||
TextIndent=5
|
||||
FontScale=FNS_Small
|
||||
WinHeight=0.050
|
||||
RenderWeight=0.300000
|
||||
TabOrder=8
|
||||
ButtonHeight=0.035
|
||||
OnPreDraw=SPFooter.InternalOnPreDraw
|
||||
End Object
|
||||
t_Footer=KFGameFooter'KFGui.KFGamePageMP.SPFooter'
|
||||
|
||||
Begin Object Class=BackgroundImage Name=PageBackground
|
||||
Image=Texture'KillingFloor2HUD.menu.menuBackground'
|
||||
ImageStyle=ISTY_Justified
|
||||
ImageAlign=IMGA_Center
|
||||
RenderWeight=0.010000
|
||||
End Object
|
||||
i_Background=PageBackground
|
||||
|
||||
i_bkScan=None
|
||||
|
||||
PanelClass(0)="KFGUI.KFTab_GameTypeMP"
|
||||
PanelClass(1)="KFGUI.KFMapPage"
|
||||
PanelClass(2)="KFGUI.KFRules"
|
||||
PanelClass(3)="KFGUI.KFMutatorPage"
|
||||
PanelClass(4)="KFGUI.KFUT2K4Tab_ServerRulesPanel"
|
||||
|
||||
PanelCaption(2)="Sandbox"
|
||||
PanelCaption(4)="Server Rules"
|
||||
|
||||
PanelHint(4)="Configure the server settings..."
|
||||
|
||||
bRenderWorld=false
|
||||
|
||||
FirewallWarning="KFGUI.KFFirewallWarn"
|
||||
bExpert=false
|
||||
t_Header=ServerBrowserHeader
|
||||
|
||||
OnOpen=InternalOnOpen
|
||||
}
|
||||
201
kf_sources/KFGui/Classes/KFGamePageSP.uc
Normal file
201
kf_sources/KFGui/Classes/KFGamePageSP.uc
Normal file
|
|
@ -0,0 +1,201 @@
|
|||
class KFGamePageSP extends UT2K4GamePageSP;
|
||||
|
||||
// Helper for Hack fix for selecting GameType tab
|
||||
var bool bFirstChangeCompleted;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
super(UT2K4MainPage).Initcomponent(MyController, MyOwner);
|
||||
|
||||
RuleInfo = new(None) class'Engine.PlayInfo';
|
||||
|
||||
p_Game = UT2K4Tab_GameTypeBase(c_Tabs.AddTab(PanelCaption[0],PanelClass[0],,PanelHint[0], true));
|
||||
p_Game.OnChangeGameType = ChangeGameType;
|
||||
|
||||
p_Main = UT2K4Tab_MainBase(c_Tabs.AddTab(PanelCaption[1],PanelClass[1],,PanelHint[1], true));
|
||||
p_Game.tp_Main = p_Main;
|
||||
|
||||
mcRules = KFIAMultiColumnRulesPanel(c_Tabs.AddTab(PanelCaption[2], "KFGUI.KFIAMultiColumnRulesPanel",, PanelHint[2], false));
|
||||
p_Mutators = UT2K4Tab_MutatorBase(c_Tabs.AddTab(PanelCaption[3],PanelClass[3],,PanelHint[3], false));
|
||||
|
||||
b_Back = UT2K4GameFooter(t_Footer).b_Back;
|
||||
b_Secondary = UT2K4GameFooter(t_Footer).b_Secondary;
|
||||
b_Primary = UT2K4GameFooter(t_Footer).b_Primary;
|
||||
|
||||
DisableComponent(b_Secondary);
|
||||
EnableComponent(b_Primary);
|
||||
|
||||
// Disable the Sandbox Tab if we're not in Sandbox mode
|
||||
if ( class'KFGameType'.default.KFGameLength != 3 )
|
||||
{
|
||||
c_Tabs.TabStack[2].DisableMe();
|
||||
}
|
||||
}
|
||||
|
||||
function InternalOnChange(GUIComponent Sender)
|
||||
{
|
||||
// HACK: Switch back to the GameType tab if we have more than 1 GameType available
|
||||
if ( !bFirstChangeCompleted )
|
||||
{
|
||||
if ( p_Game.li_Games.Elements.Length > 0 )
|
||||
{
|
||||
if ( p_Game.li_Games.Elements.Length > 1 )
|
||||
{
|
||||
bFirstChangeCompleted = true;
|
||||
c_Tabs.ActivateTabByName(PanelCaption[0], True);
|
||||
}
|
||||
|
||||
p_Game.li_Games.SetIndex(0);
|
||||
}
|
||||
}
|
||||
|
||||
bFirstChangeCompleted = p_Game.li_Games.Elements.Length > 0;
|
||||
super.InternalOnChange(Sender);
|
||||
}
|
||||
|
||||
function UpdateBotSetting( string NewValue, moNumericEdit BotControl )
|
||||
{
|
||||
local GUITabButton BotTab;
|
||||
|
||||
if ( BotControl == None || NewValue == "" )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
BotTab = GetBotTab();
|
||||
EnableComponent(BotControl);
|
||||
EnableComponent(BotTab);
|
||||
}
|
||||
|
||||
function ChangeGameType(bool bIsCustom)
|
||||
{
|
||||
if ( GameTypeLocked() )
|
||||
return;
|
||||
|
||||
// We've changed the gametype, so the settings in PlayInfo may no longer be applicable
|
||||
// Re-initialize PlayInfo and refresh the applicable pages, then update the maplists
|
||||
// and bot configurations
|
||||
if ( p_Main != None )
|
||||
{
|
||||
p_Main.InitGameType();
|
||||
if ( p_Mutators != None )
|
||||
p_Mutators.SetCurrentGame(p_Main.CurrentGameType);
|
||||
}
|
||||
|
||||
SetRuleInfo();
|
||||
|
||||
KFMapPage(p_Main).RefreshOptions();
|
||||
|
||||
// We use the bIsCustom flag to denote whether or not we should move on to the Maps tab
|
||||
if ( bIsCustom )
|
||||
{
|
||||
c_Tabs.ActivateTabByName(PanelCaption[1], True);
|
||||
}
|
||||
|
||||
if ( p_BotConfig != none )
|
||||
p_BotConfig.SetupBotLists(p_Main.GetIsTeamGame());
|
||||
}
|
||||
|
||||
// Forces the player to choose a gametype if none has been chosen - prevents having to load any gametypes until one is chosen, and speeds the page load
|
||||
function bool GameTypeLocked()
|
||||
{
|
||||
local int i;
|
||||
local GUITabButton tb;
|
||||
|
||||
// Don't lock if we don't have a gametype tab (for whatever reason)
|
||||
if ( p_Game == None )
|
||||
return false;
|
||||
|
||||
if ( Controller.LastGameType == "" )
|
||||
{
|
||||
for ( i = 0; i < c_Tabs.TabStack.Length; i++ )
|
||||
{
|
||||
tb = c_Tabs.TabStack[i];
|
||||
if ( tb != None && tb != p_Game.MyButton )
|
||||
DisableComponent(tb);
|
||||
}
|
||||
|
||||
DisableComponent(b_Primary);
|
||||
DisableComponent(b_Secondary);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
for ( i = 0; i < c_Tabs.TabStack.Length; i++ )
|
||||
{
|
||||
tb = c_Tabs.TabStack[i];
|
||||
if ( tb != None )
|
||||
{
|
||||
if ( tb.MyPanel == p_Mutators && class'LevelInfo'.static.IsDemoBuild() )
|
||||
DisableComponent(tb);
|
||||
else EnableComponent(tb);
|
||||
}
|
||||
}
|
||||
|
||||
EnableComponent(b_Primary);
|
||||
DisableComponent(b_Secondary);
|
||||
// Update the botmode stuff (tab button & minplayers property control)
|
||||
if ( RuleInfo != None && mcRules != None )
|
||||
{
|
||||
i = RuleInfo.FindIndex("BotMode");
|
||||
if ( i != -1 )
|
||||
mcRules.UpdateBotSetting(i);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
PageCaption="Solo"
|
||||
Begin Object Class=KFGameFooter Name=SPFooter
|
||||
PrimaryCaption="PLAY"
|
||||
PrimaryHint="Start A Match With These Settings"
|
||||
SecondaryCaption="SPECTATE"
|
||||
SecondaryHint="Spectate A Match With These Settings"
|
||||
Justification=TXTA_Center
|
||||
TextIndent=5
|
||||
FontScale=FNS_Small
|
||||
WinHeight=0.050
|
||||
RenderWeight=0.300000
|
||||
TabOrder=8
|
||||
ButtonHeight=0.035
|
||||
OnPreDraw=SPFooter.InternalOnPreDraw
|
||||
End Object
|
||||
t_Footer=KFGameFooter'KFGui.KFGamePageSP.SPFooter'
|
||||
|
||||
Begin Object Class=BackgroundImage Name=PageBackground
|
||||
Image=Texture'KillingFloor2HUD.menu.menuBackground'
|
||||
ImageStyle=ISTY_Justified
|
||||
ImageAlign=IMGA_Center
|
||||
RenderWeight=0.010000
|
||||
End Object
|
||||
i_Background=PageBackground
|
||||
|
||||
i_bkScan=None
|
||||
|
||||
PanelCaption(0)="Select Gametype"
|
||||
PanelCaption(1)="Select Map"
|
||||
PanelCaption(2)="Sandbox"
|
||||
PanelCaption(3)="Mutators"
|
||||
|
||||
PanelHint(0)="Select desired gametype"
|
||||
PanelHint(1)="Select maps and difficulty..."
|
||||
PanelHint(2)="Configure the current game..."
|
||||
PanelHint(3)="Select and configure any mutators to use..."
|
||||
|
||||
PanelClass(0)="KFGUI.KFTab_GameTypeSP"
|
||||
PanelClass(1)="KFGUI.KFMapPage"
|
||||
PanelClass(2)="KFGUI.KFRules"
|
||||
PanelClass(3)="KFGUI.KFMutatorPage"
|
||||
|
||||
bRenderWorld=false
|
||||
|
||||
t_Header=ServerBrowserHeader
|
||||
|
||||
OnOpen=UT2K4GamePageBase.InternalOnOpen
|
||||
}
|
||||
|
||||
437
kf_sources/KFGui/Classes/KFGameSettings.uc
Normal file
437
kf_sources/KFGui/Classes/KFGameSettings.uc
Normal file
|
|
@ -0,0 +1,437 @@
|
|||
class KFGameSettings extends Settings_Tabs;
|
||||
|
||||
var automated GUISectionBackground i_BG1, i_BG2;
|
||||
|
||||
//var automated moEditBox ed_PlayerName;
|
||||
|
||||
var automated moCheckBox ch_DynNetspeed;
|
||||
var automated moComboBox co_Netspeed;
|
||||
|
||||
var automated moComboBox co_Hints;
|
||||
var int HintLevel,
|
||||
HintLevelD; // 0 = all hints, 1 = new hints, 2 = no hints
|
||||
var localized array<string> Hints;
|
||||
|
||||
var automated moComboBox co_AudioMessageLevel;
|
||||
var int AudioMessageLevel,
|
||||
AudioMessageLevelD;
|
||||
var localized string AudioMessageLevels[3];
|
||||
|
||||
var automated moCheckBox ch_TraderPath;
|
||||
var bool bTrader;
|
||||
|
||||
var int iNetspeed, iNetSpeedD;
|
||||
var bool bDynNet;
|
||||
var string sPlayerName, sPlayerNameD;
|
||||
|
||||
var localized string NetSpeedText[4];
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
local int i;
|
||||
|
||||
Super.InitComponent(MyController, MyOwner);
|
||||
|
||||
for(i = 0; i < ArrayCount(NetSpeedText); i++)
|
||||
co_Netspeed.AddItem(NetSpeedText[i]);
|
||||
|
||||
i_BG2.ManageComponent(co_Netspeed);
|
||||
i_BG2.ManageComponent(ch_DynNetspeed);
|
||||
|
||||
i_BG1.ManageComponent(co_Hints);
|
||||
i_BG1.ManageComponent(ch_TraderPath);
|
||||
i_BG1.ManageComponent(co_AudioMessageLevel);
|
||||
|
||||
for ( i = 0; i < Hints.Length; i++ )
|
||||
{
|
||||
co_Hints.AddItem(Hints[i]);
|
||||
}
|
||||
co_Hints.ReadOnly(true);
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
co_AudioMessageLevel.AddItem(AudioMessageLevels[i]);
|
||||
}
|
||||
co_AudioMessageLevel.ReadOnly(true);
|
||||
|
||||
}
|
||||
|
||||
function InternalOnLoadINI(GUIComponent Sender, string s)
|
||||
{
|
||||
local PlayerController PC;
|
||||
local int i;
|
||||
|
||||
PC = PlayerOwner();
|
||||
|
||||
switch (Sender)
|
||||
{
|
||||
case co_Netspeed:
|
||||
if ( PC.Player != None )
|
||||
i = PC.Player.ConfiguredInternetSpeed;
|
||||
else
|
||||
i = class'Player'.default.ConfiguredInternetSpeed;
|
||||
|
||||
if (i <= 2600)
|
||||
iNetSpeed = 0;
|
||||
|
||||
else if (i <= 5000)
|
||||
iNetSpeed = 1;
|
||||
|
||||
else if (i <= 10000)
|
||||
iNetSpeed = 2;
|
||||
|
||||
else iNetSpeed = 3;
|
||||
|
||||
iNetSpeedD = iNetSpeed;
|
||||
co_NetSpeed.SetIndex(iNetSpeed);
|
||||
break;
|
||||
|
||||
case ch_DynNetspeed:
|
||||
bDynNet = PC.bDynamicNetSpeed;
|
||||
ch_DynNetspeed.Checked(bDynNet);
|
||||
break;
|
||||
|
||||
case co_Hints:
|
||||
if ( KFPlayerController(PlayerOwner()) != none )
|
||||
{
|
||||
if ( KFPlayerController(PlayerOwner()).bShowHints )
|
||||
{
|
||||
HintLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
HintLevel = 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( class'KFPlayerController'.default.bShowHints )
|
||||
{
|
||||
HintLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
HintLevel = 2;
|
||||
}
|
||||
}
|
||||
|
||||
HintLevelD = HintLevel;
|
||||
co_Hints.SetIndex(HintLevel);
|
||||
break;
|
||||
|
||||
case ch_TraderPath:
|
||||
if ( KFPlayerController(PlayerOwner()) != none )
|
||||
{
|
||||
bTrader = KFPlayerController(PlayerOwner()).bWantsTraderPath;
|
||||
}
|
||||
else
|
||||
{
|
||||
bTrader = class'KFPlayerController'.default.bWantsTraderPath;
|
||||
}
|
||||
|
||||
ch_TraderPath.SetComponentValue(bTrader,true);
|
||||
break;
|
||||
|
||||
case co_AudioMessageLevel:
|
||||
AudioMessageLevel = int(PC.ConsoleCommand("get KFMod.KFPlayerController AudioMessageLevel"));
|
||||
AudioMessageLevelD = AudioMessageLevel;
|
||||
co_AudioMessageLevel.SetIndex(AudioMessageLevel);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function SaveSettings()
|
||||
{
|
||||
local PlayerController PC;
|
||||
local bool bSave;
|
||||
|
||||
Super.SaveSettings();
|
||||
PC = PlayerOwner();
|
||||
|
||||
if ( iNetSpeed != iNetSpeedD || (class'Player'.default.ConfiguredInternetSpeed == 9636) )
|
||||
{
|
||||
if ( PC.Player != None )
|
||||
{
|
||||
switch (iNetSpeed)
|
||||
{
|
||||
case 0: PC.Player.ConfiguredInternetSpeed = 2600; break;
|
||||
case 1: PC.Player.ConfiguredInternetSpeed = 5000; break;
|
||||
case 2: PC.Player.ConfiguredInternetSpeed = 10000; break;
|
||||
case 3: PC.Player.ConfiguredInternetSpeed = 15000; break;
|
||||
}
|
||||
|
||||
PC.Player.SaveConfig();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
switch (iNetSpeed)
|
||||
{
|
||||
case 0: class'Player'.default.ConfiguredInternetSpeed = 2600; break;
|
||||
case 1: class'Player'.default.ConfiguredInternetSpeed = 5000; break;
|
||||
case 2: class'Player'.default.ConfiguredInternetSpeed = 10000; break;
|
||||
case 3: class'Player'.default.ConfiguredInternetSpeed = 15000; break;
|
||||
}
|
||||
|
||||
class'Player'.static.StaticSaveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
if ( PC.bDynamicNetSpeed != bDynNet )
|
||||
{
|
||||
PC.bDynamicNetSpeed = bDynNet;
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
if ( HintLevelD != HintLevel )
|
||||
{
|
||||
if (HintLevel == 0)
|
||||
{
|
||||
if (KFPlayerController(PC) != none)
|
||||
{
|
||||
KFPlayerController(PC).bShowHints = true;
|
||||
KFPlayerController(PC).UpdateHintManagement(true);
|
||||
if (KFPlayerController(PC).HintManager != none)
|
||||
KFPlayerController(PC).HintManager.NonStaticReset();
|
||||
KFPlayerController(PC).SaveConfig();
|
||||
}
|
||||
else
|
||||
{
|
||||
class'KFHintManager'.static.StaticReset();
|
||||
class'KFPlayerController'.default.bShowHints = true;
|
||||
class'KFPlayerController'.static.StaticSaveConfig();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (KFPlayerController(PC) != none)
|
||||
{
|
||||
KFPlayerController(PC).bShowHints = (HintLevel == 1);
|
||||
KFPlayerController(PC).UpdateHintManagement(HintLevel == 1);
|
||||
KFPlayerController(PC).SaveConfig();
|
||||
}
|
||||
else
|
||||
{
|
||||
class'KFPlayerController'.default.bShowHints = (HintLevel == 1);
|
||||
class'KFPlayerController'.static.StaticSaveConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (KFPlayerController(PlayerOwner()) != none)
|
||||
{
|
||||
KFPlayerController(PlayerOwner()).bWantsTraderPath = bTrader;
|
||||
KFPlayerController(PC).SaveConfig();
|
||||
}
|
||||
else
|
||||
{
|
||||
class'KFPlayerController'.default.bWantsTraderPath = bTrader;
|
||||
class'KFPlayerController'.static.StaticSaveConfig();
|
||||
}
|
||||
|
||||
|
||||
if ( AudioMessageLevelD != AudioMessageLevel )
|
||||
{
|
||||
if (KFPlayerController(PlayerOwner()) != none)
|
||||
{
|
||||
KFPlayerController(PlayerOwner()).AudioMessageLevel = AudioMessageLevel;
|
||||
KFPlayerController(PC).SaveConfig();
|
||||
}
|
||||
else
|
||||
{
|
||||
class'KFPlayerController'.default.AudioMessageLevel = AudioMessageLevel;
|
||||
class'KFPlayerController'.static.StaticSaveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
if (bSave)
|
||||
PC.SaveConfig();
|
||||
}
|
||||
|
||||
function InternalOnChange(GUIComponent Sender)
|
||||
{
|
||||
Super.InternalOnChange(Sender);
|
||||
|
||||
switch (sender)
|
||||
{
|
||||
case co_Netspeed:
|
||||
iNetSpeed = co_NetSpeed.GetIndex();
|
||||
break;
|
||||
|
||||
case ch_DynNetspeed:
|
||||
bDynNet = ch_DynNetspeed.IsChecked();
|
||||
break;
|
||||
|
||||
case co_Hints:
|
||||
HintLevel = co_Hints.GetIndex();
|
||||
break;
|
||||
|
||||
case ch_TraderPath:
|
||||
bTrader = ch_TraderPath.IsChecked();
|
||||
break;
|
||||
|
||||
case co_AudioMessageLevel:
|
||||
AudioMessageLevel = co_AudioMessageLevel.GetIndex();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function ResetClicked()
|
||||
{
|
||||
local PlayerController PC;
|
||||
local int i;
|
||||
|
||||
Super.ResetClicked();
|
||||
|
||||
PC = PlayerOwner();
|
||||
|
||||
class'Player'.static.ResetConfig("ConfiguredInternetSpeed");
|
||||
class'PlayerController'.static.ResetConfig("bDynamicNetSpeed");
|
||||
|
||||
for (i = 0; i < Components.Length; i++)
|
||||
Components[i].LoadINI();
|
||||
}
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
Begin Object class=GUISectionBackground Name=GameBK1
|
||||
WinWidth=0.5
|
||||
WinHeight=0.25
|
||||
WinLeft=0.25
|
||||
WinTop=0.05
|
||||
RenderWeight=0.1001
|
||||
Caption="Gameplay"
|
||||
End Object
|
||||
i_BG1=GameBK1
|
||||
|
||||
|
||||
Begin Object class=GUISectionBackground Name=GameBK2
|
||||
WinWidth=0.5
|
||||
WinHeight=0.2
|
||||
WinLeft=0.25
|
||||
WinTop=0.35
|
||||
RenderWeight=0.1002
|
||||
Caption="Network"
|
||||
End Object
|
||||
i_BG2=GameBK2
|
||||
|
||||
/* Begin Object class=moEditBox Name=OnlineStatsName
|
||||
WinWidth=0.419316
|
||||
WinLeft=0.524912
|
||||
WinTop=0.373349
|
||||
INIOption="@Internal"
|
||||
OnLoadINI=InternalOnLoadINI
|
||||
OnChange=InternalOnChange
|
||||
Caption="Player Name"
|
||||
Hint="Please select a name to use ingame"
|
||||
CaptionWidth=0.5
|
||||
TabOrder=1
|
||||
End Object
|
||||
ed_PlayerName=OnlineStatsName
|
||||
*/
|
||||
|
||||
Begin Object class=moComboBox Name=OnlineNetSpeed
|
||||
WinWidth=0.419297
|
||||
WinLeft=0.528997
|
||||
WinTop=0.222944
|
||||
Caption="Connection"
|
||||
INIOption="@Internal"
|
||||
INIDefault="Cable Modem/DSL"
|
||||
OnLoadINI=InternalOnLoadINI
|
||||
OnChange=InternalOnChange
|
||||
Hint="How fast is your connection?"
|
||||
CaptionWidth=0.5
|
||||
ComponentJustification=TXTA_Left
|
||||
bReadOnly=true
|
||||
bHeightFromComponent=false
|
||||
TabOrder=3
|
||||
End Object
|
||||
co_Netspeed=OnlineNetSpeed
|
||||
|
||||
Begin Object class=moCheckBox Name=NetworkDynamicNetspeed
|
||||
WinWidth=0.419297
|
||||
WinLeft=0.528997
|
||||
WinTop=0.266017
|
||||
Caption="Dynamic Netspeed"
|
||||
Hint="Netspeed is automatically adjusted based on the speed of your network connection"
|
||||
CaptionWidth=0.955
|
||||
bSquare=true
|
||||
ComponentJustification=TXTA_Left
|
||||
IniOption="@Internal"
|
||||
OnLoadINI=InternalOnLoadINI
|
||||
OnChange=InternalOnChange
|
||||
TabOrder=4
|
||||
End Object
|
||||
ch_DynNetspeed=NetworkDynamicNetspeed
|
||||
|
||||
|
||||
Begin Object Class=moComboBox Name=HintsCombo
|
||||
Caption="Hint Level"
|
||||
ComponentJustification=TXTA_Left
|
||||
Hint="Selects whether hints should be shown or not."
|
||||
WinWidth=0.401953
|
||||
WinLeft=0.547773
|
||||
WinTop=0.335021
|
||||
CaptionWidth=0.55
|
||||
TabOrder=0
|
||||
bBoundToParent=True
|
||||
bScaleToParent=True
|
||||
OnLoadINI=InternalOnLoadINI
|
||||
OnChange=InternalOnChange
|
||||
IniOption="@Internal"
|
||||
End Object
|
||||
co_Hints=HintsCombo
|
||||
|
||||
Begin Object class=moCheckBox Name=TraderPath
|
||||
Caption="Show the trader path"
|
||||
Hint="Enables the path to the trader"
|
||||
CaptionWidth=0.955
|
||||
bSquare=True
|
||||
ComponentJustification=TXTA_Left
|
||||
OnLoadINI=InternalOnLoadINI
|
||||
OnChange=InternalOnChange
|
||||
INIOption="@Internal"
|
||||
INIDefault="False"
|
||||
bAutoSizeCaption=True
|
||||
End Object
|
||||
ch_TraderPath=TraderPath
|
||||
|
||||
Begin Object Class=moComboBox Name=AudioMessageCombo
|
||||
Caption="Audio Message Level"
|
||||
ComponentJustification=TXTA_Left
|
||||
Hint="Selects what type of messages are played"
|
||||
WinWidth=0.401953
|
||||
WinLeft=0.547773
|
||||
WinTop=0.335021
|
||||
CaptionWidth=0.55
|
||||
TabOrder=0
|
||||
bBoundToParent=True
|
||||
bScaleToParent=True
|
||||
OnLoadINI=InternalOnLoadINI
|
||||
OnChange=InternalOnChange
|
||||
IniOption="@Internal"
|
||||
End Object
|
||||
co_AudioMessageLevel=AudioMessageCombo
|
||||
|
||||
Hints(0)="All Hints (Reset)"
|
||||
Hints(1)="New Hints Only"
|
||||
Hints(2)="No Hints"
|
||||
|
||||
AudioMessageLevels(0)="All Messages"
|
||||
AudioMessageLevels(1)="Important Messages"
|
||||
AudioMessageLevels(2)="Minimal Messages"
|
||||
|
||||
WinTop=0.15
|
||||
WinLeft=0
|
||||
WinWidth=1
|
||||
WinHeight=0.72
|
||||
bAcceptsInput=false
|
||||
|
||||
NetSpeedText(0)="Modem"
|
||||
NetSpeedText(1)="ISDN"
|
||||
NetSpeedText(2)="Cable/ADSL"
|
||||
NetSpeedText(3)="LAN/T1"
|
||||
|
||||
PanelCaption="Game"
|
||||
}
|
||||
|
||||
406
kf_sources/KFGui/Classes/KFHudSettings.uc
Normal file
406
kf_sources/KFGui/Classes/KFHudSettings.uc
Normal file
|
|
@ -0,0 +1,406 @@
|
|||
class KFHudSettings extends UT2K4Tab_HudSettings;
|
||||
|
||||
var automated moCheckBox ch_LightHud;
|
||||
var() bool bLight;
|
||||
|
||||
var automated moCheckBox ch_SpecKillCounter;
|
||||
var bool bTallySpecimenKills;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
Super(Settings_Tabs).InitComponent(MyController, MyOwner);
|
||||
|
||||
i_BG1.ManageComponent(ch_Visible);
|
||||
i_BG1.ManageComponent(ch_Weapons);
|
||||
i_BG1.ManageComponent(ch_LightHud);
|
||||
i_BG1.ManageComponent(ch_SpecKillCounter);
|
||||
i_BG1.ManageComponent(ch_Personal);
|
||||
i_BG1.ManageComponent(ch_Score);
|
||||
// KFTODO: reintegrate these
|
||||
//i_BG1.ManageComponent(ch_Portraits);
|
||||
//i_BG1.ManageComponent(ch_VCPortraits);
|
||||
i_BG1.ManageComponent(ch_DeathMsgs);
|
||||
i_BG1.ManageComponent(nu_MsgCount);
|
||||
i_BG1.ManageComponent(nu_MsgScale);
|
||||
i_BG1.ManageComponent(nu_MsgOffset);
|
||||
|
||||
sl_Opacity.MySlider.bDrawPercentSign = True;
|
||||
//sl_Scale.MySlider.bDrawPercentSign = True;
|
||||
}
|
||||
|
||||
function InternalOnLoadINI(GUIComponent Sender, string s)
|
||||
{
|
||||
local HUD H;
|
||||
|
||||
H = PlayerOwner().myHUD;
|
||||
|
||||
switch (Sender)
|
||||
{
|
||||
case ch_DeathMsgs:
|
||||
bNoMsgs = class'XGame.xDeathMessage'.default.bNoConsoleDeathMessages;
|
||||
ch_DeathMsgs.SetComponentValue(bNoMsgs,true);
|
||||
break;
|
||||
|
||||
case ch_Visible:
|
||||
bVis = H.bHideHUD;
|
||||
ch_Visible.SetComponentValue(bVis,true);
|
||||
InitializeHUDColor();
|
||||
break;
|
||||
|
||||
|
||||
case ch_LightHud:
|
||||
if ( HUDKillingFloor(H) != none )
|
||||
{
|
||||
bLight = HUDKillingFloor(H).bLightHud;
|
||||
ch_LightHud.SetComponentValue(bLight,true);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
bLight = class'KFMod.HUDKillingFloor'.default.bLightHud;
|
||||
ch_LightHud.SetComponentValue(bLight,true);
|
||||
break;
|
||||
}
|
||||
case ch_SpecKillCounter:
|
||||
if ( HUDKillingFloor(H) != none )
|
||||
{
|
||||
bTallySpecimenKills = HUDKillingFloor(H).bTallySpecimenKills;
|
||||
ch_SpecKillCounter.SetComponentValue(bTallySpecimenKills,true);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
bTallySpecimenKills = class'KFMod.HUDKillingFloor'.default.bTallySpecimenKills;
|
||||
ch_SpecKillCounter.SetComponentValue(bTallySpecimenKills,true);
|
||||
break;
|
||||
}
|
||||
|
||||
case ch_Weapons:
|
||||
bWeapons = H.bShowWeaponInfo;
|
||||
ch_Weapons.SetComponentValue(bWeapons,true);
|
||||
break;
|
||||
|
||||
case ch_Personal:
|
||||
bPersonal = H.bShowPersonalInfo;
|
||||
ch_Personal.SetComponentValue(bPersonal,true);
|
||||
break;
|
||||
|
||||
case ch_Score:
|
||||
bScore = H.bShowPoints;
|
||||
ch_Score.SetComponentValue(bScore,true);
|
||||
break;
|
||||
|
||||
case ch_WeaponBar:
|
||||
bWeaponBar = H.bShowWeaponBar;
|
||||
ch_WeaponBar.SetComponentValue(bWeaponBar,true);
|
||||
break;
|
||||
|
||||
// KFTODO: Figure out how to reintegrate this!
|
||||
// case ch_Portraits:
|
||||
// bPortraits = H.bShowPortrait;
|
||||
// ch_Portraits.SetComponentValue(bPortraits,true);
|
||||
// break;
|
||||
|
||||
case nu_MsgCount:
|
||||
iCount = H.ConsoleMessageCount;
|
||||
nu_MsgCount.SetComponentValue(iCount,true);
|
||||
break;
|
||||
|
||||
case nu_MsgScale:
|
||||
iScale = 8 - H.ConsoleFontSize;
|
||||
nu_MsgScale.SetComponentValue(iScale,true);
|
||||
break;
|
||||
|
||||
case nu_MsgOffset:
|
||||
iOffset = H.MessageFontOffset+4;
|
||||
nu_MsgOffset.SetComponentValue(iOffset,true);
|
||||
break;
|
||||
|
||||
default:
|
||||
GUIMenuOption(Sender).SetComponentValue(s,true);
|
||||
}
|
||||
}
|
||||
|
||||
function SaveSettings()
|
||||
{
|
||||
local PlayerController PC;
|
||||
local HUD H;
|
||||
local bool bSave;
|
||||
|
||||
PC = PlayerOwner();
|
||||
H = PlayerOwner().myHUD;
|
||||
|
||||
if ( H.bHideHud != bVis )
|
||||
{
|
||||
H.bHideHUD = bVis;
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
if ( HUDKillingFloor(H) != none )
|
||||
{
|
||||
if ( HUDKillingFloor(H).bLightHud != bLight )
|
||||
{
|
||||
HUDKillingFloor(H).bLightHUD = bLight;
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
if ( HUDKillingFloor(H).bTallySpecimenKills != bTallySpecimenKills )
|
||||
{
|
||||
HUDKillingFloor(H).bTallySpecimenKills = bTallySpecimenKills;
|
||||
bSave = True;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( class'KFMod.HUDKillingFloor'.default.bLightHud != bLight )
|
||||
{
|
||||
class'KFMod.HUDKillingFloor'.default.bLightHud = bLight;
|
||||
class'KFMod.HUDKillingFloor'.static.StaticSaveConfig();
|
||||
}
|
||||
|
||||
if ( class'KFMod.HUDKillingFloor'.default.bTallySpecimenKills != bTallySpecimenKills )
|
||||
{
|
||||
class'KFMod.HUDKillingFloor'.default.bTallySpecimenKills = bTallySpecimenKills;
|
||||
class'KFMod.HUDKillingFloor'.static.StaticSaveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
if ( H.bShowWeaponInfo != bWeapons )
|
||||
{
|
||||
H.bShowWeaponInfo = bWeapons;
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
if ( H.bShowPersonalInfo != bPersonal )
|
||||
{
|
||||
H.bShowPersonalInfo = bPersonal;
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
if ( H.bShowPoints != bScore )
|
||||
{
|
||||
H.bShowPoints = bScore;
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
if ( H.bShowWeaponBar != bWeaponBar)
|
||||
{
|
||||
H.bShowWeaponBar = bWeaponBar;
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
// if _RO_
|
||||
/*
|
||||
// end if _RO_
|
||||
if ( H.bShowPortrait != bPortraits )
|
||||
{
|
||||
H.bShowPortrait = bPortraits;
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
if ( H.bShowPortraitVC != bVCPortraits )
|
||||
{
|
||||
H.bShowPortraitVC = bVCPortraits;
|
||||
bSave = True;
|
||||
}
|
||||
// if _RO_
|
||||
*/
|
||||
// end if _RO_
|
||||
|
||||
if ( H.bNoEnemyNames == bNames )
|
||||
{
|
||||
H.bNoEnemyNames = !bNames;
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
if ( H.ConsoleMessageCount != iCount )
|
||||
{
|
||||
H.ConsoleMessageCount = iCount;
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
if ( H.ConsoleFontSize != Abs(iScale - 8) )
|
||||
{
|
||||
H.ConsoleFontSize = Abs(iScale - 8);
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
if ( H.MessageFontOffset != iOffset - 4 )
|
||||
{
|
||||
H.MessageFontOffset = iOffset - 4;
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
if ( H.HudScale != fScale / 100.0 )
|
||||
{
|
||||
H.HudScale = fScale / 100.0;
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
if ( H.HudOpacity != (fOpacity / 100.0) * 255.0 )
|
||||
{
|
||||
H.HudOpacity = (fOpacity / 100.0) * 255.0;
|
||||
bSave = True;
|
||||
}
|
||||
|
||||
if ( HudBase(H) != None )
|
||||
{
|
||||
if ( SaveCustomHUDColor() || bSave )
|
||||
H.SaveConfig();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if ( bSave )
|
||||
H.SaveConfig();
|
||||
|
||||
SaveCustomHUDColor();
|
||||
}
|
||||
|
||||
if ( class'XGame.xDeathMessage'.default.bNoConsoleDeathMessages != bNoMsgs )
|
||||
{
|
||||
class'XGame.xDeathMessage'.default.bNoConsoleDeathMessages = bNoMsgs;
|
||||
class'XGame.xDeathMessage'.static.StaticSaveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
function InternalOnChange(GUIComponent Sender)
|
||||
{
|
||||
Super.InternalOnChange(Sender);
|
||||
|
||||
switch (Sender)
|
||||
{
|
||||
case ch_LightHud:
|
||||
bLight = ch_LightHud.IsChecked();
|
||||
break;
|
||||
case ch_SpecKillCounter:
|
||||
bTallySpecimenKills = ch_SpecKillCounter.IsChecked();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function InitializeHUDColor()
|
||||
{
|
||||
fScale = PlayerOwner().myHUD.HudScale * 100;
|
||||
fOpacity = (PlayerOwner().myHUD.HudOpacity / 255) * 100;
|
||||
|
||||
//sl_Scale.SetValue(fScale);
|
||||
sl_Opacity.SetValue(fOpacity);
|
||||
|
||||
UpdatePreviewColor();
|
||||
}
|
||||
|
||||
function UpdatePreviewColor()
|
||||
{
|
||||
local float o, s;
|
||||
|
||||
i_PreviewBG.ImageColor = cCustom;
|
||||
|
||||
o = 255.0 * (fOpacity / 100.0);
|
||||
i_PreviewBG.ImageColor.A = o;
|
||||
i_Preview.ImageColor.A = o;
|
||||
|
||||
s = 1.0;
|
||||
i_PreviewBG.WinWidth = DefaultBGPos.X2 * s;
|
||||
i_PreviewBG.WinHeight = DefaultBGPos.Y2 * s;
|
||||
|
||||
i_Preview.WinWidth = DefaultHealthPos.X2 * s;
|
||||
i_Preview.WinHeight = DefaultHealthPos.Y2 * s;
|
||||
|
||||
i_Scale.WinWidth = i_PreviewBG.WinWidth;
|
||||
i_Scale.WinHeight = i_PreviewBG.WinHeight;
|
||||
|
||||
}
|
||||
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Begin Object Class=GUIImage Name=PreviewBackground
|
||||
Image=none//Texture'InterfaceArt_tex.Menu.traderlist_normal'
|
||||
ImageStyle=ISTY_Stretched
|
||||
ImageAlign=IMGA_Center
|
||||
WinTop=0.211713
|
||||
WinLeft=0.749335
|
||||
WinWidth=0.190000
|
||||
WinHeight=0.160000
|
||||
RenderWeight=1.002000
|
||||
End Object
|
||||
i_PreviewBG=GUIImage'KFGui.KFHudSettings.PreviewBackground'
|
||||
|
||||
Begin Object Class=GUIImage Name=Preview
|
||||
Image=Texture'KillingFloorHud.Perk_Firebug'
|
||||
ImageStyle=ISTY_Scaled
|
||||
ImageAlign=IMGA_Center
|
||||
X1=-1
|
||||
Y1=-1
|
||||
X2=-1
|
||||
Y2=-1
|
||||
WinTop=0.211559
|
||||
WinLeft=0.749828
|
||||
WinWidth=0.150000
|
||||
WinHeight=0.150000
|
||||
RenderWeight=1.003000
|
||||
End Object
|
||||
i_Preview=GUIImage'KFGui.KFHudSettings.Preview'
|
||||
|
||||
Begin Object Class=GUIImage Name=PreviewBK
|
||||
Image=Texture'InterfaceArt_tex.Menu.traderlist_normal'
|
||||
//Texture'InterfaceArt_tex.Menu.changeme_texture'
|
||||
WinWidth=0.400000
|
||||
WinHeight=0.250000
|
||||
WinLeft=0.749335
|
||||
WinTop=0.211713
|
||||
ImageStyle=ISTY_Scaled
|
||||
ImageRenderStyle=MSTY_Alpha
|
||||
ImageColor=(R=255,G=255,B=255,A=255)
|
||||
ImageAlign=IMGA_Center
|
||||
RenderWeight=1.001
|
||||
End Object
|
||||
i_Scale=PreviewBK;
|
||||
|
||||
Begin Object class=moCheckBox Name=LightHud
|
||||
WinWidth=0.196875
|
||||
WinLeft=0.379297
|
||||
WinTop=0.043906
|
||||
Caption="Light HUD"
|
||||
INIOption="@Internal"
|
||||
OnLoadINI=InternalOnLoadINI
|
||||
OnChange=InternalOnChange
|
||||
Hint="Show a light version of the HUD"
|
||||
CaptionWidth=0.9
|
||||
bSquare=true
|
||||
ComponentJustification=TXTA_Left
|
||||
bAutoSizeCaption=True
|
||||
TabOrder=1
|
||||
End Object
|
||||
ch_LightHud=LightHud
|
||||
|
||||
Begin Object class=moCheckBox Name=SpecimenKillCounter
|
||||
WinWidth=0.196875
|
||||
WinLeft=0.379297
|
||||
WinTop=0.043906
|
||||
Caption="Show Kill Counter"
|
||||
INIOption="@Internal"
|
||||
OnLoadINI=InternalOnLoadINI
|
||||
OnChange=InternalOnChange
|
||||
Hint="Tally specimen kills on the HUD"
|
||||
CaptionWidth=0.9
|
||||
bSquare=true
|
||||
ComponentJustification=TXTA_Left
|
||||
bAutoSizeCaption=True
|
||||
TabOrder=1
|
||||
End Object
|
||||
ch_SpecKillCounter=SpecimenKillCounter
|
||||
|
||||
sl_Scale=none
|
||||
|
||||
sl_Red=None
|
||||
sl_Green=None
|
||||
sl_Blue=None
|
||||
ch_WeaponBar=None
|
||||
ch_EnemyNames=None
|
||||
ch_CustomColor=None
|
||||
co_CustomHUD=None
|
||||
b_CustomHUD=None
|
||||
}
|
||||
|
||||
118
kf_sources/KFGui/Classes/KFIAMultiColumnRulesPanel.uc
Normal file
118
kf_sources/KFGui/Classes/KFIAMultiColumnRulesPanel.uc
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
class KFIAMultiColumnRulesPanel extends IAMultiColumnRulesPanel;
|
||||
|
||||
var GUIController localController;
|
||||
|
||||
var automated GUISectionBackground sb_background;
|
||||
|
||||
delegate OnDifficultyChanged(int index, int tag);
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
localController = MyController;
|
||||
|
||||
Super.InitComponent(MyController, MyOwner);
|
||||
|
||||
RemoveComponent(b_Symbols);
|
||||
|
||||
//sb_background.ManageComponent(ch_Advanced);
|
||||
//ch_Advanced.Checked(true);
|
||||
sb_background.ManageComponent(lb_Rules);
|
||||
//ch_Advanced.SetVisibility(false);
|
||||
}
|
||||
|
||||
function UpdateSymbolButton()
|
||||
{
|
||||
b_Symbols=None;
|
||||
}
|
||||
|
||||
function InternalOnChange(GUIComponent Sender)
|
||||
{
|
||||
local moComboBox combo;
|
||||
|
||||
if (GUIMultiOptionList(Sender) != None)
|
||||
{
|
||||
if (Controller.bCurMenuInitialized)
|
||||
{
|
||||
combo = moComboBox(GUIMultiOptionList(Sender).Get());
|
||||
if (combo != none)
|
||||
OnDifficultyChanged(combo.getIndex(), combo.tag);
|
||||
}
|
||||
}
|
||||
|
||||
Super.InternalOnChange(Sender);
|
||||
}
|
||||
|
||||
function LoadRules()
|
||||
{
|
||||
local int i;
|
||||
|
||||
// Now settings in PlayInfo have been sorted by Group
|
||||
// We can now simply check if this setting's group is different from the last,
|
||||
// and if so, create a header for it.
|
||||
for (i = 0; i < InfoRules.Length; i++)
|
||||
{
|
||||
if ( InfoRules[i].DisplayName == "Monsters Config" )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( i == 0 || InfoRules[i].Grouping != InfoRules[i - 1].Grouping )
|
||||
{
|
||||
AddGroupHeader(i,li_Rules.Elements.Length == 0);
|
||||
}
|
||||
|
||||
// Now add the setting to the GUIMultiOptionList
|
||||
AddRule(InfoRules[i], i);
|
||||
}
|
||||
super(UT2K4PlayInfoPanel).LoadRules();
|
||||
|
||||
if ( GamePI != None )
|
||||
{
|
||||
i = GamePI.FindIndex("BotMode");
|
||||
if ( i != -1 )
|
||||
UpdateBotSetting(i);
|
||||
}
|
||||
|
||||
//UpdateAdvancedCheckbox();
|
||||
UpdateSymbolButton();
|
||||
}
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
|
||||
/*Begin Object Class=GUIImage Name=Bk1
|
||||
ImageStyle=ISTY_Stretched
|
||||
WinTop=0.014733
|
||||
WinLeft=0.000505
|
||||
WinWidth=0.996997
|
||||
WinHeight=0.907930
|
||||
End Object*/
|
||||
i_bk=none //GUIImage'ROInterface.ROIAMultiColumnRulesPanel.Bk1'
|
||||
|
||||
Begin Object Class=ROGUIProportionalContainer Name=myBackgroundGroup
|
||||
bNoCaption=true
|
||||
WinTop=0
|
||||
WinLeft=0
|
||||
WinWidth=1
|
||||
WinHeight=1
|
||||
End Object
|
||||
sb_background=myBackgroundGroup
|
||||
|
||||
Begin Object Class=moCheckBox Name=AdvancedButton
|
||||
OnChange=InternalOnChange
|
||||
Caption="View Advanced Options"
|
||||
Hint="Toggles whether advanced properties are displayed"
|
||||
WinWidth=0.35
|
||||
WinHeight=0.040000
|
||||
WinLeft=0.00
|
||||
WinTop=0.948334
|
||||
TabOrder=1
|
||||
RenderWeight=1.0
|
||||
bSquare=True
|
||||
bBoundToParent=True
|
||||
bScaleToParent=True
|
||||
bAutoSizeCaption=True
|
||||
bVisible=false
|
||||
End Object
|
||||
// ch_Advanced=AdvancedButton
|
||||
}
|
||||
22
kf_sources/KFGui/Classes/KFIndexedGUIImage.uc
Normal file
22
kf_sources/KFGui/Classes/KFIndexedGUIImage.uc
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
//=============================================================================
|
||||
// A GUIImage with an Index
|
||||
//=============================================================================
|
||||
// Killing Floor Source
|
||||
// Copyright (C) 2009 Tripwire Interactive LLC
|
||||
// Christian "schneidzekk" Schneider
|
||||
//=============================================================================
|
||||
class KFIndexedGUIImage extends GUIImage;
|
||||
|
||||
var int Index;
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
Index=0
|
||||
bAcceptsInput=true
|
||||
bCaptureMouse=True
|
||||
bNeverFocus=false
|
||||
bMouseOverSound=true
|
||||
OnClickSound=CS_Click
|
||||
|
||||
ToolTip=GUIButtonToolTip
|
||||
}
|
||||
93
kf_sources/KFGui/Classes/KFInputSettings.uc
Normal file
93
kf_sources/KFGui/Classes/KFInputSettings.uc
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
class KFInputSettings extends UT2K4Tab_IForceSettings;
|
||||
|
||||
event InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
super(Settings_Tabs).Initcomponent(MyController, MyOwner);
|
||||
|
||||
RemoveComponent(ch_WeaponEffects);
|
||||
RemoveComponent(ch_PickupEffects);
|
||||
RemoveComponent(ch_DamageEffects);
|
||||
RemoveComponent(ch_GUIEffects);
|
||||
RemoveComponent(fl_DodgeTime);
|
||||
RemoveComponent(b_Controls);
|
||||
RemoveComponent(b_Speech);
|
||||
|
||||
RemoveComponent(i_BG2);
|
||||
|
||||
i_BG1.ManageComponent(ch_AutoSlope);
|
||||
i_BG1.ManageComponent(ch_InvertMouse);
|
||||
i_BG1.ManageComponent(ch_MouseSmoothing);
|
||||
i_BG1.ManageComponent(ch_MouseLag);
|
||||
i_BG1.ManageComponent(ch_Joystick);
|
||||
|
||||
i_BG3.ManageComponent(fl_Sensitivity);
|
||||
i_BG3.ManageComponent(fl_MenuSensitivity);
|
||||
i_BG3.ManageComponent(fl_SmoothingStrength);
|
||||
i_BG3.ManageComponent(fl_MouseAccel);
|
||||
|
||||
// Disable force feedback options on non-win32 platforms... --ryan.
|
||||
if ( (!PlatformIsWindows()) || (PlatformIs64Bit()) )
|
||||
{
|
||||
ch_WeaponEffects.DisableMe();
|
||||
ch_PickupEffects.DisableMe();
|
||||
ch_DamageEffects.DisableMe();
|
||||
ch_GUIEffects.DisableMe();
|
||||
}
|
||||
}
|
||||
|
||||
function InternalOnLoadINI(GUIComponent Sender, string s)
|
||||
{
|
||||
local PlayerController player;
|
||||
player = PlayerOwner();
|
||||
switch (Sender)
|
||||
{
|
||||
case fl_Sensitivity:
|
||||
if (player != none)
|
||||
fSens = player.GetMouseSensitivity();
|
||||
else
|
||||
fSens = class'PlayerInput'.default.MouseSensitivity;
|
||||
fl_Sensitivity.SetComponentValue(fSens,true);
|
||||
break;
|
||||
|
||||
case fl_MouseAccel:
|
||||
if (player != none)
|
||||
fAccel = player.GetMouseAcceleration();
|
||||
else
|
||||
fAccel = class'PlayerInput'.Default.MouseAccelThreshold;
|
||||
fl_MouseAccel.SetComponentValue(fAccel,true);
|
||||
break;
|
||||
|
||||
case fl_SmoothingStrength:
|
||||
if (player != none)
|
||||
fSmoothing = player.GetMouseSmoothingStrength();
|
||||
else
|
||||
fSmoothing = class'PlayerInput'.Default.MouseSmoothingStrength;
|
||||
fl_SmoothingStrength.SetComponentValue(fSmoothing,true);
|
||||
break;
|
||||
|
||||
default:
|
||||
super.InternalOnLoadINI(Sender, s);
|
||||
}
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Begin Object class=GUISectionBackground Name=InputBK1
|
||||
WinWidth=0.381328
|
||||
WinHeight=0.5
|
||||
WinLeft=0.021641
|
||||
WinTop=0.15
|
||||
Caption="Options"
|
||||
End Object
|
||||
i_BG1=InputBK1
|
||||
|
||||
Begin Object class=GUISectionBackground Name=InputBK3
|
||||
WinWidth=0.527812
|
||||
WinHeight=0.4
|
||||
WinLeft=0.451289
|
||||
WinTop=0.15
|
||||
Caption="Fine Tuning"
|
||||
End Object
|
||||
i_BG3=InputBK3
|
||||
}
|
||||
|
||||
13
kf_sources/KFGui/Classes/KFInstantActionPage.uc
Normal file
13
kf_sources/KFGui/Classes/KFInstantActionPage.uc
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// ====================================================================
|
||||
// Class: XInterface.UT2InstantActionPage
|
||||
// Parent: XInterface.GUIPage
|
||||
//
|
||||
// <Enter a description here>
|
||||
// ====================================================================
|
||||
|
||||
class KFInstantActionPage extends UT2K4GamePageSP;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
PageCaption="Single Player"
|
||||
}
|
||||
169
kf_sources/KFGui/Classes/KFInvClassConfig.uc
Normal file
169
kf_sources/KFGui/Classes/KFInvClassConfig.uc
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
//==============================================================================
|
||||
// KFInvClassConfig
|
||||
//==============================================================================
|
||||
class KFInvClassConfig extends GUICustomPropertyPage;
|
||||
|
||||
var automated GUIImage i_Background;
|
||||
var automated GUIMultiOptionListBox lb_Waves;
|
||||
var GUIMultiOptionList li_waves;
|
||||
|
||||
var array<string> MonsterClasses;
|
||||
var array<moEditBox> MTxtBoxes;
|
||||
|
||||
var localized string MonsterClassConfigTitle;
|
||||
|
||||
function string GetResult()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
function InitActiveClasses()
|
||||
{
|
||||
local int i,l;
|
||||
|
||||
// Init monster table
|
||||
l = Class'KFGameType'.Default.MonsterClasses.Length;
|
||||
MonsterClasses.Length = l;
|
||||
For( i=0; i<l; i++ )
|
||||
MonsterClasses[i] = Class'KFGameType'.Default.MonsterClasses[i].MClassName;
|
||||
}
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
Super.InitComponent(MyController, MyOwner);
|
||||
|
||||
li_Waves = lb_Waves.List;
|
||||
li_Waves.OnChange = InternalOnChange;
|
||||
li_Waves.bDrawSelectionBorder = False;
|
||||
li_Waves.ItemPadding=0.15;
|
||||
li_Waves.ColumnWidth=0.95;
|
||||
li_Waves.bHotTrackSound = False;
|
||||
|
||||
sb_Main.ManageComponent(lb_Waves);
|
||||
sb_Main.LeftPadding=0;
|
||||
sb_Main.RightPadding=0;
|
||||
sb_Main.TopPadding=0.05;
|
||||
sb_Main.BottomPadding=0.05;
|
||||
sb_Main.SetPosition(0.030234,0.075000,0.851640,0.565624);
|
||||
}
|
||||
|
||||
function SetOwner( GUIComponent NewOwner )
|
||||
{
|
||||
Super.SetOwner(NewOwner);
|
||||
|
||||
t_WindowTitle.Caption = MonsterClassConfigTitle;
|
||||
InitActiveClasses();
|
||||
InitializeList();
|
||||
}
|
||||
|
||||
function InitializeList()
|
||||
{
|
||||
local int i;
|
||||
local moEditBox ch;
|
||||
|
||||
MTxtBoxes.Length = Max(MonsterClasses.Length,30);
|
||||
|
||||
For( i=0; i<MTxtBoxes.Length; i++ )
|
||||
{
|
||||
ch = moEditBox(li_Waves.AddItem( "XInterface.moEditBox",, "Monster"@GetIDName(i)));
|
||||
if ( ch != None )
|
||||
{
|
||||
MTxtBoxes[i] = ch;
|
||||
if( i<MonsterClasses.Length )
|
||||
ch.SetComponentValue(MonsterClasses[i],True);
|
||||
else ch.SetComponentValue("<Empty>",True);
|
||||
ch.bAutoSizeCaption = True;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function string GetIDName( int Num )
|
||||
{
|
||||
if( Num<26 )
|
||||
Return Chr(65+Num); // A-Z
|
||||
else Return Chr(71+Num); // a-z
|
||||
}
|
||||
|
||||
function string GetDataString()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
function InternalOnChange(GUIComponent Sender)
|
||||
{
|
||||
local GUIMenuOption mo;
|
||||
local int i;
|
||||
|
||||
if ( Sender == li_Waves )
|
||||
{
|
||||
mo = li_Waves.Get();
|
||||
|
||||
if ( moEditBox(mo)!=None )
|
||||
{
|
||||
for( i=0; i<MTxtBoxes.Length; i++ )
|
||||
{
|
||||
if( MTxtBoxes[i]==mo )
|
||||
{
|
||||
MonsterClasses[i] = MTxtBoxes[i].GetComponentValue();
|
||||
Break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
event Closed( GUIComponent Sender, bool bCancelled )
|
||||
{
|
||||
local int i;
|
||||
|
||||
if( bCancelled )
|
||||
Return;
|
||||
for( i=0; i<MonsterClasses.Length; i++ )
|
||||
{
|
||||
if( Len(MonsterClasses[i])==0 || MonsterClasses[i]=="<Empty>" || Class<Monster>(DynamicLoadObject(MonsterClasses[i],Class'Class'))==None )
|
||||
{
|
||||
MonsterClasses.Remove(i,1);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
Class'KFGameType'.Default.MonsterClasses.Length = MonsterClasses.Length;
|
||||
for( i=0; i<MonsterClasses.Length; i++ )
|
||||
{
|
||||
Class'KFGameType'.Default.MonsterClasses[i].MClassName = MonsterClasses[i];
|
||||
Class'KFGameType'.Default.MonsterClasses[i].MID = GetIDName(i);
|
||||
}
|
||||
Class'KFGameType'.Static.StaticSaveConfig();
|
||||
}
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
Begin Object Class=GUIMultiOptionListBox Name=WavesList
|
||||
NumColumns=1
|
||||
OnChange=InternalOnChange
|
||||
WinWidth=0.983750
|
||||
WinHeight=0.698149
|
||||
WinLeft=0.007500
|
||||
WinTop=0.150608
|
||||
TabOrder=1
|
||||
bVisibleWhenEmpty=True
|
||||
bBoundToParent=True
|
||||
bScaleToParent=True
|
||||
// StyleName="ServerBrowserGrid"
|
||||
End Object
|
||||
lb_Waves=WavesList
|
||||
|
||||
MonsterClassConfigTitle="Killing Floor Monster Classlist config page"
|
||||
|
||||
bDrawFocusedLast=False
|
||||
|
||||
WinWidth=0.9
|
||||
WinHeight=0.7
|
||||
WinLeft=0.05
|
||||
WinTop=0.15
|
||||
|
||||
|
||||
DefaultWidth=0.9
|
||||
DefaultHeight=0.7
|
||||
DefaultLeft=0.05
|
||||
DefaultTop=0.15
|
||||
}
|
||||
258
kf_sources/KFGui/Classes/KFInvSquadConfig.uc
Normal file
258
kf_sources/KFGui/Classes/KFInvSquadConfig.uc
Normal file
|
|
@ -0,0 +1,258 @@
|
|||
//==============================================================================
|
||||
// KFInvSquadConfig
|
||||
//==============================================================================
|
||||
class KFInvSquadConfig extends GUICustomPropertyPage;
|
||||
|
||||
var automated GUIImage i_Background;
|
||||
var automated moNumericEdit nu_Wave;
|
||||
var automated GUIMultiOptionListBox lb_Waves;
|
||||
var GUIMultiOptionList li_waves;
|
||||
|
||||
var localized string SquadConfigTitle;
|
||||
|
||||
struct WaveMonsterType
|
||||
{
|
||||
var string MName,MID;
|
||||
var moNumericEdit MonsterCount;
|
||||
};
|
||||
|
||||
var int ActiveSquad;
|
||||
var array<WaveMonsterType> SquadMonsters;
|
||||
struct WMCount
|
||||
{
|
||||
var array<int> MCount;
|
||||
};
|
||||
var array<WMCount> Squads;
|
||||
|
||||
function string GetResult()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
function InitActiveClasses()
|
||||
{
|
||||
local int i,l,j,c,z;
|
||||
local string S,ID;
|
||||
|
||||
// Init monster table
|
||||
l = Class'KFGameType'.default.MonsterCollection.Default.MonsterClasses.Length;
|
||||
SquadMonsters.Length = l;
|
||||
For( i=0; i<l; i++ )
|
||||
{
|
||||
SquadMonsters[i].MID = Class'KFGameType'.default.MonsterCollection.Default.MonsterClasses[i].MID;
|
||||
SquadMonsters[i].MName = GetMonsterName(Class'KFGameType'.default.MonsterCollection.Default.MonsterClasses[i].MClassName);
|
||||
}
|
||||
|
||||
// Init active squads on current settings
|
||||
z = Class'KFGameType'.Default.MonsterSquad.Length;
|
||||
Squads.Length = 31;
|
||||
For( i=0; i<z; i++ )
|
||||
{
|
||||
Squads[i].MCount.Length = l;
|
||||
S = Class'KFGameType'.Default.MonsterSquad[i];
|
||||
while( Len(S)>0 )
|
||||
{
|
||||
c = int(Left(S,1));
|
||||
ID = Mid(S,1,1);
|
||||
for( j=0; j<l; j++ )
|
||||
{
|
||||
if( SquadMonsters[j].MID==ID )
|
||||
{
|
||||
Squads[i].MCount[j] = c;
|
||||
Break;
|
||||
}
|
||||
}
|
||||
S = Mid(S,2);
|
||||
}
|
||||
}
|
||||
while( i<31 )
|
||||
{
|
||||
Squads[i].MCount.Length = l;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
function string GetMonsterName( string InS )
|
||||
{
|
||||
local Class<Monster> MC;
|
||||
|
||||
MC = Class<Monster>(DynamicLoadObject(InS,Class'Class'));
|
||||
if( MC==None )
|
||||
Return "Invalid";
|
||||
else if( MC.Default.MenuName!="" )
|
||||
Return MC.Default.MenuName;
|
||||
Return string(MC.Name);
|
||||
}
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
Super.InitComponent(MyController, MyOwner);
|
||||
|
||||
li_Waves = lb_Waves.List;
|
||||
li_Waves.OnChange = InternalOnChange;
|
||||
li_Waves.bDrawSelectionBorder = False;
|
||||
li_Waves.ItemPadding=0.15;
|
||||
li_Waves.ColumnWidth=0.95;
|
||||
li_Waves.bHotTrackSound = False;
|
||||
|
||||
sb_Main.ManageComponent(lb_Waves);
|
||||
sb_Main.LeftPadding=0;
|
||||
sb_Main.RightPadding=0;
|
||||
sb_Main.TopPadding=0.05;
|
||||
sb_Main.BottomPadding=0.05;
|
||||
sb_Main.SetPosition(0.030234,0.075000,0.851640,0.565624);
|
||||
}
|
||||
|
||||
function SetOwner( GUIComponent NewOwner )
|
||||
{
|
||||
Super.SetOwner(NewOwner);
|
||||
|
||||
t_WindowTitle.Caption = SquadConfigTitle;
|
||||
InitActiveClasses();
|
||||
InitializeList();
|
||||
}
|
||||
|
||||
function InitializeList()
|
||||
{
|
||||
local int i;
|
||||
local moNumericEdit ch;
|
||||
|
||||
For( i=0; i<SquadMonsters.Length; i++ )
|
||||
{
|
||||
ch = moNumericEdit(li_Waves.AddItem( "XInterface.moNumericEdit",, SquadMonsters[i].MName));
|
||||
if ( ch != None )
|
||||
{
|
||||
SquadMonsters[i].MonsterCount = ch;
|
||||
ch.Setup( 0, 9, 1 );
|
||||
ch.bAutoSizeCaption = True;
|
||||
}
|
||||
}
|
||||
|
||||
UpdateSquadValues();
|
||||
}
|
||||
|
||||
function string GetDataString()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
function InternalOnChange(GUIComponent Sender)
|
||||
{
|
||||
local GUIMenuOption mo;
|
||||
local int i;
|
||||
|
||||
if ( Sender == nu_Wave )
|
||||
{
|
||||
ActiveSquad = nu_Wave.GetValue();
|
||||
UpdateSquadValues();
|
||||
}
|
||||
else if ( Sender == li_Waves )
|
||||
{
|
||||
mo = li_Waves.Get();
|
||||
|
||||
if ( moNumericEdit(mo) != None )
|
||||
{
|
||||
for( i=0; i<SquadMonsters.Length; i++ )
|
||||
{
|
||||
if( SquadMonsters[i].MonsterCount==mo )
|
||||
{
|
||||
Squads[ActiveSquad].MCount[i] = SquadMonsters[i].MonsterCount.GetValue();
|
||||
Break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Called when the active wave has been changed - updates all components with the correct values
|
||||
function UpdateSquadValues()
|
||||
{
|
||||
local int i;
|
||||
|
||||
for( i=0; i<SquadMonsters.Length; i++ )
|
||||
SquadMonsters[i].MonsterCount.SetComponentValue( Squads[ActiveSquad].MCount[i], True );
|
||||
}
|
||||
|
||||
event Closed( GUIComponent Sender, bool bCancelled )
|
||||
{
|
||||
local array<string> AS;
|
||||
local int i,j,l,f;
|
||||
|
||||
if( bCancelled )
|
||||
Return;
|
||||
AS.Length = 31;
|
||||
l = SquadMonsters.Length;
|
||||
for( i=0; i<31; i++ )
|
||||
{
|
||||
for( j=0; j<l; j++ )
|
||||
{
|
||||
if( Squads[i].MCount[j]<=0 )
|
||||
continue;
|
||||
f = i;
|
||||
AS[i]$=Squads[i].MCount[j]$SquadMonsters[j].MID;
|
||||
}
|
||||
}
|
||||
// Clean up.
|
||||
for( i=0; i<AS.Length; i++ )
|
||||
{
|
||||
if( Len(AS[i])==0 )
|
||||
{
|
||||
AS.Remove(i,1);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
Class'KFGameType'.Default.MonsterSquad = AS;
|
||||
Class'KFGameType'.Static.StaticSaveConfig();
|
||||
}
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
Begin Object Class=moNumericEdit Name=WaveNumber
|
||||
Caption="Squad No."
|
||||
Hint="Select the squad you'd like to configure"
|
||||
WinWidth=0.220000
|
||||
WinHeight=0.042857
|
||||
WinLeft=0.407353
|
||||
WinTop=0.092990
|
||||
MinValue=0
|
||||
MaxValue=30
|
||||
CaptionWidth=0.1
|
||||
ComponentWidth=0.3
|
||||
bAutoSizeCaption=true
|
||||
ComponentJustification=TXTA_Center
|
||||
OnChange=InternalOnChange
|
||||
RenderWeight=0.7
|
||||
bBoundToParent=True
|
||||
bScaleToParent=True
|
||||
End Object
|
||||
nu_Wave=WaveNumber
|
||||
|
||||
Begin Object Class=GUIMultiOptionListBox Name=WavesList
|
||||
NumColumns=2
|
||||
OnChange=InternalOnChange
|
||||
WinWidth=0.983750
|
||||
WinHeight=0.698149
|
||||
WinLeft=0.007500
|
||||
WinTop=0.150608
|
||||
TabOrder=1
|
||||
bVisibleWhenEmpty=True
|
||||
bBoundToParent=True
|
||||
bScaleToParent=True
|
||||
// StyleName="ServerBrowserGrid"
|
||||
End Object
|
||||
lb_Waves=WavesList
|
||||
|
||||
SquadConfigTitle="Killing Floor Squad config page"
|
||||
|
||||
bDrawFocusedLast=False
|
||||
|
||||
WinWidth=0.9
|
||||
WinHeight=0.7
|
||||
WinLeft=0.05
|
||||
WinTop=0.15
|
||||
|
||||
|
||||
DefaultWidth=0.9
|
||||
DefaultHeight=0.7
|
||||
DefaultLeft=0.05
|
||||
DefaultTop=0.15
|
||||
}
|
||||
284
kf_sources/KFGui/Classes/KFInvWaveConfig.uc
Normal file
284
kf_sources/KFGui/Classes/KFInvWaveConfig.uc
Normal file
|
|
@ -0,0 +1,284 @@
|
|||
//==============================================================================
|
||||
// KFInvWaveConfig
|
||||
//==============================================================================
|
||||
class KFInvWaveConfig extends GUICustomPropertyPage;
|
||||
|
||||
var array<string> Waves;
|
||||
|
||||
var automated GUIImage i_Background;
|
||||
var automated moNumericEdit nu_Wave;
|
||||
var automated GUIMultiOptionListBox lb_Waves;
|
||||
var GUIMultiOptionList li_waves;
|
||||
|
||||
var localized string WaveConfigTitle;
|
||||
var localized string DiffHint, MaxInvaderHint;
|
||||
|
||||
struct WaveSquadType
|
||||
{
|
||||
var string SName;
|
||||
var int Mask;
|
||||
var moCheckBox CheckButton;
|
||||
};
|
||||
|
||||
var int ActiveWave; // Wave currently being edited
|
||||
var array<WaveSquadType> WaveSquad;
|
||||
var Invasion.WaveInfo EditedWaves[16];
|
||||
|
||||
var moSlider sl_Diff;
|
||||
var moNumericEdit nu_MaxMonster;
|
||||
|
||||
function string GetResult()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
function InitActiveSquads()
|
||||
{
|
||||
local int i,l,m,j,z,n;
|
||||
local byte c;
|
||||
local array<string> AS;
|
||||
local string S;
|
||||
|
||||
AS = Class'KFGameType'.Default.MonsterSquad;
|
||||
l = AS.Length;
|
||||
WaveSquad.Length = l;
|
||||
m = 1;
|
||||
z = Class'KFGameType'.default.MonsterCollection.Default.MonsterClasses.Length;
|
||||
For( i=0; i<l; i++ )
|
||||
{
|
||||
WaveSquad[i].Mask = m;
|
||||
m*=2;
|
||||
c = 0;
|
||||
while( Len(AS[i])>1 )
|
||||
{
|
||||
S = Mid(AS[i],1,1);
|
||||
n = int(Left(AS[i],1));
|
||||
AS[i] = Mid(AS[i],2);
|
||||
for( j=0; j<z; j++ )
|
||||
{
|
||||
if( Class'KFGameType'.default.MonsterCollection.Default.MonsterClasses[j].MID==S )
|
||||
{
|
||||
S = n$":"$GetMonsterName(Class'KFGameType'.default.MonsterCollection.Default.MonsterClasses[j].MClassName);
|
||||
if( Len(S)==0 )
|
||||
Break;
|
||||
if( c++==0 )
|
||||
WaveSquad[i].SName$=S;
|
||||
else WaveSquad[i].SName$=","$S;
|
||||
}
|
||||
}
|
||||
if( Len(WaveSquad[i].SName)>75 )
|
||||
{
|
||||
WaveSquad[i].SName$="...";
|
||||
Break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function string GetMonsterName( string InS )
|
||||
{
|
||||
local Class<Monster> MC;
|
||||
|
||||
MC = Class<Monster>(DynamicLoadObject(InS,Class'Class'));
|
||||
if( MC==None )
|
||||
Return "Invalid";
|
||||
else if( MC.Default.MenuName!="" )
|
||||
Return MC.Default.MenuName;
|
||||
Return string(MC.Name);
|
||||
}
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
local int i;
|
||||
|
||||
Super.InitComponent(MyController, MyOwner);
|
||||
|
||||
li_Waves = lb_Waves.List;
|
||||
li_Waves.OnChange = InternalOnChange;
|
||||
li_Waves.bDrawSelectionBorder = False;
|
||||
li_Waves.ItemPadding=0.15;
|
||||
li_Waves.ColumnWidth=0.95;
|
||||
li_Waves.bHotTrackSound = False;
|
||||
|
||||
sl_Diff = moSlider(li_Waves.AddItem( "XInterface.moSlider", None, "Difficulty", true ));
|
||||
nu_MaxMonster = moNumericEdit(li_Waves.AddItem( "XInterface.moNumericEdit", None, "Number of monsters (X players count)", true ));
|
||||
|
||||
sl_Diff.Hint = DiffHint;
|
||||
nu_MaxMonster.Hint=MaxInvaderHint;
|
||||
|
||||
for ( i = 0; i < li_Waves.NumColumns; i++ )
|
||||
li_Waves.AddItem( "XInterface.GUIListSpacer" );
|
||||
for( i=0; i<ArrayCount(EditedWaves); i++ )
|
||||
EditedWaves[i] = Class'KFGameType'.Default.Waves[i];
|
||||
|
||||
sb_Main.ManageComponent(lb_Waves);
|
||||
sb_Main.LeftPadding=0;
|
||||
sb_Main.RightPadding=0;
|
||||
sb_Main.TopPadding=0.05;
|
||||
sb_Main.BottomPadding=0.05;
|
||||
sb_Main.SetPosition(0.030234,0.075000,0.851640,0.565624);
|
||||
|
||||
InitWaveControls();
|
||||
}
|
||||
|
||||
function InitWaveControls()
|
||||
{
|
||||
InitDifficulty();
|
||||
InitMaxMonsters();
|
||||
}
|
||||
|
||||
function InitDifficulty()
|
||||
{
|
||||
sl_Diff.Setup( 0.0, 3.0 );
|
||||
sl_Diff.CaptionWidth = 0.1;
|
||||
sl_Diff.ComponentWidth = -1;
|
||||
sl_Diff.bAutoSizeCaption = true;
|
||||
sl_Diff.ComponentJustification = TXTA_Left;
|
||||
}
|
||||
|
||||
function InitMaxMonsters()
|
||||
{
|
||||
nu_MaxMonster.Setup( 1, 500, 1 );
|
||||
nu_MaxMonster.CaptionWidth = 0.1;
|
||||
nu_MaxMonster.ComponentWidth = 0.3;
|
||||
nu_MaxMonster.bAutoSizeCaption = true;
|
||||
nu_MaxMonster.ComponentJustification = TXTA_Center;
|
||||
}
|
||||
|
||||
function SetOwner( GUIComponent NewOwner )
|
||||
{
|
||||
Super.SetOwner(NewOwner);
|
||||
|
||||
t_WindowTitle.Caption = WaveConfigTitle;
|
||||
InitActiveSquads();
|
||||
InitializeList();
|
||||
}
|
||||
|
||||
function InitializeList()
|
||||
{
|
||||
local int i;
|
||||
local moCheckBox ch;
|
||||
|
||||
for ( i = 0; i<WaveSquad.Length; i++ )
|
||||
{
|
||||
ch = moCheckbox(li_Waves.AddItem( "XInterface.moCheckbox",, WaveSquad[i].SName ));
|
||||
if ( ch != None )
|
||||
{
|
||||
WaveSquad[i].CheckButton = ch;
|
||||
ch.Tag = WaveSquad[i].Mask;
|
||||
ch.bAutoSizeCaption = True;
|
||||
}
|
||||
}
|
||||
|
||||
UpdateWaveValues();
|
||||
}
|
||||
|
||||
function string GetDataString()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
function InternalOnChange(GUIComponent Sender)
|
||||
{
|
||||
local GUIMenuOption mo;
|
||||
|
||||
if ( Sender == nu_Wave )
|
||||
{
|
||||
ActiveWave = nu_Wave.GetValue();
|
||||
UpdateWaveValues();
|
||||
}
|
||||
else if ( Sender == li_Waves )
|
||||
{
|
||||
mo = li_Waves.Get();
|
||||
|
||||
if ( mo == sl_Diff )
|
||||
EditedWaves[ActiveWave].WaveDifficulty = sl_Diff.GetValue();
|
||||
else if ( mo == nu_MaxMonster )
|
||||
EditedWaves[ActiveWave].WaveMaxMonsters = nu_MaxMonster.GetValue();
|
||||
|
||||
if ( moCheckBox(mo) != None )
|
||||
{
|
||||
if ( moCheckbox(mo).IsChecked() )
|
||||
EditedWaves[ActiveWave].WaveMask = EditedWaves[ActiveWave].WaveMask | mo.Tag;
|
||||
else EditedWaves[ActiveWave].WaveMask = EditedWaves[ActiveWave].WaveMask & ~mo.Tag;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Called when the active wave has been changed - updates all components with the correct values
|
||||
function UpdateWaveValues()
|
||||
{
|
||||
local int i;
|
||||
|
||||
sl_Diff.SetComponentValue( EditedWaves[ActiveWave].WaveDifficulty, true );
|
||||
nu_MaxMonster.SetComponentValue( EditedWaves[ActiveWave].WaveMaxMonsters, True );
|
||||
|
||||
for ( i=0; i<WaveSquad.Length; i++ )
|
||||
WaveSquad[i].CheckButton.SetComponentValue( EditedWaves[ActiveWave].WaveMask & WaveSquad[i].CheckButton.Tag, True );
|
||||
}
|
||||
|
||||
event Closed( GUIComponent Sender, bool bCancelled )
|
||||
{
|
||||
local byte i;
|
||||
|
||||
if( bCancelled )
|
||||
Return;
|
||||
for( i=0; i<ArrayCount(EditedWaves); i++ )
|
||||
Class'KFGameType'.Default.Waves[i] = EditedWaves[i];
|
||||
Class'KFGameType'.Static.StaticSaveConfig();
|
||||
}
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
Begin Object Class=moNumericEdit Name=WaveNumber
|
||||
Caption="Wave No."
|
||||
Hint="Select the wave you'd like to configure"
|
||||
WinWidth=0.220000
|
||||
WinHeight=0.042857
|
||||
WinLeft=0.407353
|
||||
WinTop=0.092990
|
||||
MinValue=0
|
||||
MaxValue=15
|
||||
CaptionWidth=0.1
|
||||
ComponentWidth=0.3
|
||||
bAutoSizeCaption=true
|
||||
ComponentJustification=TXTA_Center
|
||||
OnChange=InternalOnChange
|
||||
RenderWeight=0.7
|
||||
bBoundToParent=True
|
||||
bScaleToParent=True
|
||||
End Object
|
||||
nu_Wave=WaveNumber
|
||||
|
||||
Begin Object Class=GUIMultiOptionListBox Name=WavesList
|
||||
NumColumns=1
|
||||
OnChange=InternalOnChange
|
||||
WinWidth=0.983750
|
||||
WinHeight=0.698149
|
||||
WinLeft=0.007500
|
||||
WinTop=0.150608
|
||||
TabOrder=1
|
||||
bVisibleWhenEmpty=True
|
||||
bBoundToParent=True
|
||||
bScaleToParent=True
|
||||
// StyleName="ServerBrowserGrid"
|
||||
End Object
|
||||
lb_Waves=WavesList
|
||||
|
||||
WaveConfigTitle="Killing Floor Wave config page"
|
||||
|
||||
bDrawFocusedLast=False
|
||||
|
||||
WinWidth=0.9
|
||||
WinHeight=0.7
|
||||
WinLeft=0.05
|
||||
WinTop=0.15
|
||||
|
||||
|
||||
DefaultWidth=0.9
|
||||
DefaultHeight=0.7
|
||||
DefaultLeft=0.05
|
||||
DefaultTop=0.15
|
||||
|
||||
DiffHint="How hard should this wave be."
|
||||
MaxInvaderHint="What is the maximum number of monsters to spawn for this wave."
|
||||
}
|
||||
95
kf_sources/KFGui/Classes/KFInvasionLoginMenu.uc
Normal file
95
kf_sources/KFGui/Classes/KFInvasionLoginMenu.uc
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
class KFInvasionLoginMenu extends UT2K4PlayerLoginMenu;
|
||||
|
||||
var bool bNoSteam;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyComponent)
|
||||
{
|
||||
local PlayerController PC;
|
||||
local int i;
|
||||
|
||||
Super.InitComponent(MyController, MyComponent);
|
||||
|
||||
// Remove Perks tab if Perks aren't enabled
|
||||
PC = PlayerOwner();
|
||||
if ( !MyController.CheckSteam() || PC == none || KFGameReplicationInfo(PC.Level.GRI) == none )
|
||||
{
|
||||
c_Main.RemoveTab(Panels[1].Caption);
|
||||
c_Main.ActivateTabByName(Panels[2].Caption, true);
|
||||
bNoSteam = true;
|
||||
}
|
||||
else if ( PC.SteamStatsAndAchievements == none )
|
||||
{
|
||||
if ( PC.Level.NetMode != NM_Client )
|
||||
{
|
||||
PC.SteamStatsAndAchievements = PC.Spawn(PC.default.SteamStatsAndAchievementsClass, PC);
|
||||
if ( !PC.SteamStatsAndAchievements.Initialize(PC) )
|
||||
{
|
||||
PC.SteamStatsAndAchievements.Destroy();
|
||||
PC.SteamStatsAndAchievements = none;
|
||||
}
|
||||
}
|
||||
|
||||
c_Main.RemoveTab(Panels[1].Caption);
|
||||
c_Main.ActivateTabByName(Panels[2].Caption, true);
|
||||
bNoSteam = true;
|
||||
}
|
||||
else if ( !PC.SteamStatsAndAchievements.bInitialized )
|
||||
{
|
||||
PC.SteamStatsAndAchievements.GetStatsAndAchievements();
|
||||
c_Main.RemoveTab(Panels[1].Caption);
|
||||
c_Main.ActivateTabByName(Panels[2].Caption, true);
|
||||
bNoSteam = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( i = 0; i < class'KFGameType'.default.LoadedSkills.Length; i++ )
|
||||
{
|
||||
if ( KFSteamStatsAndAchievements(PC.SteamStatsAndAchievements).GetPerkProgress(i) < 0.0 )
|
||||
{
|
||||
PC.SteamStatsAndAchievements.GetStatsAndAchievements();
|
||||
c_Main.RemoveTab(Panels[1].Caption);
|
||||
c_Main.ActivateTabByName(Panels[2].Caption, true);
|
||||
bNoSteam = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
c_Main.RemoveTab(Panels[0].Caption);
|
||||
if ( !bNoSteam )
|
||||
{
|
||||
c_Main.ActivateTabByName(Panels[1].Caption, true);
|
||||
}
|
||||
}
|
||||
|
||||
// Overridden to stop the unnecessary removal of Panels
|
||||
function RemoveMultiplayerTabs(GameInfo Game)
|
||||
{
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Panels(0)=(ClassName="KFGUI.KFLoginControls")
|
||||
Panels(1)=(ClassName="KFGUI.KFTab_MidGamePerks",Caption="Perks",Hint="Select your current Perk")
|
||||
Panels(2)=(ClassName="KFGUI.KFTab_MidGameVoiceChat",Caption="Communication",Hint="Manage communication with other players")
|
||||
Panels(3)=(ClassName="KFGUI.KFTab_MidGameHelp",Caption="Help",Hint="How to survive in Killing Floor")
|
||||
Panels(4)=none
|
||||
|
||||
WinWidth=0.814844
|
||||
WinHeight=0.990311
|
||||
WinLeft=0.110313
|
||||
WinTop=0.006158
|
||||
|
||||
Begin Object Class=GUITabControl Name=LoginMenuTC
|
||||
WinWidth=0.974999
|
||||
WinHeight=0.050000
|
||||
WinLeft=0.012500
|
||||
WinTop=0.026336
|
||||
TabHeight=0.035000
|
||||
bAcceptsInput=true
|
||||
bDockPanels=true
|
||||
bScaleToParent=true
|
||||
bFillSpace=False
|
||||
BackgroundStyleName="TabBackground"
|
||||
End Object
|
||||
c_Main=LoginMenuTC
|
||||
}
|
||||
19
kf_sources/KFGui/Classes/KFKeyBindings.uc
Normal file
19
kf_sources/KFGui/Classes/KFKeyBindings.uc
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
class KFKeyBindings extends GUIUserKeyBinding;
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
KeyData(0)=(KeyLabel="Killing Floor",bIsSection=True)
|
||||
KeyData(1)=(Alias="ReloadWeapon",KeyLabel="Reload Weapon")
|
||||
//KeyData(2)=(Alias="ToggleTorch",KeyLabel="Toggle Torch")
|
||||
KeyData(2)=(Alias="ThrowNade",KeyLabel="Throw Grenade")
|
||||
KeyData(3)=(Alias="ShoutSupport",KeyLabel="Shout: Need Support")
|
||||
KeyData(4)=(Alias="ShoutFormUp",KeyLabel="Shout: Form Up On Me")
|
||||
KeyData(5)=(Alias="ShoutTakeThis",KeyLabel="Shout: Take This")
|
||||
KeyData(6)=(Alias="ShoutTrading",KeyLabel="Shout: I'm Going Trading")
|
||||
KeyData(7)=(Alias="ShoutMedic",KeyLabel="Shout: MEDIC!")
|
||||
KeyData(8)=(Alias="ShoutWelding",KeyLabel="I'm Welding")
|
||||
KeyData(9)=(Alias="ShoutCovering",KeyLabel="I'll Cover You")
|
||||
KeyData(10)=(Alias="Aiming",KeyLabel="Aiming")
|
||||
KeyData(11)=(Alias="ToggleAiming",KeyLabel="Toggle Aiming")
|
||||
KeyData(12)=(Alias="QuickHeal",KeyLabel="Quick Self-Heal")
|
||||
}
|
||||
288
kf_sources/KFGui/Classes/KFLobbyChat.uc
Normal file
288
kf_sources/KFGui/Classes/KFLobbyChat.uc
Normal file
|
|
@ -0,0 +1,288 @@
|
|||
// Custom Chatbox for the Lobby GUI : Alex
|
||||
|
||||
class KFLobbyChat extends FloatingWindow;
|
||||
|
||||
var automated GUISectionBackground sB_Main;
|
||||
var automated moEditBox eb_Send;
|
||||
var automated GUIScrollTextBox lb_Chat;
|
||||
var bool bVoiceRepeat;
|
||||
|
||||
var() editinline array<byte> CloseKey;
|
||||
var() editinlinenotify color TextColor[3];
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
local int i;
|
||||
local PlayerController PC;
|
||||
local ExtendedConsole MyConsole;
|
||||
|
||||
Super(PopupPageBase).InitComponent( MyController, MyOwner );
|
||||
|
||||
PC = PlayerOwner();
|
||||
TextColor[0] = class'SayMessagePlus'.default.RedTeamColor;
|
||||
TextColor[1] = class'SayMessagePlus'.default.BlueTeamColor;
|
||||
TextColor[2] = class'SayMessagePlus'.default.DrawColor;
|
||||
|
||||
eb_Send.MyEditBox.OnKeyEvent = InternalOnKeyEvent;
|
||||
lb_Chat.MyScrollText.bNeverFocus=true;
|
||||
|
||||
MyConsole = ExtendedConsole(PC.Player.Console);
|
||||
if (MyConsole==None)
|
||||
return;
|
||||
|
||||
MyConsole.OnChat = HandleChat;
|
||||
for (i=0;i<MyConsole.ChatMessages.Length;i++)
|
||||
{
|
||||
if ( !MyConsole.bTeamChatOnly || PC.PlayerReplicationInfo == None || PC.PlayerReplicationInfo.Team == None
|
||||
|| MyConsole.ChatMessages[i].Team == PC.PlayerReplicationInfo.Team.TeamIndex )
|
||||
HandleChat(MyConsole.ChatMessages[i].Message, MyConsole.ChatMessages[i].Team);
|
||||
}
|
||||
}
|
||||
|
||||
event Opened(GUIComponent Sender)
|
||||
{
|
||||
local int i;
|
||||
local string KeyName;
|
||||
local array<string> KeyNames;
|
||||
local PlayerController PC;
|
||||
|
||||
Super.Opened(Sender);
|
||||
PC = PlayerOwner();
|
||||
|
||||
CloseKey.Remove(0, CloseKey.Length);
|
||||
KeyName = PC.ConsoleCommand("BINDINGTOKEY InGameChat");
|
||||
Split(KeyName, ",", KeyNames);
|
||||
for ( i = 0; i < KeyNames.Length; i++ )
|
||||
CloseKey[CloseKey.Length] = byte(PC.ConsoleCommand("KEYNUMBER"@KeyNames[i]));
|
||||
|
||||
// Advance the cursor position to the end of the text
|
||||
lb_Chat.MyScrollText.End();
|
||||
|
||||
FocusFirst(None);
|
||||
}
|
||||
|
||||
function HandleChat(string Msg, int TeamIndex)
|
||||
{
|
||||
local int i;
|
||||
local string str;
|
||||
|
||||
i = InStr( Msg, ":" );
|
||||
if ( TeamIndex < 2 && i != -1 )
|
||||
{
|
||||
str = MakeColorCode(TextColor[TeamIndex]) $ Left(Msg, i) $
|
||||
MakeColorCode(TextColor[2]) $ ":" $ Mid(Msg, i+1);
|
||||
}
|
||||
else str = MakeColorCode(TextColor[2]) $ Msg;
|
||||
lb_chat.AddText( str );
|
||||
}
|
||||
|
||||
function bool InternalOnKeyEvent(out byte Key, out byte State, float delta)
|
||||
{
|
||||
local string cmd;
|
||||
local int i;
|
||||
local bool bVoiceChatKey;
|
||||
local array<string> BindKeyNames, LocalizedBindKeyNames;
|
||||
local string TempString;
|
||||
|
||||
Controller.GetAssignedKeys( "VoiceTalk", BindKeyNames, LocalizedBindKeyNames );
|
||||
|
||||
for ( i = 0; i < BindKeyNames.Length; i++ )
|
||||
{
|
||||
if ( Mid( GetEnum(enum'EInputKey', Key), 3 ) ~= BindKeyNames[i] )
|
||||
{
|
||||
bVoiceChatKey = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( bVoiceChatKey )
|
||||
{
|
||||
if ( bVoiceRepeat )
|
||||
{
|
||||
TempString = left(eb_send.MyEditBox.TextStr, len(eb_send.MyEditBox.TextStr) - 1);
|
||||
}
|
||||
|
||||
if ( State == 1 )
|
||||
{
|
||||
if ( PlayerOwner() != none )
|
||||
{
|
||||
PlayerOwner().bVoiceTalk = 1;
|
||||
|
||||
if ( bVoiceRepeat )
|
||||
{
|
||||
eb_send.MyEditBox.TextStr = TempString;
|
||||
eb_send.MyEditBox.CaretPos = len(eb_send.MyEditBox.TextStr);
|
||||
}
|
||||
|
||||
bVoiceRepeat = true;
|
||||
|
||||
return True;
|
||||
}
|
||||
}
|
||||
else if ( State == 2 )
|
||||
{
|
||||
if ( PlayerOwner() != none )
|
||||
{
|
||||
PlayerOwner().bVoiceTalk = 1;
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
bVoiceRepeat = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( PlayerOwner() != none )
|
||||
{
|
||||
PlayerOwner().bVoiceTalk = 0;
|
||||
}
|
||||
|
||||
bVoiceRepeat = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( state == 1 )
|
||||
{
|
||||
for ( i = 0; i < CloseKey.Length; i++ )
|
||||
{
|
||||
if ( Key == CloseKey[i] )
|
||||
{
|
||||
Controller.CloseMenu(false);
|
||||
return True;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( state == 3 )
|
||||
{
|
||||
if ( Key == 0x0D )
|
||||
{
|
||||
cmd = eb_Send.GetText();
|
||||
|
||||
if ( cmd == "" )
|
||||
{
|
||||
return True;
|
||||
}
|
||||
|
||||
if ( Left(cmd, 1) == "/" )
|
||||
{
|
||||
cmd = Mid(cmd, 1);
|
||||
}
|
||||
else if ( Left(cmd, 1) == "." )
|
||||
{
|
||||
cmd = "teamsay" @ Mid( cmd, 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
cmd = "say" @ cmd;
|
||||
}
|
||||
|
||||
PlayerOwner().ConsoleCommand(cmd);
|
||||
eb_Send.SetText("");
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return eb_Send.MyEditBox.InternalOnKeyEvent(key,state,delta);
|
||||
}
|
||||
|
||||
function InternalOnCreateComponent( GUIComponent NewComp, GUIComponent Sender )
|
||||
{
|
||||
if ( NewComp != eb_Send )
|
||||
NewComp.bNeverFocus = True;
|
||||
|
||||
Super.InternalOnCreateComponent(NewComp,Sender);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Begin Object Class=moEditBox Name=ebSend
|
||||
CaptionWidth=0.100000
|
||||
Caption="Say: "
|
||||
OnCreateComponent=ebSend.InternalOnCreateComponent
|
||||
Hint="Prefix a message with a dot (.) to send a team message or a slash (/) to send a command."
|
||||
WinWidth=0.92
|
||||
WinHeight=0.060000
|
||||
WinLeft=0.044128
|
||||
WinTop=0.973152
|
||||
TabOrder=0
|
||||
bBoundToParent=True
|
||||
bScaleToParent=True
|
||||
ToolTip=none
|
||||
End Object
|
||||
eb_Send=moEditBox'KFGui.KFLobbyChat.ebSend'
|
||||
|
||||
Begin Object Class=AltSectionBackground Name=sbMain
|
||||
bFillClient=True
|
||||
LeftPadding=0.000000
|
||||
RightPadding=0.000000
|
||||
StyleName="none"
|
||||
WinHeight=0.000000
|
||||
bBoundToParent=True
|
||||
bScaleToParent=True
|
||||
bNeverFocus=True
|
||||
OnPreDraw=sbMain.InternalPreDraw
|
||||
ToolTip=none
|
||||
End Object
|
||||
|
||||
sb_Main=none//AltSectionBackground'KFGui.KFLobbyChat.sbMain'
|
||||
|
||||
Begin Object Class=GUIScrollTextBox Name=lbChat
|
||||
bNoTeletype=True
|
||||
CharDelay=0.002500
|
||||
EOLDelay=0.000000
|
||||
Separator="þ"
|
||||
OnCreateComponent=lbChat.InternalOnCreateComponent
|
||||
FontScale=FNS_Small
|
||||
WinTop=0
|
||||
WinHeight=0
|
||||
Winwidth=0
|
||||
bBoundToParent=True
|
||||
bScaleToParent=True
|
||||
bNeverFocus=True
|
||||
StyleName="none"
|
||||
ToolTip=none
|
||||
End Object
|
||||
lb_Chat=GUIScrollTextBox'KFGui.KFLobbyChat.lbChat'
|
||||
|
||||
|
||||
Begin Object Class=GUIHeader Name=TitleBar
|
||||
bUseTextHeight=True
|
||||
//StyleName="NoBackground"
|
||||
WinWidth=0.000000
|
||||
WinHeight=0.000000
|
||||
RenderWeight=0.0100000
|
||||
bBoundToParent=True
|
||||
bScaleToParent=True
|
||||
bVisible=False
|
||||
bAcceptsInput=false
|
||||
bNeverFocus=False
|
||||
ScalingType=SCALE_X
|
||||
ToolTip=none
|
||||
End Object
|
||||
t_WindowTitle=TitleBar
|
||||
|
||||
|
||||
ToolTip=none
|
||||
WindowName=""
|
||||
bMoveAllowed=False
|
||||
DefaultLeft=0.025000
|
||||
DefaultTop=0.460000
|
||||
DefaultWidth=0.400000
|
||||
DefaultHeight=0.0500000
|
||||
WinTop=0.430000
|
||||
WinLeft=0.025000
|
||||
WinWidth=0.400000
|
||||
WinHeight=0.0500000
|
||||
|
||||
bRenderWorld=true
|
||||
bRequire640x480=false
|
||||
bAllowedAsLast=true
|
||||
|
||||
bResizeWidthAllowed=False
|
||||
bResizeHeightAllowed=false
|
||||
bPersistent=True
|
||||
|
||||
i_FrameBG = none
|
||||
}
|
||||
48
kf_sources/KFGui/Classes/KFLobbyTitleLabel.uc
Normal file
48
kf_sources/KFGui/Classes/KFLobbyTitleLabel.uc
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
//By: Alex (AND PROUD OF IT. THIS TOOK ALL DAY) >:(
|
||||
// ONLY TO LATER COMMENT IT ALL OUT IN FAVOR OF DOING THINGS FROM THE LOBBY CLASS :-/
|
||||
class KFLobbyTitleLabel extends GUILabel;
|
||||
|
||||
//var() localized String MapName;
|
||||
//var localized string SkillLevel[8];
|
||||
//var String SkillString;
|
||||
|
||||
/*
|
||||
function SetCaption( string NewCaption )
|
||||
{
|
||||
Caption = GetMapName(Caption);
|
||||
}
|
||||
|
||||
|
||||
function String GetMapName(string TitleName)
|
||||
{
|
||||
local class <KFScoreBoard> KFScoreBoardType;
|
||||
local KFScoreBoard A;
|
||||
|
||||
if (PlayerOwner().Level.Game!=None)
|
||||
{
|
||||
//if (SkillString == "" && PlayerOwner().Level.Game.ScoreBoardType != "")
|
||||
if (PlayerOwner().Level.Game.ScoreBoardType != "")
|
||||
{
|
||||
KFScoreBoardType = class<KFScoreBoard>(DynamicLoadObject(PlayerOwner().Level.Game.ScoreBoardType, class'Class'));
|
||||
A = PlayerOwner().Spawn(KFScoreBoardType);
|
||||
// SkillString = A.SkillLevel[Clamp(KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).BaseDifficulty,0,7)];
|
||||
|
||||
}
|
||||
|
||||
if (KFGameReplicationInfo(PlayerOwner().GameReplicationInfo) != none)
|
||||
{
|
||||
|
||||
// return SkillText@KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).GameName$" on "$PlayerOwner().Level.Title;
|
||||
return A.SkillLevel[Clamp(KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).BaseDifficulty,0,7)]@KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).GameName$" on "$PlayerOwner().Level.Title;
|
||||
A.Destroy();
|
||||
}
|
||||
else
|
||||
return "Killing Floor";
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
}
|
||||
1152
kf_sources/KFGui/Classes/KFLoginControls.uc
Normal file
1152
kf_sources/KFGui/Classes/KFLoginControls.uc
Normal file
File diff suppressed because it is too large
Load diff
231
kf_sources/KFGui/Classes/KFMOTD.uc
Normal file
231
kf_sources/KFGui/Classes/KFMOTD.uc
Normal file
|
|
@ -0,0 +1,231 @@
|
|||
class KFMOTD extends UT2K4Browser_MOTD;
|
||||
|
||||
var String myMOTD;
|
||||
|
||||
var String getRequest;
|
||||
var String getResponse;
|
||||
var String newsIPAddr;
|
||||
var int myRetryCount;
|
||||
var int myRetryMax;
|
||||
|
||||
var ROBufferedTCPLink myLink;
|
||||
var string LinkClassName;
|
||||
var bool sendGet;
|
||||
var bool pageWait;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
super.InitComponent(MyController, MyOwner);
|
||||
|
||||
GetNewNews();
|
||||
lb_MOTD.MyScrollText.SetContent(myMOTD);
|
||||
}
|
||||
|
||||
event Opened(GUIComponent Sender)
|
||||
{
|
||||
l_Version.Caption = VersionString@PlayerOwner().Level.ROVersion;
|
||||
|
||||
super(Ut2k4Browser_Page).Opened(Sender);
|
||||
}
|
||||
|
||||
protected function ROBufferedTCPLink CreateNewLink()
|
||||
{
|
||||
local class<ROBufferedTCPLink> NewLinkClass;
|
||||
local ROBufferedTCPLink NewLink;
|
||||
|
||||
if ( PlayerOwner() == None )
|
||||
return None;
|
||||
|
||||
if ( LinkClassName != "" )
|
||||
{
|
||||
NewLinkClass = class<ROBufferedTCPLink>(DynamicLoadObject( LinkClassName, class'Class'));
|
||||
}
|
||||
if ( NewLinkClass != None )
|
||||
{
|
||||
NewLink = PlayerOwner().Spawn( NewLinkClass );
|
||||
}
|
||||
|
||||
NewLink.ResetBuffer();
|
||||
|
||||
return NewLink;
|
||||
}
|
||||
|
||||
|
||||
function ReceivedMOTD(MasterServerClient.EMOTDResponse Command, string Data)
|
||||
{
|
||||
}
|
||||
|
||||
function GetNewNews()
|
||||
{
|
||||
if(myLink == None)
|
||||
{
|
||||
myLink = CreateNewLink();
|
||||
}
|
||||
|
||||
if(myLink != None)
|
||||
{
|
||||
myLink.ServerIpAddr.Port = 0;
|
||||
|
||||
sendGet = true;
|
||||
myLink.Resolve(newsIPAddr); // NOTE: This is a non-blocking operation
|
||||
|
||||
SetTimer(ReReadyPause, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
myMOTD = myMOTD$"|| myLink is None";
|
||||
}
|
||||
}
|
||||
|
||||
event Timer()
|
||||
{
|
||||
local string text;
|
||||
local string page;
|
||||
local string command;
|
||||
|
||||
|
||||
if(myLink != None)
|
||||
{
|
||||
if ( myLink.ServerIpAddr.Port != 0)
|
||||
{
|
||||
if(myLink.IsConnected())
|
||||
{
|
||||
if(sendGet)
|
||||
{
|
||||
command = getRequest$myLink.CRLF$"Host: "$newsIPAddr$myLink.CRLF$myLink.CRLF;
|
||||
myLink.SendCommand(command);
|
||||
|
||||
pageWait = true;
|
||||
myLink.WaitForCount(1,20,1); // 20 sec timeout
|
||||
sendGet = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(pageWait)
|
||||
{
|
||||
myMOTD = myMOTD$".";
|
||||
lb_MOTD.MyScrollText.SetContent(myMOTD);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(sendGet)
|
||||
{
|
||||
myMOTD = myMOTD$"|| Could not connect to news server";
|
||||
lb_MOTD.MyScrollText.SetContent(myMOTD);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (myRetryCount++ > myRetryMax)
|
||||
{
|
||||
myMOTD = myMOTD$"|| Retries Failed";
|
||||
KillTimer();
|
||||
lb_MOTD.MyScrollText.SetContent(myMOTD);
|
||||
}
|
||||
}
|
||||
|
||||
if(myLink.PeekChar() != 0)
|
||||
{
|
||||
pageWait = false;
|
||||
|
||||
// data waiting
|
||||
page = "";
|
||||
while(myLink.ReadBufferedLine(text))
|
||||
{
|
||||
page = page$text;
|
||||
}
|
||||
|
||||
NewsParse(page);
|
||||
|
||||
myMOTD = "|"$page;
|
||||
|
||||
lb_MOTD.MyScrollText.SetContent(myMOTD);
|
||||
|
||||
myLink.DestroyLink();
|
||||
myLink = none;
|
||||
|
||||
KillTimer();
|
||||
}
|
||||
}
|
||||
|
||||
SetTimer(ReReadyPause, true);
|
||||
}
|
||||
|
||||
function NewsParse(out string page)
|
||||
{
|
||||
local string junk;
|
||||
local int i;
|
||||
|
||||
junk = page;
|
||||
Caps(junk);
|
||||
|
||||
i = InStr(junk, "<BODY>");
|
||||
if ( i > -1 )
|
||||
{
|
||||
// remove all header from string
|
||||
page = Right(page, len(page) - i - 6);
|
||||
}
|
||||
|
||||
junk = page;
|
||||
Caps(junk);
|
||||
|
||||
i = InStr(junk, "</BODY>");
|
||||
if ( i > -1 )
|
||||
{
|
||||
// remove all footers from string
|
||||
page = Left(page, i);
|
||||
}
|
||||
|
||||
page = Repl(page, "<br>", "|", false);
|
||||
}
|
||||
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Begin Object Class=GUIScrollTextBox Name=MyMOTDText
|
||||
bNoTeletype=True
|
||||
CharDelay=0.050000
|
||||
EOLDelay=0.100000
|
||||
bVisibleWhenEmpty=True
|
||||
OnCreateComponent=MyMOTDText.InternalOnCreateComponent
|
||||
WinTop=0.001679
|
||||
WinHeight=0.833203
|
||||
WinLeft=0.01
|
||||
WinWidth=0.99
|
||||
RenderWeight=0.600000
|
||||
TabOrder=1
|
||||
bNeverFocus=True
|
||||
End Object
|
||||
lb_MOTD=GUIScrollTextBox'KFGui.KFMOTD.MyMOTDText'
|
||||
|
||||
Begin Object Class=GUILabel Name=VersionNum
|
||||
TextAlign=TXTA_Right
|
||||
StyleName="TextLabel"
|
||||
WinTop=-0.043415
|
||||
WinLeft=0.738500
|
||||
WinWidth=0.252128
|
||||
WinHeight=0.040000
|
||||
RenderWeight=20.700001
|
||||
End Object
|
||||
l_Version=GUILabel'KFGui.KFMOTD.VersionNum'
|
||||
|
||||
VersionString="KF Version"
|
||||
PanelCaption="News from Tripwire Interactive"
|
||||
|
||||
b_QuickConnect=None
|
||||
|
||||
myMOTD = "||Connecting To News Server"
|
||||
|
||||
newsIPAddr = "redorchestragame.com"
|
||||
getRequest = "GET /kfnews.htm HTTP/1.1"
|
||||
|
||||
ReReadyPause=0.250000
|
||||
myRetryCount=0
|
||||
myRetryMax=40
|
||||
|
||||
LinkClassName="ROInterface.ROBufferedTCPLink"
|
||||
sendGet = true;
|
||||
}
|
||||
1093
kf_sources/KFGui/Classes/KFMainMenu.uc
Normal file
1093
kf_sources/KFGui/Classes/KFMainMenu.uc
Normal file
File diff suppressed because it is too large
Load diff
89
kf_sources/KFGui/Classes/KFMainPage.uc
Normal file
89
kf_sources/KFGui/Classes/KFMainPage.uc
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
//====================================================================
|
||||
// Killing Floor Main Page Class
|
||||
// ====================================================================
|
||||
class KFMainPage extends UT2K4MainPage;
|
||||
|
||||
function InitComponent(GUIController MyC, GUIComponent MyO)
|
||||
{
|
||||
Super.InitComponent(MyC, MyO);
|
||||
|
||||
c_Tabs.MyFooter = t_Footer;
|
||||
t_Header.DockedTabs = c_Tabs;
|
||||
}
|
||||
|
||||
function InternalOnChange(GUIComponent Sender);
|
||||
|
||||
function HandleParameters(string Param1, string Param2)
|
||||
{
|
||||
if ( Param1 != "" )
|
||||
{
|
||||
if ( c_Tabs != none )
|
||||
c_Tabs.ActivateTabByName(Param1, True);
|
||||
}
|
||||
}
|
||||
|
||||
function bool GetRestoreParams( out string Param1, out string Param2 )
|
||||
{
|
||||
if ( c_Tabs != None && c_Tabs.ActiveTab != None )
|
||||
{
|
||||
Param1 = c_Tabs.ActiveTab.Caption;
|
||||
return True;
|
||||
}
|
||||
|
||||
return False;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
Begin Object Class=GUITabControl Name=PageTabs
|
||||
bDockPanels=True
|
||||
TabHeight=0.040000
|
||||
BackgroundStyleName="TabBackground"
|
||||
WinLeft=0.010000
|
||||
WinWidth=0.980000
|
||||
WinHeight=0.040000
|
||||
RenderWeight=0.490000
|
||||
TabOrder=3
|
||||
bAcceptsInput=True
|
||||
OnActivate=PageTabs.InternalOnActivate
|
||||
OnChange=KFMainPage.InternalOnChange
|
||||
End Object
|
||||
c_Tabs=GUITabControl'KFGui.KFMainPage.PageTabs'
|
||||
|
||||
Begin Object Class=BackgroundImage Name=PageBackground
|
||||
Image=Texture'2K4Menus.BkRenders.Bgndtile'
|
||||
ImageStyle=ISTY_PartialScaled
|
||||
X1=0
|
||||
Y1=0
|
||||
X2=4
|
||||
Y2=768
|
||||
RenderWeight=0.010000
|
||||
End Object
|
||||
i_Background=BackgroundImage'KFGui.KFMainPage.PageBackground'
|
||||
|
||||
Begin Object Class=GUIImage Name=BkChar
|
||||
Image=Texture'2K4Menus.MainMenu.Char01'
|
||||
ImageStyle=ISTY_Scaled
|
||||
X1=0
|
||||
Y1=0
|
||||
X2=1024
|
||||
Y2=768
|
||||
WinHeight=1.000000
|
||||
RenderWeight=0.020000
|
||||
End Object
|
||||
i_bkChar=GUIImage'KFGui.KFMainPage.BkChar'
|
||||
|
||||
Begin Object Class=BackgroundImage Name=PageScanLine
|
||||
Image=Texture'2K4Menus.BkRenders.Scanlines'
|
||||
ImageColor=(A=32)
|
||||
ImageStyle=ISTY_Tiled
|
||||
ImageRenderStyle=MSTY_Alpha
|
||||
X1=0
|
||||
Y1=0
|
||||
X2=32
|
||||
Y2=32
|
||||
RenderWeight=0.030000
|
||||
End Object
|
||||
i_bkScan=BackgroundImage'KFGui.KFMainPage.PageScanLine'
|
||||
|
||||
}
|
||||
110
kf_sources/KFGui/Classes/KFMapListEditor.uc
Normal file
110
kf_sources/KFGui/Classes/KFMapListEditor.uc
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
class KFMaplistEditor extends MaplistEditor;
|
||||
|
||||
// Query the CacheManager for the maps that correspond to this gametype, then fill the 'available' list
|
||||
function ReloadAvailable()
|
||||
{
|
||||
local int i, j;
|
||||
local array<string> CustomLinkSetups;
|
||||
|
||||
if ( MapHandler.GetAvailableMaps(GameIndex, Maps) )
|
||||
{
|
||||
li_Avail.bNotify = False;
|
||||
li_Avail.Clear();
|
||||
|
||||
for ( i = 0; i < Maps.Length; i++ )
|
||||
{
|
||||
if ( class'CacheManager'.static.IsDefaultContent(Maps[i].MapName) )
|
||||
{
|
||||
if ( bOnlyShowCustom )
|
||||
continue;
|
||||
}
|
||||
else if ( bOnlyShowOfficial )
|
||||
continue;
|
||||
|
||||
if ( Maps[i].MapName == "KF-Intro" || Maps[i].MapName == "KF-Menu" )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// KF Hack . OMG HiJacked!
|
||||
if ( Maps[i].Options.Length > 0 )
|
||||
{
|
||||
// Add the "auto link setup" item
|
||||
li_Avail.AddItem( AutoSelectText @ LinkText, Maps[i].MapName $ "?LinkSetup=Random", Maps[i].MapName );
|
||||
|
||||
// Now add all custom link setups
|
||||
for ( j = 0; j < Maps[i].Options.Length; j++ )
|
||||
li_Avail.AddItem(Maps[i].Options[j].Value @ LinkText, Maps[i].MapName $ "?LinkSetup=" $ Maps[i].Options[j].Value, Maps[i].MapName );
|
||||
}
|
||||
else li_Avail.AddItem( Maps[i].MapName, Maps[i].MapName );
|
||||
|
||||
if ( CurrentGameType.MapPrefix == "ONS" )
|
||||
{
|
||||
CustomLinkSetups = GetPerObjectNames( Maps[i].MapName, "ONSPowerLinkCustomSetup" );
|
||||
for ( j = 0; j < CustomLinkSetups.Length; j++ )
|
||||
li_Avail.AddItem( CustomLinkSetups[j] @ LinkText, Maps[i].MapName $ "?LinkSetup=" $ CustomLinkSetups[j], Maps[i].MapName );
|
||||
|
||||
if ( OrigONSMap(Maps[i].MapName) && Controller.bECEEdition )
|
||||
{
|
||||
li_Avail.AddItem( Maps[i].MapName$BonusVehicles, Maps[i].MapName$"?BonusVehicles=true" );
|
||||
|
||||
// Now add all custom link setups
|
||||
for ( j = 0; j < Maps[i].Options.Length; j++ )
|
||||
li_Avail.AddItem(Maps[i].Options[j].Value @ LinkText, Maps[i].MapName $ "?LinkSetup=" $ Maps[i].Options[j].Value$"?BonusVehicles=true" , Maps[i].MapName$BonusVehicles );
|
||||
|
||||
CustomLinkSetups = GetPerObjectNames( Maps[i].MapName, "ONSPowerLinkCustomSetup" );
|
||||
for ( j = 0; j < CustomLinkSetups.Length; j++ )
|
||||
li_Avail.AddItem( CustomLinkSetups[j] @ LinkText, Maps[i].MapName $ "?LinkSetup=" $ CustomLinkSetups[j]$"?BonusVehicles=true", Maps[i].MapName$BonusVehicles );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( li_Avail.bSorted )
|
||||
li_Avail.Sort();
|
||||
|
||||
li_Avail.bNotify = True;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
|
||||
Begin Object Class=GUIButton Name=RemoveButton
|
||||
Caption="Remove"
|
||||
Hint="Remove the selected maps from your map list"
|
||||
WinWidth=0.223407
|
||||
WinHeight=0.056312
|
||||
WinLeft=0.511243
|
||||
WinTop=0.918035
|
||||
OnClick=ModifyMapList
|
||||
OnClickSound=CS_Down
|
||||
TabOrder=10
|
||||
AutoSizePadding=(HorzPerc=0.5,VertPerc=0.0)
|
||||
bScaleToParent=true
|
||||
bRepeatClick=True
|
||||
End Object
|
||||
b_Remove=RemoveButton
|
||||
|
||||
Begin Object Class=GUIButton Name=RemoveAllButton
|
||||
Caption="Remove All"
|
||||
Hint="Remove all maps from your map list"
|
||||
WinWidth=0.223407
|
||||
WinHeight=0.056312
|
||||
WinLeft=0.753268
|
||||
WinTop=0.918035
|
||||
OnClick=ModifyMapList
|
||||
OnClickSound=CS_Down
|
||||
TabOrder=11
|
||||
bScaleToParent=true
|
||||
End Object
|
||||
b_RemoveAll=RemoveAllButton
|
||||
|
||||
Begin Object class=AltSectionBackground name=MapListSectionBackground
|
||||
WinTop=0.055162
|
||||
WinLeft=0.034523
|
||||
WinWidth=0.941820
|
||||
WinHeight=0.194434
|
||||
End Object
|
||||
sb_MapList=MapListSectionBackground
|
||||
|
||||
}
|
||||
21
kf_sources/KFGui/Classes/KFMapListManager.uc
Normal file
21
kf_sources/KFGui/Classes/KFMapListManager.uc
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
class KFMaplistManager extends MaplistManager;
|
||||
|
||||
// returns whether Maplist class was loaded successfully
|
||||
function bool GetDefaultMaps( string MaplistClassName, out array<string> Maps )
|
||||
{
|
||||
local class<Maplist> List;
|
||||
|
||||
if ( MaplistClassName == "" )
|
||||
return false;
|
||||
|
||||
List = class<Maplist>(DynamicLoadObject( MaplistClassName, class'Class', True ));
|
||||
if ( List == None )
|
||||
return false;
|
||||
|
||||
Maps = List.static.StaticGetMaps();
|
||||
return true;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
}
|
||||
550
kf_sources/KFGui/Classes/KFMapPage.uc
Normal file
550
kf_sources/KFGui/Classes/KFMapPage.uc
Normal file
|
|
@ -0,0 +1,550 @@
|
|||
class KFMapPage extends UT2K4Tab_MainSP;
|
||||
|
||||
var automated moComboBox co_Difficulty;
|
||||
var automated moComboBox co_GameLength;
|
||||
var automated moCheckBox ch_Sandbox;
|
||||
|
||||
var() editconst noexport PlayInfo GamePI;
|
||||
var array<PlayInfo.PlayInfoData> InfoRules;
|
||||
var byte LastGameLengthIndex;
|
||||
var int DefaultInitialCountDownValue;
|
||||
var bool bDisableCombos;
|
||||
|
||||
function bool Tick(Canvas Canvas)
|
||||
{
|
||||
if ( bDisableCombos )
|
||||
{
|
||||
co_Difficulty.DisableMe();
|
||||
co_GameLength.DisableMe();
|
||||
}
|
||||
|
||||
return super.OnDraw(Canvas);
|
||||
}
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
local array<CacheManager.MapRecord> TutMaps;
|
||||
|
||||
OnDraw = Tick;
|
||||
|
||||
super(UT2K4GameTabBase).InitComponent(MyController, MyOwner);
|
||||
|
||||
if ( lb_Maps != None )
|
||||
li_Maps = lb_Maps.List;
|
||||
|
||||
if ( li_Maps != None )
|
||||
{
|
||||
li_Maps.OnDblClick = MapListDblClick;
|
||||
li_Maps.bSorted = True;
|
||||
lb_Maps.NotifyContextSelect = HandleContextSelect;
|
||||
}
|
||||
|
||||
class'CacheManager'.static.InitCache();
|
||||
MapHandler = PlayerOwner().Spawn(class'MaplistManager');
|
||||
class'CacheManager'.static.GetMaplist(TutMaps, "TUT");
|
||||
|
||||
lb_Maps.bBoundToParent=false;
|
||||
lb_Maps.bScaleToParent=false;
|
||||
|
||||
sb_Selection.ManageComponent(lb_Maps);
|
||||
|
||||
asb_Scroll.ManageComponent(lb_MapDesc);
|
||||
|
||||
LastGameLengthIndex = 0;
|
||||
|
||||
sb_Options.ManageComponent(co_Difficulty);
|
||||
sb_Options.ManageComponent(co_GameLength);
|
||||
sb_Options.ManageComponent(ch_Sandbox);
|
||||
sb_Options.ManageComponent(b_Maplist);
|
||||
|
||||
SetGamePI();
|
||||
}
|
||||
|
||||
protected function SetGamePI()
|
||||
{
|
||||
p_Anchor.SetRuleInfo();
|
||||
GamePI = p_Anchor.RuleInfo;
|
||||
GamePI.Sort(0);
|
||||
}
|
||||
|
||||
function ShowPanel(bool bShow)
|
||||
{
|
||||
local int DifficultyIndex;
|
||||
|
||||
super.ShowPanel(bShow);
|
||||
|
||||
DifficultyIndex = GamePI.FindIndex("GameDifficulty");
|
||||
|
||||
if ( float(GamePI.Settings[DifficultyIndex].Value) < 2.0000 )
|
||||
{
|
||||
co_Difficulty.SetIndex(0);
|
||||
}
|
||||
else if ( float(GamePI.Settings[DifficultyIndex].Value) < 4.0000 )
|
||||
{
|
||||
co_Difficulty.SetIndex(1);
|
||||
}
|
||||
else if ( float(GamePI.Settings[DifficultyIndex].Value) < 5.0000 )
|
||||
{
|
||||
co_Difficulty.SetIndex(2);
|
||||
}
|
||||
else if ( float(GamePI.Settings[DifficultyIndex].Value) < 7.0000 )
|
||||
{
|
||||
co_Difficulty.SetIndex(3);
|
||||
}
|
||||
else
|
||||
{
|
||||
co_Difficulty.SetIndex(4);
|
||||
}
|
||||
}
|
||||
|
||||
function RefreshOptions()
|
||||
{
|
||||
local int i, j;
|
||||
local array<string> Range;
|
||||
|
||||
SetGamePI();
|
||||
GamePI.GetSettings("", InfoRules);
|
||||
co_Difficulty.MyComboBox.Clear();
|
||||
co_GameLength.MyComboBox.Clear();
|
||||
|
||||
for ( i = 0; i < InfoRules.Length; i++)
|
||||
{
|
||||
if ( InfoRules[i].DisplayName == co_Difficulty.Caption )
|
||||
{
|
||||
GamePI.SplitStringToArray(Range, InfoRules[i].Data, ";");
|
||||
|
||||
for ( j = 0; j + 1 < Range.Length; j += 2 )
|
||||
{
|
||||
co_Difficulty.AddItem(Range[j+1], , Range[j]);
|
||||
co_Difficulty.Tag = i;
|
||||
}
|
||||
}
|
||||
else if ( InfoRules[i].DisplayName == co_GameLength.Caption )
|
||||
{
|
||||
GamePI.SplitStringToArray(Range, InfoRules[i].Data, ";");
|
||||
|
||||
for ( j = 0; j + 1 < Range.Length; j += 2 )
|
||||
{
|
||||
co_GameLength.AddItem(Range[j+1], , Range[j]);
|
||||
co_GameLength.Tag = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
co_GameLength.SetIndex(class'KFGameType'.default.KFGameLength);
|
||||
GameLengthChange(co_GameLength);
|
||||
}
|
||||
|
||||
function InternalOnChange(GUIComponent Sender)
|
||||
{
|
||||
if (GUIMultiOptionList(Sender) != None)
|
||||
{
|
||||
if (Controller.bCurMenuInitialized)
|
||||
UpdateSetting(GUIMultiOptionList(Sender).Get());
|
||||
}
|
||||
|
||||
else if ( GUIMenuOption(Sender) != None && Controller.bCurMenuInitialized )
|
||||
UpdateSetting( GUIMenuOption(Sender) );
|
||||
}
|
||||
|
||||
function UpdateSetting(GUIMenuOption Sender)
|
||||
{
|
||||
local int i;
|
||||
local int Index;
|
||||
|
||||
if ( Sender == none )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
i = Sender.Tag;
|
||||
|
||||
if ( i < 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( InfoRules[i].DisplayName != Sender.Caption )
|
||||
{
|
||||
if ( Controller.bModAuthor )
|
||||
{
|
||||
log("Corrupt list index detected in component"@Sender.Name,'ModAuthor');
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Index = GamePI.FindIndex(InfoRules[i].SettingName);
|
||||
|
||||
if ( InfoRules[i].DisplayName != Sender.Caption || Index == -1 )
|
||||
{
|
||||
if ( Controller.bModAuthor )
|
||||
{
|
||||
log("Invalid setting requested from PlayInfo!",'ModAuthor');
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
StoreSetting(Index, Sender.GetComponentValue());
|
||||
}
|
||||
|
||||
protected function StoreSetting(int Index, string NewValue)
|
||||
{
|
||||
GamePI.StoreSetting(Index, NewValue);
|
||||
}
|
||||
|
||||
|
||||
// Called when a new gametype is selected
|
||||
function InitGameType()
|
||||
{
|
||||
local int i;
|
||||
local array<CacheManager.GameRecord> Games;
|
||||
local bool bReloadMaps;
|
||||
|
||||
// Get a list of all gametypes.
|
||||
class'CacheManager'.static.GetGameTypeList(Games);
|
||||
for (i = 0; i < Games.Length; i++)
|
||||
{
|
||||
if (Games[i].ClassName ~= Controller.LastGameType)
|
||||
{
|
||||
bReloadMaps = CurrentGameType.MapPrefix != Games[i].MapPrefix;
|
||||
CurrentGameType = Games[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( i == Games.Length )
|
||||
return;
|
||||
|
||||
// Enable/Disable extra options based on GameType
|
||||
if ( CurrentGameType.ClassName == "KFMod.KFGameType" )
|
||||
{
|
||||
co_GameLength.EnableMe();
|
||||
ch_Sandbox.EnableMe();
|
||||
}
|
||||
else
|
||||
{
|
||||
co_GameLength.DisableMe();
|
||||
ch_Sandbox.DisableMe();
|
||||
}
|
||||
|
||||
// Update the gametype label's text
|
||||
SetGameTypeCaption();
|
||||
|
||||
// Should the tutorial button be enabled?
|
||||
// CheckGameTutorial();
|
||||
|
||||
// Load Maps for the new gametype, but only if it uses a different maplist
|
||||
if (bReloadMaps)
|
||||
InitMaps();
|
||||
|
||||
// Set the selected map
|
||||
i = li_Maps.FindIndexByValue(LastSelectedMap);
|
||||
if ( i == -1 )
|
||||
i = 0;
|
||||
li_Maps.SetIndex(i);
|
||||
li_Maps.Expand(i);
|
||||
|
||||
// Load the information (screenshot, desc., etc.) for the currently selected map
|
||||
// ReadMapInfo(li_Maps.GetParentCaption());
|
||||
}
|
||||
|
||||
// Query the CacheManager for the maps that correspond to this gametype, then fill the main list
|
||||
function InitMaps(optional string MapPrefix)
|
||||
{
|
||||
local int i, j;
|
||||
local bool bTemp;
|
||||
local string Package, Item, Desc;
|
||||
local GUITreeNode StoredItem;
|
||||
local DecoText DT;
|
||||
|
||||
// Make sure we have a map prefix
|
||||
if ( MapPrefix == "" )
|
||||
{
|
||||
MapPrefix = GetMapPrefix();
|
||||
}
|
||||
|
||||
// Temporarily disable notification in all components
|
||||
bTemp = Controller.bCurMenuInitialized;
|
||||
Controller.bCurMenuInitialized = False;
|
||||
|
||||
if ( li_Maps.IsValid() )
|
||||
li_Maps.GetElementAtIndex(li_Maps.Index, StoredItem);
|
||||
|
||||
// Get the list of maps for the current gametype
|
||||
class'CacheManager'.static.GetMapList( CacheMaps, MapPrefix );
|
||||
if ( MapHandler.GetAvailableMaps(MapHandler.GetGameIndex(CurrentGameType.ClassName), Maps) )
|
||||
{
|
||||
li_Maps.bNotify = False;
|
||||
li_Maps.Clear();
|
||||
|
||||
for ( i = 0; i < Maps.Length; i++ )
|
||||
{
|
||||
DT = None;
|
||||
if ( class'CacheManager'.static.IsDefaultContent(Maps[i].MapName) )
|
||||
{
|
||||
if ( bOnlyShowCustom )
|
||||
continue;
|
||||
}
|
||||
else if ( bOnlyShowOfficial )
|
||||
continue;
|
||||
|
||||
j = FindCacheRecordIndex(Maps[i].MapName);
|
||||
if ( class'CacheManager'.static.Is2003Content(Maps[i].MapName) )
|
||||
{
|
||||
if ( CacheMaps[j].TextName != "" )
|
||||
{
|
||||
if ( !Divide(CacheMaps[j].TextName, ".", Package, Item) )
|
||||
{
|
||||
Package = "XMaps";
|
||||
Item = CacheMaps[j].TextName;
|
||||
}
|
||||
}
|
||||
|
||||
DT = class'xUtil'.static.LoadDecoText(Package, Item);
|
||||
}
|
||||
|
||||
if ( DT != None )
|
||||
Desc = JoinArray(DT.Rows, "|");
|
||||
else
|
||||
Desc = CacheMaps[j].Description;
|
||||
|
||||
|
||||
// KF Map Hack
|
||||
if ( CurrentGameType.MapPrefix ~= "KF" )
|
||||
{
|
||||
if (Maps[i].MapName != "KF-Intro" && Maps[i].MapName != "KF-Menu")
|
||||
li_Maps.AddItem( Maps[i].MapName, Maps[i].MapName, ,,Desc);
|
||||
}
|
||||
else
|
||||
li_Maps.AddItem( Maps[i].MapName, Maps[i].MapName, ,,Desc);
|
||||
}
|
||||
}
|
||||
|
||||
if ( li_Maps.bSorted )
|
||||
li_Maps.SortList();
|
||||
|
||||
if ( StoredItem.Caption != "" )
|
||||
{
|
||||
i = li_Maps.FindFullIndex(StoredItem.Caption, StoredItem.Value, StoredItem.ParentCaption);
|
||||
if ( i != -1 )
|
||||
li_Maps.SilentSetIndex(i);
|
||||
}
|
||||
|
||||
li_Maps.bNotify = True;
|
||||
|
||||
Controller.bCurMenuInitialized = bTemp;
|
||||
}
|
||||
|
||||
function SandBoxChange(GUIComponent Sender)
|
||||
{
|
||||
local int CountDownIndex, DifficultyIndex;
|
||||
|
||||
if ( ch_Sandbox.IsChecked() )
|
||||
{
|
||||
bDisableCombos = true;
|
||||
|
||||
co_GameLength.SetIndex(3);
|
||||
|
||||
sb_Options.DisableComponent(co_Difficulty);
|
||||
sb_Options.DisableComponent(co_GameLength);
|
||||
|
||||
UT2K4MainPage(OwnerPage()).c_Tabs.TabStack[1].EnableMe();
|
||||
}
|
||||
else
|
||||
{
|
||||
bDisableCombos = false;
|
||||
|
||||
sb_Options.EnableComponent(co_Difficulty);
|
||||
sb_Options.EnableComponent(co_GameLength);
|
||||
|
||||
co_GameLength.SetIndex(LastGameLengthIndex);
|
||||
|
||||
CountDownIndex = GamePI.FindIndex("InitialCountDownValue");
|
||||
GamePI.StoreSetting(CountDownIndex, DefaultInitialCountDownValue);
|
||||
|
||||
DifficultyIndex = GamePI.FindIndex("GameDifficulty");
|
||||
|
||||
if ( float(GamePI.Settings[DifficultyIndex].Value) < 2.0000 )
|
||||
{
|
||||
co_Difficulty.SetIndex(0);
|
||||
}
|
||||
else if ( float(GamePI.Settings[DifficultyIndex].Value) < 4.0000 )
|
||||
{
|
||||
co_Difficulty.SetIndex(1);
|
||||
}
|
||||
else if ( float(GamePI.Settings[DifficultyIndex].Value) < 5.0000 )
|
||||
{
|
||||
co_Difficulty.SetIndex(2);
|
||||
}
|
||||
else if ( float(GamePI.Settings[DifficultyIndex].Value) < 7.0000 )
|
||||
{
|
||||
co_Difficulty.SetIndex(3);
|
||||
}
|
||||
else
|
||||
{
|
||||
co_Difficulty.SetIndex(4);
|
||||
}
|
||||
|
||||
GameLengthChange(Sender);
|
||||
UT2K4MainPage(OwnerPage()).c_Tabs.TabStack[1].DisableMe();
|
||||
}
|
||||
}
|
||||
|
||||
function GameLengthChange(GUIComponent Sender)
|
||||
{
|
||||
if ( co_GameLength.GetIndex() != 3 )
|
||||
{
|
||||
LastGameLengthIndex = co_GameLength.GetIndex();
|
||||
}
|
||||
|
||||
class'KFGameType'.default.KFGameLength = co_GameLength.GetIndex();
|
||||
class'KFGameType'.static.StaticSaveConfig();
|
||||
UpdateSetting(co_GameLength);
|
||||
|
||||
if ( class'KFGameType'.default.KFGameLength == 3 )
|
||||
{
|
||||
ch_Sandbox.SetComponentValue(true);
|
||||
SandBoxChange(Sender);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( ch_Sandbox.IsChecked() )
|
||||
{
|
||||
ch_Sandbox.SetComponentValue(false);
|
||||
SandBoxChange(Sender);
|
||||
//co_GameLength.SetIndex(LastGameLengthIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function GameDifficultyChange(GUIMenuOption Sender)
|
||||
{
|
||||
local int NewIndex;
|
||||
|
||||
|
||||
NewIndex = co_Difficulty.GetIndex();
|
||||
|
||||
if ( NewIndex == 0 )
|
||||
{
|
||||
class'KFGameType'.default.GameDifficulty = 1.0000;
|
||||
}
|
||||
else if ( NewIndex == 1 )
|
||||
{
|
||||
class'KFGameType'.default.GameDifficulty = 2.0000;
|
||||
}
|
||||
else if ( NewIndex == 3 )
|
||||
{
|
||||
class'KFGameType'.default.GameDifficulty = 4.0000;
|
||||
}
|
||||
else if ( NewIndex == 4 )
|
||||
{
|
||||
class'KFGameType'.default.GameDifficulty = 5.0000;
|
||||
}
|
||||
else
|
||||
{
|
||||
class'KFGameType'.default.GameDifficulty = 7.0000;
|
||||
}
|
||||
|
||||
class'KFGameType'.static.StaticSaveConfig();
|
||||
UpdateSetting(Sender);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
LastSelectedMap="KF-Test"
|
||||
bOnlyShowOfficial=false;
|
||||
DefaultInitialCountDownValue=60
|
||||
|
||||
/* Begin Object Class=moCheckBox Name=FilterCheck
|
||||
CaptionWidth=0.100000
|
||||
ComponentWidth=0.900000
|
||||
Caption="Only Official KF Maps"
|
||||
OnCreateComponent=FilterCheck.InternalOnCreateComponent
|
||||
Hint="Hides all those that are not official Killing Floor maps"
|
||||
WinTop=0.772865
|
||||
WinLeft=0.051758
|
||||
WinWidth=0.341797
|
||||
WinHeight=0.030035
|
||||
TabOrder=1
|
||||
OnChange=KFMapPage.ChangeMapFilter
|
||||
End Object
|
||||
ch_OfficialMapsOnly=moCheckBox'KFGui.KFMapPage.FilterCheck'
|
||||
*/
|
||||
Begin Object Class=moComboBox Name=DifficultyCombo
|
||||
Caption="Difficulty"
|
||||
WinWidth=0.341797
|
||||
WinHeight=0.0300000
|
||||
WinLeft=0.087169
|
||||
WinTop=0.750547
|
||||
OnChange=GameDifficultyChange
|
||||
CaptionWidth=0.5
|
||||
ComponentWidth=0.50000
|
||||
bAutoSizeCaption=True
|
||||
TabOrder=0
|
||||
Hint="Sets how skilled your opponents will be"
|
||||
bReadOnly=true
|
||||
End Object
|
||||
co_Difficulty=DifficultyCombo
|
||||
|
||||
Begin Object Class=moComboBox Name=GameLengthCombo
|
||||
Caption="Game Length"
|
||||
WinWidth=0.341797
|
||||
WinHeight=0.030000
|
||||
WinLeft=0.087169
|
||||
WinTop=0.750547
|
||||
OnChange=GameLengthChange
|
||||
CaptionWidth=0.5
|
||||
ComponentWidth=0.50000
|
||||
bAutoSizeCaption=True
|
||||
TabOrder=1
|
||||
Hint="Sets how long the game will be"
|
||||
bReadOnly=true
|
||||
End Object
|
||||
co_GameLength=GameLengthCombo
|
||||
|
||||
Begin Object Class=moCheckBox Name=SandboxCheck
|
||||
CaptionWidth=0.500000
|
||||
ComponentWidth=0.500000
|
||||
Caption="Enable Sandbox"
|
||||
//OnCreateComponent=FilterCheck.InternalOnCreateComponent
|
||||
OnChange=SandBoxChange
|
||||
WinTop=0.772865
|
||||
WinLeft=0.051758
|
||||
WinWidth=0.341797
|
||||
WinHeight=0.030000
|
||||
TabOrder=3
|
||||
Hint="Enable the advanced sandbox settings"
|
||||
//OnChange=KFMapPage.ChangeMapFilter
|
||||
End Object
|
||||
ch_Sandbox=moCheckBox'KFGui.KFMapPage.SandboxCheck'
|
||||
|
||||
Begin Object Class=moButton Name=MaplistButton
|
||||
WinWidth=0.341797
|
||||
WinHeight=0.05
|
||||
WinLeft=0.039258
|
||||
WinTop=0.888587
|
||||
ButtonCaption="Maplist Configuration"
|
||||
Hint="Modify the maps that should be used in gameplay"
|
||||
OnChange=MaplistConfigClick
|
||||
TabOrder=4
|
||||
ComponentWidth=1.0
|
||||
End Object
|
||||
b_Maplist=MaplistButton
|
||||
|
||||
Begin Object class=AltSectionBackground name=ScrollSection
|
||||
WinWidth=0.409888
|
||||
WinHeight=0.437814
|
||||
WinLeft=0.546118
|
||||
WinTop=0.525219
|
||||
Caption="Map Desc"
|
||||
bFillClient=true
|
||||
bNoCaption=true
|
||||
End Object
|
||||
asb_Scroll=ScrollSection
|
||||
|
||||
|
||||
ch_OfficialMapsOnly=none
|
||||
b_Tutorial=none
|
||||
}
|
||||
86
kf_sources/KFGui/Classes/KFMapStoryLabel.uc
Normal file
86
kf_sources/KFGui/Classes/KFMapStoryLabel.uc
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
// Text Box for our Lobby. includes a little blurb about the map. (to make peace with myself for removing intro cutscenes :-/ )
|
||||
|
||||
class KFMapStoryLabel extends GUIScrollTextBox ;
|
||||
|
||||
var string StoryString;
|
||||
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
|
||||
Super.InitComponent(MyController, MyOwner);
|
||||
|
||||
/*
|
||||
|
||||
if (PlayerOwner().Level != none)
|
||||
StoryString = PlayerOwner().Level.Description ;
|
||||
|
||||
|
||||
SetContent(StoryString);
|
||||
|
||||
|
||||
|
||||
|
||||
if (DefaultListClass != "")
|
||||
{
|
||||
MyScrollText = GUIScrollText(AddComponent(DefaultListClass));
|
||||
if (MyScrollText == None)
|
||||
{
|
||||
log(Class$".InitComponent - Could not create default list ["$DefaultListClass$"]");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (MyScrollText == None)
|
||||
{
|
||||
Warn("Could not initialize list!");
|
||||
return;
|
||||
}
|
||||
|
||||
InitBaseList(MyScrollText);
|
||||
*/
|
||||
}
|
||||
|
||||
function LoadStoryText()
|
||||
{
|
||||
local string MapName;
|
||||
local int i, j;
|
||||
|
||||
MapName = PlayerOwner().Level.GetLocalURL();
|
||||
|
||||
i = InStr(MapName, "/");
|
||||
if ( i < 0 )
|
||||
{
|
||||
i = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
i++;
|
||||
}
|
||||
|
||||
j = InStr(MapName, "?");
|
||||
if ( j < 0 )
|
||||
{
|
||||
j = Len(MapName);
|
||||
}
|
||||
|
||||
MapName = Mid(MapName, i, j - i);
|
||||
|
||||
StoryString = class'CacheManager'.static.GetMapRecord(MapName).Description;
|
||||
|
||||
SetContent(StoryString);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
bNoTeletype=True
|
||||
CharDelay=0.010000
|
||||
EOLDelay=0.010000
|
||||
bVisibleWhenEmpty=True
|
||||
StyleName="NoBackground"
|
||||
WinTop=0.123207
|
||||
WinLeft=0.499288
|
||||
WinWidth=0.469593
|
||||
WinHeight=0.283379
|
||||
bAcceptsInput=False
|
||||
bNeverFocus=True
|
||||
}
|
||||
8
kf_sources/KFGui/Classes/KFMapVotingPage.uc
Normal file
8
kf_sources/KFGui/Classes/KFMapVotingPage.uc
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
//-----------------------------------------------------------
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
class KFMapVotingPage extends ROMapVotingPage;
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
}
|
||||
176
kf_sources/KFGui/Classes/KFModelSelect.uc
Normal file
176
kf_sources/KFGui/Classes/KFModelSelect.uc
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
class KFModelSelect extends UT2k4ModelSelect;
|
||||
|
||||
// Overridden to get rid of the Race combo
|
||||
function InitComponent(GUIController MyController, GUIComponent MyOwner)
|
||||
{
|
||||
super(LockedFloatingWindow).Initcomponent(MyController, MyOwner);
|
||||
|
||||
sb_Main.SetPosition(0.040000,0.075000,0.680742,0.555859);
|
||||
sb_Main.RightPadding = 0.5;
|
||||
sb_Main.ManageComponent(CharList);
|
||||
|
||||
class'xUtil'.static.GetPlayerList(PlayerList);
|
||||
RefreshCharacterList("DUP");
|
||||
|
||||
// Spawn spinning character actor
|
||||
if ( SpinnyDude == None )
|
||||
SpinnyDude = PlayerOwner().spawn(class'XInterface.SpinnyWeap');
|
||||
|
||||
SpinnyDude.SetDrawType(DT_Mesh);
|
||||
SpinnyDude.SetDrawScale(0.9);
|
||||
SpinnyDude.SpinRate = 0;
|
||||
}
|
||||
|
||||
function RefreshCharacterList(string ExcludedChars, optional string Race)
|
||||
{
|
||||
local int i, j;
|
||||
local array<string> Excluded;
|
||||
|
||||
// Prevent list from calling OnChange events
|
||||
CharList.List.bNotify = False;
|
||||
CharList.Clear();
|
||||
|
||||
Split(ExcludedChars, ";", Excluded);
|
||||
for ( i = 0; i < PlayerList.Length; i++ )
|
||||
{
|
||||
// Check that this character is selectable
|
||||
if ( PlayerList[i].Menu != "" )
|
||||
{
|
||||
for (j = 0; j < Excluded.Length; j++)
|
||||
if ( InStr(";" $ Playerlist[i].Menu $ ";", ";" $ Excluded[j] $ ";") != -1 )
|
||||
break;
|
||||
|
||||
if ( j < Excluded.Length )
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( IsUnLocked(PlayerList[i]) )
|
||||
{
|
||||
CharList.List.Add(Playerlist[i].Portrait, i, 0);
|
||||
}
|
||||
else if ( Playerlist[i].LockedPortrait == none )
|
||||
{
|
||||
CharList.List.Add(Playerlist[i].Portrait, i, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
CharList.List.Add(Playerlist[i].LockedPortrait, i, 1);
|
||||
}
|
||||
}
|
||||
|
||||
CharList.List.LockedMat = LockedImage;
|
||||
CharList.List.bNotify = True;
|
||||
}
|
||||
|
||||
function HandleParameters( string Who, string Team )
|
||||
{
|
||||
local int i;
|
||||
|
||||
for ( i = 0; i < PlayerList.Length; i++)
|
||||
{
|
||||
if ( PlayerList[i].DefaultName ~= Who && IsUnlocked(PlayerList[i]) )
|
||||
{
|
||||
CharList.List.SetIndex(CharList.List.FindItem(i));
|
||||
}
|
||||
}
|
||||
|
||||
UpdateSpinnyDude();
|
||||
}
|
||||
|
||||
// Overridden to set Idle Animation
|
||||
function UpdateSpinnyDude()
|
||||
{
|
||||
local int idx;
|
||||
local xUtil.PlayerRecord Rec;
|
||||
local Mesh PlayerMesh;
|
||||
local Material BodySkin, HeadSkin;
|
||||
local string BodySkinName, HeadSkinName, TeamSuffix;
|
||||
|
||||
idx = CharList.List.GetItem();
|
||||
if ( idx < 0 || idx >= Playerlist.Length )
|
||||
return;
|
||||
|
||||
Rec = PlayerList[idx];
|
||||
|
||||
if (Rec.Race ~= "Juggernaut" || Rec.DefaultName~="Axon" || Rec.DefaultName~="Cyclops" || Rec.DefaultName ~="Virus" )
|
||||
SpinnyDudeOffset=vect(250.0,1.00,-14.00);
|
||||
else
|
||||
SpinnyDudeOffset=vect(250.0,1.00,-24.00);
|
||||
|
||||
PlayerMesh = Mesh(DynamicLoadObject(Rec.MeshName, class'Mesh'));
|
||||
if(PlayerMesh == None)
|
||||
{
|
||||
Log("Could not load mesh: "$Rec.MeshName$" For player: "$Rec.DefaultName);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the body skin
|
||||
BodySkinName = Rec.BodySkinName;
|
||||
|
||||
// Get the head skin
|
||||
HeadSkinName = Rec.FaceSkinName;
|
||||
if ( Rec.TeamFace )
|
||||
HeadSkinName $= TeamSuffix;
|
||||
|
||||
BodySkin = Material(DynamicLoadObject(BodySkinName, class'Material'));
|
||||
if(BodySkin == None)
|
||||
{
|
||||
Log("Could not load body material: "$Rec.BodySkinName$" For player: "$Rec.DefaultName);
|
||||
return;
|
||||
}
|
||||
|
||||
HeadSkin = Material(DynamicLoadObject(HeadSkinName, class'Material'));
|
||||
if(HeadSkin == None)
|
||||
{
|
||||
Log("Could not load head material: "$HeadSkinName$" For player: "$Rec.DefaultName);
|
||||
return;
|
||||
}
|
||||
|
||||
SpinnyDude.LinkMesh(PlayerMesh);
|
||||
SpinnyDude.Skins[0] = BodySkin;
|
||||
SpinnyDude.Skins[1] = HeadSkin;
|
||||
SpinnyDude.LoopAnim('Profile_idle');
|
||||
}
|
||||
|
||||
// Overridden to stop log spam
|
||||
function PopulateRaces()
|
||||
{
|
||||
}
|
||||
|
||||
// Overridden to hook up Steam Checks
|
||||
function bool IsUnlocked(xUtil.PlayerRecord Test)
|
||||
{
|
||||
// If character has no menu filter, just return true
|
||||
if ( PlayerOwner() == none )
|
||||
return super.IsUnlocked(Test);
|
||||
|
||||
return PlayerOwner().CharacterAvailable(Test.DefaultName);
|
||||
}
|
||||
|
||||
function HandleLockedCharacterClicked(int NewIndex)
|
||||
{
|
||||
if ( PlayerOwner() != none && PlayerOwner().PurchaseCharacter(Playerlist[NewIndex].DefaultName) )
|
||||
{
|
||||
Controller.CloseMenu(true);
|
||||
}
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
co_Race=none
|
||||
|
||||
Begin Object class=KFGUIVertImageListBox name=vil_CharList
|
||||
bScaleToParent=true
|
||||
bBoundToParent=true
|
||||
WinWidth=0.403407
|
||||
WinHeight=0.658125
|
||||
WinLeft=0.102888
|
||||
WinTop=0.185119
|
||||
CellStyle=Cell_FixedCount
|
||||
NoVisibleRows=3
|
||||
NoVisibleCols=4
|
||||
TabOrder=0
|
||||
OnChange=ListChange
|
||||
End Object
|
||||
CharList=vil_CharList
|
||||
}
|
||||
49
kf_sources/KFGui/Classes/KFMutatorPage.uc
Normal file
49
kf_sources/KFGui/Classes/KFMutatorPage.uc
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
class KFMutatorPage extends UT2K4Tab_MutatorBase;
|
||||
|
||||
// Called when a new gametype has been selected - remove any mutators which affect physics if
|
||||
// this gametype doesn't allow them
|
||||
function SetCurrentGame( CacheManager.GameRecord CurrentGame )
|
||||
{
|
||||
local int i;
|
||||
local string m, t;
|
||||
local class<GameInfo> GameClass;
|
||||
|
||||
if ( MutatorList.Length > 0 )
|
||||
m = BuildActiveMutatorString();
|
||||
else m = LastActiveMutators;
|
||||
|
||||
class'CacheManager'.static.GetMutatorList(MutatorList);
|
||||
GameClass = class<GameInfo>(DynamicLoadObject(CurrentGame.ClassName, class'Class'));
|
||||
if ( GameClass != None )
|
||||
{
|
||||
for ( i = MutatorList.Length - 1; i >= 0; i-- )
|
||||
if ( !GameClass.static.AllowMutator(MutatorList[i].ClassName) )
|
||||
MutatorList.Remove(i,1);
|
||||
}
|
||||
|
||||
// Disable the list's OnChange() delegate
|
||||
lb_Active.List.bNotify = False;
|
||||
lb_Avail.List.bNotify = False;
|
||||
|
||||
lb_Active.List.Clear();
|
||||
lb_Avail.List.Clear();
|
||||
|
||||
for (i=0;i<MutatorList.Length;i++)
|
||||
{
|
||||
if ( Left(MutatorList[i].GroupName,2)== "KF")
|
||||
lb_Avail.List.Add(MutatorList[i].FriendlyName,,MutatorList[i].Description);
|
||||
}
|
||||
|
||||
t = NextMutatorInString(m);
|
||||
while (t!="")
|
||||
{
|
||||
SelectMutator(t);
|
||||
t = NextMutatorInString(m);
|
||||
}
|
||||
|
||||
lb_Active.List.bNotify = True;
|
||||
lb_Avail.List.bNotify = True;
|
||||
|
||||
lb_Active.List.CheckLinkedObjects(lb_Active.List);
|
||||
lb_Avail.List.CheckLinkedObjects(lb_Avail.List);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue