Prepare fixtures

This commit is contained in:
dkanus 2026-07-14 20:27:09 +07:00
commit 9c94356263
6021 changed files with 722805 additions and 22 deletions

View file

@ -0,0 +1,147 @@
/*
--------------------------------------------------------------
GUIBuyMenu_Story
--------------------------------------------------------------
Main Trader Menu class
extended to add support for story elements.
Author : Alex Quick
--------------------------------------------------------------
*/
class GUIBuyMenu_Story extends GUIBuyMenu;
var automated GUILabel ShopTitleLabel;
var bool bShowPerkHeader;
function UpdateHeader()
{
local int TimeLeftMin, TimeLeftSec;
local string TimeString;
local KFPlayerController_Story StoryPC;
local float ObjTimeRemaining;
if ( KFPlayerController(PlayerOwner()) == none || PlayerOwner().PlayerReplicationInfo == none ||
PlayerOwner().GameReplicationInfo == none )
{
return;
}
StoryPC = KFPlayerController_Story(PlayerOwner());
if(StoryPC == none)
{
Super.UpdateHeader();
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
if(StoryPC != none)
{
ObjTimeRemaining = StoryPC.RemainingTraderTime;
}
TimeLeftMin = ObjTimeRemaining / 60;
TimeLeftSec = ObjTimeRemaining % 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;
}
}
function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
Super.InitComponent(MyController, MyOwner);
FillInfoFromVolume();
if(!bShowPerkHeader)
{
HeaderBG_Left.Hint = "";
HeaderBG_Left_Label.Caption = "";
c_Tabs.RemoveTab(PanelClass[1]);
RemoveComponent(QuickPerkSelect);
RemoveComponent(StoreTabButton);
RemoveComponent(PerkTabButton);
}
}
function FillInfoFromVolume()
{
local KFShopVolume_Story CurrentPlayerShop;
if(KFPlayerController_Story(PlayerOwner()) != none)
{
CurrentplayerShop = KFPlayerController_Story(PlayerOwner()).CurrentShopVolume ;
if(CurrentPlayerShop != none)
{
if( CurrentPlayerShop.ShopName != "" )
{
ShopTitleLabel.Caption = CurrentPlayerShop.ShopName ;
}
bShowPerkHeader = CurrentPlayerShop.bShowPerkHeader;
}
}
}
defaultproperties
{
bShowPerkHeader = true;
PanelClass(0)="KFStoryUI.KFTab_BuyMenu_Story"
Begin Object Class=GUILabel Name=ShopTitle
Caption="Trader"
TextAlign=TXTA_Center
TextColor=(B=158,G=176,R=175)
WinTop=0.052857
WinLeft=0.336529
WinWidth=0.327071
WinHeight=0.035000
End Object
ShopTitleLabel=GUILabel'KFStoryUI.GUIBuyMenu_Story.ShopTitle'
WaveLabel = none
// TimeLeftLabel = none
}

View file

@ -0,0 +1,17 @@
/*
--------------------------------------------------------------
KFBuyMenuInvListBox_Story
--------------------------------------------------------------
Author : Alex Quick
--------------------------------------------------------------
*/
class KFBuyMenuInvListBox_Story extends KFBuyMenuInvListBox;
defaultproperties
{
DefaultListClass="KFStoryUI.KFBuyMenuInvList_Story"
}

View file

@ -0,0 +1,330 @@
/*
--------------------------------------------------------------
KFBuyMenuInvListBox_Story
--------------------------------------------------------------
Author : Alex Quick
--------------------------------------------------------------
*/
class KFBuyMenuInvList_Story extends KFBuyMenuInvList;
/* Had to C&P this whole function just to exclude a single type of weapon from the buy menu's sell list
@todo - Implement a less retarded solution. Like a bool bTraderSellable in KFWeapon , or something */
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, bHasDualGoldenCannon;
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' )
{
bHasDualGoldenCannon = 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') || CurInv.IsA('Dummy_JoggingWeapon') )
{
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') ||
(bHasDualGoldenCannon && 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();
}

View file

@ -0,0 +1,19 @@
/*
--------------------------------------------------------------
KFBuyMenuSaleListBox_Story
--------------------------------------------------------------
Trader Menu ListBox Widget
extended to add support for story elements.
Author : Alex Quick
--------------------------------------------------------------
*/
class KFBuyMenuSaleListBox_Story extends KFBuyMenuSaleListBox;
defaultproperties
{
DefaultListClass="KFStoryUI.KFBuyMenuSaleList_Story"
}

View file

@ -0,0 +1,314 @@
/*
--------------------------------------------------------------
KFBuyMenuSaleList_Story
--------------------------------------------------------------
TraderShop GUI's ItemList Widget
extended to add support for story elements.
Author : Alex Quick
--------------------------------------------------------------
*/
class KFBuyMenuSaleList_Story extends KFBuyMenuSaleList;
function KFShopVolume_Story GetCurrentShop()
{
local KFPlayerController_Story StoryPC;
StoryPC = KFPlayerController_Story(PlayerOwner());
if(StoryPC != none)
{
return StoryPC.CurrentShopVolume ;
}
return none;
}
/* overriden so that it fills the buyables list from the Shop Volume the player is currently standing in
rather than the level rules actor */
function UpdateForSaleBuyables()
{
local class<KFVeterancyTypes> PlayerVeterancy;
local KFPlayerReplicationInfo KFPRI;
local GUIBuyable ForSaleBuyable;
local class<KFWeaponPickup> ForSalePickup;
local int i, j, DualDivider, ForSaleArrayIndex;
local bool bZeroWeight;
local KFShopVolume_Story CurrentShop;
local KFLevelRules KFLR;
DualDivider = 1;
CurrentShop = GetCurrentShop();
if(CurrentShop == none )
{
// log("Warning - Trader UI is open but player"@PlayerOwner()@"is not inside a story shop volume!");
super.UpdateForSaleBuyables();
return;
}
foreach PlayerOwner().DynamicActors(class'KFLevelRules', KFLR)
{
Break;
}
// 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 < CurrentShop.SaleItems.length ; j++ )
{
if ( CurrentShop.SaleItems[j] != none )
{
//Let's see if this is a vest, first aid kit, ammo or stuff we already have
if ( class<Vest>(CurrentShop.SaleItems[j]) != none || class<FirstAidKit>(CurrentShop.SaleItems[j]) != none ||
class<KFWeapon>(CurrentShop.SaleItems[j].default.InventoryType) == none || CurrentShop.SaleItems[j].IsA('Ammunition') ||
class<KFWeapon>(CurrentShop.SaleItems[j].default.InventoryType).default.bKFNeverThrow ||
IsInInventory(CurrentShop.SaleItems[j]) ||
class<KFWeaponPickup>(CurrentShop.SaleItems[j]).default.CorrespondingPerkIndex != PlayerVeterancy.default.PerkIndex)
{
continue;
}
if ( class<Deagle>(CurrentShop.SaleItems[j].default.InventoryType) != none )
{
if ( IsInInventory(class'DualDeaglePickup') )
{
continue;
}
}
if ( class<GoldenDeagle>(CurrentShop.SaleItems[j].default.InventoryType) != none )
{
if ( IsInInventory(class'GoldenDualDeaglePickup') )
{
continue;
}
}
if ( class<Magnum44Pistol>(CurrentShop.SaleItems[j].default.InventoryType) != none )
{
if ( IsInInventory(class'Dual44MagnumPickup') )
{
continue;
}
}
if ( class<DualDeagle>(CurrentShop.SaleItems[j].default.InventoryType) != none ||
class<Dual44Magnum>(CurrentShop.SaleItems[j].default.InventoryType) != none ||
class<GoldenDualDeagle>(CurrentShop.SaleItems[j].default.InventoryType) != none)
{
if ( IsInInventory(class'DeaglePickup') )
{
DualDivider = 2;
bZeroWeight = true;
}
else if ( IsInInventory(class'GoldenDeaglePickup') )
{
DualDivider = 2;
bZeroWeight = true;
}
else if ( IsInInventory(class'Magnum44Pickup') )
{
DualDivider = 2;
bZeroWeight = true;
}
}
else
{
DualDivider = 1;
bZeroWeight = false;
}
if ( ForSaleArrayIndex >= ForSaleBuyables.Length )
{
ForSaleBuyable = new class'GUIBuyable';
ForSaleBuyables[ForSaleBuyables.Length] = ForSaleBuyable;
}
else
{
ForSaleBuyable = ForSaleBuyables[ForSaleArrayIndex];
}
ForSaleArrayIndex++;
ForSalePickup = class<KFWeaponPickup>(CurrentShop.SaleItems[j]);
ForSaleBuyable.ItemName = ForSalePickup.default.ItemName;
ForSaleBuyable.ItemDescription = ForSalePickup.default.Description;
ForSaleBuyable.ItemCategorie = KFLR.EquipmentCategories[i].EquipmentCategoryName;
ForSaleBuyable.ItemImage = class<KFWeapon>(ForSalePickup.default.InventoryType).default.TraderInfoTexture;
ForSaleBuyable.ItemWeaponClass = class<KFWeapon>(ForSalePickup.default.InventoryType);
ForSaleBuyable.ItemAmmoClass = class<KFWeapon>(ForSalePickup.default.InventoryType).default.FireModeClass[0].default.AmmoClass;
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 = 0.f;
}
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;
}
}
// now the rest
for ( j = CurrentShop.SaleItems.length - 1; j >= 0; j-- )
{
if (CurrentShop.SaleItems[j] != none )
{
//Let's see if this is a vest, first aid kit, ammo or stuff we already have
if ( class<Vest>(CurrentShop.SaleItems[j]) != none || class<FirstAidKit>(CurrentShop.SaleItems[j]) != none ||
class<KFWeapon>(CurrentShop.SaleItems[j].default.InventoryType) == none || CurrentShop.SaleItems[j].IsA('Ammunition') ||
class<KFWeapon>(CurrentShop.SaleItems[j].default.InventoryType).default.bKFNeverThrow ||
IsInInventory(CurrentShop.SaleItems[j]) ||
class<KFWeaponPickup>(CurrentShop.SaleItems[j]).default.CorrespondingPerkIndex == PlayerVeterancy.default.PerkIndex )
{
continue;
}
if ( class<Deagle>(CurrentShop.SaleItems[j].default.InventoryType) != none )
{
if ( IsInInventory(class'DualDeaglePickup') )
{
continue;
}
}
if ( class<GoldenDeagle>(CurrentShop.SaleItems[j].default.InventoryType) != none )
{
if ( IsInInventory(class'GoldenDualDeaglePickup') )
{
continue;
}
}
if ( class<Magnum44Pistol>(CurrentShop.SaleItems[j].default.InventoryType) != none )
{
if ( IsInInventory(class'Dual44MagnumPickup') )
{
continue;
}
}
if ( class<DualDeagle>(CurrentShop.SaleItems[j].default.InventoryType) != none ||
class<Dual44Magnum>(CurrentShop.SaleItems[j].default.InventoryType) != none ||
class<GoldenDualDeagle>(CurrentShop.SaleItems[j].default.InventoryType) != none )
{
if ( IsInInventory(class'DeaglePickup') )
{
DualDivider = 2;
bZeroWeight = true;
}
else if ( IsInInventory(class'GoldenDeaglePickup') )
{
DualDivider = 2;
bZeroWeight = true;
}
else if ( IsInInventory(class'Magnum44Pickup') )
{
DualDivider = 2;
bZeroWeight = true;
}
}
else
{
DualDivider = 1;
bZeroWeight = false;
}
if ( ForSaleArrayIndex >= ForSaleBuyables.Length )
{
ForSaleBuyable = new class'GUIBuyable';
ForSaleBuyables[ForSaleBuyables.Length] = ForSaleBuyable;
}
else
{
ForSaleBuyable = ForSaleBuyables[ForSaleArrayIndex];
}
ForSaleArrayIndex++;
ForSalePickup = class<KFWeaponPickup>(CurrentShop.SaleItems[j]);
ForSaleBuyable.ItemName = ForSalePickup.default.ItemName;
ForSaleBuyable.ItemDescription = ForSalePickup.default.Description;
ForSaleBuyable.ItemCategorie = KFLR.EquipmentCategories[i].EquipmentCategoryName;
if ( class<KFWeapon>(ForSalePickup.default.InventoryType) != none )
{
ForSaleBuyable.ItemImage = class<KFWeapon>(ForSalePickup.default.InventoryType).default.TraderInfoTexture;
ForSaleBuyable.ItemWeaponClass = class<KFWeapon>(ForSalePickup.default.InventoryType);
ForSaleBuyable.ItemAmmoClass = class<KFWeapon>(ForSalePickup.default.InventoryType).default.FireModeClass[0].default.AmmoClass;
}
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 = 0.f;
}
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;
}
}
if ( ForSaleArrayIndex < ForSaleBuyables.Length )
{
ForSaleBuyables.Remove(ForSaleArrayIndex, ForSaleBuyables.Length);
}
//Now Update the list
UpdateList();
}

View file

@ -0,0 +1,62 @@
/*
--------------------------------------------------------------
KFTab_BuyMenu_Story
--------------------------------------------------------------
Main Trader Menu class
extended to add support for story elements.
Author : Alex Quick
--------------------------------------------------------------
*/
class KFTab_BuyMenu_Story extends KFTab_BuyMenu;
function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
Super.InitComponent(MyController, MyOwner);
FillInfoTextFromVolume();
}
function FillInfoTextFromVolume()
{
local KFShopVolume_Story CurrentPlayerShop;
if(KFPlayerController_Story(PlayerOwner()) != none)
{
CurrentplayerShop = KFPlayerController_Story(PlayerOwner()).CurrentShopVolume ;
if(CurrentPlayerShop != none &&
CurrentPlayerShop.WelcomeText != "")
{
InfoText[0] = CurrentPlayerShop.WelcomeText;
}
}
}
defaultproperties
{
Begin Object Class=KFBuyMenuSaleListBox_Story Name=SaleBox
OnCreateComponent=SaleBox.InternalOnCreateComponent
WinTop=0.064312
WinLeft=0.672632
WinWidth=0.325857
WinHeight=0.674039
End Object
SaleSelect=KFBuyMenuSaleListBox_Story'KFStoryUI.KFTab_BuyMenu_Story.SaleBox'
Begin Object Class=KFBuyMenuInvListBox_Story Name=InventoryBox
OnCreateComponent=InventoryBox.InternalOnCreateComponent
WinTop=0.070841
WinLeft=0.000108
WinWidth=0.328204
WinHeight=0.521856
End Object
InvSelect=KFBuyMenuInvListBox_Story'KFStoryUI.KFTab_BuyMenu_Story.InventoryBox'
}

View file

@ -0,0 +1,22 @@
class LobbyFooter_Story extends LobbyFooter;
/* Set ready up on the server for late joining players */
function bool OnFooterClick(GUIComponent Sender)
{
local PlayerController PC;
/*
if(Sender == b_Ready)
{
PC = PlayerOwner();
if ( PC.PlayerReplicationInfo.Team != none &&
!PC.PlayerReplicationInfo.bReadyToPlay)
{
if(KFPlayerController_Story(PC) != none)
{
KFPlayerController_Story(PC).ServerReadyLateJoiner();
}
}
}
*/
return Super.OnFooterClick(Sender);
}

View file

@ -0,0 +1,29 @@
//-----------------------------------------------------------
//
//-----------------------------------------------------------
class LobbyMenu_Story extends LobbyMenu;
DefaultProperties
{
/* clear this stuff out ,'cuz its not really useful in Obj/Story mode ...
Slotting in dummy objects so I dont have to overide InternalOnPreDraw
(if I set the vars to none it would spam the log to hell) */
Begin Object Class=GUIImage Name=DummyBG
End Object
WaveBG=DummyBG
Begin Object Class=GUILabel Name=DummyWaveText
End Object
WaveLabel=DummyWaveText
Begin Object Class=LobbyFooter_Story Name=StoryLobbyFooter
RenderWeight=0.300000
TabOrder=8
bBoundToParent=False
bScaleToParent=False
OnPreDraw=BuyFooter.InternalOnPreDraw
ToolTip=none
End Object
t_Footer=LobbyFooter_Story'KFStoryUI.LobbyMenu_Story.StoryLobbyFooter'
}

View file

@ -0,0 +1,14 @@
<html>
<head><title>Index of /kf_sources/KFStoryUI/Classes/</title></head>
<body>
<h1>Index of /kf_sources/KFStoryUI/Classes/</h1><hr><pre><a href="../">../</a>
<a href="GUIBuyMenu_Story.uc">GUIBuyMenu_Story.uc</a> 06-Oct-2019 10:27 3365
<a href="KFBuyMenuInvListBox_Story.uc">KFBuyMenuInvListBox_Story.uc</a> 06-Oct-2019 10:27 409
<a href="KFBuyMenuInvList_Story.uc">KFBuyMenuInvList_Story.uc</a> 06-Oct-2019 10:27 12492
<a href="KFBuyMenuSaleListBox_Story.uc">KFBuyMenuSaleListBox_Story.uc</a> 06-Oct-2019 10:27 485
<a href="KFBuyMenuSaleList_Story.uc">KFBuyMenuSaleList_Story.uc</a> 06-Oct-2019 10:27 9904
<a href="KFTab_BuyMenu_Story.uc">KFTab_BuyMenu_Story.uc</a> 06-Oct-2019 10:27 1593
<a href="LobbyFooter_Story.uc">LobbyFooter_Story.uc</a> 06-Oct-2019 10:27 579
<a href="LobbyMenu_Story.uc">LobbyMenu_Story.uc</a> 06-Oct-2019 10:27 878
</pre><hr></body>
</html>

View file

@ -0,0 +1,7 @@
<html>
<head><title>Index of /kf_sources/KFStoryUI/</title></head>
<body>
<h1>Index of /kf_sources/KFStoryUI/</h1><hr><pre><a href="../">../</a>
<a href="Classes/">Classes/</a> 29-Jun-2025 19:43 -
</pre><hr></body>
</html>