2017-10-20 02:00:49 +00:00
|
|
|
class ExtPerksContainer_Selection extends KFGFxPerksContainer_Selection;
|
|
|
|
|
2021-01-17 21:55:45 +00:00
|
|
|
var localized string PerkChangeWarning;
|
|
|
|
|
2017-10-20 02:00:49 +00:00
|
|
|
function UpdatePerkSelection(byte SelectedPerkIndex)
|
|
|
|
{
|
|
|
|
local int i;
|
|
|
|
local GFxObject DataProvider;
|
|
|
|
local GFxObject TempObj;
|
|
|
|
local ExtPlayerController KFPC;
|
2023-05-14 02:49:12 +00:00
|
|
|
local Ext_PerkBase PerkClass;
|
2017-10-20 02:00:49 +00:00
|
|
|
|
2020-11-28 20:04:55 +00:00
|
|
|
KFPC = ExtPlayerController(GetPC());
|
2017-10-20 02:00:49 +00:00
|
|
|
|
2020-11-28 20:04:55 +00:00
|
|
|
if (KFPC!=none && KFPC.ActivePerkManager!=None)
|
2017-10-20 02:00:49 +00:00
|
|
|
{
|
|
|
|
DataProvider = CreateArray();
|
|
|
|
|
|
|
|
for (i = 0; i < KFPC.ActivePerkManager.UserPerks.Length; i++)
|
|
|
|
{
|
|
|
|
PerkClass = KFPC.ActivePerkManager.UserPerks[i];
|
2020-11-28 20:04:55 +00:00
|
|
|
TempObj = CreateObject("Object");
|
|
|
|
TempObj.SetInt("PerkLevel", PerkClass.CurrentLevel);
|
2023-05-14 02:49:12 +00:00
|
|
|
TempObj.SetString("Title", PerkClass.PerkName);
|
2020-11-28 20:04:55 +00:00
|
|
|
TempObj.SetString("iconSource", PerkClass.GetPerkIconPath(PerkClass.CurrentLevel));
|
2017-10-20 02:00:49 +00:00
|
|
|
TempObj.SetBool("bTierUnlocked", true);
|
2023-05-14 02:49:12 +00:00
|
|
|
|
2020-11-28 20:04:55 +00:00
|
|
|
DataProvider.SetElementObject(i, TempObj);
|
2023-05-14 02:49:12 +00:00
|
|
|
}
|
2020-11-28 20:04:55 +00:00
|
|
|
SetObject("perkData", DataProvider);
|
2017-10-20 02:00:49 +00:00
|
|
|
SetInt("SelectedIndex", SelectedPerkIndex);
|
|
|
|
|
|
|
|
UpdatePendingPerkInfo(SelectedPerkIndex);
|
2020-11-28 19:53:57 +00:00
|
|
|
}
|
2017-10-20 02:00:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function UpdatePendingPerkInfo(byte SelectedPerkIndex)
|
|
|
|
{
|
|
|
|
local ExtPlayerController KFPC;
|
|
|
|
local Ext_PerkBase PerkClass;
|
|
|
|
|
2020-11-28 20:04:55 +00:00
|
|
|
KFPC = ExtPlayerController(GetPC());
|
2020-11-28 20:12:58 +00:00
|
|
|
if (KFPC != none)
|
2017-10-20 02:00:49 +00:00
|
|
|
{
|
|
|
|
PerkClass = KFPC.ActivePerkManager.UserPerks[SelectedPerkIndex];
|
2021-01-17 21:55:45 +00:00
|
|
|
SetPendingPerkChanges(PerkClass.PerkName, PerkClass.GetPerkIconPath(PerkClass.CurrentLevel), PerkChangeWarning);
|
2017-10-20 02:00:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function SavePerk(int PerkID);
|