2017-10-20 02:00:49 +00:00
class ExtPerksContainer _Selection extends KFGFxPerksContainer _Selection ;
function UpdatePerkSelection ( byte SelectedPerkIndex )
{
local int i ;
local GFxObject DataProvider ;
local GFxObject TempObj ;
local ExtPlayerController KFPC ;
local Ext _PerkBase PerkClass ;
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 ) ;
TempObj . SetString ( "Title" , PerkClass . PerkName ) ;
TempObj . SetString ( "iconSource" , PerkClass . GetPerkIconPath ( PerkClass . CurrentLevel ) ) ;
2017-10-20 02:00:49 +00:00
TempObj . SetBool ( "bTierUnlocked" , true ) ;
2020-11-28 20:04:55 +00:00
DataProvider . SetElementObject ( i , TempObj ) ;
2017-10-20 02:00:49 +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-15 09:02:32 +00:00
SetPendingPerkChanges ( PerkClass . PerkName , PerkClass . GetPerkIconPath ( PerkClass . CurrentLevel ) , "Perk changes will be applied when you die." ) ; // TODO: Localization
2017-10-20 02:00:49 +00:00
}
}
function SavePerk ( int PerkID ) ;