KF2-Server-Extension/ServerExt/Classes/ExtPerksContainer_Details.uc

62 lines
1.8 KiB
Ucode
Raw Normal View History

2017-10-20 02:00:49 +00:00
class ExtPerksContainer_Details extends KFGFxPerksContainer_Details;
2020-11-28 20:12:58 +00:00
`define AddWeaponsInfo(InClassDef) if (`InClassDef!=None) AddWeaponInfo(WeaponNames, WeaponSources, `InClassDef.static.GetItemName(), `InClassDef.static.GetImagePath())
2017-10-20 02:00:49 +00:00
2020-11-28 20:04:55 +00:00
final function ExUpdateDetails(Ext_PerkBase PerkClass)
2017-10-20 02:00:49 +00:00
{
local GFxObject DetailsProvider;
local KFPlayerController KFPC;
local KFGameReplicationInfo KFGRI;
local array<string> WeaponNames;
local array<string> WeaponSources;
local int i;
2020-11-28 20:04:55 +00:00
DetailsProvider = CreateObject("Object");
2017-10-20 02:00:49 +00:00
2020-11-28 20:04:55 +00:00
KFPC = KFPlayerController(GetPC());
2017-10-20 02:00:49 +00:00
2020-11-28 20:04:55 +00:00
if (KFPC != none)
2017-10-20 02:00:49 +00:00
{
KFGRI = KFGameReplicationInfo(KFPC.WorldInfo.GRI);
2020-11-28 20:04:55 +00:00
DetailsProvider.SetString("ExperienceMessage", ExperienceString @ PerkClass.CurrentEXP);
2017-10-20 02:00:49 +00:00
2020-11-28 20:12:58 +00:00
if (KFGRI != none)
2017-10-20 02:00:49 +00:00
{
`AddWeaponsInfo(PerkClass.PrimaryWeaponDef);
`AddWeaponsInfo(PerkClass.SecondaryWeaponDef);
`AddWeaponsInfo(PerkClass.KnifeWeaponDef);
`AddWeaponsInfo(PerkClass.GrenadeWeaponDef);
}
for (i = 0; i < WeaponNames.length; i++)
{
2020-11-28 20:04:55 +00:00
DetailsProvider.SetString("WeaponName" $ i, WeaponNames[i]);
DetailsProvider.SetString("WeaponImage" $ i, "img://"$WeaponSources[i]);
2017-10-20 02:00:49 +00:00
}
2020-11-28 20:04:55 +00:00
DetailsProvider.SetString("EXPAction1", "Kill zombies");
//DetailsProvider.SetString("EXPAction2", PerkClass.default.EXPAction2);
2017-10-20 02:00:49 +00:00
2020-11-28 20:04:55 +00:00
SetObject("detailsData", DetailsProvider);
2017-10-20 02:00:49 +00:00
}
}
2020-11-28 20:04:55 +00:00
final function ExUpdatePassives(Ext_PerkBase PerkClass)
2017-10-20 02:00:49 +00:00
{
local GFxObject PassivesProvider;
local GFxObject PassiveObject;
local int i;
PassivesProvider = CreateArray();
2020-11-28 20:12:58 +00:00
for (i=0; i<PerkClass.PerkStats.Length; ++i)
2017-10-20 02:00:49 +00:00
{
2020-11-28 20:04:55 +00:00
PassiveObject = CreateObject("Object");
PassiveObject.SetString("PassiveTitle", PerkClass.GetStatUIStr(i));
PassiveObject.SetString("PerkBonusModifier", "");
PassiveObject.SetString("PerkBonusAmount", "");
PassivesProvider.SetElementObject(i, PassiveObject);
2017-10-20 02:00:49 +00:00
}
2020-11-28 20:04:55 +00:00
SetObject("passivesData", PassivesProvider);
2017-10-20 02:00:49 +00:00
}