Add setting for medical ai

This commit is contained in:
PabstMirror 2016-09-05 22:35:01 -05:00
parent 9cd50c89a0
commit ec4c2276a5
4 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,7 @@
class ACE_Settings {
class GVAR(enabledFor) {
value = 2;
typeName = "SCALAR";
values[] = {ECSTRING(Common,Disabled), CSTRING(enabledFor_OnlyServerAndHC), ECSTRING(Common,Enabled)};
};
};

View File

@ -1,6 +1,10 @@
#include "script_component.hpp"
["ace_settingsInitialized", {
TRACE_1("settingsInitialized", GVAR(enabledFor));
if (GVAR(enabledFor) == 0) exitWith {}; // 0: disabled
if ((GVAR(enabledFor) == 1) && {!isServer} && {hasInterface}) exitWith {}; // 1: Don't Run on non-hc Clients
// Only run for AI that does not have to deal with advanced medical
if (EGVAR(medical,enableFor) == 1 || {hasInterface && {EGVAR(medical,level) == 2}}) exitWith {};

View File

@ -14,5 +14,6 @@ class CfgPatches {
};
};
#include "ACE_Settings.hpp"
#include "CfgEventHandlers.hpp"
#include "StateMachine.hpp"

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="medical_ai">
<Key ID="STR_ACE_medical_ai_enabledFor_OnlyServerAndHC">
<English>Only Server and HC</English>
<German>Nur Server und HC</German>
<Spanish>Sólo Server y HC</Spanish>
<Russian>Нур сервера унд HC</Russian>
</Key>
</Package>
</Project>