2022-08-17 18:25:39 +00:00
|
|
|
class MSKGS_GFxMenu_Perks extends KFGFxMenu_Perks
|
|
|
|
dependson(MSKGS_GFxPerksContainer_Selection);
|
|
|
|
|
|
|
|
function PerkChanged(byte NewPerkIndex, bool bClickedIndex)
|
|
|
|
{
|
|
|
|
local KFGameReplicationInfo KFGRI;
|
|
|
|
local MSKGS_PlayerController MSKGSPC;
|
|
|
|
|
|
|
|
if (KFPC == None) return;
|
|
|
|
|
|
|
|
KFGRI = KFGameReplicationInfo(KFPC.WorldInfo.GRI);
|
|
|
|
MSKGSPC = MSKGS_PlayerController(KFPC);
|
|
|
|
|
|
|
|
if (KFGRI == None || MSKGSPC == None) return;
|
|
|
|
|
|
|
|
if (!MSKGSPC.IsPerkAllowed(MSKGSPC.PerkList[NewPerkIndex])) return;
|
|
|
|
|
|
|
|
UpdateSkillsHolder(MSKGSPC.PerkList[NewPerkIndex].PerkClass);
|
|
|
|
|
|
|
|
bChangesMadeDuringLobby = !IsMatchStarted();
|
|
|
|
|
|
|
|
if (bClickedIndex)
|
|
|
|
{
|
|
|
|
LastPerkIndex = NewPerkIndex;
|
|
|
|
bModifiedPerk = true;
|
|
|
|
|
2022-12-07 20:27:51 +00:00
|
|
|
if (MSKGSPC.Pawn == None || !MSKGSPC.Pawn.IsAliveAndWell() || KFGRI.bTraderIsOpen)
|
2022-08-17 18:25:39 +00:00
|
|
|
{
|
|
|
|
SavePerkData();
|
|
|
|
SelectionContainer.SavePerk( NewPerkIndex );
|
|
|
|
Manager.CachedProfile.SetProfileSettingValueInt( KFID_SavedPerkIndex, NewPerkIndex );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-10-21 10:46:39 +00:00
|
|
|
PreviewPerkIndex = NewPerkIndex;
|
|
|
|
|
2022-08-17 18:25:39 +00:00
|
|
|
UpdateContainers(MSKGSPC.PerkList[NewPerkIndex].PerkClass, bClickedIndex);
|
|
|
|
}
|
|
|
|
|
|
|
|
defaultproperties
|
|
|
|
{
|
|
|
|
SubWidgetBindings.Remove((WidgetName="SelectionContainer",WidgetClass=class'KFGFxPerksContainer_Selection'))
|
|
|
|
SubWidgetBindings.Add((WidgetName="SelectionContainer",WidgetClass=class'MSKGS_GFxPerksContainer_Selection'))
|
|
|
|
}
|