14 [
RplProp(onRplName:
"OnPlayerLoadoutInfoChanged")]
40 int loadoutIndex = info.GetLoadoutIndex();
57 return loadoutManager.GetPlayerLoadout(playerId);
79 return loadoutManager.GetLocalPlayerLoadout();
106 return loadoutManager.GetLoadoutPlayerCount(
loadout);
118 int loadoutIndex = -1;
120 loadoutIndex = loadoutInfo.GetLoadoutIndex();
135 if (playerLoadoutIndex != -1)
143 int previousLoadoutIndex;
145 previousLoadoutIndex = -1;
147 if (previousLoadoutIndex != playerLoadoutIndex)
158 if (loadoutIndex == -1)
181 #ifdef _ENABLE_RESPAWN_LOGS
184 PrintFormat(
"%1::OnPlayerLoadoutCountChanged(loadout: %2 [%3], count: %4)", Type().ToString(),
loadout, res, newCount);
193 #ifdef _ENABLE_RESPAWN_LOGS
194 PrintFormat(
"%1::OnPlayerLoadoutSet_S(playerId: %2, loadout: %3)", Type().ToString(), playerComponent.GetPlayerId(),
loadout);
204 int targetPlayerId = playerLoadoutComponent.GetPlayerController().GetPlayerId();
218 if (previousIndex != -1)
222 int newCount = previousCount - 1;
229 foundInfo.SetLoadoutIndex(targetLoadoutIndex);
232 if (targetLoadoutIndex != -1)
236 int newCount = previousCount + 1;
244 Replication.BumpMe();
250 newInfo.SetLoadoutIndex(targetLoadoutIndex);
256 if (targetLoadoutIndex != -1)
260 int newCount = previousCount + 1;
268 Replication.BumpMe();
333 for (
int i = 0; i < count; i++)
337 if (candidate.GetLoadoutName() == name)
349 array<ref SCR_BasePlayerLoadout> loadouts = {};
353 return loadouts.GetRandomElement();
367 ArmaReforgerScripted game =
GetGame();
371 FactionManager factionManager = game.GetFactionManager();
378 for (
int i = 0; i < count; i++)
380 #ifdef DISABLE_ARSENAL_LOADOUTS
387 Faction ldFaction = factionManager.GetFactionByKey(factionLoadout.m_sAffiliatedFaction);
388 if (faction == ldFaction)
390 outLoadouts.Insert(factionLoadout);
411 for (
int i = 0; i < count; i++)
428 array<ref SCR_BasePlayerLoadout> loadouts = {};
433 return Math.RandomInt(0, count);
448 return Math.RandomInt(0, count);
477 protected override void EOnDiag(IEntity owner,
float timeSlice)
479 super.EOnDiag(owner, timeSlice);
481 if (!DiagMenu.GetBool(
SCR_DebugMenuID.DEBUGUI_RESPAWN_PLAYER_LOADOUT_DIAG))
484 DbgUI.Begin(
"SCR_LoadoutManager");
486 DbgUI.Text(
"* Loadout Player Count *");
502 GetGame().RegisterLoadoutManager(
this);
505 ConnectToDiagSystem();
514 DisconnectFromDiagSystem();
516 GetGame().UnregisterLoadoutManager(
this);