RPL
This commit is contained in:
@ -32,5 +32,5 @@ protected function DistributeMoneyAndXP(class<KFPawn_Monster> MonsterClass, cons
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
|
||||
KFGFxManagerClass = class'MSKGS_GFxMoviePlayer_Manager'
|
||||
}
|
||||
|
42
MSKGS/Classes/MSKGS_GFxMenu_Perks.uc
Normal file
42
MSKGS/Classes/MSKGS_GFxMenu_Perks.uc
Normal file
@ -0,0 +1,42 @@
|
||||
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;
|
||||
|
||||
if (MSKGSPC.Pawn == None || !MSKGSPC.Pawn.IsAliveAndWell())
|
||||
{
|
||||
SavePerkData();
|
||||
SelectionContainer.SavePerk( NewPerkIndex );
|
||||
Manager.CachedProfile.SetProfileSettingValueInt( KFID_SavedPerkIndex, NewPerkIndex );
|
||||
}
|
||||
}
|
||||
|
||||
UpdateContainers(MSKGSPC.PerkList[NewPerkIndex].PerkClass, bClickedIndex);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
SubWidgetBindings.Remove((WidgetName="SelectionContainer",WidgetClass=class'KFGFxPerksContainer_Selection'))
|
||||
SubWidgetBindings.Add((WidgetName="SelectionContainer",WidgetClass=class'MSKGS_GFxPerksContainer_Selection'))
|
||||
}
|
8
MSKGS/Classes/MSKGS_GFxMenu_Trader.uc
Normal file
8
MSKGS/Classes/MSKGS_GFxMenu_Trader.uc
Normal file
@ -0,0 +1,8 @@
|
||||
class MSKGS_GFxMenu_Trader extends KFGFxMenu_Trader
|
||||
dependsOn(MSKGS_GFxTraderContainer_Store);
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
SubWidgetBindings.Remove((WidgetName="shopContainer",WidgetClass=class'KFGFxTraderContainer_Store'))
|
||||
SubWidgetBindings.Add((WidgetName="shopContainer",WidgetClass=class'MSKGS_GFxTraderContainer_Store'))
|
||||
}
|
11
MSKGS/Classes/MSKGS_GFxMoviePlayer_Manager.uc
Normal file
11
MSKGS/Classes/MSKGS_GFxMoviePlayer_Manager.uc
Normal file
@ -0,0 +1,11 @@
|
||||
class MSKGS_GFxMoviePlayer_Manager extends KFGFxMoviePlayer_Manager
|
||||
dependson(MSKGS_GFxMenu_Perks);
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
WidgetBindings.Remove((WidgetName="PerksMenu",WidgetClass=class'KFGFxMenu_Perks'))
|
||||
WidgetBindings.Add((WidgetName="PerksMenu",WidgetClass=class'MSKGS_GFxMenu_Perks'))
|
||||
|
||||
WidgetBindings.Remove((WidgetName="traderMenu",WidgetClass=class'KFGFxMenu_Trader'))
|
||||
WidgetBindings.Add((WidgetName="traderMenu",WidgetClass=class'MSKGS_GFxMenu_Trader'))
|
||||
}
|
11
MSKGS/Classes/MSKGS_GFxMoviePlayer_Manager_Versus.uc
Normal file
11
MSKGS/Classes/MSKGS_GFxMoviePlayer_Manager_Versus.uc
Normal file
@ -0,0 +1,11 @@
|
||||
class MSKGS_GFxMoviePlayer_Manager_Versus extends KFGFxMoviePlayer_Manager_Versus
|
||||
dependson(MSKGS_GFxMenu_Perks, MSKGS_GFxMenu_Trader);
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
WidgetBindings.Remove((WidgetName="PerksMenu",WidgetClass=class'KFGFxMenu_Perks'))
|
||||
WidgetBindings.Add((WidgetName="PerksMenu",WidgetClass=class'MSKGS_GFxMenu_Perks'))
|
||||
|
||||
WidgetBindings.Remove((WidgetName="traderMenu",WidgetClass=class'KFGFxMenu_Trader'))
|
||||
WidgetBindings.Add((WidgetName="traderMenu",WidgetClass=class'MSKGS_GFxMenu_Trader'))
|
||||
}
|
51
MSKGS/Classes/MSKGS_GFxPerksContainer_Selection.uc
Normal file
51
MSKGS/Classes/MSKGS_GFxPerksContainer_Selection.uc
Normal file
@ -0,0 +1,51 @@
|
||||
class MSKGS_GFxPerksContainer_Selection extends KFGFxPerksContainer_Selection;
|
||||
|
||||
var const Texture2D NegativeIcon;
|
||||
|
||||
function UpdatePerkSelection(byte SelectedPerkIndex)
|
||||
{
|
||||
local int Index;
|
||||
local GFxObject DataProvider;
|
||||
local GFxObject TempObj;
|
||||
local MSKGS_PlayerController MSKGSPC;
|
||||
local byte bTierUnlocked;
|
||||
local int UnlockedPerkLevel;
|
||||
local PerkInfo PerkInfo;
|
||||
|
||||
MSKGSPC = MSKGS_PlayerController(GetPC());
|
||||
|
||||
if (MSKGSPC == None) return;
|
||||
|
||||
DataProvider = CreateArray();
|
||||
|
||||
foreach MSKGSPC.PerkList(PerkInfo, Index)
|
||||
{
|
||||
class'KFPerk'.static.LoadTierUnlockFromConfig(PerkInfo.PerkClass, bTierUnlocked, UnlockedPerkLevel);
|
||||
TempObj = CreateObject("Object");
|
||||
TempObj.SetInt("PerkLevel", PerkInfo.PerkLevel);
|
||||
TempObj.SetString("Title", PerkInfo.PerkClass.default.PerkName);
|
||||
if (MSKGSPC.IsPerkAllowed(PerkInfo))
|
||||
{
|
||||
TempObj.SetString("iconSource", "img://" $ PerkInfo.PerkClass.static.GetPerkIconPath());
|
||||
TempObj.SetBool("bPerkAllowed", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
TempObj.SetString("iconSource", "img://" $ PathName(NegativeIcon));
|
||||
TempObj.SetBool("bPerkAllowed", false);
|
||||
}
|
||||
TempObj.SetBool("bTierUnlocked", bool(bTierUnlocked) && PerkInfo.PerkLevel >= UnlockedPerkLevel);
|
||||
DataProvider.SetElementObject(Index, TempObj);
|
||||
}
|
||||
|
||||
SetObject("perkData", DataProvider);
|
||||
SetInt("SelectedIndex", SelectedPerkIndex);
|
||||
SetInt("ActiveIndex", SelectedPerkIndex);
|
||||
|
||||
UpdatePendingPerkInfo(SelectedPerkIndex);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
NegativeIcon = Texture2D'UI_VoiceComms_TEX.UI_VoiceCommand_Icon_Negative'
|
||||
}
|
20
MSKGS/Classes/MSKGS_GFxTraderContainer_Store.uc
Normal file
20
MSKGS/Classes/MSKGS_GFxTraderContainer_Store.uc
Normal file
@ -0,0 +1,20 @@
|
||||
class MSKGS_GFxTraderContainer_Store extends KFGFxTraderContainer_Store;
|
||||
|
||||
function bool IsItemFiltered(STraderItem Item, optional bool bDebug)
|
||||
{
|
||||
if (KFPC.GetPurchaseHelper().IsInOwnedItemList(Item.ClassName))
|
||||
return true;
|
||||
if (KFPC.GetPurchaseHelper().IsInOwnedItemList(Item.DualClassName))
|
||||
return true;
|
||||
if (!KFPC.GetPurchaseHelper().IsSellable(Item))
|
||||
return true;
|
||||
if (Item.WeaponDef.default.PlatformRestriction != PR_All && class'KFUnlockManager'.static.IsPlatformRestricted(Item.WeaponDef.default.PlatformRestriction))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
|
||||
}
|
@ -7,7 +7,11 @@ enum E_MSKGS_LocalMessageType
|
||||
MSKGS_PlayerGiveBoostToServerMax,
|
||||
MSKGS_BoosterLeaveServer,
|
||||
MSKGS_BoosterLeaveServerMax,
|
||||
MSKGS_BoosterLeaveServerNoBoost
|
||||
MSKGS_BoosterLeaveServerNoBoost,
|
||||
|
||||
MSKGS_AllowedLevels,
|
||||
MSKGS_UnsuitablePerksLocked,
|
||||
MSKGS_NoPerksDisconnect
|
||||
};
|
||||
|
||||
var const String PlayerGivesBoostDefault;
|
||||
@ -23,6 +27,13 @@ var private localized String PlayerLeft;
|
||||
var const String NoBoostDefault;
|
||||
var private localized String NoBoost;
|
||||
|
||||
var const String AllowedLevelsDefault;
|
||||
var private localized String AllowedLevels;
|
||||
var const String UnsuitablePerksLockedDefault;
|
||||
var private localized String UnsuitablePerksLocked;
|
||||
var const String NoPerksDisconnectDefault;
|
||||
var private localized String NoPerksDisconnect;
|
||||
|
||||
private static function String ReplPlayer(String Str, String Player)
|
||||
{
|
||||
return Repl(Str, "<player>", Player, false);
|
||||
@ -38,6 +49,21 @@ private static function String ReplTotalBoost(String Str, String Boost)
|
||||
return Repl(Str, "<totalboost>", Boost, false);
|
||||
}
|
||||
|
||||
private static function String ReplMinLevel(String Str, String MinLevel)
|
||||
{
|
||||
return Repl(Str, "<minlevel>", MinLevel, false);
|
||||
}
|
||||
|
||||
private static function String ReplMaxLevel(String Str, String MaxLevel)
|
||||
{
|
||||
return Repl(Str, "<maxlevel>", MaxLevel, false);
|
||||
}
|
||||
|
||||
private static function String ReplDisconnectTime(String Str, String DisconnectTime)
|
||||
{
|
||||
return Repl(Str, "<disconnecttime>", DisconnectTime, false);
|
||||
}
|
||||
|
||||
public static function String GetLocalizedString(
|
||||
E_LogLevel LogLevel,
|
||||
E_MSKGS_LocalMessageType LMT,
|
||||
@ -97,6 +123,21 @@ public static function String GetLocalizedString(
|
||||
@ (default.NoBoost != "" ? default.NoBoost : default.NoBoostDefault);
|
||||
RV = ReplPlayer(RV, String1);
|
||||
break;
|
||||
|
||||
case MSKGS_AllowedLevels:
|
||||
RV = (default.AllowedLevels != "" ? default.AllowedLevels : default.AllowedLevelsDefault);
|
||||
RV = ReplMinLevel(RV, String1);
|
||||
RV = ReplMaxLevel(RV, String2);
|
||||
break;
|
||||
|
||||
case MSKGS_UnsuitablePerksLocked:
|
||||
RV = (default.UnsuitablePerksLocked != "" ? default.UnsuitablePerksLocked : default.UnsuitablePerksLockedDefault);
|
||||
break;
|
||||
|
||||
case MSKGS_NoPerksDisconnect:
|
||||
RV = (default.NoPerksDisconnect != "" ? default.NoPerksDisconnect : default.NoPerksDisconnectDefault);
|
||||
RV = ReplDisconnectTime(RV, String1);
|
||||
break;
|
||||
}
|
||||
|
||||
return RV;
|
||||
@ -110,4 +151,8 @@ defaultproperties
|
||||
MaxDefault = "(MAX)"
|
||||
PlayerLeftDefault = "<player> left the server."
|
||||
NoBoostDefault = "Now there is no XP boost."
|
||||
|
||||
AllowedLevelsDefault = "Allowed levels: <minlevel> - <maxlevel>"
|
||||
UnsuitablePerksLockedDefault = "Perks with unsuitable level are locked"
|
||||
NoPerksDisconnectDefault = "You don't have perks with required level. Disconnect after <disconnecttime> seconds..."
|
||||
}
|
||||
|
@ -32,5 +32,5 @@ protected function DistributeMoneyAndXP(class<KFPawn_Monster> MonsterClass, cons
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
|
||||
KFGFxManagerClass = class'MSKGS_GFxMoviePlayer_Manager'
|
||||
}
|
||||
|
230
MSKGS/Classes/MSKGS_PlayerController.uc
Normal file
230
MSKGS/Classes/MSKGS_PlayerController.uc
Normal file
@ -0,0 +1,230 @@
|
||||
class MSKGS_PlayerController extends KFPlayerController;
|
||||
|
||||
var public MSKGS_RepInfo RepInfo;
|
||||
var public byte MinLevel, MaxLevel;
|
||||
var public int DisconnectTimer;
|
||||
var public String HexColorInfo;
|
||||
var public String HexColorWarn;
|
||||
var public String HexColorError;
|
||||
|
||||
var private KFGameReplicationInfo KFGRI;
|
||||
|
||||
var private bool StatsInitialized;
|
||||
var private KFGFxWidget_PartyInGame PartyInGameWidget;
|
||||
var private bool bChatMessageRecieved;
|
||||
|
||||
replication
|
||||
{
|
||||
if (bNetInitial && Role == ROLE_Authority)
|
||||
RepInfo, MinLevel, MaxLevel, DisconnectTimer,
|
||||
HexColorInfo, HexColorWarn, HexColorError;
|
||||
}
|
||||
|
||||
public simulated event PreBeginPlay()
|
||||
{
|
||||
super.PreBeginPlay();
|
||||
}
|
||||
|
||||
public simulated event PostBeginPlay()
|
||||
{
|
||||
super.PostBeginPlay();
|
||||
}
|
||||
|
||||
private simulated function KFGameReplicationInfo GetKFGRI()
|
||||
{
|
||||
if (KFGRI == None)
|
||||
{
|
||||
KFGRI = KFGameReplicationInfo(WorldInfo.GRI);
|
||||
}
|
||||
|
||||
return KFGRI;
|
||||
}
|
||||
|
||||
private simulated function SetPartyInGameWidget()
|
||||
{
|
||||
if (MyGFxManager == None) return;
|
||||
if (MyGFxManager.PartyWidget == None) return;
|
||||
|
||||
PartyInGameWidget = KFGFxWidget_PartyInGame(MyGFxManager.PartyWidget);
|
||||
}
|
||||
|
||||
private simulated function bool CheckPartyInGameWidget()
|
||||
{
|
||||
if (PartyInGameWidget == None)
|
||||
{
|
||||
SetPartyInGameWidget();
|
||||
}
|
||||
|
||||
return (PartyInGameWidget != None);
|
||||
}
|
||||
|
||||
private simulated function HideReadyButton()
|
||||
{
|
||||
if (CheckPartyInGameWidget())
|
||||
{
|
||||
PartyInGameWidget.SetReadyButtonVisibility(false);
|
||||
}
|
||||
}
|
||||
|
||||
private simulated function ShowReadyButton()
|
||||
{
|
||||
if (CheckPartyInGameWidget())
|
||||
{
|
||||
PartyInGameWidget.SetReadyButtonVisibility(true);
|
||||
PartyInGameWidget.UpdateReadyButtonText();
|
||||
PartyInGameWidget.UpdateReadyButtonVisibility();
|
||||
}
|
||||
}
|
||||
|
||||
private simulated function NoPerkDisconnect()
|
||||
{
|
||||
if (CheckPartyInGameWidget())
|
||||
{
|
||||
if (!bChatMessageRecieved)
|
||||
{
|
||||
RepInfo.WriteToChatLocalized(
|
||||
MSKGS_NoPerksDisconnect,
|
||||
HexColorError,
|
||||
String(DisconnectTimer));
|
||||
bChatMessageRecieved = true;
|
||||
}
|
||||
|
||||
if (DisconnectTimer-- <= 0)
|
||||
{
|
||||
ClearTimer(nameof(HideReadyButton));
|
||||
ClearTimer(nameof(NoPerkDisconnect));
|
||||
ClientWasKicked();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private simulated function PerksLocked()
|
||||
{
|
||||
if (CheckPartyInGameWidget() && !bChatMessageRecieved)
|
||||
{
|
||||
ClearTimer(nameof(PerksLocked));
|
||||
RepInfo.WriteToChatLocalized(
|
||||
MSKGS_UnsuitablePerksLocked,
|
||||
HexColorWarn);
|
||||
bChatMessageRecieved = true;
|
||||
}
|
||||
}
|
||||
|
||||
public simulated function OnStatsInitialized(bool bWasSuccessful)
|
||||
{
|
||||
Super.OnStatsInitialized(bWasSuccessful);
|
||||
StatsInitialized = true;
|
||||
RequestPerkChange(CheckCurrentPerkAllowed());
|
||||
}
|
||||
|
||||
public reliable server function ServerHidePerks()
|
||||
{
|
||||
HidePerks();
|
||||
ClientHidePerks();
|
||||
}
|
||||
|
||||
private reliable client function ClientHidePerks()
|
||||
{
|
||||
HidePerks();
|
||||
}
|
||||
|
||||
private simulated function HidePerks()
|
||||
{
|
||||
local int Index;
|
||||
|
||||
if (GetKFGRI() == None)
|
||||
{
|
||||
SetTimer(0.1f, false, nameof(HidePerks));
|
||||
return;
|
||||
}
|
||||
|
||||
for (Index = PerkList.length - 1; Index >= 0; --Index)
|
||||
{
|
||||
if (!KFGRI.IsPerkAllowed(PerkList[Index].PerkClass))
|
||||
{
|
||||
PerkList.Remove(Index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
SavedPerkIndex = CheckCurrentPerkAllowed();
|
||||
}
|
||||
|
||||
public simulated function byte CheckCurrentPerkAllowed()
|
||||
{
|
||||
local PerkInfo Perk;
|
||||
|
||||
if (SavedPerkIndex >= PerkList.length || !IsPerkAllowed(PerkList[SavedPerkIndex]))
|
||||
{
|
||||
SavedPerkIndex = 0;
|
||||
for (SavedPerkIndex = 0; SavedPerkIndex < PerkList.length; SavedPerkIndex++)
|
||||
{
|
||||
if (IsPerkAllowed(PerkList[SavedPerkIndex]))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (SavedPerkIndex >= PerkList.length)
|
||||
{
|
||||
SavedPerkIndex = 0;
|
||||
if (StatsInitialized && ROLE < ROLE_Authority)
|
||||
{
|
||||
SetTimer(0.1f, true, nameof(HideReadyButton));
|
||||
SetTimer(1.0f, true, nameof(NoPerkDisconnect));
|
||||
}
|
||||
}
|
||||
else if (StatsInitialized && ROLE < ROLE_Authority)
|
||||
{
|
||||
foreach PerkList(Perk)
|
||||
{
|
||||
if (!IsPerkAllowed(Perk))
|
||||
{
|
||||
SetTimer(1.0f, true, nameof(PerksLocked));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return SavedPerkIndex;
|
||||
}
|
||||
|
||||
public simulated function bool IsPerkAllowed(PerkInfo Perk)
|
||||
{
|
||||
local bool PerkAllowed;
|
||||
|
||||
PerkAllowed = true;
|
||||
|
||||
if (GetKFGRI() != None)
|
||||
{
|
||||
PerkAllowed = KFGRI.IsPerkAllowed(Perk.PerkClass);
|
||||
}
|
||||
|
||||
return (PerkAllowed && Perk.PerkLevel >= MinLevel && Perk.PerkLevel <= MaxLevel);
|
||||
}
|
||||
|
||||
public simulated function InitPerkLoadout()
|
||||
{
|
||||
if (CurrentPerk == None) // Problem here: it is NONE for some reason
|
||||
{
|
||||
CurrentPerk = GetPerk(); // even after that
|
||||
// dunno where and how it is initialized
|
||||
// and why it dont happened now
|
||||
}
|
||||
|
||||
Super.InitPerkLoadout();
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
StatsInitialized = false
|
||||
bChatMessageRecieved = false
|
||||
|
||||
DisconnectTimer = 15
|
||||
MinLevel = 0
|
||||
MaxLevel = 25
|
||||
|
||||
HexColorInfo = "0000FF"
|
||||
HexColorWarn = "FFFF00"
|
||||
HexColorError = "FF0000"
|
||||
}
|
@ -14,6 +14,7 @@ enum MSKGS_PlayerType
|
||||
var private IMSKGS MSKGS;
|
||||
var private bool ServerOwner;
|
||||
var private bool GroupMember;
|
||||
var private bool Admin;
|
||||
|
||||
var private repnotify E_LogLevel LogLevel;
|
||||
var private repnotify UniqueNetId GroupID;
|
||||
@ -165,7 +166,12 @@ public simulated function bool IsServerOwner()
|
||||
|
||||
public simulated function bool IsAdmin()
|
||||
{
|
||||
return (GetKFPC() != None && KFPC.PlayerReplicationInfo != None && KFPC.PlayerReplicationInfo.bAdmin);
|
||||
if (!Admin)
|
||||
{
|
||||
Admin = (GetKFPC() != None && KFPC.PlayerReplicationInfo != None && KFPC.PlayerReplicationInfo.bAdmin);
|
||||
}
|
||||
|
||||
return Admin;
|
||||
}
|
||||
|
||||
public simulated function bool IsGroupMember()
|
||||
|
@ -32,5 +32,5 @@ protected function DistributeMoneyAndXP(class<KFPawn_Monster> MonsterClass, cons
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
|
||||
KFGFxManagerClass = class'MSKGS_GFxMoviePlayer_Manager'
|
||||
}
|
||||
|
@ -32,5 +32,5 @@ protected function DistributeMoneyAndXP(class<KFPawn_Monster> MonsterClass, cons
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
|
||||
KFGFxManagerClass = class'MSKGS_GFxMoviePlayer_Manager_Versus'
|
||||
}
|
||||
|
@ -32,5 +32,5 @@ protected function DistributeMoneyAndXP(class<KFPawn_Monster> MonsterClass, cons
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
|
||||
KFGFxManagerClass = class'MSKGS_GFxMoviePlayer_Manager'
|
||||
}
|
||||
|
Reference in New Issue
Block a user