9 static int m_SystemsMask;
12 bool m_ModifiersEnabled =
true;
14 bool m_StaminaDisabled;
18 bool m_LogPlayerStats;
19 Shape m_VehicleFreeAreaBox;
20 ref EnvDebugData m_EnvDebugData;
21 ref FallDamageDebugData m_FallDamageDebugData;
30 protected void BindCallbacks()
90 DiagMenu.BindCallback(
DiagMenuIDs.MISC_ENVIRONMENT_LOGGING_DRYWET, CBMiscEnvironmentLoggingDryWet);
99 DiagMenu.BindCallback(
DiagMenuIDs.MISC_UNIVERSAL_TEMPERATURE_SOURCES, CBMiscUniversalTemperatureSources);
102 DiagMenu.BindCallback(
DiagMenuIDs.MISC_GO_UNCONSCIOUS_DELAYED, CBMiscGoUnconsciousDelayed);
124 DiagMenu.BindCallback(
DiagMenuIDs.MISC_HIT_INDICATION_SPAWN_HIT, CBMiscHitIndicationSpawnHit);
161 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDING_DISABLE_BLOOD_LOSS, CBBleedingDisableBloodLoss);
163 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDING_ACTIVATE_ALL_SOURCES, CBBleedingActivateAllSources);
164 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDING_ACTIVATE_SOURCE_LEVEL, CBBleedingActivateSourceLevel);
171 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_USEVALUEOVERRIDES, CBBBleedingIndicators);
172 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_RANDOMROTATION, CBBBleedingIndicators);
173 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_SEQUENCE_DURATION, CBBBleedingIndicators);
174 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_BASEDURATION, CBBBleedingIndicators);
175 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_MINDELAY, CBBBleedingIndicators);
176 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_MAXDELAY, CBBBleedingIndicators);
177 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_PROGRESSTHRESHOLD, CBBBleedingIndicators);
178 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_STARTSIZE, CBBBleedingIndicators);
180 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_RNDSCALEMIN, CBBBleedingIndicators);
181 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_RNDSCALEMAX, CBBBleedingIndicators);
183 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_SLIDEDISTANCE, CBBBleedingIndicators);
188 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_COLOR_ENABLEDESATURATION, CBBBleedingIndicators);
189 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_COLOR_DESATURATIONEND, CBBBleedingIndicators);
193 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_COLOR_A_START, CBBBleedingIndicators);
194 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_COLOR_A_END, CBBBleedingIndicators);
233 DiagMenu.BindCallback(
DiagMenuIDs.CAMERATOOLS_ENABLE_REMOTE_CAMERA, CBCameraToolsEnableRemoteCamera);
239 super.OnRPC(player, rpc_type, ctx);
243 case ERPCs.DIAG_MISC_ENVIRONMENT_DEBUG_DATA:
246 m_EnvDebugData =
new EnvDebugData();
248 ctx.Read(m_EnvDebugData);
252 case ERPCs.DIAG_MISC_FALLDAMAGE_DEBUG_DATA:
254 if (!m_FallDamageDebugData)
255 m_FallDamageDebugData =
new FallDamageDebugData();
257 ctx.Read(m_FallDamageDebugData);
261 case ERPCs.DIAG_VEHICLES_DUMP_CRASH_DATA_CONTENTS:
263 Param1<array<ref CrashDebugData>> par =
new Param1<array<ref CrashDebugData>>(
null);
266 CrashDebugData.DumpDataArray(par.param1);
273 override void OnUpdate(
float delta_time)
275 super.OnUpdate(delta_time);
285 UpdateMiscVehicleGetOutBox();
286 UpdateEnvironmentDebug();
291 void CheckTimeAccel()
293 if (!FeatureTimeAccel.m_CurrentTimeAccel)
300 TimeAccelParam param = GetTimeAccelMenuState();
302 if (!FeatureTimeAccel.AreTimeAccelParamsSame(param, FeatureTimeAccel.m_CurrentTimeAccel))
304 int timeAccelBig = param.param2;
305 float timeAccelSmall = param.param2 - timeAccelBig;
306 FeatureTimeAccel.CopyTimeAccelClipboard(param.param1, timeAccelBig, timeAccelSmall, param.param3 );
308 FeatureTimeAccel.m_CurrentTimeAccel = param;
315 static void CBCraftingGenerate(
bool enabled,
int id)
317 PluginRecipesManager pluginRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
318 DiagButtonAction(enabled,
id,
ScriptCaller.Create(pluginRecipesManager.CallbackGenerateCache));
322 static void CBCraftingInstant(
bool enabled)
324 PluginRecipesManager pluginRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
325 DiagToggleRPC(enabled, pluginRecipesManager.IsEnableDebugCrafting(),
ERPCs.DIAG_CRAFTING_INSTANT);
329 static void CBCraftingDump(
bool enabled,
int id)
331 PluginRecipesManager pluginRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
332 DiagButtonAction(enabled,
id,
ScriptCaller.Create(pluginRecipesManager.GenerateHumanReadableRecipeList));
336 static void CBCheatsModifiers(
bool enabled)
339 DiagToggleRPCServer(enabled, pluginDiag.m_ModifiersEnabled,
ERPCs.DIAG_CHEATS_MODIFIERS);
343 static void CBCheatsKillPlayer(
bool enabled,
int id)
345 DiagButtonRPC(enabled,
id,
ERPCs.DIAG_CHEATS_KILL_PLAYER,
true);
349 static void CBCheatsInvincibility(
int value)
352 DiagToggleRPCServer(value, pluginDiag.m_IsInvincible,
ERPCs.DIAG_CHEATS_INVINCIBILITY);
356 static void CBCheatsStaminaDisable(
bool enabled)
360 player.SetStaminaDisabled(enabled);
363 DiagToggleRPCServer(enabled, pluginDiag.m_StaminaDisabled,
ERPCs.DIAG_CHEATS_DISABLE_STAMINA);
367 static void CBCheatsResetPlayer(
bool enabled,
int id)
371 player.ResetPlayer(
false);
372 DiagButtonRPC(enabled,
id,
ERPCs.DIAG_CHEATS_RESET_PLAYER,
true);
376 static void CBCheatsResetPlayerMax(
bool enabled,
int id)
380 player.ResetPlayer(
true);
381 DiagButtonRPC(enabled,
id,
ERPCs.DIAG_CHEATS_RESET_PLAYER_MAX,
true);
385 static void CBCheatsInventoryAccess(
bool enabled)
387 DiagToggleRPCServer(enabled,
PlayerBase.DEBUG_INVENTORY_ACCESS,
ERPCs.DIAG_CHEATS_INVENTORY_ACCESS);
391 static void CBCheatsFixItems(
bool enabled,
int id)
393 DiagButtonRPC(enabled,
id,
ERPCs.DIAG_CHEATS_ITEMS_FIX,
true);
396 static void CBCreateHit(
bool enabled,
int id)
398 DiagButtonRPC(enabled,
id,
ERPCs.DIAG_CHEATS_CREATE_HIT,
true);
401 static void CBCreateHitLight(
bool enabled,
int id)
403 DiagButtonRPC(enabled,
id,
ERPCs.DIAG_CHEATS_CREATE_HIT_LIGHT,
true);
407 static void CBPlayerAgentsInjectActions(
bool enabled)
413 static void CBSoftSkillsShowDebug(
bool enabled)
416 DiagToggleRPCAction(enabled,
ScriptCaller.Create(ssMngr.CreateDebugWindow), ssMngr.IsDebug(),
ERPCs.DIAG_SOFT_SKILLS_SHOW_DEBUG);
420 static void CBSoftSkillsToggleState(
bool enabled)
423 DiagToggleRPC(enabled, ssMngr.GetSoftSkillsState(),
ERPCs.DIAG_SOFT_SKILLS_TOGGLE_STATE);
427 static void CBSoftSkillsToggleModel(
bool enabled)
430 DiagToggleRPC(enabled, ssMngr.IsLinear(),
ERPCs.DIAG_SOFT_SKILLS_TOGGLE_MODEL);
434 static void CBSoftSkillsSpecialtyValue(
float value)
437 DiagToggleRPC(value, ssMngr.GetSpecialtyLevel(),
ERPCs.DIAG_SOFT_SKILLS_SPECIALTY_VALUE);
441 static void CBLifespanBloodyHands(
bool enabled)
445 DiagToggleRPCServer(enabled, player.HasBloodyHands(),
ERPCs.DIAG_LIFESPAN_BLOODY_HANDS);
449 static void CBLifespanPlaytimeUpdate(
float value)
452 DiagToggleRPCServer(value * 60, pluginDiag.m_Playtime,
ERPCs.DIAG_LIFESPAN_PLAYTIME_UPDATE);
456 static void CBMiscPersonalLight(
bool enabled)
463 static void CBMiscItemDebugActions(
bool enabled)
469 static void CBMiscLogPlayerStats(
bool enabled)
472 DiagToggleRPC(enabled, pluginDiag.m_LogPlayerStats,
ERPCs.DIAG_MISC_LOG_PLAYER_STATS);
476 static void CBMiscForceHintIndex(
int index)
482 static void CBMiscPermanentCrossHair(
bool enabled)
484 PluginPermanentCrossHair crosshair = PluginPermanentCrossHair.Cast(
GetPlugin(PluginPermanentCrossHair));
485 crosshair.SwitchPermanentCrossHair(enabled);
489 void UpdateMiscVehicleGetOutBox()
493 if (m_VehicleFreeAreaBox)
495 m_VehicleFreeAreaBox.Destroy();
496 m_VehicleFreeAreaBox =
null;
503 m_VehicleFreeAreaBox = hcv.GetTransport().DebugFreeAreaAtDoor( hcv.GetVehicleSeat() );
505 else if (m_VehicleFreeAreaBox)
507 m_VehicleFreeAreaBox.Destroy();
508 m_VehicleFreeAreaBox =
null;
513 static void CBMiscToggleHud(
bool enabled)
516 mission.GetHud().Show(!enabled);
519 mission.HideCrosshairVisibility();
523 mission.RefreshCrosshairVisibility();
528 static void CBMiscEnvironmentDebug(
bool enabled)
530 SendDiagRPC(enabled,
ERPCs.DIAG_MISC_ENVIRONMENT_DEBUG);
533 void UpdateEnvironmentDebug()
536 Environment.DisplayEnvDebugPlayerInfo(
true, m_EnvDebugData);
537 else if (m_EnvDebugData)
538 m_EnvDebugData =
null;
541 static void CBMiscEnvironmentLoggingDryWet(
bool enabled)
543 SendDiagRPC(enabled,
ERPCs.DIAG_MISC_ENVIRONMENT_LOGGING_DRYWET);
546 static void CBMiscFallDamageDebug(
bool enabled)
548 SendDiagRPC(enabled,
ERPCs.DIAG_MISC_FALLDAMAGE_DEBUG);
551 void UpdateFallDamageDebug()
555 else if (m_FallDamageDebugData)
556 m_FallDamageDebugData =
null;
560 static void CBMiscDisplayPlayerInfo(
int value)
562 PluginRemotePlayerDebugClient prpdc = PluginRemotePlayerDebugClient.Cast(
GetPlugin(PluginRemotePlayerDebugClient));
567 static void CBMiscUniversalTemperatureSources(
bool enabled)
569 PluginUniversalTemperatureSourceClient client = PluginUniversalTemperatureSourceClient.Cast(
GetPlugin(PluginUniversalTemperatureSourceClient));
574 static void CBMiscBulletImpact(
bool enabled,
int id)
583 static void CBMiscGoUnconscious(
bool enabled,
int id)
585 DiagButtonRPC(enabled,
id,
ERPCs.DIAG_MISC_GO_UNCONSCIOUS,
true);
589 static void CBMiscGoUnconsciousDelayed(
bool enabled,
int id)
591 DiagButtonRPC(enabled,
id,
ERPCs.DIAG_MISC_GO_UNCONSCIOUS_DELAYED,
true);
595 static void CBMiscQuickRestrain(
bool enabled)
598 DiagToggleRPC(enabled, player.IsQuickRestrain(),
ERPCs.DIAG_MISC_QUICK_RESTRAIN);
602 static void CBMiscHairHide(
bool enabled,
int id)
605 DiagButtonRPCIntInt(enabled,
id, value, enabled,
ERPCs.DIAG_MISC_HAIR_LEVEL_HIDE,
true);
609 static void CBMiscHairHideAll(
bool enabled)
618 static void CBMiscCamShake(
bool enabled,
int id)
621 DiagButtonAction(enabled,
id,
ScriptCaller.Create(cam.SpawnDiagCameraShake));
625 static void CBMiscQuickFishing(
bool enabled)
628 DiagToggleRPC(enabled, player.IsQuickFishing(),
ERPCs.DIAG_MISC_QUICK_FISHING);
632 static void CBMiscShockImpact(
bool enabled,
int id)
634 DiagButtonAction(enabled,
id,
ScriptCaller.Create(ShockImpact));
637 static void ShockImpact()
639 static float intensity;
641 intensity =
Math.WrapFloat(intensity, 0.25, 1);
644 player.SpawnShockEffect(intensity);
648 static void CBMiscPlugArrows(
bool enabled)
650 GetGame().EnableEMPlugs(enabled);
654 static void CBMiscTargetableByAI(
bool enabled,
int id)
658 DiagToggleRPC(enabled, player.m_CanBeTargetedDebug,
ERPCs.DIAG_MISC_TARGETABLE_BY_AI);
662 static void CBMiscHitIndication()
692 static void CBMiscHitIndicationSpawnHit(
bool enabled,
int id)
694 DiagButtonAction(enabled,
id,
ScriptCaller.Create(SpawnHitDirEffect));
697 static void SpawnHitDirEffect()
700 GetGame().GetMission().GetHud().SpawnHitDirEffect(player,
DiagMenu.GetRangeValue(
DiagMenuIDs.MISC_HIT_INDICATION_SPAWN_HIT_DIRECTION), 1.0);
704 static void CBDebugMonitor(
bool enabled,
int id)
706 SendDiagRPC(enabled,
ERPCs.DIAG_MISC_DEBUG_MONITOR,
true);
709 GetGame().GetMission().CreateDebugMonitor();
711 GetGame().GetMission().HideDebugMonitor();
715 static void CBMiscFreezeEntity(
bool enabled,
int id)
717 DiagButtonAction(enabled,
id,
ScriptCaller.Create(FreezeEntity));
720 static void FreezeEntity()
723 if (PluginSceneManager.GetInstance() && PluginSceneManager.GetInstance().IsOpened())
726 SceneObject scene_obj = PluginSceneManager.GetInstance().GetSelectedSceneObject();
730 entity = scene_obj.GetObject();
736 FreeDebugCamera camera = FreeDebugCamera.GetInstance();
737 entity =
EntityAI.Cast(camera.GetCrosshairObject());
741 entity.DisableSimulation(!entity.GetIsSimulationDisabled());
745 static void CBVehicleDebugOutput(
int value)
751 bitValue = EVehicleDebugOutputType.DAMAGE_APPLIED;
755 bitValue = EVehicleDebugOutputType.DAMAGE_APPLIED | EVehicleDebugOutputType.DAMAGE_CONSIDERED;
759 bitValue = EVehicleDebugOutputType.CONTACT;
763 bitValue = EVehicleDebugOutputType.DAMAGE_APPLIED | EVehicleDebugOutputType.CONTACT;
765 SendDiagRPC(bitValue,
ERPCs.DIAG_VEHICLE_DEBUG_OUTPUT,
true);
769 static void CBDumpCrashData(
bool value)
773 SendDiagRPC(
true,
ERPCs.DIAG_VEHICLES_DUMP_CRASH_DATA_REQUEST,
true);
781 static void SimulateMode(
bool enabled,
int id,
int rpc)
789 DiagButtonRPC(enabled,
id, rpc,
true);
794 DiagButtonRPCSelf(enabled,
id, rpc);
799 DiagButtonRPC(enabled,
id, rpc,
true);
800 DiagButtonRPCSelf(enabled,
id, rpc);
807 static void CBSimulateInfiniteLoop(
bool enabled,
int id)
809 SimulateMode(enabled,
id,
ERPCs.DIAG_SIMULATE_INFINITE_LOOP);
813 static void CBSimulateNullPointer(
bool enabled,
int id)
815 SimulateMode(enabled,
id,
ERPCs.DIAG_SIMULATE_NULL_POINTER);
819 static void CBSimulateDivisionByZero(
bool enabled,
int id)
821 SimulateMode(enabled,
id,
ERPCs.DIAG_SIMULATE_DIVISION_BY_ZERO);
825 static void CBSimulateErrorFunction(
bool enabled,
int id)
827 SimulateMode(enabled,
id,
ERPCs.DIAG_SIMULATE_ERROR_FUNCTION);
831 static void CBWeaponParticles(
bool enabled)
833 DiagToggleRPCServer(enabled,
PrtTest.m_GunParticlesState,
ERPCs.DIAG_WEAPON_PARTICLES);
837 static void CBWeaponDebug(
bool enabled)
840 DiagToggleAction(enabled,
ScriptCaller.Create(player.ShowWeaponDebug), player.IsWeaponDebugEnabled());
844 static void CBWeaponAimNoise(
bool enabled)
850 DiagToggleAction(enabled,
ScriptCaller.Create(aimModel.SetAimNoiseAllowed), aimModel.IsAimNoiseAllowed());
855 static void CBWeaponRecoil(
bool enabled)
861 DiagToggleRPC(enabled, aimModel.IsProceduralRecoilEnabled(),
ERPCs.DIAG_WEAPON_RECOIL);
866 static void CBWeaponUnlimitedAmmo(
bool enabled)
872 static void CBWeaponBurstVersion(
int value)
876 DiagToggleRPC(value, wpnMngr.GetBurstOption(),
ERPCs.DIAG_WEAPON_BURST_VERSION);
880 static void CBBleedingSources(
bool enabled)
883 player.GetBleedingManagerRemote().SetDiag(enabled);
887 static void CBBleedingDisableBloodLoss(
bool enabled)
889 SendDiagRPC(enabled,
ERPCs.DIAG_BLEEDING_DISABLE_BLOOD_LOSS,
true);
893 static void CBBleedingActivateSource(
int value)
895 SendDiagRPC(value,
ERPCs.DIAG_BLEEDING_ACTIVATE_SOURCE,
true);
899 static void CBBleedingActivateAllSources(
bool enabled,
int id)
901 DiagButtonRPC(enabled,
id,
ERPCs.DIAG_BLEEDING_ACTIVATE_ALL_SOURCES,
true);
905 static void CBBleedingActivateSourceLevel(
int value)
917 bone =
"lefttoebase";
929 int count = mgr.m_BleedingSourceZone.Count();
931 for (
int i = 0; i < count; ++i)
933 if (mgr.m_BleedingSourceZone.GetKey(i) == bone)
941 CBBleedingActivateSource(idx);
945 static void CBBleedingReload(
bool enabled,
int id)
948 BleedingSourcesManagerRemote bsMngrRem = player.GetBleedingManagerRemote();
949 DiagButtonAction(enabled,
id,
ScriptCaller.Create(bsMngrRem.Reload));
953 static void CBBBleedingIndicators()
960 if (player && player.GetBleedingManagerRemote())
962 player.GetBleedingManagerRemote().Reload();
994 static void CBLogsActions(
bool enabled)
996 DiagToggleRPC(enabled,
LogManager.IsActionLogEnable(),
ERPCs.DIAG_LOGS_ACTIONS);
1000 static void CBLogsWeapons(
bool enabled)
1002 DiagToggleRPC(enabled,
LogManager.IsWeaponLogEnable(),
ERPCs.DIAG_LOGS_WEAPONS);
1006 static void CBLogsSync(
bool enabled)
1008 DiagToggleRPC(enabled,
LogManager.IsSyncLogEnable(),
ERPCs.DIAG_LOGS_SYNC);
1012 static void CBLogsBaseBuilding(
bool enabled)
1014 DiagToggleRPC(enabled,
LogManager.IsBaseBuildingLogEnable(),
ERPCs.DIAG_LOGS_BASEBUILDING);
1018 static void CBLogsSymptoms(
bool enabled)
1020 DiagToggleRPC(enabled,
LogManager.IsSymptomLogEnable(),
ERPCs.DIAG_LOGS_SYMPTOMS);
1024 static void CBLogsInventoryMove(
bool enabled)
1026 DiagToggleRPC(enabled,
LogManager.IsInventoryMoveLogEnable(),
ERPCs.DIAG_LOGS_INVENTORY_MOVE);
1030 static void CBLogsInventoryReservation(
bool enabled)
1032 DiagToggleRPC(enabled,
LogManager.IsInventoryReservationLogEnable(),
ERPCs.DIAG_LOGS_INVENTORY_RESERVATION);
1036 static void CBLogsInventoryHFSM(
bool enabled)
1038 DiagToggleRPC(enabled,
LogManager.IsInventoryHFSMLogEnable(),
ERPCs.DIAG_LOGS_INVENTORY_HFSM);
1042 static void CBLogsQuickbar(
bool enabled)
1044 DiagToggleRPC(enabled,
LogManager.IsQuickbarLogEnable(),
ERPCs.DIAG_LOGS_QUICKBAR);
1048 static void CBLogsBleedingChances(
bool enabled)
1050 DiagToggleRPC(enabled,
LogManager.IsBleedingChancesLogEnable(),
ERPCs.DIAG_LOGS_BLEEDING_CHANCES);
1054 static void CBTriggerDebug(
bool enabled)
1056 EnableDebugSystemClient(ESubscriberSystems.TRIGGERS, enabled);
1060 static void CBBaseBuildingWood(
bool enabled)
1062 SendDiagRPC(enabled,
ERPCs.DIAG_BASEBUILDING_WOOD,
true);
1066 static void CBBaseBuildingGate(
bool enabled)
1068 SendDiagRPC(enabled,
ERPCs.DIAG_BASEBUILDING_GATE,
true);
1072 static void CBFinishersFinisherForced(
int value)
1075 DiagToggleRPC(value - 1, player.GetMeleeCombat().DebugGetForcedFinisherType(),
ERPCs.DIAG_FINISHERS_FORCE_FINISHER);
1079 static void CBCameraToolsEnableRemoteCamera(
bool enabled)
1086 if (!enabled && player.m_CameraToolsMenuClient)
1088 player.m_CameraToolsMenuClient.DelayedDestroy();
1092 GetGame().RPCSingleParam(
null,
ERPCs.DIAG_CAMERATOOLS_CAM_SUBSCRIBE, param,
true );
1109 vector end = start + (
GetGame().GetCurrentCameraDirection() * 5.0);
1111 vector hitPos, hitNormal;
1116 DayZPhysics.RayCastBullet(start, end, hitMask,
null, hitObj, hitPos, hitNormal, hitFraction);
1117 Class.CastTo(player, hitObj);
1131 mask = (
ItemBase.GetDebugActionsMask() | type);
1135 mask = (
ItemBase.GetDebugActionsMask() & (~type));
1144 static void EnableDebugSystemClient(ESubscriberSystems system,
bool enable)
1149 mask = (m_SystemsMask | system);
1153 mask = (m_SystemsMask & (~system));
1156 if (mask != m_SystemsMask)
1160 m_SystemsMask = mask;
1168 static void DiagButtonActionParams(
bool enabled,
int id,
ScriptCaller action,
Param params)
1172 action.Invoke(params);
1178 static void DiagButtonAction(
bool enabled,
int id,
ScriptCaller action)
1180 DiagButtonActionParams(enabled,
id, action,
null);
1184 static void DiagButtonRPC(
bool enabled,
int id,
int rpc,
bool serverOnly =
false)
1187 SendDiagRPCBasicParam params =
new SendDiagRPCBasicParam(rpc, serverOnly);
1189 DiagButtonActionParams(enabled,
id, action, params);
1193 static void DiagButtonRPCSelf(
bool enabled,
int id,
int rpc)
1196 SendDiagRPCSelfBasicParam params =
new SendDiagRPCSelfBasicParam(rpc);
1198 DiagButtonActionParams(enabled,
id, action, params);
1202 static void DiagButtonRPCIntInt(
bool enabled,
int id,
int value,
int value2,
int rpc,
bool serverOnly =
false)
1208 SendDiagRPCParamParam params =
new SendDiagRPCParamParam(rpc, serverOnly,
CachedObjectsParams.PARAM2_INT_INT);
1210 DiagButtonActionParams(enabled,
id, action, params);
1214 static void DiagToggleRPC(
bool value,
int current,
int rpc)
1216 if (value != current)
1218 SendDiagRPC(value, rpc,
false);
1223 static void DiagToggleRPC(
int value,
int current,
int rpc)
1225 if (value != current)
1227 SendDiagRPC(value, rpc,
false);
1232 static void DiagToggleRPC(
float value,
int current,
int rpc)
1234 if (value != current)
1236 SendDiagRPC(value, rpc,
false);
1241 static void DiagToggleRPCServer(
bool value, out
bool current,
int rpc)
1243 if (value != current)
1246 SendDiagRPC(value, rpc,
true);
1251 static void DiagToggleRPCServer(
int value, out
int current,
int rpc)
1253 if (value != current)
1256 SendDiagRPC(value, rpc,
true);
1261 static void DiagToggleRPCServer(
float value, out
float current,
int rpc)
1263 if (value != current)
1266 SendDiagRPC(value, rpc,
true);
1271 static void DiagToggleRPCAction(
int value,
ScriptCaller action,
int current,
int rpc)
1273 if (value != current)
1275 SendDiagRPC(value, rpc);
1276 action.Invoke(value);
1281 static void DiagToggleAction(
int value,
ScriptCaller action,
int current)
1283 if (value != current)
1285 action.Invoke(value);
1290 static void SendDiagRPCSelf(
Param value,
int rpc)
1295 GetGame().RPCSelfSingleParam(player, rpc, value);
1300 static void SendDiagRPCSelfBasic(SendDiagRPCSelfBasicParam param)
1302 SendDiagRPCSelf(
null, param.param1);
1306 static void SendDiagRPCSelfParam(SendDiagRPCSelfParamParam param)
1308 SendDiagRPCSelf(param.param2, param.param1);
1312 static void SendDiagRPC(
Param value,
int rpc,
bool serverOnly =
false)
1318 if (
GetGame().IsMultiplayer() && playerIdentity)
1320 GetGame().RPCSingleParam(player, rpc, value,
true, playerIdentity);
1323 if (!
GetGame().IsMultiplayer() || !serverOnly)
1325 GetGame().RPCSelfSingleParam(player, rpc, value);
1331 static void SendDiagRPCBasic(SendDiagRPCBasicParam param)
1333 SendDiagRPC(
null, param.param1, param.param2);
1337 static void SendDiagRPCParam(SendDiagRPCParamParam param)
1339 SendDiagRPC(param.param3, param.param1, param.param2);
1343 static void SendDiagRPC(
int rpc,
bool serverOnly =
false)
1345 SendDiagRPC(
null, rpc, serverOnly);
1349 static void SendDiagRPC(
bool value,
int rpc,
bool serverOnly =
false)
1356 static void SendDiagRPC(
int value,
int rpc,
bool serverOnly =
false)
1363 static void SendDiagRPC(
float value,
int rpc,
bool serverOnly =
false)