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

56 lines
1.8 KiB
Ucode
Raw Normal View History

2017-10-20 02:00:49 +00:00
class ExtMenu_Trader extends KFGFxMenu_Trader;
var ExtPlayerController ExtKFPC;
var Ext_PerkBase ExLastPerkClass;
2020-11-28 20:04:55 +00:00
function InitializeMenu(KFGFxMoviePlayer_Manager InManager)
2017-10-20 02:00:49 +00:00
{
Super.InitializeMenu(InManager);
2020-11-28 20:04:55 +00:00
ExtKFPC = ExtPlayerController (GetPC());
2017-10-20 02:00:49 +00:00
}
2020-11-28 21:54:57 +00:00
2017-10-20 02:00:49 +00:00
function int GetPerkIndex()
{
return (ExtKFPC.ActivePerkManager!=None ? Max(ExtKFPC.ActivePerkManager.UserPerks.Find(ExtKFPC.ActivePerkManager.CurrentPerk),0) : 0);
}
2020-11-28 21:54:57 +00:00
2017-10-20 02:00:49 +00:00
function UpdatePlayerInfo()
{
2020-11-28 20:12:58 +00:00
if (ExtKFPC != none && PlayerInfoContainer != none)
2017-10-20 02:00:49 +00:00
{
PlayerInfoContainer.SetPerkInfo();
PlayerInfoContainer.SetPerkList();
2020-11-28 20:12:58 +00:00
if (ExtKFPC.ActivePerkManager!=None && ExtKFPC.ActivePerkManager.CurrentPerk!=ExLastPerkClass)
2017-10-20 02:00:49 +00:00
{
ExLastPerkClass = ExtKFPC.ActivePerkManager.CurrentPerk;
OnPerkChanged(GetPerkIndex());
}
RefreshItemComponents();
}
}
function Callback_PerkChanged(int PerkIndex)
{
ExtKFPC.PendingPerkClass = ExtKFPC.ActivePerkManager.UserPerks[PerkIndex].Class;
ExtKFPC.SwitchToPerk(ExtKFPC.PendingPerkClass);
2020-11-28 20:12:58 +00:00
if (PlayerInventoryContainer != none)
2017-10-20 02:00:49 +00:00
{
PlayerInventoryContainer.UpdateLock();
}
UpdatePlayerInfo();
// Refresht he UI
RefreshItemComponents();
}
defaultproperties
{
SubWidgetBindings.Remove((WidgetName="filterContainer",WidgetClass=class'KFGFxTraderContainer_Filter'))
SubWidgetBindings.Add((WidgetName="filterContainer",WidgetClass=class'ExtTraderContainer_Filter'))
SubWidgetBindings.Remove((WidgetName="shopContainer",WidgetClass=class'KFGFxTraderContainer_Store'))
SubWidgetBindings.Add((WidgetName="shopContainer",WidgetClass=class'ExtTraderContainer_Store'))
SubWidgetBindings.Remove((WidgetName="playerInfoContainer",WidgetClass=class'KFGFxTraderContainer_PlayerInfo'))
SubWidgetBindings.Add((WidgetName="playerInfoContainer",WidgetClass=class'ExtTraderContainer_PlayerInfo'))
}