diff --git a/.github/workflows/build_pbo.yml b/.github/workflows/build_pbo.yml index 7541e650..6e8a761c 100644 --- a/.github/workflows/build_pbo.yml +++ b/.github/workflows/build_pbo.yml @@ -6,7 +6,7 @@ jobs: build: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup HEMTT uses: arma-actions/hemtt@v1 - name: Run HEMTT build diff --git a/.gitignore b/.gitignore index 634621be..5005bedc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .vscode/* .hemttout/* -releases \ No newline at end of file +releases +.hemttprivatekey +*.biprivatekey diff --git a/.hemtt/launch.toml b/.hemtt/launch.toml new file mode 100644 index 00000000..a282de3c --- /dev/null +++ b/.hemtt/launch.toml @@ -0,0 +1,7 @@ +[default] +mission = "tmf_template.vr" # Open the TMF template mission in Eden +workshop = [ + "450814997", # CBA_A3 + "751965892", # ACRE2 +] +# HEMTT already passes -skipIntro -noSplash -showScriptErrors -debug and -filePatching diff --git a/.hemtt/lints.toml b/.hemtt/lints.toml index ee002f91..df7ac0bf 100644 --- a/.hemtt/lints.toml +++ b/.hemtt/lints.toml @@ -7,7 +7,7 @@ options.ignore = [ [sqf.var_all_caps] options.ignore = [ - "SLX_*", "ACE_*" + "SLX_*", "ACE_*", "ACRE_*", "MAIN_IDCS", "EDIT_IDCS", "MOVE_IDCS" ] [sqf.undefined] diff --git a/.hemtt/project.toml b/.hemtt/project.toml index bf27def9..fbd39a98 100644 --- a/.hemtt/project.toml +++ b/.hemtt/project.toml @@ -1,4 +1,5 @@ name = "TMF" prefix = "tmf" +mainprefix = "x" [version] path = "addons/main/script_mod.hpp" \ No newline at end of file diff --git a/addons/acre2/Cfg3DEN.hpp b/addons/acre2/Cfg3DEN.hpp index 117fd27d..a47ca3a2 100644 --- a/addons/acre2/Cfg3DEN.hpp +++ b/addons/acre2/Cfg3DEN.hpp @@ -3,18 +3,17 @@ #include "\a3\3DEN\UI\resincl.inc" class ctrlDefault; -class ctrlDefaultText;// : ctrlDefault; class ctrlStatic;// : ctrlDefaultText; class ctrlListNBox;// : ctrlDefaultText; class ctrlTree;// : ctrlDefaultText; class ctrlEdit;// : ctrlDefaultText; -class ctrlToolBox;// : ctrlDefaultText; +class ctrlToolbox;// : ctrlDefaultText; class RscButtonMenu; class RscText; -class cfgScriptPaths +class CfgScriptPaths { TMF_acre2 = "x\tmf\addons\acre2\ui_scripts\"; //" }; @@ -42,7 +41,7 @@ class Cfg3DEN control = "Checkbox"; //expression = "missionNamespace setVariable ['TMF_NetworkEnabled',_value];"; tooltip = "Enable the custom ACRE network and channel feature. Configure this in the 'Radios' section below. If disabled the below networks and channels will not be created."; - defaultValue = false; + defaultValue = QUOTE(false); condition = "1"; }; class Babel_Enabled @@ -52,7 +51,7 @@ class Cfg3DEN control = "Checkbox"; //expression = "missionNamespace setVariable ['TMF_BabelEnabled',_value];"; tooltip = "Enable ACRE's Babel feature? Configure this is in the next section"; - defaultValue = false; + defaultValue = QUOTE(false); condition = "1"; }; class Action_Radios @@ -215,7 +214,6 @@ class Cfg3DEN class Attributes { - class Title; class Toolbox; //class Toolbox: Title class TMF_AcreAddRadioActions : Toolbox { @@ -227,17 +225,17 @@ class Cfg3DEN attributeLoad = "['attributeLoad',_this] call (uinamespace getvariable 'AcreAddRadioActions_script');"; attributeSave = "['attributeSave',_this] call (uinamespace getvariable 'AcreAddRadioActions_script');"; - w = (ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W) * GRID_W; - h = 6 * SIZE_M * GRID_H; + w = QUOTE((ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W) * GRID_W); + h = QUOTE(6 * SIZE_M * GRID_H); class Controls { class ActionTitle : ctrlStatic { text = "Radios available via action:"; style = ST_RIGHT; - w = ATTRIBUTE_TITLE_W * GRID_W; + w = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); x = 0; - h = 1 * SIZE_M * GRID_H; + h = QUOTE(1 * SIZE_M * GRID_H); y = 0; colorBackground[] = {0,0,0,0}; tooltip = "These radios will be available for selection (via scroll wheel action) for the first 5 minutes after the player has spawned."; @@ -245,19 +243,19 @@ class Cfg3DEN class ActionListBackground : ctrlStatic { idc = 313208; - x = (ATTRIBUTE_TITLE_W) * GRID_W; - y = 0 * SIZE_M * GRID_H; - w = ((ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W; //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; - h = 6 * SIZE_M * GRID_H; + x = QUOTE((ATTRIBUTE_TITLE_W) * GRID_W); + y = QUOTE(0 * SIZE_M * GRID_H); + w = QUOTE(((ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W); //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; + h = QUOTE(6 * SIZE_M * GRID_H); colorBackground[] = {0.33,0.33,0.33,1}; }; class ActionList: ctrlListNBox { idc = 101; - x = (ATTRIBUTE_TITLE_W) * GRID_W; - y = 0 * SIZE_M * GRID_H; - w = ((ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W; //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; - h = 6 * SIZE_M * GRID_H; + x = QUOTE((ATTRIBUTE_TITLE_W) * GRID_W); + y = QUOTE(0 * SIZE_M * GRID_H); + w = QUOTE(((ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W); //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; + h = QUOTE(6 * SIZE_M * GRID_H); drawSideArrows = 0;//1; idcLeft = -1; idcRight = -1; @@ -278,49 +276,49 @@ class Cfg3DEN attributeLoad = "['attributeLoad',_this] call (uinamespace getvariable 'BabelSettings_script');"; attributeSave = "['attributeSave',_this] call (uinamespace getvariable 'BabelSettings_script');"; - w = (ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W) * GRID_W; - h = 16 * SIZE_M * GRID_H; + w = QUOTE((ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W) * GRID_W); + h = QUOTE(16 * SIZE_M * GRID_H); class Controls { class LangTitle : ctrlStatic { text = "Languages:"; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) * GRID_W; - h = 1 * SIZE_M * GRID_H; + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) * GRID_W); + h = QUOTE(1 * SIZE_M * GRID_H); y = 0; - x = SIZE_M * GRID_W; + x = QUOTE(SIZE_M * GRID_W); colorBackground[] = {0,0,0,0}; }; class SpeakersTitle : LangTitle { text = "Language speakers:"; - x = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W-SIZE_M)/2) * GRID_W; + x = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W-SIZE_M)/2) * GRID_W); }; class ButtonSpeakerMake : RscButtonMenu { text = "Grant"; - h = SIZE_M * GRID_H; - x = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W; - w = ((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/2; - y = 1 * SIZE_M * GRID_H; + h = QUOTE(SIZE_M * GRID_H); + x = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W); + w = QUOTE(((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/2); + y = QUOTE(1 * SIZE_M * GRID_H); action = "['langTreeGive',_this] call (uinamespace getvariable 'BabelSettings_script');"; tooltip = "Make the selected element speak the selected language."; }; class ButtonSpeakerRemove: ButtonSpeakerMake { text = "Remove"; - x = (((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - SIZE_M)/2) ) * GRID_W)/2) + (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W); + x = QUOTE((((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - SIZE_M)/2) ) * GRID_W)/2) + (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W)); action = "['langTreeRemove',_this] call (uinamespace getvariable 'BabelSettings_script');"; tooltip = "Remove the selected element from speaking the selected language."; }; class SpeakerTree : ctrlTree { idc = 189437; - x = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W; - w = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - SIZE_M)/2)) * GRID_W; //(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) * GRID_W)/2) - SIZE_M; - y = 2 * SIZE_M * GRID_H; - h = 14 * SIZE_M * GRID_H; + x = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W); + w = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - SIZE_M)/2)) * GRID_W); //(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) * GRID_W)/2) - SIZE_M; + y = QUOTE(2 * SIZE_M * GRID_H); + h = QUOTE(14 * SIZE_M * GRID_H); multiselectEnabled = 1; disableKeyboardSearch = 1; colorDisabled[] = {1,1,1,0.25}; @@ -329,43 +327,43 @@ class Cfg3DEN }; class ListBackground: ctrlStatic { - x = SIZE_M * GRID_W; - y = 2 * SIZE_M * GRID_H; - w = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W; //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; - h = 14 * SIZE_M * GRID_H; + x = QUOTE(SIZE_M * GRID_W); + y = QUOTE(2 * SIZE_M * GRID_H); + w = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W); //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; + h = QUOTE(14 * SIZE_M * GRID_H); colorBackground[] = {1,1,1,0.1}; }; class ButtonLangAdd : RscButtonMenu { text = "Add"; - h = SIZE_M * GRID_H; - x = SIZE_M * GRID_W; - w = ((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/3; - y = 1 * SIZE_M * GRID_H; + h = QUOTE(SIZE_M * GRID_H); + x = QUOTE(SIZE_M * GRID_W); + w = QUOTE(((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/3); + y = QUOTE(1 * SIZE_M * GRID_H); action = "['langAddClick',_this] call (uinamespace getvariable 'BabelSettings_script');"; tooltip = "Add a new language."; }; class ButtonLangEdit: ButtonLangAdd { text = "Edit"; - x = ((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/3 + SIZE_M * GRID_W; + x = QUOTE(((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/3 + SIZE_M * GRID_W); action = "['langEditClick',_this] call (uinamespace getvariable 'BabelSettings_script');"; tooltip = "Edit the selected language."; }; class ButtonLangDel : ButtonLangAdd { text = "Delete"; - x = (((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/3) *2 + SIZE_M * GRID_W; + x = QUOTE((((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/3) *2 + SIZE_M * GRID_W); action = "['langDelClick',_this] call (uinamespace getvariable 'BabelSettings_script');"; tooltip = "Delete the selected language."; }; class LangList: ctrlListNBox { idc = 101; - x = SIZE_M * GRID_W; - y = 2 * SIZE_M * GRID_H; - w = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W; //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; - h = 14 * SIZE_M * GRID_H; + x = QUOTE(SIZE_M * GRID_W); + y = QUOTE(2 * SIZE_M * GRID_H); + w = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W); //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; + h = QUOTE(14 * SIZE_M * GRID_H); drawSideArrows = 0;//1; idcLeft = -1; idcRight = -1; @@ -377,26 +375,26 @@ class Cfg3DEN class EditLanguageBackgroundS: ctrlStatic { idc = 313208; - x = SIZE_M * GRID_W; - y = 1 * SIZE_M * GRID_H; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W; //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; - h = 15 * SIZE_M * GRID_H; + x = QUOTE(SIZE_M * GRID_W); + y = QUOTE(1 * SIZE_M * GRID_H); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W); //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; + h = QUOTE(15 * SIZE_M * GRID_H); colorBackground[] = {0.33,0.33,0.33,1}; }; class EditLanguageButtonOk : ButtonSpeakerMake { idc = 313209; text = "Okay"; - y = 12.25 * SIZE_M * GRID_H; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 7; - x = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 7)*2.1875 + SIZE_M * GRID_W; + y = QUOTE(12.25 * SIZE_M * GRID_H); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 7); + x = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 7)*2.1875 + SIZE_M * GRID_W); action = "['languageEditClickOkay',_this] call (uinamespace getvariable 'BabelSettings_script');"; }; class EditLanguageButtonCancel : EditLanguageButtonOk { idc = 313210; text = "Cancel"; - x = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 7)*3.9375 + SIZE_M * GRID_W; + x = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 7)*3.9375 + SIZE_M * GRID_W); action = "['languageDelClickCancel',_this] call (uinamespace getvariable 'BabelSettings_script');"; }; @@ -404,9 +402,9 @@ class Cfg3DEN { idc = 313201; text = "Add/Edit Language"; - y = 1 * SIZE_M * GRID_H; - x = SIZE_M * GRID_W; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W; + y = QUOTE(1 * SIZE_M * GRID_H); + x = QUOTE(SIZE_M * GRID_W); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W); colorBackground[] = {0.1,0.1,0.1,1}; }; @@ -414,9 +412,9 @@ class Cfg3DEN { idc = 313202; text = "Language Name:"; - y = 3 * SIZE_M * GRID_H; - x = 2 * SIZE_M * GRID_W; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W; + y = QUOTE(3 * SIZE_M * GRID_H); + x = QUOTE(2 * SIZE_M * GRID_W); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W); }; class EditLanguageShort : ctrlEdit { @@ -431,10 +429,10 @@ class Cfg3DEN canModify = 1; // True (1) to allow text editing, 0 to disable it autocomplete = ""; // Text autocomplete, can be "scripting" (scripting commands) or "general" (previously typed text) - y = 4.15 * SIZE_M * GRID_H; - x = 2 * SIZE_M * GRID_W; - h = SIZE_M * GRID_H; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - (4 * SIZE_M) ) * GRID_W; + y = QUOTE(4.15 * SIZE_M * GRID_H); + x = QUOTE(2 * SIZE_M * GRID_W); + h = QUOTE(SIZE_M * GRID_H); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - (4 * SIZE_M) ) * GRID_W); }; }; @@ -449,8 +447,8 @@ class Cfg3DEN attributeLoad = "['attributeLoad', _this, _value] call (uinamespace getvariable 'RadioChannels_script');"; attributeSave = "['attributeSave',_this] call (uinamespace getvariable 'RadioChannels_script');"; - w = (ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W) * GRID_W; - h = (32 * SIZE_M + 1) * GRID_H; + w = QUOTE((ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W) * GRID_W); + h = QUOTE((32 * SIZE_M + 1) * GRID_H); //Attribute_Title_W = left side? Attribute_content_W = right Side? // SIZE_M <- size of margin (relatively big-ish) @@ -460,10 +458,10 @@ class Cfg3DEN class Title0: ctrlStatic { text = "Radio network allocation:"; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) * GRID_W; - h = 1 * SIZE_M * GRID_H; + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) * GRID_W); + h = QUOTE(1 * SIZE_M * GRID_H); y = 0; - x = SIZE_M * GRID_W; + x = QUOTE(SIZE_M * GRID_W); colorBackground[] = {0,0,0,0}; tooltip = "Each network is a collection of radio channels. The network number is displayed on the right side below. To assign a different network select the entity below and press the number on your keyboard for the network number you wish to assign."; }; @@ -471,10 +469,10 @@ class Cfg3DEN class NetworkTree : ctrlTree { idc = 189438; - x = SIZE_M * GRID_W; - w = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - SIZE_M))) * GRID_W; //(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) * GRID_W)/2) - SIZE_M; - y = 2 * SIZE_M * GRID_H; - h = 10 * SIZE_M * GRID_H; + x = QUOTE(SIZE_M * GRID_W); + w = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - SIZE_M))) * GRID_W); //(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) * GRID_W)/2) - SIZE_M; + y = QUOTE(2 * SIZE_M * GRID_H); + h = QUOTE(10 * SIZE_M * GRID_H); multiselectEnabled = 0; disableKeyboardSearch = 1; colorDisabled[] = {1,1,1,0.25}; @@ -486,10 +484,10 @@ class Cfg3DEN { style = ST_LINE; colorText[] = {1,1,1,1.0}; // to whatever gives you a thrill - x = (SIZE_M * GRID_W); - h = (SIZE_M * GRID_H)/10; - y = SIZE_M * GRID_H * 12.4; - w = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)) * GRID_W); + x = QUOTE((SIZE_M * GRID_W)); + h = QUOTE((SIZE_M * GRID_H)/10); + y = QUOTE(SIZE_M * GRID_H * 12.4); + w = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)) * GRID_W)); }; class networkButton : RscButtonMenu @@ -499,10 +497,10 @@ class Cfg3DEN align = "center"; }; text = "< Configure Network 1 >"; - h = SIZE_M * GRID_H; - x = SIZE_M * GRID_W; - w = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W); - y = SIZE_M * GRID_H * 13; + h = QUOTE(SIZE_M * GRID_H); + x = QUOTE(SIZE_M * GRID_W); + w = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W)); + y = QUOTE(SIZE_M * GRID_H * 13); action = "['networkToggleButton',_this] call (uinamespace getvariable 'RadioChannels_script');"; tooltip = "Toggle through the radio networks."; }; @@ -510,10 +508,10 @@ class Cfg3DEN class Title1: Title0 { text = "Channels of selected network:"; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) * GRID_W; - h = 1 * SIZE_M * GRID_H; - y = SIZE_M * GRID_H * 14; - x = SIZE_M * GRID_W; + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) * GRID_W); + h = QUOTE(1 * SIZE_M * GRID_H); + y = QUOTE(SIZE_M * GRID_H * 14); + x = QUOTE(SIZE_M * GRID_W); colorBackground[] = {0,0,0,0}; tooltip = ""; }; @@ -521,41 +519,41 @@ class Cfg3DEN class Title2 : Title1 { text = "Entities present on selected channel:"; - x = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W-SIZE_M)/2) * GRID_W; + x = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W-SIZE_M)/2) * GRID_W); tooltip = ""; }; class ButtonChannelGive : RscButtonMenu { text = "Give"; - h = SIZE_M * GRID_H; - x = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W; - w = ((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/3; - y = 15 * SIZE_M * GRID_H; + h = QUOTE(SIZE_M * GRID_H); + x = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W); + w = QUOTE(((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/3); + y = QUOTE(15 * SIZE_M * GRID_H); action = "['channelTreeGive',_this] call (uinamespace getvariable 'RadioChannels_script');"; tooltip = "Put the selected element on the selected radio channel."; }; class ButtonChannelLeader: ButtonChannelGive { text = "Leader"; - x = ((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - SIZE_M)/2) ) * GRID_W)/3 + (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W); + x = QUOTE(((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - SIZE_M)/2) ) * GRID_W)/3 + (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W)); action = "['channelTreeLeader',_this] call (uinamespace getvariable 'RadioChannels_script');"; tooltip = "Make the leader of the group use the selected radio channel (Only avaiable on groups)"; }; class ButtonChannelRemove: ButtonChannelGive { text = "Remove"; - x = (((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - SIZE_M)/2) ) * GRID_W)/3) *2 + (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W); + x = QUOTE((((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - SIZE_M)/2) ) * GRID_W)/3) *2 + (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W)); action = "['channelTreeRemove',_this] call (uinamespace getvariable 'RadioChannels_script');"; tooltip = "Remove the selected radio channel from the selected element."; }; class Value: ctrlTree { idc = 189437; - x = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W; - w = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - SIZE_M)/2)) * GRID_W; //(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) * GRID_W)/2) - SIZE_M; - y = 16 * SIZE_M * GRID_H; - h = 16 * SIZE_M * GRID_H; + x = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W); + w = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - SIZE_M)/2)) * GRID_W); //(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) * GRID_W)/2) - SIZE_M; + y = QUOTE(16 * SIZE_M * GRID_H); + h = QUOTE(16 * SIZE_M * GRID_H); multiselectEnabled = 1; disableKeyboardSearch = 1; colorDisabled[] = {1,1,1,0.25}; @@ -564,43 +562,43 @@ class Cfg3DEN }; class ListBackground: ctrlStatic { - x = SIZE_M * GRID_W; - y = 16 * SIZE_M * GRID_H; - w = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W; //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; - h = 16 * SIZE_M * GRID_H; + x = QUOTE(SIZE_M * GRID_W); + y = QUOTE(16 * SIZE_M * GRID_H); + w = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W); //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; + h = QUOTE(16 * SIZE_M * GRID_H); colorBackground[] = {1,1,1,0.1}; }; class ButtonAdd2: RscButtonMenu { text = "Add"; - h = SIZE_M * GRID_H; - x = SIZE_M * GRID_W; - w = ((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/3; - y = 15 * SIZE_M * GRID_H; + h = QUOTE(SIZE_M * GRID_H); + x = QUOTE(SIZE_M * GRID_W); + w = QUOTE(((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/3); + y = QUOTE(15 * SIZE_M * GRID_H); action = "['channelAddClick',_this] call (uinamespace getvariable 'RadioChannels_script');"; tooltip = "Add a radio channel to the present network"; }; class ButtonEdit: ButtonAdd2 { text = "Edit"; - x = ((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/3 + SIZE_M * GRID_W; + x = QUOTE(((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/3 + SIZE_M * GRID_W); action = "['channelEditClick',_this] call (uinamespace getvariable 'RadioChannels_script');"; tooltip = "Edit the selected radio channel"; }; class ButtonDel: ButtonAdd2 { text = "Delete"; - x = (((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/3) *2 + SIZE_M * GRID_W; + x = QUOTE((((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/3) *2 + SIZE_M * GRID_W); action = "['channelDelClick',_this] call (uinamespace getvariable 'RadioChannels_script');"; tooltip = "Delete the selected radio channel"; }; class List: ctrlListNBox { idc = 101; - x = SIZE_M * GRID_W; - y = 16 * SIZE_M * GRID_H; - w = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W; //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; - h = 16 * SIZE_M * GRID_H; + x = QUOTE(SIZE_M * GRID_W); + y = QUOTE(16 * SIZE_M * GRID_H); + w = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W); //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; + h = QUOTE(16 * SIZE_M * GRID_H); drawSideArrows = 0;//1; idcLeft = -1; idcRight = -1; @@ -611,26 +609,26 @@ class Cfg3DEN class EditChannelBackgroundS: ctrlStatic { idc = 313208; - x = SIZE_M * GRID_W; - y = 16 * SIZE_M * GRID_H; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W; //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; - h = 12.75 * SIZE_M * GRID_H; + x = QUOTE(SIZE_M * GRID_W); + y = QUOTE(16 * SIZE_M * GRID_H); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W); //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; + h = QUOTE(12.75 * SIZE_M * GRID_H); colorBackground[] = {0.33,0.33,0.33,1}; }; class EditChannelButtonOk : ButtonAdd2 { idc = 313209; text = "Okay"; - y = 27.3 * SIZE_M * GRID_H; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 7; - x = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 7)*2.1875 + SIZE_M * GRID_W; + y = QUOTE(27.3 * SIZE_M * GRID_H); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 7); + x = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 7)*2.1875 + SIZE_M * GRID_W); action = "['channelEditClickOkay',_this] call (uinamespace getvariable 'RadioChannels_script');"; }; class EditChannelButtonCancel : EditChannelButtonOk { idc = 313210; text = "Cancel"; - x = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 7)*3.9375 + SIZE_M * GRID_W; + x = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 7)*3.9375 + SIZE_M * GRID_W); action = "['channelDelClickCancel',_this] call (uinamespace getvariable 'RadioChannels_script');"; }; @@ -638,9 +636,9 @@ class Cfg3DEN { idc = 313201; text = "Add/Edit Channel"; - y = 16 * SIZE_M * GRID_H; - x = SIZE_M * GRID_W; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W; + y = QUOTE(16 * SIZE_M * GRID_H); + x = QUOTE(SIZE_M * GRID_W); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W); colorBackground[] = {0.1,0.1,0.1,1}; tooltip = ""; }; @@ -649,9 +647,9 @@ class Cfg3DEN { idc = 313202; text = "Short channel name:"; - y = 17 * SIZE_M * GRID_H; - x = 2*SIZE_M * GRID_W; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - (2*SIZE_M) ) * GRID_W; + y = QUOTE(17 * SIZE_M * GRID_H); + x = QUOTE(2*SIZE_M * GRID_W); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - (2*SIZE_M) ) * GRID_W); tooltip = ""; }; class EditChannelShort : ctrlEdit @@ -667,43 +665,43 @@ class Cfg3DEN canModify = 1; // True (1) to allow text editing, 0 to disable it autocomplete = ""; // Text autocomplete, can be "scripting" (scripting commands) or "general" (previously typed text) - y = 18.15 * SIZE_M * GRID_H; - x = 2 * SIZE_M * GRID_W; - h = SIZE_M * GRID_H; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - (4 * SIZE_M) ) * GRID_W; + y = QUOTE(18.15 * SIZE_M * GRID_H); + x = QUOTE(2 * SIZE_M * GRID_W); + h = QUOTE(SIZE_M * GRID_H); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - (4 * SIZE_M) ) * GRID_W); }; class EditChannelLongTitle : Title1 { idc = 313203; text = "Long (Briefing) channel name:"; - y = 19.3 * SIZE_M * GRID_H; - x = 2 * SIZE_M * GRID_W; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - (2* SIZE_M) ) * GRID_W; + y = QUOTE(19.3 * SIZE_M * GRID_H); + x = QUOTE(2 * SIZE_M * GRID_W); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - (2* SIZE_M) ) * GRID_W); tooltip = ""; }; class EditChannelLong: EditChannelShort { idc = 313207; text = ""; - y = 20.45 * SIZE_M * GRID_H; + y = QUOTE(20.45 * SIZE_M * GRID_H); }; class EditChannelRadioTitle : Title1 { idc = 313204; text = "Radio"; - y = 21.6 * SIZE_M * GRID_H; - x = 2 *SIZE_M * GRID_W; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - (2*SIZE_M) ) * GRID_W; + y = QUOTE(21.6 * SIZE_M * GRID_H); + x = QUOTE(2 *SIZE_M * GRID_W); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - (2*SIZE_M) ) * GRID_W); tooltip = ""; }; class EditChannelRadioChooser: ctrlToolbox { idc = 313205; style = ST_PICTURE + ST_KEEP_ASPECT_RATIO; - x = 2 * SIZE_M * GRID_W; - y = 22.75 * SIZE_M * GRID_H; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - (4*SIZE_M) ) * GRID_W; //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; - h = 2 * SIZE_M * GRID_H; + x = QUOTE(2 * SIZE_M * GRID_W); + y = QUOTE(22.75 * SIZE_M * GRID_H); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - (4*SIZE_M) ) * GRID_W); //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; + h = QUOTE(2 * SIZE_M * GRID_H); rows = 1; columns = 7; @@ -730,17 +728,17 @@ class Cfg3DEN { idc = 313211; text = "Share channel across networks:"; - y = 24.9 * SIZE_M * GRID_H; - x = 2 *SIZE_M * GRID_W; - w = ATTRIBUTE_TITLE_W * GRID_W; + y = QUOTE(24.9 * SIZE_M * GRID_H); + x = QUOTE(2 *SIZE_M * GRID_W); + w = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); tooltip = "Mark this channel as shared. If a channel on another network has an identical shortname and is also a shared channel they will be linked together. Use this for channels that need that need to be cross-network."; }; class SharedCheckBox : ctrlDefault { idc = 313212; - y = 26.05 * SIZE_M * GRID_H; - x = 2 *SIZE_M * GRID_W; - w = SIZE_M * GRID_W; - h = SIZE_M * GRID_H; + y = QUOTE(26.05 * SIZE_M * GRID_H); + x = QUOTE(2 *SIZE_M * GRID_W); + w = QUOTE(SIZE_M * GRID_W); + h = QUOTE(SIZE_M * GRID_H); text = ""; type = CT_CHECKBOX; // Type //style = ST_LEFT + ST_MULTI; // Style diff --git a/addons/acre2/CfgLoadouts.hpp b/addons/acre2/CfgLoadouts.hpp index d41fb5fc..cb3424d1 100644 --- a/addons/acre2/CfgLoadouts.hpp +++ b/addons/acre2/CfgLoadouts.hpp @@ -325,4 +325,4 @@ class cfgLoadouts }; }; }; -}; \ No newline at end of file +}; diff --git a/addons/acre2/addon.toml b/addons/acre2/addon.toml deleted file mode 100644 index 1bc9698a..00000000 --- a/addons/acre2/addon.toml +++ /dev/null @@ -1,5 +0,0 @@ -[rapify] -enabled = false # Default: true -exclude = [ - "Cfg3DEN.hpp" -] \ No newline at end of file diff --git a/addons/acre2/config.cpp b/addons/acre2/config.cpp index b3cfb33e..0d5b4cc0 100644 --- a/addons/acre2/config.cpp +++ b/addons/acre2/config.cpp @@ -1,6 +1,6 @@ #include "script_component.hpp" -class cfgPatches +class CfgPatches { class ADDON { diff --git a/addons/acre2/display3DEN.hpp b/addons/acre2/display3DEN.hpp index 53628447..3f3f0717 100644 --- a/addons/acre2/display3DEN.hpp +++ b/addons/acre2/display3DEN.hpp @@ -1,5 +1,5 @@ class ctrlMenuStrip; -class display3DEN +class Display3DEN { class Controls { @@ -19,4 +19,4 @@ class display3DEN }; }; }; -}; \ No newline at end of file +}; diff --git a/addons/acre2/functions/fnc_clientInit.sqf b/addons/acre2/functions/fnc_clientInit.sqf index e8618cc1..f6534b2c 100644 --- a/addons/acre2/functions/fnc_clientInit.sqf +++ b/addons/acre2/functions/fnc_clientInit.sqf @@ -45,7 +45,7 @@ if (!alive player) exitWith {}; //Call ACRE API - if (count _languagesToSpeak > 0) then { + if (_languagesToSpeak isNotEqualTo []) then { _languagesToSpeak call acre_api_fnc_babelSetSpokenLanguages; [_languagesToSpeak select 0] call acre_api_fnc_babelSetSpeakingLanguage; }; @@ -168,19 +168,15 @@ if (!alive player) exitWith {}; - private _text = "
RADIO CHANNEL LISTING"; + private _textParts = ["
RADIO CHANNEL LISTING"]; { private _radioSettingsIndex = _forEachIndex; if (count (_channelsProcessed select _radioSettingsIndex) > 0) then { // If at least one channel is defined. - _text = _text + "
For: "; - _radioFreqInfo = _x; - _radioList = _radioFreqInfo select 0; - _radio = (_radioList select 0); - { - if (_forEachIndex != 0) then {_text = _text + ", "; }; - _text = _text + getText (configfile >> "CfgWeapons" >> _x >> "displayName"); - } forEach _radioList; - _text = _text + ":
"; + private _radioFreqInfo = _x; + private _radioList = _radioFreqInfo select 0; + private _radio = (_radioList select 0); + private _radioNames = _radioList apply {getText (configFile >> "CfgWeapons" >> _x >> "displayName")}; + _textParts pushBack format ["
For: %1:
", _radioNames joinString ", "]; { private _chanNum = _forEachIndex +1; @@ -195,13 +191,13 @@ if (!alive player) exitWith {}; }; }; private _channelLine = format["CHN %1 (%2 MHz) - %3 - %4",_chanNum,_frequency,(_x select 0),(_x select 1)]; - _defaultRadio = (_x select 2); - if (_x select ((count _x) -1 )) then { // if player is supposet to be on this channel + private _defaultRadio = (_x select 2); + if (_x select -1) then { // if player is supposet to be on this channel // Match radio to number... private _radioFndIdx = -1; { if (_radioFndIdx != -1) exitWith {}; - _radioID = _forEachIndex; + private _radioID = _forEachIndex; if (!(_radioID in _usedRadioIndexs)) then { if (_x in _radioList) then { _radioFndIdx = _radioID; @@ -222,18 +218,18 @@ if (!alive player) exitWith {}; } else { _channelLine = " " +_channelLine + "
"; }; - _text = _text + _channelLine; + _textParts pushBack _channelLine; } forEach (_channelsProcessed select _radioSettingsIndex); }; } forEach GVAR(radioCoreSettings); - private _myRadiosText = "

MY ASSIGNED RADIOS
"; + private _myRadiosParts = ["

MY ASSIGNED RADIOS
"]; { - _color = [_forEachIndex] call EFUNC(common,numToColor); - _myRadiosText = _myRadiosText + format["%2
",_color,getText (configfile >> "CfgWeapons" >> _x >> "displayName")]; + private _color = [_forEachIndex] call EFUNC(common,numToColor); + _myRadiosParts pushBack format["%2
",_color,getText (configFile >> "CfgWeapons" >> _x >> "displayName")]; } forEach _radiosToGive; - _text = _ltext + _myRadiosText + _text; + private _text = _ltext + (_myRadiosParts joinString "") + (_textParts joinString ""); //Provide instructions on the page. such as * to denote a channel you are suppose to be on, explain what the colours mean. player createDiaryRecord ["diary", ["ACRE2", _text]]; @@ -243,7 +239,7 @@ if (!alive player) exitWith {}; // Uses CBA PFH to have a delay yet ensure code is still run in the unscheduled enviornment. private _delay = 0; - if (didJip) then { _delay = 3; }; // If jip give more time. + if (didJIP) then { _delay = 3; }; // If jip give more time. [{ // On finish wait. @@ -282,7 +278,7 @@ if (!alive player) exitWith {}; }; //Create addAction to give radio. - private _radioName = getText (configfile >> "CfgWeapons" >> _x >> "displayName"); + private _radioName = getText (configFile >> "CfgWeapons" >> _x >> "displayName"); private _actionID = _unit addAction [format ["[Radios] Give myself a %1 radio",_radioName], { private _radioToGive = (_this select 3) select 0; @@ -332,7 +328,7 @@ if (!alive player) exitWith {}; // Give addActions to addRadios. if (!isNil QGVAR(radioAddActions)) then { { - private _actionid_action = _unit addAction [format["[Radios] Give myself a %1 radio (check your inventory for space)",getText (configfile >> "CfgWeapons" >> _x >> "displayName")], + private _actionid_action = _unit addAction [format["[Radios] Give myself a %1 radio (check your inventory for space)",getText (configFile >> "CfgWeapons" >> _x >> "displayName")], format["if ((_this select 0) canAdd '%1') then { (_this select 0) addItem '%1'; (_this select 0) removeAction (_this select 2); } else { systemChat '[TMF ACRE2] No space for radios'; };",_x],0,0,false,true,"","(_target == _this)"]; [_actionid_action,_unit] spawn { sleep 300; diff --git a/addons/acre2/functions/fnc_createPresets.sqf b/addons/acre2/functions/fnc_createPresets.sqf index 5c1ff2a3..2440fac9 100644 --- a/addons/acre2/functions/fnc_createPresets.sqf +++ b/addons/acre2/functions/fnc_createPresets.sqf @@ -91,7 +91,7 @@ private _sharedRadioChannelListing = []; if (!_return) then { private _radioPresetData = [] call acre_main_fnc_fastHashCreate;//HASH_CREATE; - _channels = []; + private _channels = []; for "_i" from 0 to 15 do { private _channel = [] call acre_main_fnc_fastHashCreate;//HASHLIST_CREATEHASH(_channels); _channel setVariable ["frequencyTX",0]; @@ -119,7 +119,7 @@ private _sharedRadioChannelListing = []; if (_i > (count _channelList)) then { _channelName = "Channel " + str(_i); } else { - _channelEntry = _channelList select (_i-1); + private _channelEntry = _channelList select (_i-1); _channelName = (_channelEntry select 0); if (_channelEntry select 4) then { // Check if this is a shared channel. _frequency = [_radioSettingIndex, (count GVAR(networksWithRadioChannels)), (_channelEntry select 5)] call _calcChanFreq; // Use 'special preset' and 'special channel' number. @@ -134,4 +134,4 @@ private _sharedRadioChannelListing = []; } forEach GVAR(radioCoreSettings); } forEach GVAR(networksWithRadioChannels); -tmf_acre2_networksCreated = true; \ No newline at end of file +tmf_acre2_networksCreated = true; diff --git a/addons/acre2/functions/fnc_testBabel.sqf b/addons/acre2/functions/fnc_testBabel.sqf index 13829ad7..08d3bc86 100644 --- a/addons/acre2/functions/fnc_testBabel.sqf +++ b/addons/acre2/functions/fnc_testBabel.sqf @@ -15,7 +15,7 @@ Author: private _warnings = []; -if (getmissionconfigvalue ["TMF_AcreBabelEnabled",false]) then { +if (getMissionConfigValue ["TMF_AcreBabelEnabled",false]) then { LOG("Running Autotest on Babel"); private _babelArray = getMissionConfigValue ["TMF_AcreBabelSettings", []]; if IS_STRING(_babelArray) then {_babelArray = call compile _babelArray}; @@ -48,15 +48,15 @@ if (getmissionconfigvalue ["TMF_AcreBabelEnabled",false]) then { if (_unitCond isEqualTo []) then { // No languages assigned on each level, post warning. WARNING_1("No languages assigned for %1",_unit); - _warnings pushBack [0,format ["%1 has no Babel languages assigned", _unit]]; + _warnings pushBack [0,format ["%1 speaks no Babel language. Assign one in the Eden TMF menu > TMF ACRE2 Settings.", _unit]]; }; } forEach (units _grp); }; }; } forEach _playerGroups; - if (count _warnings == 0) then { + if (_warnings isEqualTo []) then { LOG("Babel Autotest finished"); - _warnings pushBack [-1,"Babel checks complete"]; + _warnings pushBack [-1,"ACRE2 Babel language check done"]; } else { WARNING_1("Babel Autotest finished with warnings: %1",_warnings); }; diff --git a/addons/acre2/functions/fnc_testNets.sqf b/addons/acre2/functions/fnc_testNets.sqf index cf133965..9ce1c720 100644 --- a/addons/acre2/functions/fnc_testNets.sqf +++ b/addons/acre2/functions/fnc_testNets.sqf @@ -15,7 +15,7 @@ Author: private _warnings = []; -if (getmissionconfigvalue ["TMF_AcreNetworkEnabled",false]) then { +if (getMissionConfigValue ["TMF_AcreNetworkEnabled",false]) then { LOG("Running Autotest on Radio Networks"); private _networksArray = getMissionConfigValue ['TMF_AcreSettings', []]; if IS_STRING(_networksArray) then {_networksArray = call compile _networksArray}; @@ -48,15 +48,15 @@ if (getmissionconfigvalue ["TMF_AcreNetworkEnabled",false]) then { if (_unitCond isEqualTo -1 || _unitCond > (count (_networksArray # 0)) - 1) then { // No nets assigned on each level, post warning. WARNING_1("No Radio Nets assigned for %1",_unit); - _warnings pushBack [0,format ["%1 has no Radio Networks assigned", _unit]]; + _warnings pushBack [0,format ["%1 is in no radio network and gets no channels. Assign one in the Eden TMF menu > TMF ACRE2 Settings.", _unit]]; }; } forEach (units _grp); }; }; } forEach _playerGroups; - if (count _warnings == 0) then { + if (_warnings isEqualTo []) then { LOG("Radio Net Autotest finished"); - _warnings pushBack [-1,"ACRE2 Radio Network checks complete"]; + _warnings pushBack [-1,"ACRE2 radio network check done"]; } else { WARNING_1("Radio Networks Autotest finished with warnings: %1",_warnings); }; diff --git a/addons/acre2/script_component.hpp b/addons/acre2/script_component.hpp index 9938d0f8..bc14103b 100644 --- a/addons/acre2/script_component.hpp +++ b/addons/acre2/script_component.hpp @@ -1,6 +1,11 @@ +#ifndef TMF_ACRE2_SCRIPT_COMPONENT_HPP +#define TMF_ACRE2_SCRIPT_COMPONENT_HPP + #define COMPONENT acre2 #include "\x\tmf\addons\main\script_mod.hpp" #include "\x\tmf\addons\main\script_macros.hpp" #define SPECTATOR_IDC_RADIO_INFO 7076 + +#endif // TMF_ACRE2_SCRIPT_COMPONENT_HPP diff --git a/addons/acre2/ui_scripts/AcreAddRadioActions.sqf b/addons/acre2/ui_scripts/AcreAddRadioActions.sqf index 39ad6149..061399ea 100644 --- a/addons/acre2/ui_scripts/AcreAddRadioActions.sqf +++ b/addons/acre2/ui_scripts/AcreAddRadioActions.sqf @@ -11,32 +11,32 @@ switch _mode do { case "onLoad": { //Add EH On touch - _ctrlGroup = _params select 0; + private _ctrlGroup = _params select 0; AcreAddRadioActions_ctrlGroup = _ctrlGroup; - _ctrlGroup ctrladdeventhandler ["setfocus",{with uinamespace do {AcreAddRadioActions_ctrlGroup = _this select 0;};}]; - _ctrlGroup ctrladdeventhandler ["killfocus",{with uinamespace do {AcreAddRadioActions_ctrlGroup = nil;};}]; + _ctrlGroup ctrlAddEventHandler ["SetFocus",{with uiNamespace do {AcreAddRadioActions_ctrlGroup = _this select 0;};}]; + _ctrlGroup ctrlAddEventHandler ["KillFocus",{with uiNamespace do {AcreAddRadioActions_ctrlGroup = nil;};}]; - _ctrlList = _ctrlGroup controlsGroupCtrl 101; - _ctrlList ctrladdeventhandler ["lbdblclick",{with uinamespace do {["listModify",[ctrlparentcontrolsgroup (_this select 0),+1],objnull] call AcreAddRadioActions_script;};}]; + private _ctrlList = _ctrlGroup controlsGroupCtrl 101; + _ctrlList ctrlAddEventHandler ["LBDblClick",{with uiNamespace do {["listModify",[ctrlParentControlsGroup (_this select 0),+1],objNull] call AcreAddRadioActions_script;};}]; TMF_AcreAddRadioActions_Array = ("TMF_MissionAcre2Attributes" get3DENMissionAttribute "TMF_AcreAddRadioActions"); if (TMF_AcreAddRadioActions_Array isEqualType "") then { TMF_AcreAddRadioActions_Array = call compile TMF_AcreAddRadioActions_Array; }; - lnbclear _ctrlList; + lnbClear _ctrlList; _ctrlList lnbSetColumnsPos [0.1,0.2]; { - _weaponCfg = configfile >> "cfgWeapons" >> _x; - _displayName = gettext (_weaponCfg >> "displayName"); - _picture = gettext (_weaponCfg >> "picture"); - _description = getText (_weaponCfg >> "descriptionShort"); - _lnbAdd = _ctrlList lnbaddrow ["",_displayName]; - _ctrlList lnbsetdata [[_lnbAdd,0],_x]; - _ctrlList lnbsetpicture [[_lnbAdd,0],_picture]; - _alpha = if (_x in TMF_AcreAddRadioActions_Array) then {1} else {0.5}; - _ctrlList lnbsetcolor [[_lnbAdd,1],[1,1,1,_alpha]]; + private _weaponCfg = configFile >> "cfgWeapons" >> _x; + private _displayName = getText (_weaponCfg >> "displayName"); + private _picture = getText (_weaponCfg >> "picture"); + private _description = getText (_weaponCfg >> "descriptionShort"); + private _lnbAdd = _ctrlList lnbAddRow ["",_displayName]; + _ctrlList lnbSetData [[_lnbAdd,0],_x]; + _ctrlList lnbSetPicture [[_lnbAdd,0],_picture]; + private _alpha = [0.5, 1] select (_x in TMF_AcreAddRadioActions_Array); + _ctrlList lnbSetColor [[_lnbAdd,1],[1,1,1,_alpha]]; } forEach ACRE_RADIO_CLASSNAME_ARRAY; }; case "attributeSave": { @@ -52,21 +52,21 @@ switch _mode do { } else { TMF_AcreAddRadioActions_Array pushBackUnique _radio; }; - lnbclear _ctrlList; + lnbClear _ctrlList; _ctrlList lnbSetColumnsPos [0.1,0.2]; { - _weaponCfg = configfile >> "cfgWeapons" >> _x; - _displayName = gettext (_weaponCfg >> "displayName"); - _picture = gettext (_weaponCfg >> "picture"); - _description = getText (_weaponCfg >> "descriptionShort"); - _lnbAdd = _ctrlList lnbaddrow ["",_displayName]; - _ctrlList lnbsetdata [[_lnbAdd,0],_x]; - _ctrlList lnbsetpicture [[_lnbAdd,0],_picture]; - _alpha = if (_x in TMF_AcreAddRadioActions_Array) then {1} else {0.5}; - _ctrlList lnbsetcolor [[_lnbAdd,1],[1,1,1,_alpha]]; + private _weaponCfg = configFile >> "cfgWeapons" >> _x; + private _displayName = getText (_weaponCfg >> "displayName"); + private _picture = getText (_weaponCfg >> "picture"); + private _description = getText (_weaponCfg >> "descriptionShort"); + private _lnbAdd = _ctrlList lnbAddRow ["",_displayName]; + _ctrlList lnbSetData [[_lnbAdd,0],_x]; + _ctrlList lnbSetPicture [[_lnbAdd,0],_picture]; + private _alpha = [0.5, 1] select (_x in TMF_AcreAddRadioActions_Array); + _ctrlList lnbSetColor [[_lnbAdd,1],[1,1,1,_alpha]]; } forEach ACRE_RADIO_CLASSNAME_ARRAY; }; case "attributeLoad": { }; -}; \ No newline at end of file +}; diff --git a/addons/acre2/ui_scripts/BabelSettings.sqf b/addons/acre2/ui_scripts/BabelSettings.sqf index 62299387..59458553 100644 --- a/addons/acre2/ui_scripts/BabelSettings.sqf +++ b/addons/acre2/ui_scripts/BabelSettings.sqf @@ -12,7 +12,7 @@ params ["_mode",["_params",[]]]; fn_removeUnitFromLang = { params ["_channel", "_unit"]; - _list = (_unit get3DENAttribute "TMF_BabelLanguages") params ["_value"]; + (_unit get3DENAttribute "TMF_BabelLanguages") params ["_value"]; if (_value isEqualType []) then { //Is default do nothing //_unit set3DENAttribute ["TMF_Channellist",str []]; @@ -26,7 +26,7 @@ fn_removeUnitFromLang = { fn_removeGroupFromLang = { params ["_channel", "_group"]; - _list = (_group get3DENAttribute "TMF_BabelLanguages") params ["_value"]; + (_group get3DENAttribute "TMF_BabelLanguages") params ["_value"]; if (_value isEqualType []) then { //Is Default do nothing //_group set3DENAttribute ["TMF_ChannellistLeader",str []]; @@ -37,7 +37,7 @@ fn_removeGroupFromLang = { }; - _list = (_group get3DENAttribute "TMF_BabelLanguages") params ["_value"]; + (_group get3DENAttribute "TMF_BabelLanguages") params ["_value"]; if (_value isEqualType []) then { //is default do nothing //_group set3DENAttribute ["TMF_Channellist",str []]; @@ -82,11 +82,11 @@ switch _mode do { BabelCurrentLang = 0; //--- Init UI - _ctrlGroup = _params select 0; + private _ctrlGroup = _params select 0; BabelSettings_ctrlGroup = _ctrlGroup; - _ctrlGroup ctrladdeventhandler ["setfocus",{with uinamespace do {BabelSettings_ctrlGroup = _this select 0;};}]; - _ctrlGroup ctrladdeventhandler ["killfocus",{with uinamespace do {BabelSettings_ctrlGroup = nil;};}]; + _ctrlGroup ctrlAddEventHandler ["SetFocus",{with uiNamespace do {BabelSettings_ctrlGroup = _this select 0;};}]; + _ctrlGroup ctrlAddEventHandler ["KillFocus",{with uiNamespace do {BabelSettings_ctrlGroup = nil;};}]; { @@ -126,14 +126,14 @@ switch _mode do { lnbClear _ctrlLangList; { _x params ["_name"]; - _ctrlLangList lnbaddrow [_name, "", ""]; + _ctrlLangList lnbAddRow [_name, "", ""]; } forEach BabelArray; if (count BabelArray > 0) then { _ctrlLangList lnbSetCurSelRow 0; BabelCurrentLang = 0; } else { _ctrlLangList lnbSetColumnsPos [0,5,5]; - _ctrlLangList lnbaddrow ["No Languages","",""]; + _ctrlLangList lnbAddRow ["No Languages","",""]; BabelCurrentLang = -1; }; @@ -145,7 +145,7 @@ switch _mode do { if (isNil "BabelSettings_ctrlGroup") exitWith {}; - _ctrlTree = BabelSettings_ctrlGroup controlsGroupCtrl 189437; + private _ctrlTree = BabelSettings_ctrlGroup controlsGroupCtrl 189437; tvClear _ctrlTree; if (BabelCurrentLang == -1) exitWith {}; @@ -163,12 +163,12 @@ switch _mode do { private _color = (side _unit) call TMF_common_fnc_sideToColor; if (_roleDesc == "") then { - _roleDesc = getText (configfile >> "CfgVehicles" >> (typeOf _unit) >> "displayName"); + _roleDesc = getText (configOf _unit >> "displayName"); }; private _unitIdx = _ctrlTree tvAdd [ _treeRoot, _roleDesc]; private _location = _treeRoot + [_unitIdx]; _ctrlTree tvSetValue [_location, BabelLang_data pushBack _unit]; - private _icon = getText (configFile >> "CfgVehicleIcons" >> getText (configFile >> "CfgVehicles" >> (typeOf _unit) >> "icon")); + private _icon = getText (configFile >> "CfgVehicleIcons" >> getText (configOf _unit >> "icon")); if (_icon == "") then { _icon = "\a3\3DEN\Data\Cfg3DEN\Object\iconPlayer_ca.paa"; //default player icon }; @@ -202,7 +202,7 @@ switch _mode do { private _side = side _group; private _color = _side call TMF_common_fnc_sideToColor; - private _grpIdx = _ctrlTree tvAdd [ _treeRoot, groupID _group]; + private _grpIdx = _ctrlTree tvAdd [ _treeRoot, groupId _group]; private _location = _treeRoot + [_grpIdx]; private _grpIcon = "\a3\Ui_f\data\Map\Markers\NATO\n_unknown.paa"; @@ -263,12 +263,12 @@ switch _mode do { _doSpeak = true; }; - private _factionIdx = _ctrlTree tvAdd [ _treeRoot,getText (configfile >> "CfgFactionClasses" >> _faction >> "displayName")]; + private _factionIdx = _ctrlTree tvAdd [ _treeRoot,getText (configFile >> "CfgFactionClasses" >> _faction >> "displayName")]; private _location = _treeRoot + [_factionIdx]; _ctrlTree tvSetValue [_location, BabelLang_data pushBack _faction]; - private _factionImg = getText (configfile >> "CfgFactionClasses" >> _faction >> "icon"); + private _factionImg = getText (configFile >> "CfgFactionClasses" >> _faction >> "icon"); _ctrlTree tvSetPicture [_location, _factionImg]; private _hasSpeaker = false; @@ -310,7 +310,7 @@ switch _mode do { }; //Collect factions for side. - _factions = []; + private _factions = []; { _factions pushBackUnique (toLower (faction (leader _x))); } forEach (cacheAllPlayerGroups select {(side _x) == _side}); @@ -423,11 +423,11 @@ switch _mode do { private _curSel = lnbCurSelRow (BabelSettings_ctrlGroup controlsGroupCtrl 101); private _condition = (BabelArray select _curSel) select 1; - if (_entity isEqualType east or _entity isEqualType "") then { + if (_entity isEqualTypeAny [east, ""]) then { _condition pushBackUnique _entity; } else { - if (_entity isEqualType grpNull or _entity isEqualType objNull) then { - _list = (_entity get3DENAttribute "TMF_BabelLanguages") params ["_value"]; + if (_entity isEqualTypeAny [grpNull, objNull]) then { + (_entity get3DENAttribute "TMF_BabelLanguages") params ["_value"]; if (_value isEqualType []) then { _entity set3DENAttribute ["TMF_BabelLanguages",str [_curSel]]; } else { @@ -454,14 +454,14 @@ switch _mode do { private _langEntry = (BabelArray select _curSel); private _condition = _langEntry select 1; - if (_entity isEqualType east or _entity isEqualType "") then { + if (_entity isEqualTypeAny [east, ""]) then { _langEntry set [1,_condition - [_entity]]; if (_entity isEqualType east) then { //Find and remove matching faction groups private _sideNum = _entity call TMF_common_fnc_sideToNum; { if (_x isEqualType "") then { - if (_sideNum == getNumber (configfile >> "CfgFactionClasses" >> _x >> "side")) then { + if (_sideNum == getNumber (configFile >> "CfgFactionClasses" >> _x >> "side")) then { _langEntry set [1,_condition - [_x]]; }; }; diff --git a/addons/acre2/ui_scripts/RadioChannels.sqf b/addons/acre2/ui_scripts/RadioChannels.sqf index 6409682f..339fa4f2 100644 --- a/addons/acre2/ui_scripts/RadioChannels.sqf +++ b/addons/acre2/ui_scripts/RadioChannels.sqf @@ -15,7 +15,7 @@ params ["_mode",["_params",[]]]; fn_removeUnitFromChannel = { params ["_channel", "_unit"]; - _list = (_unit get3DENAttribute "TMF_Channellist") params ["_value"]; + (_unit get3DENAttribute "TMF_Channellist") params ["_value"]; if (_value isEqualType []) then { //Is default do nothing //_unit set3DENAttribute ["TMF_Channellist",str []]; @@ -29,7 +29,7 @@ fn_removeUnitFromChannel = { fn_removeGroupFromChannel = { params ["_channel", "_group"]; - _list = (_group get3DENAttribute "TMF_ChannellistLeader") params ["_value"]; + (_group get3DENAttribute "TMF_ChannellistLeader") params ["_value"]; if (_value isEqualType []) then { //Is Default do nothing //_group set3DENAttribute ["TMF_ChannellistLeader",str []]; @@ -40,7 +40,7 @@ fn_removeGroupFromChannel = { }; - _list = (_group get3DENAttribute "TMF_Channellist") params ["_value"]; + (_group get3DENAttribute "TMF_Channellist") params ["_value"]; if (_value isEqualType []) then { //is default do nothing //_group set3DENAttribute ["TMF_Channellist",str []]; @@ -73,7 +73,7 @@ fn_networkTreeHandleKey = { _condition set [_forEachIndex,-1]; }; if (_x isEqualType "") then { - if (_sideNum == getNumber (configfile >> "CfgFactionClasses" >> _x >> "side")) then { + if (_sideNum == getNumber (configFile >> "CfgFactionClasses" >> _x >> "side")) then { _condition set [_forEachIndex,-1]; }; }; @@ -97,7 +97,7 @@ fn_networkTreeHandleKey = { }; if (_thing isEqualType "") then { - private _sideNum = getNumber (configfile >> "CfgFactionClasses" >> _thing >> "side"); + private _sideNum = getNumber (configFile >> "CfgFactionClasses" >> _thing >> "side"); private _side = _sideNum call TMF_common_fnc_numToSide; { @@ -122,7 +122,7 @@ fn_networkTreeHandleKey = { }; if (_thing isEqualType grpNull) then { private _faction = toLower (faction (leader _thing)); - private _sideNum = getNumber (configfile >> "CfgFactionClasses" >> _faction >> "side"); + private _sideNum = getNumber (configFile >> "CfgFactionClasses" >> _faction >> "side"); private _side = _sideNum call TMF_common_fnc_numToSide; { private _channel = _x; @@ -137,7 +137,7 @@ fn_networkTreeHandleKey = { }; if (_thing isEqualType objNull) then { private _faction = toLower (faction (leader (group _thing))); - private _sideNum = getNumber (configfile >> "CfgFactionClasses" >> _faction >> "side"); + private _sideNum = getNumber (configFile >> "CfgFactionClasses" >> _faction >> "side"); private _side = _sideNum call TMF_common_fnc_numToSide; { private _channel = _x; @@ -205,11 +205,11 @@ switch _mode do { RadioCurrentNetwork = 0; //--- Init UI - _ctrlGroup = _params select 0; + private _ctrlGroup = _params select 0; RadioChannels_ctrlGroup = _ctrlGroup; - _ctrlGroup ctrladdeventhandler ["setfocus",{with uinamespace do {RadioChannels_ctrlGroup = _this select 0;};}]; - _ctrlGroup ctrladdeventhandler ["killfocus",{with uinamespace do {RadioChannels_ctrlGroup = nil;};}]; + _ctrlGroup ctrlAddEventHandler ["SetFocus",{with uiNamespace do {RadioChannels_ctrlGroup = _this select 0;};}]; + _ctrlGroup ctrlAddEventHandler ["KillFocus",{with uiNamespace do {RadioChannels_ctrlGroup = nil;};}]; @@ -217,8 +217,8 @@ switch _mode do { ["refreshChannelList"] call RadioChannels_script; //Tree EH for keyboard number presses - _ctrlTree = _ctrlGroup controlsGroupCtrl 189438; - _ctrlTree ctrladdeventhandler ["keyDown",{with uinamespace do {['keydown',[RadioChannels_ctrlGroup,_this select 1,_this select 2,_this select 3],objnull] call RadioChannels_script;};}]; + private _ctrlTree = _ctrlGroup controlsGroupCtrl 189438; + _ctrlTree ctrlAddEventHandler ["KeyDown",{with uiNamespace do {['keydown',[RadioChannels_ctrlGroup,_this select 1,_this select 2,_this select 3],objNull] call RadioChannels_script;};}]; { @@ -233,9 +233,9 @@ switch _mode do { case "keydown": { // Handle key press on tree. _params params ["_ctrlGroup", "_key", "_shift", "_ctrl"]; - if !(isnil "_ctrlGroup") then { + if !(isNil "_ctrlGroup") then { - _ctrlTree = _ctrlGroup controlsGroupCtrl 189438; + private _ctrlTree = _ctrlGroup controlsGroupCtrl 189438; switch _key do { case DIK_1: { @@ -322,7 +322,7 @@ switch _mode do { _hasChannels = true; _x params ["_shortName", "_longName", "_radioClassname", "_condition", "_shared"]; - private _lnbIdx = _ctrlChannelList lnbaddrow ["", _shortName, _longName]; + private _lnbIdx = _ctrlChannelList lnbAddRow ["", _shortName, _longName]; private _icon = getText (configFile >> "CfgWeapons" >> _radioClassname >> "picture"); _ctrlChannelList lnbSetPicture [[_lnbIdx,1],_icon]; } forEach _channels; @@ -334,9 +334,9 @@ switch _mode do { } else { _ctrlChannelList lnbSetColumnsPos [0,1,1]; if (RadioCurrentNetwork < count RadioChannelArray) then { - _ctrlChannelList lnbaddrow ["No Channels on this network","",""]; + _ctrlChannelList lnbAddRow ["No Channels on this network","",""]; } else { - _ctrlChannelList lnbaddrow ["Adds units to this network first!","",""]; + _ctrlChannelList lnbAddRow ["Adds units to this network first!","",""]; }; RadioCurrentNetworkChannel = -1; }; @@ -372,12 +372,12 @@ switch _mode do { private _color = (side _unit) call TMF_common_fnc_sideToColor; if (_roleDesc == "") then { - _roleDesc = getText (configfile >> "CfgVehicles" >> (typeOf _unit) >> "displayName"); + _roleDesc = getText (configOf _unit >> "displayName"); }; private _unitIdx = _ctrlTree tvAdd [ _treeRoot, _roleDesc]; private _location = _treeRoot + [_unitIdx]; _ctrlTree tvSetValue [_location, RadioNetworkChannel_data pushBack _unit]; - private _icon = getText (configFile >> "CfgVehicleIcons" >> getText (configFile >> "CfgVehicles" >> (typeOf _unit) >> "icon")); + private _icon = getText (configFile >> "CfgVehicleIcons" >> getText (configOf _unit >> "icon")); if (_icon == "") then { _icon = "\a3\3DEN\Data\Cfg3DEN\Object\iconPlayer_ca.paa"; //default player icon }; @@ -412,7 +412,7 @@ switch _mode do { private _side = side _group; private _color = _side call TMF_common_fnc_sideToColor; - private _grpIdx = _ctrlTree tvAdd [ _treeRoot, groupID _group]; + private _grpIdx = _ctrlTree tvAdd [ _treeRoot, groupId _group]; private _location = _treeRoot + [_grpIdx]; private _grpIcon = "\a3\Ui_f\data\Map\Markers\NATO\n_unknown.paa"; @@ -489,12 +489,12 @@ switch _mode do { _giveRadio = true; }; - private _factionIdx = _ctrlTree tvAdd [ _treeRoot,getText (configfile >> "CfgFactionClasses" >> _faction >> "displayName")]; + private _factionIdx = _ctrlTree tvAdd [ _treeRoot,getText (configFile >> "CfgFactionClasses" >> _faction >> "displayName")]; private _location = _treeRoot + [_factionIdx]; _ctrlTree tvSetValue [_location, RadioNetworkChannel_data pushBack _faction]; - private _factionImg = getText (configfile >> "CfgFactionClasses" >> _faction >> "icon"); + private _factionImg = getText (configFile >> "CfgFactionClasses" >> _faction >> "icon"); _ctrlTree tvSetPicture [_location, _factionImg]; private _gaveSomeoneARadio = false; @@ -540,7 +540,7 @@ switch _mode do { }; //Collect factions for side. - _factions = []; + private _factions = []; { _factions pushBackUnique (toLower (faction (leader _x))); } forEach (cacheAllPlayerGroups select {(side _x) == _side}); @@ -592,13 +592,13 @@ switch _mode do { if (isNil "RadioChannels_ctrlGroup") exitWith {}; - _ctrlTree = RadioChannels_ctrlGroup controlsGroupCtrl 189438; + private _ctrlTree = RadioChannels_ctrlGroup controlsGroupCtrl 189438; tvClear _ctrlTree; RadioNetwork_data = []; - _sides = []; - _factions = []; + private _sides = []; + private _factions = []; { private _group = _x; private _side = (side _x); @@ -659,11 +659,11 @@ switch _mode do { if (_factionIdx == -1) then { - _factionIdx = _ctrlTree tvAdd [ [_sideIdx],getText (configfile >> "CfgFactionClasses" >> _faction >> "displayName")]; + _factionIdx = _ctrlTree tvAdd [ [_sideIdx],getText (configFile >> "CfgFactionClasses" >> _faction >> "displayName")]; _sideFactions pushBack _faction; _ctrlTree tvSetValue [[_sideIdx, _factionIdx], RadioNetwork_data pushBack _faction]; - private _factionImg = getText (configfile >> "CfgFactionClasses" >> _faction >> "icon"); + private _factionImg = getText (configFile >> "CfgFactionClasses" >> _faction >> "icon"); _ctrlTree tvSetPicture [[_sideIdx,_factionIdx],_factionImg]; if (_networkNumber != -1) then { @@ -674,7 +674,7 @@ switch _mode do { }; - private _grpIdx = _ctrlTree tvAdd [ [_sideIdx, _factionIdx],groupID _x]; + private _grpIdx = _ctrlTree tvAdd [ [_sideIdx, _factionIdx],groupId _x]; private _grpIcon = "\a3\Ui_f\data\Map\Markers\NATO\n_unknown.paa"; //Found in (configfile >> "Cfg3DEN" >> "Group" >> "Draw" >> "textureCivilian") @@ -704,10 +704,10 @@ switch _mode do { private _roleDesc = ((_x get3DENAttribute "description") select 0); if (_roleDesc == "") then { - _roleDesc = getText (configfile >> "CfgVehicles" >> (typeOf _x) >> "displayName"); + _roleDesc = getText (configOf _x >> "displayName"); }; private _unitIdx = _ctrlTree tvAdd [ [_sideIdx, _factionIdx, _grpIdx], _roleDesc]; - private _icon = getText (configFile >> "CfgVehicleIcons" >> getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "icon")); + private _icon = getText (configFile >> "CfgVehicleIcons" >> getText (configOf _x >> "icon")); if (_icon == "") then { _icon = "\a3\3DEN\Data\Cfg3DEN\Object\iconPlayer_ca.paa"; //default player icon }; @@ -806,7 +806,7 @@ switch _mode do { RadioChannelsEditMode = 0; (RadioChannels_ctrlGroup controlsGroupCtrl 313206) ctrlSetText ""; (RadioChannels_ctrlGroup controlsGroupCtrl 313207) ctrlSetText ""; - (RadioChannels_ctrlGroup controlsGroupCtrl 313205) lbsetcursel 0; + (RadioChannels_ctrlGroup controlsGroupCtrl 313205) lbSetCurSel 0; ctrlSetFocus (RadioChannels_ctrlGroup controlsGroupCtrl 313206); }; }; @@ -890,11 +890,11 @@ switch _mode do { private _radioChannel = (((RadioChannelArray select RadioCurrentNetwork) select 1) select _curSel); private _condition = _radioChannel select 3; - if (_entity isEqualType east or _entity isEqualType "") then { + if (_entity isEqualTypeAny [east, ""]) then { _condition pushBackUnique _entity; } else { - if (_entity isEqualType grpNull or _entity isEqualType objNull) then { - _list = (_entity get3DENAttribute "TMF_Channellist") params ["_value"]; + if (_entity isEqualTypeAny [grpNull, objNull]) then { + (_entity get3DENAttribute "TMF_Channellist") params ["_value"]; if (_value isEqualType []) then { _entity set3DENAttribute ["TMF_Channellist",str [_curSel]]; } else { @@ -923,7 +923,7 @@ switch _mode do { private _condition = _radioChannel select 3; if (_entity isEqualType grpNull) then { - _list = (_entity get3DENAttribute "TMF_ChannellistLeader") params ["_value"]; + (_entity get3DENAttribute "TMF_ChannellistLeader") params ["_value"]; if (_value isEqualType []) then { _entity set3DENAttribute ["TMF_ChannellistLeader",str [_curSel]]; } else { @@ -948,14 +948,14 @@ switch _mode do { private _radioChannel = (((RadioChannelArray select RadioCurrentNetwork) select 1) select _curSel); private _condition = _radioChannel select 3; - if (_entity isEqualType east or _entity isEqualType "") then { + if (_entity isEqualTypeAny [east, ""]) then { _radioChannel set [3,_condition - [_entity]]; if (_entity isEqualType east) then { //Find and remove matching faction groups private _sideNum = _entity call TMF_common_fnc_sideToNum; { if (_x isEqualType "") then { - if (_sideNum == getNumber (configfile >> "CfgFactionClasses" >> _x >> "side")) then { + if (_sideNum == getNumber (configFile >> "CfgFactionClasses" >> _x >> "side")) then { _radioChannel set [3,_condition - [_x]]; }; }; diff --git a/addons/adminmenu/CfgEventHandlers.hpp b/addons/adminmenu/CfgEventHandlers.hpp index 48a76999..c0018f30 100644 --- a/addons/adminmenu/CfgEventHandlers.hpp +++ b/addons/adminmenu/CfgEventHandlers.hpp @@ -1,7 +1,7 @@ class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE( call COMPILE_FILE(XEH_postInit) ); - serverInit = QUOTE( call COMPILE_FILE(XEH_postServerInit) ); + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + serverInit = QUOTE(call COMPILE_FILE(XEH_postServerInit)); }; }; diff --git a/addons/adminmenu/CfgFunctions.hpp b/addons/adminmenu/CfgFunctions.hpp index f1c5b9f5..7523baee 100644 --- a/addons/adminmenu/CfgFunctions.hpp +++ b/addons/adminmenu/CfgFunctions.hpp @@ -4,7 +4,7 @@ class CfgFunctions { PATHTO_FNC(isDebugConsoleAllowed); class isDebugConsoleAllowed_old { - file = "\x\cba\addons\diagnostic\fnc_isDebugConsoleAllowed.sqf"; + file = "\x\cba\addons\diagnostic\fnc_isDebugConsoleAllowed.inc.sqf"; }; }; }; diff --git a/addons/adminmenu/XEH_postInit.sqf b/addons/adminmenu/XEH_postInit.sqf index a72c4200..f3937da1 100644 --- a/addons/adminmenu/XEH_postInit.sqf +++ b/addons/adminmenu/XEH_postInit.sqf @@ -19,7 +19,7 @@ if (isTMF) then { GVAR(logEntries) pushBack [CBA_missionTime, format ["Mission Ended, endtype: %1",_endType], false]; if GVAR(endLogToRPT) then { - [] call FUNC(printLogToRPT); + [] call FUNC(messageLog_printAll); }; // Print to debriefing diff --git a/addons/adminmenu/XEH_postServerInit.sqf b/addons/adminmenu/XEH_postServerInit.sqf index 73af4b40..ba451e01 100644 --- a/addons/adminmenu/XEH_postServerInit.sqf +++ b/addons/adminmenu/XEH_postServerInit.sqf @@ -5,7 +5,7 @@ if (isTMF) then { GVAR(disconnectEH) = addMissionEventHandler ["HandleDisconnect",{ params ["_unit", "_id", "_uid", "_name"]; - if !(typeOf _unit isEqualTo QEGVAR(spectator,unit)) then { + if (typeOf _unit isNotEqualTo QEGVAR(spectator,unit)) then { [format ["Player disconnected while not spectator: %1", _name], true] call FUNC(log); }; }]; @@ -59,7 +59,7 @@ if (isTMF) then { // Cleanup groups no longer used. { - if (count (units _x) == 0) then {deleteGroup _x;}; + if (units _x isEqualTo []) then {deleteGroup _x;}; } forEach (_oldGroups - [grpNull]); //params ["_hunters", "_targetSide", "_position", "_range",["_targets",[]]] diff --git a/addons/adminmenu/XEH_preServerInit.sqf b/addons/adminmenu/XEH_preServerInit.sqf index 86e5f259..dd45a616 100644 --- a/addons/adminmenu/XEH_preServerInit.sqf +++ b/addons/adminmenu/XEH_preServerInit.sqf @@ -7,7 +7,7 @@ if (isServer && !hasInterface) then { GVAR(logEntries) pushBack _this; GVAR(logEntries) sort true; - TRACE_1("Received log message", _this); + TRACE_1("Received log message",_this); }; [QGVAR(log),_this,_targets] call CBA_fnc_targetEvent; diff --git a/addons/adminmenu/addon.toml b/addons/adminmenu/addon.toml deleted file mode 100644 index 33d02ffe..00000000 --- a/addons/adminmenu/addon.toml +++ /dev/null @@ -1,5 +0,0 @@ -[rapify] -enabled = false # Default: true -exclude = [ - "adminMenu.hpp" -] \ No newline at end of file diff --git a/addons/adminmenu/autotest.hpp b/addons/adminmenu/autotest.hpp index c9b87b2b..53e59813 100644 --- a/addons/adminmenu/autotest.hpp +++ b/addons/adminmenu/autotest.hpp @@ -1,10 +1,5 @@ class DOUBLES(PREFIX,autotest) { class ADDON { - code = QUOTE( \ - [ARR_2( \ - [ARR_2([1,'Admin log debriefing section not present'])], \ - [ARR_2([-1,'Admin log debriefing section present'])] \ - )] select (isClass (missionConfigFile >> 'CfgDebriefingSections' >> 'DOUBLES(PREFIX,adminlog)')) \ - ); + code = QUOTE([ARR_2([ARR_2([1,'Admin log debriefing section not present'])],[ARR_2([-1,'Admin log debriefing section present'])])] select (isClass (missionConfigFile >> 'CfgDebriefingSections' >> 'DOUBLES(PREFIX,adminlog)'))); }; }; diff --git a/addons/adminmenu/functions/fnc_adminEye_draw.sqf b/addons/adminmenu/functions/fnc_adminEye_draw.sqf index c22e2865..80212086 100644 --- a/addons/adminmenu/functions/fnc_adminEye_draw.sqf +++ b/addons/adminmenu/functions/fnc_adminEye_draw.sqf @@ -76,7 +76,7 @@ params["_fullmapWindow"]; private _data = _x getVariable [QEGVAR(ai,waveAdminData), []]; { _x params ["_type", "_entityPos", "_dir"]; - private _icon = getText (configfile >> "CfgVehicles" >> _type >> "icon"); + private _icon = getText (configFile >> "CfgVehicles" >> _type >> "icon"); _fullmapWindow drawLine [_pos, _entityPos, [1, 1, 0, 0.4]]; _fullmapWindow drawIcon [_icon, [1, 1, 0, 0.3], _entityPos, 19, 19, _dir, "", 0]; } forEach _data; @@ -129,11 +129,11 @@ params["_fullmapWindow"]; { if(alive _x) then { - if(vehicle _x != _x && crew (vehicle _x) select 0 == _x || vehicle _x == _x) then + if(!isNull objectParent _x && crew (vehicle _x) select 0 == _x || isNull objectParent _x) then { private _icon = (vehicle _x getVariable ["f_cam_icon",""]); if(_icon == "") then { - _icon = getText (configfile >> "CfgVehicles" >> typeOf (vehicle _x) >> "icon"); + _icon = getText (configOf (vehicle _x) >> "icon"); (vehicle _x) setVariable ["f_cam_icon",_icon]; }; @@ -145,7 +145,7 @@ params["_fullmapWindow"]; private _name = ""; - if (leader _x == _x && {isPlayer _x} count units _x > 0) then {_name = format["%1 - %2",toString(toArray(groupID (group _x)) - [45]),_name]}; + if (leader _x == _x && {isPlayer _x} count units _x > 0) then {_name = format["%1 - %2",toString(toArray(groupId (group _x)) - [45]),_name]}; if (isPlayer _x) then { @@ -176,24 +176,24 @@ params["_fullmapWindow"]; private _markerShape = markerShape _x; private _markerPos = getMarkerPos _x; private _markerSize = getMarkerSize _x; - private _markerColor = (configfile >> "CfgMarkerColors" >> getMarkerColor _x >> "color") call BIS_fnc_colorConfigToRGBA; + private _markerColor = (configFile >> "CfgMarkerColors" >> getMarkerColor _x >> "color") call BIS_fnc_colorConfigToRGBA; private _markerDir = markerDir _x; switch (_markerShape) do { case "RECTANGLE": { - private _markerBrush = getText (configfile >> "cfgMarkerBrushes" >> markerBrush _x >> "texture"); + private _markerBrush = getText (configFile >> "cfgMarkerBrushes" >> markerBrush _x >> "texture"); _fullmapWindow drawRectangle [_markerPos, _markerSize select 0, _markerSize select 1, _markerDir, _markerColor, _markerBrush] }; case "ELLIPSE": { - private _markerBrush = getText (configfile >> "cfgMarkerBrushes" >> markerBrush _x >> "texture"); + private _markerBrush = getText (configFile >> "cfgMarkerBrushes" >> markerBrush _x >> "texture"); _fullmapWindow drawEllipse [_markerPos, _markerSize select 0, _markerSize select 1, _markerDir, _markerColor, _markerBrush] }; case "ICON": { private _markerType = getMarkerType _x; if (_markerType != "Empty") then { - _multiplier = 20; - _markerIcon = getText (configfile >> "CfgMarkers" >> _markerType >> "icon"); - _markerText = markerText _x; + private _multiplier = 20; + private _markerIcon = getText (configFile >> "CfgMarkers" >> _markerType >> "icon"); + private _markerText = markerText _x; _fullmapWindow drawIcon [_markerIcon, _markerColor, _markerPos, (_markerSize select 0) * _multiplier, (_markerSize select 1) * _multiplier, _markerDir, _markerText, 1]; }; }; diff --git a/addons/adminmenu/functions/fnc_adminEye_fireTrigger.sqf b/addons/adminmenu/functions/fnc_adminEye_fireTrigger.sqf index 9f4d5abd..fb66847a 100644 --- a/addons/adminmenu/functions/fnc_adminEye_fireTrigger.sqf +++ b/addons/adminmenu/functions/fnc_adminEye_fireTrigger.sqf @@ -8,7 +8,7 @@ private _statements = triggerStatements _trigger; if (count _statements > 0) then { // isTrigger. [{ params ["_trigger"]; - TRACE_1("Admin Eye triggered trigger", _trigger); + TRACE_1("Admin Eye triggered trigger",_trigger); private _statements = triggerStatements _trigger; private _activation = triggerActivation _trigger; private _interval = triggerInterval _trigger; diff --git a/addons/adminmenu/functions/fnc_adminEye_onKeyPress.sqf b/addons/adminmenu/functions/fnc_adminEye_onKeyPress.sqf index e5c28d4c..747638d0 100644 --- a/addons/adminmenu/functions/fnc_adminEye_onKeyPress.sqf +++ b/addons/adminmenu/functions/fnc_adminEye_onKeyPress.sqf @@ -11,7 +11,7 @@ if (_type == 20) then { } else { if (typeOf GVAR(adminEyeSelectedObj) == "tmf_ai_wavespawn") then { // Wave spawner trigger. - TRACE_1("Admin Eye triggered wave", GVAR(adminEyeSelectedObj)); + TRACE_1("Admin Eye triggered wave",GVAR(adminEyeSelectedObj)); [{ params ["_waveSpawner"]; [_waveSpawner] remoteExecCall [QEFUNC(ai,spawnWave), _waveSpawner]; diff --git a/addons/adminmenu/functions/fnc_adminEye_onLoad.sqf b/addons/adminmenu/functions/fnc_adminEye_onLoad.sqf index e9c06719..3c1450eb 100644 --- a/addons/adminmenu/functions/fnc_adminEye_onLoad.sqf +++ b/addons/adminmenu/functions/fnc_adminEye_onLoad.sqf @@ -9,7 +9,7 @@ private _pos = [0,0,0]; if (alive player && !(player isKindOf "tmf_spectator_unit")) then { _pos = getPos player; } else { - if (count playableUnits > 0) then { + if (playableUnits isNotEqualTo []) then { _pos = getPos (playableUnits select 0); } else { if (count allUnits > 0) then { diff --git a/addons/adminmenu/functions/fnc_adminEye_restoreTrigger.sqf b/addons/adminmenu/functions/fnc_adminEye_restoreTrigger.sqf index 4ff19e53..0ee4f0f3 100644 --- a/addons/adminmenu/functions/fnc_adminEye_restoreTrigger.sqf +++ b/addons/adminmenu/functions/fnc_adminEye_restoreTrigger.sqf @@ -20,4 +20,4 @@ _trigger setTriggerTimeout _delays; _trigger setTriggerActivation _activation; _trigger setTriggerInterval _interval; -TRACE_5("Admin Eye restored trigger", _trigger, _statements, _delays, _activation, _interval); +TRACE_5("Admin Eye restored trigger",_trigger,_statements,_delays,_activation,_interval); diff --git a/addons/adminmenu/functions/fnc_endMission.sqf b/addons/adminmenu/functions/fnc_endMission.sqf index a5a21886..ef62e900 100644 --- a/addons/adminmenu/functions/fnc_endMission.sqf +++ b/addons/adminmenu/functions/fnc_endMission.sqf @@ -12,12 +12,12 @@ if ((lbSize _endingList) == 0) then { private _title = getText (_x >> "title"); private _extra = getText (_x >> "description"); - if !(_extra isEqualTo "") then { + if (_extra isNotEqualTo "") then { _title = _title + " | " + _extra; }; _extra = getText (_x >> "subtitle"); - if !(_extra isEqualTo "") then { + if (_extra isNotEqualTo "") then { _title = _title + " | " + _extra; }; diff --git a/addons/adminmenu/functions/fnc_log.sqf b/addons/adminmenu/functions/fnc_log.sqf index f6db9097..cb022d27 100644 --- a/addons/adminmenu/functions/fnc_log.sqf +++ b/addons/adminmenu/functions/fnc_log.sqf @@ -32,7 +32,7 @@ params [ ["_tag","",[""]] ]; -if !(_tag isEqualTo "") then { +if (_tag isNotEqualTo "") then { _tag = format ["[%1] ",_tag]; }; diff --git a/addons/adminmenu/functions/fnc_modal.sqf b/addons/adminmenu/functions/fnc_modal.sqf index 1ac2d02c..ab07b624 100644 --- a/addons/adminmenu/functions/fnc_modal.sqf +++ b/addons/adminmenu/functions/fnc_modal.sqf @@ -13,10 +13,10 @@ private _exit = false; if ((missionNamespace getVariable [QGVAR(selectedTab), -1]) isEqualTo IDC_TMF_ADMINMENU_G_PMAN) then { GVAR(utilityData) = GVAR(playerManagement_selected) apply {_x call BIS_fnc_objectFromNetId}; - _exit = count GVAR(utilityData) == 0; + _exit = GVAR(utilityData) isEqualTo []; if (!_exit && _args isEqualTo true) then { GVAR(utilityData) = GVAR(utilityData) select {alive _x && _x isKindOf "CAManBase"}; - _exit = count GVAR(utilityData) == 0; + _exit = GVAR(utilityData) isEqualTo []; }; }; diff --git a/addons/adminmenu/functions/fnc_modal_ACRE2Languages.sqf b/addons/adminmenu/functions/fnc_modal_ACRE2Languages.sqf index 6b5cd616..489018cf 100644 --- a/addons/adminmenu/functions/fnc_modal_ACRE2Languages.sqf +++ b/addons/adminmenu/functions/fnc_modal_ACRE2Languages.sqf @@ -2,6 +2,7 @@ disableSerialization; params ["_ctrlGroup"]; +private _display = ctrlParent _ctrlGroup; (ctrlPosition _ctrlGroup) params ["", "", "_ctrlGrpWidth", "_ctrlGrpHeight"]; @@ -68,8 +69,8 @@ _ctrlButton ctrlAddEventHandler ["ButtonClick", { }; } forEach _langComboCtrls; - if (count _langsToAdd == 0) then { - if (count _langsToRemove == 0) exitWith { + if (_langsToAdd isEqualTo []) then { + if (_langsToRemove isEqualTo []) exitWith { systemChat "[TMF Admin Menu] No changes selected"; }; diff --git a/addons/adminmenu/functions/fnc_modal_ACRE2Radios.sqf b/addons/adminmenu/functions/fnc_modal_ACRE2Radios.sqf index 71ed3265..a6ed35a8 100644 --- a/addons/adminmenu/functions/fnc_modal_ACRE2Radios.sqf +++ b/addons/adminmenu/functions/fnc_modal_ACRE2Radios.sqf @@ -2,6 +2,7 @@ disableSerialization; params ["_ctrlGroup"]; +private _display = ctrlParent _ctrlGroup; (ctrlPosition _ctrlGroup) params ["", "", "_ctrlGrpWidth", "_ctrlGrpHeight"]; @@ -116,7 +117,7 @@ _ctrlButton ctrlAddEventHandler ["ButtonClick", { systemChat (_radios joinString ", "); private _network = -1; - if !(_networkCtrls isEqualTo []) then { + if (_networkCtrls isNotEqualTo []) then { _networkCtrls params ["_ctrlNetworkCheck", "_ctrlNetworkList"]; if (cbChecked _ctrlNetworkCheck) then { @@ -130,6 +131,6 @@ _ctrlButton ctrlAddEventHandler ["ButtonClick", { }; }; - [_radios, _network] remoteExecCall [QFUNC(modal_ACRE2Languages_assign), GVAR(utilityData)]; - [format ["%1 Assigned radios %2 on network %3 to ",profileName,_radio,_network],false,"Admin Menu"] call FUNC(log); + [_radios, _network] remoteExecCall [QFUNC(modal_ACRE2Radios_assign), GVAR(utilityData)]; + [format ["%1 Assigned radios %2 on network %3",profileName,_radios,_network],false,"Admin Menu"] call FUNC(log); }]; diff --git a/addons/adminmenu/functions/fnc_modal_ACRE2Radios_assign.sqf b/addons/adminmenu/functions/fnc_modal_ACRE2Radios_assign.sqf index a7d30abb..1b64ef82 100644 --- a/addons/adminmenu/functions/fnc_modal_ACRE2Radios_assign.sqf +++ b/addons/adminmenu/functions/fnc_modal_ACRE2Radios_assign.sqf @@ -7,7 +7,7 @@ params [["_radios", []], ["_network", -1]]; private _presetName = format ["tmf_preset%1", _network]; private _oldPresetName = ["ACRE_PRC343"] call acre_api_fnc_getPreset; -if (_network > -1 && !(_presetName isEqualTo _oldPresetName)) then { +if (_network > -1 && (_presetName isNotEqualTo _oldPresetName)) then { { _x params ["_radioList"]; { @@ -17,6 +17,7 @@ if (_network > -1 && !(_presetName isEqualTo _oldPresetName)) then { }; { + private _radio = _x; if (player canAdd _radio) then { player addItem _radio; systemChat format ["[TMF] Added radio: %1", _radio]; @@ -32,7 +33,7 @@ if (_network > -1 && !(_presetName isEqualTo _oldPresetName)) then { }; } forEach _radios; -if (_network > -1 && !(_presetName isEqualTo _oldPresetName)) then { +if (_network > -1 && (_presetName isNotEqualTo _oldPresetName)) then { [{[] call acre_api_fnc_isInitialized}, { params ["_unit", "_oldPresetName"]; @@ -45,4 +46,4 @@ if (_network > -1 && !(_presetName isEqualTo _oldPresetName)) then { } forEach _radioList; } forEach EGVAR(acre,radioCoreSettings); }, [player, _oldPresetName]] call CBA_fnc_waitUntilAndExecute; -}; \ No newline at end of file +}; diff --git a/addons/adminmenu/functions/fnc_modal_assignGear.sqf b/addons/adminmenu/functions/fnc_modal_assignGear.sqf index ce4ca034..de5c2c3e 100644 --- a/addons/adminmenu/functions/fnc_modal_assignGear.sqf +++ b/addons/adminmenu/functions/fnc_modal_assignGear.sqf @@ -2,6 +2,7 @@ disableSerialization; params ["_ctrlGroup"]; +private _display = ctrlParent _ctrlGroup; (ctrlPosition _ctrlGroup) params ["", "", "_ctrlGrpWidth", "_ctrlGrpHeight"]; diff --git a/addons/adminmenu/functions/fnc_modal_assignGear_listboxFactions.sqf b/addons/adminmenu/functions/fnc_modal_assignGear_listboxFactions.sqf index 1d673be0..e42f62d1 100644 --- a/addons/adminmenu/functions/fnc_modal_assignGear_listboxFactions.sqf +++ b/addons/adminmenu/functions/fnc_modal_assignGear_listboxFactions.sqf @@ -10,7 +10,7 @@ if (_onlyPresent isEqualTo 1) then { private _missionFactionsFound = []; { private _faction = _x getVariable [QEGVAR(assigngear,faction), ""]; - if !(_faction isEqualTo "") then { + if (_faction isNotEqualTo "") then { _missionFactionsFound pushBackUnique toLower _faction; }; } forEach allPlayers; diff --git a/addons/adminmenu/functions/fnc_modal_assignTraits.sqf b/addons/adminmenu/functions/fnc_modal_assignTraits.sqf index 7f6dcf80..b35cbb24 100644 --- a/addons/adminmenu/functions/fnc_modal_assignTraits.sqf +++ b/addons/adminmenu/functions/fnc_modal_assignTraits.sqf @@ -2,6 +2,7 @@ disableSerialization; params ["_ctrlGroup"]; +private _display = ctrlParent _ctrlGroup; (ctrlPosition _ctrlGroup) params ["", "", "_ctrlGrpWidth", "_ctrlGrpHeight"]; diff --git a/addons/adminmenu/functions/fnc_modal_message.sqf b/addons/adminmenu/functions/fnc_modal_message.sqf index 36d063b9..7f00a33b 100644 --- a/addons/adminmenu/functions/fnc_modal_message.sqf +++ b/addons/adminmenu/functions/fnc_modal_message.sqf @@ -25,7 +25,7 @@ _ctrlButtonPreview ctrlSetPosition [(_ctrlGrpWidth * 0.7) - (0.2 * TMF_ADMINMENU _ctrlButtonPreview ctrlCommit 0; _ctrlButtonPreview ctrlSetText "Preview"; _ctrlButtonPreview setVariable [QGVAR(association), [_ctrlEdit, _ctrlCombo]]; -_ctrlButtonPreview ctrlAddEventHandler ["buttonClick", { +_ctrlButtonPreview ctrlAddEventHandler ["ButtonClick", { params ["_ctrlButton"]; (_ctrlButton getVariable [QGVAR(association), [controlNull, controlNull]]) params ["_ctrlEdit", "_ctrlCombo"]; _ctrlButton call FUNC(debounceButton); @@ -56,7 +56,7 @@ _ctrlButtonCommit ctrlSetPosition [(_ctrlGrpWidth * 0.85), _ctrlGrpHeight - TMF_ _ctrlButtonCommit ctrlCommit 0; _ctrlButtonCommit ctrlSetText "Send Message"; _ctrlButtonCommit setVariable [QGVAR(association), [_ctrlEdit, _ctrlCombo]]; -_ctrlButtonCommit ctrlAddEventHandler ["buttonClick", { +_ctrlButtonCommit ctrlAddEventHandler ["ButtonClick", { params ["_ctrlButton"]; (_ctrlButton getVariable [QGVAR(association), [controlNull, controlNull]]) params ["_ctrlEdit", "_ctrlCombo"]; _ctrlButton call FUNC(debounceButton); diff --git a/addons/adminmenu/functions/fnc_modal_runCode.sqf b/addons/adminmenu/functions/fnc_modal_runCode.sqf index 8766f643..38313b2f 100644 --- a/addons/adminmenu/functions/fnc_modal_runCode.sqf +++ b/addons/adminmenu/functions/fnc_modal_runCode.sqf @@ -37,7 +37,7 @@ _ctrlButton ctrlSetPosition [0.8 * _ctrlGrpWidth, _bottomY, 0.2 * _ctrlGrpWidth, _ctrlButton ctrlCommit 0; _ctrlButton ctrlSetText "Execute"; _ctrlButton setVariable [QGVAR(association), [_ctrlEdit, _ctrlCombo]]; -_ctrlButton ctrlAddEventHandler ["buttonClick", { +_ctrlButton ctrlAddEventHandler ["ButtonClick", { params ["_ctrlButton"]; (_ctrlButton getVariable [QGVAR(association), [controlNull, controlNull]]) params ["_ctrlEdit", "_ctrlCombo"]; _ctrlButton call FUNC(debounceButton); diff --git a/addons/adminmenu/functions/fnc_modal_teleport.sqf b/addons/adminmenu/functions/fnc_modal_teleport.sqf index 18a3b47b..2359cc25 100644 --- a/addons/adminmenu/functions/fnc_modal_teleport.sqf +++ b/addons/adminmenu/functions/fnc_modal_teleport.sqf @@ -19,7 +19,7 @@ if (!isNull cameraOn) then { _ctrlMap ctrlMapAnimAdd [0, ctrlMapScale _ctrlMap, cameraOn]; ctrlMapAnimCommit _ctrlMap; }; -_ctrlMap ctrlAddEventHandler ["mouseButtonClick", { +_ctrlMap ctrlAddEventHandler ["MouseButtonClick", { params ["_ctrlMap", "", "_pos_x", "_pos_y"]; private _toggle = missionNamespace getVariable [QGVAR(utility_teleport_toggle), false]; @@ -96,6 +96,8 @@ _ctrlMap ctrlAddEventHandler ["mouseButtonClick", { systemChat format ["[TMF Admin Menu] Teleported %1 players", _numPlayers]; + private _isParadropped = (missionNamespace getVariable [QGVAR(utility_teleport_paradrop), 0]) == 1; + [format [ "%1 %2 %3 %4 %5", profileName, @@ -106,7 +108,7 @@ _ctrlMap ctrlAddEventHandler ["mouseButtonClick", { ],false,"Admin Menu"] call FUNC(log); }; }]; -_ctrlMap ctrlAddEventHandler ["draw", { +_ctrlMap ctrlAddEventHandler ["Draw", { params ["_ctrlMap"]; if ((missionNamespace getVariable [QGVAR(utility_teleport_drawEnemy), 0]) == 1) then { { @@ -164,7 +166,7 @@ GVAR(utilityTabControls) pushBack _ctrlButton; _ctrlButton ctrlSetPosition [_ctrlGrpX + 0.8 * _ctrlGrpWidth, _ctrlGrpY + _ctrlGrpHeight - TMF_ADMINMENU_STD_HEIGHT, 0.2 * _ctrlGrpWidth, TMF_ADMINMENU_STD_HEIGHT]; _ctrlButton ctrlCommit 0; _ctrlButton ctrlSetText "Enable Teleport"; -_ctrlButton ctrlAddEventHandler ["buttonClick", { +_ctrlButton ctrlAddEventHandler ["ButtonClick", { params ["_ctrlButton"]; GVAR(utility_teleport_toggle) = !(missionNamespace getVariable [QGVAR(utility_teleport_toggle), false]); _ctrlButton ctrlSetText (["Enable Teleport", "Disable Teleport"] select GVAR(utility_teleport_toggle)); diff --git a/addons/adminmenu/functions/fnc_onUnload.sqf b/addons/adminmenu/functions/fnc_onUnload.sqf index d3ee9ec3..78349aad 100644 --- a/addons/adminmenu/functions/fnc_onUnload.sqf +++ b/addons/adminmenu/functions/fnc_onUnload.sqf @@ -8,4 +8,4 @@ disableSerialization; [false] remoteExec [QFUNC(fpsHandlerServer), 2]; -uiNamespace setVariable [QGVAR(display), nil]; \ No newline at end of file +uiNamespace setVariable [QGVAR(display), nil]; diff --git a/addons/adminmenu/functions/fnc_playerManagement.sqf b/addons/adminmenu/functions/fnc_playerManagement.sqf index ec445ed1..d62cab83 100644 --- a/addons/adminmenu/functions/fnc_playerManagement.sqf +++ b/addons/adminmenu/functions/fnc_playerManagement.sqf @@ -3,4 +3,4 @@ disableSerialization; params ["_display"]; -_display call FUNC(playerManagement_updateList); \ No newline at end of file +_display call FUNC(playerManagement_updateList); diff --git a/addons/adminmenu/functions/fnc_playerManagement_updateList.sqf b/addons/adminmenu/functions/fnc_playerManagement_updateList.sqf index f4e21a83..42f74a02 100644 --- a/addons/adminmenu/functions/fnc_playerManagement_updateList.sqf +++ b/addons/adminmenu/functions/fnc_playerManagement_updateList.sqf @@ -20,7 +20,7 @@ private _newPlayers = []; private _isSpectator = _x isKindOf QEGVAR(spectator,unit); private _playerSide = side _x; - if (_addPlayer && !(_filterSide isEqualTo sideUnknown)) then { + if (_addPlayer && (_filterSide isNotEqualTo sideUnknown)) then { if (_isSpectator) then { _playerSide = (_x getVariable [QEGVAR(spectator,side), sideUnknown]); }; diff --git a/addons/adminmenu/functions/fnc_remoteControl.sqf b/addons/adminmenu/functions/fnc_remoteControl.sqf index f8ce56d0..00509815 100644 --- a/addons/adminmenu/functions/fnc_remoteControl.sqf +++ b/addons/adminmenu/functions/fnc_remoteControl.sqf @@ -29,7 +29,7 @@ call { if !(alive _unit) exitWith {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorDestroyed";}; if !(_unit isKindOf "CAManBase") exitWith {_error = "Target must be a unit.";}; if !((side group _unit) in [east, west, resistance, civilian]) exitWith {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorEmpty";}; - private _tempOwner = _unit getVariable ["bis_fnc_moduleRemoteControl_owner", objnull]; + private _tempOwner = _unit getVariable ["bis_fnc_moduleRemoteControl_owner", objNull]; if (!isNull _tempOwner && {_tempOwner in allPlayers}) exitWith {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";}; if (isUAVConnected vehicle _unit) exitWith {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";}; }; @@ -58,8 +58,8 @@ if (_error isEqualTo "") then { (_this getVariable ["ACE_isUnconscious", false]) || (cameraOn isEqualTo player) || !(player isKindOf QEGVAR(spectator,unit)) || - !((missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", objNull]) isEqualTo _this) || - !((_this getVariable ["bis_fnc_moduleRemoteControl_owner", objNull]) isEqualTo player) + ((missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", objNull]) isNotEqualTo _this) || + ((_this getVariable ["bis_fnc_moduleRemoteControl_owner", objNull]) isNotEqualTo player) }, { private _reasons = []; if (!alive _this) then { @@ -74,10 +74,10 @@ if (_error isEqualTo "") then { if (!(player isKindOf QEGVAR(spectator,unit))) then { _reasons pushBack "Player is not a spectator unit (respawned?)"; }; - if (!((missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", objNull]) isEqualTo _this)) then { + if (((missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", objNull]) isNotEqualTo _this)) then { _reasons pushBack "Mission RC var says current unit shouldn't be RC'd"; }; - if (!((_this getVariable ["bis_fnc_moduleRemoteControl_owner", objNull]) isEqualTo player)) then { + if (((_this getVariable ["bis_fnc_moduleRemoteControl_owner", objNull]) isNotEqualTo player)) then { _reasons pushBack "Unit RC var says player shouldn't be remote controlling it"; }; systemChat format [ diff --git a/addons/adminmenu/functions/fnc_remoteControl_dialog.sqf b/addons/adminmenu/functions/fnc_remoteControl_dialog.sqf index ed4b0a1f..f71d365a 100644 --- a/addons/adminmenu/functions/fnc_remoteControl_dialog.sqf +++ b/addons/adminmenu/functions/fnc_remoteControl_dialog.sqf @@ -20,7 +20,7 @@ _ctrlList ctrlCommit 0; _name = getText (([GVAR(remoteControlUnits) # 1, _turretPath] call BIS_fnc_turretConfig) >> "gunnerName"); }; private _i = _ctrlList lbAdd _name; - _ctrlList lbSetTextRight [_i, getText (configFile >> "CfgVehicles" >> typeOf (_x # 0) >> "displayName")]; + _ctrlList lbSetTextRight [_i, getText (configOf (_x # 0) >> "displayName")]; _ctrlList lbSetTooltip [_i, format ["Turret Path: %1\nFFV: %2", _x # 3, _x # 4]]; _ctrlList lbSetPicture [_i, format ["\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa", rank (_x # 0)]]; _ctrlList lbSetPictureColor [_i, [1, 1, 1, 1]]; @@ -32,7 +32,7 @@ _ctrlOK ctrlSetText "Control"; _ctrlOK ctrlSetPosition [(_dialogPosition # 0) + 0.67 * (_dialogPosition # 2), (_dialogPosition # 1) + (_dialogPosition # 3) + 0.1 * TMF_ADMINMENU_STD_HEIGHT, 0.33 * (_dialogPosition # 2), TMF_ADMINMENU_STD_HEIGHT]; _ctrlOK ctrlCommit 0; _ctrlOK setVariable [QGVAR(association), _ctrlList]; -_ctrlOK ctrlAddEventHandler ["buttonClick", { +_ctrlOK ctrlAddEventHandler ["ButtonClick", { params ["_ctrlOK"]; private _listIndex = lbCurSel (_ctrlOK getVariable [QGVAR(association), controlNull]); @@ -42,4 +42,4 @@ _ctrlOK ctrlAddEventHandler ["buttonClick", { [_unit, true, true] call FUNC(remoteControl); GVAR(remoteControlUnits) = nil; -}]; \ No newline at end of file +}]; diff --git a/addons/adminmenu/functions/fnc_respawn.sqf b/addons/adminmenu/functions/fnc_respawn.sqf index 625b6b94..5573b786 100644 --- a/addons/adminmenu/functions/fnc_respawn.sqf +++ b/addons/adminmenu/functions/fnc_respawn.sqf @@ -196,7 +196,7 @@ _control = (_display displayCtrl IDC_TMF_ADMINMENU_RESP_MARKERTYPE); lbClear _control; { private _idx = _control lbAdd (_x select 1); - _markerImg = (_x select 0); + private _markerImg = (_x select 0); if (_markerImg != "") then { _control lbSetPicture[_idx,_markerImg]; _control lbSetColor[_idx,[1,1,1,1]]; @@ -272,7 +272,7 @@ if (!isNil QGVAR(respawnGroupMarkerCheckBoxVal)) then { [{ params["_input", "_pfhID"]; _input params ["_oldSpectList"]; - _display = findDisplay IDD_TMF_ADMINMENU; + private _display = findDisplay IDD_TMF_ADMINMENU; if (isNull (findDisplay IDD_TMF_ADMINMENU)) exitWith { [_pfhID] call CBA_fnc_removePerFrameHandler;} ; //Recompute who is alive and Dead. diff --git a/addons/adminmenu/functions/fnc_respawn_mapDrawIcons.sqf b/addons/adminmenu/functions/fnc_respawn_mapDrawIcons.sqf index 190ac947..5ae47459 100644 --- a/addons/adminmenu/functions/fnc_respawn_mapDrawIcons.sqf +++ b/addons/adminmenu/functions/fnc_respawn_mapDrawIcons.sqf @@ -7,13 +7,13 @@ params["_fullmapWindow"]; if(alive _x) then { private _name = ""; if(isPlayer _x) then {_name = name _x}; - if(leader _x == _x && {isPlayer _x} count units _x > 0) then {_name = format["%1 - %2",toString(toArray(groupID (group _x)) - [45]),_name]}; - if(vehicle _x != _x && crew (vehicle _x) select 0 == _x || vehicle _x == _x) then + if(leader _x == _x && {isPlayer _x} count units _x > 0) then {_name = format["%1 - %2",toString(toArray(groupId (group _x)) - [45]),_name]}; + if(!isNull objectParent _x && crew (vehicle _x) select 0 == _x || isNull objectParent _x) then { private _icon = (vehicle _x getVariable ["f_cam_icon",""]); - if(_icon == "") then {_icon = gettext (configfile >> "CfgVehicles" >> typeOf (vehicle _x) >> "icon");vehicle _x setVariable ["f_cam_icon",_icon]}; + if(_icon == "") then {_icon = getText (configOf (vehicle _x) >> "icon");vehicle _x setVariable ["f_cam_icon",_icon]}; private _color = (side _x) call tmf_common_fnc_sideToColor; - _fullmapWindow drawIcon [_icon,_color,getpos _x,19,19,getDir (vehicle _x),_name,1]; + _fullmapWindow drawIcon [_icon,_color,getPos _x,19,19,getDir (vehicle _x),_name,1]; }; }; @@ -23,24 +23,24 @@ params["_fullmapWindow"]; private _markerShape = markerShape _x; private _markerPos = getMarkerPos _x; private _markerSize = getMarkerSize _x; - private _markerColor = (configfile >> "CfgMarkerColors" >> getMarkerColor _x >> "color") call BIS_fnc_colorConfigToRGBA; + private _markerColor = (configFile >> "CfgMarkerColors" >> getMarkerColor _x >> "color") call BIS_fnc_colorConfigToRGBA; private _markerDir = markerDir _x; switch (_markerShape) do { case "RECTANGLE": { - private _markerBrush = getText (configfile >> "cfgMarkerBrushes" >> markerBrush _x >> "texture"); + private _markerBrush = getText (configFile >> "cfgMarkerBrushes" >> markerBrush _x >> "texture"); _fullmapWindow drawRectangle [_markerPos, _markerSize select 0, _markerSize select 1, _markerDir, _markerColor, _markerBrush] }; case "ELLIPSE": { - private _markerBrush = getText (configfile >> "cfgMarkerBrushes" >> markerBrush _x >> "texture"); + private _markerBrush = getText (configFile >> "cfgMarkerBrushes" >> markerBrush _x >> "texture"); _fullmapWindow drawEllipse [_markerPos, _markerSize select 0, _markerSize select 1, _markerDir, _markerColor, _markerBrush] }; case "ICON": { private _markerType = getMarkerType _x; if (_markerType != "Empty") then { - _multiplier = 20; - _markerIcon = getText (configfile >> "CfgMarkers" >> _markerType >> "icon"); - _markerText = markerText _x; + private _multiplier = 20; + private _markerIcon = getText (configFile >> "CfgMarkers" >> _markerType >> "icon"); + private _markerText = markerText _x; _fullmapWindow drawIcon [_markerIcon, _markerColor, _markerPos, (_markerSize select 0) * _multiplier, (_markerSize select 1) * _multiplier, _markerDir, _markerText, 1]; }; }; @@ -71,4 +71,4 @@ if (_mousePos isEqualType []) then { }; _fullmapWindow drawIcon ["\A3\ui_f\data\map\markers\military\start_CA.paa",[1,0,0,1],_mousePos,20,20,0,_text,1]; }; -}; \ No newline at end of file +}; diff --git a/addons/adminmenu/functions/fnc_respawn_mapKeyUp.sqf b/addons/adminmenu/functions/fnc_respawn_mapKeyUp.sqf index bf4c11b1..c70e55a3 100644 --- a/addons/adminmenu/functions/fnc_respawn_mapKeyUp.sqf +++ b/addons/adminmenu/functions/fnc_respawn_mapKeyUp.sqf @@ -34,8 +34,8 @@ if (_type == 28) then { _x set [2,(respawnMenuRoles select _roleIdx) select 0]; } forEach GVAR(selectedRespawnGroup); - TRACE_9("Triggered respawn wave",_groupName,_position, _faction, GVAR(selectedRespawnGroup), _markerType, _markerColor, _markerName,_halo,GVAR(selectedSide)); - [[_groupName,_position, _faction, GVAR(selectedRespawnGroup), _markerType, _markerColor, _markerName,_halo,GVAR(selectedSide)], QEFUNC(respawn,respawnWaveServer), false] call BIS_fnc_MP; + TRACE_9("Triggered respawn wave",_groupName,_position,_faction,GVAR(selectedRespawnGroup),_markerType,_markerColor,_markerName,_halo,GVAR(selectedSide)); + [_groupName,_position, _faction, GVAR(selectedRespawnGroup), _markerType, _markerColor, _markerName,_halo,GVAR(selectedSide)] remoteExec [QEFUNC(respawn,respawnWaveServer), 2]; // Print to log private _argsStr = [ @@ -50,7 +50,7 @@ if (_type == 28) then { // Close the Map ((findDisplay IDC_TMF_ADMINMENU_RESP_MAP_DISPLAY) displayCtrl IDC_TMF_ADMINMENU_RESP_MAP_CONTROL) ctrlShow false; ((findDisplay IDC_TMF_ADMINMENU_RESP_MAP_DISPLAY) displayCtrl IDC_TMF_ADMINMENU_RESP_MAP_CONTROL) mapCenterOnCamera false; - closeDialog IDC_TMF_ADMINMENU_RESP_MAP_DISPLAY; + (findDisplay IDC_TMF_ADMINMENU_RESP_MAP_DISPLAY) closeDisplay 1; }; }; //SPACEBAR (HALO TOGGLE) diff --git a/addons/adminmenu/functions/fnc_respawn_mapLoaded.sqf b/addons/adminmenu/functions/fnc_respawn_mapLoaded.sqf index c127ac8c..67a37b50 100644 --- a/addons/adminmenu/functions/fnc_respawn_mapLoaded.sqf +++ b/addons/adminmenu/functions/fnc_respawn_mapLoaded.sqf @@ -9,7 +9,7 @@ private _pos = [0,0,0]; if (alive player && !(player isKindOf "tmf_spectator_unit")) then { _pos = getPos player; } else { - if (count playableUnits > 0) then { + if (playableUnits isNotEqualTo []) then { _pos = getPos (playableUnits select 0); } else { if (count allUnits > 0) then { diff --git a/addons/adminmenu/functions/fnc_respawn_respawnButton.sqf b/addons/adminmenu/functions/fnc_respawn_respawnButton.sqf index a4ff3469..1b495774 100644 --- a/addons/adminmenu/functions/fnc_respawn_respawnButton.sqf +++ b/addons/adminmenu/functions/fnc_respawn_respawnButton.sqf @@ -22,7 +22,7 @@ if (!_useMarker) then { //GVAR(respawnGroupMarkerCheckBoxVal) }; // Hand over control to the map dialog. -closeDialog IDD_TMF_ADMINMENU; +(findDisplay IDD_TMF_ADMINMENU) closeDisplay 2; createDialog QGVAR(respawnMapDialog); GVAR(respawnGuiParameters) = [_faction, _groupName, _markerType, _markerColor, _markerName]; diff --git a/addons/adminmenu/functions/fnc_selectTab.sqf b/addons/adminmenu/functions/fnc_selectTab.sqf index e9fe6080..462ceae7 100644 --- a/addons/adminmenu/functions/fnc_selectTab.sqf +++ b/addons/adminmenu/functions/fnc_selectTab.sqf @@ -3,8 +3,6 @@ disableSerialization; params ["_display", ["_tab", IDC_TMF_ADMINMENU_G_DASH]]; -_display call FUNC(utilityClose); - GVAR(selectedTab) = _tab; while {count GVAR(tabPFHHandles) > 0} do { diff --git a/addons/adminmenu/functions/fnc_utility_grantzeus.sqf b/addons/adminmenu/functions/fnc_utility_grantzeus.sqf index 0a92427a..f694d1a3 100644 --- a/addons/adminmenu/functions/fnc_utility_grantzeus.sqf +++ b/addons/adminmenu/functions/fnc_utility_grantzeus.sqf @@ -12,14 +12,14 @@ private _had = []; }; } forEach GVAR(utilityData); -if (count _given > 0) then { +if (_given isNotEqualTo []) then { _given = str (_given apply {name _x}); _given = _given select [1, (count _given) - 2]; systemChat format ["[TMF Admin Menu] Zeus access was given to %1", _given]; [format ["%1 granted zeus to %2",profileName, _given],false,"Admin Menu"] call FUNC(log); }; -if (count _had > 0) then { +if (_had isNotEqualTo []) then { _had = str (_had apply {name _x}); _had = _had select [1, (count _had) - 2]; systemChat format ["[TMF Admin Menu] Zeus access was already given to %1", _had]; diff --git a/addons/adminmenu/functions/fnc_utility_quickRespawn.sqf b/addons/adminmenu/functions/fnc_utility_quickRespawn.sqf index 12ada88f..82d400ba 100644 --- a/addons/adminmenu/functions/fnc_utility_quickRespawn.sqf +++ b/addons/adminmenu/functions/fnc_utility_quickRespawn.sqf @@ -1,12 +1,11 @@ #include "\x\tmf\addons\adminmenu\script_component.hpp" systemChat "[TMF Admin Menu] Quick Respawn:"; -private _str = ""; -{ - _str = _str + format ["[%1: %2]", name _x, str ((_x getVariable [QEGVAR(spectator,unitData), false]) isEqualType [])]; - +private _parts = GVAR(utilityData) apply { [QGVAR(quickRespawn), 0, _x] call CBA_fnc_targetEvent; -} forEach GVAR(utilityData); + format ["[%1: %2]", name _x, str ((_x getVariable [QEGVAR(spectator,unitData), false]) isEqualType [])] +}; +private _str = _parts joinString ""; systemChat _str; -[["%1 Quick Respawned %2",profileName,_str],false,"[TMF Admin Menu] "]; +[format ["%1 Quick Respawned %2",profileName,_str],false,"Admin Menu"] call FUNC(log); diff --git a/addons/adminmenu/functions/fnc_utility_quickRespawn_local.sqf b/addons/adminmenu/functions/fnc_utility_quickRespawn_local.sqf index 2c5b64cb..b09ef211 100644 --- a/addons/adminmenu/functions/fnc_utility_quickRespawn_local.sqf +++ b/addons/adminmenu/functions/fnc_utility_quickRespawn_local.sqf @@ -65,7 +65,7 @@ if (_oldUnitdata isEqualType []) then { [player, true] call EFUNC(orbat,setup); // Add all the respawned groups to the map markers as well. - [] call FUNC(respawnGroupMarkerUpdate); + [] call EFUNC(respawn,respawnGroupMarkerUpdate); } else { systemChat "[TMF Admin Menu] Quick Respawn failed: old unit data unavailable"; }; diff --git a/addons/adminmenu/gui/adminMenu.hpp b/addons/adminmenu/gui/adminMenu.hpp index dd3a5778..14d8013f 100644 --- a/addons/adminmenu/gui/adminMenu.hpp +++ b/addons/adminmenu/gui/adminMenu.hpp @@ -14,31 +14,29 @@ class RscEditMulti: RscEdit {}; class RscPicture; class RscToolbox; class RscStructuredText; -class RscControlsTable; class RscMapControl; -class ScrollBar; class GVAR(RscButtonMenu): RscButtonMenu { style = "0x02 + 0x0C"; font = "RobotoCondensed"; - sizeEx = TMF_ADMINMENU_STD_SIZEX_L; - size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.9)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX_L); + size = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.9)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class GVAR(RscText): RscText { - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); }; class GVAR(RscTextLarge): RscText { - sizeEx = TMF_ADMINMENU_STD_SIZEX_L; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX_L); }; class GVAR(RscSpectatorControlTableText): RscText { - sizeEx = TMF_ADMINMENU_STD_SIZEX; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = (6/10) * TMF_ADMINMENU_RESP_W_COL1; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = QUOTE((6/10) * TMF_ADMINMENU_RESP_W_COL1); x = 0; y = 0; }; @@ -54,7 +52,7 @@ class GVAR(RscEditMultiCode): RscEditMulti { class GVAR(RscCombo): RscCombo { font = "RobotoCondensed"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); }; class GVAR(RscTextIcon): RscText { @@ -64,12 +62,12 @@ class GVAR(RscTextIcon): RscText { class GVAR(RscListBox): RscListBox { font = "RobotoCondensed"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); }; class GVAR(RscListNBox): RscListNBox { font = "RobotoCondensed"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); }; class ADDON @@ -89,10 +87,10 @@ class ADDON text = "TMF Admin Menu"; style = 0; colorBackground[] = {0, 0, 0, 0}; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "15 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "1 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "15 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class TitleFPS: Title @@ -100,8 +98,8 @@ class ADDON idc = IDC_TMF_ADMINMENU_FPS; text = ""; style = 1; - x = "16 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - w = "23 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "16 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + w = "23 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; @@ -113,10 +111,10 @@ class ADDON tooltip = ""; onButtonClick = QUOTE([ARR_2(ctrlParent param [0],IDC_TMF_ADMINMENU_G_DASH)] call FUNC(selectTab)); colorBackground[] = {0, 0, 0, 0}; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "5.8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "1 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "2.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "5.8 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class TabPlayerManagement: TabDashboard { @@ -124,8 +122,8 @@ class ADDON text = "Player Management"; tooltip = "Perform actions on players"; onButtonClick = QUOTE([ARR_2(ctrlParent param [0],IDC_TMF_ADMINMENU_G_PMAN)] call FUNC(selectTab)); - x = "6.9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - w = "9 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "6.9 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + w = "9 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class TabRespawnPlayers: TabDashboard { @@ -133,8 +131,8 @@ class ADDON text = "Respawn"; tooltip = "Respawn dead players back in the game"; onButtonClick = QUOTE([ARR_2(ctrlParent param [0],IDC_TMF_ADMINMENU_G_RESP)] call FUNC(selectTab)); - x = "16 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - w = "4.8 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "16 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + w = "4.8 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class TabEndMission: TabDashboard { @@ -142,8 +140,8 @@ class ADDON text = "End Mission"; tooltip = "Select and execute a mission ending"; onButtonClick = QUOTE([ARR_2(ctrlParent param [0],IDC_TMF_ADMINMENU_G_ENDM)] call FUNC(selectTab)); - x = "20.9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - w = "5.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "20.9 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + w = "5.9 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class TabMessageLog: TabDashboard { @@ -151,15 +149,15 @@ class ADDON text = "Logs"; tooltip = "Status and debug messages from TMF components"; onButtonClick = QUOTE([ARR_2(ctrlParent param [0],IDC_TMF_ADMINMENU_G_MSGS)] call FUNC(selectTab)); - x = "26.9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - w = "3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "26.9 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + w = "3 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; // Groups for Tabs class GroupBase: RscControlsGroup { - x = "1.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + x = "1.1 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "3.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; w = "0"; h = "0"; class Controls {}; @@ -168,40 +166,40 @@ class ADDON class GroupDashboard: GroupBase { idc = IDC_TMF_ADMINMENU_G_DASH; - w = TMF_GROUPBASE_W; - h = TMF_GROUPBASE_H; + w = QUOTE(TMF_GROUPBASE_W); + h = QUOTE(TMF_GROUPBASE_H); #include "dashboard.hpp" }; class GroupPlayerManagement: GroupBase { idc = IDC_TMF_ADMINMENU_G_PMAN; - w = TMF_GROUPBASE_W; - h = TMF_GROUPBASE_H; + w = QUOTE(TMF_GROUPBASE_W); + h = QUOTE(TMF_GROUPBASE_H); #include "playerManagement.hpp" }; class GroupRespawn: GroupBase { idc = IDC_TMF_ADMINMENU_G_RESP; - w = TMF_GROUPBASE_W; - h = TMF_GROUPBASE_H; + w = QUOTE(TMF_GROUPBASE_W); + h = QUOTE(TMF_GROUPBASE_H); #include "respawn.hpp" }; class GroupEndMission: GroupBase { idc = IDC_TMF_ADMINMENU_G_ENDM; - w = TMF_GROUPBASE_W; - h = TMF_GROUPBASE_H; + w = QUOTE(TMF_GROUPBASE_W); + h = QUOTE(TMF_GROUPBASE_H); #include "endMission.hpp" }; class GroupMessageLog: GroupBase { idc = IDC_TMF_ADMINMENU_G_MSGS; - w = TMF_GROUPBASE_W; - h = TMF_GROUPBASE_H; + w = QUOTE(TMF_GROUPBASE_W); + h = QUOTE(TMF_GROUPBASE_H); #include "messageLog.hpp" }; @@ -210,10 +208,10 @@ class ADDON { idc = IDC_TMF_ADMINMENU_UTIL_TBACK; colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])"}; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "3.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "1 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "3.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class UtilityTitle: RscTitle { @@ -221,17 +219,17 @@ class ADDON text = "Utility Title"; style = 0; colorBackground[] = {0, 0, 0, 0}; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "3.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "1 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "3.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class UtilityGroup: GroupBase { idc = IDC_TMF_ADMINMENU_G_UTIL; - y = "4.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "37.8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "19.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "4.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "37.8 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "19.6 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; }; @@ -240,21 +238,21 @@ class ADDON class TitleBackground: RscText { colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])"}; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "1 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class TabsBackgroundLeft: TitleBackground { colorBackground[] = {0, 0, 0, 1}; - y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "2.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class MainBackground: TitleBackground { colorBackground[] = {0, 0, 0, 0.7}; - y = "3.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - h = "20.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "3.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + h = "20.8 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; }; }; @@ -275,14 +273,14 @@ class GVAR(respawnMapDialog) { { idc = IDC_TMF_ADMINMENU_RESP_MAP_CONTROL; type = 100; - x = 0 * safezoneW + safezoneX; - y = 0 * safezoneH + safezoneY; - w = 1 * safezoneW; - h = 1 * safezoneH; + x = QUOTE(0 * safeZoneW + safeZoneX); + y = QUOTE(0 * safeZoneH + safeZoneY); + w = QUOTE(1 * safeZoneW); + h = QUOTE(1 * safeZoneH); onDraw = QUOTE(_this call FUNC(respawn_mapDrawIcons)); - onSetFocus = QUOTE(_this spawn FUNC(respawn_mapLoaded)); //"['respawnMapLoaded'] spawn tmf_respawn_fnc_handleRespawnUI"; - onMouseButtonDown = QUOTE(_this spawn FUNC(respawn_mapClick)); //"['respawnMap_onMouseButtonDown',_this] spawn tmf_respawn_fnc_handleRespawnUI"; - onKeyUp = QUOTE(_this spawn FUNC(respawn_mapKeyUp)); //"['respawnMap_keyUp',_this] spawn tmf_respawn_fnc_handleRespawnUI"; + onSetFocus = QUOTE(_this call FUNC(respawn_mapLoaded)); + onMouseButtonDown = QUOTE(_this call FUNC(respawn_mapClick)); + onKeyUp = QUOTE(_this call FUNC(respawn_mapKeyUp)); }; }; }; @@ -300,14 +298,14 @@ class GVAR(adminEyeDialog) { { idc = IDC_TMF_ADMINMENU_ADME_MAP_CONTROL; type = 100; - x = 0 * safezoneW + safezoneX; - y = 0 * safezoneH + safezoneY; - w = 1 * safezoneW; - h = 1 * safezoneH; + x = QUOTE(0 * safeZoneW + safeZoneX); + y = QUOTE(0 * safeZoneH + safeZoneY); + w = QUOTE(1 * safeZoneW); + h = QUOTE(1 * safeZoneH); onDraw = QUOTE(_this call FUNC(adminEye_draw)); - onMouseButtonDown = QUOTE(_this spawn FUNC(adminEye_onClick)); - onSetFocus = QUOTE(_this spawn FUNC(adminEye_onLoad)); - onKeyUp = QUOTE(_this spawn FUNC(adminEye_onKeyPress)); + onMouseButtonDown = QUOTE(_this call FUNC(adminEye_onClick)); + onSetFocus = QUOTE(_this call FUNC(adminEye_onLoad)); + onKeyUp = QUOTE(_this call FUNC(adminEye_onKeyPress)); }; }; }; @@ -321,20 +319,20 @@ class GVAR(spectatorControlUnitDialog) { class Title: RscTitle { idc = -1; text = "Select Unit in Vehicle"; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "19 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "1 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "19 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])"}; shadow = 1; style = 0; }; class Background: RscText { onLoad = QUOTE(_this call FUNC(remoteControl_dialog)); - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "19 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "16 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "1 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "2.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "19 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "16 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; colorBackground[] = {0,0,0,0.7}; }; }; diff --git a/addons/adminmenu/gui/dashboard.hpp b/addons/adminmenu/gui/dashboard.hpp index 639efde6..1a245e65 100644 --- a/addons/adminmenu/gui/dashboard.hpp +++ b/addons/adminmenu/gui/dashboard.hpp @@ -4,11 +4,11 @@ class Controls class LabelShortcuts: RscText { text = "Shortcuts"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); x = "0"; y = "0"; - w = "7 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "7 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class ButtonDebugConsole: GVAR(RscButtonMenu) { @@ -16,22 +16,22 @@ class Controls text = "Debug Console"; onButtonClick = "(ctrlParent param [0]) closeDisplay 1; createDialog 'RscDisplayDebugPublic';"; x = "0"; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "7 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "1.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "7 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class ButtonClaimZeus: ButtonDebugConsole { idc = IDC_TMF_ADMINMENU_DASH_CLAIMZEUS; text = "Claim Zeus"; onButtonClick = QUOTE(call FUNC(claimZeus)); - y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "2.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class ButtonCamera: ButtonDebugConsole { idc = IDC_TMF_ADMINMENU_DASH_CAMERA; text = "Camera"; onButtonClick = "(ctrlParent param [0]) closeDisplay 1; [] spawn BIS_fnc_camera;"; - y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "3.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class ButtonArsenal: ButtonDebugConsole { @@ -40,7 +40,7 @@ class Controls tooltip = "ACE Arsenal. Hold Shift to open vanilla Arsenal."; onButtonClick = ""; onMouseButtonClick = "if (player isKindOf 'CAManBase' && alive player) then {(ctrlParent param [0]) closeDisplay 1; if (!param [4]) then {[player, player, true] call ACE_arsenal_fnc_openBox;} else {['Open', true] spawn BIS_fnc_arsenal;};} else {systemChat '[TMF Admin Menu] Player object not compatible with Arsenal';};"; - y = "4.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "4.4 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class TabAdminEye: ButtonDebugConsole { @@ -48,57 +48,57 @@ class Controls text = "Map"; tooltip = "View Admin Map"; onButtonClick = QUOTE([] call FUNC(adminEye_open)); - y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "5.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; // Safestart class LabelSafestart: LabelShortcuts { text = "Safestart"; - y = "6.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "6.8 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class CheckboxSafestartEnabled: RscCheckBox { idc = IDC_TMF_ADMINMENU_DASH_SAFESTART; - x = "0.1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "7.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "0.1 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "7.7 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "1 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class LabelSafestartEnabled: LabelShortcuts { idc = -1; text = "Enabled"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); colorText[] = {0.8, 0.8, 0.8, 1}; - x = "0.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "7.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "5.8 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "0.9 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "7.7 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "5.8 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; // Toggle Spectator Talk class LabelSpectatorTalk: LabelShortcuts { text = "Talk with Spectators"; - y = "9.0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "9.0 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class CheckboxSpectatorTalkEnabled: RscCheckBox { idc = IDC_TMF_ADMINMENU_DASH_SPECTATORTALK; - x = "0.1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "9.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "0.1 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "9.9 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "1 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class LabelSpectatorTalkEnabled: LabelShortcuts { idc = -1; text = "Enabled"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); colorText[] = {0.8, 0.8, 0.8, 1}; - x = "0.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "9.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "5.8 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "0.9 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "9.9 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "5.8 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; @@ -109,115 +109,115 @@ class Controls class LabelInformation: RscText { text = "General Information"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "8.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "7 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); + x = "8 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "8.7 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "7 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class StatsLabel_Vehicles: RscText { text = "Vehicles"; colorBackground[] = {1, 1, 1, 0.2}; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "9.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "4.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); + x = "8 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "9.8 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "4.5 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class StatsValue_Vehicles: StatsLabel_Vehicles { idc = IDC_TMF_ADMINMENU_DASH_VEHICLES; text = "0"; colorBackground[] = {0.5, 0.5, 0.5, 0.1}; - x = "12.6 * (((safezoneW / safezoneH) min 1.2) / 40)"; - w = "8.8 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "12.6 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + w = "8.8 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class StatsLabel_DeadUnits: StatsLabel_Vehicles { text = "Dead Units"; - y = "10.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "10.9 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class StatsValue_DeadUnits: StatsValue_Vehicles { idc = IDC_TMF_ADMINMENU_DASH_DEADMEN; text = "0"; - y = "10.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "10.9 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class StatsLabel_HeadlessClients: StatsLabel_Vehicles { text = "AI Load Balance"; tooltip = "The number of groups being run on the server and each HC."; - y = "12 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "12 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class StatsValue_HeadlessClients: StatsValue_Vehicles { idc = IDC_TMF_ADMINMENU_DASH_HEADLESS; text = "0"; - y = "12 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "12 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class StatsLabel_Curators: StatsLabel_Vehicles { text = "Zeuses"; - y = "13.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "13.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class StatsValue_Curators: StatsValue_Vehicles { idc = IDC_TMF_ADMINMENU_DASH_CURATORS; text = "0"; - y = "13.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "13.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class StatsLabel_CurrentAdmin: StatsLabel_Vehicles { text = "Current Admin"; - y = "14.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "14.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class StatsValue_CurrentAdmin: StatsValue_Vehicles { idc = IDC_TMF_ADMINMENU_DASH_CURRADMIN; text = "no data"; - y = "14.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "14.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class StatsLabel_MissionRuntime: StatsLabel_Vehicles { text = "Mission Runtime"; - y = "15.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "15.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class StatsValue_MissionRuntime: StatsValue_Vehicles { idc = IDC_TMF_ADMINMENU_DASH_RUNTIME; text = "18m 37s"; - y = "15.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "15.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; // Mission maker's notes, right class LabelMissionNotes: RscText { text = "Mission Maker's Notes"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "22.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); + x = "22.4 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; y = "0"; - w = "15.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "15.4 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class GroupMissionNotes: RscControlsGroup { idc = IDC_TMF_ADMINMENU_G_DASH_MISSIONNOTES; - x = "22.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "15.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "19.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "22.4 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "1.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "15.4 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "19.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; class Controls { class TextMissionNotes: RscStructuredText { idc = IDC_TMF_ADMINMENU_DASH_MISSIONNOTES; - size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + size = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.8)"; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); x = "0"; y = "0"; - w = "14.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; // Margin for vertical scrollbar - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "14.9 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; // Margin for vertical scrollbar + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; }; }; diff --git a/addons/adminmenu/gui/dashboard_table.hpp b/addons/adminmenu/gui/dashboard_table.hpp index f91b0c2a..378aa5a9 100644 --- a/addons/adminmenu/gui/dashboard_table.hpp +++ b/addons/adminmenu/gui/dashboard_table.hpp @@ -1,11 +1,11 @@ class LabelUnitStats: RscText { text = "Statistics"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "8 * (((safezoneW / safezoneH) min 1.2) / 40)"; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); + x = "8 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; y = "0"; - w = "13.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "13.4 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; // Header @@ -13,217 +13,217 @@ class UnitStats_SideBackground: RscText { text = ""; colorBackground[] = {1, 1, 1, 0.2}; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); + x = "8 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "1.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "1 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class UnitStats_AI: UnitStats_SideBackground { text = "AI"; - x = "9.1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - w = "2 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "9.1 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + w = "2 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class UnitStats_Players: UnitStats_AI { text = "Players"; - x = "11.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - w = "3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "11.2 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + w = "3 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class UnitStats_Spectators: UnitStats_AI { text = "Spectators"; - x = "14.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - w = "4 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "14.3 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + w = "4 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class UnitStats_Total: UnitStats_AI { text = "Total"; - x = "18.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - w = "3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "18.4 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + w = "3 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; // Blufor class UnitStats_SideBackground_Blufor: UnitStats_SideBackground { colorBackground[] = {0.5, 0.5, 0.5, 0.1}; - y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "2.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_SideIcon_Blufor: RscPicture { style = 48 + 2048; // picture + keep aspect ratio text = "\a3\ui_f\data\GUI\Rsc\RscDisplayMultiplayerSetup\flag_indep_ca.paa"; colorText[] = {"(profilenamespace getvariable ['Map_BLUFOR_R',0])", "(profilenamespace getvariable ['Map_BLUFOR_G',0])", "(profilenamespace getvariable ['Map_BLUFOR_B',1])", 0.8}; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "2.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); + x = "8 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "2.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "1 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class UnitStats_AI_Blufor: UnitStats_AI { idc = IDC_TMF_ADMINMENU_DASH_STATS_BLUFOR_AI; text = ""; colorBackground[] = {0.5, 0.5, 0.5, 0.1}; - y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "2.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_Players_Blufor: UnitStats_Players { idc = IDC_TMF_ADMINMENU_DASH_STATS_BLUFOR_PLAYERS; text = ""; colorBackground[] = {0.5, 0.5, 0.5, 0.1}; - y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "2.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_Spectators_Blufor: UnitStats_Spectators { idc = IDC_TMF_ADMINMENU_DASH_STATS_BLUFOR_SPECTATORS; text = ""; colorBackground[] = {0.5, 0.5, 0.5, 0.1}; - y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "2.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_Total_Blufor: UnitStats_Total { idc = IDC_TMF_ADMINMENU_DASH_STATS_BLUFOR_TOTAL; text = ""; colorBackground[] = {0.5, 0.5, 0.5, 0.1}; - y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "2.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; // Opfor class UnitStats_SideBackground_Opfor: UnitStats_SideBackground { colorBackground[] = {1, 1, 1, 0.1}; - y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "3.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_SideIcon_Opfor: UnitStats_SideIcon_Blufor { colorText[] = {"(profilenamespace getvariable ['Map_OPFOR_R',1])", "(profilenamespace getvariable ['Map_OPFOR_G',0])", "(profilenamespace getvariable ['Map_OPFOR_B',0])", 0.8}; - y = "3.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "3.4 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_AI_Opfor: UnitStats_AI { idc = IDC_TMF_ADMINMENU_DASH_STATS_OPFOR_AI; text = ""; colorBackground[] = {1, 1, 1, 0.1}; - y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "3.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_Players_Opfor: UnitStats_Players { idc = IDC_TMF_ADMINMENU_DASH_STATS_OPFOR_PLAYERS; text = ""; colorBackground[] = {1, 1, 1, 0.1}; - y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "3.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_Spectators_Opfor: UnitStats_Spectators { idc = IDC_TMF_ADMINMENU_DASH_STATS_OPFOR_SPECTATORS; text = ""; colorBackground[] = {1, 1, 1, 0.1}; - y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "3.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_Total_Opfor: UnitStats_Total { idc = IDC_TMF_ADMINMENU_DASH_STATS_OPFOR_TOTAL; text = ""; colorBackground[] = {1, 1, 1, 0.1}; - y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "3.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; // Indep class UnitStats_SideBackground_Indep: UnitStats_SideBackground_Blufor { - y = "4.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "4.4 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_SideIcon_Indep: UnitStats_SideIcon_Blufor { colorText[] = {"(profilenamespace getvariable ['Map_Independent_R',0])", "(profilenamespace getvariable ['Map_Independent_G',1])", "(profilenamespace getvariable ['Map_Independent_B',0])", 0.8}; - y = "4.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "4.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_AI_Indep: UnitStats_AI_Blufor { idc = IDC_TMF_ADMINMENU_DASH_STATS_INDEP_AI; - y = "4.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "4.4 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_Players_Indep: UnitStats_Players_Blufor { idc = IDC_TMF_ADMINMENU_DASH_STATS_INDEP_PLAYERS; - y = "4.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "4.4 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_Spectators_Indep: UnitStats_Spectators_Blufor { idc = IDC_TMF_ADMINMENU_DASH_STATS_INDEP_SPECTATORS; - y = "4.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "4.4 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_Total_Indep: UnitStats_Total_Blufor { idc = IDC_TMF_ADMINMENU_DASH_STATS_INDEP_TOTAL; - y = "4.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "4.4 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; // Civilian class UnitStats_SideBackground_Civilian: UnitStats_SideBackground_Opfor { - y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "5.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_SideIcon_Civilian: UnitStats_SideIcon_Blufor { colorText[] = {"(profilenamespace getvariable ['Map_Civilian_R',0.5])", "(profilenamespace getvariable ['Map_Civilian_G',0])", "(profilenamespace getvariable ['Map_Civilian_B',0.5])", 0.8}; - y = "5.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "5.6 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_AI_Civilian: UnitStats_AI_Opfor { idc = IDC_TMF_ADMINMENU_DASH_STATS_CIV_AI; - y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "5.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_Players_Civilian: UnitStats_Players_Opfor { idc = IDC_TMF_ADMINMENU_DASH_STATS_CIV_PLAYERS; - y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "5.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_Spectators_Civilian: UnitStats_Spectators_Opfor { idc = IDC_TMF_ADMINMENU_DASH_STATS_CIV_SPECTATORS; - y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "5.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_Total_Civilian: UnitStats_Total_Opfor { idc = IDC_TMF_ADMINMENU_DASH_STATS_CIV_TOTAL; - y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "5.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; // Total class UnitStats_SideBackground_Total: UnitStats_SideBackground_Blufor { - y = "6.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "6.6 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_SideIcon_Total: RscText { style = 2; // Center text = "*"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "6.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); + x = "8 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "6.6 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "1 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class UnitStats_AI_Total: UnitStats_AI_Blufor { idc = IDC_TMF_ADMINMENU_DASH_STATS_TOTAL_AI; - y = "6.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "6.6 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_Players_Total: UnitStats_Players_Blufor { idc = IDC_TMF_ADMINMENU_DASH_STATS_TOTAL_PLAYERS; - y = "6.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "6.6 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_Spectators_Total: UnitStats_Spectators_Blufor { idc = IDC_TMF_ADMINMENU_DASH_STATS_TOTAL_SPECTATORS; - y = "6.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "6.6 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class UnitStats_Total_Total: UnitStats_Total_Blufor { idc = IDC_TMF_ADMINMENU_DASH_STATS_TOTAL_TOTAL; - y = "6.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "6.6 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; diff --git a/addons/adminmenu/gui/endMission.hpp b/addons/adminmenu/gui/endMission.hpp index 7df15d4e..16168211 100644 --- a/addons/adminmenu/gui/endMission.hpp +++ b/addons/adminmenu/gui/endMission.hpp @@ -3,46 +3,46 @@ class Controls class CheckboxUseMissionEnding: RscCheckBox { idc = IDC_TMF_ADMINMENU_ENDM_FROMMISSION; - onCheckedChanged = QUOTE([ARR_2(ctrlParent (param [0]), ctrlIDC (param [0]))] call FUNC(endMission_occluder);); + onCheckedChanged = QUOTE([ARR_2(ctrlParent (param [0]),ctrlIDC (param [0]))] call FUNC(endMission_occluder);); x = "0"; y = "0"; - w = "1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "1 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class LabelEndings: RscText { idc = -1; text = "Use Ending from Mission"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "1.0 * (((safezoneW / safezoneH) min 1.2) / 40)"; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); + x = "1.0 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; y = "0"; - w = "23.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "23.2 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1.0 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class ListEndings: RscListBox { idc = IDC_TMF_ADMINMENU_ENDM_LIST; tooltip = "These endings are present in the mission"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); x = "0"; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "24.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "12.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "1.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "24.2 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "12.9 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class CheckboxMissionEndingDefeat: CheckboxUseMissionEnding { idc = IDC_TMF_ADMINMENU_ENDM_FROMMISSION_ISDEFEAT; onCheckedChanged = ""; x = "0"; - y = "14 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "14 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class LabelMissionEndingDefeat: LabelEndings { text = "Mission is a Defeat (determines music played)"; colorText[] = {0.8, 0.8, 0.8, 1}; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "14 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "23.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "1 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "14 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "23.2 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class ButtonEndMission: GVAR(RscButtonMenu) @@ -51,26 +51,26 @@ class Controls text = "End Mission"; colorBackground[] = {0.8,0.27,0.133,1}; onButtonClick = QUOTE((ctrlParent (param [0])) call FUNC(endMission_commit)); - x = "32.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "19.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "5.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "32.3 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "19.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "5.5 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class CheckboxExportAAR: CheckboxUseMissionEnding { idc = IDC_TMF_ADMINMENU_ENDM_EXPORTAAR; onCheckedChanged = ""; - x = "32.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "18.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "32.3 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "18.4 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class LabelExportAAR: LabelEndings { idc = -1; text = "Export AAR"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); colorText[] = {0.8, 0.8, 0.8, 1}; - x = "33.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "18.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "4.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "33.3 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "18.4 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "4.5 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class ButtonActivateHunt: GVAR(RscButtonMenu) { @@ -78,22 +78,22 @@ class Controls text = "Activate AI Hunt"; onButtonClick = QUOTE([] call FUNC(endMission_hunt)); colorBackground[] = {0, 0, 0, 1}; - x = "25.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "19.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "7 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "25.2 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "19.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "7 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class CheckboxUseSideSpecificEnding: CheckboxUseMissionEnding { idc = IDC_TMF_ADMINMENU_ENDM_SIDESPECIFIC; - onCheckedChanged = QUOTE([ARR_2(ctrlParent (param [0]), ctrlIDC (param [0]))] call FUNC(endMission_occluder);); - x = "25.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; + onCheckedChanged = QUOTE([ARR_2(ctrlParent (param [0]),ctrlIDC (param [0]))] call FUNC(endMission_occluder);); + x = "25.2 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class LabelEndingsGenericSide: LabelEndings { text = "Use Side-Specific Endings"; - x = "26.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - w = "11.6 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "26.2 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + w = "11.6 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class IconSide_Blufor: RscPicture @@ -101,28 +101,28 @@ class Controls style = 48 + 2048; // picture + keep aspect ratio text = "\a3\ui_f\data\GUI\Rsc\RscDisplayMultiplayerSetup\flag_indep_ca.paa"; colorText[] = {"(profilenamespace getvariable ['Map_BLUFOR_R',0])", "(profilenamespace getvariable ['Map_BLUFOR_G',0])", "(profilenamespace getvariable ['Map_BLUFOR_B',1])", 0.8}; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "24.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "1.0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "1.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); + x = "24.9 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "1.0 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "1.3 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class LabelSide_Blufor: RscText { idc = -1; text = "BLUFOR"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "25.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "11.6 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); + x = "25.9 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "1.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "11.6 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 *((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class EndingSide_Blufor: RscToolbox { idc = IDC_TMF_ADMINMENU_ENDM_BLUFOR; onToolBoxSelChanged = QUOTE(GVAR(DOUBLES(ending,blufor)) = param [1];); - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); rows = 1; columns = 2; strings[] = {"Defeat", "Victory"}; @@ -137,131 +137,131 @@ class Controls colorSelectedBg[] = {1, 1, 1, 0.2}; colorBackground[] = {0.5, 0.5, 0.5, 0.1}; - x = "25.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "12.6 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "25.2 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "2.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "12.6 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class IconSide_Opfor: IconSide_Blufor { colorText[] = {"(profilenamespace getvariable ['Map_OPFOR_R',1])", "(profilenamespace getvariable ['Map_OPFOR_G',0])", "(profilenamespace getvariable ['Map_OPFOR_B',0])", 0.8}; - y = "3.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "3.4 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class LabelSide_Opfor: LabelSide_Blufor { text = "OPFOR"; - y = "3.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "3.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class EndingSide_Opfor: EndingSide_Blufor { idc = IDC_TMF_ADMINMENU_ENDM_OPFOR; onToolBoxSelChanged = QUOTE(GVAR(DOUBLES(ending,opfor)) = param [1];); - y = "4.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "4.6 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class IconSide_Indep: IconSide_Blufor { colorText[] = {"(profilenamespace getvariable ['Map_Independent_R',0])", "(profilenamespace getvariable ['Map_Independent_G',1])", "(profilenamespace getvariable ['Map_Independent_B',0])", 0.8}; - y = "5.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "5.8 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class LabelSide_Indep: LabelSide_Blufor { text = "Independent"; - y = "5.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "5.9 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class EndingSide_Indep: EndingSide_Blufor { idc = IDC_TMF_ADMINMENU_ENDM_INDEP; onToolBoxSelChanged = QUOTE(GVAR(DOUBLES(ending,resistance)) = param [1];); - y = "7.0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "7.0 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class IconSide_Civilian: IconSide_Blufor { colorText[] = {"(profilenamespace getvariable ['Map_Civilian_R',0.5])", "(profilenamespace getvariable ['Map_Civilian_G',0])", "(profilenamespace getvariable ['Map_Civilian_B',0.5])", 0.8}; - y = "8.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "8.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class LabelSide_Civilian: LabelSide_Blufor { text = "Civilian"; - y = "8.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "8.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class EndingSide_Civilian: EndingSide_Blufor { idc = IDC_TMF_ADMINMENU_ENDM_CIVILIAN; onToolBoxSelChanged = QUOTE(GVAR(DOUBLES(ending,civilian)) = param [1];); - y = "9.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "9.4 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class CheckboxEndingSideDraw: CheckboxUseMissionEnding { idc = IDC_TMF_ADMINMENU_ENDM_SIDEDRAW; onCheckedChanged = ""; - x = "25.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "11.0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "25.2 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "11.0 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class LabelEndingSideDraw: LabelExportAAR { text = "Mission is a Draw (ignores above options)"; - x = "26.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "11.0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "11.6 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "26.2 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "11.0 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "11.6 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class CheckboxUseCustomEnding: CheckboxUseMissionEnding { idc = IDC_TMF_ADMINMENU_ENDM_CUSTOM; - onCheckedChanged = QUOTE([ARR_2(ctrlParent (param [0]), ctrlIDC (param [0]))] call FUNC(endMission_occluder);); - y = "16.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + onCheckedChanged = QUOTE([ARR_2(ctrlParent (param [0]),ctrlIDC (param [0]))] call FUNC(endMission_occluder);); + y = "16.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class LabelCustomEnding: LabelEndings { text = "Use Custom Ending"; - y = "16.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "16.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class LabelCustomEndingTitle: LabelExportAAR { text = "Title"; x = "0"; - y = "17.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "2.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "17.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "2.4 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class TextfieldCustomEndingTitle: RscEdit { idc = IDC_TMF_ADMINMENU_ENDM_CUSTOM_TITLE; colorBackground[] = {0.5, 0.5, 0.5, 0.1}; colorBorder[] = {1, 1, 1, 0.33}; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "2.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "17.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "10.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); + x = "2.4 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "17.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "10.9 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class LabelCustomEndingSubtext: LabelCustomEndingTitle { text = "Subtext"; - y = "18.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "18.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class TextfieldCustomEndingSubtext: TextfieldCustomEndingTitle { idc = IDC_TMF_ADMINMENU_ENDM_CUSTOM_SUBTEXT; - y = "18.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "18.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class CheckboxCustomEndingDefeat: CheckboxUseMissionEnding { idc = IDC_TMF_ADMINMENU_ENDM_CUSTOM_ISDEFEAT; onCheckedChanged = ""; x = "0"; - y = "19.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "19.4 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class LabelCustomEndingDefeat: LabelExportAAR { text = "Mission is a Defeat (determines music played)"; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "19.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "23.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "1 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "19.4 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "23.2 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class OccluderLeftUp: RscText @@ -269,25 +269,25 @@ class Controls idc = IDC_TMF_ADMINMENU_ENDM_OCCLUDER_LU; colorBackground[] = {0, 0, 0, 0.75}; style = "0x02"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); x = "0"; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "24.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "14 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "1.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "24.2 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "14 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class OccluderLeftDown: OccluderLeftUp { idc = IDC_TMF_ADMINMENU_ENDM_OCCLUDER_LD; - y = "17.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "24.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "17.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "24.2 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "3.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class OccluderRight: OccluderLeftUp { idc = IDC_TMF_ADMINMENU_ENDM_OCCLUDER_R; - x = "25.15 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "12.65 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "10.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "25.15 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "1.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "12.65 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "10.9 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; }; diff --git a/addons/adminmenu/gui/messageLog.hpp b/addons/adminmenu/gui/messageLog.hpp index a32df21a..a86752fd 100644 --- a/addons/adminmenu/gui/messageLog.hpp +++ b/addons/adminmenu/gui/messageLog.hpp @@ -4,8 +4,8 @@ class Controls { x = 0; y = 0; - w = TMF_ADMINMENU_MSGS_W_LIST; - h = TMF_ADMINMENU_MSGS_H_LIST; + w = QUOTE(TMF_ADMINMENU_MSGS_W_LIST); + h = QUOTE(TMF_ADMINMENU_MSGS_H_LIST); colorBackground[] = {0, 0, 0, 0.3}; style = "0x02"; }; @@ -14,20 +14,20 @@ class Controls { idc = IDC_TMF_ADMINMENU_MSGS_LIST; //style = 32 + 16; // LB_MULTI + ST_MULTI - sizeEx = TMF_ADMINMENU_STD_SIZEX; - sizeEx2 = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); + sizeEx2 = QUOTE(TMF_ADMINMENU_STD_SIZEX); pictureColor[] = {1,1,1,1}; // Picture color pictureColorSelect[] = {1,1,1,1}; // Selected picture color pictureColorDisabled[] = {1,1,1,1}; // Disabled picture color - rowHeight = TMF_ADMINMENU_STD_HEIGHT; + rowHeight = QUOTE(TMF_ADMINMENU_STD_HEIGHT); colorText[] = {1,1,1,1}; colorBackground[] = {1,0,0,0}; itemBackground[] = {1,1,1,0.2}; itemSpacing = 0; x = 0; y = 0; - w = TMF_ADMINMENU_MSGS_W_LIST; - h = TMF_ADMINMENU_MSGS_H_LIST; + w = QUOTE(TMF_ADMINMENU_MSGS_W_LIST); + h = QUOTE(TMF_ADMINMENU_MSGS_H_LIST); }; class ButtonPrintSelected: GVAR(RscButtonMenu) @@ -37,9 +37,9 @@ class Controls onButtonClick = QUOTE(_this call FUNC(messageLog_print)); tooltip = "Prints currently selected log entry to RPT."; colorBackground[] = {0, 0, 0, 1}; - x = 0 * TMF_ADMINMENU_STD_WIDTH; - y = 19.5 * TMF_ADMINMENU_STD_HEIGHT; - w = 9 * TMF_ADMINMENU_STD_WIDTH; + x = QUOTE(0 * TMF_ADMINMENU_STD_WIDTH); + y = QUOTE(19.5 * TMF_ADMINMENU_STD_HEIGHT); + w = QUOTE(9 * TMF_ADMINMENU_STD_WIDTH); }; class ButtonPrintAll: GVAR(RscButtonMenu) @@ -49,8 +49,8 @@ class Controls tooltip = "Prints all logged entries to RPT."; onButtonClick = QUOTE(_this call FUNC(messageLog_printAll)); colorBackground[] = {0, 0, 0, 1}; - x = 9.1 * TMF_ADMINMENU_STD_WIDTH; - y = 19.5 * TMF_ADMINMENU_STD_HEIGHT; - w = 7 * TMF_ADMINMENU_STD_WIDTH; + x = QUOTE(9.1 * TMF_ADMINMENU_STD_WIDTH); + y = QUOTE(19.5 * TMF_ADMINMENU_STD_HEIGHT); + w = QUOTE(7 * TMF_ADMINMENU_STD_WIDTH); }; }; diff --git a/addons/adminmenu/gui/modal.hpp b/addons/adminmenu/gui/modal.hpp index f3be1fd9..e878ac28 100644 --- a/addons/adminmenu/gui/modal.hpp +++ b/addons/adminmenu/gui/modal.hpp @@ -1,6 +1,6 @@ class GVAR(modal) { - idd = IDD_TMF_ADMINMENU; + idd = IDD_TMF_ADMINMENU_MODAL; movingEnable = 0; enableDisplay = 1; enableSimulation = 1; @@ -13,19 +13,19 @@ class GVAR(modal) { idc = IDC_TMF_ADMINMENU_MODAL_BACK; colorBackground[] = {0, 0, 0, 0}; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "23 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "1 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "23 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class TitleBackground: RscText { idc = IDC_TMF_ADMINMENU_MODAL_TBACK; colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])"}; - x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "2.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "37 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "1.5 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "2.6 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "37 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class Title: RscTitle { @@ -33,10 +33,10 @@ class GVAR(modal) text = "TMF Admin Menu"; style = 0; colorBackground[] = {0, 0, 0, 0}; - x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "2.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "37 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "1.5 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "2.6 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "37 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class GroupBackground: RscText { @@ -45,18 +45,18 @@ class GVAR(modal) shadow = 2; colorShadow[] = {1, 1, 1, 1}; colorText[] = {1, 1, 1, 1}; - x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "3.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "37 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "20.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "1.5 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "3.7 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "37 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "20.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class Group: RscControlsGroup { idc = IDC_TMF_ADMINMENU_G_MODAL; - x = "1.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "3.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "36.8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "20.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "1.6 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "3.8 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "36.8 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "20.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; class Controls {}; }; class Close @@ -67,7 +67,7 @@ class GVAR(modal) text = "\a3\ui_f\data\GUI\Rsc\RscDisplayArcadeMap\top_close_gs.paa"; tooltip = "Close Utility"; onMouseButtonClick = "closeDialog 1;"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); font = "RobotoCondensed"; colorBackground[] = {0, 0, 0, 0}; colorBackgroundActive[] = {0, 0, 0, 0}; @@ -86,10 +86,10 @@ class GVAR(modal) soundPush[] = {"", 0.1, 1}; soundClick[] = {"", 0.1, 1}; soundEscape[] = {"", 0.1, 1}; - x = "37.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "2.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = "37.5 * (((safeZoneW / safeZoneH) min 1.2) / 40) + (safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2))/2)"; + y = "2.6 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "1 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; }; }; diff --git a/addons/adminmenu/gui/playerManagement.hpp b/addons/adminmenu/gui/playerManagement.hpp index aea67081..336483c0 100644 --- a/addons/adminmenu/gui/playerManagement.hpp +++ b/addons/adminmenu/gui/playerManagement.hpp @@ -3,51 +3,51 @@ class Controls class LabelFilter: RscText { text = "Filter:"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); x = "0"; y = "0"; - w = "2.1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "2.1 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 *((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class ComboFilterSide: RscCombo { idc = IDC_TMF_ADMINMENU_PMAN_FILTER_SIDE; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); font = "RobotoCondensed"; - x = "2.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "2.2 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; y = "0"; - w = "6 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "6 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class ComboFilterState: ComboFilterSide { idc = IDC_TMF_ADMINMENU_PMAN_FILTER_STATE; - x = "8.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - w = "5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "8.3 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + w = "5 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class ButtonFilterReset: GVAR(RscButtonMenu) { idc = IDC_TMF_ADMINMENU_PMAN_FILTER_RESET; text = "Reset"; - x = "13.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "13.4 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; y = "0"; - w = "2.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + w = "2.5 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class ButtonRefresh: GVAR(RscButtonMenu) { idc = IDC_TMF_ADMINMENU_PMAN_REFRESH; text = "Refresh"; - x = "26.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "26.9 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; y = "0"; - w = "3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + w = "3 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class BackgroundGroupList: RscText { x = "0"; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = TMF_ADMINMENU_PMAN_W_LISTGROUP; - h = TMF_ADMINMENU_PMAN_H_LISTGROUP; + y = "1.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = QUOTE(TMF_ADMINMENU_PMAN_W_LISTGROUP); + h = QUOTE(TMF_ADMINMENU_PMAN_H_LISTGROUP); colorBackground[] = {0, 0, 0, 0.3}; style = "0x02"; }; @@ -57,20 +57,20 @@ class Controls idc = IDC_TMF_ADMINMENU_PMAN_LIST; style = 32 + 16; // LB_MULTI + ST_MULTI onLBSelChanged = QUOTE(_this call FUNC(playerManagement_listSelChange);); - sizeEx = TMF_ADMINMENU_STD_SIZEX; - sizeEx2 = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); + sizeEx2 = QUOTE(TMF_ADMINMENU_STD_SIZEX); pictureColor[] = {1,1,1,1}; // Picture color pictureColorSelect[] = {1,1,1,1}; // Selected picture color pictureColorDisabled[] = {1,1,1,0.5}; // Disabled picture color - rowHeight = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + rowHeight = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; colorText[] = {1,1,1,1}; colorBackground[] = {0,0,0,0}; itemBackground[] = {1,1,1,0.2}; itemSpacing = 0; x = 0; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = TMF_ADMINMENU_PMAN_W_LISTGROUP; - h = TMF_ADMINMENU_PMAN_H_LISTGROUP; + y = "1.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = QUOTE(TMF_ADMINMENU_PMAN_W_LISTGROUP); + h = QUOTE(TMF_ADMINMENU_PMAN_H_LISTGROUP); }; /* @@ -79,42 +79,42 @@ class Controls class LabelSelect: RscText { text = "Select..."; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "30.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); + x = "30.9 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; y = "0"; - w = "6.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "6.9 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 *((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class ButtonSelectAll: ButtonFilterReset { idc = IDC_TMF_ADMINMENU_PMAN_SEL_ALL; text = "All"; - x = "30.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "6.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x = "30.9 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "1.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "6.9 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; }; class ButtonSelectNone: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_SEL_NONE; text = "None"; - y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "2.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class ButtonSelectInvert: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_SEL_INVERT; text = "Invert"; - y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "3.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class LabelWithSelected: RscText { idc = -1; text = "With Selected..."; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - x = "30.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "4.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "6.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); + x = "30.9 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y = "4.4 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = "6.9 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h = "1 *((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class ButtonACRE2Languages: ButtonSelectAll @@ -122,76 +122,76 @@ class Controls idc = IDC_TMF_ADMINMENU_PMAN_ACRELANGUAGES; text = "ACRE2 Languages"; onButtonClick = QUOTE([ARR_2(QUOTE(QFUNC(modal_ACRE2Languages)),ctrlText (_this select 0))] call FUNC(modal);); - y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "5.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class ButtonACRE2Radios: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_ACRERADIOS; text = "ACRE2 Radios"; onButtonClick = QUOTE([ARR_2(QUOTE(QFUNC(modal_ACRE2Radios)),ctrlText (_this select 0))] call FUNC(modal);); - y = "6.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "6.6 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class ButtonAssignGear: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_ASSIGNGEAR; text = "Assign Gear"; onButtonClick = QUOTE([ARR_2(QUOTE(QFUNC(modal_assignGear)),ctrlText (_this select 0))] call FUNC(modal);); - y = "7.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "7.7 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class ButtonAssignTraits: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_ASSIGNTRAITS; text = "Assign Traits"; onButtonClick = QUOTE([ARR_2(QUOTE(QFUNC(modal_assignTraits)),ctrlText (_this select 0))] call FUNC(modal);); - y = "8.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "8.8 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class ButtonGrantZeus: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_GRANTZEUS; text = "Grant Zeus"; onButtonClick = QUOTE([ARR_2(QUOTE(QFUNC(utility_grantZeus)),ctrlText (_this select 0))] call FUNC(utility);); - y = "9.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "9.9 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class ButtonHeal: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_HEAL; text = "Heal"; onButtonClick = QUOTE([ARR_3(QUOTE(QFUNC(utility_heal)),ctrlText (_this select 0),true)] call FUNC(utility);); - y = "11 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "11 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class ButtonMessage: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_MESSAGE; text = "Message"; onButtonClick = QUOTE([ARR_2(QUOTE(QFUNC(modal_message)),ctrlText (_this select 0))] call FUNC(modal);); - y = "12.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "12.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class ButtonQuickRespawn: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_QRESPAWN; text = "Quick Respawn"; onButtonClick = QUOTE([ARR_2(QUOTE(QFUNC(utility_quickRespawn)),ctrlText (_this select 0))] call FUNC(utility);); - y = "13.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "13.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class ButtonRunCode: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_RUNCODE; text = "Run Code On"; onButtonClick = QUOTE([ARR_2(QUOTE(QFUNC(modal_runCode)),ctrlText (_this select 0))] call FUNC(modal);); - y = "14.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "14.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class ButtonSteamProfile: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_STEAM; text = "Steam Profile"; onButtonClick = QUOTE([ARR_2(QUOTE(QFUNC(modal_steamProfile)),ctrlText (_this select 0))] call FUNC(modal);); - y = "15.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "15.4 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; class ButtonTeleport: ButtonSelectAll { idc = IDC_TMF_ADMINMENU_PMAN_TELEPORT; text = "Teleport"; onButtonClick = QUOTE([ARR_3(QUOTE(QFUNC(modal_teleport)),ctrlText (_this select 0),true)] call FUNC(modal);); - y = "16.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + y = "16.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; }; }; diff --git a/addons/adminmenu/gui/respawn.hpp b/addons/adminmenu/gui/respawn.hpp index 01e11505..fbda5ce8 100644 --- a/addons/adminmenu/gui/respawn.hpp +++ b/addons/adminmenu/gui/respawn.hpp @@ -5,19 +5,19 @@ class Controls idc = IDC_TMF_ADMINMENU_RESP_SPECTATORTEXT; text = "Players in Spectator: 0"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); x = 0; y = 0; - w = TMF_ADMINMENU_RESP_W_COL1; - h = TMF_ADMINMENU_STD_HEIGHT; + w = QUOTE(TMF_ADMINMENU_RESP_W_COL1); + h = QUOTE(TMF_ADMINMENU_STD_HEIGHT); }; class spectatorListBox: RscListBox { idc = IDC_TMF_ADMINMENU_RESP_SPECTATORLIST; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - sizeEx2 = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); + sizeEx2 = QUOTE(TMF_ADMINMENU_STD_SIZEX); //rowHeight = 0.97 * TMF_ADMINMENU_STD_HEIGHT; //rowHeight = TMF_ADMINMENU_STD_HEIGHT; //colorBackground[] = {0, 0, 0, 1}; @@ -28,7 +28,7 @@ class Controls pictureColorSelect[] = {1,1,1,1}; // Selected picture color pictureColorDisabled[] = {1,1,1,0.5}; // Disabled picture color - rowHeight = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + rowHeight = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; colorText[] = {1,1,1,1}; // colorBackground[] = {0,0,0,0}; itemBackground[] = {1,1,1,0.2}; @@ -37,29 +37,29 @@ class Controls tooltip = "tooltip test"; x = "0"; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = TMF_ADMINMENU_RESP_W_COL1; - h = 0.308 * safezoneH; + y = "1.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = QUOTE(TMF_ADMINMENU_RESP_W_COL1); + h = QUOTE(0.308 * safeZoneH); }; class respawnMenuAddButton: GVAR(RscButtonMenu) { idc = IDC_TMF_ADMINMENU_RESP_ADDBUTTON; text = "Add"; - x = TMF_ADMINMENU_RESP_X_COL2; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = TMF_ADMINMENU_RESP_W_COL2; - h = TMF_ADMINMENU_STD_HEIGHT; + x = QUOTE(TMF_ADMINMENU_RESP_X_COL2); + y = "1.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = QUOTE(TMF_ADMINMENU_RESP_W_COL2); + h = QUOTE(TMF_ADMINMENU_STD_HEIGHT); onButtonClick=QUOTE((ctrlParent (param [0])) call FUNC(respawn_addAction)); }; class respawnMenuRemoveButton: GVAR(RscButtonMenu) { idc = IDC_TMF_ADMINMENU_RESP_REMOVEBUTTON; text = "Remove"; - x = TMF_ADMINMENU_RESP_X_COL2; - y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = TMF_ADMINMENU_RESP_W_COL2; - h = TMF_ADMINMENU_STD_HEIGHT; + x = QUOTE(TMF_ADMINMENU_RESP_X_COL2); + y = "2.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = QUOTE(TMF_ADMINMENU_RESP_W_COL2); + h = QUOTE(TMF_ADMINMENU_STD_HEIGHT); onButtonClick=QUOTE((ctrlParent (param [0])) call FUNC(respawn_removeAction)); }; class respawnMenuRscComboRole: RscCombo @@ -67,25 +67,25 @@ class Controls idc = IDC_TMF_ADMINMENU_RESP_ROLECOMBO; text = "Role"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); font = "RobotoCondensed"; - x = TMF_ADMINMENU_RESP_X_COL2; - y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = TMF_ADMINMENU_RESP_W_COL2; - h = TMF_ADMINMENU_STD_HEIGHT; + x = QUOTE(TMF_ADMINMENU_RESP_X_COL2); + y = "3.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = QUOTE(TMF_ADMINMENU_RESP_W_COL2); + h = QUOTE(TMF_ADMINMENU_STD_HEIGHT); }; class RankText: RscText { idc = -1; text = "Unit rank:"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); - x = TMF_ADMINMENU_RESP_X_COL2; - y = "4.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = TMF_ADMINMENU_RESP_W_COL2; - h = TMF_ADMINMENU_STD_HEIGHT; + x = QUOTE(TMF_ADMINMENU_RESP_X_COL2); + y = "4.4 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = QUOTE(TMF_ADMINMENU_RESP_W_COL2); + h = QUOTE(TMF_ADMINMENU_STD_HEIGHT); }; class RankSelector: RscToolbox @@ -93,7 +93,7 @@ class Controls idc = IDC_TMF_ADMINMENU_RESP_RANK; style="0x02 + 0x30 + 0x800"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); rows = 2; columns = 4; strings[]= @@ -127,20 +127,20 @@ class Controls colorSelectedBg[] = {1, 1, 1, 0.2}; colorBackground[] = {0.5, 0.5, 0.5, 0.1}; - x = TMF_ADMINMENU_RESP_X_COL2; - y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = TMF_ADMINMENU_RESP_W_COL2; - h = 2*TMF_ADMINMENU_STD_HEIGHT; + x = QUOTE(TMF_ADMINMENU_RESP_X_COL2); + y = "5.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = QUOTE(TMF_ADMINMENU_RESP_W_COL2); + h = QUOTE(2*TMF_ADMINMENU_STD_HEIGHT); }; class respawnMenuVOIP: GVAR(RscButtonMenu) { idc = IDC_TMF_ADMINMENU_RESP_SPECTATORVOIP; text = "Toggle Spectator VOIP"; - x = TMF_ADMINMENU_RESP_X_COL3; + x = QUOTE(TMF_ADMINMENU_RESP_X_COL3); y = "0"; - w = TMF_ADMINMENU_RESP_W_COL3; - h = TMF_ADMINMENU_STD_HEIGHT; + w = QUOTE(TMF_ADMINMENU_RESP_W_COL3); + h = QUOTE(TMF_ADMINMENU_STD_HEIGHT); tooltip = "Toggles the spectator channel for you (ACRE/TFAR), so that you can talk to dead players if alive."; onButtonClick = QUOTE((ctrlParent (param [0])) call FUNC(respawn_toggleSpectatorVOIP)); }; @@ -148,8 +148,8 @@ class Controls { idc = IDC_TMF_ADMINMENU_RESP_GROUPLIST; - sizeEx = TMF_ADMINMENU_STD_SIZEX; - sizeEx2 = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); + sizeEx2 = QUOTE(TMF_ADMINMENU_STD_SIZEX); //rowHeight = 0.97 * TMF_ADMINMENU_STD_HEIGHT; //rowHeight = TMF_ADMINMENU_STD_HEIGHT; //colorBackground[] = {0, 0, 0, 1}; @@ -160,7 +160,7 @@ class Controls pictureColorSelect[] = {1,1,1,1}; // Selected picture color pictureColorDisabled[] = {1,1,1,0.5}; // Disabled picture color - rowHeight = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + rowHeight = "1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; colorText[] = {1,1,1,1}; // colorBackground[] = {0,0,0,0}; itemBackground[] = {1,1,1,0.2}; @@ -168,10 +168,10 @@ class Controls tooltip = "tooltip test"; - x = TMF_ADMINMENU_RESP_X_COL3; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = TMF_ADMINMENU_RESP_W_COL3; - h = 0.308 * safezoneH; + x = QUOTE(TMF_ADMINMENU_RESP_X_COL3); + y = "1.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = QUOTE(TMF_ADMINMENU_RESP_W_COL3); + h = QUOTE(0.308 * safeZoneH); }; class respawnGroupDetailsText: RscText @@ -179,12 +179,12 @@ class Controls idc = -1; text = "Group Details:"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); - x = TMF_ADMINMENU_RESP_X_COL4; - y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = TMF_ADMINMENU_RESP_W_COL1; - h = TMF_ADMINMENU_STD_HEIGHT; + x = QUOTE(TMF_ADMINMENU_RESP_X_COL4); + y = "1.1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = QUOTE(TMF_ADMINMENU_RESP_W_COL1); + h = QUOTE(TMF_ADMINMENU_STD_HEIGHT); }; class respawnMenuGroupNameText: RscEdit { @@ -193,51 +193,51 @@ class Controls colorBackground[] = {0.5, 0.5, 0.5, 0.1}; colorBorder[] = {1, 1, 1, 0.33}; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); - x = TMF_ADMINMENU_RESP_X_COL4; - y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = TMF_ADMINMENU_RESP_W_COL4; - h = TMF_ADMINMENU_STD_HEIGHT; + x = QUOTE(TMF_ADMINMENU_RESP_X_COL4); + y = "2.2 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = QUOTE(TMF_ADMINMENU_RESP_W_COL4); + h = QUOTE(TMF_ADMINMENU_STD_HEIGHT); }; class respawnMenuFactionCategoryCombo: RscCombo { idc = IDC_TMF_ADMINMENU_RESP_FACTIONCATEGORY; text = "FactionCategory"; /*Formerly side */ - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); font = "RobotoCondensed"; - x = TMF_ADMINMENU_RESP_X_COL4; - y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = TMF_ADMINMENU_RESP_W_COL4; - h = TMF_ADMINMENU_STD_HEIGHT; + x = QUOTE(TMF_ADMINMENU_RESP_X_COL4); + y = "3.3 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = QUOTE(TMF_ADMINMENU_RESP_W_COL4); + h = QUOTE(TMF_ADMINMENU_STD_HEIGHT); }; class respawnMenuFactionCombo: RscCombo { idc = IDC_TMF_ADMINMENU_RESP_FACTION; text = "Faction"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); font = "RobotoCondensed"; - x = TMF_ADMINMENU_RESP_X_COL4; - y = "4.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = TMF_ADMINMENU_RESP_W_COL4; - h = TMF_ADMINMENU_STD_HEIGHT; + x = QUOTE(TMF_ADMINMENU_RESP_X_COL4); + y = "4.4 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = QUOTE(TMF_ADMINMENU_RESP_W_COL4); + h = QUOTE(TMF_ADMINMENU_STD_HEIGHT); }; class respawnMenuSideCombo: RscCombo { idc = IDC_TMF_ADMINMENU_RESP_SIDE; text = "Side"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); font = "RobotoCondensed"; - x = TMF_ADMINMENU_RESP_X_COL4; - y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = TMF_ADMINMENU_RESP_W_COL4; - h = TMF_ADMINMENU_STD_HEIGHT; + x = QUOTE(TMF_ADMINMENU_RESP_X_COL4); + y = "5.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = QUOTE(TMF_ADMINMENU_RESP_W_COL4); + h = QUOTE(TMF_ADMINMENU_STD_HEIGHT); }; class respawnMenuSpawnMarkerText: RscText @@ -245,21 +245,21 @@ class Controls idc = -1; text = "Spawn with ORBAT marker?"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); - x = TMF_ADMINMENU_RESP_X_COL4; - y = "7.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = TMF_ADMINMENU_RESP_W_COL4; - h = TMF_ADMINMENU_STD_HEIGHT; + x = QUOTE(TMF_ADMINMENU_RESP_X_COL4); + y = "7.7 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = QUOTE(TMF_ADMINMENU_RESP_W_COL4); + h = QUOTE(TMF_ADMINMENU_STD_HEIGHT); }; class respawnMenuGroupMarkerCheckbox: RscCheckBox { idc = IDC_TMF_ADMINMENU_RESP_GROUPMARKERCHECKBOX; text = "Give group marker"; - x = TMF_ADMINMENU_RESP_X_COL4 + (7 * (((safezoneW / safezoneH) min 1.2) / 40)); - y = "7.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = (1 * (((safezoneW / safezoneH) min 1.2) / 40)); - h = TMF_ADMINMENU_STD_HEIGHT; + x = QUOTE(TMF_ADMINMENU_RESP_X_COL4 + (7 * (((safeZoneW / safeZoneH) min 1.2) / 40))); + y = "7.7 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = QUOTE((1 * (((safeZoneW / safeZoneH) min 1.2) / 40))); + h = QUOTE(TMF_ADMINMENU_STD_HEIGHT); //action = "['respawnMenuToggleGroupCheckbox'] spawn tmf_respawn_fnc_handleRespawnUI"; }; class respawnMenuMarkerName: RscEdit @@ -269,12 +269,12 @@ class Controls // colorBackground[] = {0.5, 0.5, 0.5, 0.1}; // colorBorder[] = {1, 1, 1, 0.33}; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); - x = TMF_ADMINMENU_RESP_X_COL4; - y = "8.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = TMF_ADMINMENU_RESP_W_COL4; - h = TMF_ADMINMENU_STD_HEIGHT; + x = QUOTE(TMF_ADMINMENU_RESP_X_COL4); + y = "8.8 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = QUOTE(TMF_ADMINMENU_RESP_W_COL4); + h = QUOTE(TMF_ADMINMENU_STD_HEIGHT); }; @@ -284,37 +284,37 @@ class Controls idc = IDC_TMF_ADMINMENU_RESP_MARKERTYPE; text = "Side"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); font = "RobotoCondensed"; - x = TMF_ADMINMENU_RESP_X_COL4; - y = "9.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = TMF_ADMINMENU_RESP_W_COL4; - h = TMF_ADMINMENU_STD_HEIGHT; + x = QUOTE(TMF_ADMINMENU_RESP_X_COL4); + y = "9.9 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = QUOTE(TMF_ADMINMENU_RESP_W_COL4); + h = QUOTE(TMF_ADMINMENU_STD_HEIGHT); }; class MarkerColourCombo: RscCombo { idc = IDC_TMF_ADMINMENU_RESP_MARKERCOLOUR; text = "Side"; - sizeEx = TMF_ADMINMENU_STD_SIZEX; + sizeEx = QUOTE(TMF_ADMINMENU_STD_SIZEX); font = "RobotoCondensed"; - x = TMF_ADMINMENU_RESP_X_COL4; - y = "11 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = TMF_ADMINMENU_RESP_W_COL4; - h = TMF_ADMINMENU_STD_HEIGHT; + x = QUOTE(TMF_ADMINMENU_RESP_X_COL4); + y = "11 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = QUOTE(TMF_ADMINMENU_RESP_W_COL4); + h = QUOTE(TMF_ADMINMENU_STD_HEIGHT); }; class respawnMenuSpawnButton: GVAR(RscButtonMenu) { idc = IDC_TMF_ADMINMENU_RESP_SPAWNBUTTON; text = "Spawn Group"; - x = TMF_ADMINMENU_RESP_X_COL4; - y = "19 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = TMF_ADMINMENU_RESP_W_COL4; - h = TMF_ADMINMENU_STD_HEIGHT; + x = QUOTE(TMF_ADMINMENU_RESP_X_COL4); + y = "19 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) + (safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2))/2)"; + w = QUOTE(TMF_ADMINMENU_RESP_W_COL4); + h = QUOTE(TMF_ADMINMENU_STD_HEIGHT); onButtonClick=QUOTE((ctrlParent (param [0])) call FUNC(respawn_respawnButton)); }; @@ -325,10 +325,10 @@ class Controls // { // idc = 26904; // text = "Close"; - // x = 0.716563 * safezoneW + safezoneX; - // y = 0.3196 * safezoneH + safezoneY; - // w = 0.0309375 * safezoneW; - // h = 0.022 * safezoneH; + // x = 0.716563 * safeZoneW + safeZoneX; + // y = 0.3196 * safeZoneH + safeZoneY; + // w = 0.0309375 * safeZoneW; + // h = 0.022 * safeZoneH; // action = "closeDialog 26893"; // }; @@ -336,20 +336,20 @@ class Controls // { // idc = 1603; // text = "Cycle Role"; - // x = 0.684594 * safezoneW + safezoneX; - // y = 0.445 * safezoneH + safezoneY; - // w = 0.0567187 * safezoneW; - // h = 0.055 * safezoneH; + // x = 0.684594 * safeZoneW + safeZoneX; + // y = 0.445 * safeZoneH + safeZoneY; + // w = 0.0567187 * safeZoneW; + // h = 0.055 * safeZoneH; // action="['respawnMenuChangeRoleAction'] spawn tmf_respawn_fnc_handleRespawnUI"; // }; // class respawnMenuChangeRankButton: GVAR(RscButtonMenu) // { // idc = 1604; // text = "Cycle Rank"; - // x = 0.684594 * safezoneW + safezoneX; - // y = 0.544 * safezoneH + safezoneY; - // w = 0.0567187 * safezoneW; - // h = 0.055 * safezoneH; + // x = 0.684594 * safeZoneW + safeZoneX; + // y = 0.544 * safeZoneH + safeZoneY; + // w = 0.0567187 * safeZoneW; + // h = 0.055 * safeZoneH; // action="['respawnMenuChangeRankAction'] spawn tmf_respawn_fnc_handleRespawnUI"; // }; }; diff --git a/addons/adminmenu/initSettings.sqf b/addons/adminmenu/initSettings.sqf index a87fa589..e8272e93 100644 --- a/addons/adminmenu/initSettings.sqf +++ b/addons/adminmenu/initSettings.sqf @@ -3,15 +3,15 @@ private _fnc_settings = { [ QGVAR(printToChat), "LIST", - ["Print log messages to chat", "Whether to print logged messages to chat. Only visible for admins."], + ["Show admin log in chat", "Which admin log entries are also shown in chat. Only admins see these messages."], ["TMF", "Adminmenu"], - [[2,1,0],["All Messages", "Only Warnings", "None"],1] + [[2,1,0],["All entries", "Warnings only", "Off"],1] ] call CBA_fnc_addSetting; [ QGVAR(endLogToRPT), "CHECKBOX", - ["Print log to server RPT on mission end", "Toggles whether to print the admin log to server RPT once mission ends."], + ["Save admin log to server RPT at mission end", "When the mission ends, the full admin log is written to the server's RPT file."], ["TMF", "Adminmenu"], false ] call CBA_fnc_addSetting; diff --git a/addons/adminmenu/script_component.hpp b/addons/adminmenu/script_component.hpp index 3b7aee19..0a5e88bc 100644 --- a/addons/adminmenu/script_component.hpp +++ b/addons/adminmenu/script_component.hpp @@ -1,10 +1,13 @@ +#ifndef TMF_ADMINMENU_SCRIPT_COMPONENT_HPP +#define TMF_ADMINMENU_SCRIPT_COMPONENT_HPP + #define COMPONENT adminMenu #include "\x\tmf\addons\main\script_mod.hpp" #include "\x\tmf\addons\main\script_macros.hpp" -#define TMF_ADMINMENU_STD_WIDTH (((safezoneW / safezoneH) min 1.2) / 40) -#define TMF_ADMINMENU_STD_HEIGHT ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) +#define TMF_ADMINMENU_STD_WIDTH (((safeZoneW / safeZoneH) min 1.2) / 40) +#define TMF_ADMINMENU_STD_HEIGHT ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) #define TMF_ADMINMENU_STD_SIZEX (TMF_ADMINMENU_STD_HEIGHT * 0.8) #define TMF_ADMINMENU_STD_SIZEX_L (TMF_ADMINMENU_STD_HEIGHT * 0.9) @@ -12,6 +15,7 @@ #define TMF_GROUPBASE_H (20.6 * TMF_ADMINMENU_STD_HEIGHT) #define IDD_TMF_ADMINMENU 56100 +#define IDD_TMF_ADMINMENU_MODAL 56099 #define IDC_TMF_ADMINMENU_FPS 56101 #define IDC_TMF_ADMINMENU_DASH 56102 @@ -98,8 +102,8 @@ #define IDC_TMF_ADMINMENU_PMAN_STEAM 56320 #define IDC_TMF_ADMINMENU_PMAN_QRESPAWN 56321 -#define TMF_ADMINMENU_PMAN_W_LISTGROUP (29.9 * (((safezoneW / safezoneH) min 1.2) / 40)) -#define TMF_ADMINMENU_PMAN_H_LISTGROUP (19.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)) +#define TMF_ADMINMENU_PMAN_W_LISTGROUP (29.9 * (((safeZoneW / safeZoneH) min 1.2) / 40)) +#define TMF_ADMINMENU_PMAN_H_LISTGROUP (19.4 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)) // 4.4*stdwidth #define TMF_ADMINMENU_PMAN_W_LIST (TMF_ADMINMENU_PMAN_W_LISTGROUP - (6.6 * TMF_ADMINMENU_STD_WIDTH)) @@ -135,18 +139,18 @@ //37.8 max width let's do 37.8 - 10 // max H is 20 -#define TMF_ADMINMENU_RESP_W_COL1 (10 * (((safezoneW / safezoneH) min 1.2) / 40)) +#define TMF_ADMINMENU_RESP_W_COL1 (10 * (((safeZoneW / safeZoneH) min 1.2) / 40)) #define TMF_ADMINMENU_RESP_X_COL1 0 -#define TMF_ADMINMENU_RESP_W_COL2 (4.8 * (((safezoneW / safezoneH) min 1.2) / 40)) -#define TMF_ADMINMENU_RESP_X_COL2 (11 * (((safezoneW / safezoneH) min 1.2) / 40)) +#define TMF_ADMINMENU_RESP_W_COL2 (4.8 * (((safeZoneW / safeZoneH) min 1.2) / 40)) +#define TMF_ADMINMENU_RESP_X_COL2 (11 * (((safeZoneW / safeZoneH) min 1.2) / 40)) -#define TMF_ADMINMENU_RESP_X_COL3 (16.8 * (((safezoneW / safezoneH) min 1.2) / 40)) -#define TMF_ADMINMENU_RESP_W_COL3 (10 * (((safezoneW / safezoneH) min 1.2) / 40)) +#define TMF_ADMINMENU_RESP_X_COL3 (16.8 * (((safeZoneW / safeZoneH) min 1.2) / 40)) +#define TMF_ADMINMENU_RESP_W_COL3 (10 * (((safeZoneW / safeZoneH) min 1.2) / 40)) // COL3 is same as COL1 Width -#define TMF_ADMINMENU_RESP_W_COL4 (10 * (((safezoneW / safezoneH) min 1.2) / 40)) -#define TMF_ADMINMENU_RESP_X_COL4 (27.8 * (((safezoneW / safezoneH) min 1.2) / 40)) +#define TMF_ADMINMENU_RESP_W_COL4 (10 * (((safeZoneW / safeZoneH) min 1.2) / 40)) +#define TMF_ADMINMENU_RESP_X_COL4 (27.8 * (((safeZoneW / safeZoneH) min 1.2) / 40)) #define IDC_TMF_ADMINMENU_ENDM_LIST 56501 #define IDC_TMF_ADMINMENU_ENDM_ENDMISSION 56502 @@ -201,3 +205,5 @@ /* AdminEye */ #define IDC_TMF_ADMINMENU_ADME_MAP_DISPLAY 26850 #define IDC_TMF_ADMINMENU_ADME_MAP_CONTROL 26851 + +#endif // TMF_ADMINMENU_SCRIPT_COMPONENT_HPP diff --git a/addons/adminmenu/square_ca.paa b/addons/adminmenu/square_ca.paa deleted file mode 100644 index 54ee05ed..00000000 Binary files a/addons/adminmenu/square_ca.paa and /dev/null differ diff --git a/addons/ai/CfgModules.hpp b/addons/ai/CfgModules.hpp index 10720c79..df9d0eff 100644 --- a/addons/ai/CfgModules.hpp +++ b/addons/ai/CfgModules.hpp @@ -7,19 +7,13 @@ class CfgVehicles { class Default; class Edit; - class Combo; - class Checkbox; - class CheckboxNumber; class ModuleDescription; - class Units; }; class ArgumentsBaseUnits { - class Units; }; class ModuleDescription { - class AnyBrain; }; class EventHandlers; }; diff --git a/addons/ai/config.cpp b/addons/ai/config.cpp index 13acce74..11d7e5f0 100644 --- a/addons/ai/config.cpp +++ b/addons/ai/config.cpp @@ -1,13 +1,13 @@ #include "script_component.hpp" -class cfgPatches +class CfgPatches { class ADDON { name = "TMF: AI"; author = "Nick"; url = "http://www.teamonetactical.com"; - units[] = {}; + units[] = {QGVAR(area), QGVAR(area_rectangle), QGVAR(wavespawn), QGVAR(huntModule), QGVAR(Rearm), QGVAR(garrisonQuantity), QGVAR(artillery)}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"tmf_common"}; diff --git a/addons/ai/functions/fnc_arty.sqf b/addons/ai/functions/fnc_arty.sqf index 90e36b55..f0311c27 100644 --- a/addons/ai/functions/fnc_arty.sqf +++ b/addons/ai/functions/fnc_arty.sqf @@ -2,7 +2,7 @@ params ["_logic","_units","_activated"]; #include "\x\tmf\addons\AI\script_component.hpp" -if(!_activated) exitwith {}; +if(!_activated) exitWith {}; private _areas = (synchronizedObjects _logic) select {_x isKindOf QGVAR(area)}; private _vehicles = (synchronizedObjects _logic) select { !(_x isKindOf QGVAR(area)) }; diff --git a/addons/ai/functions/fnc_doArty.sqf b/addons/ai/functions/fnc_doArty.sqf index 983a2384..21242922 100644 --- a/addons/ai/functions/fnc_doArty.sqf +++ b/addons/ai/functions/fnc_doArty.sqf @@ -3,16 +3,16 @@ params ["_logic","_areas","_vehicles"]; { private _area = selectRandom _areas; - private _bounds = [getpos _area] + (_area getvariable ["objectArea",0]); + private _bounds = [getPos _area] + (_area getVariable ["objectArea",0]); private _pos = [_bounds] call CFUNC(randPosArea); private _magazine = _logic getVariable ["Round", ""]; _x setVehicleAmmo 1; if(!(_magazine isEqualType "") || _magazine == "" || !(_magazine in (magazines vehicle _x)) ) then {_magazine = currentMagazine _x;}; (gunner _x) doArtilleryFire [_pos, _magazine, _logic getVariable ["RoundsPerSalvo", 1]]; -} foreach _vehicles; +} forEach _vehicles; private _salvos = (_logic getVariable ["Salvos", 5]) -1; -_logic setvariable ["Salvos",_salvos]; +_logic setVariable ["Salvos",_salvos]; if(_salvos > 0 || _salvos == -1) then { - [FUNC(doArty),_this, (_logic getvariable ["TimeBetweenShots",5]) max 1] call CBA_fnc_waitAndExecute; + [FUNC(doArty),_this, (_logic getVariable ["TimeBetweenShots",5]) max 1] call CBA_fnc_waitAndExecute; }; diff --git a/addons/ai/functions/fnc_emptyFunction.sqf b/addons/ai/functions/fnc_emptyFunction.sqf index 77f89f7e..2cf9d72c 100644 --- a/addons/ai/functions/fnc_emptyFunction.sqf +++ b/addons/ai/functions/fnc_emptyFunction.sqf @@ -1,3 +1,3 @@ #include "\x\tmf\addons\AI\script_component.hpp" -// Do Nothing. \ No newline at end of file +// Do Nothing. diff --git a/addons/ai/functions/fnc_fortify.sqf b/addons/ai/functions/fnc_fortify.sqf index 5ec01434..4f8c571b 100644 --- a/addons/ai/functions/fnc_fortify.sqf +++ b/addons/ai/functions/fnc_fortify.sqf @@ -8,11 +8,11 @@ private _leader = leader _group; // Check if group needs to move first if (_leader distance2D _pos > _radius) then { _leader doMove _pos; - ((units _group) select {!(_x == _leader)}) doFollow _leader; + ((units _group) select {_x != _leader}) doFollow _leader; waitUntil {_leader distance2D _pos < _radius}; }; // CBA_fnc_taskDefend for now [_group,_pos,_radius] call CBA_fnc_taskDefend; -true \ No newline at end of file +true diff --git a/addons/ai/functions/fnc_garrison.sqf b/addons/ai/functions/fnc_garrison.sqf index b37812e3..b27b92e7 100644 --- a/addons/ai/functions/fnc_garrison.sqf +++ b/addons/ai/functions/fnc_garrison.sqf @@ -2,7 +2,7 @@ params ["_logic","_units","_activated"]; private _headless = (synchronizedObjects _logic) select {_x isKindOf "HeadlessClient_F" && !local _x}; -if(count _headless > 0 && isServer) exitWith { +if(_headless isNotEqualTo [] && isServer) exitWith { _this remoteExec [QFUNC(garrison), _headless select 0]; }; @@ -34,11 +34,11 @@ private _mainGroup = createGroup ((_unitData select 0) select 0); [_mainGroup,QGVAR(garrisonGroup),true] call tmf_common_fnc_initGroupVar; private _holdPos = _logic getVariable ["hold", false]; -if(count _areas > 0) then { +if(_areas isNotEqualTo []) then { { private _areaLogic = _x; (_areaLogic getVariable ["objectArea",[0,0,0,false,0]]) params ["_a","_b","_dir","_isrect"]; - private _buildings = ((getPos _x) nearObjects ["Static", _a * _b]) select {count (_x buildingPos -1) > 0 && {(getPos _x) inArea [getPos _areaLogic,_a , _b, _dir, _isrect]}}; + private _buildings = ((getPos _x) nearObjects ["Static", _a * _b]) select {(_x buildingPos -1) isNotEqualTo [] && {(getPos _x) inArea [getPos _areaLogic,_a , _b, _dir, _isrect]}}; private _freeBuildings = []; // List of buildings that list have free positions. @@ -88,10 +88,10 @@ if(count _areas > 0) then { if(_debug) then { private _mkr = createMarker [str (random 999),_posToUse]; - _mkr setMarkerShape "ICON"; - _mkr setMarkerType "mil_dot"; - _mkr setMarkerSize [0.5,0.5]; - _mkr setMarkerColor "ColorRed"; + _mkr setMarkerShapeLocal "ICON"; + _mkr setMarkerTypeLocal "mil_dot"; + _mkr setMarkerSizeLocal [0.5,0.5]; + _mkr setMarkerColorLocal "ColorRed"; _mkr setMarkerText (_unitClassname); }; }; diff --git a/addons/ai/functions/fnc_garrisonQuantity.sqf b/addons/ai/functions/fnc_garrisonQuantity.sqf index 8e189bb3..2f0a5278 100644 --- a/addons/ai/functions/fnc_garrisonQuantity.sqf +++ b/addons/ai/functions/fnc_garrisonQuantity.sqf @@ -3,7 +3,7 @@ if(is3DEN) exitWith {}; params ["_logic","_units","_activated"]; private _headless = (synchronizedObjects _logic) select {_x isKindOf "HeadlessClient_F" && !local _x}; -if(count _headless > 0 && isServer) exitWith { +if(_headless isNotEqualTo [] && isServer) exitWith { _this remoteExec [QFUNC(garrison), _headless select 0]; }; @@ -42,7 +42,7 @@ private _buildings = []; private _areaLogic = _x; (_areaLogic getVariable ["objectArea",[0,0,0,false,0]]) params ["_a","_b","_dir","_isrect"]; - private _nearObjects = ((getPos _x) nearObjects ["Static", _a * _b]) select {count (_x buildingPos -1) > 0 && {(getPos _x) inArea [getPos _areaLogic,_a , _b, _dir, _isrect]}}; + private _nearObjects = ((getPos _x) nearObjects ["Static", _a * _b]) select {(_x buildingPos -1) isNotEqualTo [] && {(getPos _x) inArea [getPos _areaLogic,_a , _b, _dir, _isrect]}}; _buildings append _nearObjects; } forEach _areas; @@ -80,11 +80,11 @@ private _freeBuildings = []; // List of buildings that list have free positions. if (_aiNumberToSpawn > _freeBuildingSpaces) then { systemChat "TMF Garrison - Insufficent free building positions check your map for location and details."; private _mkr = createMarkerLocal [str (random 99999),getPos _logic]; - _mkr setMarkerShape "ICON"; - _mkr setMarkerType "mil_dot"; - _mkr setMarkerSize [0.5,0.5]; - _mkr setMarkerColor "ColorRed"; - _mkr setMarkerText format ["Error - TMF Garrison Module - Unable to find sufficent building places (%1 available / %2 needed)", _freeBuildingSpaces, _aiNumberToSpawn]; + _mkr setMarkerShapeLocal "ICON"; + _mkr setMarkerTypeLocal "mil_dot"; + _mkr setMarkerSizeLocal [0.5,0.5]; + _mkr setMarkerColorLocal "ColorRed"; + _mkr setMarkerTextLocal format ["Error - TMF Garrison Module - Unable to find sufficent building places (%1 available / %2 needed)", _freeBuildingSpaces, _aiNumberToSpawn]; }; private _garrisonedBuildings = []; for "_i" from 1 to (_aiNumberToSpawn min _freeBuildingSpaces) do { @@ -119,10 +119,10 @@ for "_i" from 1 to (_aiNumberToSpawn min _freeBuildingSpaces) do { if(_debug) then { private _mkr = createMarker [str (random 999),_posToUse]; - _mkr setMarkerShape "ICON"; - _mkr setMarkerType "mil_dot"; - _mkr setMarkerSize [0.5,0.5]; - _mkr setMarkerColor "ColorRed"; + _mkr setMarkerShapeLocal "ICON"; + _mkr setMarkerTypeLocal "mil_dot"; + _mkr setMarkerSizeLocal [0.5,0.5]; + _mkr setMarkerColorLocal "ColorRed"; _mkr setMarkerText (_unitClassname); }; }; @@ -139,8 +139,8 @@ if((_logic getVariable ["WakeUp", false])) then { _trigger setTriggerArea [_buildingSize * 3, _buildingSize * 3, 0, false, 10]; _trigger setTriggerActivation ["ANYPLAYER","PRESENT",false]; _trigger setTriggerStatements [ - QUOTE(private _side = (thisTrigger getVariable [ARR_2('side', opfor)]); this && ({ side _x != _side} count thisList) > 0), - QUOTE({ _x enableAI 'PATH'; _x setUnitPos 'AUTO'; } forEach (thisTrigger getVariable [ARR_2('units', [])]); deleteVehicle thisTrigger;), + QUOTE(private _side = (thisTrigger getVariable [ARR_2('side',opfor)]); this && ({ side _x != _side} count thisList) > 0), + QUOTE({ _x enableAI 'PATH'; _x setUnitPos 'AUTO'; } forEach (thisTrigger getVariable [ARR_2('units',[])]); deleteVehicle thisTrigger;), "" ]; } forEach _garrisonedBuildings; diff --git a/addons/ai/functions/fnc_hunt.sqf b/addons/ai/functions/fnc_hunt.sqf index 483b024f..8e21cedc 100644 --- a/addons/ai/functions/fnc_hunt.sqf +++ b/addons/ai/functions/fnc_hunt.sqf @@ -62,7 +62,7 @@ private _oldGroups = []; // Cleanup groups no longer used. { - if (count (units _x) == 0) then {deleteGroup _x;}; + if (units _x isEqualTo []) then {deleteGroup _x;}; } forEach (_oldGroups - [grpNull]); [format ["Triggered hunt on %1 units",count _hunters],false,"AI"] call EFUNC(adminmenu,log); diff --git a/addons/ai/functions/fnc_huntInit.sqf b/addons/ai/functions/fnc_huntInit.sqf index 20d363d0..8aa1b1f8 100644 --- a/addons/ai/functions/fnc_huntInit.sqf +++ b/addons/ai/functions/fnc_huntInit.sqf @@ -26,4 +26,4 @@ _hunters = ((_hunters - playableUnits) - switchableUnits) - [player]; { _x disableAI "AUTOCOMBAT"; -} forEach _hunters; \ No newline at end of file +} forEach _hunters; diff --git a/addons/ai/functions/fnc_huntLoop.sqf b/addons/ai/functions/fnc_huntLoop.sqf index bde841dc..3eba9cfc 100644 --- a/addons/ai/functions/fnc_huntLoop.sqf +++ b/addons/ai/functions/fnc_huntLoop.sqf @@ -61,6 +61,6 @@ while {_continue} do { } forEach _hunters; sleep 5; _hunters = _hunters select {alive _x}; - if (count _hunters == 0) exitWith {_continue = false;}; + if (_hunters isEqualTo []) exitWith {_continue = false;}; sleep 10; }; diff --git a/addons/ai/functions/fnc_rearm.sqf b/addons/ai/functions/fnc_rearm.sqf index 1d7769e8..60154de5 100644 --- a/addons/ai/functions/fnc_rearm.sqf +++ b/addons/ai/functions/fnc_rearm.sqf @@ -1,24 +1,24 @@ #include "\x\tmf\addons\AI\script_component.hpp" params ["_self","_caller"]; -_repairPerTick = 0.1; -_fuelPerTick = 0.1; -_ammoPerTick = 0.1; -if(_caller getvariable [QGVAR(rearming),false]) exitwith { +private _repairPerTick = 0.1; +private _fuelPerTick = 0.1; +private _ammoPerTick = 0.1; +if(_caller getVariable [QGVAR(rearming),false]) exitWith { hint "You are already rearming!"; }; _caller setVariable [QGVAR(rearming), true]; -_vehicle = vehicle _caller; -if(_vehicle == _caller) exitwith { +private _vehicle = vehicle _caller; +if(_vehicle == _caller) exitWith { hint "You have to be in the vehicle"; }; _vehicle setFuel 0; -_initalDamage = damage _vehicle; +private _initalDamage = damage _vehicle; while {damage _vehicle > 0} do { _vehicle setDamage (damage _vehicle - _repairPerTick); hint "Repairing"; sleep 1; }; -_ammo = 0; +private _ammo = 0; while {_ammo < 1} do { _vehicle setVehicleAmmoDef (_ammo + _ammoPerTick); _ammo = _ammo + 0.1; diff --git a/addons/ai/functions/fnc_rearmInit.sqf b/addons/ai/functions/fnc_rearmInit.sqf index 511187a7..83a4f87b 100644 --- a/addons/ai/functions/fnc_rearmInit.sqf +++ b/addons/ai/functions/fnc_rearmInit.sqf @@ -4,11 +4,11 @@ sleep 1; if(_activated) then { [{ _this params ["_logic"]; - if((getpos player) inArea ([getpos _logic] + (_logic getVariable ["objectArea",[]])) && (player getVariable [QGVAR(rearmHandle),-1]) == -1) then { - _handle = player addAction ["Rearm",{_this call tmf_ai_fnc_rearm},[],6,true,true,"","vehicle player != player && local (vehicle player) && !isEngineOn (vehicle player) && !(player getVariable ['tmf_ai_rearming', false])"]; + if((getPos player) inArea ([getPos _logic] + (_logic getVariable ["objectArea",[]])) && (player getVariable [QGVAR(rearmHandle),-1]) == -1) then { + private _handle = player addAction ["Rearm",{_this call tmf_ai_fnc_rearm},[],6,true,true,"","vehicle player != player && local (vehicle player) && !isEngineOn (vehicle player) && !(player getVariable ['tmf_ai_rearming', false])"]; player setVariable [QGVAR(rearmHandle), _handle]; }; - if((player getVariable [QGVAR(rearmHandle),-1]) != -1 && !( (getpos player) inArea ([getpos _logic] + (_logic getVariable ["objectArea",[]])) ) ) then + if((player getVariable [QGVAR(rearmHandle),-1]) != -1 && !( (getPos player) inArea ([getPos _logic] + (_logic getVariable ["objectArea",[]])) ) ) then { player removeAction (player getVariable [QGVAR(rearmHandle),-1]); player setVariable [QGVAR(rearmHandle), -1]; diff --git a/addons/ai/functions/fnc_spawnWave.sqf b/addons/ai/functions/fnc_spawnWave.sqf index 5762a8b3..b0feda4c 100644 --- a/addons/ai/functions/fnc_spawnWave.sqf +++ b/addons/ai/functions/fnc_spawnWave.sqf @@ -10,143 +10,222 @@ * N/A * * Description: - * Handles spawning units + * Handles spawning units. Spawning is spread over several frames to avoid + * freezing the machine when a large wave spawns. Each vehicle is spawned in + * the same frame as its crew. */ + +// Spawn cost budget per frame. Units and vehicles cost 4, objects cost 1. +#define SPAWN_BUDGET 8 +#define COST_OBJECT 1 +#define COST_HEAVY 4 + params ["_logic"]; -private _spawnedVehicles = []; -private _spawnedGroups = []; -private _spawnedUnits = []; -private _spawnedObjects = []; private _data = _logic getVariable [QGVAR(waveData), []]; _data params ['_groups', '_vehicles', '_objects']; + +// Sort units into vehicle crews and units on foot: [groupIndex, unitIndex, unitData] +private _crews = _vehicles apply {[]}; +private _footUnits = []; { - _x params ["_type", "_pos", "_dir", "_vectorDirAndUp", "_isSimple", "_simulationEnabled","_simpleObjData"]; + private _groupIndex = _forEachIndex; + { + private _vehicleIndex = _x select 4; + if (_vehicleIndex >= 0) then { + (_crews select _vehicleIndex) pushBack [_groupIndex, _forEachIndex, _x]; + } else { + _footUnits pushBack [_groupIndex, _forEachIndex, _x]; + }; + } forEach (_x select 1); +} forEach _groups; - if (_isSimple) then { - private _simpleObj = [_type,_pos, _dir] call BIS_fnc_createSimpleObject; - _simpleObj setPosWorld _pos; - _simpleObj setVectorDirAndUp _vectorDirAndUp; - _spawnedObjects pushBack _simpleObj; - } else { - private _object = createVehicle [_type, _pos, [], 0, "CAN_COLLIDE"]; - _object setDir _dir; - _object setVectorDirAndUp _vectorDirAndUp; - _object enableSimulation _simulationEnabled; - _spawnedObjects pushBack _object; - }; -} forEach _objects; +// Queue of spawn steps: [kind, data] +// 0: object, 1: vehicle with crew, 2: unit on foot, 3: finish group (leader, waypoints) +private _queue = []; +{ _queue pushBack [0, _x] } forEach _objects; +{ _queue pushBack [1, [_x, _crews select _forEachIndex]] } forEach _vehicles; +{ _queue pushBack [2, _x] } forEach _footUnits; +{ _queue pushBack [3, _forEachIndex] } forEach _groups; +reverse _queue; // pop from the end -{ - _x params ['_type','_pos','_vectorDirAndUp','_custom', '_pylons']; - private _formationType = "NONE"; - if((_pos select 2) > 3) then {_formationType = "FLY"}; - private _vehicle = createVehicle [_type, [0,0,0], [], 0, _formationType]; - _vehicle setPosATL _pos; - _vehicle setVectorDirAndUp _vectorDirAndUp; - [_vehicle,_custom select 0,_custom select 1] spawn BIS_fnc_initVehicle; - - if(count _pylons > 0) then { - private _pylonPaths = (configProperties [configFile >> "CfgVehicles" >> typeOf _vehicle >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"]) apply {getArray (_x >> "turret")}; - { - _vehicle removeWeaponGlobal getText (configFile >> "CfgMagazines" >> _x >> "pylonWeapon") - } forEach getPylonMagazines _vehicle; - { - _vehicle setPylonLoadout [_forEachIndex + 1, _x, true, _pylonPaths select _forEachIndex] - } forEach _pylons; - }; - _spawnedVehicles pushBack _vehicle; +// [groups, units, vehicles, objects, saved group data, units per group in saved order] +private _state = [ + _groups apply {grpNull}, + [], + [], + [], + _groups, + _groups apply {(_x select 1) apply {objNull}} +]; -} forEach _vehicles; +private _fnc_spawnUnit = { + params ["_state", "_groupIndex", "_unitIndex", "_unitData", ["_vehicle", objNull]]; + _state params ["_spawnedGroups", "_spawnedUnits", "", "", "_groupData", "_groupUnits"]; -{ - _x params ['_side', '_units', '_waypoints']; + private _grp = _spawnedGroups select _groupIndex; + if (isNull _grp) then { + _grp = createGroup [(_groupData select _groupIndex) select 0, false]; + _spawnedGroups set [_groupIndex, _grp]; + }; - private _grp = createGroup [_side, true]; // Delete group when empty - { - _x params ["_type","_pos","_vectorDirAndUp","_gear", "_vehicleIndex", "_vehicleRole"]; - private _unit = _grp createUnit [_type, [0,0,0],[] , 0, "NONE"]; - _spawnedUnits pushBack _unit; - _unit setPosATL _pos; - _unit setUnitLoadout [_gear, false]; - _unit setVectorDirAndUp _vectorDirAndUp; - if (_vehicleIndex >= 0) then { - private _vehicle = _spawnedVehicles # _vehicleIndex; - _vehicleRole params ["_role", "_path"]; - _role = toLower _role; - switch(_role) do { - case 'driver': { - _unit assignAsDriver _vehicle; - _unit moveInDriver _vehicle; - }; - case 'cargo': { - if(isNil '_path') then { - _unit assignAsCargo _vehicle; - _unit moveInCargo _vehicle; + _unitData params ["_type","_pos","_vectorDirAndUp","_gear", "", "_vehicleRole"]; + private _unit = _grp createUnit [_type, [0,0,0],[] , 0, "NONE"]; + _grp deleteGroupWhenEmpty true; + _spawnedUnits pushBack _unit; + (_groupUnits select _groupIndex) set [_unitIndex, _unit]; + _unit setPosATL _pos; + _unit setUnitLoadout [_gear, false]; + _unit setVectorDirAndUp _vectorDirAndUp; + if (!isNull _vehicle) then { + _vehicleRole params ["_role", "_path"]; + _role = toLower _role; + switch(_role) do { + case 'driver': { + _unit assignAsDriver _vehicle; + _unit moveInDriver _vehicle; + }; + case 'cargo': { + if(isNil '_path') then { + _unit assignAsCargo _vehicle; + _unit moveInCargo _vehicle; + } else { + if(_path isEqualType []) then { + _unit assignAsTurret [_vehicle, _path]; + _unit moveInTurret [_vehicle, _path]; } else { - if(_path isEqualType []) then { - _unit assignAsTurret [_vehicle, _path]; - _unit moveInTurret [_vehicle, _path]; - } else { - _unit assignAsCargoIndex [_vehicle, _path]; - _unit moveInCargo [_vehicle, _path]; - } + _unit assignAsCargoIndex [_vehicle, _path]; + _unit moveInCargo [_vehicle, _path]; } + } + }; + case 'turret': { + _unit assignAsTurret [_vehicle, _path]; + _unit moveInTurret [_vehicle, _path]; + }; + }; + }; +}; + +[{ + params ["_args", "_pfh"]; + _args params ["_logic", "_queue", "_state", "_fnc_spawnUnit"]; + _state params ["_spawnedGroups", "_spawnedUnits", "_spawnedVehicles", "_spawnedObjects", "_groupData", "_groupUnits"]; + + private _budget = SPAWN_BUDGET; + while {_budget > 0 && {_queue isNotEqualTo []}} do { + (_queue deleteAt (count _queue - 1)) params ["_kind", "_item"]; + switch (_kind) do { + case 0: { + _item params ["_type", "_pos", "_dir", "_vectorDirAndUp", "_isSimple", "_simulationEnabled"]; + if (_isSimple) then { + private _simpleObj = [_type,_pos, _dir] call BIS_fnc_createSimpleObject; + _simpleObj setPosWorld _pos; + _simpleObj setVectorDirAndUp _vectorDirAndUp; + _spawnedObjects pushBack _simpleObj; + } else { + private _object = createVehicle [_type, _pos, [], 0, "CAN_COLLIDE"]; + _object setDir _dir; + _object setVectorDirAndUp _vectorDirAndUp; + _object enableSimulation _simulationEnabled; + _spawnedObjects pushBack _object; }; - case 'turret': { - _unit assignAsTurret [_vehicle, _path]; - _unit moveInTurret [_vehicle, _path]; + _budget = _budget - COST_OBJECT; + }; + case 1: { + _item params ["_vehicleData", "_crew"]; + _vehicleData params ['_type','_pos','_vectorDirAndUp','_custom', '_pylons']; + private _formationType = ["NONE", "FLY"] select ((_pos select 2) > 3); + private _vehicle = createVehicle [_type, [0,0,0], [], 0, _formationType]; + _vehicle setPosATL _pos; + _vehicle setVectorDirAndUp _vectorDirAndUp; + [_vehicle,_custom select 0,_custom select 1] spawn BIS_fnc_initVehicle; + + if (_pylons isNotEqualTo []) then { + private _pylonPaths = (configProperties [configOf _vehicle >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"]) apply {getArray (_x >> "turret")}; + { + _vehicle removeWeaponGlobal getText (configFile >> "CfgMagazines" >> _x >> "pylonWeapon") + } forEach getPylonMagazines _vehicle; + { + _vehicle setPylonLoadout [_forEachIndex + 1, _x, true, _pylonPaths select _forEachIndex] + } forEach _pylons; + }; + _spawnedVehicles pushBack _vehicle; + + // Crew in the same frame so the vehicle is never left empty + { + _x params ["_groupIndex", "_unitIndex", "_unitData"]; + [_state, _groupIndex, _unitIndex, _unitData, _vehicle] call _fnc_spawnUnit; + } forEach _crew; + _budget = _budget - COST_HEAVY * (1 + count _crew); + }; + case 2: { + _item params ["_groupIndex", "_unitIndex", "_unitData"]; + [_state, _groupIndex, _unitIndex, _unitData] call _fnc_spawnUnit; + _budget = _budget - COST_HEAVY; + }; + case 3: { + private _grp = _spawnedGroups select _item; + if (!isNull _grp) then { + // Crews spawn first, so restore the original leader + private _leader = (_groupUnits select _item) select 0; + if (!isNull _leader) then { + _grp selectLeader _leader; + }; + [_grp] call CBA_fnc_clearWaypoints; + { + [_grp, _forEachIndex + 1, _x] call CFUNC(deserializeWaypoint); + } forEach ((_groupData select _item) select 2); + if((count waypoints _grp) > 1) then { + _grp setCurrentWaypoint [_grp,1]; // skip the next one okeyyo.. + }; }; }; }; - } forEach _units; - (units _grp) join _grp; - _lastIndex = (count waypoints _grp)-1; - [_grp] call CBA_fnc_clearWaypoints; - { - [_grp, _forEachIndex + 1, _x] call CFUNC(deserializeWaypoint); - } forEach _waypoints; - if((count waypoints _grp) > 1) then { - _grp setCurrentWaypoint [_grp,1]; // skip the next one okeyyo.. }; - _spawnedGroups pushBack _grp; -} forEach _groups; -_wave = _logic getVariable ["Waves",1]; -_logic setVariable ["Waves", (_wave-1), true]; -_handlers = _logic getVariable ["Handlers",[]]; -{ - if(_x isEqualType {}) then { - [_wave,_spawnedGroups,_spawnedUnits,_spawnedVehicles,_spawnedObjects,_logic,_forEachIndex] call _x; + if (_queue isNotEqualTo []) exitWith {}; + + // Wave fully spawned + [_pfh] call CBA_fnc_removePerFrameHandler; + _spawnedGroups = _spawnedGroups select {!isNull _x}; + + private _wave = _logic getVariable ["Waves",1]; + _logic setVariable ["Waves", (_wave-1), true]; + private _handlers = _logic getVariable ["Handlers",[]]; + { + if(_x isEqualType {}) then { + [_wave,_spawnedGroups,_spawnedUnits,_spawnedVehicles,_spawnedObjects,_logic,_forEachIndex] call _x; + }; + } forEach _handlers; + + // Check if there is another wave + if(_logic getVariable ["Waves",1] > 0) then { + private _time = _logic getVariable ["Time",10]; + private _whenDead = _logic getVariable ["WhenDead",0]; + + // Wait for conditions before spawning the next wave, checked once a second + [{ + params ["_args", "_pfh"]; + _args params ["_logic", "_minimumDead", "_spawnedUnits", "_targetTime"]; + if (CBA_missionTime < _targetTime) exitWith {}; + if ({!alive _x || lifeState _x isEqualTo "INCAPACITATED"} count _spawnedUnits < _minimumDead) exitWith {}; + + [_pfh] call CBA_fnc_removePerFrameHandler; + [_logic] call FUNC(spawnWave); + }, 1, [_logic, _whenDead * count _spawnedUnits, _spawnedUnits, CBA_missionTime + _time]] call CBA_fnc_addPerFrameHandler; + } else { + deleteVehicle _logic; }; -} forEach _handlers; -// Check if there is another wave -if(_logic getVariable ["Waves",1] > 0) then { - private _time = _logic getvariable ["Time",10]; - private _whenDead = _logic getVariable ["WhenDead",0]; - // Wait for conditions before spawning waves [ - { - //params ["","","_minimumDead","_spawnedUnits", "_targetTime"]; - CBA_missionTime > (_this # 4) && - {{!alive _x || lifeState _x isEqualTo "INCAPACITATED"} count (_this # 3) >= (_this # 2)} - }, - FUNC(spawnWave), - [_logic,_spawnedGroups,_whenDead * count _spawnedUnits,_spawnedUnits, CBA_missionTime + _time] - ] call CBA_fnc_waitUntilAndExecute; - -} else { - deleteVehicle _logic; -}; - -[ - format [ - "Spawned wave, unit count: %1, vehicle count: %2, group count %3, object count %4", - count _spawnedUnits, - count _spawnedVehicles, - count _spawnedGroups, - count _spawnedObjects - ], - count _spawnedUnits > 40, - "AI" -] call EFUNC(adminmenu,log); + format [ + "Spawned wave, unit count: %1, vehicle count: %2, group count %3, object count %4", + count _spawnedUnits, + count _spawnedVehicles, + count _spawnedGroups, + count _spawnedObjects + ], + count _spawnedUnits > 40, + "AI" + ] call EFUNC(adminmenu,log); +}, 0, [_logic, _queue, _state, _fnc_spawnUnit]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/ai/functions/fnc_waveInit.sqf b/addons/ai/functions/fnc_waveInit.sqf index 08cbcfd9..b9b13e43 100644 --- a/addons/ai/functions/fnc_waveInit.sqf +++ b/addons/ai/functions/fnc_waveInit.sqf @@ -17,8 +17,8 @@ if(is3DEN) exitWith {}; #include "\x\tmf\addons\AI\script_component.hpp" params ["_logic","_units","_activated"]; -_headless = (synchronizedObjects _logic) select {_x isKindOf "HeadlessClient_F" && !local _x}; -if(count _headless > 0 && isServer) exitWith { +private _headless = (synchronizedObjects _logic) select {_x isKindOf "HeadlessClient_F" && !local _x}; +if(_headless isNotEqualTo [] && isServer) exitWith { _this remoteExec [QFUNC(waveInit), _headless select 0]; }; @@ -55,10 +55,10 @@ if(!(_logic getVariable [QGVAR(init),false])) then { } else { { _synchronizedGroups pushBackUnique (group _x); - } foreach crew _x; + } forEach crew _x; }; }; - } foreach _objects; + } forEach _objects; private _allUnits = []; { _allUnits append (units _x) } forEach _synchronizedGroups; @@ -100,7 +100,7 @@ if(!(_logic getVariable [QGVAR(init),false])) then { ]}; // store vehicle data - _vehicles = _vehicles apply {[typeof _x,getposATL _x,[vectorDir _x,vectorUp _x],[_x] call BIS_fnc_getVehicleCustomization, getPylonMagazines _x, getDir _x]}; + _vehicles = _vehicles apply {[typeOf _x,getPosATL _x,[vectorDir _x,vectorUp _x],[_x] call BIS_fnc_getVehicleCustomization, getPylonMagazines _x, getDir _x]}; _logic setVariable [QGVAR(waveData), [_groups, _vehicles, _cachedObjects]]; @@ -110,11 +110,11 @@ if(!(_logic getVariable [QGVAR(init),false])) then { { if(!isNull objectParent _x) then {_units pushBackUnique vehicle _x}; deleteVehicle _x; - } foreach _units; - } foreach _synchronizedGroups; + } forEach _units; + } forEach _synchronizedGroups; { deleteVehicle _x; - } foreach _objects; + } forEach _objects; // Generate Admin Map data (Lite version of data for broadcast) // Array of [typeof, pos, direction] diff --git a/addons/ai/modules/huntModule.hpp b/addons/ai/modules/huntModule.hpp index 14cbc91e..04411ada 100644 --- a/addons/ai/modules/huntModule.hpp +++ b/addons/ai/modules/huntModule.hpp @@ -86,4 +86,4 @@ class GVAR(huntModule) : Module_F class ModuleDescription: ModuleDescription { description = "Short module description"; // Short description, will be formatted as structured text }; -}; \ No newline at end of file +}; diff --git a/addons/ai/modules/waveSpawner.hpp b/addons/ai/modules/waveSpawner.hpp index 033c8dd1..c297d8bd 100644 --- a/addons/ai/modules/waveSpawner.hpp +++ b/addons/ai/modules/waveSpawner.hpp @@ -54,11 +54,7 @@ class GVAR(wavespawn) : Module_F { property = QGVAR(wavespawn_WaveInit); displayName = "Wave init code"; tooltip = "Code executed every time a new wave is spawned"; - expression = QUOTE( \ - if (_value != 'params [ARR_7(""_wave"",""_spawnedGroups"",""_spawnedUnits"",""_spawnedVehicles"",""_spawnedObjects"",""_logic"",""_wavehandlerID"")];' && _value != '') then { \ - [ARR_3(_this,compile _value,True)] call FUNC(addWaveHandler); \ - }; \ - ); + expression = QUOTE(if (_value != 'params [ARR_7(""_wave"",""_spawnedGroups"",""_spawnedUnits"",""_spawnedVehicles"",""_spawnedObjects"",""_logic"",""_wavehandlerID"")];' && _value != '') then {[ARR_3(_this,compile _value,True)] call FUNC(addWaveHandler);};); defaultValue = "'params [""_wave"",""_spawnedGroups"",""_spawnedUnits"",""_spawnedVehicles"",""_spawnedObjects"",""_logic"",""_wavehandlerID""];'"; control = "EditCodeMulti5"; }; diff --git a/addons/ai/script_component.hpp b/addons/ai/script_component.hpp index 617ee394..c304c7bd 100644 --- a/addons/ai/script_component.hpp +++ b/addons/ai/script_component.hpp @@ -1,6 +1,11 @@ +#ifndef TMF_AI_SCRIPT_COMPONENT_HPP +#define TMF_AI_SCRIPT_COMPONENT_HPP + #define COMPONENT ai #include "\x\tmf\addons\main\script_mod.hpp" #include "\x\tmf\addons\main\script_macros.hpp" #define ALL_AI_FEATURES ["TARGET","AUTOTARGET","MOVE","ANIM","TEAMSWITCH","FSM","WEAPONAIM","AIMINGERROR","SUPPRESSION","CHECKVISIBLE","COVER","AUTOCOMBAT","PATH","MINEDETECTION","NVG","LIGHTS","RADIOPROTOCOL"] + +#endif // TMF_AI_SCRIPT_COMPONENT_HPP diff --git a/addons/assigngear/Cfg3DEN.hpp b/addons/assigngear/Cfg3DEN.hpp index 35155517..eb11c8d3 100644 --- a/addons/assigngear/Cfg3DEN.hpp +++ b/addons/assigngear/Cfg3DEN.hpp @@ -63,7 +63,7 @@ class Cfg3DEN property = "TMF_assignGear_full"; condition = "objectBrain"; control = "None"; - expression = QUOTE([ARR_2(_this, _value)] call FUNC(helper)); + expression = QUOTE([ARR_2(_this,_value)] call FUNC(helper)); defaultValue = "['r','',false]"; }; }; @@ -78,11 +78,11 @@ class Cfg3DEN property = QGVAR(vehicleContents); condition = "objectHasInventoryCargo"; defaultValue = "['', '', createHashMap]"; - expression = QUOTE([ARR_2(_this, _value)] call FUNC(vehicleGear_init)); + expression = QUOTE([ARR_2(_this,_value)] call FUNC(vehicleGear_init)); control = QGVAR(AmmoBox); }; - } - } + }; + }; }; }; class Attributes @@ -99,13 +99,14 @@ class Cfg3DEN class Value; }; }; - class Value; - class TitleWide; class Controls; // AI Gear module controls class GVARMAIN(DOUBLES(aigear,faction)) : Combo { - INIT_CONTROL(GVARMAIN(AttributesFaction),ADDON) + scriptName = QGVARMAIN(AttributesFaction); + scriptPath = QUOTE(ADDON); + onLoad = QUOTE([ARR_5('onLoad',_this,QQGVARMAIN(AttributesFaction),QUOTE(QUOTE(ADDON)),false)] call (uiNamespace getVariable 'BIS_fnc_initDisplay')); + onUnload = QUOTE([ARR_5('onUnload',_this,QQGVARMAIN(AttributesFaction),QUOTE(QUOTE(ADDON)),false)] call (uiNamespace getVariable 'BIS_fnc_initDisplay')); }; class GVARMAIN(loadout) : Combo { @@ -173,9 +174,9 @@ class Cfg3DEN (_this select 0) lbData (_this select 1)\ ] call (missionNamespace getVariable 'TMF_assignGear_fnc_loadRoles');\ "; - x = ATTRIBUTE_TITLE_W * GRID_W; - w = ATTRIBUTE_CONTENT_W * GRID_W; - h = SIZE_M * GRID_H; + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + w = QUOTE(ATTRIBUTE_CONTENT_W * GRID_W); + h = QUOTE(SIZE_M * GRID_H); }; }; }; @@ -203,32 +204,32 @@ class Cfg3DEN class Title: ctrlStatic { style = 0x01; x = 0; - w = ATTRIBUTE_TITLE_W * GRID_W; - h = SIZE_M * GRID_H; + w = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + h = QUOTE(SIZE_M * GRID_H); colorBackground[] = {0,0,0,0}; }; class ValueRole: ctrlCombo { idc = 100; onLoad = "uiNamespace setVariable ['AttributeTMF_Role',_this select 0];"; - x = ATTRIBUTE_TITLE_W * GRID_W; - w = ATTRIBUTE_CONTENT_W * GRID_W; - h = SIZE_M * GRID_H; + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + w = QUOTE(ATTRIBUTE_CONTENT_W * GRID_W); + h = QUOTE(SIZE_M * GRID_H); }; }; }; class GVAR(AmmoBox): Default { - onLoad = QUOTE( [ARR_2(_this select 0, 'onLoad')] call FUNC(gui_vehicleGear_selector) ); - attributeLoad = QUOTE([ARR_2(_this, _value)] call FUNC(gui_vehicleGear_load)); + onLoad = QUOTE([ARR_2(_this select 0,'onLoad')] call FUNC(gui_vehicleGear_selector)); + attributeLoad = QUOTE([ARR_2(_this,_value)] call FUNC(gui_vehicleGear_load)); attributeSave = QUOTE([_this] call FUNC(gui_vehicleGear_save)); - h = (22 * ATTRIBUTE_CONTENT_H + 1) * GRID_H; + h = QUOTE((22 * ATTRIBUTE_CONTENT_H + 1) * GRID_H); class Controls: Controls { class CategoryTitle: ctrlStatic { x = 0; y = 0; - w = ATTRIBUTE_TITLE_W * GRID_W; - h = SIZE_XL * GRID_H; + w = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + h = QUOTE(SIZE_XL * GRID_H); text = "Category"; style = ST_RIGHT; colorBackground[] = {0,0,0,0}; @@ -236,66 +237,45 @@ class Cfg3DEN class CategoryValue: ctrlCombo { idc = IDC_VEHICLEGEAR_CATEGORY; - x = ATTRIBUTE_TITLE_W * GRID_W; + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); y = 0; - w = ATTRIBUTE_CONTENT_W * GRID_W; - h = SIZE_M * GRID_H; - onLBSelChanged = QUOTE( \ - params [ARR_2('_control', '_index')]; \ - [ARR_3( \ - ctrlParentControlsGroup _control, \ - 'categoryChanged', \ - _control lbData _index \ - )] call FUNC(gui_vehicleGear_selector); \ - ); + w = QUOTE(ATTRIBUTE_CONTENT_W * GRID_W); + h = QUOTE(SIZE_M * GRID_H); + onLBSelChanged = QUOTE(params [ARR_2('_control','_index')]; [ARR_3(ctrlParentControlsGroup _control,'categoryChanged',_control lbData _index)] call FUNC(gui_vehicleGear_selector);); }; class FactionTitle : ctrlStatic { text = "Faction"; style = ST_RIGHT; x = 0; - y = 1 * SIZE_XL * GRID_H; - w = ATTRIBUTE_TITLE_W * GRID_W; - h = SIZE_XL * GRID_H; + y = QUOTE(1 * SIZE_XL * GRID_H); + w = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + h = QUOTE(SIZE_XL * GRID_H); colorBackground[] = {0,0,0,0}; }; class FactionValue: ctrlCombo { idc = IDC_VEHICLEGEAR_FACTION; - x = ATTRIBUTE_TITLE_W * GRID_W; - y = 1 * SIZE_XL * GRID_H; - w = ATTRIBUTE_CONTENT_W * GRID_W; - h = SIZE_M * GRID_H; - onLBSelChanged = QUOTE( \ - params [ARR_2('_control', '_index')]; \ - [ARR_3( \ - ctrlParentControlsGroup _control, \ - 'filterChanged', \ - uiNamespace getVariable [ARR_2(QQGVAR(filter), FILTER_CONTENTS)] \ - )] call FUNC(gui_vehicleGear_selector); \ - ); + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + y = QUOTE(1 * SIZE_XL * GRID_H); + w = QUOTE(ATTRIBUTE_CONTENT_W * GRID_W); + h = QUOTE(SIZE_M * GRID_H); + onLBSelChanged = QUOTE(params [ARR_2('_control','_index')]; [ARR_3(ctrlParentControlsGroup _control,'filterChanged',uiNamespace getVariable [ARR_2(QQGVAR(filter),FILTER_CONTENTS)])] call FUNC(gui_vehicleGear_selector);); }; class Title2: Title { text = "$STR_3den_attributes_ammobox_title2_text"; - y = 2 * ATTRIBUTE_CONTENT_H * GRID_H; + y = QUOTE(2 * ATTRIBUTE_CONTENT_H * GRID_H); }; class Filter: ctrlToolboxPictureKeepAspect { idc = IDC_VEHICLEGEAR_FILTER; - x = ATTRIBUTE_CONTENT_H * GRID_W; - y = 3 * ATTRIBUTE_CONTENT_H * GRID_H; - w = (ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - 5) * GRID_W; - h = 2 * ATTRIBUTE_CONTENT_H * GRID_H; + x = QUOTE(ATTRIBUTE_CONTENT_H * GRID_W); + y = QUOTE(3 * ATTRIBUTE_CONTENT_H * GRID_H); + w = QUOTE((ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - 5) * GRID_W); + h = QUOTE(2 * ATTRIBUTE_CONTENT_H * GRID_H); rows = 1; columns = 4; - onToolBoxSelChanged = QUOTE( \ - params [ARR_2('_ctrl', '_idx')]; \ - [ARR_3( \ - ctrlParentControlsGroup _ctrl, \ - 'filterChanged', \ - _idx \ - )] call FUNC(gui_vehicleGear_selector); \ - ); + onToolBoxSelChanged = QUOTE(params [ARR_2('_ctrl','_idx')]; [ARR_3(ctrlParentControlsGroup _ctrl,'filterChanged',_idx)] call FUNC(gui_vehicleGear_selector);); strings[] = { "\a3\Ui_F_Curator\Data\RscCommon\RscAttributeInventory\filter_0_ca.paa", "\a3\Ui_F_Curator\Data\RscCommon\RscAttributeInventory\filter_1_ca.paa", @@ -305,37 +285,37 @@ class Cfg3DEN }; class ListSortBackground: ctrlStatic { - x = ATTRIBUTE_CONTENT_H * GRID_W; - y = 5 * ATTRIBUTE_CONTENT_H * GRID_H; - w = (ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - ATTRIBUTE_CONTENT_H) * GRID_W; - h = ATTRIBUTE_CONTENT_H * GRID_H; + x = QUOTE(ATTRIBUTE_CONTENT_H * GRID_W); + y = QUOTE(5 * ATTRIBUTE_CONTENT_H * GRID_H); + w = QUOTE((ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - ATTRIBUTE_CONTENT_H) * GRID_W); + h = QUOTE(ATTRIBUTE_CONTENT_H * GRID_H); colorBackground[] = {0,0,0,1}; }; class ListSort: ctrlListNBox { idc = IDC_VEHICLEGEAR_LISTSORT; - x = ATTRIBUTE_CONTENT_H * GRID_W; - y = 5 * ATTRIBUTE_CONTENT_H * GRID_H; - w = (ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - 5) * GRID_W; - h = ATTRIBUTE_CONTENT_H * GRID_H; + x = QUOTE(ATTRIBUTE_CONTENT_H * GRID_W); + y = QUOTE(5 * ATTRIBUTE_CONTENT_H * GRID_H); + w = QUOTE((ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - 5) * GRID_W); + h = QUOTE(ATTRIBUTE_CONTENT_H * GRID_H); disableOverflow = 1; columns[] = {0,0.60,0.82,0.89,1}; }; class ListBackground: ctrlStatic { - x = ATTRIBUTE_CONTENT_H * GRID_W; - y = 6 * ATTRIBUTE_CONTENT_H * GRID_H; - w = (ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - ATTRIBUTE_CONTENT_H) * GRID_W; - h = 13 * ATTRIBUTE_CONTENT_H * GRID_H; + x = QUOTE(ATTRIBUTE_CONTENT_H * GRID_W); + y = QUOTE(6 * ATTRIBUTE_CONTENT_H * GRID_H); + w = QUOTE((ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - ATTRIBUTE_CONTENT_H) * GRID_W); + h = QUOTE(13 * ATTRIBUTE_CONTENT_H * GRID_H); colorBackground[] = {1,1,1,0.1}; }; class List: ctrlListNBox { idc = IDC_VEHICLEGEAR_LIST; - x = ATTRIBUTE_CONTENT_H * GRID_W; - y = 6 * ATTRIBUTE_CONTENT_H * GRID_H; - w = (ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - 5) * GRID_W; - h = 13 * ATTRIBUTE_CONTENT_H * GRID_H; + x = QUOTE(ATTRIBUTE_CONTENT_H * GRID_W); + y = QUOTE(6 * ATTRIBUTE_CONTENT_H * GRID_H); + w = QUOTE((ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - 5) * GRID_W); + h = QUOTE(13 * ATTRIBUTE_CONTENT_H * GRID_H); drawSideArrows = 1; idcLeft = IDC_VEHICLEGEAR_SUBTRACT; idcRight = IDC_VEHICLEGEAR_ADD; @@ -348,14 +328,11 @@ class Cfg3DEN { idc = IDC_VEHICLEGEAR_CLEAR; text = "Clear"; - x = (ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - 25) * GRID_W; - y = 19 * ATTRIBUTE_CONTENT_H * GRID_H; - w = 25 * GRID_W; - h = ATTRIBUTE_CONTENT_H * GRID_H; - onButtonClick = QUOTE( \ - params ['_ctrlButton']; \ - [ARR_2(ctrlParentControlsGroup _ctrlButton, 'clear')] call FUNC(gui_vehicleGear_selector); \ - ); + x = QUOTE((ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - 25) * GRID_W); + y = QUOTE(19 * ATTRIBUTE_CONTENT_H * GRID_H); + w = QUOTE(25 * GRID_W); + h = QUOTE(ATTRIBUTE_CONTENT_H * GRID_H); + onButtonClick = QUOTE(params ['_ctrlButton']; [ARR_2(ctrlParentControlsGroup _ctrlButton,'clear')] call FUNC(gui_vehicleGear_selector);); }; class ArrowLeft: ctrlButton { @@ -364,8 +341,8 @@ class Cfg3DEN font = "RobotoCondensedBold"; x = -1; y = -1; - w = ATTRIBUTE_CONTENT_H * GRID_W; - h = ATTRIBUTE_CONTENT_H * GRID_H; + w = QUOTE(ATTRIBUTE_CONTENT_H * GRID_W); + h = QUOTE(ATTRIBUTE_CONTENT_H * GRID_H); }; class ArrowRight: ArrowLeft { diff --git a/addons/assigngear/CfgModules.hpp b/addons/assigngear/CfgModules.hpp index 35fa2b2d..f3024a3e 100644 --- a/addons/assigngear/CfgModules.hpp +++ b/addons/assigngear/CfgModules.hpp @@ -6,14 +6,12 @@ class CfgVehicles class AttributesBase { class Default; - class Combo; class Checkbox; class ModuleDescription; }; // Description base classes, for more information see below class ModuleDescription { - class AnyBrain; }; }; #include "modules\aigear.hpp" diff --git a/addons/assigngear/UI/RscDisplayArsenal.hpp b/addons/assigngear/UI/RscDisplayArsenal.hpp index 54409e3d..d0d61e1f 100644 --- a/addons/assigngear/UI/RscDisplayArsenal.hpp +++ b/addons/assigngear/UI/RscDisplayArsenal.hpp @@ -3,10 +3,10 @@ class RscDisplayArsenal class controls { class TMFexport : RscButtonMenu { - x ="0.425079 * safezoneW + safezoneX"; - y = "0.951298 * safezoneH + safezoneY"; - w = "0.123399 * safezoneW"; - h ="0.0188041 * safezoneH"; + x ="0.425079 * safeZoneW + safeZoneX"; + y = "0.951298 * safeZoneH + safeZoneY"; + w = "0.123399 * safeZoneW"; + h ="0.0188041 * safeZoneH"; text = "Export as TMF Role"; action = "[player,'test'] call tmf_assigngear_fnc_saveRole"; }; diff --git a/addons/assigngear/UI/TMF_AttributesFaction.sqf b/addons/assigngear/UI/TMF_AttributesFaction.sqf index 0b94783c..e75d14d9 100644 --- a/addons/assigngear/UI/TMF_AttributesFaction.sqf +++ b/addons/assigngear/UI/TMF_AttributesFaction.sqf @@ -7,7 +7,7 @@ _params params ["_ctrl","_config"]; TRACE_3("Loading AIGear Faction Attribute",_mode,_params,_module); #ifdef CURATOR_ATTRIBUTE - private _ctrlCombo = _ctrl displayctrl IDC_RSCATTRIBUTEFACTION_COMBO; + private _ctrlCombo = _ctrl displayCtrl IDC_RSCATTRIBUTEFACTION_COMBO; #else private _ctrlCombo = _ctrl controlsGroupCtrl 100; #endif diff --git a/addons/assigngear/UI/TMF_RscAttributeFaction.hpp b/addons/assigngear/UI/TMF_RscAttributeFaction.hpp index d0db4491..ae4e621b 100644 --- a/addons/assigngear/UI/TMF_RscAttributeFaction.hpp +++ b/addons/assigngear/UI/TMF_RscAttributeFaction.hpp @@ -1,28 +1,28 @@ class GVARMAIN(RscAttributeFaction): RscControlsGroupNoScrollbars { onSetFocus = QUOTE([ARR_3(_this,'GVARMAIN(RscAttributeFaction)','ADDON')] call (uinamespace getvariable 'BIS_fnc_initCuratorAttribute')); idc = IDC_RSCATTRIBUTEFACTION_RSCATTRIBUTEFACTION; - x = 7 * GUI_GRID_W + GUI_GRID_X; - y = 10 * GUI_GRID_H + GUI_GRID_Y; - w = 26 * GUI_GRID_W; - h = 1 * GUI_GRID_H; + x = QUOTE(7 * GUI_GRID_W + GUI_GRID_X); + y = QUOTE(10 * GUI_GRID_H + GUI_GRID_Y); + w = QUOTE(26 * GUI_GRID_W); + h = QUOTE(1 * GUI_GRID_H); class controls { class Title: RscText { idc = IDC_RSCATTRIBUTEFACTION_TITLE; text = "Faction"; - x = 0 * GUI_GRID_W; - y = 0 * GUI_GRID_H; - w = 10 * GUI_GRID_W; - h = 1 * GUI_GRID_H; + x = QUOTE(0 * GUI_GRID_W); + y = QUOTE(0 * GUI_GRID_H); + w = QUOTE(10 * GUI_GRID_W); + h = QUOTE(1 * GUI_GRID_H); colorBackground[] = GUI_TEXT_SHADOW; }; class Faction: RscCombo { - font = GUI_FONT_MONO; + font = QUOTE(GUI_FONT_MONO); idc = IDC_RSCATTRIBUTEFACTION_COMBO; - x = 10 * GUI_GRID_W; - y = 0 * GUI_GRID_H; - w = 16 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - sizeEx = GUI_TEXT_SIZE_SMALL; + x = QUOTE(10 * GUI_GRID_W); + y = QUOTE(0 * GUI_GRID_H); + w = QUOTE(16 * GUI_GRID_W); + h = QUOTE(1 * GUI_GRID_H); + sizeEx = QUOTE(GUI_TEXT_SIZE_SMALL); }; }; }; diff --git a/addons/assigngear/UI/TMF_RscAttributeLoadout.hpp b/addons/assigngear/UI/TMF_RscAttributeLoadout.hpp index a964d303..3dd6b76c 100644 --- a/addons/assigngear/UI/TMF_RscAttributeLoadout.hpp +++ b/addons/assigngear/UI/TMF_RscAttributeLoadout.hpp @@ -1,28 +1,28 @@ class GVARMAIN(RscAttributeLoadout): RscControlsGroupNoScrollbars { onSetFocus = QUOTE([ARR_3(_this,'GVARMAIN(RscAttributeLoadout)','ADDON')] call (uinamespace getvariable 'BIS_fnc_initCuratorAttribute')); idc = IDC_RSCATTRIBUTELOADOUT_RSCATTRIBUTELOADOUT; - x = 7 * GUI_GRID_W + GUI_GRID_X; - y = 10 * GUI_GRID_H + GUI_GRID_Y; - w = 26 * GUI_GRID_W; - h = 1 * GUI_GRID_H; + x = QUOTE(7 * GUI_GRID_W + GUI_GRID_X); + y = QUOTE(10 * GUI_GRID_H + GUI_GRID_Y); + w = QUOTE(26 * GUI_GRID_W); + h = QUOTE(1 * GUI_GRID_H); class controls { class Title: RscText { idc = IDC_RSCATTRIBUTELOADOUT_TITLE; text = "Loadout"; - x = 0 * GUI_GRID_W; - y = 0 * GUI_GRID_H; - w = 10 * GUI_GRID_W; - h = 1 * GUI_GRID_H; + x = QUOTE(0 * GUI_GRID_W); + y = QUOTE(0 * GUI_GRID_H); + w = QUOTE(10 * GUI_GRID_W); + h = QUOTE(1 * GUI_GRID_H); colorBackground[] = GUI_TEXT_SHADOW; }; class Loadout: RscCombo { - font = GUI_FONT_MONO; + font = QUOTE(GUI_FONT_MONO); idc = IDC_RSCATTRIBUTELOADOUT_COMBO; - x = 10 * GUI_GRID_W; - y = 0 * GUI_GRID_H; - w = 16 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - sizeEx = GUI_TEXT_SIZE_SMALL; + x = QUOTE(10 * GUI_GRID_W); + y = QUOTE(0 * GUI_GRID_H); + w = QUOTE(16 * GUI_GRID_W); + h = QUOTE(1 * GUI_GRID_H); + sizeEx = QUOTE(GUI_TEXT_SIZE_SMALL); }; }; }; diff --git a/addons/assigngear/UI/TMF_RscAttributeLoadout.sqf b/addons/assigngear/UI/TMF_RscAttributeLoadout.sqf index 40770fb5..fad0697a 100644 --- a/addons/assigngear/UI/TMF_RscAttributeLoadout.sqf +++ b/addons/assigngear/UI/TMF_RscAttributeLoadout.sqf @@ -12,16 +12,17 @@ switch _mode do { TRACE_1("Adding loadout",_x); private _lbAdd = _loadoutCombo lbAdd getText (_x >> "displayName"); _loadoutCombo lbSetData [_lbAdd, configName _x]; - private _dlcLogo = if (configsourcemod _x != '') then { - (modParams [configSourceMod _x,['logo']]) param [0]; + private _dlcLogo = ''; + if (configSourceMod _x != '') then { + _dlcLogo = (modParams [configSourceMod _x,['logo']]) param [0, '']; }; - if (!isNil "_dlcLogo" && {_dlcLogo != ''}) then { + if (_dlcLogo != '') then { _loadoutCombo lbSetPictureRight [_lbAdd,_dlcLogo]; }; } forEach ("true" configClasses _x); } forEach [configFile >> "CfgLoadouts", missionConfigFile >> "CfgLoadouts"]; - lbsort _loadoutCombo; + lbSort _loadoutCombo; _loadoutCombo lbSetCurSel 0; }; case "onUnload": {}; diff --git a/addons/assigngear/UI/TMF_RscAttributeRetroactive.hpp b/addons/assigngear/UI/TMF_RscAttributeRetroactive.hpp index 14084229..0ac98636 100644 --- a/addons/assigngear/UI/TMF_RscAttributeRetroactive.hpp +++ b/addons/assigngear/UI/TMF_RscAttributeRetroactive.hpp @@ -1,39 +1,39 @@ class GVARMAIN(RscAttributeRetroactive): RscControlsGroupNoScrollbars { onSetFocus = QUOTE([ARR_3(_this,'GVARMAIN(RscAttributeRetroactive)','ADDON')] call (uinamespace getvariable 'BIS_fnc_initCuratorAttribute')); idc = IDC_RSCATTRIBUTERETROACTIVE_RSCATTRIBUTERETROACTIVE; - x = 7 * GUI_GRID_W + GUI_GRID_CENTER_X; - y = 10 * GUI_GRID_H + GUI_GRID_CENTER_Y; - w = 26 * GUI_GRID_W; - h = 1 * GUI_GRID_H; + x = QUOTE(7 * GUI_GRID_W + GUI_GRID_CENTER_X); + y = QUOTE(10 * GUI_GRID_H + GUI_GRID_CENTER_Y); + w = QUOTE(26 * GUI_GRID_W); + h = QUOTE(1 * GUI_GRID_H); class controls { class Title: RscText { idc = IDC_RSCATTRIBUTERETROACTIVE_TITLE; text = "Apply Retroactively"; - x = 0 * GUI_GRID_W; - y = 0 * GUI_GRID_H; - w = 10 * GUI_GRID_W; - h = 1 * GUI_GRID_H; + x = QUOTE(0 * GUI_GRID_W); + y = QUOTE(0 * GUI_GRID_H); + w = QUOTE(10 * GUI_GRID_W); + h = QUOTE(1 * GUI_GRID_H); colorBackground[] = GUI_TEXT_SHADOW; }; class Background: RscText { style = 2; idc = IDC_RSCATTRIBUTERETROACTIVE_BCG; - x = 10 * GUI_GRID_W; - y = 0 * GUI_GRID_H; - w = 16 * GUI_GRID_W; - h = 1 * GUI_GRID_H; + x = QUOTE(10 * GUI_GRID_W); + y = QUOTE(0 * GUI_GRID_H); + w = QUOTE(16 * GUI_GRID_W); + h = QUOTE(1 * GUI_GRID_H); colorText[] = {1,1,1,0.5}; colorBackground[] = {1,1,1,0.1}; }; class Value: RscToolboxButton { rows = 1; columns = 2; - strings[] = {$STR_enabled,$STR_disabled}; + strings[] = {"$STR_enabled","$STR_disabled"}; idc = IDC_RSCATTRIBUTERETROACTIVE_TOOLBOX; - x = 10 * GUI_GRID_W; - y = 0 * GUI_GRID_H; - w = 16 * GUI_GRID_W; - h = 1 * GUI_GRID_H; + x = QUOTE(10 * GUI_GRID_W); + y = QUOTE(0 * GUI_GRID_H); + w = QUOTE(16 * GUI_GRID_W); + h = QUOTE(1 * GUI_GRID_H); }; }; }; diff --git a/addons/assigngear/UI/TMF_RscAttributeRetroactive.sqf b/addons/assigngear/UI/TMF_RscAttributeRetroactive.sqf index 11476f95..649cbe04 100644 --- a/addons/assigngear/UI/TMF_RscAttributeRetroactive.sqf +++ b/addons/assigngear/UI/TMF_RscAttributeRetroactive.sqf @@ -5,7 +5,7 @@ disableSerialization; params ["_mode","_params","_unit"]; _params params ["_display"]; TRACE_3("Loading AIGear Retroactive Attribute",_mode,_params,_class); -private _ctrlToolbox = _display displayctrl IDC_RSCATTRIBUTERETROACTIVE_TOOLBOX; +private _ctrlToolbox = _display displayCtrl IDC_RSCATTRIBUTERETROACTIVE_TOOLBOX; switch (_mode) do { case "onLoad": {}; diff --git a/addons/assigngear/UI/TMF_RscDisplayAttributesModuleAIGear.hpp b/addons/assigngear/UI/TMF_RscDisplayAttributesModuleAIGear.hpp index 3e771320..c9f360ab 100644 --- a/addons/assigngear/UI/TMF_RscDisplayAttributesModuleAIGear.hpp +++ b/addons/assigngear/UI/TMF_RscDisplayAttributesModuleAIGear.hpp @@ -1,13 +1,16 @@ class GVARMAIN(RscDisplayAttributesModuleAIGear): RscDisplayAttributes { - INIT_DISPLAY(GVARMAIN(RscDisplayAttributesModuleAIGear),ADDON) + scriptName = QGVARMAIN(RscDisplayAttributesModuleAIGear); + scriptPath = QUOTE(ADDON); + onLoad = QUOTE([ARR_4('onLoad',_this,QQGVARMAIN(RscDisplayAttributesModuleAIGear),QUOTE(QUOTE(ADDON)))] call (uiNamespace getVariable 'BIS_fnc_initDisplay')); + onUnload = QUOTE([ARR_4('onUnload',_this,QQGVARMAIN(RscDisplayAttributesModuleAIGear),QUOTE(QUOTE(ADDON)))] call (uiNamespace getVariable 'BIS_fnc_initDisplay')); curatorObjectAttributes = true; class Controls: Controls { class Background: Background{}; class Title: Title{}; class Content: Content { - class Controls: controls { + class Controls: Controls { class Text: RscAttributeText { - class Controls: controls { + class Controls: Controls { class Title: Title { text = "Bulk applies loadouts to AI units. Cannot be undone/disabled!"; }; diff --git a/addons/assigngear/UI/gearSelector.hpp b/addons/assigngear/UI/gearSelector.hpp index 7f69adbf..8a406949 100644 --- a/addons/assigngear/UI/gearSelector.hpp +++ b/addons/assigngear/UI/gearSelector.hpp @@ -1,147 +1,133 @@ class GVAR(RscGearSelector) : RscStandardDisplay { idd = IDD_RSCGEARSELECTOR; - onLoad = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(gear_display), _this select 0)]; _this call FUNC(gui_gearSelector_init);); - onUnload = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(gear_display), displayNull)];); + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(gear_display),_this select 0)]; _this call FUNC(gui_gearSelector_init);); + onUnload = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(gear_display),displayNull)];); class controls { class Title : RscTitle { text = "TMF Loadout Jukebox"; - x = CENTER_X - 25 * GRID_W; - y = CENTER_Y - GRID_H * 15; - w = 50 * GRID_W; - h = SIZE_M * GRID_H; + x = QUOTE(CENTER_X - 25 * GRID_W); + y = QUOTE(CENTER_Y - GRID_H * 15); + w = QUOTE(50 * GRID_W); + h = QUOTE(SIZE_M * GRID_H); sizeEx = SIZEEX_PURISTA(SIZEEX_M); }; class TitleIcon : RscPicture { text = QPATHTOEF(common,UI\logo_tmf_small_ca.paa); - x = CENTER_X - 30 * GRID_W; - y = CENTER_Y - GRID_H * 15; - w = SIZE_M * GRID_W; - h = SIZE_M * GRID_H; + x = QUOTE(CENTER_X - 30 * GRID_W); + y = QUOTE(CENTER_Y - GRID_H * 15); + w = QUOTE(SIZE_M * GRID_W); + h = QUOTE(SIZE_M * GRID_H); }; class CategoryLabel : RscText { text = "Category:"; - x = CENTER_X - 30 * GRID_W; - y = CENTER_Y - GRID_H * 9; - w = 60 * GRID_W; - h = SIZE_S * GRID_H; + x = QUOTE(CENTER_X - 30 * GRID_W); + y = QUOTE(CENTER_Y - GRID_H * 9); + w = QUOTE(60 * GRID_W); + h = QUOTE(SIZE_S * GRID_H); sizeEx = SIZEEX_PURISTA(SIZEEX_S); }; class Category : RscCombo { idc = IDC_RSCGEARSELECTOR_CATEGORY; - x = CENTER_X - 28 * GRID_W; - y = CENTER_Y - GRID_H * 5; - w = 56 * GRID_W; - h = SIZE_S * GRID_H; + x = QUOTE(CENTER_X - 28 * GRID_W); + y = QUOTE(CENTER_Y - GRID_H * 5); + w = QUOTE(56 * GRID_W); + h = QUOTE(SIZE_S * GRID_H); sizeEx = SIZEEX_PURISTA(SIZEEX_S); - onLBSelChanged = QUOTE( \ - params [ARR_2('_ctrl', '_selectedIndex')]; \ - [ARR_2(ctrlParent _ctrl, _selectedIndex)] call FUNC(gui_gearSelector_loadFactions); \ - false \ - ); + onLBSelChanged = QUOTE(params [ARR_2('_ctrl','_selectedIndex')]; [ARR_2(ctrlParent _ctrl,_selectedIndex)] call FUNC(gui_gearSelector_loadFactions); false); }; class FactionLabel : RscText { text = "Faction:"; - x = CENTER_X - 30 * GRID_W; - y = CENTER_Y - GRID_H * 1; - w = 60 * GRID_W; - h = SIZE_S * GRID_H; + x = QUOTE(CENTER_X - 30 * GRID_W); + y = QUOTE(CENTER_Y - GRID_H * 1); + w = QUOTE(60 * GRID_W); + h = QUOTE(SIZE_S * GRID_H); sizeEx = SIZEEX_PURISTA(SIZEEX_S); }; class Faction : RscCombo { idc = IDC_RSCGEARSELECTOR_FACTION; - x = CENTER_X - 28 * GRID_W; - y = CENTER_Y + GRID_H * 3; - w = 56 * GRID_W; - h = SIZE_S * GRID_H; + x = QUOTE(CENTER_X - 28 * GRID_W); + y = QUOTE(CENTER_Y + GRID_H * 3); + w = QUOTE(56 * GRID_W); + h = QUOTE(SIZE_S * GRID_H); sizeEx = SIZEEX_PURISTA(SIZEEX_S); - onLBSelChanged = QUOTE( \ - params [ARR_2('_ctrl', '_selectedIndex')]; \ - [ARR_2(ctrlParent _ctrl, _selectedIndex)] call FUNC(gui_gearSelector_loadRoles); \ - false \ - ); + onLBSelChanged = QUOTE(params [ARR_2('_ctrl','_selectedIndex')]; [ARR_2(ctrlParent _ctrl,_selectedIndex)] call FUNC(gui_gearSelector_loadRoles); false); }; class RoleLabel : RscText{ text = "Role:"; - x = CENTER_X - 30 * GRID_W; - y = CENTER_Y + GRID_H * 7; - w = 60 * GRID_W; - h = SIZE_S * GRID_H; + x = QUOTE(CENTER_X - 30 * GRID_W); + y = QUOTE(CENTER_Y + GRID_H * 7); + w = QUOTE(60 * GRID_W); + h = QUOTE(SIZE_S * GRID_H); sizeEx = SIZEEX_PURISTA(SIZEEX_S); }; class Role : RscCombo{ idc = IDC_RSCGEARSELECTOR_ROLE; - x = CENTER_X - 28 * GRID_W; - y = CENTER_Y + GRID_H * 11; - w = 56 * GRID_W; - h = SIZE_S * GRID_H; + x = QUOTE(CENTER_X - 28 * GRID_W); + y = QUOTE(CENTER_Y + GRID_H * 11); + w = QUOTE(56 * GRID_W); + h = QUOTE(SIZE_S * GRID_H); sizeEx = SIZEEX_PURISTA(SIZEEX_S); }; class ButtonCancel : RscButtonMenuCancel { - x = CENTER_X - 30 * GRID_W; - y = CENTER_Y + GRID_H * 17; - w = (59 / 3) * GRID_W; - h = SIZE_M * GRID_H; + x = QUOTE(CENTER_X - 30 * GRID_W); + y = QUOTE(CENTER_Y + GRID_H * 17); + w = QUOTE((59 / 3) * GRID_W); + h = QUOTE(SIZE_M * GRID_H); sizeEx = SIZEEX_PURISTA(SIZEEX_S); }; class ButtonRandom : RscButtonMenu { text = "Random"; idc = IDC_RSCGEARSELECTOR_RANDOM; - onButtonClick = QUOTE( \ - params ['_ctrl']; \ - [(ctrlParent _ctrl)] call FUNC(gui_gearSelector_random); \ - ); + onButtonClick = QUOTE(params ['_ctrl']; [(ctrlParent _ctrl)] call FUNC(gui_gearSelector_random);); - x = CENTER_X - ((59 / 3) * GRID_W) / 2; - y = CENTER_Y + GRID_H * 17; - w = (59 / 3) * GRID_W; - h = SIZE_M * GRID_H; + x = QUOTE(CENTER_X - ((59 / 3) * GRID_W) / 2); + y = QUOTE(CENTER_Y + GRID_H * 17); + w = QUOTE((59 / 3) * GRID_W); + h = QUOTE(SIZE_M * GRID_H); sizeEx = SIZEEX_PURISTA(SIZEEX_S); }; class ButtonOK : RscButtonMenuOK { idc = IDC_RSCGEARSELECTOR_SUBMIT; - onButtonClick = QUOTE( \ - params ['_ctrl']; \ - [(ctrlParent _ctrl)] call FUNC(gui_gearSelector_submit); \ - ); + onButtonClick = QUOTE(params ['_ctrl']; [(ctrlParent _ctrl)] call FUNC(gui_gearSelector_submit);); - x = CENTER_X + (GRID_W * 0.5) + ((59 / 3) * GRID_W) / 2; - y = CENTER_Y + GRID_H * 17; - w = (59 / 3) * GRID_W; - h = SIZE_M * GRID_H; + x = QUOTE(CENTER_X + (GRID_W * 0.5) + ((59 / 3) * GRID_W) / 2); + y = QUOTE(CENTER_Y + GRID_H * 17); + w = QUOTE((59 / 3) * GRID_W); + h = QUOTE(SIZE_M * GRID_H); sizeEx = SIZEEX_PURISTA(SIZEEX_S); }; }; class controlsBackground { class TitleBackground : RscBackgroundGUITop { - x = CENTER_X - 30 * GRID_W; - y = CENTER_Y - GRID_H * 15; - w = 60 * GRID_W; - h = SIZE_M * GRID_H; + x = QUOTE(CENTER_X - 30 * GRID_W); + y = QUOTE(CENTER_Y - GRID_H * 15); + w = QUOTE(60 * GRID_W); + h = QUOTE(SIZE_M * GRID_H); colorBackground[] = {COLOR_ACTIVE_RGBA}; backgroundType = 1; }; class Background : RscBackgroundGUI { - x = CENTER_X - 30 * GRID_W; - y = CENTER_Y - GRID_H * 9.5; - w = 60 * GRID_W; - h = 26 * GRID_H; + x = QUOTE(CENTER_X - 30 * GRID_W); + y = QUOTE(CENTER_Y - GRID_H * 9.5); + w = QUOTE(60 * GRID_W); + h = QUOTE(26 * GRID_H); }; }; }; diff --git a/addons/assigngear/UI/gui.hpp b/addons/assigngear/UI/gui.hpp index e5b32afe..fbca5ab9 100644 --- a/addons/assigngear/UI/gui.hpp +++ b/addons/assigngear/UI/gui.hpp @@ -9,7 +9,6 @@ class RscButtonMenuOK: RscButtonMenu {}; class RscBackgroundGUI; class RscBackgroundGUITop; class RscPicture; -class RscSlider; class RscDisplayAttributes { class Controls { class Background; diff --git a/addons/assigngear/XEH_PREP.hpp b/addons/assigngear/XEH_PREP.hpp index d368ec34..151f9984 100644 --- a/addons/assigngear/XEH_PREP.hpp +++ b/addons/assigngear/XEH_PREP.hpp @@ -36,4 +36,4 @@ PREP(gui_gearSelector_submit); PREP(gui_vehicleGear_selector); PREP(gui_vehicleGear_save); PREP(gui_vehicleGear_load); -PREP(vehicleGear_init); \ No newline at end of file +PREP(vehicleGear_init); diff --git a/addons/assigngear/XEH_postInit.sqf b/addons/assigngear/XEH_postInit.sqf index 3059a9d7..f5d7585f 100644 --- a/addons/assigngear/XEH_postInit.sqf +++ b/addons/assigngear/XEH_postInit.sqf @@ -2,4 +2,4 @@ if (hasInterface) then { call FUNC(overrideProfileItems); -}; \ No newline at end of file +}; diff --git a/addons/assigngear/XEH_preStart.sqf b/addons/assigngear/XEH_preStart.sqf index 2b89f58b..875c1ed9 100644 --- a/addons/assigngear/XEH_preStart.sqf +++ b/addons/assigngear/XEH_preStart.sqf @@ -8,7 +8,7 @@ private _faceClasses = []; { _faceClasses append (("true" configClasses _x) apply {toLower (configName _x)}); -} forEach ("true" configClasses(configfile >> "CfgFaces")); +} forEach ("true" configClasses(configFile >> "CfgFaces")); uiNamespace setVariable ["tmf_assignGear_validFaces",_faceClasses]; @@ -29,7 +29,7 @@ uiNamespace setVariable ["tmf_assignGear_validFaces",_faceClasses]; }; } forEach configProperties [_class, "isClass _x", true]; - if (count _weightedArray > 0) then { + if (_weightedArray isNotEqualTo []) then { uiNamespace setVariable ["tmf_assignGear_faceset_"+_name,_weightedArray]; }; } forEach ("true" configClasses (configFile >> "tmf_assignGear_facesets")); diff --git a/addons/assigngear/addon.toml b/addons/assigngear/addon.toml deleted file mode 100644 index 5b8f6fa4..00000000 --- a/addons/assigngear/addon.toml +++ /dev/null @@ -1,5 +0,0 @@ -[rapify] -enabled = false # Default: true -exclude = [ - "TMF_RscAttributeLoadout.hpp" -] \ No newline at end of file diff --git a/addons/assigngear/display3DEN.hpp b/addons/assigngear/display3DEN.hpp index 827d7fd8..5aca6db0 100644 --- a/addons/assigngear/display3DEN.hpp +++ b/addons/assigngear/display3DEN.hpp @@ -12,7 +12,7 @@ * parentDisplay: DISPLAY - display from which the window is opened from */ class ctrlMenu; /*proto*/ -class display3DEN +class Display3DEN { class ContextMenu: ctrlMenu { @@ -30,4 +30,4 @@ class display3DEN }; }; }; -}; \ No newline at end of file +}; diff --git a/addons/assigngear/functions/fnc_addBackpackItems.sqf b/addons/assigngear/functions/fnc_addBackpackItems.sqf index 1ed791fd..16d0ed76 100644 --- a/addons/assigngear/functions/fnc_addBackpackItems.sqf +++ b/addons/assigngear/functions/fnc_addBackpackItems.sqf @@ -22,7 +22,7 @@ if (isNil "_unit" || isNil "_items") exitWith {}; }) then { _unit addItemToBackpack _x; } else { - WARNING_2("Adding item to backpack failed. Unit: %1, Item: %2.", _unit, _x); + WARNING_2("Adding item to backpack failed. Unit: %1, Item: %2.",_unit,_x); continue; }; -} forEach _items; \ No newline at end of file +} forEach _items; diff --git a/addons/assigngear/functions/fnc_addItems.sqf b/addons/assigngear/functions/fnc_addItems.sqf index 6d5f7153..5f0dca4d 100644 --- a/addons/assigngear/functions/fnc_addItems.sqf +++ b/addons/assigngear/functions/fnc_addItems.sqf @@ -27,4 +27,4 @@ if (isNil "_unit" || isNil "_items") exitWith {}; }; } forEach _items; -_overflow \ No newline at end of file +_overflow diff --git a/addons/assigngear/functions/fnc_assignGear.sqf b/addons/assigngear/functions/fnc_assignGear.sqf index dedf86eb..dbc159c9 100644 --- a/addons/assigngear/functions/fnc_assignGear.sqf +++ b/addons/assigngear/functions/fnc_assignGear.sqf @@ -27,41 +27,41 @@ _this params [ // Sometimes in editor this function is run before preInit, this should make sure that the namespace exists private _namespace = missionNamespace getVariable QGVAR(namespace); -ISNILS(_namespace, [FUNC(initNamespace)] call CBA_fnc_directCall); +ISNILS(_namespace,[FUNC(initNamespace)] call CBA_fnc_directCall); private _loadout = format ["loadout_%1_%2", _faction, _role]; // Check if loadout if cached, if not then cache it private _loadoutArray = _namespace getVariable _loadout; -ISNILS(_loadoutArray, [ARR_2(_faction, _role)] call FUNC(cacheAssignGear)); +ISNILS(_loadoutArray,[ARR_2(_faction,_role)] call FUNC(cacheAssignGear)); _unit setUnitLoadout (configFile >> 'EmptyLoadout'); // Each index is tied to a specific type of item { - if (!isNil "_x" && {!(_x isEqualTo [])} && {!(_x isEqualTo "")}) then { + if (!isNil "_x" && {(_x isNotEqualTo [])} && {(_x isNotEqualTo "")}) then { switch _forEachIndex do { case 0: {}; // displayName case 1: { // uniform private _uniform = selectRandom _x; - if !(_uniform isEqualTo '') then { + if (_uniform isNotEqualTo '') then { _unit forceAddUniform _uniform; }; }; case 2: { // vest private _vest = selectRandom _x; - if !(_vest isEqualTo '') then { + if (_vest isNotEqualTo '') then { _unit addVest _vest; }; }; case 3: { // backpack private _backpack = selectRandom _x; - if !(_backpack isEqualTo '') then { + if (_backpack isNotEqualTo '') then { _unit addBackpack _backpack; }; }; case 4: { // headgear private _headgear = selectRandom _x; - if !(_headgear isEqualTo '') then { + if (_headgear isNotEqualTo '') then { _unit addHeadgear _headgear; }; }; @@ -70,7 +70,7 @@ _unit setUnitLoadout (configFile >> 'EmptyLoadout'); }; case 6: { // hmd private _hmd = selectRandom _x; - if !(_hmd isEqualTo '') then {_unit linkItem _hmd}; + if (_hmd isNotEqualTo '') then {_unit linkItem _hmd}; }; case 7: { // faces [_unit, _x] call FUNC(setFace); @@ -104,34 +104,34 @@ _unit setUnitLoadout (configFile >> 'EmptyLoadout'); }; case 13: { // primaryWeapon private _weapon = selectRandom _x; - if !(_weapon isEqualTo '') then {_unit addWeapon _weapon}; + if (_weapon isNotEqualTo '') then {_unit addWeapon _weapon}; }; case 14: { // scope private _scope = selectRandom _x; - if !(_scope isEqualTo '') then {_unit addPrimaryWeaponItem _scope}; + if (_scope isNotEqualTo '') then {_unit addPrimaryWeaponItem _scope}; }; case 15: { // bipod private _bipod = selectRandom _x; - if !(_bipod isEqualTo '') then {_unit addPrimaryWeaponItem _bipod}; + if (_bipod isNotEqualTo '') then {_unit addPrimaryWeaponItem _bipod}; }; case 16: { // attachment private _attachment = selectRandom _x; - if !(_attachment isEqualTo '') then {_unit addPrimaryWeaponItem _attachment}; + if (_attachment isNotEqualTo '') then {_unit addPrimaryWeaponItem _attachment}; }; case 17: { // silencer private _silencer = selectRandom _x; - if !(_silencer isEqualTo '') then {_unit addPrimaryWeaponItem _silencer}; + if (_silencer isNotEqualTo '') then {_unit addPrimaryWeaponItem _silencer}; }; case 18: { // secondaryWeapon private _weapon = selectRandom _x; - if !(_weapon isEqualTo '') then {_unit addWeapon _weapon}; + if (_weapon isNotEqualTo '') then {_unit addWeapon _weapon}; }; case 19: { // secondaryAttachments {_unit addSecondaryWeaponItem _x} forEach _x; }; case 20: { // sidearmweapon private _weapon = selectRandom _x; - if !(_weapon isEqualTo '') then {_unit addWeapon _weapon}; + if (_weapon isNotEqualTo '') then {_unit addWeapon _weapon}; }; case 21: { // sidearmattachments {_unit addHandgunItem _x} forEach _x; diff --git a/addons/assigngear/functions/fnc_cacheAssignGear.sqf b/addons/assigngear/functions/fnc_cacheAssignGear.sqf index 679660ec..6db28da8 100644 --- a/addons/assigngear/functions/fnc_cacheAssignGear.sqf +++ b/addons/assigngear/functions/fnc_cacheAssignGear.sqf @@ -25,7 +25,7 @@ private _cfg = if (isClass (missionConfigFile >> "CfgLoadouts" >> _faction >> _r {configFile} ]; -ASSERT_TRUE(isClass CFGROLE, format [ARR_3("Loadout not present: %1 %2", _faction, _role)]); +ASSERT_TRUE(isClass CFGROLE,format [ARR_3("Loadout not present: %1 %2",_faction,_role)]); private _loadout = format ["loadout_%1_%2", _faction, _role]; @@ -37,7 +37,7 @@ if (_cfg isEqualTo missionConfigFile) then { // Check if there is a hash storing already cached loadouts in the uiNamespace // If there isn't, create one. private _loadoutsHash = uiNamespace getVariable QGVAR(loadoutsHash); - ISNILS(_loadoutsHash, [ARR_2([],[])] call CBA_fnc_hashCreate); + ISNILS(_loadoutsHash,[ARR_2([],[])] call CBA_fnc_hashCreate); // Try to get the loadout from the hash private _hash = [_loadoutsHash, _loadout] call CBA_fnc_hashGet; diff --git a/addons/assigngear/functions/fnc_gui_gearSelector_loadFactions.sqf b/addons/assigngear/functions/fnc_gui_gearSelector_loadFactions.sqf index fd31314d..9baf2b13 100644 --- a/addons/assigngear/functions/fnc_gui_gearSelector_loadFactions.sqf +++ b/addons/assigngear/functions/fnc_gui_gearSelector_loadFactions.sqf @@ -17,9 +17,9 @@ switch (_category) do { }; // Sort alphabetically and hide duplicate configFile/missionConfigFile loadouts -MAP(_loadouts, [ARR_2(getText (_x >> "displayName"), toLower configName _x)]); +MAP(_loadouts,[ARR_2(getText (_x >> "displayName"),toLower configName _x)]); if !(_isMission) then { - FILTER(_loadouts, !isClass (missionConfigFile >> (_x # 1))); + FILTER(_loadouts,!isClass (missionConfigFile >> (_x # 1))); }; _loadouts = [_loadouts] call BIS_fnc_sortBy; diff --git a/addons/assigngear/functions/fnc_gui_gearSelector_random.sqf b/addons/assigngear/functions/fnc_gui_gearSelector_random.sqf index 6ed591c2..a309e47a 100644 --- a/addons/assigngear/functions/fnc_gui_gearSelector_random.sqf +++ b/addons/assigngear/functions/fnc_gui_gearSelector_random.sqf @@ -3,7 +3,7 @@ params ["_display"]; private _loadouts = ("true" configClasses (missionConfigFile >> "CfgLoadouts")) + ("true" configClasses (configFile >> "CfgLoadouts")); -MAP(_loadouts, toLower configName _x); +MAP(_loadouts,toLower configName _x); UNIQUE(_loadouts); [_display, selectRandom _loadouts] call FUNC(gui_gearSelector_loadCategories); diff --git a/addons/assigngear/functions/fnc_gui_vehicleGear_selector.sqf b/addons/assigngear/functions/fnc_gui_vehicleGear_selector.sqf index dcec42d3..adf07d5a 100644 --- a/addons/assigngear/functions/fnc_gui_vehicleGear_selector.sqf +++ b/addons/assigngear/functions/fnc_gui_vehicleGear_selector.sqf @@ -141,11 +141,11 @@ switch _mode do { ] call BIS_fnc_initListNBoxSorting; // Add -/+ evenhandlers - _addButton ctrlAddEventHandler ["buttonClick", { + _addButton ctrlAddEventHandler ["ButtonClick", { params ["_ctrlButton"]; [ctrlParentControlsGroup _ctrlButton, 'modifyRow', [1] ] call FUNC(gui_vehicleGear_selector); }]; - _subButton ctrlAddEventHandler ["buttonClick", { + _subButton ctrlAddEventHandler ["ButtonClick", { params ["_ctrlButton"]; [ctrlParentControlsGroup _ctrlButton, 'modifyRow', [-1] ] call FUNC(gui_vehicleGear_selector); }]; diff --git a/addons/assigngear/functions/fnc_initAIGear.sqf b/addons/assigngear/functions/fnc_initAIGear.sqf index 88f6e9d6..16ebbd1a 100644 --- a/addons/assigngear/functions/fnc_initAIGear.sqf +++ b/addons/assigngear/functions/fnc_initAIGear.sqf @@ -50,7 +50,7 @@ if (_hash isEqualTo []) then { // Fallback if no code defined if !(_hasCode) then { - _hash pushBack [_cfgName, {([_this] call BIS_fnc_objectType) select 1}]; + _hash pushBack ["code", {([_this] call BIS_fnc_objectType) select 1}]; }; // Fallback if no default defined if (_default isEqualTo []) then { diff --git a/addons/assigngear/functions/fnc_initNamespace.sqf b/addons/assigngear/functions/fnc_initNamespace.sqf index f4467b80..e22e2e90 100644 --- a/addons/assigngear/functions/fnc_initNamespace.sqf +++ b/addons/assigngear/functions/fnc_initNamespace.sqf @@ -16,6 +16,6 @@ if (!isNil QGVAR(namespace) && {!isNull GVAR(namespace)}) exitWith {GVAR(namespa GVAR(namespace) = false call CBA_fnc_createNamespace; -LOG_1("Initialized namespace", GVAR(namespace)); +LOG_1("Initialized namespace",GVAR(namespace)); GVAR(namespace) diff --git a/addons/assigngear/functions/fnc_linkItems.sqf b/addons/assigngear/functions/fnc_linkItems.sqf index 61fe3f9c..87c87a7e 100644 --- a/addons/assigngear/functions/fnc_linkItems.sqf +++ b/addons/assigngear/functions/fnc_linkItems.sqf @@ -21,4 +21,4 @@ if (isNil "_unit") exitWith {}; if !(isNil "_x") then { _unit addWeapon _x; }; -} forEach _items; \ No newline at end of file +} forEach _items; diff --git a/addons/assigngear/functions/fnc_loadAssignGear.sqf b/addons/assigngear/functions/fnc_loadAssignGear.sqf index 596f700a..fcbb716e 100644 --- a/addons/assigngear/functions/fnc_loadAssignGear.sqf +++ b/addons/assigngear/functions/fnc_loadAssignGear.sqf @@ -32,7 +32,7 @@ if (isNil "_cfg") then { ]; }; -ASSERT_TRUE(isClass CFGROLE, format [ARR_3("Loadout not present: %1 %2", _faction, _role)]); +ASSERT_TRUE(isClass CFGROLE,format [ARR_3("Loadout not present: %1 %2",_faction,_role)]); private _loadout = format ["loadout_%1_%2", _faction, _role]; private _loadoutArray = []; diff --git a/addons/assigngear/functions/fnc_onEdenMessageRecieved.sqf b/addons/assigngear/functions/fnc_onEdenMessageRecieved.sqf index 6b6902da..6f492c0d 100644 --- a/addons/assigngear/functions/fnc_onEdenMessageRecieved.sqf +++ b/addons/assigngear/functions/fnc_onEdenMessageRecieved.sqf @@ -22,7 +22,7 @@ if (_messageId isEqualTo 0) then { //Mission saved. if FILE_EXISTS("description.ext") then { // Check if description.ext has changed private _newdescription = preprocessFile "description.ext"; - if (!(_newdescription isEqualTo GVAR(descriptionExt))) then { + if ((_newdescription isNotEqualTo GVAR(descriptionExt))) then { // Clear namespace, and in turn all cached loadouts GVAR(namespace) call CBA_fnc_deleteNamespace; diff --git a/addons/assigngear/functions/fnc_overrideProfileItems.sqf b/addons/assigngear/functions/fnc_overrideProfileItems.sqf index 996b6f87..b32e7e08 100644 --- a/addons/assigngear/functions/fnc_overrideProfileItems.sqf +++ b/addons/assigngear/functions/fnc_overrideProfileItems.sqf @@ -15,15 +15,15 @@ private _cfg = configFile >> "CfgLoadouts" >> _faction >> (player getVariable [QGVAR(role), ""]); private _faces = getArray (_cfg >> "faces"); - if !(_faces isEqualTo []) then { + if (_faces isNotEqualTo []) then { [player, _faces] call FUNC(setFace); }; private _goggles = getArray (_cfg >> "goggles"); - if !(_goggles isEqualTo []) then { + if (_goggles isNotEqualTo []) then { [player, _goggles] call FUNC(setGoggles); } else { removeGoggles player; }; }, 1, 1] call CBA_fnc_waitAndExecute; -}] call CBA_fnc_addEventHandler; \ No newline at end of file +}] call CBA_fnc_addEventHandler; diff --git a/addons/assigngear/functions/fnc_replaceSidearmWeapon.sqf b/addons/assigngear/functions/fnc_replaceSidearmWeapon.sqf index a46ca93a..0764bc1a 100644 --- a/addons/assigngear/functions/fnc_replaceSidearmWeapon.sqf +++ b/addons/assigngear/functions/fnc_replaceSidearmWeapon.sqf @@ -24,7 +24,7 @@ private _weapon = selectRandom _weaponArray; // Exit if weapon was set to "default" if (_weapon isEqualTo "default") exitWith {}; -_currentWeapon = handgunWeapon _unit; +private _currentWeapon = handgunWeapon _unit; _unit removeWeapon _currentWeapon; if !(isNil "_weapon") then { @@ -34,4 +34,4 @@ if !(isNil "_weapon") then { if !(isNil "_x") then { _unit addHandgunItem _x; }; -} forEach _items; \ No newline at end of file +} forEach _items; diff --git a/addons/assigngear/functions/fnc_saveRole.sqf b/addons/assigngear/functions/fnc_saveRole.sqf index 69c94c94..f92603b7 100644 --- a/addons/assigngear/functions/fnc_saveRole.sqf +++ b/addons/assigngear/functions/fnc_saveRole.sqf @@ -2,8 +2,8 @@ // TODO, tidy up and add aresnal message, move button maybe? params ["_unit","_className"]; -_data = ""; -_nl = " +private _data = ""; +private _nl = " "; _data = _data + format ["class %1 {"+_nl,_className]; _data = _data + format [" displayName = %1;"+_nl,str "test"]; @@ -37,32 +37,32 @@ if(count primaryWeaponItems _unit > 0) then { if(secondaryWeapon _unit != "") then { _data = _data + format [" secondaryWeapon[] = {%1};"+_nl,str secondaryWeapon _unit]; }; -if(count secondaryWeaponItems _unit > 0) then { +if(secondaryWeaponItems _unit isNotEqualTo []) then { _data = _data + format [" secondaryAttachments[] = %1;"+_nl,[secondaryWeaponItems _unit] call CFUNC(arrayToStringArray)]; }; if(handgunWeapon _unit != "") then { _data = _data + format [" sidearmWeapon[] = {%1};"+_nl,str handgunWeapon _unit]; }; -if(count handgunItems _unit > 0) then { +if(handgunItems _unit isNotEqualTo []) then { _data = _data + format [" sidearmAttachments[] = %1;"+_nl,[handgunItems _unit] call CFUNC(arrayToStringArray)]; }; -_magazines = magazines _unit; -_items = (vestItems _unit + uniformItems _unit) - _magazines; -if(count _magazines > 0) then { +private _magazines = magazines _unit; +private _items = (vestItems _unit + uniformItems _unit) - _magazines; +if(_magazines isNotEqualTo []) then { _data = _data + format [" magazines[] = %1;"+_nl,[_magazines] call CFUNC(arrayToStringArray)]; }; -if(count _items > 0) then { +if(_items isNotEqualTo []) then { _data = _data + format [" items[] = %1;"+_nl,[_items] call CFUNC(arrayToStringArray)]; }; -if(count assignedItems _unit > 0) then { +if(assignedItems _unit isNotEqualTo []) then { _data = _data + format [" linkedItems[] = %1;"+_nl,[assignedItems _unit] call CFUNC(arrayToStringArray)]; }; _data = _data + "};"; copyToClipboard _data; -if(!isNull (uinamespace getvariable ["bis_fnc_arsenal_display",displayNull]) ) then { - ['showMessage',[(uinamespace getvariable ["bis_fnc_arsenal_display",displayNull]),localize "STR_a3_RscDisplayArsenal_message_clipboard"]] call (uinamespace getvariable "BIS_fnc_arsenal"); +if(!isNull (uiNamespace getVariable ["bis_fnc_arsenal_display",displayNull]) ) then { + ['showMessage',[(uiNamespace getVariable ["bis_fnc_arsenal_display",displayNull]),localize "STR_a3_RscDisplayArsenal_message_clipboard"]] call (uiNamespace getVariable "BIS_fnc_arsenal"); // ['showMessage',[_display,localize "STR_a3_RscDisplayArsenal_message_clipboard"]] call bis_fnc_arsenal; }; diff --git a/addons/assigngear/functions/fnc_setFace.sqf b/addons/assigngear/functions/fnc_setFace.sqf index e68901df..a8dd7c67 100644 --- a/addons/assigngear/functions/fnc_setFace.sqf +++ b/addons/assigngear/functions/fnc_setFace.sqf @@ -34,7 +34,7 @@ private _face = selectRandom _faces; if ((_face find "faceset:") isEqualTo 0) then { private _facesetName = _face select [8]; private _array = uiNamespace getVariable ["tmf_assignGear_faceset_" + _facesetName, []]; - if !(_array isEqualTo []) then { + if (_array isNotEqualTo []) then { _face = selectRandomWeighted _array; }; }; diff --git a/addons/assigngear/functions/fnc_setGoggles.sqf b/addons/assigngear/functions/fnc_setGoggles.sqf index da3fe7e9..eeba32e2 100644 --- a/addons/assigngear/functions/fnc_setGoggles.sqf +++ b/addons/assigngear/functions/fnc_setGoggles.sqf @@ -22,7 +22,7 @@ if (_curGoggles isEqualTo "") then { // Don't respect no-goggles profile in skip if ("default" in _goggles || _curGoggles in _goggles) exitWith {}; private _newGoggles = ""; -if !(_goggles isEqualTo []) then { +if (_goggles isNotEqualTo []) then { _newGoggles = selectRandom _goggles; }; @@ -30,4 +30,4 @@ if (_newGoggles isEqualTo "") then { removeGoggles _unit; } else { _unit addGoggles _newGoggles; -}; \ No newline at end of file +}; diff --git a/addons/assigngear/functions/fnc_testGear.sqf b/addons/assigngear/functions/fnc_testGear.sqf index 170bd34e..271db514 100644 --- a/addons/assigngear/functions/fnc_testGear.sqf +++ b/addons/assigngear/functions/fnc_testGear.sqf @@ -7,12 +7,13 @@ private _cfgWeapons = configFile >> "CfgWeapons"; private _cfgVehicles = configFile >> "CfgVehicles"; private _cfgGlasses = configFile >> "CfgGlasses"; private _cfgMagazines = configFile >> "CfgMagazines"; -private _warnWeight = getNumber (_test >> "maxWeight"); +private _warnWeight = getNumber (_test >> "maxWeight"); // _test is set by the autotest runner private _maxWeight = (getNumber (configFile >> "CfgInventoryGlobalVariable" >> "maxSoldierLoad")) * 0.95; // Add a bit of padding for radios private _maxWeightKG = ACE_MASSTOKG(_maxWeight); private _output = []; +#undef GETGEAR #define GETGEAR(var) [_config >> var] call CFUNC(getCfgEntryFromPath) private _fnc_checkExists = { @@ -21,7 +22,7 @@ private _fnc_checkExists = { { if ((_x != "") and (_x != "default")) then { if (!isClass (_config >> _x)) then { - _output pushBack [0,format["Missing classname: %1 (for: %2 - %3)", _x,_faction,_role]]; + _output pushBack [0,format["Loadout %2 > %3: %1 does not exist. Check the class name, or the mod that adds it is not loaded.", _x,_faction,_role]]; }; }; } forEach _subarray; @@ -33,7 +34,7 @@ private _fnc_checkExists_insignia = { { if ((_x != "") and (_x != "default")) then { if !(isClass (configFile >> "CfgUnitInsignia" >> _x) || {isClass (missionConfigFile >> "CfgUnitInsignia" >> _x)}) then { - _output pushBack [0,format["Missing insignia classname: %1 (for: %2 - %3)", _x,_faction,_role]]; + _output pushBack [0,format["Loadout %2 > %3: insignia %1 does not exist.", _x,_faction,_role]]; }; }; } forEach _insignias; @@ -74,11 +75,11 @@ private _fncTestUnit = { private _facesetName = _face select [8]; private _array = uiNamespace getVariable ["tmf_assignGear_faceset_" + _facesetName,0]; if (_array isEqualTo 0) then { - _output pushBack [0,format["Invalid faceset: %1 (for: %2 - %3)", _face,_faction,_role]]; + _output pushBack [0,format["Loadout %2 > %3: face set %1 does not exist.", _face,_faction,_role]]; }; } else { if (!(_face in _validFaces)) then { - _output pushBack [0,format["Invalid face classname: %1 (for: %2 - %3)", _face,_faction,_role]]; + _output pushBack [0,format["Loadout %2 > %3: face %1 does not exist.", _face,_faction,_role]]; }; }; } forEach _faces; @@ -155,10 +156,10 @@ private _fncTestUnit = { if (_mass <= _freeBackpackSpace) then { _freeBackpackSpace = _freeBackpackSpace - _mass; } else { - _output pushBack [0,format["'%1' won't fit in backpack (for: %2 - %3)", _x,_faction,_role]]; + _output pushBack [0,format["Loadout %2 > %3: %1 does not fit in the backpack.", _x,_faction,_role]]; }; } else { - _output pushBack [0,format["Missing classname: %1 (for: %2 - %3)", _x,_faction,_role]]; + _output pushBack [0,format["Loadout %2 > %3: %1 does not exist. Check the class name, or the mod that adds it is not loaded.", _x,_faction,_role]]; }; } forEach (GETGEAR("backpackItems")); @@ -196,12 +197,12 @@ private _fncTestUnit = { if (_mass <= _freeBackpackSpace) then { _freeBackpackSpace = _freeBackpackSpace - _mass; } else { - _output pushBack [0,format["'%1' won't fit (for: %2 - %3)", _x,_faction,_role]]; + _output pushBack [0,format["Loadout %2 > %3: %1 does not fit in the uniform, vest or backpack.", _x,_faction,_role]]; }; }; }; } else { - _output pushBack [0,format["Missing classname: %1 (for: %2 - %3)", _x,_faction,_role]]; + _output pushBack [0,format["Loadout %2 > %3: %1 does not exist. Check the class name, or the mod that adds it is not loaded.", _x,_faction,_role]]; }; } forEach _magsAndItems; @@ -210,23 +211,23 @@ private _fncTestUnit = { private _weaponMags = [_primaryWeapon select 0] call CBA_fnc_compatibleMagazines; _weaponMags = _weaponMags apply {toLower _x}; private _weaponMagCount = {_x in _weaponMags} count _mags; - if (_weaponMagCount < 3 && !(_weaponMags isEqualTo [])) then { - _output pushBack [1,format["Role: %1 - %2 has less than 3 compatible mags for primary weapon.",_faction,_role]]; + if (_weaponMagCount < 3 && (_weaponMags isNotEqualTo [])) then { + _output pushBack [1,format["Loadout %1 > %2: fewer than 3 magazines for the primary weapon.",_faction,_role]]; }; }; - if (count _sidearmWeapon > 0 && !(_weaponMags isEqualTo [])) then { + if (count _sidearmWeapon > 0) then { private _weaponMags = [_sidearmWeapon select 0] call CBA_fnc_compatibleMagazines; _weaponMags = _weaponMags apply {toLower _x}; private _weaponMagCount = {_x in _weaponMags} count _mags; - if (_weaponMagCount == 0) then { - _output pushBack [1,format["Role: %1 - %2 has no compatible mag for sidearm.",_faction,_role]]; + if (_weaponMagCount == 0 && (_weaponMags isNotEqualTo [])) then { + _output pushBack [1,format["Loadout %1 > %2: no magazines for the sidearm.",_faction,_role]]; }; }; _return = [_freeUniformSpace,_freeVestSpace,_freeBackpackSpace]; } else { - _output pushBack [0,format["Missing kit %1 - %2",_faction,_role]]; + _output pushBack [0,format["Loadout %1 > %2 does not exist, but a unit is set to use it.",_faction,_role]]; }; _return; }; @@ -252,10 +253,10 @@ private _loadoutFreespace = []; private _weight = loadAbs _unit; // ACE calculation if (_weight >= _maxWeight) then { - _output pushBack [0,format["Role weight above maximum, %1kg > %2 (for: %3 - %4)",ACE_MASSTOKG(_weight),_maxWeightKG,_faction,_role]]; + _output pushBack [0,format["Loadout %3 > %4 weighs %1 kg, more than the %2 kg a soldier can carry.",ACE_MASSTOKG(_weight),_maxWeightKG,_faction,_role]]; } else { if (ACE_MASSTOKG(_weight) >= _warnWeight) then { - _output pushBack [1,format["Heavy role %1kg (for: %2 - %3)",ACE_MASSTOKG(_weight),_faction,_role]]; + _output pushBack [1,format["Loadout %2 > %3 is heavy: %1 kg.",ACE_MASSTOKG(_weight),_faction,_role]]; }; }; @@ -269,7 +270,6 @@ private _loadoutFreespace = []; private _mass = -1; if (isClass (_cfgMagazines >> _x)) then { _mass = getNumber (_cfgMagazines >> _x >> "mass"); - _mags pushBack (toLower _x); }; if (isClass (_cfgWeapons >> _x)) then { _mass = getNumber (_CfgWeapons >> _x >> "ItemInfo" >> "mass"); @@ -287,17 +287,17 @@ private _loadoutFreespace = []; if (_mass <= _freeBackpackSpace) then { _freeBackpackSpace = _freeBackpackSpace - _mass; } else { - _output pushBack [0,format["'%1'(%4) radio won't fit for: %2 (%3)", _x,_unit,group _unit, _role]]; + _output pushBack [0,format["Radio %1 does not fit in the inventory of %2 (group %3, loadout %4).", _x,_unit,group _unit, _role]]; }; }; }; } else { - _output pushBack [0,format["Missing radio classname: %1 (for: %2)", _x,_unit]]; + _output pushBack [0,format["Radio %1 given to %2 does not exist.", _x,_unit]]; }; } forEach _radios; }; } forEach allUnits; -_output pushBack [-1,"AssignGear checks complete."]; +_output pushBack [-1,"AssignGear loadout check done"]; _output; diff --git a/addons/assigngear/loadouts/civ_f.hpp b/addons/assigngear/loadouts/civ_f.hpp index 353fbecd..bacdd098 100644 --- a/addons/assigngear/loadouts/civ_f.hpp +++ b/addons/assigngear/loadouts/civ_f.hpp @@ -44,4 +44,4 @@ class baseMan {// Weaponless baseclass // This is executed after unit init is complete. argument: _this = _unit. code = ""; -}; \ No newline at end of file +}; diff --git a/addons/assigngear/loadouts/fia_f.hpp b/addons/assigngear/loadouts/fia_f.hpp index 53065ed8..027b275e 100644 --- a/addons/assigngear/loadouts/fia_f.hpp +++ b/addons/assigngear/loadouts/fia_f.hpp @@ -484,4 +484,4 @@ class engm : car displayName = "UAV Operator"; backpack[] = {"I_UAV_01_backpack_F"}; linkedItems[] += {"I_UavTerminal"}; -};*/ \ No newline at end of file +};*/ diff --git a/addons/assigngear/loadouts/macros.inc b/addons/assigngear/loadouts/macros.inc index 20dc6f68..c1650bae 100644 --- a/addons/assigngear/loadouts/macros.inc +++ b/addons/assigngear/loadouts/macros.inc @@ -1,20 +1,58 @@ #define LIST_1(var1) var1 +#ifndef LIST_2 #define LIST_2(var1) var1,var1 +#endif +#ifndef LIST_3 #define LIST_3(var1) var1,var1,var1 +#endif +#ifndef LIST_4 #define LIST_4(var1) var1,var1,var1,var1 +#endif +#ifndef LIST_5 #define LIST_5(var1) var1,var1,var1,var1,var1 +#endif +#ifndef LIST_6 #define LIST_6(var1) var1,var1,var1,var1,var1,var1 +#endif +#ifndef LIST_7 #define LIST_7(var1) var1,var1,var1,var1,var1,var1,var1 +#endif +#ifndef LIST_8 #define LIST_8(var1) var1,var1,var1,var1,var1,var1,var1,var1 +#endif +#ifndef LIST_9 #define LIST_9(var1) var1,var1,var1,var1,var1,var1,var1,var1,var1 +#endif +#ifndef LIST_10 #define LIST_10(var1) var1,var1,var1,var1,var1,var1,var1,var1,var1,var1 +#endif +#ifndef LIST_11 #define LIST_11(var1) var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1 +#endif +#ifndef LIST_12 #define LIST_12(var1) var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1 +#endif +#ifndef LIST_13 #define LIST_13(var1) var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1 +#endif +#ifndef LIST_14 #define LIST_14(var1) var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1 +#endif +#ifndef LIST_15 #define LIST_15(var1) var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1 +#endif +#ifndef LIST_16 #define LIST_16(var1) var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1 +#endif +#ifndef LIST_17 #define LIST_17(var1) var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1 +#endif +#ifndef LIST_18 #define LIST_18(var1) var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1 +#endif +#ifndef LIST_19 #define LIST_19(var1) var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1 +#endif +#ifndef LIST_20 #define LIST_20(var1) var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1 +#endif diff --git a/addons/assigngear/script_component.hpp b/addons/assigngear/script_component.hpp index e6c8d526..60e5e927 100644 --- a/addons/assigngear/script_component.hpp +++ b/addons/assigngear/script_component.hpp @@ -1,3 +1,6 @@ +#ifndef TMF_ASSIGNGEAR_SCRIPT_COMPONENT_HPP +#define TMF_ASSIGNGEAR_SCRIPT_COMPONENT_HPP + #define COMPONENT assignGear #include "\x\tmf\addons\main\script_mod.hpp" @@ -73,3 +76,5 @@ #define LIST_20(var1) var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1,var1 #define DEF_LOADOUTS ["baseMan","r","g","car","m","smg","ftl","sl","co","fac","ar","aar","rat","dm","mmgg","mmgac","mmgag","hmgg","hmgac","matg","matac","matag","hatg","hatac","hatag","mtrg","mtrac","mtrag","samg","samag","sn","sp","vc","vd","vg","pp","pcc","pc","eng","engm","UAV","jp"] + +#endif // TMF_ASSIGNGEAR_SCRIPT_COMPONENT_HPP diff --git a/addons/autotest/Cfg3DEN.hpp b/addons/autotest/Cfg3DEN.hpp index 69b4921d..50d15e4b 100644 --- a/addons/autotest/Cfg3DEN.hpp +++ b/addons/autotest/Cfg3DEN.hpp @@ -3,19 +3,14 @@ #include "\a3\3DEN\UI\resincl.inc" -class ctrlDefault; -class ctrlDefaultText;// : ctrlDefault; class ctrlStatic;// : ctrlDefaultText; class ctrlListNBox;// : ctrlDefaultText; -class ctrlTree;// : ctrlDefaultText; class ctrlEdit;// : ctrlDefaultText; -class RscButtonMenu; -class RscText; class RscPicture; /* -class cfgScriptPaths +class CfgScriptPaths { TMF_briefing = "x\tmf\addons\briefing\ui_scripts\"; }; @@ -114,15 +109,7 @@ class Cfg3DEN }; class GVAR(missionName) : Title { - attributeLoad = QUOTE( \ - _value = 'Scenario' get3DENMissionAttribute 'IntelBriefingName'; \ - (_this controlsGroupCtrl 100) ctrlSetText _value; \ - if (_value == '') then { \ - (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOEF(briefing,UI\plus_small_ca.paa)'; \ - } else { \ - (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOEF(briefing,UI\check_small_ca.paa)'; \ - }; \ - ); + attributeLoad = QUOTE(_value = 'Scenario' get3DENMissionAttribute 'IntelBriefingName'; (_this controlsGroupCtrl 100) ctrlSetText _value; if (_value == '') then { (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOEF(briefing,UI\plus_small_ca.paa)'; } else { (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOEF(briefing,UI\check_small_ca.paa)'; };); attributeSave = "true"; class Controls : Controls { @@ -139,10 +126,10 @@ class Cfg3DEN colorSelection[] = {COLOR_ACTIVE_RGBA}; // Text selection color canModify = 0; // True (1) to allow text editing, 0 to disable it autocomplete = ""; // Text autocomplete, can be "scripting" (scripting commands) or "general" (previously typed text) - y = 0 * SIZE_M * GRID_H; - x = ATTRIBUTE_TITLE_W * GRID_W; - h = SIZE_M * GRID_H; - w = (ATTRIBUTE_CONTENT_W -(1.5* SIZE_M)) * GRID_W; + y = QUOTE(0 * SIZE_M * GRID_H); + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + h = QUOTE(SIZE_M * GRID_H); + w = QUOTE((ATTRIBUTE_CONTENT_W -(1.5* SIZE_M)) * GRID_W); }; class Picture : RscPicture @@ -150,27 +137,15 @@ class Cfg3DEN text = QPATHTOEF(briefing,UI\check_small_ca.paa); // Default idc = 101; y = 0; - h = SIZE_M * GRID_H; - x = (ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - (1.5*SIZE_M)) * GRID_W; - w = 1.25*SIZE_M * GRID_W; + h = QUOTE(SIZE_M * GRID_H); + x = QUOTE((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - (1.5*SIZE_M)) * GRID_W); + w = QUOTE(1.25*SIZE_M * GRID_W); }; }; }; class GVAR(missionSummary) : Title { - attributeLoad = QUOTE( \ - _value = 'Multiplayer' get3DENMissionAttribute 'IntelOverviewText'; \ - (_this controlsGroupCtrl 100) ctrlSetText _value; \ - if (_value == '' || _value == '*** Insert mission description here. ***') then { \ - (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOEF(briefing,UI\plus_small_ca.paa)'; \ - } else { \ - if (((toLower _value) find 'slot') == -1) then { \ - (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOF(UI\warning.paa)'; \ - } else { \ - (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOEF(briefing,UI\check_small_ca.paa)'; \ - }; \ - }; \ - ); + attributeLoad = QUOTE(_value = 'Multiplayer' get3DENMissionAttribute 'IntelOverviewText'; (_this controlsGroupCtrl 100) ctrlSetText _value; if (_value == '' || _value == '*** Insert mission description here. ***') then { (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOEF(briefing,UI\plus_small_ca.paa)'; } else { if (((toLower _value) find 'slot') == -1) then { (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOF(UI\warning.paa)'; } else { (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOEF(briefing,UI\check_small_ca.paa)'; }; };); attributeSave = "true"; class Controls : Controls { @@ -187,10 +162,10 @@ class Cfg3DEN colorSelection[] = {COLOR_ACTIVE_RGBA}; // Text selection color canModify = 0; // True (1) to allow text editing, 0 to disable it autocomplete = ""; // Text autocomplete, can be "scripting" (scripting commands) or "general" (previously typed text) - y = 0 * SIZE_M * GRID_H; - x = ATTRIBUTE_TITLE_W * GRID_W; - h = SIZE_M * GRID_H; - w = (ATTRIBUTE_CONTENT_W -(1.5* SIZE_M)) * GRID_W; + y = QUOTE(0 * SIZE_M * GRID_H); + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + h = QUOTE(SIZE_M * GRID_H); + w = QUOTE((ATTRIBUTE_CONTENT_W -(1.5* SIZE_M)) * GRID_W); }; class Picture : RscPicture @@ -198,23 +173,15 @@ class Cfg3DEN text = QPATHTOEF(briefing,UI\check_small_ca.paa); // Default idc = 101; y = 0; - h = SIZE_M * GRID_H; - x = (ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - (1.5*SIZE_M)) * GRID_W; - w = 1.25*SIZE_M * GRID_W; + h = QUOTE(SIZE_M * GRID_H); + x = QUOTE((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - (1.5*SIZE_M)) * GRID_W); + w = QUOTE(1.25*SIZE_M * GRID_W); }; }; }; class GVAR(Author) : Title { - attributeLoad = QUOTE( \ - _value = 'Scenario' get3DENMissionAttribute 'Author'; \ - (_this controlsGroupCtrl 100) ctrlSetText _value; \ - if ((_value find profileName) == -1) then { \ - (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOEF(briefing,UI\plus_small_ca.paa)'; \ - } else { \ - (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOEF(briefing,UI\check_small_ca.paa)'; \ - }; \ - ); + attributeLoad = QUOTE(_value = 'Scenario' get3DENMissionAttribute 'Author'; (_this controlsGroupCtrl 100) ctrlSetText _value; if ((_value find profileName) == -1) then { (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOEF(briefing,UI\plus_small_ca.paa)'; } else { (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOEF(briefing,UI\check_small_ca.paa)'; };); attributeSave = "true"; class Controls : Controls { @@ -231,35 +198,25 @@ class Cfg3DEN colorSelection[] = {COLOR_ACTIVE_RGBA}; // Text selection color canModify = 0; // True (1) to allow text editing, 0 to disable it autocomplete = ""; // Text autocomplete, can be "scripting" (scripting commands) or "general" (previously typed text) - y = 0 * SIZE_M * GRID_H; - x = ATTRIBUTE_TITLE_W * GRID_W; - h = SIZE_M * GRID_H; - w = (ATTRIBUTE_CONTENT_W -(1.5* SIZE_M)) * GRID_W; + y = QUOTE(0 * SIZE_M * GRID_H); + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + h = QUOTE(SIZE_M * GRID_H); + w = QUOTE((ATTRIBUTE_CONTENT_W -(1.5* SIZE_M)) * GRID_W); }; class Picture : RscPicture { text = QPATHTOEF(briefing,UI\check_small_ca.paa); // Default idc = 101; - x = (ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - (1.5*SIZE_M)) * GRID_W; - w = 1.25*SIZE_M * GRID_W; - h = SIZE_M * GRID_H; + x = QUOTE((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - (1.5*SIZE_M)) * GRID_W); + w = QUOTE(1.25*SIZE_M * GRID_W); + h = QUOTE(SIZE_M * GRID_H); y = 0; }; }; }; class GVAR(minPlayer) : Title { - attributeLoad = QUOTE( \ - _value = 'Multiplayer' get3DENMissionAttribute 'minplayers'; \ - _playerCount = (playableUnits + switchableUnits + [player]) - [objNull]; \ - _playerCount = count (_playerCount arrayIntersect _playerCount); \ - (_this controlsGroupCtrl 100) ctrlSetText (str _value); \ - if (_value > 0 && _value <= _playerCount) then { \ - (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOEF(briefing,UI\check_small_ca.paa)'; \ - } else { \ - (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOEF(briefing,UI\plus_small_ca.paa)'; \ - }; \ - ); + attributeLoad = QUOTE(_value = 'Multiplayer' get3DENMissionAttribute 'minplayers'; _playerCount = (playableUnits + switchableUnits + [player]) - [objNull]; _playerCount = count (_playerCount arrayIntersect _playerCount); (_this controlsGroupCtrl 100) ctrlSetText (str _value); if (_value > 0 && _value <= _playerCount) then { (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOEF(briefing,UI\check_small_ca.paa)'; } else { (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOEF(briefing,UI\plus_small_ca.paa)'; };); attributeSave = "true"; class Controls : Controls { @@ -276,36 +233,25 @@ class Cfg3DEN colorSelection[] = {COLOR_ACTIVE_RGBA}; // Text selection color canModify = 0; // True (1) to allow text editing, 0 to disable it autocomplete = ""; // Text autocomplete, can be "scripting" (scripting commands) or "general" (previously typed text) - y = 0 * SIZE_M * GRID_H; - x = ATTRIBUTE_TITLE_W * GRID_W; - h = SIZE_M * GRID_H; - w = (ATTRIBUTE_CONTENT_W -(1.5* SIZE_M)) * GRID_W; + y = QUOTE(0 * SIZE_M * GRID_H); + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + h = QUOTE(SIZE_M * GRID_H); + w = QUOTE((ATTRIBUTE_CONTENT_W -(1.5* SIZE_M)) * GRID_W); }; class Picture : RscPicture { text = QPATHTOEF(briefing,UI\check_small_ca.paa); // Default idc = 101; - x = (ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - (1.5*SIZE_M)) * GRID_W; - w = 1.25*SIZE_M * GRID_W; - h = SIZE_M * GRID_H; + x = QUOTE((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - (1.5*SIZE_M)) * GRID_W); + w = QUOTE(1.25*SIZE_M * GRID_W); + h = QUOTE(SIZE_M * GRID_H); y = 0; }; }; }; class GVAR(maxPlayer) : Title { - attributeLoad = QUOTE( \ - _value = 'Multiplayer' get3DENMissionAttribute 'maxplayers'; \ - _playerCount = (playableUnits + switchableUnits + [player]) - [objNull]; \ - _playerCount = count (_playerCount arrayIntersect _playerCount); \ - (_this controlsGroupCtrl 100) ctrlSetText (str _value); \ - if (_value != _playerCount || _value == 0) then { \ - (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOEF(briefing,UI\plus_small_ca.paa)'; \ - (_this controlsGroupCtrl 100) ctrlSetText ((str _value) + ' should be: ' + (str _playerCount)); \ - } else { \ - (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOEF(briefing,UI\check_small_ca.paa)'; \ - }; \ - ); + attributeLoad = QUOTE(_value = 'Multiplayer' get3DENMissionAttribute 'maxplayers'; _playerCount = (playableUnits + switchableUnits + [player]) - [objNull]; _playerCount = count (_playerCount arrayIntersect _playerCount); (_this controlsGroupCtrl 100) ctrlSetText (str _value); if (_value != _playerCount || _value == 0) then { (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOEF(briefing,UI\plus_small_ca.paa)'; (_this controlsGroupCtrl 100) ctrlSetText ((str _value) + ' should be: ' + (str _playerCount)); } else { (_this controlsGroupCtrl 101) ctrlSetText 'PATHTOEF(briefing,UI\check_small_ca.paa)'; };); attributeSave = "true"; class Controls : Controls { @@ -322,18 +268,18 @@ class Cfg3DEN colorSelection[] = {COLOR_ACTIVE_RGBA}; // Text selection color canModify = 0; // True (1) to allow text editing, 0 to disable it autocomplete = ""; // Text autocomplete, can be "scripting" (scripting commands) or "general" (previously typed text) - y = 0 * SIZE_M * GRID_H; - x = ATTRIBUTE_TITLE_W * GRID_W; - h = SIZE_M * GRID_H; - w = (ATTRIBUTE_CONTENT_W -(1.5* SIZE_M)) * GRID_W; + y = QUOTE(0 * SIZE_M * GRID_H); + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + h = QUOTE(SIZE_M * GRID_H); + w = QUOTE((ATTRIBUTE_CONTENT_W -(1.5* SIZE_M)) * GRID_W); }; class Picture : RscPicture { text = QPATHTOEF(briefing,UI\check_small_ca.paa); // Default idc = 101; - x = (ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - (1.5*SIZE_M)) * GRID_W; - w = 1.25*SIZE_M * GRID_W; - h = SIZE_M * GRID_H; + x = QUOTE((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - (1.5*SIZE_M)) * GRID_W); + w = QUOTE(1.25*SIZE_M * GRID_W); + h = QUOTE(SIZE_M * GRID_H); y = 0; }; }; @@ -345,17 +291,17 @@ class Cfg3DEN attributeLoad = QUOTE(_this call FUNC(autotest)); attributeSave = "true"; - w = (ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W) * GRID_W; - h = 24 * SIZE_M * GRID_H; + w = QUOTE((ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W) * GRID_W); + h = QUOTE(24 * SIZE_M * GRID_H); class Controls { class ActionTitle : ctrlStatic { text = "List of findings:"; style = ST_RIGHT; - w = ATTRIBUTE_TITLE_W * GRID_W; + w = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); x = 0; - h = 1 * SIZE_M * GRID_H; + h = QUOTE(1 * SIZE_M * GRID_H); y = 0; colorBackground[] = {0,0,0,0}; tooltip = ""; @@ -363,19 +309,19 @@ class Cfg3DEN class ActionListBackground : ctrlStatic { idc = -1; - x = SIZE_M * GRID_H; - y = 1 * SIZE_M * GRID_H; - w = ((ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W) - (2*SIZE_M)) * GRID_W; //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; - h = 23 * SIZE_M * GRID_H; + x = QUOTE(SIZE_M * GRID_H); + y = QUOTE(1 * SIZE_M * GRID_H); + w = QUOTE(((ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W) - (2*SIZE_M)) * GRID_W); //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; + h = QUOTE(23 * SIZE_M * GRID_H); colorBackground[] = {0.33,0.33,0.33,1}; }; class ActionList: ctrlListNBox { idc = 101; - x = SIZE_M * GRID_H; - y = 1 * SIZE_M * GRID_H; - w = ((ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W) - (2*SIZE_M) ) * GRID_W; //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; - h = 23 * SIZE_M * GRID_H; + x = QUOTE(SIZE_M * GRID_H); + y = QUOTE(1 * SIZE_M * GRID_H); + w = QUOTE(((ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W) - (2*SIZE_M) ) * GRID_W); //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; + h = QUOTE(23 * SIZE_M * GRID_H); drawSideArrows = 0;//1; idcLeft = -1; idcRight = -1; diff --git a/addons/autotest/addon.toml b/addons/autotest/addon.toml deleted file mode 100644 index 1bc9698a..00000000 --- a/addons/autotest/addon.toml +++ /dev/null @@ -1,5 +0,0 @@ -[rapify] -enabled = false # Default: true -exclude = [ - "Cfg3DEN.hpp" -] \ No newline at end of file diff --git a/addons/autotest/config.cpp b/addons/autotest/config.cpp index e677a16b..ff686624 100644 --- a/addons/autotest/config.cpp +++ b/addons/autotest/config.cpp @@ -1,6 +1,6 @@ #include "script_component.hpp" -class cfgPatches +class CfgPatches { class ADDON { diff --git a/addons/autotest/display3DEN.hpp b/addons/autotest/display3DEN.hpp index 24eea9d0..f853ccd5 100644 --- a/addons/autotest/display3DEN.hpp +++ b/addons/autotest/display3DEN.hpp @@ -1,5 +1,5 @@ class ctrlMenuStrip; -class display3DEN +class Display3DEN { class Controls { @@ -8,7 +8,7 @@ class display3DEN class Items { class GVARMAIN(Folder) { - items[] += {ADDON}; + items[] += {QUOTE(ADDON)}; }; class ADDON { diff --git a/addons/autotest/functions/fnc_autotest.sqf b/addons/autotest/functions/fnc_autotest.sqf index ad0f95f0..241aacd5 100644 --- a/addons/autotest/functions/fnc_autotest.sqf +++ b/addons/autotest/functions/fnc_autotest.sqf @@ -10,22 +10,23 @@ private _output = []; private _test = _x; LOG_1("Running test: %1",configName _x); private _code = getText (_test >> "code"); + // Tests read their settings from _test, which stays visible to the called code private _outputTest = call compile _code; if (_outputTest isEqualType []) then { - if (GVAR(outputToRPT) && {_output isNotEqualTo []}) then { + if (GVAR(outputToRPT) && {_outputTest isNotEqualTo []}) then { INFO(str _outputTest); }; _output append _outputTest; TRACE_2("Appending to output",_output,_outputTest); }; -} forEach ("true" configClasses (configFile >> 'ADDON')); +} forEach ("true" configClasses (configFile >> QUOTE(ADDON))); // Display them on the auto-test UI page in Eden. { _x params ["_type","_message"]; - _lnbAdd = _ctrlListbox lnbAddRow ["",_message]; + private _lnbAdd = _ctrlListbox lnbAddRow ["",_message]; if (_type == 0) then { // Cross _ctrlListbox lnbSetPicture [[_lnbAdd,0],QPATHTOEF(briefing,UI\plus_small_ca.paa)]; diff --git a/addons/autotest/functions/fnc_testAI.sqf b/addons/autotest/functions/fnc_testAI.sqf index 1f3867e5..7cef347a 100644 --- a/addons/autotest/functions/fnc_testAI.sqf +++ b/addons/autotest/functions/fnc_testAI.sqf @@ -10,9 +10,9 @@ private _aiCount = {!(_x in _array)} count allUnits; if (_aiCount > _warningAmount) then { if (_aiCount > _errorAmount) then { - _output pushBack [0,format["You have placed %1 AI. You may wish to consider the performance impact.",_aiCount]]; + _output pushBack [0,format["%1 AI units are placed in the editor. That many can slow the server; spawn some later or use headless clients.",_aiCount]]; } else { - _output pushBack [1,format["You have placed %1 AI. You may wish to consider the performance impact.",_aiCount]]; + _output pushBack [1,format["%1 AI units are placed in the editor. That many can slow the server; spawn some later or use headless clients.",_aiCount]]; }; }; diff --git a/addons/autotest/functions/fnc_testDLC.sqf b/addons/autotest/functions/fnc_testDLC.sqf index 95d3de10..5948934c 100644 --- a/addons/autotest/functions/fnc_testDLC.sqf +++ b/addons/autotest/functions/fnc_testDLC.sqf @@ -45,24 +45,24 @@ private _problemUnits = []; private _roleDescription = (_unit get3DENAttribute "description") select 0; _dlcArr = _dlcArr select { - !([_x, _roleDescription] call BIS_fnc_inString) && // DLC usage mentioned in role description - !([_x, _missionSummary] call BIS_fnc_inString) // DLC usage mentioned in mission summary + !(toLower _x in toLower _roleDescription) && // DLC usage mentioned in role description + !(toLower _x in toLower _missionSummary) // DLC usage mentioned in mission summary }; - if !(_dlcArr isEqualTo []) then { + if (_dlcArr isNotEqualTo []) then { TRACE_2("Unit has unlisted DLC",_unit,_dlcArr); _problemUnits pushBack [_unit,_dlcArr]; }; -} forEach (_unitsDLCInfo select {!(_x # 1 isEqualTo [])}); +} forEach (_unitsDLCInfo select {(_x # 1 isNotEqualTo [])}); -if !(_problemUnits isEqualTo []) then { +if (_problemUnits isNotEqualTo []) then { // Avoid cluttering autotest too much if (count _problemUnits > 5) then { _problemUnits = _problemUnits select [0,5]; - _warnings pushBack [0,"More than five playable units require notices for DLC:"]; + _warnings pushBack [0,"More than 5 playable slots use DLC gear (first 5 shown). Name the DLC in each role description or in the mission overview:"]; } else { - _warnings pushBack [1,"One or more playable units require notices for DLC:"]; + _warnings pushBack [1,"These playable slots use DLC gear. Name the DLC in their role description or in the mission overview:"]; }; { @@ -75,7 +75,7 @@ if !(_problemUnits isEqualTo []) then { _warnings pushBack [ 1, - format ["| %1%2 : %3", _unit, _roleStr, _dlc] + format [" %1%2 needs %3", _unit, _roleStr, _dlc] ]; } forEach _problemUnits; }; @@ -100,7 +100,7 @@ private _problemVehs = []; if !(_dlc in _ignoredDLC) then { _dlc = [_dlcHash, _dlc] call CBA_fnc_hashGet; - private _index = _searchTexts findIf {[_dlc,_x] call BIS_fnc_inString}; + private _index = _searchTexts findIf {toLower _dlc in toLower _x}; if (_index == -1) then { TRACE_2("Vehicle found using unlisted DLC",_veh,_dlc); @@ -109,21 +109,21 @@ private _problemVehs = []; }; } forEach (_vehicleDLCInfo select {!isNil {(_x # 1)}}); -if !(_problemVehs isEqualTo []) then { +if (_problemVehs isNotEqualTo []) then { // Avoid cluttering autotest too much if (count _problemVehs > 5) then { _problemVehs = _problemVehs select [0,5]; - _warnings pushBack [0,"More than five unlocked vehicles require DLC notices:"]; + _warnings pushBack [0,"More than 5 usable vehicles are DLC content (first 5 shown). Name the DLC in a role description or the mission overview, or lock the vehicles:"]; } else { - _warnings pushBack [1,"One or more unlocked vehicles require DLC notices:"]; + _warnings pushBack [1,"These usable vehicles are DLC content. Name the DLC in a role description or the mission overview, or lock them:"]; }; { _x params ["_veh","_dlc"]; _warnings pushBack [ 1, - format ["| %1 (%2) : '%3'", _veh, (configFile >> "CfgVehicles">> typeOf _veh) call BIS_fnc_displayName, _dlc] + format [" %1 (%2) needs %3", _veh, (configOf _veh) call BIS_fnc_displayName, _dlc] ]; } forEach _problemVehs; }; @@ -134,6 +134,6 @@ _warnings pushBack [ ]; -LOG_1("Finished DLC Tests: %1", _warnings); +LOG_1("Finished DLC Tests: %1",_warnings); _warnings diff --git a/addons/autotest/functions/fnc_testEndings.sqf b/addons/autotest/functions/fnc_testEndings.sqf index 8d4885de..4d86c5b4 100644 --- a/addons/autotest/functions/fnc_testEndings.sqf +++ b/addons/autotest/functions/fnc_testEndings.sqf @@ -4,7 +4,7 @@ private _output = []; // Check if endings are set. if (isClass (missionConfigFile >> "CfgDebriefing" >> "CustomEnding1")) then { - _output pushBack [1,"CustomEnding1 is still present. Mission endings are probably not configured."]; + _output pushBack [1,"The template ending CustomEnding1 is still in description.ext. Replace the CfgDebriefing endings with your own."]; }; _output diff --git a/addons/autotest/functions/fnc_testGroups.sqf b/addons/autotest/functions/fnc_testGroups.sqf index d0d4163d..6c969a03 100644 --- a/addons/autotest/functions/fnc_testGroups.sqf +++ b/addons/autotest/functions/fnc_testGroups.sqf @@ -4,9 +4,9 @@ private _output = []; //Group count check. { private _side = _x; - private _groupCount = {(side _x isEqualTo _side)} count allGroups; + private _groupCount = _side countSide allGroups; if (_groupCount > 200) then { - _output pushBack [1,format["Side %1 has %2 groups. Note Arma has a 288 group limit per side.",_side,_groupCount]]; + _output pushBack [1,format["Side %1 has %2 groups. Arma allows at most 288 groups per side; new groups fail to spawn past that.",_side,_groupCount]]; } } forEach [west,east,civilian,resistance]; diff --git a/addons/autotest/functions/fnc_testHCs.sqf b/addons/autotest/functions/fnc_testHCs.sqf index e17c01ad..2b8b0dec 100644 --- a/addons/autotest/functions/fnc_testHCs.sqf +++ b/addons/autotest/functions/fnc_testHCs.sqf @@ -19,13 +19,13 @@ private _HCs = (all3DENEntities # 3) select {_x isKindOf "HeadlessClient_F"}; // Check presence if (count _HCs < _targetHCs) then { - _warnings pushBack [1,format ["Less than %1 Headless Clients present",_targetHCs]]; + _warnings pushBack [1,format ["Fewer than %1 headless clients are placed. Add headless client entities in the editor.",_targetHCs]]; }; // Check if setup correctly { - if !(_x get3DENAttribute "ControlMP" isEqualTo [true]) then { - _warnings pushBack [0,format ["Headless Client %1 is not marked as playable.",_x]]; + if (_x get3DENAttribute "ControlMP" isNotEqualTo [true]) then { + _warnings pushBack [0,format ["Headless client %1 is not playable, so it cannot connect. Tick Playable in its attributes.",_x]]; }; } forEach _HCs; diff --git a/addons/autotest/functions/fnc_testInit.sqf b/addons/autotest/functions/fnc_testInit.sqf index 96b17e33..bd937c62 100644 --- a/addons/autotest/functions/fnc_testInit.sqf +++ b/addons/autotest/functions/fnc_testInit.sqf @@ -27,7 +27,7 @@ private _output = []; case (_count < 150): { // check _isServer if ((!_isServer) && (!_isLocal)) then { - _output pushBack [1,format["Unit %1 has large init field contents (%2) but no isServer or local check!",_x,_count]]; + _output pushBack [1,format["%1 has a large init field (%2 characters) that runs on every machine. Wrap it in an isServer or local check.",_x,_count]]; }; }; // >= 150 @@ -35,20 +35,20 @@ private _output = []; // check _VA if _VA then { if (_isServer or _isLocal) then { - _output pushBack [1,format["Virtual Arsenal code detected in init field of %1!",_x]]; + _output pushBack [1,format["%1 adds a Virtual Arsenal in its init field.",_x]]; } else { - _output pushBack [0,format["Virtual Arsenal code detected in init field of %1, but no isServer or local check!",_x]]; + _output pushBack [0,format["%1 adds a Virtual Arsenal in its init field on every machine. Wrap it in an isServer or local check.",_x]]; }; } else { // Check _isServer if ((!_isServer) && (!_isLocal)) then { - _output pushBack [1,format["Unit %1 has very large init field contents (%2) but no isServer or local check!",_x,_count]]; + _output pushBack [1,format["%1 has a very large init field (%2 characters) that runs on every machine. Wrap it in an isServer or local check.",_x,_count]]; }; }; }; }; } forEach (all3DENEntities select 0); -_output pushBack [-1,format["Init box checks complete, %1 issues detected",count _output]]; +_output pushBack [-1,format["Init field check done, %1 issues found",count _output]]; _output diff --git a/addons/autotest/initSettings.sqf b/addons/autotest/initSettings.sqf index 0be86dc7..082c2940 100644 --- a/addons/autotest/initSettings.sqf +++ b/addons/autotest/initSettings.sqf @@ -2,7 +2,7 @@ [ QGVAR(outputToRPT), "CHECKBOX", - ["Output Autotest Results to RPT","Logs all autotest results to the RPT file/"], + ["Write autotest results to RPT", "Also writes every autotest result to the RPT log file, not just the Eden autotest window."], ["TMF", "Autotest"], false ] call CBA_fnc_addSetting; diff --git a/addons/autotest/script_component.hpp b/addons/autotest/script_component.hpp index cd6da24c..e4fd8edb 100644 --- a/addons/autotest/script_component.hpp +++ b/addons/autotest/script_component.hpp @@ -1,4 +1,9 @@ +#ifndef TMF_AUTOTEST_SCRIPT_COMPONENT_HPP +#define TMF_AUTOTEST_SCRIPT_COMPONENT_HPP + #define COMPONENT autotest #include "\x\tmf\addons\main\script_mod.hpp" #include "\x\tmf\addons\main\script_macros.hpp" + +#endif // TMF_AUTOTEST_SCRIPT_COMPONENT_HPP diff --git a/addons/briefing/Cfg3DEN.hpp b/addons/briefing/Cfg3DEN.hpp index c6c2ca00..0e394647 100644 --- a/addons/briefing/Cfg3DEN.hpp +++ b/addons/briefing/Cfg3DEN.hpp @@ -2,8 +2,6 @@ #include "\a3\3DEN\UI\macros.inc" #include "\a3\3DEN\UI\resincl.inc" -class ctrlDefault; -class ctrlDefaultText;// : ctrlDefault; class ctrlStatic;// : ctrlDefaultText; class ctrlListNBox;// : ctrlDefaultText; class ctrlTree;// : ctrlDefaultText; @@ -13,7 +11,7 @@ class RscButtonMenu; class RscText; -class cfgScriptPaths +class CfgScriptPaths { TMF_briefing = "x\tmf\addons\briefing\ui_scripts\"; //" - Escape for VS code linter }; @@ -139,7 +137,6 @@ class Cfg3DEN class Attributes { - class Title; class Toolbox; //class Toolbox: Title @@ -153,49 +150,49 @@ class Cfg3DEN attributeLoad = "['attributeLoad',_this] call (uinamespace getvariable 'BriefingSettings_script');"; attributeSave = "['attributeSave',_this] call (uinamespace getvariable 'BriefingSettings_script');"; - w = (ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W) * GRID_W; - h = 16 * SIZE_M * GRID_H; + w = QUOTE((ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W) * GRID_W); + h = QUOTE(16 * SIZE_M * GRID_H); class Controls { class BriefTitle : ctrlStatic { text = "Briefings:"; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) * GRID_W; - h = 1 * SIZE_M * GRID_H; + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) * GRID_W); + h = QUOTE(1 * SIZE_M * GRID_H); y = 0; - x = SIZE_M * GRID_W; + x = QUOTE(SIZE_M * GRID_W); colorBackground[] = {0,0,0,0}; }; class BriefeesTitle : BriefTitle { text = "Those to be briefed:"; - x = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W-SIZE_M)/2) * GRID_W; + x = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W-SIZE_M)/2) * GRID_W); }; class ButtonBriefeeMake : RscButtonMenu { text = "Grant"; - h = SIZE_M * GRID_H; - x = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W; - w = ((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/2; - y = 1 * SIZE_M * GRID_H; + h = QUOTE(SIZE_M * GRID_H); + x = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W); + w = QUOTE(((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/2); + y = QUOTE(1 * SIZE_M * GRID_H); action = "['BriefTreeGive',_this] call (uinamespace getvariable 'BriefingSettings_script');"; tooltip = "Make the selected element recieve selected briefing."; }; class ButtonBriefeeRemove: ButtonBriefeeMake { text = "Remove"; - x = (((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - SIZE_M)/2) ) * GRID_W)/2) + (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W); + x = QUOTE((((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - SIZE_M)/2) ) * GRID_W)/2) + (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W)); action = "['BriefTreeRemove',_this] call (uinamespace getvariable 'BriefingSettings_script');"; tooltip = "Remove the selected element from recieveing the selected briefing."; }; class BriefeeTree : ctrlTree { idc = 189437; - x = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W; - w = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - SIZE_M)/2)) * GRID_W; //(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) * GRID_W)/2) - SIZE_M; - y = 2 * SIZE_M * GRID_H; - h = 14 * SIZE_M * GRID_H; + x = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W+SIZE_M)/2) * GRID_W); + w = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - SIZE_M)/2)) * GRID_W); //(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) * GRID_W)/2) - SIZE_M; + y = QUOTE(2 * SIZE_M * GRID_H); + h = QUOTE(14 * SIZE_M * GRID_H); multiselectEnabled = 1; disableKeyboardSearch = 1; colorDisabled[] = {1,1,1,0.25}; @@ -204,43 +201,43 @@ class Cfg3DEN }; class ListBackground: ctrlStatic { - x = SIZE_M * GRID_W; - y = 2 * SIZE_M * GRID_H; - w = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W; //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; - h = 14 * SIZE_M * GRID_H; + x = QUOTE(SIZE_M * GRID_W); + y = QUOTE(2 * SIZE_M * GRID_H); + w = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W); //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; + h = QUOTE(14 * SIZE_M * GRID_H); colorBackground[] = {1,1,1,0.1}; }; class ButtonBriefAdd : RscButtonMenu { text = "Add"; - h = SIZE_M * GRID_H; - x = SIZE_M * GRID_W; - w = ((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/3; - y = 1 * SIZE_M * GRID_H; + h = QUOTE(SIZE_M * GRID_H); + x = QUOTE(SIZE_M * GRID_W); + w = QUOTE(((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/3); + y = QUOTE(1 * SIZE_M * GRID_H); action = "['BriefAddClick',_this] call (uinamespace getvariable 'BriefingSettings_script');"; tooltip = "Add a new briefing."; }; class ButtonBriefEdit: ButtonBriefAdd { text = "Edit"; - x = ((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/3 + SIZE_M * GRID_W; + x = QUOTE(((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/3 + SIZE_M * GRID_W); action = "['BriefEditClick',_this] call (uinamespace getvariable 'BriefingSettings_script');"; tooltip = "Edit the selected briefing."; }; class ButtonBriefDel : ButtonBriefAdd { text = "Delete"; - x = (((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/3) *2 + SIZE_M * GRID_W; + x = QUOTE((((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W)/3) *2 + SIZE_M * GRID_W); action = "['BriefDelClick',_this] call (uinamespace getvariable 'BriefingSettings_script');"; tooltip = "Delete the selected briefing."; }; class BriefList: ctrlListNBox { idc = 101; - x = SIZE_M * GRID_W; - y = 2 * SIZE_M * GRID_H; - w = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W; //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; - h = 14 * SIZE_M * GRID_H; + x = QUOTE(SIZE_M * GRID_W); + y = QUOTE(2 * SIZE_M * GRID_H); + w = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W)/2) - SIZE_M ) * GRID_W); //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; + h = QUOTE(14 * SIZE_M * GRID_H); drawSideArrows = 0;//1; idcLeft = -1; idcRight = -1; @@ -252,26 +249,26 @@ class Cfg3DEN class EditBriefingBackgroundS: ctrlStatic { idc = 313208; - x = SIZE_M * GRID_W; - y = 1 * SIZE_M * GRID_H; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W; //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; - h = 15 * SIZE_M * GRID_H; + x = QUOTE(SIZE_M * GRID_W); + y = QUOTE(1 * SIZE_M * GRID_H); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W); //(ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W; + h = QUOTE(15 * SIZE_M * GRID_H); colorBackground[] = {0.33,0.33,0.33,1}; }; class EditBriefingButtonOk : ButtonBriefeeMake { idc = 313209; text = "Okay"; - y = 12.25 * SIZE_M * GRID_H; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 6; - x = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 6)*1.5 + SIZE_M * GRID_W; + y = QUOTE(12.25 * SIZE_M * GRID_H); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 6); + x = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 6)*1.5 + SIZE_M * GRID_W); action = "['BriefingEditClickOkay',_this] call (uinamespace getvariable 'BriefingSettings_script');"; }; class EditBriefingButtonCancel : EditBriefingButtonOk { idc = 313210; text = "Cancel"; - x = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 6)*3.5 + SIZE_M * GRID_W; + x = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 6)*3.5 + SIZE_M * GRID_W); action = "['BriefingDelClickCancel',_this] call (uinamespace getvariable 'BriefingSettings_script');"; }; @@ -279,9 +276,9 @@ class Cfg3DEN { idc = 313201; text = "Add/Edit Briefing"; - y = 1 * SIZE_M * GRID_H; - x = SIZE_M * GRID_W; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W; + y = QUOTE(1 * SIZE_M * GRID_H); + x = QUOTE(SIZE_M * GRID_W); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W); colorBackground[] = {0.1,0.1,0.1,1}; }; @@ -289,9 +286,9 @@ class Cfg3DEN { idc = 313202; text = "Briefing Name:"; - y = 3 * SIZE_M * GRID_H; - x = 2 * SIZE_M * GRID_W; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W; + y = QUOTE(3 * SIZE_M * GRID_H); + x = QUOTE(2 * SIZE_M * GRID_W); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W); }; class EditBriefingShort : ctrlEdit { @@ -306,10 +303,10 @@ class Cfg3DEN canModify = 1; // True (1) to allow text editing, 0 to disable it autocomplete = ""; // Text autocomplete, can be "scripting" (scripting commands) or "general" (previously typed text) - y = 4.15 * SIZE_M * GRID_H; - x = 2 * SIZE_M * GRID_W; - h = SIZE_M * GRID_H; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - (4 * SIZE_M) ) * GRID_W; + y = QUOTE(4.15 * SIZE_M * GRID_H); + x = QUOTE(2 * SIZE_M * GRID_W); + h = QUOTE(SIZE_M * GRID_H); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - (4 * SIZE_M) ) * GRID_W); }; class EditBriefingSciptName : EditBriefingShortTitle @@ -317,14 +314,14 @@ class Cfg3DEN idc = 313207; text = "Script location:"; tooltip = "Script location to mission root e.g. briefings\briefing_orbat.sqf"; - y = 5.3 * SIZE_M * GRID_H; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W; + y = QUOTE(5.3 * SIZE_M * GRID_H); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W); }; class EditBriefingScript : EditBriefingShort { idc = 313211; - y = 6.45 * SIZE_M * GRID_H; + y = QUOTE(6.45 * SIZE_M * GRID_H); }; }; diff --git a/addons/briefing/CfgDiary.hpp b/addons/briefing/CfgDiary.hpp index 8b8485c5..77724b7e 100644 --- a/addons/briefing/CfgDiary.hpp +++ b/addons/briefing/CfgDiary.hpp @@ -15,16 +15,16 @@ class RscControlsGroup; class RscDisplayMainMap { class controls { class CA_ContentBackgroundd: RscText { - w = "21.5 * (((safezoneW / safezoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF - h = "18 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "21.5 * (((safeZoneW / safeZoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF + h = "18 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class CA_DiaryGroup: RscControlsGroup { - h = "safezoneH - 7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "21.5 * (((safezoneW / safezoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF + h = "safeZoneH - 7 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "21.5 * (((safeZoneW / safeZoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF class controls { class CA_Diary: RscHTML { h = 100; - w = "20.5 * (((safezoneW / safezoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF + w = "20.5 * (((safeZoneW / safeZoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF }; }; }; @@ -34,16 +34,16 @@ class RscDisplayMainMap { class RscDisplayDiary { class controls { class CA_ContentBackgroundd: RscText { - w = "21.5 * (((safezoneW / safezoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF - h = "18 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "21.5 * (((safeZoneW / safeZoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF + h = "18 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class CA_DiaryGroup: RscControlsGroup { - h = "safezoneH - 7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "21.5 * (((safezoneW / safezoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF + h = "safeZoneH - 7 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "21.5 * (((safeZoneW / safeZoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF class controls { class CA_Diary: RscHTML { h = 100; - w = "20.5 * (((safezoneW / safezoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF + w = "20.5 * (((safeZoneW / safeZoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF }; }; }; @@ -53,16 +53,16 @@ class RscDisplayDiary { class RscDisplayGetReady: RscDisplayMainMap { class controls { class CA_ContentBackgroundd: RscText { - w = "21.5 * (((safezoneW / safezoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF - h = "18 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "21.5 * (((safeZoneW / safeZoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF + h = "18 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class CA_DiaryGroup: RscControlsGroup { - h = "safezoneH - 7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "21.5 * (((safezoneW / safezoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF + h = "safeZoneH - 7 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "21.5 * (((safeZoneW / safeZoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF class controls { class CA_Diary: RscHTML { h = 100; - w = "20.5 * (((safezoneW / safezoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF + w = "20.5 * (((safeZoneW / safeZoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF }; }; }; @@ -72,16 +72,16 @@ class RscDisplayGetReady: RscDisplayMainMap { class RscDisplayServerGetReady: RscDisplayGetReady { class controls { class CA_ContentBackgroundd: RscText { - w = "21.5 * (((safezoneW / safezoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF - h = "18 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "21.5 * (((safeZoneW / safeZoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF + h = "18 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class CA_DiaryGroup: RscControlsGroup { - h = "safezoneH - 7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "21.5 * (((safezoneW / safezoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF + h = "safeZoneH - 7 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "21.5 * (((safeZoneW / safeZoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF class controls { class CA_Diary: RscHTML { h = 100; - w = "20.5 * (((safezoneW / safezoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF + w = "20.5 * (((safeZoneW / safeZoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF }; }; }; @@ -91,18 +91,18 @@ class RscDisplayServerGetReady: RscDisplayGetReady { class RscDisplayClientGetReady: RscDisplayGetReady { class controls { class CA_ContentBackgroundd: RscText { - w = "21.5 * (((safezoneW / safezoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF - h = "18 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "21.5 * (((safeZoneW / safeZoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF + h = "18 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; }; class CA_DiaryGroup: RscControlsGroup { - h = "safezoneH - 7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "21.5 * (((safezoneW / safezoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF + h = "safeZoneH - 7 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = "21.5 * (((safeZoneW / safeZoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF class controls { class CA_Diary: RscHTML { h = 100; - w = "20.5 * (((safezoneW / safezoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF + w = "20.5 * (((safeZoneW / safeZoneH) min 1.2) / 40) * 1.25"; // *1.25 = TMF }; }; }; }; -}; \ No newline at end of file +}; diff --git a/addons/briefing/addon.toml b/addons/briefing/addon.toml deleted file mode 100644 index 1bc9698a..00000000 --- a/addons/briefing/addon.toml +++ /dev/null @@ -1,5 +0,0 @@ -[rapify] -enabled = false # Default: true -exclude = [ - "Cfg3DEN.hpp" -] \ No newline at end of file diff --git a/addons/briefing/config.cpp b/addons/briefing/config.cpp index 70555c83..87530ed7 100644 --- a/addons/briefing/config.cpp +++ b/addons/briefing/config.cpp @@ -1,6 +1,6 @@ #include "script_component.hpp" -class cfgPatches +class CfgPatches { class ADDON { diff --git a/addons/briefing/display3DEN.hpp b/addons/briefing/display3DEN.hpp index 2b8922d0..f7275af6 100644 --- a/addons/briefing/display3DEN.hpp +++ b/addons/briefing/display3DEN.hpp @@ -1,5 +1,5 @@ class ctrlMenuStrip; -class display3DEN +class Display3DEN { class Controls { @@ -19,4 +19,4 @@ class display3DEN }; }; }; -}; \ No newline at end of file +}; diff --git a/addons/briefing/functions/fnc_createCreditsPage.sqf b/addons/briefing/functions/fnc_createCreditsPage.sqf index 54c752e1..b121c6bf 100644 --- a/addons/briefing/functions/fnc_createCreditsPage.sqf +++ b/addons/briefing/functions/fnc_createCreditsPage.sqf @@ -12,6 +12,6 @@ _text = _text + "by " + getMissionConfigValue ["Author", ""] +"< _text = _text + "Terrain: " + getText (configFile >> "CfgWorlds" >> worldName >> "description") + ""; -_text = _text + "

This mission was created using TMF (Teamwork Mission Framework).
TMF Mod v" + getText (ConfigFile >> "CfgPatches" >> "tmf_main" >> "versionStr") + "
TMF Mission Template v" + (getMissionConfigValue ["tmf_version",[0,0,0]] joinString ".") + "
"; +_text = _text + "

This mission was created using TMF (Teamwork Mission Framework).
TMF Mod v" + getText (configFile >> "CfgPatches" >> "tmf_main" >> "versionStr") + "
TMF Mission Template v" + (getMissionConfigValue ["tmf_version",[0,0,0]] joinString ".") + "
"; -player createDiaryRecord ["Diary", ["Credits", _text]]; \ No newline at end of file +player createDiaryRecord ["Diary", ["Credits", _text]]; diff --git a/addons/briefing/functions/fnc_generateBriefing.sqf b/addons/briefing/functions/fnc_generateBriefing.sqf index 6637987a..99b5fd2b 100644 --- a/addons/briefing/functions/fnc_generateBriefing.sqf +++ b/addons/briefing/functions/fnc_generateBriefing.sqf @@ -45,7 +45,7 @@ if (_unitCond isEqualType "") then { _unitCond = call compile _unitCond; }; { private _scriptName = (_briefingArray select _x) select 2; if FILE_EXISTS(_scriptName) then { - call compile preprocessfilelinenumbers _scriptName; + call compile preprocessFileLineNumbers _scriptName; } else { [_scriptName] spawn { params ["_scriptName"]; @@ -58,7 +58,7 @@ if (_unitCond isEqualType "") then { _unitCond = call compile _unitCond; }; //Do Admin briefing. if ([] call tmf_common_fnc_isAdmin) then { if FILE_EXISTS("briefing\admin.sqf") then { - call compile preprocessfilelinenumbers "briefing\admin.sqf"; + call compile preprocessFileLineNumbers "briefing\admin.sqf"; } else { [] spawn { uiSleep 5; diff --git a/addons/briefing/functions/fnc_generateLoadoutPage.sqf b/addons/briefing/functions/fnc_generateLoadoutPage.sqf index 9c8e880e..b63e0662 100644 --- a/addons/briefing/functions/fnc_generateLoadoutPage.sqf +++ b/addons/briefing/functions/fnc_generateLoadoutPage.sqf @@ -19,8 +19,8 @@ params [["_unit",player]]; _unit createDiarySubject ["loadout","Equipment"]; private _units = (units (group _unit)); reverse _units; // Briefings get added in reverse order -private _vehicles = (_units select {!(vehicle _x isEqualTo _x)}) apply {vehicle _x}; // Proud +private _vehicles = (_units select {(vehicle _x isNotEqualTo _x)}) apply {vehicle _x}; // Proud _vehicles = _vehicles arrayIntersect _vehicles; [_unit,_vehicles] call FUNC(vehiclePage); -[_unit,_units] call FUNC(unitPage); \ No newline at end of file +[_unit,_units] call FUNC(unitPage); diff --git a/addons/briefing/functions/fnc_testBriefings.sqf b/addons/briefing/functions/fnc_testBriefings.sqf index 8dabf287..748d5018 100644 --- a/addons/briefing/functions/fnc_testBriefings.sqf +++ b/addons/briefing/functions/fnc_testBriefings.sqf @@ -17,7 +17,7 @@ private _conditions = []; //TODO: error check the briefing script for errors. //call compile preprocessFileLineNumbers _scriptPath; } else { - _output pushBack [0,format["Briefing %1 - file missing %2", _name, _scriptPath]]; + _output pushBack [0,format["Briefing %1: file %2 does not exist.", _name, _scriptPath]]; }; // Weed out units that are acceptable to the condition @@ -55,9 +55,9 @@ private _conditions = []; _units = _units - [objNull]; -if (count _units > 0) then { - _output pushBack [1,"Some units do not have an associated briefing:"]; - _output pushBack [1,format ["units (%1): %2",count _units,str _units]]; +if (_units isNotEqualTo []) then { + _output pushBack [1,"Some playable units get no briefing. Add their side or faction to a briefing in the Eden TMF menu > TMF Briefing Settings:"]; + _output pushBack [1,format [" %1 units: %2",count _units,str _units]]; }; -_output; \ No newline at end of file +_output; diff --git a/addons/briefing/functions/fnc_unitPage.sqf b/addons/briefing/functions/fnc_unitPage.sqf index 818a5029..1b95696c 100644 --- a/addons/briefing/functions/fnc_unitPage.sqf +++ b/addons/briefing/functions/fnc_unitPage.sqf @@ -53,6 +53,7 @@ private _cfgWeapons = configFile >> "CfgWeapons"; private _visText = ""; private _magVisText = ""; + private _magVisParts = []; private _weaponText = ""; private _otherText = ""; @@ -66,15 +67,16 @@ private _cfgWeapons = configFile >> "CfgWeapons"; //if (getNumber (_cfgMagazines >> _magClassName >> "mass") > 0) then { private _icon = getText(_cfgMagazines >> _magClassName >> "picture"); if (_icon find ".paa" == -1) then { _icon = _icon + ".paa"}; - _magVisText = _magVisText + format["",_icon]; + _magVisParts pushBack format["",_icon]; if ((_x select 1) > 1) then { - _magVisText = _magVisText + format[" x%1",_magQuantity]; + _magVisParts pushBack format[" x%1",_magQuantity]; }; //}; } forEach _mags; + _magVisText = _magVisParts joinString ""; // Weapons - if (count _weapons > 0) then { + if (_weapons isNotEqualTo []) then { _weaponText = _weaponText + "WEAPONS"; { private _weapon = _x; @@ -140,39 +142,39 @@ private _cfgWeapons = configFile >> "CfgWeapons"; // Gear _gearText = _gearText + "
GEAR
"; - if !((uniform _unit) isEqualTo "") then { + if ((uniform _unit) isNotEqualTo "") then { _gearText = _gearText + format ["Uniform: %1 [%2", getText (configFile >> "CfgWeapons" >> (uniform _unit) >> "displayName"), round (100 * loadUniform _unit)] + "% full]
"; }; - if !((vest _unit) isEqualTo "") then { + if ((vest _unit) isNotEqualTo "") then { _gearText = _gearText + format ["Gear: %1 [%2", getText (configFile >> "CfgWeapons" >> (vest _unit) >> "displayName"), round (100 * loadVest _unit)] + "% full]
"; }; - if !((backpack _unit) isEqualTo "") then { + if ((backpack _unit) isNotEqualTo "") then { _gearText = _gearText + format ["Backpack: %1 [%2", getText (configFile >> "CfgVehicles" >> (backpack _unit) >> "displayName"), round (100 * loadBackpack _unit)] + "% full]
"; }; - if !((headgear _unit) isEqualTo "") then { + if ((headgear _unit) isNotEqualTo "") then { _gearText = _gearText + format ["Head: %1
", getText (configFile >> "CfgWeapons" >> (headgear _unit) >> "displayName")]; }; - if !((hmd _unit) isEqualTo "") then { + if ((hmd _unit) isNotEqualTo "") then { _gearText = _gearText + format ["NVG: %1
", getText (configFile >> "CfgWeapons" >> (hmd _unit) >> "displayName")]; _visText = _visText + ""; }; - if !((binocular _unit) isEqualTo "") then { + if ((binocular _unit) isNotEqualTo "") then { _gearText = _gearText + format ["Binocular: %1
", getText (configFile >> "CfgWeapons" >> (binocular _unit) >> "displayName")]; _visText = _visText + ""; }; // Misc. Items private _assignedItems = assignedItems _unit - [binocular _unit, hmd _unit]; - if (count _items > 0 || count _assignedItems > 0) then { + if (_items isNotEqualTo [] || {_assignedItems isNotEqualTo []}) then { _itemText = _itemText + "
ITEMS
"; private _filter = ["ItemWatch", "ItemMap", "ItemCompass"]; { _visText = format["%1", _visText, getText (_cfgWeapons >> _x >> "picture")]; - } forEach _assignedItems select {!(_x in _filter)}; + } forEach (_assignedItems select {!(_x in _filter)}); private _assignedItemsStr = (_assignedItems apply {getText (_cfgWeapons >> _x >> "displayName")}) joinString ", "; - if !(_assignedItemsStr isEqualTo "") then { + if (_assignedItemsStr isNotEqualTo "") then { _itemText = format["%1%2
", _itemText, _assignedItemsStr]; }; @@ -195,7 +197,7 @@ private _cfgWeapons = configFile >> "CfgWeapons"; private _faction = _unit getVariable [QEGVAR(assigngear,faction), ""]; private _role = _unit getVariable [QEGVAR(assigngear,role), ""]; - if !(_faction isEqualTo "") then { + if (_faction isNotEqualTo "") then { private _classFaction = (missionConfigFile >> "CfgLoadouts" >> _faction); if (isNull _classFaction) then { _classFaction = (configFile >> "CfgLoadouts" >> _faction); @@ -212,8 +214,8 @@ private _cfgWeapons = configFile >> "CfgWeapons"; // Add the created text private _entryString = (name _unit); - if !(_roleName isEqualTo "") then { + if (_roleName isNotEqualTo "") then { _entryString = _entryString + format [" [%1]", _roleName]; }; _target createDiaryRecord ["loadout", [_entryString, "NOTE: The loadout shown below is only accurate at mission start.
" + ((_visText + _text) splitString "&" joinString "&")]]; -} forEach _units; \ No newline at end of file +} forEach _units; diff --git a/addons/briefing/functions/fnc_vehiclePage.sqf b/addons/briefing/functions/fnc_vehiclePage.sqf index 1ec4b74e..e4c5a1f7 100644 --- a/addons/briefing/functions/fnc_vehiclePage.sqf +++ b/addons/briefing/functions/fnc_vehiclePage.sqf @@ -27,7 +27,7 @@ params ["_target","_vehicles"]; QEGVAR(orbat,vehicleCallsign), [getText (_cfg >> "displayName"),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-(),. "] call BIS_fnc_filterString ]; - if !((_veh getVariable [QEGVAR(orbat,vehicleCallsign),-1]) isEqualTo -1) then { + if ((_veh getVariable [QEGVAR(orbat,vehicleCallsign),-1]) isNotEqualTo -1) then { _vehName = _vehName + " (" + ([getText(_cfg >> "displayName"),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-(),. "] call BIS_fnc_filterString) + ")"; }; _text = _text + format["%1",_vehName]; @@ -55,7 +55,7 @@ params ["_target","_vehicles"]; private _turretName = [getText(_cfgTurret >> "gunnerName")] call CBA_fnc_capitalize; private _locked = _veh lockedTurret _x; // Handle FFV turrets and turned out positions - if ((getNumber(_cfgTurret >> "isPersonTurret") > 0) && (getnumber(_cfg >> "hideProxyInCombat") isEqualTo 0)) then { + if ((getNumber(_cfgTurret >> "isPersonTurret") > 0) && (getNumber(_cfg >> "hideProxyInCombat") isEqualTo 0)) then { // Save the idx of the turret _proxyIdxs pushBack getNumber(_cfgTurret >> "proxyIndex"); }; @@ -83,7 +83,7 @@ params ["_target","_vehicles"]; private _transportSoldier = getNumber(_cfg >> "transportSoldier"); private _cargoProxyIdxs = []; - if (count _getInProxyOrder == 0) then { + if (_getInProxyOrder isEqualTo []) then { for "_i" from 1 to _transportSoldier do { _getInProxyOrder pushBack _i}; private _turretCount = count _proxyIdxs; for "_i" from (1+_turretCount) to (_transportSoldier+_turretCount) do {_cargoProxyIdxs pushBack _i}; @@ -95,17 +95,19 @@ params ["_target","_vehicles"]; // Resize _cargoProxyIdxs as appropriate _cargoProxyIdxs resize (_transportSoldier min (count _cargoProxyIdxs)); + private _passengerLines = []; { private _idx = _x; private _locked = _veh lockedCargo (_x - 1); private _unitText = (crew _veh) select {(_veh getCargoIndex _x) isEqualTo _idx}; - if ((count _unitText) > 0) then { + if (_unitText isNotEqualTo []) then { _unitText = name (_unitText select 0); } else { _unitText = "Empty"; }; - _text = _text + format[" Passenger #%1: %2
",_idx,_unitText]; // Possibly work out columns here? + _passengerLines pushBack format[" Passenger #%1: %2
",_idx,_unitText]; // Possibly work out columns here? } forEach _cargoProxyIdxs; + _text = _text + (_passengerLines joinString ""); // Vehicle weapons _text = _text + "
Vehicle weapons:
"; @@ -113,7 +115,7 @@ params ["_target","_vehicles"]; // Driver weapons if ((getNumber (_cfg >> "hasDriver")) > 0) then { private _weapons = _veh weaponsTurret [-1]; - if ((count _weapons) > 0) then { + if (_weapons isNotEqualTo []) then { _text = format ["%1%2:
", _text, ["Driver","Pilot"] select _isAir]; { @@ -124,7 +126,7 @@ params ["_target","_vehicles"]; if ((count _weaponMagazines) > 0) then { private _weaponName = getText (configFile >> "CfgWeapons" >> _weapon >> "displayName"); - if !(_weaponName isEqualTo "") then { + if (_weaponName isNotEqualTo "") then { _text = format ["%1 %2
", _text, _weaponName]; }; @@ -144,7 +146,7 @@ params ["_target","_vehicles"]; if !(_veh lockedTurret _turretPath) then { // RHS uses locked turrets for turning in/out (?) private _turretWeapons = _veh weaponsTurret _turretPath; - if (count _turretWeapons > 0) then { + if (_turretWeapons isNotEqualTo []) then { private _turretMagazines = _veh magazinesTurret _turretPath; private _turretCfg = _cfg; @@ -172,43 +174,24 @@ params ["_target","_vehicles"]; } forEach allTurrets _veh; // Vehicle Cargo >> Backpack, Weapon, Magazine, Item - _text = _text + "
Vehicle cargo:
"; - private _backPackCargo = getBackpackCargo _veh; - if ((count (_backPackCargo select 0)) > 0) then { - _text = _text + "Backpacks:
"; - _backPackCargo params ["_a","_b"]; - { - _backPackText = [getText(configFile >> "cfgVehicles" >> _x >> "displayName"),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-(),. "] call BIS_fnc_filterString; - _text = _text + format[" %1 [%2]
",_backPackText,(_b select _forEachIndex)]; - } forEach _a; - }; - private _weaponCargo = getWeaponCargo _veh; - if ((count (_weaponCargo select 0)) > 0) then { - _text = _text + "Weapons:
"; - _weaponCargo params ["_a","_b"]; - { - _weaponText = [getText(configFile >> "cfgWeapons" >> _x >> "displayName"),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-(),. "] call BIS_fnc_filterString; - _text = _text + format[" %1 [%2]
",_weaponText,(_b select _forEachIndex)]; - } forEach _a; - }; - private _magazineCargo = getMagazineCargo _veh; - if ((count (_magazineCargo select 0)) > 0) then { - _text = _text + "Magazines:
"; - _magazineCargo params ["_a","_b"]; - { - _magazineText = [getText(configFile >> "cfgMagazines" >> _x >> "displayName"),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-(),. "] call BIS_fnc_filterString; - _text = _text + format[" %1 [%2]
",_magazineText,(_b select _forEachIndex)]; - } forEach _a; - }; - private _itemCargo = getItemCargo _veh; - if ((count (_itemCargo select 0)) > 0) then { - _text = _text + "Items:
"; - _itemCargo params ["_a","_b"]; - { - _itemText = [getText(configFile >> "cfgWeapons" >> _x >> "displayName"),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-(),. "] call BIS_fnc_filterString; - _text = _text + format[" %1 [%2]
",_itemText,(_b select _forEachIndex)]; - } forEach _a; - }; + private _cargoLines = ["
Vehicle cargo:
"]; + { + _x params ["_title", "_cargo", "_cfgClass"]; + _cargo params ["_classes", "_counts"]; + if (_classes isNotEqualTo []) then { + _cargoLines pushBack (_title + ":
"); + { + private _name = [getText (configFile >> _cfgClass >> _x >> "displayName"),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-(),. "] call BIS_fnc_filterString; + _cargoLines pushBack format [" %1 [%2]
", _name, _counts select _forEachIndex]; + } forEach _classes; + }; + } forEach [ + ["Backpacks", getBackpackCargo _veh, "CfgVehicles"], + ["Weapons", getWeaponCargo _veh, "CfgWeapons"], + ["Magazines", getMagazineCargo _veh, "CfgMagazines"], + ["Items", getItemCargo _veh, "CfgWeapons"] + ]; + _text = _text + (_cargoLines joinString ""); _target createDiaryRecord ["loadout", ["["+_vehName+"]", "NOTE: The information shown below is only accurate at mission start.
" + _text]]; -} forEach _vehicles; \ No newline at end of file +} forEach _vehicles; diff --git a/addons/briefing/script_component.hpp b/addons/briefing/script_component.hpp index d10ee95e..33526ef6 100644 --- a/addons/briefing/script_component.hpp +++ b/addons/briefing/script_component.hpp @@ -1,5 +1,9 @@ +#ifndef TMF_BRIEFING_SCRIPT_COMPONENT_HPP +#define TMF_BRIEFING_SCRIPT_COMPONENT_HPP + #define COMPONENT briefing #include "\x\tmf\addons\main\script_mod.hpp" #include "\x\tmf\addons\main\script_macros.hpp" +#endif // TMF_BRIEFING_SCRIPT_COMPONENT_HPP diff --git a/addons/briefing/ui_scripts/BriefingSettings.sqf b/addons/briefing/ui_scripts/BriefingSettings.sqf index 8795fca0..e7666c40 100644 --- a/addons/briefing/ui_scripts/BriefingSettings.sqf +++ b/addons/briefing/ui_scripts/BriefingSettings.sqf @@ -8,10 +8,10 @@ params ["_mode",["_params",[]]]; fn_removeUnitFromBrief = { params ["_channel", "_unit"]; - _list = (_unit get3DENAttribute "TMF_Briefinglist") params ["_value"]; + (_unit get3DENAttribute "TMF_Briefinglist") params ["_value"]; if (_value isEqualType []) then { //Is default do nothing - _//unit set3DENAttribute ["TMF_Channellist",str []]; + //_unit set3DENAttribute ["TMF_Channellist",str []]; } else { _value = call compile _value; _value = _value - [_channel]; @@ -22,7 +22,7 @@ fn_removeUnitFromBrief = { fn_removeGroupFromBrief = { params ["_channel", "_group"]; - _list = (_group get3DENAttribute "TMF_Briefinglist") params ["_value"]; + (_group get3DENAttribute "TMF_Briefinglist") params ["_value"]; if (_value isEqualType []) then { //Is Default do nothing //_group set3DENAttribute ["TMF_ChannellistLeader",str []]; @@ -33,7 +33,7 @@ fn_removeGroupFromBrief = { }; - _list = (_group get3DENAttribute "TMF_Briefinglist") params ["_value"]; + (_group get3DENAttribute "TMF_Briefinglist") params ["_value"]; if (_value isEqualType []) then { //is default do nothing //_group set3DENAttribute ["TMF_Channellist",str []]; @@ -53,9 +53,9 @@ fn_removeGroupFromBrief = { switch _mode do { case "onLoad": { private _playableUnits = (((all3DENEntities select 0)+(all3DENEntities select 3)) select { - (_x get3DENAttribute "ControlMP") IsEqualTo [true] + (_x get3DENAttribute "ControlMP") isEqualTo [true] || - (_x get3DENAttribute "ControlSP") IsEqualTo [true] + (_x get3DENAttribute "ControlSP") isEqualTo [true] }); cacheAllPlayerGroups = [];//allGroups select {{_x in _playableUnits} count (units _x) > 0}; { @@ -85,11 +85,11 @@ switch _mode do { BriefingCurrentBrief = 0; //--- Init UI - _ctrlGroup = _params select 0; + private _ctrlGroup = _params select 0; BriefingSettings_ctrlGroup = _ctrlGroup; - _ctrlGroup ctrladdeventhandler ["setfocus",{with uinamespace do {BriefingSettings_ctrlGroup = _this select 0;};}]; - _ctrlGroup ctrladdeventhandler ["killfocus",{with uinamespace do {BriefingSettings_ctrlGroup = nil;};}]; + _ctrlGroup ctrlAddEventHandler ["SetFocus",{with uiNamespace do {BriefingSettings_ctrlGroup = _this select 0;};}]; + _ctrlGroup ctrlAddEventHandler ["KillFocus",{with uiNamespace do {BriefingSettings_ctrlGroup = nil;};}]; { @@ -129,14 +129,14 @@ switch _mode do { lnbClear _ctrlBriefList; { _x params ["_name"]; - _ctrlBriefList lnbaddrow [_name, "", ""]; + _ctrlBriefList lnbAddRow [_name, "", ""]; } forEach BriefingArray; if (count BriefingArray > 0) then { _ctrlBriefList lnbSetCurSelRow 0; BriefingCurrentBrief = 0; } else { _ctrlBriefList lnbSetColumnsPos [0,5,5]; - _ctrlBriefList lnbaddrow ["No Briefings","",""]; + _ctrlBriefList lnbAddRow ["No Briefings","",""]; BriefingCurrentBrief = -1; }; @@ -148,7 +148,7 @@ switch _mode do { if (isNil "BriefingSettings_ctrlGroup") exitWith {}; - _ctrlTree = BriefingSettings_ctrlGroup controlsGroupCtrl 189437; + private _ctrlTree = BriefingSettings_ctrlGroup controlsGroupCtrl 189437; tvClear _ctrlTree; if (BriefingCurrentBrief == -1) exitWith {}; @@ -166,12 +166,12 @@ switch _mode do { private _color = (side _unit) call TMF_common_fnc_sideToColor; if (_roleDesc == "") then { - _roleDesc = getText (configfile >> "CfgVehicles" >> (typeOf _unit) >> "displayName"); + _roleDesc = getText (configOf _unit >> "displayName"); }; private _unitIdx = _ctrlTree tvAdd [ _treeRoot, _roleDesc]; private _location = _treeRoot + [_unitIdx]; _ctrlTree tvSetValue [_location, BriefingTree_data pushBack _unit]; - private _icon = getText (configFile >> "CfgVehicleIcons" >> getText (configFile >> "CfgVehicles" >> (typeOf _unit) >> "icon")); + private _icon = getText (configFile >> "CfgVehicleIcons" >> getText (configOf _unit >> "icon")); if (_icon == "") then { _icon = "\a3\3DEN\Data\Cfg3DEN\Object\iconPlayer_ca.paa"; //default player icon }; @@ -208,8 +208,8 @@ switch _mode do { private _location = +_treeRoot; if (_render) then { private _color = _side call TMF_common_fnc_sideToColor; - private _grpIdx = _ctrlTree tvAdd [ _treeRoot, groupID _group]; - _location = _location + [_grpIdx]; + private _grpIdx = _ctrlTree tvAdd [ _treeRoot, groupId _group]; + _location pushBack _grpIdx; private _grpIcon = "\a3\Ui_f\data\Map\Markers\NATO\n_unknown.paa"; //Found in (configfile >> "Cfg3DEN" >> "Group" >> "Draw" >> "textureCivilian") @@ -239,9 +239,9 @@ switch _mode do { private _units = units _group; if (_side == sideLogic) then { _units = _units select { - (_x get3DENAttribute "ControlMP") IsEqualTo [true] + (_x get3DENAttribute "ControlMP") isEqualTo [true] || - (_x get3DENAttribute "ControlSP") IsEqualTo [true] + (_x get3DENAttribute "ControlSP") isEqualTo [true] }; }; { @@ -287,12 +287,12 @@ switch _mode do { }; if (_render) then { - private _factionIdx = _ctrlTree tvAdd [ _treeRoot,getText (configfile >> "CfgFactionClasses" >> _faction >> "displayName")]; - _location = _location + [_factionIdx]; + private _factionIdx = _ctrlTree tvAdd [ _treeRoot,getText (configFile >> "CfgFactionClasses" >> _faction >> "displayName")]; + _location pushBack _factionIdx; _ctrlTree tvSetValue [_location, BriefingTree_data pushBack _faction]; - private _factionImg = getText (configfile >> "CfgFactionClasses" >> _faction >> "icon"); + private _factionImg = getText (configFile >> "CfgFactionClasses" >> _faction >> "icon"); _ctrlTree tvSetPicture [_location, _factionImg]; }; @@ -341,7 +341,7 @@ switch _mode do { }; //Collect factions for side. - _factions = []; + private _factions = []; { _factions pushBackUnique (toLower (faction (leader _x))); } forEach (cacheAllPlayerGroups select {(side _x) == _side}); @@ -456,11 +456,11 @@ switch _mode do { private _curSel = lnbCurSelRow (BriefingSettings_ctrlGroup controlsGroupCtrl 101); private _condition = (BriefingArray select _curSel) select 1; - if (_entity isEqualType east or _entity isEqualType "") then { + if (_entity isEqualTypeAny [east, ""]) then { _condition pushBackUnique _entity; } else { - if (_entity isEqualType grpNull or _entity isEqualType objNull) then { - _list = (_entity get3DENAttribute "TMF_Briefinglist") params ["_value"]; + if (_entity isEqualTypeAny [grpNull, objNull]) then { + (_entity get3DENAttribute "TMF_Briefinglist") params ["_value"]; if (_value isEqualType []) then { _entity set3DENAttribute ["TMF_Briefinglist",str [_curSel]]; } else { @@ -487,14 +487,14 @@ switch _mode do { private _BriefEntry = (BriefingArray select _curSel); private _condition = _BriefEntry select 1; - if (_entity isEqualType east or _entity isEqualType "") then { + if (_entity isEqualTypeAny [east, ""]) then { _BriefEntry set [1,_condition - [_entity]]; if (_entity isEqualType east) then { //Find and remove matching faction groups private _sideNum = _entity call TMF_common_fnc_sideToNum; { if (_x isEqualType "") then { - if (_sideNum == getNumber (configfile >> "CfgFactionClasses" >> _x >> "side")) then { + if (_sideNum == getNumber (configFile >> "CfgFactionClasses" >> _x >> "side")) then { _BriefEntry set [1,_condition - [_x]]; }; }; diff --git a/addons/chat/config.cpp b/addons/chat/config.cpp index 72913857..52cc0ccf 100644 --- a/addons/chat/config.cpp +++ b/addons/chat/config.cpp @@ -1,6 +1,6 @@ #include "script_component.hpp" -class cfgPatches +class CfgPatches { class ADDON { diff --git a/addons/chat/functions/fnc_cmndHeal.sqf b/addons/chat/functions/fnc_cmndHeal.sqf index 50fa1bd6..682f6de0 100644 --- a/addons/chat/functions/fnc_cmndHeal.sqf +++ b/addons/chat/functions/fnc_cmndHeal.sqf @@ -35,7 +35,7 @@ switch (toLower _name) do { _x setDamage 0; systemChat "TMF: Healed everyone"; - (FORMAT_1("TMF: Healed by %1", name player)) remoteExecCall ["systemChat", _x]; + (FORMAT_1("TMF: Healed by %1",name player)) remoteExecCall ["systemChat", _x]; } forEach allPlayers; }; default { // Heal target player @@ -46,11 +46,11 @@ switch (toLower _name) do { [_target, _target] call ace_medical_treatment_fnc_fullHeal; }; _target setDamage 0; - systemChat FORMAT_1("TMF: Healed %1", name _target); + systemChat FORMAT_1("TMF: Healed %1",name _target); - (FORMAT_1("TMF: Healed by %1", name player)) remoteExecCall ["systemChat", _target]; + (FORMAT_1("TMF: Healed by %1",name player)) remoteExecCall ["systemChat", _target]; } else { - systemChat FORMAT_1("TMF Error: No player containing %1, or more than one found.", str _name); + systemChat FORMAT_1("TMF Error: No player containing %1, or more than one found.",str _name); }; }; }; diff --git a/addons/chat/functions/fnc_cmndLoadout.sqf b/addons/chat/functions/fnc_cmndLoadout.sqf index 46a808ac..04c397dd 100644 --- a/addons/chat/functions/fnc_cmndLoadout.sqf +++ b/addons/chat/functions/fnc_cmndLoadout.sqf @@ -18,20 +18,20 @@ * None */ -IS_CMND_AVAILABLE(GVAR(loadoutUsage), "#loadout"); +IS_CMND_AVAILABLE(GVAR(loadoutUsage),"#loadout"); params ["_input"]; -LOG_1("executed command #loadout with input: %1", str _input); +LOG_1("executed command #loadout with input: %1",str _input); -private _inputArr = _input splitstring " "; +private _inputArr = _input splitString " "; private _gearselector = EFUNC(assigngear,gearselector); switch (count _inputArr) do { case 0: _gearselector; case 1: { _inputArr params ["_in1"]; - private _faction = CURUNIT getVariable [QEGVAR(assigngear, faction), ""]; + private _faction = CURUNIT getVariable [QEGVAR(assigngear,faction), ""]; private _cfg = if (isClass (missionConfigFile >> "Cfgloadouts" >> _faction >> _in1)) then [{ missionConfigFile }, { @@ -40,22 +40,22 @@ switch (count _inputArr) do { if (isClass (_cfg >> "Cfgloadouts" >> _faction >> _in1)) then { // input corresponds with a loadout [CURUNIT, _faction, _in1] call EFUNC(assigngear,assignGear); - systemChat format ["TMF: Assigned loadout %1", str gettext (_cfg >> "Cfgloadouts" >> _faction >> _in1 >> "displayname")]; + systemChat format ["TMF: Assigned loadout %1", str getText (_cfg >> "Cfgloadouts" >> _faction >> _in1 >> "displayname")]; } else { private _match = [_in1] call FUNC(findMatch); if (isNull _match) then { // No loadout or player found, or more than one player - if (_faction isEqualto "") then { + if (_faction isEqualTo "") then { systemChat "TMF Error: Cannot select loadout as you do not have an assigned faction. Use #loadout "; - systemChat FORMAT_1("TMF Error: Could not find player containing %1, or more than one player found.", str _in1); + systemChat FORMAT_1("TMF Error: Could not find player containing %1, or more than one player found.",str _in1); } else { - systemChat FORMAT_2("TMF Error: No loadout with name %1 in %2", str _in1, _faction); - systemChat FORMAT_1("TMF Error: Could not find player containing %1, or more than one player found.", str _in1); + systemChat FORMAT_2("TMF Error: No loadout with name %1 in %2",str _in1,_faction); + systemChat FORMAT_1("TMF Error: Could not find player containing %1, or more than one player found.",str _in1); }; } else { // Copy other players loadout - CURUNIT setUnitLoadout getUnitloadout _match; - systemChat FORMAT_1("TMF: Copied loadout from %1", name _match); + CURUNIT setUnitLoadout getUnitLoadout _match; + systemChat FORMAT_1("TMF: Copied loadout from %1",name _match); }; }; }; @@ -70,13 +70,13 @@ switch (count _inputArr) do { if (isClass (_cfg >> "Cfgloadouts" >> _in1 >> _in2)) then { // input corresponds with a loadout [CURUNIT, _in1, _in2] call EFUNC(assigngear,assignGear); - systemChat FORMAT_2("TMF: Assigned loadout %1 from %2", str gettext (_cfg >> "Cfgloadouts" >> _in1 >> _in2 >> "displayname"), str gettext (_cfg >> "Cfgloadouts" >> _in1 >> "displayname")); + systemChat FORMAT_2("TMF: Assigned loadout %1 from %2",str getText (_cfg >> "Cfgloadouts" >> _in1 >> _in2 >> "displayname"),str getText (_cfg >> "Cfgloadouts" >> _in1 >> "displayname")); } else { if !(isClass (_cfg >> "Cfgloadouts" >> _in1)) then { - systemChat FORMAT_1("TMF Error: No faction with name %1", str _in1); + systemChat FORMAT_1("TMF Error: No faction with name %1",str _in1); } else { - systemChat FORMAT_2("TMF Error: No loadout with name %1 in %2", str _in2, str _in1); + systemChat FORMAT_2("TMF Error: No loadout with name %1 in %2",str _in2,str _in1); }; }; }; -}; \ No newline at end of file +}; diff --git a/addons/chat/functions/fnc_cmndRadio.sqf b/addons/chat/functions/fnc_cmndRadio.sqf index 4866e110..110fa1a3 100644 --- a/addons/chat/functions/fnc_cmndRadio.sqf +++ b/addons/chat/functions/fnc_cmndRadio.sqf @@ -19,18 +19,18 @@ params [["_name", ""]]; if (_name isEqualTo "") exitWith {systemChat "TMF Error: No argument passed. Command usage: #radio "}; -private _configs = "true" configClasses (configfile >> "CfgAcreComponents"); +private _configs = "true" configClasses (configFile >> "CfgAcreComponents"); private _radios = _configs select { getNumber (_x >> "type") isEqualTo 5 && - !(getText (_x >> "name") isEqualTo "ACRE Base Radio") && - {[_name, configName _x] call BIS_fnc_inString || {[_name, getText (_x >> "name")] call BIS_fnc_inString}} + (getText (_x >> "name") isNotEqualTo "ACRE Base Radio") && + {(toLower _name in toLower configName _x) || {(toLower _name in toLower getText (_x >> "name"))}} }; if (_radios isEqualTo []) exitWith { - systemChat FORMAT_1("TMF Error: Unable to find radio containing %1", str _name); + systemChat FORMAT_1("TMF Error: Unable to find radio containing %1",str _name); }; if (count _radios > 1) exitWith { - systemChat FORMAT_1("TMF Error: More than one radio found containing %1", str _name); + systemChat FORMAT_1("TMF Error: More than one radio found containing %1",str _name); }; private _radioType = configName (_radios # 0); @@ -38,7 +38,7 @@ private _radioName = getText ((_radios # 0) >> "name"); if (CURUNIT canAdd _radioType) then { CURUNIT addItem _radioType; - systemChat FORMAT_1("TMF: Added %1 to inventory", _radioName); + systemChat FORMAT_1("TMF: Added %1 to inventory",_radioName); } else { - systemChat FORMAT_1("TMF Error: Not enough room for %1 in inventory", _radioName); + systemChat FORMAT_1("TMF Error: Not enough room for %1 in inventory",_radioName); }; diff --git a/addons/chat/functions/fnc_cmndTp.sqf b/addons/chat/functions/fnc_cmndTp.sqf index c2eab21c..5f88ed2b 100644 --- a/addons/chat/functions/fnc_cmndTp.sqf +++ b/addons/chat/functions/fnc_cmndTp.sqf @@ -28,7 +28,7 @@ if (isNull _unit) then { private _side = side CURUNIT; private _grpArr = allGroups select { _side isEqualTo side _x && - [_name, groupId _x] call BIS_fnc_inString + (toLower _name in toLower groupId _x) }; if (count _grpArr isEqualTo 1) then { _unit = leader (_grpArr # 0); @@ -36,20 +36,20 @@ if (isNull _unit) then { }; if (!isNull _unit) then { - if (vehicle _unit != _unit) then { + if (!isNull objectParent _unit) then { CURUNIT moveInAny vehicle _unit; if !(CURUNIT in vehicle _unit) then { - systemChat FORMAT_1("TMF: %1's vehicle is full", name _unit); + systemChat FORMAT_1("TMF: %1's vehicle is full",name _unit); } else { - systemChat FORMAT_1("TMF: Teleported into %1's vehicle", name _unit); + systemChat FORMAT_1("TMF: Teleported into %1's vehicle",name _unit); }; } else { private _pos = _unit getRelPos [3, 180]; CURUNIT setDir (getDir _unit); CURUNIT setPos _pos; - systemChat FORMAT_1("TMF: Teleported to %1", name _unit); + systemChat FORMAT_1("TMF: Teleported to %1",name _unit); }; } else { - systemChat FORMAT_1("TMF Error: No player/group containing %1, or more than one found.", str _name); + systemChat FORMAT_1("TMF Error: No player/group containing %1, or more than one found.",str _name); }; diff --git a/addons/chat/functions/fnc_commandAvailable.sqf b/addons/chat/functions/fnc_commandAvailable.sqf index 10920a46..54e1a191 100644 --- a/addons/chat/functions/fnc_commandAvailable.sqf +++ b/addons/chat/functions/fnc_commandAvailable.sqf @@ -24,13 +24,13 @@ private _enabled = true; switch (_var) do { case 0: { // Never available if true exitWith { - systemChat FORMAT_1("TMF: %1 is disabled.", _command); + systemChat FORMAT_1("TMF: %1 is disabled.",_command); _enabled = false; }; }; case 1: { // Available during safestart if !(call EFUNC(safestart,isActive)) exitWith { - systemChat FORMAT_1("TMF: %1 is only available during Safe Start.", _command); + systemChat FORMAT_1("TMF: %1 is only available during Safe Start.",_command); _enabled = false; }; }; @@ -39,7 +39,7 @@ switch (_var) do { CURUNIT getVariable [QGVARMAIN(lastRespawn), 0] < time - 300 && {!(call EFUNC(safestart,isActive))} ) exitWith { - systemChat FORMAT_1("TMF: %1 is only available during Safe Start and within 5 minutes of respawn.", _command); + systemChat FORMAT_1("TMF: %1 is only available during Safe Start and within 5 minutes of respawn.",_command); _enabled = false; }; }; diff --git a/addons/chat/functions/fnc_findMatch.sqf b/addons/chat/functions/fnc_findMatch.sqf index 3b05da11..cc18fcb3 100644 --- a/addons/chat/functions/fnc_findMatch.sqf +++ b/addons/chat/functions/fnc_findMatch.sqf @@ -19,7 +19,7 @@ params ["_name"]; private _matches = []; { - if ([_name, name _x] call BIS_fnc_inString) then { + if (toLower _name in toLower name _x) then { _matches pushBack _x; }; } forEach ([] call CBA_fnc_players); diff --git a/addons/chat/initCommands.sqf b/addons/chat/initCommands.sqf index 6594cecd..7978cffa 100644 --- a/addons/chat/initCommands.sqf +++ b/addons/chat/initCommands.sqf @@ -1,5 +1,5 @@ #include "\x\tmf\addons\chat\script_component.hpp" -#define CMND(x) cmnd##COMMAND +#define CMND(x) cmnd##x #define CHAT_FUNC(COMMAND) { _this call FUNC(CMND(COMMAND)); [format ["%1 executed #%2 %3",profileName,QUOTE(COMMAND),_this select 0],false,"Chat"] call EFUNC(adminmenu,log)} ; diff --git a/addons/chat/initSettings.sqf b/addons/chat/initSettings.sqf index 41d143e9..48ed6dc3 100644 --- a/addons/chat/initSettings.sqf +++ b/addons/chat/initSettings.sqf @@ -2,11 +2,11 @@ [ QGVAR(healUsage), "LIST", - "#heal available", + ["#heal command", "When players may use #heal in chat to heal themselves or another player. Admins can always use it."], ["TMF", "Chat Commands"], [ [0, 1, 3 ], - ["Never", "During safestart", "Always"], + ["Never", "During safe start", "Always"], 0 ], // default value 1 // isGlobal @@ -15,11 +15,11 @@ [ QGVAR(rpUsage), "LIST", - "#rp available", + ["#rp command", "When players may use #rp in chat to move to a free spot nearby when they are stuck. Admins can always use it."], ["TMF", "Chat Commands"], [ [0, 1, 3 ], - ["Never", "During safestart", "Always"], + ["Never", "During safe start", "Always"], 0 ], // default value 1 // isGlobal @@ -28,11 +28,11 @@ [ QGVAR(tpUsage), "LIST", - "#tp available", + ["#tp command", "When players may use #tp in chat to teleport to another player or group. Admins can always use it."], ["TMF", "Chat Commands"], [ [0, 1, 2, 3 ], - ["Never", "During safestart", "During safestart & after respawn", "Always"], + ["Never", "During safe start", "During safe start and 5 min after respawn", "Always"], 0 ], // default value 1 // isGlobal @@ -41,7 +41,7 @@ [ QGVAR(whisperUsage), "LIST", - "#whisper available", + ["#whisper command", "Whether players may use #whisper in chat to send a private message to another player."], ["TMF", "Chat Commands"], [ [0, 3 ], @@ -54,11 +54,11 @@ [ QGVAR(specUsage), "LIST", - "#spec available", + ["#spec command", "When players may use #spec in chat to enter spectator. Admins can always use it."], ["TMF", "Chat Commands"], [ [0, 1, 2, 3 ], - ["Never", "During safestart", "During safestart & after respawn", "Always"], + ["Never", "During safe start", "During safe start and 5 min after respawn", "Always"], 0 ], // default value 1 // isGlobal @@ -68,11 +68,11 @@ if (isClass (configFile >> "CfgPatches" >> QUOTE(DOUBLES(PREFIX,assignGear)))) t [ QGVAR(loadoutUsage), "LIST", - "#loadout available", + ["#loadout command", "When players may use #loadout in chat to change or copy their loadout. Admins can always use it."], ["TMF", "Chat Commands"], [ [0, 1, 2, 3 ], - ["Never", "During safestart", "During safestart & after respawn", "Always"], + ["Never", "During safe start", "During safe start and 5 min after respawn", "Always"], 0 ], // default value 1 // isGlobal @@ -83,11 +83,11 @@ if (isClass (configFile >> "CfgPatches" >> QUOTE(DOUBLES(PREFIX,acre2)))) then { [ QGVAR(radioUsage), "LIST", - "#radio available", + ["#radio command", "When players may use #radio in chat to give themselves an ACRE2 radio. Admins can always use it."], ["TMF", "Chat Commands"], [ [0, 1, 2, 3 ], - ["Never", "During safestart", "During safestart & after respawn", "Always"], + ["Never", "During safe start", "During safe start and 5 min after respawn", "Always"], 0 ], // default value 1 // isGlobal diff --git a/addons/chat/script_component.hpp b/addons/chat/script_component.hpp index d30612f0..4bfed40e 100644 --- a/addons/chat/script_component.hpp +++ b/addons/chat/script_component.hpp @@ -1,6 +1,11 @@ +#ifndef TMF_CHAT_SCRIPT_COMPONENT_HPP +#define TMF_CHAT_SCRIPT_COMPONENT_HPP + #define COMPONENT chat #include "\x\tmf\addons\main\script_mod.hpp" #include "\x\tmf\addons\main\script_macros.hpp" #define CURUNIT (call CBA_fnc_currentUnit) + +#endif // TMF_CHAT_SCRIPT_COMPONENT_HPP diff --git a/addons/common/Cfg3DEN.hpp b/addons/common/Cfg3DEN.hpp index 13da4649..ef4ee623 100644 --- a/addons/common/Cfg3DEN.hpp +++ b/addons/common/Cfg3DEN.hpp @@ -30,7 +30,6 @@ class Cfg3DEN }; class Attributes { - class CheckboxNumber; class None { idc = -1; type = 0; style = 0; diff --git a/addons/common/CfgEventHandlers.hpp b/addons/common/CfgEventHandlers.hpp index 49c86404..b3202169 100644 --- a/addons/common/CfgEventHandlers.hpp +++ b/addons/common/CfgEventHandlers.hpp @@ -20,9 +20,6 @@ class Extended_Respawn_EventHandlers { }; class Extended_DisplayLoad_EventHandlers { - class RscDisplayMultiplayerSetup { - tmf_slotting = QUOTE(_this call (uiNamespace getVariable 'FUNC(initDisplayMultiplayerSetup)')); - }; class RscDisplayDebriefing { tmf_override_end_text = QUOTE(_this call (uiNamespace getVariable 'FUNC(initDisplayDebriefing)')); }; diff --git a/addons/common/CfgVehicles.hpp b/addons/common/CfgVehicles.hpp index af144f14..75237cff 100644 --- a/addons/common/CfgVehicles.hpp +++ b/addons/common/CfgVehicles.hpp @@ -1,12 +1,9 @@ -class cfgVehicles { - class All; - class Logic : All { - class Eventhandlers; - }; +class CfgVehicles { + class Logic; class GVAR(hideMapObjects) : Logic { displayName = "[TMF] Hide Map Objects"; - class Eventhandlers { + class EventHandlers { init = "call cba_xeh_fnc_init"; }; }; -}; \ No newline at end of file +}; diff --git a/addons/common/XEH_PREP.hpp b/addons/common/XEH_PREP.hpp index baea9944..9f6fe33f 100644 --- a/addons/common/XEH_PREP.hpp +++ b/addons/common/XEH_PREP.hpp @@ -35,7 +35,6 @@ PREP(edenHideMapObjects); PREP(hideMapObjectsInit); PREP(getPosVisual); PREP(initDisplayDebriefing); -PREP(initDisplayMultiplayerSetup); PREP(testGroupsSlottingScreen); PREP(secondsToTime); PREP(edenDisplayFactionIcons); diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index acaff59e..430dac21 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -24,7 +24,7 @@ if (isTMF) then { { params ["_unit", "_fullName"]; private _value = _unit getVariable ["sth_name", []]; - if ((count(_value) isEqualTo 0) || {!(isPlayer(_unit) isEqualTo (_value select 0))}) then + if ((count(_value) isEqualTo 0) || {(isPlayer(_unit) isNotEqualTo (_value select 0))}) then { private _newName = name (_unit); if (_newName != "") then { diff --git a/addons/common/config.cpp b/addons/common/config.cpp index 8d0e96f8..120029e7 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -1,6 +1,6 @@ #include "script_component.hpp" -class cfgPatches +class CfgPatches { class ADDON { diff --git a/addons/common/display3DEN.hpp b/addons/common/display3DEN.hpp index 7d1b8457..62ce0f88 100644 --- a/addons/common/display3DEN.hpp +++ b/addons/common/display3DEN.hpp @@ -3,7 +3,7 @@ class ctrlControlsGroupNoScrollbars; class ctrlCheckboxToolbar; class Separator1; -class display3DEN +class Display3DEN { class Controls { diff --git a/addons/common/functions/fnc_arrayToStringArray.sqf b/addons/common/functions/fnc_arrayToStringArray.sqf index 43a3a43a..267f87d8 100644 --- a/addons/common/functions/fnc_arrayToStringArray.sqf +++ b/addons/common/functions/fnc_arrayToStringArray.sqf @@ -10,5 +10,5 @@ private _text = ""; }; _text = _text + _t; }; -} foreach _arr; +} forEach _arr; format["{%1}",_text]; diff --git a/addons/common/functions/fnc_checkVersionArray.sqf b/addons/common/functions/fnc_checkVersionArray.sqf index 86d5acca..6a285fcc 100644 --- a/addons/common/functions/fnc_checkVersionArray.sqf +++ b/addons/common/functions/fnc_checkVersionArray.sqf @@ -28,4 +28,4 @@ if (_i1 > _r1) exitWith {true}; if (_i1 < _r1) exitWith {false}; if (_i2 < _r2) exitWith {false}; -true; \ No newline at end of file +true; diff --git a/addons/common/functions/fnc_deserializeWaypoint.sqf b/addons/common/functions/fnc_deserializeWaypoint.sqf index 41395222..5151a726 100644 --- a/addons/common/functions/fnc_deserializeWaypoint.sqf +++ b/addons/common/functions/fnc_deserializeWaypoint.sqf @@ -31,7 +31,7 @@ _wpData params [ '_attachedObject', '_attachedVehicle' ]; -_wp = _group addWaypoint [_pos, -1, _wpIndex, _name]; +private _wp = _group addWaypoint [_pos, -1, _wpIndex, _name]; _wp setWaypointType _type; _wp setWaypointBehaviour _behaviour; _wp setWaypointCombatMode _combatMode; diff --git a/addons/common/functions/fnc_edenDisplayFactionIcons.sqf b/addons/common/functions/fnc_edenDisplayFactionIcons.sqf index 7796aadd..942ae6aa 100644 --- a/addons/common/functions/fnc_edenDisplayFactionIcons.sqf +++ b/addons/common/functions/fnc_edenDisplayFactionIcons.sqf @@ -14,10 +14,10 @@ private ["_i", "_faction", "_factionIcon"]; for "_i" from 0 to ((_x tvCount []) - 1) do { _faction = _x tvData [_i]; - if !(_faction isEqualTo "") then { + if (_faction isNotEqualTo "") then { _factionIcon = getText (configFile >> "CfgFactionClasses" >> _faction >> "icon"); - if !(_factionIcon isEqualTo "") then { + if (_factionIcon isNotEqualTo "") then { _x tvSetPictureRight [[_i], _factionIcon]; }; }; diff --git a/addons/common/functions/fnc_edenDraw.sqf b/addons/common/functions/fnc_edenDraw.sqf index 29cac8c0..bcf4bbc4 100644 --- a/addons/common/functions/fnc_edenDraw.sqf +++ b/addons/common/functions/fnc_edenDraw.sqf @@ -18,4 +18,4 @@ if (GVAR(Garrison)) then { [] call FUNC(edenMouseKeyDown); }; -[] call FUNC(edenHideMapObjects); \ No newline at end of file +[] call FUNC(edenHideMapObjects); diff --git a/addons/common/functions/fnc_edenHideMapObjects.sqf b/addons/common/functions/fnc_edenHideMapObjects.sqf index 2e02e033..07c3673a 100644 --- a/addons/common/functions/fnc_edenHideMapObjects.sqf +++ b/addons/common/functions/fnc_edenHideMapObjects.sqf @@ -61,4 +61,4 @@ if (current3DENOperation == "MoveItems" || current3DENOperation == "RotateItems" _x setVariable [QGVAR(intersections),_ints]; { _x hideObjectGlobal true } forEach _ints; } forEach ((get3DENSelected "Logic") select {_x isKindOf QGVAR(hideMapObjects)}); -}; \ No newline at end of file +}; diff --git a/addons/common/functions/fnc_edenInit.sqf b/addons/common/functions/fnc_edenInit.sqf index 31a8eadd..aee3c6ed 100644 --- a/addons/common/functions/fnc_edenInit.sqf +++ b/addons/common/functions/fnc_edenInit.sqf @@ -20,7 +20,7 @@ call FUNC(edenDisplayFactionIcons); // Add mouseOver EH private _idx = missionNamespace getVariable [QGVAR(edenDrawIdx), -1]; -if !(_idx == -1) then { +if (_idx != -1) then { removeMissionEventHandler ["Draw3D", _idx]; }; @@ -35,20 +35,20 @@ GVAR(posIdxs) = []; // do stuff with mouseOver EH // KeyDown -GVAR(edenMouseKeyDownIdx) = ((findDisplay 313) displayAddEventHandler ["mouseButtonDown", { +GVAR(edenMouseKeyDownIdx) = ((findDisplay 313) displayAddEventHandler ["MouseButtonDown", { GVAR(mouseKeysPressed) pushBackUnique (_this select 1); }]); // EDEN IDC 313 // KeyUp -GVAR(edenMouseKeyUpIdx) = ((findDisplay 313) displayAddEventHandler ["mouseButtonUp", { +GVAR(edenMouseKeyUpIdx) = ((findDisplay 313) displayAddEventHandler ["MouseButtonUp", { [_this select 1] call FUNC(edenMouseKeyUp); GVAR(mouseKeysPressed) = GVAR(mouseKeysPressed) - [(_this select 1)]; }]); // MouseZchanged -GVAR(edenMouseZchangedIdx) = ((findDisplay 313) displayAddEventHandler ["mouseZchanged", { +GVAR(edenMouseZchangedIdx) = ((findDisplay 313) displayAddEventHandler ["MouseZChanged", { if (GVAR(Garrison)) then { private _A =+ GVAR(posIdxs); private _B = []; - while { count _A > 0 } do { + while { _A isNotEqualTo [] } do { _B pushBack (_A deleteAt floor random count _A) }; GVAR(posIdxs) = +_B; @@ -106,4 +106,4 @@ add3DENEventHandler ["OnMissionPreviewEnd", { _x isKindOf QGVAR(hideMapObjects) }); }; -}]; \ No newline at end of file +}]; diff --git a/addons/common/functions/fnc_edenMouseKeyDown.sqf b/addons/common/functions/fnc_edenMouseKeyDown.sqf index 8691b109..76f988da 100644 --- a/addons/common/functions/fnc_edenMouseKeyDown.sqf +++ b/addons/common/functions/fnc_edenMouseKeyDown.sqf @@ -19,13 +19,13 @@ // Select building from mouseOvers private _building = GVAR(edenMouseObjects); _building = _building select {!(_x in (get3DENSelected "Object"))}; -if (count _building == 0) exitWith {}; +if (_building isEqualTo []) exitWith {}; _building = _building select 0; private _positions = _building buildingPos -1; if (count _positions < 1) exitWith {}; // Draw boundingbox -if (!(typeOf _building isEqualTo "") && {count (_building buildingPos -1) > 0}) then { +if ((typeOf _building isNotEqualTo "") && {_building buildingPos -1 isNotEqualTo []}) then { private _fn_bbox = { params ["_pos1","_pos2"]; private _bbx = [_pos1 select 0,_pos2 select 0]; @@ -56,7 +56,7 @@ if (!(typeOf _building isEqualTo "") && {count (_building buildingPos -1) > 0}) }; private _validIdxs = _building getVariable [QGVAR(validIdxs),[]]; -if ((count _validIdxs == 0) || {diag_frameno % 15 == 0}) then { // Also recalc every 15 frames, also seems to randomize order? +if ((count _validIdxs == 0) || {diag_frameNo % 15 == 0}) then { // Also recalc every 15 frames, also seems to randomize order? _validIdxs = []; { // Check for obstruction //TODO Zsorting? @@ -64,7 +64,7 @@ if ((count _validIdxs == 0) || {diag_frameno % 15 == 0}) then { // Also recalc e // Lags for buildings with >10 positions private _nearObjects = (_x nearObjects ["Static",2]) + (_x nearObjects ["ThingX",2]) + (_x nearObjects ["AllVehicles",2]) - [_building]; if (current3DENOperation == "MoveItems") then {_nearObjects = _nearObjects - MANOBJECTS}; - if (count _nearObjects == 0) then { + if (_nearObjects isEqualTo []) then { _validIdxs pushBack _forEachIndex; }; } forEach _positions; diff --git a/addons/common/functions/fnc_edenMouseKeyUp.sqf b/addons/common/functions/fnc_edenMouseKeyUp.sqf index 0b843989..fa60e6c6 100644 --- a/addons/common/functions/fnc_edenMouseKeyUp.sqf +++ b/addons/common/functions/fnc_edenMouseKeyUp.sqf @@ -26,7 +26,7 @@ if (current3DENOperation != "MoveItems") exitWith {}; private _building = GVAR(edenMouseObjects); if isNil "_building" exitWith {}; _building = _building select {!(_x in (get3DENSelected "Object"))}; - if (count _building == 0) exitWith {}; + if (_building isEqualTo []) exitWith {}; if (count GVAR(posIdxs) == 0) exitWith {}; _building = _building select 0; do3DENAction "Undo"; // Undo movement @@ -39,4 +39,4 @@ if (current3DENOperation != "MoveItems") exitWith {}; } forEach MANOBJECTS; }; GVAR(posIdxs) = []; -}; \ No newline at end of file +}; diff --git a/addons/common/functions/fnc_edenMouseOver.sqf b/addons/common/functions/fnc_edenMouseOver.sqf index 3fecdc45..ef6a1b82 100644 --- a/addons/common/functions/fnc_edenMouseOver.sqf +++ b/addons/common/functions/fnc_edenMouseOver.sqf @@ -18,11 +18,11 @@ private _intersects = lineIntersectsSurfaces [getPosASL get3DENCamera,ATLToASL screenToWorld getMousePosition,objNull,objNull,true,5,"FIRE","GEOM"]; _intersects = _intersects apply {_x select 2}; _intersects = _intersects select {!(isNull _x)}; -if !(current3DENOperation == "") then { +if (current3DENOperation != "") then { _intersects = _intersects select {!(_x in (get3DENSelected "object"))}; // Remove selected objects if they're being dragged. }; -if !(GVAR(edenMouseObjects) isEqualTo _intersects) then { +if (GVAR(edenMouseObjects) isNotEqualTo _intersects) then { GVAR(edenMouseObjects) = _intersects; [QGVAR(edenMouseOverChanged),GVAR(edenMouseObjects)] call CBA_fnc_localEvent; } else { diff --git a/addons/common/functions/fnc_endMission.sqf b/addons/common/functions/fnc_endMission.sqf index 7ac3976b..4c4fd91e 100644 --- a/addons/common/functions/fnc_endMission.sqf +++ b/addons/common/functions/fnc_endMission.sqf @@ -20,14 +20,14 @@ if (missionNamespace getVariable [QGVAR(ending),false]) exitWith {}; // Already // Message admins private _message = format["[TMF] Ending mission..."]; -[_message,'tac1_admin_fnc_messageAdmin',true] call BIS_fnc_MP; +[_message, false, "Mission"] call EFUNC(adminmenu,log); GVAR(endMissionWait) = -1; GVAR(ending) = true; if (!isNil "ocap_fnc_exportData") then { _message = format["[TMF] OCAP detected exporting (10 second timeout)..."]; - [_message,'tac1_admin_fnc_messageAdmin',true] call BIS_fnc_MP; + [_message, false, "Mission"] call EFUNC(adminmenu,log); GVAR(endMissionWait) = time + 10; //Give OCAP 10 seconds. @@ -36,7 +36,7 @@ if (!isNil "ocap_fnc_exportData") then { { [] call ocap_fnc_exportData; private _message = format["[TMF] OCAP Export complete. Ending..."]; - [_message,'tac1_admin_fnc_messageAdmin',true] call BIS_fnc_MP; + [_message, false, "Mission"] call EFUNC(adminmenu,log); GVAR(endMissionWait) = -1; } call CBA_fnc_directCall; }; @@ -49,5 +49,5 @@ if (!isNil "ocap_fnc_exportData") then { //TODO - Replace with our own splashscreen //[endName,isVictory,fadeType,playMusic,completeTasks] spawn BIS_fnc_endMission; [{time > GVAR(endMissionWait)},{ - [(_this select 0),'BIS_fnc_endMission',true] call BIS_fnc_MP; // End the mission for everyone. + (_this select 0) remoteExec ["BIS_fnc_endMission", 0]; // End the mission for everyone. }, [_this]] call CBA_fnc_waitUntilAndExecute; diff --git a/addons/common/functions/fnc_getNearestRoad.sqf b/addons/common/functions/fnc_getNearestRoad.sqf index 381487e6..961b1376 100644 --- a/addons/common/functions/fnc_getNearestRoad.sqf +++ b/addons/common/functions/fnc_getNearestRoad.sqf @@ -2,7 +2,7 @@ params ["_point",["_radius",100]]; private _roads = _point nearRoads _radius; private _road = objNull; -if(count _roads > 0) then { +if(_roads isNotEqualTo []) then { { _roads set [_forEachIndex, [_x distance _point, _x]]; } forEach _roads; diff --git a/addons/common/functions/fnc_getPosVisual.sqf b/addons/common/functions/fnc_getPosVisual.sqf index 2133dc55..11d57d19 100644 --- a/addons/common/functions/fnc_getPosVisual.sqf +++ b/addons/common/functions/fnc_getPosVisual.sqf @@ -1,6 +1,6 @@ params ["_object"]; -_pos = getPosATLVisual _object; +private _pos = getPosATLVisual _object; if(surfaceIsWater _pos) then { _pos = getPosASLVisual _object; }; -_pos \ No newline at end of file +_pos diff --git a/addons/common/functions/fnc_initDisplayDebriefing.sqf b/addons/common/functions/fnc_initDisplayDebriefing.sqf index c6639a69..248482d3 100644 --- a/addons/common/functions/fnc_initDisplayDebriefing.sqf +++ b/addons/common/functions/fnc_initDisplayDebriefing.sqf @@ -9,9 +9,9 @@ if (!isNil QGVAR(EndMissionText)) then { disableSerialization; params ["_display"]; GVAR(EndMissionText) params [["_titleText",""],["_subtitleText",""]]; - private _titleCtrl = _display displayctrl 20600; - private _subtitleCtrl = _display displayctrl 20601; - _titleCtrl ctrlsettext toUpper _titleText; + private _titleCtrl = _display displayCtrl 20600; + private _subtitleCtrl = _display displayCtrl 20601; + _titleCtrl ctrlSetText toUpper _titleText; if (_subtitleText != "") then { if (ctrlText _subtitleCtrl == "") then { @@ -20,17 +20,17 @@ if (!isNil QGVAR(EndMissionText)) then { private _subtitlePosStart = +_subtitlePosFinal; _subtitlePosStart set [0,(_subtitlePosStart select 0) + (_subtitlePosStart select 2) / 2]; _subtitlePosStart set [2,0]; - _subtitleCtrl ctrlsetposition _subtitlePosStart; + _subtitleCtrl ctrlSetPosition _subtitlePosStart; _subtitleCtrl ctrlSetFade 0; - _subtitleCtrl ctrlcommit 0; - _subtitleCtrl ctrlshow false; + _subtitleCtrl ctrlCommit 0; + _subtitleCtrl ctrlShow false; [_subtitleCtrl,_subtitlePosFinal] spawn { disableSerialization; params ["_subtitleCtrl","_subtitlePosFinal"]; sleep 2; - _subtitleCtrl ctrlshow true; - _subtitleCtrl ctrlsetposition _subtitlePosFinal; - _subtitleCtrl ctrlcommit 0.4; + _subtitleCtrl ctrlShow true; + _subtitleCtrl ctrlSetPosition _subtitlePosFinal; + _subtitleCtrl ctrlCommit 0.4; }; }; // Update the text. @@ -38,7 +38,7 @@ if (!isNil QGVAR(EndMissionText)) then { } else { _subtitleCtrl ctrlSetFade 1; _subtitleCtrl ctrlCommit 0; - _subtitleCtrl ctrlshow false; + _subtitleCtrl ctrlShow false; }; }, [_display]] call CBA_fnc_execNextFrame; }; diff --git a/addons/common/functions/fnc_initDisplayMultiplayerSetup.sqf b/addons/common/functions/fnc_initDisplayMultiplayerSetup.sqf deleted file mode 100644 index 4819c524..00000000 --- a/addons/common/functions/fnc_initDisplayMultiplayerSetup.sqf +++ /dev/null @@ -1,66 +0,0 @@ -// Updates the group names on the slotting/lobby screen. - -#include "\x\tmf\addons\common\script_component.hpp" - -params ["_display"]; - -// Deprecated in newer versions, replaced by CBA system -// https://github.com/CBATeam/CBA_A3/wiki/Name-Groups-in-Lobby -if ([[1,1,0]] call FUNC(checkTMFVersion)) exitWith {}; - -private _fn_update_group_names_in_lobby = { - params ["_display"]; - private _slotListControl = _display displayCtrl 109; - - private _lastGroupName = ""; - for "_playerListIdx" from 1 to (lbSize _slotListControl) do { - private _currentText = _slotListControl lbText 0; - private _currentValue = _slotListControl lbValue 0; - - // delete old lb entry (replace later) - _slotListControl lbDelete 0; - - if (_currentValue isEqualTo -1) then { - // Value is -1 when it's a groupname. - - // Collect descriptions of upcoming roles/terminate if another group appears. - private _descriptions = []; - for "_idx" from 0 to (lbSize _slotListControl -1) do { - private _currentValue = _slotListControl lbValue _idx; - if (_currentValue isEqualTo -1) exitWith {}; // Terminate upon reaching next group. - _descriptions pushBack (_slotListControl lbText _idx); - }; - _descriptions = _descriptions apply {(/*toLower*/ _x) splitString " "}; - if (count _descriptions > 1) then { - private _common = _descriptions select 0; - _common = _common select [0,count _common -1]; // Ensure the last word isn't used so every description has at least one word. - { - // Ensure common is not more tokens than the present description and one less than the current ensures that every slot has at least one word remaining. - _common resize (((count _x)-1) min (count _common)); - for "_idx2" from 0 to (count _common -1) do { - if (_common select _idx2 != _x select _idx2) exitWith { _common resize _idx2;} - }; - } forEach _descriptions; - _lastGroupName = _common joinString " "; - } else { - _lastGroupName = ""; - }; - - if (_lastGroupName != "") then { - _currentText = _lastGroupName; - }; - } else { - _currentText = _currentText select [count _lastGroupName]; - }; - - // Add new entry. - private _slotListIdx = _slotListControl lbAdd _currentText; - _slotListControl lbSetValue [_slotListIdx, _currentValue]; - }; -}; - -_display call _fn_update_group_names_in_lobby; - -// Refresh constantly. -_display displayAddEventHandler ["MouseMoving", _fn_update_group_names_in_lobby]; -_display displayAddEventHandler ["MouseHolding", _fn_update_group_names_in_lobby]; diff --git a/addons/common/functions/fnc_intro.sqf b/addons/common/functions/fnc_intro.sqf index 14d78ef5..76478a16 100644 --- a/addons/common/functions/fnc_intro.sqf +++ b/addons/common/functions/fnc_intro.sqf @@ -8,11 +8,11 @@ if (_value) then { _msg = _msg + format ['
%1', ([dayTime, 'HH:MM'] call BIS_fnc_timeToString)]; [ _msg, - [safezoneX + safezoneW - 0.8,0.50], - [safezoneY + safezoneH - 0.8,0.8], + [safeZoneX + safeZoneW - 0.8,0.50], + [safeZoneY + safeZoneH - 0.8,0.8], 5, 0.5 ] spawn BIS_fnc_dynamicText; }; },nil] call CBA_fnc_waitUntilAndExecute; -}; \ No newline at end of file +}; diff --git a/addons/common/functions/fnc_isAdmin.sqf b/addons/common/functions/fnc_isAdmin.sqf index a3375eca..270d2fb3 100644 --- a/addons/common/functions/fnc_isAdmin.sqf +++ b/addons/common/functions/fnc_isAdmin.sqf @@ -26,4 +26,4 @@ if (!isNil "tac1_adminIDs") then { }; }; -_return \ No newline at end of file +_return diff --git a/addons/common/functions/fnc_moduleUnits.sqf b/addons/common/functions/fnc_moduleUnits.sqf index bf79062b..ceac7504 100644 --- a/addons/common/functions/fnc_moduleUnits.sqf +++ b/addons/common/functions/fnc_moduleUnits.sqf @@ -12,7 +12,7 @@ switch (_logic getVariable ["TMFUnits",-1]) do { case (1): { { _units append units _x; - } foreach synchronizedObjects _logic; + } forEach synchronizedObjects _logic; }; case (2): { { @@ -21,4 +21,4 @@ switch (_logic getVariable ["TMFUnits",-1]) do { } forEach synchronizedObjects _logic; }; }; -_units arrayIntersect _units \ No newline at end of file +_units arrayIntersect _units diff --git a/addons/common/functions/fnc_numToColor.sqf b/addons/common/functions/fnc_numToColor.sqf index 35890887..05ac50bc 100644 --- a/addons/common/functions/fnc_numToColor.sqf +++ b/addons/common/functions/fnc_numToColor.sqf @@ -34,4 +34,4 @@ private _color = switch (_number) do { default {"#FFAB06"}; }; // return color -_color \ No newline at end of file +_color diff --git a/addons/common/functions/fnc_numToTexture.sqf b/addons/common/functions/fnc_numToTexture.sqf index 53e22e35..241fbaa4 100644 --- a/addons/common/functions/fnc_numToTexture.sqf +++ b/addons/common/functions/fnc_numToTexture.sqf @@ -23,4 +23,4 @@ if (_num == 6) exitWith {"x\tmf\addons\common\UI\numbers\6.paa"}; if (_num == 7) exitWith {"x\tmf\addons\common\UI\numbers\7.paa"}; if (_num == 8) exitWith {"x\tmf\addons\common\UI\numbers\8.paa"}; if (_num == 9) exitWith {"x\tmf\addons\common\UI\numbers\9.paa"}; -"x\tmf\addons\common\UI\numbers\0.paa" \ No newline at end of file +"x\tmf\addons\common\UI\numbers\0.paa" diff --git a/addons/common/functions/fnc_randPosArea.sqf b/addons/common/functions/fnc_randPosArea.sqf index 02ebcba7..7a71517a 100644 --- a/addons/common/functions/fnc_randPosArea.sqf +++ b/addons/common/functions/fnc_randPosArea.sqf @@ -20,7 +20,7 @@ Author: SilentSpike 2015-07-06 ---------------------------------------------------------------------------- */ -params ["_area",["_perimeter",false,true]]; +params ["_area",["_perimeter",false,[false]]]; _area params ["_center","_a","_b","_angle","_isRect"]; diff --git a/addons/common/functions/fnc_secondsToTime.sqf b/addons/common/functions/fnc_secondsToTime.sqf index 41b334db..7f7ff627 100644 --- a/addons/common/functions/fnc_secondsToTime.sqf +++ b/addons/common/functions/fnc_secondsToTime.sqf @@ -30,4 +30,4 @@ if(_padding) then { if(_seconds < 10) then {_seconds = format["0%1",_seconds]} else {_seconds = str _seconds}; }; -[_hours, _minutes, _seconds] \ No newline at end of file +[_hours, _minutes, _seconds] diff --git a/addons/common/functions/fnc_serializeWaypoint.sqf b/addons/common/functions/fnc_serializeWaypoint.sqf index 03bba7bd..e79d3b6f 100644 --- a/addons/common/functions/fnc_serializeWaypoint.sqf +++ b/addons/common/functions/fnc_serializeWaypoint.sqf @@ -27,4 +27,4 @@ private _way = [ waypointAttachedObject _this, waypointAttachedVehicle _this ]; -_way \ No newline at end of file +_way diff --git a/addons/common/functions/fnc_sideToColor.sqf b/addons/common/functions/fnc_sideToColor.sqf index 9c857bf9..c870f6ed 100644 --- a/addons/common/functions/fnc_sideToColor.sqf +++ b/addons/common/functions/fnc_sideToColor.sqf @@ -27,4 +27,4 @@ switch _this do { case independent: {tmf_common_indep_color}; case civilian: {tmf_common_civ_color}; default {tmf_common_empty_color}; -}; \ No newline at end of file +}; diff --git a/addons/common/functions/fnc_sideToNum.sqf b/addons/common/functions/fnc_sideToNum.sqf index aa29d8b5..b3bd7f64 100644 --- a/addons/common/functions/fnc_sideToNum.sqf +++ b/addons/common/functions/fnc_sideToNum.sqf @@ -18,4 +18,4 @@ if (_return isEqualTo -1) then { _return = 4; // sideUnknown }; -_return; \ No newline at end of file +_return; diff --git a/addons/common/functions/fnc_sideToString.sqf b/addons/common/functions/fnc_sideToString.sqf index a981ac1f..668c49ea 100644 --- a/addons/common/functions/fnc_sideToString.sqf +++ b/addons/common/functions/fnc_sideToString.sqf @@ -17,4 +17,4 @@ if (_this == east) exitWith { "OPFOR"; }; if (_this == independent) exitWith {"Independent"}; if (_this == civilian) exitWith { "Civilian";}; if (_this == sideLogic) exitWith { "Logic";}; -"Unknown" \ No newline at end of file +"Unknown" diff --git a/addons/common/functions/fnc_sideToTexture.sqf b/addons/common/functions/fnc_sideToTexture.sqf index 70b52397..87e665c5 100644 --- a/addons/common/functions/fnc_sideToTexture.sqf +++ b/addons/common/functions/fnc_sideToTexture.sqf @@ -17,4 +17,4 @@ if (_this == east) exitWith {"\a3\3DEN\Data\Displays\Display3DEN\PanelRight\side if (_this == independent) exitWith {"\a3\3DEN\Data\Displays\Display3DEN\PanelRight\side_guer_ca.paa";}; if (_this == civilian) exitWith {"\a3\3DEN\Data\Displays\Display3DEN\PanelRight\side_civ_ca.paa";}; if (_this == sideLogic) exitWith {"\a3\3DEN\Data\Displays\Display3DEN\PanelRight\side_custom_ca.paa";}; -"\a3\3DEN\Data\Displays\Display3DEN\PanelRight\side_empty_ca.paa" \ No newline at end of file +"\a3\3DEN\Data\Displays\Display3DEN\PanelRight\side_empty_ca.paa" diff --git a/addons/common/functions/fnc_sideType.sqf b/addons/common/functions/fnc_sideType.sqf index f5e288b8..6356fc8e 100644 --- a/addons/common/functions/fnc_sideType.sqf +++ b/addons/common/functions/fnc_sideType.sqf @@ -14,4 +14,4 @@ params ["_side"]; _side = _side max 0 min 3; -["east", "west", "resistance", "civilian"] select _side \ No newline at end of file +["east", "west", "resistance", "civilian"] select _side diff --git a/addons/common/functions/fnc_testGroupsSlottingScreen.sqf b/addons/common/functions/fnc_testGroupsSlottingScreen.sqf index eef3e8d2..16d795b7 100644 --- a/addons/common/functions/fnc_testGroupsSlottingScreen.sqf +++ b/addons/common/functions/fnc_testGroupsSlottingScreen.sqf @@ -14,66 +14,16 @@ private _output = []; -// Deprecated in newer versions, replaced by CBA system -// https://github.com/CBATeam/CBA_A3/wiki/Name-Groups-in-Lobby -if ([[1,1,0]] call FUNC(checkTMFVersion)) then { - // Find groups with playableUnits - private _groups = []; - {_groups pushBackUnique (group _x);} forEach playableUnits; +{ + private _desc = (_x get3DENAttribute "description") # 0; - private _outputGroups = []; - { - private _group = _x; - private _descriptions = []; - private _skip = false; - { - private _description = (_x get3DENAttribute "description") select 0; - if (_description find "@" != -1) exitWith {_skip = true}; - _descriptions pushBack _description; - } forEach (units _group select {_x in playableUnits}); - if (!_skip) then { - _descriptions = _descriptions apply {(/*toLower*/ _x) splitString " "}; - if (count (units _group) > 1) then { - private _common = _descriptions select 0; - { - // Ensure common is not more tokens than the present description. - _common resize ((count _x) min (count _common)); - for "_idx2" from 0 to (count _common -1) do { - //diag_log str [_idx2,"c",_common,"d",_descriptions]; - if (_common select _idx2 != _x select _idx2) exitWith { _common resize _idx2;} - }; - } forEach _descriptions; - //diag_log str ["group",_common,"d",_descriptions]; - //_common = _common apply {/*toUpper*/ (_x select [0,1]) + (_x select [1])}; - if (count _common == 0) then { - // No common part. - _outputGroups pushBackUnique _group; - }; - }; + if (_desc isEqualTo "") then { + _output pushBack [1,format ["%1 has no role description, so the lobby shows only its class name.",_x]]; + } else { + if !("@" in _desc) then { + _output pushBack [1,format ["Role %1 has no lobby group name. Write it as %1@Group Name.", _desc]]; }; - } forEach _groups; - - if (count _outputGroups > 0) then { - _output pushBack [1,"Some groups do not have a slotting screen name:"]; - private _string = ""; - { - _string = _string + ((side _x) call BIS_fnc_sideName) + " - " + groupID _x + ", "; - } forEach _outputGroups; - _output pushBack [1,format ["groups (%1): %2",count _outputGroups,_string]]; }; -} else { - private _units = (playableUnits + [player]); - { - private _desc = (_x get3DENAttribute "description") # 0; - - if (_desc isEqualTo "") then { - _output pushBack [1,format ["Unit lacks role description: %1",_x]]; - } else { - if !("@" in _desc) then { - _output pushBack [1,format ["Unit lacks slotting group name: %1 (should be: %1@Group Name)", _desc]]; - }; - }; - } forEach (playableUnits + [player]); -}; +} forEach (playableUnits + [player] - [objNull]); _output diff --git a/addons/common/initSettings.sqf b/addons/common/initSettings.sqf index f9cf284d..fc804e46 100644 --- a/addons/common/initSettings.sqf +++ b/addons/common/initSettings.sqf @@ -3,7 +3,7 @@ if (isClass (configFile >> "CfgPatches" >> "ace_safemode")) then { [ QGVAR(weaponSafety), "CHECKBOX", - "Enable ACE Weapon Safety on mission start", + ["Weapons on safe at mission start", "Players start the mission with ACE weapon safety on. Requires ACE."], ["TMF", "Common"], true, 0, diff --git a/addons/common/script_component.hpp b/addons/common/script_component.hpp index 96156fd4..d316a532 100644 --- a/addons/common/script_component.hpp +++ b/addons/common/script_component.hpp @@ -1,5 +1,9 @@ +#ifndef TMF_COMMON_SCRIPT_COMPONENT_HPP +#define TMF_COMMON_SCRIPT_COMPONENT_HPP + #define COMPONENT common #include "\x\tmf\addons\main\script_mod.hpp" #include "\x\tmf\addons\main\script_macros.hpp" +#endif // TMF_COMMON_SCRIPT_COMPONENT_HPP diff --git a/addons/main/config.cpp b/addons/main/config.cpp index 373130b6..5a515500 100644 --- a/addons/main/config.cpp +++ b/addons/main/config.cpp @@ -1,6 +1,6 @@ #include "script_component.hpp" -class cfgPatches { +class CfgPatches { class ADDON { name = "TMF: Main"; author = "Nick"; diff --git a/addons/main/script_component.hpp b/addons/main/script_component.hpp index d6f61328..ef789420 100644 --- a/addons/main/script_component.hpp +++ b/addons/main/script_component.hpp @@ -1,4 +1,9 @@ +#ifndef TMF_MAIN_SCRIPT_COMPONENT_HPP +#define TMF_MAIN_SCRIPT_COMPONENT_HPP + #define COMPONENT main #include "\x\tmf\addons\main\script_mod.hpp" -#include "\x\tmf\addons\main\script_macros.hpp" \ No newline at end of file +#include "\x\tmf\addons\main\script_macros.hpp" + +#endif // TMF_MAIN_SCRIPT_COMPONENT_HPP diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index 6b4cf2f2..38aff0a5 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -5,7 +5,8 @@ #define MINOR 0 #define PATCH 0 -#define VERSION MAJOR.MINOR.PATCH +#define VERSION MAJOR.MINOR +#define VERSION_STR MAJOR.MINOR.PATCH #define VERSION_AR MAJOR,MINOR,PATCH -#define REQUIRED_VERSION 1.56 \ No newline at end of file +#define REQUIRED_VERSION 2.18 diff --git a/addons/marker/config.cpp b/addons/marker/config.cpp index bcad1445..67ac93ea 100644 --- a/addons/marker/config.cpp +++ b/addons/marker/config.cpp @@ -1,6 +1,6 @@ #include "script_component.hpp" -class cfgPatches +class CfgPatches { class ADDON { diff --git a/addons/marker/functions/fnc_hide.sqf b/addons/marker/functions/fnc_hide.sqf index 0a7850c4..97208ab3 100644 --- a/addons/marker/functions/fnc_hide.sqf +++ b/addons/marker/functions/fnc_hide.sqf @@ -4,4 +4,4 @@ if(_side != 1 && side player == west) exitWith {_mkrName setMarkerAlphaLocal 0}; if(_side != 0 && side player == east) exitWith {_mkrName setMarkerAlphaLocal 0}; if(_side != 2 && side player == resistance) exitWith {_mkrName setMarkerAlphaLocal 0}; if(_side != 3 && side player == civilian) exitWith {_mkrName setMarkerAlphaLocal 0}; -if(_side == 4) exitWith {_mkrName setMarkerAlphaLocal 0}; \ No newline at end of file +if(_side == 4) exitWith {_mkrName setMarkerAlphaLocal 0}; diff --git a/addons/marker/script_component.hpp b/addons/marker/script_component.hpp index 49feda5d..dde580c6 100644 --- a/addons/marker/script_component.hpp +++ b/addons/marker/script_component.hpp @@ -1,4 +1,9 @@ +#ifndef TMF_MARKER_SCRIPT_COMPONENT_HPP +#define TMF_MARKER_SCRIPT_COMPONENT_HPP + #define COMPONENT marker #include "\x\tmf\addons\main\script_mod.hpp" #include "\x\tmf\addons\main\script_macros.hpp" + +#endif // TMF_MARKER_SCRIPT_COMPONENT_HPP diff --git a/addons/modules/CfgEventHandlers.hpp b/addons/modules/CfgEventHandlers.hpp index 182c3de4..3e038d73 100644 --- a/addons/modules/CfgEventHandlers.hpp +++ b/addons/modules/CfgEventHandlers.hpp @@ -5,12 +5,7 @@ XEH_PREINIT; class Extended_InitPost_EventHandlers { class GVAR(ambientVehicles) { class ADDON { - init = QUOTE( \ - params ['_logic']; \ - if (local _logic) then { \ - [ARR_2('preInit', [_logic])] call FUNC(ambientVehicleInit); \ - }; \ - ); + init = QUOTE(params ['_logic']; if (local _logic) then {[ARR_2('preInit',[_logic])] call FUNC(ambientVehicleInit)};); }; }; }; diff --git a/addons/modules/CfgModules.hpp b/addons/modules/CfgModules.hpp index 6da5fc95..28eacc15 100644 --- a/addons/modules/CfgModules.hpp +++ b/addons/modules/CfgModules.hpp @@ -3,20 +3,13 @@ class CfgVehicles { class Module_F: Logic { class AttributesBase { class Default; - class Edit; - class Combo; class Checkbox; - class CheckboxNumber; class ModuleDescription; - class Units; }; class ArgumentsBaseUnits { - class Units; }; class ModuleDescription { - class AnyBrain; }; - class EventHandlers; }; #include "modules\ambientVehicles.hpp" }; diff --git a/addons/modules/functions/fnc_ambientVehicleInit.sqf b/addons/modules/functions/fnc_ambientVehicleInit.sqf index b26930da..59587ed9 100644 --- a/addons/modules/functions/fnc_ambientVehicleInit.sqf +++ b/addons/modules/functions/fnc_ambientVehicleInit.sqf @@ -1,4 +1,4 @@ -#include "../script_component.hpp" +#include "\x\tmf\addons\modules\script_component.hpp" /* ---------------------------------------------------------------------------- Internal Function: TMF_modules_fnc_ambientVehicleInit @@ -17,7 +17,7 @@ ---------------------------------------------------------------------------- */ params ["_mode", "_input"]; -TRACE_2("Initializing Ambient Vehicles module", _mode, _input); +TRACE_2("Initializing Ambient Vehicles module",_mode,_input); _input params ["_logic"]; private _code = _logic getVariable [QGVAR(code), ""]; @@ -41,11 +41,11 @@ switch _mode do { _x distance2D _obj < 500 }) == -1) then { deleteVehicle _obj; - TRACE_2("Ambient vehicles despawning vehicle", _logic, _obj); + TRACE_2("Ambient vehicles despawning vehicle",_logic,_obj); INC(_count); }; } forEach (_logic getVariable [QGVAR(spawnedVehicles), []]); - TRACE_2("Ambient vehicles finished despawning vehicles", _logic, _count); + TRACE_2("Ambient vehicles finished despawning vehicles",_logic,_count); _logic setVariable [QGVAR(vehicleNumber), _count, true]; true }; @@ -53,12 +53,12 @@ switch _mode do { if (isNil { _logic getVariable QGVAR(data) }) then { - TRACE_1("Ambient Vehicles post init run before pre init, running preinit now", _logic); + TRACE_1("Ambient Vehicles post init run before pre init, running preinit now",_logic); ["preInit", _logic] call FUNC(ambientVehicleInit); }; private _moduleData = _logic getVariable QGVAR(data); - ASSERT_DEFINED("_moduleData", "Ambient Vehicles module failed init, postInit ran before preInit!"); + ASSERT_DEFINED("_moduleData","Ambient Vehicles module failed init, postInit ran before preInit!"); _moduleData params [ ["_vehicleTypes", []], @@ -68,11 +68,11 @@ switch _mode do { if (_area isEqualTo [] || { _area isEqualTo ([] call BIS_fnc_getArea) }) exitWith { - ERROR_MSG_1("No area module synchronized to Ambient Vehicles module: %1", _logic); + ERROR_MSG_1("No area module synchronized to Ambient Vehicles module: %1",_logic); }; if (_vehicleTypes isEqualTo []) exitWith { - ERROR_MSG_1("No vehicles synchronized to Ambient Vehicles module: %1", _logic); + ERROR_MSG_1("No vehicles synchronized to Ambient Vehicles module: %1",_logic); }; private _vehicles = [_area, _vehicleTypes, _vehicleNumber, _spacing] call FUNC(createAmbientVehicles); @@ -93,7 +93,7 @@ switch _mode do { _x call _code; } forEach _vehicles; - TRACE_2("Ambient Vehicles module spawned vehicles", _logic, _vehicles); + TRACE_2("Ambient Vehicles module spawned vehicles",_logic,_vehicles); _logic setVariable [QGVAR(spawnedVehicles), _vehicles, true]; }; @@ -103,17 +103,17 @@ switch _mode do { private _moduleData = _logic getVariable QGVAR(data); if (!is3DEN && !isNil "_moduleData") exitWith { - TRACE_2("Tried to run preInit on Ambient Vehicles module, but preInit has already been run", _logic, _moduleData); + TRACE_2("Tried to run preInit on Ambient Vehicles module, but preInit has already been run",_logic,_moduleData); }; if is3DEN then { private _connections = (get3DENConnections _logic); - FILTER(_connections, (_x select 0) isEqualTo "Sync"); + FILTER(_connections,(_x select 0) isEqualTo "Sync"); _syncedObjects = _connections apply { _x # 1 }; _area = (_syncedObjects select { - _x isKindOf QEGVAR(ai, area) + _x isKindOf QEGVAR(ai,area) }) param [0, objNull]; ((_area get3DENAttribute "size2") # 0) params [ @@ -133,7 +133,7 @@ switch _mode do { } else { _syncedObjects = synchronizedObjects _logic; _area = (_syncedObjects select { - _x isKindOf QEGVAR(ai, area) + _x isKindOf QEGVAR(ai,area) }) param [0, objNull]; _area = [getPos _area, _area getVariable "objectarea"] call BIS_fnc_getArea; }; @@ -158,7 +158,7 @@ switch _mode do { } forEach _this; }, _syncedObjects] call CBA_fnc_execNextFrame; - TRACE_2("Ambient Vehicle PreInit run with result", _vehicleTypes, _area); + TRACE_2("Ambient Vehicle PreInit run with result",_vehicleTypes,_area); _logic setVariable [QGVAR(data), [_vehicleTypes, _area]]; }; @@ -192,4 +192,4 @@ switch _mode do { } forEach (_logic getVariable [QGVAR(spawnedVehicles), []]); }; }; -true \ No newline at end of file +true diff --git a/addons/modules/functions/fnc_createAmbientVehicles.sqf b/addons/modules/functions/fnc_createAmbientVehicles.sqf index 01534372..fcaa5947 100644 --- a/addons/modules/functions/fnc_createAmbientVehicles.sqf +++ b/addons/modules/functions/fnc_createAmbientVehicles.sqf @@ -1,4 +1,4 @@ -#include "../script_component.hpp" +#include "\x\tmf\addons\modules\script_component.hpp" /* ---------------------------------------------------------------------------- Internal Function: TMF_modules_fnc_createAmbientVehicles diff --git a/addons/modules/script_component.hpp b/addons/modules/script_component.hpp index 571750b5..5ab5dfc3 100644 --- a/addons/modules/script_component.hpp +++ b/addons/modules/script_component.hpp @@ -1,6 +1,11 @@ +#ifndef TMF_MODULES_SCRIPT_COMPONENT_HPP +#define TMF_MODULES_SCRIPT_COMPONENT_HPP + #define COMPONENT modules //#define DEBUG_MODE_FULL #include "\x\tmf\addons\main\script_mod.hpp" #include "\x\tmf\addons\main\script_macros.hpp" + +#endif // TMF_MODULES_SCRIPT_COMPONENT_HPP diff --git a/addons/orbat/Cfg3DEN.hpp b/addons/orbat/Cfg3DEN.hpp index bbb0703f..73419d3f 100644 --- a/addons/orbat/Cfg3DEN.hpp +++ b/addons/orbat/Cfg3DEN.hpp @@ -150,19 +150,15 @@ "_sl_flag.paa" -class ctrlDefault; -class ctrlDefaultText;// : ctrlDefault; class ctrlStatic;// : ctrlDefaultText; -class ctrlListNBox;// : ctrlDefaultText; class ctrlTree;// : ctrlDefaultText; class ctrlEdit;// : ctrlDefaultText; -class ctrlToolBox;// : ctrlDefaultText; +class ctrlToolbox;// : ctrlDefaultText; class ctrlCombo; class RscButtonMenu; -class RscText; -class cfgScriptPaths +class CfgScriptPaths { TMF_orbat = "x\tmf\addons\orbat\ui_scripts\"; // " // comment here for Bad parser. }; diff --git a/addons/orbat/Cfg3DEN/Attributes.hpp b/addons/orbat/Cfg3DEN/Attributes.hpp index ec6d3f00..20cd3652 100644 --- a/addons/orbat/Cfg3DEN/Attributes.hpp +++ b/addons/orbat/Cfg3DEN/Attributes.hpp @@ -7,7 +7,6 @@ class Attributes { class Controls { - class Title; }; }; #include "attr_team.hpp" diff --git a/addons/orbat/Cfg3DEN/Mission.hpp b/addons/orbat/Cfg3DEN/Mission.hpp index 0448d8fc..fc7bcf54 100644 --- a/addons/orbat/Cfg3DEN/Mission.hpp +++ b/addons/orbat/Cfg3DEN/Mission.hpp @@ -19,7 +19,7 @@ class Mission control = "Checkbox"; //expression = "missionNamespace setVariable ['TMF_ORBAT_Tracker',_value];"; tooltip = "Use this option to disable elements of the ORBAT being displayed on the map."; - defaultValue = false; + defaultValue = QUOTE(false); condition = "1"; wikiType = "[[String]]"; }; @@ -41,7 +41,7 @@ class Mission control = "Checkbox"; //expression = "missionNamespace setVariable ['TMF_ORBAT_MarkersFT',_value];"; tooltip = "Use this option to disable drawing members of the current player's fireteam on the map."; - defaultValue = false; + defaultValue = QUOTE(false); condition = "1"; wikiType = "[[String]]"; }; @@ -52,7 +52,7 @@ class Mission control = "Checkbox"; expression = "missionNamespace setVariable ['TMF_ORBAT_MarkersFT_Directional',_value,true];"; tooltip = "Set whether fireteam map markers are directional or not."; - defaultValue = false; + defaultValue = QUOTE(false); condition = "1"; wikiType = "[[String]]"; }; diff --git a/addons/orbat/Cfg3DEN/attr_orbatSettings.hpp b/addons/orbat/Cfg3DEN/attr_orbatSettings.hpp index 3f17bbb4..d52ad0a3 100644 --- a/addons/orbat/Cfg3DEN/attr_orbatSettings.hpp +++ b/addons/orbat/Cfg3DEN/attr_orbatSettings.hpp @@ -8,16 +8,16 @@ class ORBATSettings : Toolbox attributeLoad = "['attributeLoad',_this] call (uinamespace getvariable 'ORBATSettings_script');"; attributeSave = "['attributeSave',_this] call (uinamespace getvariable 'ORBATSettings_script');"; - w = (ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W) * GRID_W; - h = 25 * SIZE_M * GRID_H; //20 + w = QUOTE((ATTRIBUTE_TITLE_W + ATTRIBUTE_CONTENT_W) * GRID_W); + h = QUOTE(25 * SIZE_M * GRID_H); //20 class Controls { class LangTitle : ctrlStatic { text = "Split ORBATs by:"; style = ST_RIGHT; - w = ATTRIBUTE_TITLE_W * GRID_W; - h = 1 * SIZE_M * GRID_H; + w = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + h = QUOTE(1 * SIZE_M * GRID_H); y = 0; x = 0; colorBackground[] = {0,0,0,0}; @@ -26,11 +26,11 @@ class ORBATSettings : Toolbox class Value: ctrlToolbox { idc = 100; - x = ATTRIBUTE_TITLE_W * GRID_W; - w = ATTRIBUTE_CONTENT_W * GRID_W; + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + w = QUOTE(ATTRIBUTE_CONTENT_W * GRID_W); style = ST_CENTER + ST_KEEP_ASPECT_RATIO; //ST_PICTURE + y = 0; - h = 1 * SIZE_M * GRID_H; + h = QUOTE(1 * SIZE_M * GRID_H); rows = 1; columns = 2; strings[] = {"Side", "Faction"}; @@ -46,10 +46,10 @@ class ORBATSettings : Toolbox align = "center"; }; text = "< Configure X >"; - h = SIZE_M * GRID_H; - x = SIZE_M * GRID_W; - w = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W); - y = 2 * SIZE_M * GRID_H; + h = QUOTE(SIZE_M * GRID_H); + x = QUOTE(SIZE_M * GRID_W); + w = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W)); + y = QUOTE(2 * SIZE_M * GRID_H); action = "['orbatToggleButton',_this] call (uinamespace getvariable 'ORBATSettings_script');"; tooltip = "Toggle through the various sides/factions (Only toggles through sides/factions with playable units)"; }; @@ -57,9 +57,9 @@ class ORBATSettings : Toolbox { idc = 103; text = "Orbat hierarchy:"; - x = SIZE_M * GRID_W; + x = QUOTE(SIZE_M * GRID_W); style = ST_LEFT; - y = 3 * SIZE_M * GRID_H; + y = QUOTE(3 * SIZE_M * GRID_H); tooltip = "Hierarchy tree of ORBAT"; }; @@ -75,10 +75,10 @@ class ORBATSettings : Toolbox { idc = 104; text = "Move"; - h = SIZE_M * GRID_H; - x = SIZE_M * GRID_W; - w = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W)/4; - y = 4 * SIZE_M * GRID_H; + h = QUOTE(SIZE_M * GRID_H); + x = QUOTE(SIZE_M * GRID_W); + w = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W)/4); + y = QUOTE(4 * SIZE_M * GRID_H); action = "['treeMoveClick',_this] call (uinamespace getvariable 'ORBATSettings_script');"; tooltip = "Move the selected element"; }; @@ -86,7 +86,7 @@ class ORBATSettings : Toolbox { idc = 105; text = "Add"; - x = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W)/4 + SIZE_M * GRID_W; + x = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W)/4 + SIZE_M * GRID_W); action = "['treeAddClick',_this] call (uinamespace getvariable 'ORBATSettings_script');"; tooltip = "Add a new virtual element as a child of the selected element. You can not create a virtual element on a real group."; }; @@ -94,7 +94,7 @@ class ORBATSettings : Toolbox { idc = 106; text = "Edit"; - x = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W)/4 *2 + SIZE_M * GRID_W; + x = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W)/4 *2 + SIZE_M * GRID_W); action = "['treeEditClick',_this] call (uinamespace getvariable 'ORBATSettings_script');"; tooltip = "Edit the orbat settings for the selected element"; }; @@ -102,17 +102,17 @@ class ORBATSettings : Toolbox { idc = 107; text = "Delete"; - x = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W)/4 *3 + SIZE_M * GRID_W; + x = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W)/4 *3 + SIZE_M * GRID_W); action = "['treeDelClick',_this] call (uinamespace getvariable 'ORBATSettings_script');"; tooltip = "Delete the virtual element. This will not delete real groups"; }; class OrbatTree : ctrlTree { idc = 102; - x = SIZE_M * GRID_W; - w = (ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - (3.5*SIZE_M)) * GRID_W; - y = 5 * SIZE_M * GRID_H; - h = 19 * SIZE_M * GRID_H; + x = QUOTE(SIZE_M * GRID_W); + w = QUOTE((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - (3.5*SIZE_M)) * GRID_W); + y = QUOTE(5 * SIZE_M * GRID_H); + h = QUOTE(19 * SIZE_M * GRID_H); multiselectEnabled = 1; disableKeyboardSearch = 1; colorDisabled[] = {1,1,1,0.25}; @@ -140,17 +140,17 @@ class ORBATSettings : Toolbox colorBackground2[] = {1,1,1,0.5}; text = ""; - h = 1*SIZE_M * GRID_H;//(ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W * 0.1; //SIZE_M * GRID_H; //keep square - x = (ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - (2.5*SIZE_M)) * GRID_W; - w = 2.5*SIZE_M * GRID_W; //(ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W * 0.1; - y = 8.3 * SIZE_M * GRID_H; + h = QUOTE(1*SIZE_M * GRID_H);//(ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W * 0.1; //SIZE_M * GRID_H; //keep square + x = QUOTE((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - (2.5*SIZE_M)) * GRID_W); + w = QUOTE(2.5*SIZE_M * GRID_W); //(ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W - SIZE_M) * GRID_W * 0.1; + y = QUOTE(8.3 * SIZE_M * GRID_H); action = "['moveTop',_this] call (uinamespace getvariable 'ORBATSettings_script');"; tooltip = "Move the current entry to the top."; }; class TreeUp : TreeTop { idc = 125; - y = 10.45* SIZE_M * GRID_H; + y = QUOTE(10.45* SIZE_M * GRID_H); animTextureNormal = "\a3\ui_f\data\gui\Rsc\RscDisplayMultiplayer\arrow_up_ca.paa"; animTextureDisabled = "\a3\ui_f\data\gui\Rsc\RscDisplayMultiplayer\arrow_up_ca.paa"; @@ -171,7 +171,7 @@ class ORBATSettings : Toolbox animTextureFocused = "\a3\ui_f\data\gui\Rsc\RscDisplayMultiplayer\arrow_down_ca.paa"; animTexturePressed = "\a3\ui_f\data\gui\Rsc\RscDisplayMultiplayer\arrow_down_ca.paa"; animTextureDefault = "\a3\ui_f\data\gui\Rsc\RscDisplayMultiplayer\arrow_down_ca.paa"; - y = 12.6 * SIZE_M * GRID_H; + y = QUOTE(12.6 * SIZE_M * GRID_H); action = "['moveDown',_this] call (uinamespace getvariable 'ORBATSettings_script');"; tooltip = "Move the current entry down."; }; @@ -185,7 +185,7 @@ class ORBATSettings : Toolbox animTextureDefault = "\x\tmf\addons\orbat\ui\arrow_bottom_ca.paa"; idc = 127; - y = 14.75 * SIZE_M * GRID_H; + y = QUOTE(14.75 * SIZE_M * GRID_H); action = "['moveBottom',_this] call (uinamespace getvariable 'ORBATSettings_script');"; tooltip = "Move the current entry to the bottom."; }; @@ -195,20 +195,20 @@ class ORBATSettings : Toolbox { idc = 120; text = "Select the new parent (double click)"; - w = (ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W-SIZE_M) * GRID_W; - x = SIZE_M * GRID_W; + w = QUOTE((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W-SIZE_M) * GRID_W); + x = QUOTE(SIZE_M * GRID_W); style = ST_LEFT; - y = 3.25 * SIZE_M * GRID_H; + y = QUOTE(3.25 * SIZE_M * GRID_H); tooltip = "Hierarchy tree of ORBAT"; }; class MoveTree : ctrlTree { idc = 108; - x = 1 * SIZE_M * GRID_W; - w = (ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W-SIZE_M) * GRID_W; - y = 4.5 * SIZE_M * GRID_H; - h = 19 * SIZE_M * GRID_H; + x = QUOTE(1 * SIZE_M * GRID_W); + w = QUOTE((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W-SIZE_M) * GRID_W); + y = QUOTE(4.5 * SIZE_M * GRID_H); + h = QUOTE(19 * SIZE_M * GRID_H); multiselectEnabled = 1; disableKeyboardSearch = 1; colorDisabled[] = {1,1,1,0.25}; @@ -220,8 +220,8 @@ class ORBATSettings : Toolbox { idc = 121; text = "Cancel"; - y = 24 * SIZE_M * GRID_H; - x = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 8)*4.5 + SIZE_M * GRID_W; + y = QUOTE(24 * SIZE_M * GRID_H); + x = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 8)*4.5 + SIZE_M * GRID_W); action = "['editOrbatEntryClickCancel',_this] call (uinamespace getvariable 'ORBATSettings_script');"; tooltip = "Cancel moving the element."; }; @@ -231,18 +231,18 @@ class ORBATSettings : Toolbox { idc = 109; text = "Add/Edit heirarchy piece:"; - x = SIZE_M * GRID_W; + x = QUOTE(SIZE_M * GRID_W); style = ST_LEFT; - y = 3 * SIZE_M * GRID_H; + y = QUOTE(3 * SIZE_M * GRID_H); tooltip = "Hierarchy tree of ORBAT"; }; class GmTitle: ctrlStatic { idc = 110; x = 0; - w = ATTRIBUTE_TITLE_W * GRID_W; - h = SIZE_M * GRID_H; - y = 4 * SIZE_M * GRID_H; + w = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + h = QUOTE(SIZE_M * GRID_H); + y = QUOTE(4 * SIZE_M * GRID_H); colorBackground[] = {0,0,0,0}; style = ST_RIGHT; text = "Marker icon"; @@ -251,11 +251,11 @@ class ORBATSettings : Toolbox class Icon: ctrlToolbox { idc = 111; - x = ATTRIBUTE_TITLE_W * GRID_W; - w = ATTRIBUTE_CONTENT_W * GRID_W; + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + w = QUOTE(ATTRIBUTE_CONTENT_W * GRID_W); style = ST_CENTER + ST_PICTURE + ST_KEEP_ASPECT_RATIO; - h = 12.25 * SIZE_M * GRID_H; - y = 4 * SIZE_M * GRID_H; + h = QUOTE(12.25 * SIZE_M * GRID_H); + y = QUOTE(4 * SIZE_M * GRID_H); rows = 7; columns = 7; strings[] = {GROUP_MARKER_PREVIEW}; @@ -270,18 +270,18 @@ class ORBATSettings : Toolbox class ColourTitle: GmTitle { idc = 112; - y = (4+12.25+0.15) * SIZE_M * GRID_H; + y = QUOTE((4+12.25+0.15) * SIZE_M * GRID_H); text = "Marker colour"; tooltip = "Select the colour to use for the marker"; }; class ColourValue: ctrlToolbox { idc = 113; - x = ATTRIBUTE_TITLE_W * GRID_W; - w = ATTRIBUTE_CONTENT_W * GRID_W; + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + w = QUOTE(ATTRIBUTE_CONTENT_W * GRID_W); style = ST_CENTER + ST_PICTURE + ST_KEEP_ASPECT_RATIO; - y = (4+12.25+0.15) * SIZE_M * GRID_H; - h = 1.75 * SIZE_M * GRID_H; + y = QUOTE((4+12.25+0.15) * SIZE_M * GRID_H); + h = QUOTE(1.75 * SIZE_M * GRID_H); rows = 1; columns = 7; @@ -319,47 +319,47 @@ class ORBATSettings : Toolbox class MarkerTitle: GmTitle { idc = 114; - y = (4+14+0.3) * SIZE_M * GRID_H; + y = QUOTE((4+14+0.3) * SIZE_M * GRID_H); text = "Marker text"; tooltip = "Text to display alongside the marker. This should ideally be a short string e.g. 'A'"; }; class EditMarkerTitleValue : ctrlEdit { - y = (4+14+0.3) * SIZE_M * GRID_H; + y = QUOTE((4+14+0.3) * SIZE_M * GRID_H); idc = 115; - x = ATTRIBUTE_TITLE_W * GRID_W; - w = ATTRIBUTE_CONTENT_W * GRID_W; - h = SIZE_M * GRID_H; + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + w = QUOTE(ATTRIBUTE_CONTENT_W * GRID_W); + h = QUOTE(SIZE_M * GRID_H); }; class FullTitle: MarkerTitle { idc = 122; - y = (4+15+0.45) * SIZE_M * GRID_H; + y = QUOTE((4+15+0.45) * SIZE_M * GRID_H); text = "Briefing text"; tooltip = "Text to display for this entry in the briefing. E.g. 'Alpha Squad', '1st Platoon'"; }; class EditFullTitleValue : EditMarkerTitleValue { - y = (4+15+0.45) * SIZE_M * GRID_H; + y = QUOTE((4+15+0.45) * SIZE_M * GRID_H); idc = 123; - x = ATTRIBUTE_TITLE_W * GRID_W; + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); }; // Size class sizeTitle: GmTitle { idc = 116; - y = (4+16+0.6) * SIZE_M * GRID_H; + y = QUOTE((4+16+0.6) * SIZE_M * GRID_H); text = "Marker size modifier"; tooltip = "Size modifier"; }; class sizeValue: ctrlToolbox { idc = 117; - x = ATTRIBUTE_TITLE_W * GRID_W; - w = ATTRIBUTE_CONTENT_W * GRID_W; + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + w = QUOTE(ATTRIBUTE_CONTENT_W * GRID_W); style = ST_CENTER + ST_PICTURE + ST_KEEP_ASPECT_RATIO; - y = (4+16+0.6) * SIZE_M * GRID_H; - h = 1.75 * SIZE_M * GRID_H; + y = QUOTE((4+16+0.6) * SIZE_M * GRID_H); + h = QUOTE(1.75 * SIZE_M * GRID_H); colorBackground[] = {1,1,1,0.3}; rows = 1; @@ -395,17 +395,17 @@ class ORBATSettings : Toolbox { idc = 118; text = "Ok"; - y = 23.5 * SIZE_M * GRID_H; - w = ((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 6; - x = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 6)*1.5 + SIZE_M * GRID_W; - h = SIZE_M * GRID_H; + y = QUOTE(23.5 * SIZE_M * GRID_H); + w = QUOTE(((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 6); + x = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 6)*1.5 + SIZE_M * GRID_W); + h = QUOTE(SIZE_M * GRID_H); action = "['editOrbatEntryClickOkay',_this] call (uinamespace getvariable 'ORBATSettings_script');"; }; class EditOrbatEntryCancel : EditOrbatEntryOk { idc = 119; text = "Cancel"; - x = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 6)*3.5 + SIZE_M * GRID_W; + x = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - SIZE_M ) * GRID_W / 6)*3.5 + SIZE_M * GRID_W); action = "['editOrbatEntryClickCancel',_this] call (uinamespace getvariable 'ORBATSettings_script');"; }; diff --git a/addons/orbat/Cfg3DEN/attr_renamer.hpp b/addons/orbat/Cfg3DEN/attr_renamer.hpp index e247b9bb..58b5a4c7 100644 --- a/addons/orbat/Cfg3DEN/attr_renamer.hpp +++ b/addons/orbat/Cfg3DEN/attr_renamer.hpp @@ -3,14 +3,14 @@ class TMF_ORBAT_Renamer : Title onLoad = "uiNamespace setVariable ['TMF_OrbatRenamer_ctrlGroup', (_this select 0)];"; attributeLoad = ""; attributeSave = "true"; - h = 5 * SIZE_M * GRID_H; + h = QUOTE(5 * SIZE_M * GRID_H); class Controls : Controls { class renamerTitle: ctrlStatic { - x = SIZE_M * GRID_W * 2; - w = (ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) * GRID_W; - h = SIZE_M * GRID_H; + x = QUOTE(SIZE_M * GRID_W * 2); + w = QUOTE((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) * GRID_W); + h = QUOTE(SIZE_M * GRID_H); y = 0; colorBackground[] = {0,0,0,0}; text = "Find & Replace - Group & unit descriptions."; @@ -19,9 +19,9 @@ class TMF_ORBAT_Renamer : Title class renamerFindTitle: ctrlStatic { x = 0; - w = ATTRIBUTE_TITLE_W * GRID_W; - h = SIZE_M * GRID_H; - y = SIZE_M * GRID_H; + w = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + h = QUOTE(SIZE_M * GRID_H); + y = QUOTE(SIZE_M * GRID_H); colorBackground[] = {0,0,0,0}; style = ST_RIGHT; text = "Find what:"; @@ -29,7 +29,7 @@ class TMF_ORBAT_Renamer : Title }; class renamerReplaceTitle : renamerFindTitle { - y = 2.15 * SIZE_M * GRID_H; + y = QUOTE(2.15 * SIZE_M * GRID_H); text = "Replace with:"; }; class Value : ctrlEdit @@ -44,15 +44,15 @@ class TMF_ORBAT_Renamer : Title colorSelection[] = {COLOR_ACTIVE_RGBA}; // Text selection color canModify = 1; // True (1) to allow text editing, 0 to disable it autocomplete = ""; // Text autocomplete, can be "scripting" (scripting commands) or "general" (previously typed text) - y = 1 * SIZE_M * GRID_H; - x = ATTRIBUTE_TITLE_W * GRID_W; - h = SIZE_M * GRID_H; - w = (ATTRIBUTE_CONTENT_W -(3.5* SIZE_M)) * GRID_W; + y = QUOTE(1 * SIZE_M * GRID_H); + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + h = QUOTE(SIZE_M * GRID_H); + w = QUOTE((ATTRIBUTE_CONTENT_W -(3.5* SIZE_M)) * GRID_W); }; class Value2 : Value { idc = 101; - y = 2.15 * SIZE_M * GRID_H; + y = QUOTE(2.15 * SIZE_M * GRID_H); }; class orbatRenamerButton : RscButtonMenu { @@ -61,10 +61,10 @@ class TMF_ORBAT_Renamer : Title align = "center"; }; text = "Replace all"; - h = SIZE_M * GRID_H; - x = (8*SIZE_M * GRID_W); - w = (((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - (16*SIZE_M) ) * GRID_W); - y = 3.5 * SIZE_M * GRID_H; + h = QUOTE(SIZE_M * GRID_H); + x = QUOTE((8*SIZE_M * GRID_W)); + w = QUOTE((((ATTRIBUTE_TITLE_W+ATTRIBUTE_CONTENT_W) - (16*SIZE_M) ) * GRID_W)); + y = QUOTE(3.5 * SIZE_M * GRID_H); action = "[] call (missionNamespace getVariable 'tmf_orbat_fnc_renameUnitAndGroups');"; //action = "['orbatToggleButton',_this] call (uinamespace getvariable 'ORBATSettings_script');"; }; diff --git a/addons/orbat/Cfg3DEN/attr_team.hpp b/addons/orbat/Cfg3DEN/attr_team.hpp index 3f780885..85d62c05 100644 --- a/addons/orbat/Cfg3DEN/attr_team.hpp +++ b/addons/orbat/Cfg3DEN/attr_team.hpp @@ -14,17 +14,17 @@ class TMF_ORBAT_team: Combo class Title: ctrlStatic { style = 0x01; x = 0; - w = ATTRIBUTE_TITLE_W * GRID_W; - h = SIZE_M * GRID_H; + w = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + h = QUOTE(SIZE_M * GRID_H); colorBackground[] = {0,0,0,0}; }; class ValueRole: ctrlCombo { idc = 100; onLoad = "uiNamespace setVariable ['AttributeTMF_Orbat_team',_this select 0];"; - x = ATTRIBUTE_TITLE_W * GRID_W; - w = ATTRIBUTE_CONTENT_W * GRID_W; - h = SIZE_M * GRID_H; + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + w = QUOTE(ATTRIBUTE_CONTENT_W * GRID_W); + h = QUOTE(SIZE_M * GRID_H); }; }; }; diff --git a/addons/orbat/Cfg3DEN/attr_twGroupMarker.hpp b/addons/orbat/Cfg3DEN/attr_twGroupMarker.hpp index 7ecfd0dc..2430858d 100644 --- a/addons/orbat/Cfg3DEN/attr_twGroupMarker.hpp +++ b/addons/orbat/Cfg3DEN/attr_twGroupMarker.hpp @@ -8,15 +8,15 @@ class twGroupMarker: Toolbox attributeLoad = "['attributeLoad',_this,_value] call (uinamespace getvariable 'GroupMarker_script');"; attributeSave = "['attributeSave',_this] call (uinamespace getvariable 'GroupMarker_script');"; - h = (16.75+0.45) * SIZE_M * GRID_H; + h = QUOTE((16.75+0.45) * SIZE_M * GRID_H); class Controls { // ICON class GmTitle: ctrlStatic { x = 0; - w = ATTRIBUTE_TITLE_W * GRID_W; - h = SIZE_M * GRID_H; + w = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + h = QUOTE(SIZE_M * GRID_H); y = 0; colorBackground[] = {0,0,0,0}; style = ST_RIGHT; @@ -26,10 +26,10 @@ class twGroupMarker: Toolbox class Icon: ctrlToolbox { idc = 100; - x = ATTRIBUTE_TITLE_W * GRID_W; - w = ATTRIBUTE_CONTENT_W * GRID_W; + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + w = QUOTE(ATTRIBUTE_CONTENT_W * GRID_W); style = ST_CENTER + ST_PICTURE + ST_KEEP_ASPECT_RATIO; - h = 12.25 * SIZE_M * GRID_H; + h = QUOTE(12.25 * SIZE_M * GRID_H); rows = 7; columns = 7; @@ -44,18 +44,18 @@ class twGroupMarker: Toolbox // Colours class ColourTitle: GmTitle { - y = (12.25+0.15) * SIZE_M * GRID_H; + y = QUOTE((12.25+0.15) * SIZE_M * GRID_H); text = "Marker colour"; tooltip = "Select the colour to use for the marker"; }; class ColourValue: ctrlToolbox { idc = 101; - x = ATTRIBUTE_TITLE_W * GRID_W; - w = ATTRIBUTE_CONTENT_W * GRID_W; + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + w = QUOTE(ATTRIBUTE_CONTENT_W * GRID_W); style = ST_CENTER + ST_PICTURE + ST_KEEP_ASPECT_RATIO; - y = (12.25+0.15) * SIZE_M * GRID_H; - h = 1.75 * SIZE_M * GRID_H; + y = QUOTE((12.25+0.15) * SIZE_M * GRID_H); + h = QUOTE(1.75 * SIZE_M * GRID_H); rows = 1; columns = 7; @@ -92,33 +92,33 @@ class twGroupMarker: Toolbox // MARKER TEXT class MarkerTitle: GmTitle { - y = (14+0.3) * SIZE_M * GRID_H; + y = QUOTE((14+0.3) * SIZE_M * GRID_H); text = "Marker text"; tooltip = "Text to display alongside the marker"; }; class EditValue : ctrlEdit { - y = (14+0.3) * SIZE_M * GRID_H; + y = QUOTE((14+0.3) * SIZE_M * GRID_H); idc = 102; - x = ATTRIBUTE_TITLE_W * GRID_W; - w = ATTRIBUTE_CONTENT_W * GRID_W; - h = SIZE_M * GRID_H; + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + w = QUOTE(ATTRIBUTE_CONTENT_W * GRID_W); + h = QUOTE(SIZE_M * GRID_H); }; // Size class sizeTitle: GmTitle { - y = (15+0.45) * SIZE_M * GRID_H; + y = QUOTE((15+0.45) * SIZE_M * GRID_H); text = "Marker size modifier"; tooltip = "Size modifier"; }; class sizeValue: ctrlToolbox { idc = 103; - x = ATTRIBUTE_TITLE_W * GRID_W; - w = ATTRIBUTE_CONTENT_W * GRID_W; + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + w = QUOTE(ATTRIBUTE_CONTENT_W * GRID_W); style = ST_CENTER + ST_PICTURE + ST_KEEP_ASPECT_RATIO; - y = (15+0.45) * SIZE_M * GRID_H; - h = 1.75 * SIZE_M * GRID_H; + y = QUOTE((15+0.45) * SIZE_M * GRID_H); + h = QUOTE(1.75 * SIZE_M * GRID_H); colorBackground[] = {1,1,1,0.3}; rows = 1; diff --git a/addons/orbat/Cfg3DEN/attr_twUnitMarker.hpp b/addons/orbat/Cfg3DEN/attr_twUnitMarker.hpp index 010d9059..aac8b142 100644 --- a/addons/orbat/Cfg3DEN/attr_twUnitMarker.hpp +++ b/addons/orbat/Cfg3DEN/attr_twUnitMarker.hpp @@ -8,15 +8,15 @@ class twUnitMarker: Toolbox attributeLoad = "['attributeLoad',_this] call (uinamespace getvariable 'UnitMarker_script');"; attributeSave = "['attributeSave',_this] call (uinamespace getvariable 'UnitMarker_script');"; - h = (9+0.2) * SIZE_M * GRID_H; + h = QUOTE((9+0.2) * SIZE_M * GRID_H); class Controls { // ICON class GmTitle: ctrlStatic { x = 0; - w = ATTRIBUTE_TITLE_W * GRID_W; - h = SIZE_M * GRID_H; + w = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + h = QUOTE(SIZE_M * GRID_H); y = 0; colorBackground[] = {0,0,0,0}; style = ST_RIGHT; @@ -26,10 +26,10 @@ class twUnitMarker: Toolbox class Icon: ctrlToolbox { idc = 100; - x = ATTRIBUTE_TITLE_W * GRID_W; - w = ATTRIBUTE_CONTENT_W * GRID_W; + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + w = QUOTE(ATTRIBUTE_CONTENT_W * GRID_W); style = ST_CENTER + ST_PICTURE + ST_KEEP_ASPECT_RATIO; - h = 6 * SIZE_M * GRID_H; + h = QUOTE(6 * SIZE_M * GRID_H); rows = 3; columns = 7; strings[] = {UNIT_MARKER_PREVIEW}; @@ -43,18 +43,18 @@ class twUnitMarker: Toolbox // Colours class ColourTitle: GmTitle { - y = (6+0.15) * SIZE_M * GRID_H; + y = QUOTE((6+0.15) * SIZE_M * GRID_H); text = "Marker colour"; tooltip = "Select the colour to use for the marker"; }; class ColourValue: ctrlToolbox { idc = 101; - x = ATTRIBUTE_TITLE_W * GRID_W; - w = ATTRIBUTE_CONTENT_W * GRID_W; + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + w = QUOTE(ATTRIBUTE_CONTENT_W * GRID_W); style = ST_CENTER + ST_PICTURE + ST_KEEP_ASPECT_RATIO; - y = (6+0.15) * SIZE_M * GRID_H; - h = 1.75 * SIZE_M * GRID_H; + y = QUOTE((6+0.15) * SIZE_M * GRID_H); + h = QUOTE(1.75 * SIZE_M * GRID_H); rows = 1; columns = 7; strings[] = { @@ -90,17 +90,17 @@ class twUnitMarker: Toolbox // MARKER TEXT class MarkerTitle: GmTitle { - y = 8 * SIZE_M * GRID_H; + y = QUOTE(8 * SIZE_M * GRID_H); text = "Marker text"; tooltip = "Text to display alongside the icon"; }; class EditValue : ctrlEdit { - y = 8 * SIZE_M * GRID_H; + y = QUOTE(8 * SIZE_M * GRID_H); idc = 102; - x = ATTRIBUTE_TITLE_W * GRID_W; - w = ATTRIBUTE_CONTENT_W * GRID_W; - h = SIZE_M * GRID_H; + x = QUOTE(ATTRIBUTE_TITLE_W * GRID_W); + w = QUOTE(ATTRIBUTE_CONTENT_W * GRID_W); + h = QUOTE(SIZE_M * GRID_H); }; }; }; diff --git a/addons/orbat/XEH_postInit.sqf b/addons/orbat/XEH_postInit.sqf index 83ec079a..0a320b3f 100644 --- a/addons/orbat/XEH_postInit.sqf +++ b/addons/orbat/XEH_postInit.sqf @@ -24,9 +24,9 @@ if (isClass(configFile >> "CfgPatches" >> "tao_foldmap_a3")) then { while {true} do { private _display = displayNull; waitUntil {sleep 1;_display = (uiNamespace getVariable ["tao_foldmap",displayNull]); !isNull _display}; - private _control1 = _display displayctrl 40; - (_display displayctrl 40) ctrlAddEventHandler ["draw",{_this call FUNC(draw)}]; - (_display displayctrl 41) ctrlAddEventHandler ["draw",{_this call FUNC(draw)}]; + private _control1 = _display displayCtrl 40; + (_display displayCtrl 40) ctrlAddEventHandler ["Draw",{_this call FUNC(draw)}]; + (_display displayCtrl 41) ctrlAddEventHandler ["Draw",{_this call FUNC(draw)}]; waitUntil{sleep 1;isNull _control1}; }; }; diff --git a/addons/orbat/addon.toml b/addons/orbat/addon.toml deleted file mode 100644 index 1bc9698a..00000000 --- a/addons/orbat/addon.toml +++ /dev/null @@ -1,5 +0,0 @@ -[rapify] -enabled = false # Default: true -exclude = [ - "Cfg3DEN.hpp" -] \ No newline at end of file diff --git a/addons/orbat/config.cpp b/addons/orbat/config.cpp index adc7f761..0a42433b 100644 --- a/addons/orbat/config.cpp +++ b/addons/orbat/config.cpp @@ -1,6 +1,6 @@ #include "script_component.hpp" -class cfgPatches +class CfgPatches { class ADDON { diff --git a/addons/orbat/display3DEN.hpp b/addons/orbat/display3DEN.hpp index 8d8b6284..749991d8 100644 --- a/addons/orbat/display3DEN.hpp +++ b/addons/orbat/display3DEN.hpp @@ -1,5 +1,5 @@ class ctrlMenuStrip; -class display3DEN +class Display3DEN { class Controls { @@ -14,9 +14,9 @@ class display3DEN { text = "TMF ORBAT Settings"; action = "edit3DENMissionAttributes 'TMF_ORBAT_Settings';"; - picture = "\x\tmf\addons\common\UI\icon_gear_ca"; + picture = "\x\tmf\addons\common\UI\icon_gear_ca.paa"; }; }; }; }; -}; \ No newline at end of file +}; diff --git a/addons/orbat/functions/fnc_createBriefingPage.sqf b/addons/orbat/functions/fnc_createBriefingPage.sqf index a5c5653e..685fe682 100644 --- a/addons/orbat/functions/fnc_createBriefingPage.sqf +++ b/addons/orbat/functions/fnc_createBriefingPage.sqf @@ -78,8 +78,6 @@ private _fnc_findValidParents = { { _x call _fnc_findValidParents; } forEach _children; - - _data pushBack _added; }; _ourData call _fnc_findValidParents; @@ -194,7 +192,7 @@ _fnc_processOrbatTrackerBriefingRawData = { private _thisBriefing = ""; if (_entity isEqualType objNull) then { private _veh = _entity; - private _vehDisplayName = [getText (configFile >> "CfgVehicles" >> (typeOf _veh) >> "displayname"),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_- "] call BIS_fnc_filterString; + private _vehDisplayName = [getText (configOf _veh >> "displayname"),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_- "] call BIS_fnc_filterString; private _callsign = _veh getVariable [QGVAR(vehicleCallsign),""]; if (_callsign isEqualTo "") then { @@ -203,30 +201,30 @@ _fnc_processOrbatTrackerBriefingRawData = { }; _vehDisplayName = _vehDisplayName + " (" + _callsign + ")"; - private _vehIcon = getText(configfile >> "CfgVehicles" >> typeof _veh >> "picture"); + private _vehIcon = getText(configOf _veh >> "picture"); if (_groupTexture == "\x\tmf\addons\orbat\textures\empty.paa") then { _thisBriefing = format ["%1",_indent]; } else { _thisBriefing = format ["%1",_indent,_groupTexture]; }; - private _maxSlots = getNumber(configfile >> "CfgVehicles" >> typeof _veh >> "transportSoldier") + private _maxSlots = getNumber(configOf _veh >> "transportSoldier") + count (((allTurrets [_veh, true]) apply {[_veh, _x] call CBA_fnc_getTurret}) select { !((getNumber (_x >> "rhs_hatch_control") isEqualTo 1) && (getNumber (_x >> "isPersonTurret") isEqualTo 1)) }) - + getNumber(configfile >> "CfgVehicles" >> typeof _veh >> "hasDriver"); + + getNumber(configOf _veh >> "hasDriver"); private _occupiedSlots = count crew _veh; //private _color = [_allVehs find _veh] call EFUNC(common,numToColor); _thisBriefing = format ["%5 %1 [%3/%4]
",_vehDisplayName,_vehIcon,_occupiedSlots,_maxSlots, _thisBriefing]; } else { // Is Group. - _thisBriefing = format["%3 %2", _groupTexture, groupID _entity, _indent]; - private _grpVehicles = (units _entity select {!(vehicle _x isEqualTo _x)}) apply {vehicle _x}; + _thisBriefing = format["%3 %2", _groupTexture, groupId _entity, _indent]; + private _grpVehicles = (units _entity select {(vehicle _x isNotEqualTo _x)}) apply {vehicle _x}; _grpVehicles = _grpVehicles arrayIntersect _grpVehicles; { private _veh = _x; // check if vehicle has callsign. If not, use displayName - private _vehDisplayName = [getText (configFile >> "CfgVehicles" >> (typeOf _veh) >> "displayname"),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_- "] call BIS_fnc_filterString; + private _vehDisplayName = [getText (configOf _veh >> "displayname"),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_- "] call BIS_fnc_filterString; private _callsign = _veh getVariable [QGVAR(vehicleCallsign),""]; if (_callsign isEqualTo "") then { @@ -234,13 +232,13 @@ _fnc_processOrbatTrackerBriefingRawData = { _callsign = format ["Vic #%1",(_vehNum + 1)]; }; _vehDisplayName = _vehDisplayName + " (" + _callsign + ")"; - private _vehIcon = getText(configfile >> "CfgVehicles" >> typeof _veh >> "picture"); - private _maxSlots = getNumber(configfile >> "CfgVehicles" >> typeof _veh >> "transportSoldier") + private _vehIcon = getText(configOf _veh >> "picture"); + private _maxSlots = getNumber(configOf _veh >> "transportSoldier") + count (((allTurrets [_veh, true]) apply {[_veh, _x] call CBA_fnc_getTurret}) select { !((getNumber (_x >> "rhs_hatch_control") isEqualTo 1) && (getNumber (_x >> "isPersonTurret") isEqualTo 1)) }) - + getNumber(configfile >> "CfgVehicles" >> typeof _veh >> "hasDriver"); + + getNumber(configOf _veh >> "hasDriver"); private _occupiedSlots = count crew _veh; //private _color = [_allVehs find _veh] call EFUNC(common,numToColor); _thisBriefing = _thisBriefing + format [" ( %1 [%3/%4])",_vehDisplayName,_vehIcon,_occupiedSlots,_maxSlots]; @@ -250,7 +248,7 @@ _fnc_processOrbatTrackerBriefingRawData = { //Retrieve specialist marker otherwise use default vanilla icon private _markerEntry = _x getVariable ["TMF_SpecialistMarker",[]]; if (_markerEntry isEqualType "") then { _markerEntry = call compile _markerEntry; }; - private _unitImg = getText (configFile >> "CfgVehicleIcons" >> getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "icon")); + private _unitImg = getText (configFile >> "CfgVehicleIcons" >> getText (configOf _x >> "icon")); if (leader _entity == _x) then { _unitImg = "\A3\ui_f\data\map\vehicleicons\iconManLeader_ca.paa"; }; @@ -271,7 +269,7 @@ _fnc_processOrbatTrackerBriefingRawData = { case "Cannon"; case "Launcher"; case "RocketLauncher": { - if ((getNumber (configFile >> "CfgWeapons" >> (primaryWeapon _x) >> "rhsdisposable") == 1) or + if ((getNumber (configFile >> "CfgWeapons" >> (primaryWeapon _x) >> "rhs_disposable") == 1) or (getNumber (configFile >> "CfgWeapons" >> (primaryWeapon _x) >> "tf47_disposable") == 1) or (isText (configFile >> "CfgWeapons" >> (primaryWeapon _x) >> "UK3CB_used_launcher")) or (isText (configFile >> "CfgWeapons" >> (primaryWeapon _x) >> "ACE_UsedTube"))) then {"\x\tmf\addons\orbat\weapon_textures\lat"} else {"\x\tmf\addons\orbat\weapon_textures\mat"} @@ -394,9 +392,7 @@ _fnc_processOrbatTrackerBriefingRawData = { _childrenBriefings sort true; - { - _briefingText = _briefingText + (_x select 1); - } forEach _childrenBriefings; + _briefingText = _briefingText + ((_childrenBriefings apply {_x select 1}) joinString ""); _briefingText; }; diff --git a/addons/orbat/functions/fnc_draw.sqf b/addons/orbat/functions/fnc_draw.sqf index f885f723..4e268828 100644 --- a/addons/orbat/functions/fnc_draw.sqf +++ b/addons/orbat/functions/fnc_draw.sqf @@ -22,4 +22,4 @@ if ((ctrlMapScale _mapControl) < 0.25) then { //Orbat Markers if (GVAR(orbatTrackerCodeCached)) then { [GVAR(orbatMarkerArray), _mapControl] call FUNC(drawArrayRec); -}; \ No newline at end of file +}; diff --git a/addons/orbat/functions/fnc_drawArrayRec.sqf b/addons/orbat/functions/fnc_drawArrayRec.sqf index f9392dec..dc65ac54 100644 --- a/addons/orbat/functions/fnc_drawArrayRec.sqf +++ b/addons/orbat/functions/fnc_drawArrayRec.sqf @@ -41,4 +41,4 @@ if (_drawMe) then { for "_i" from 1 to (count _in - 1) do { [(_in select _i), _mapControl] call FUNC(drawArrayRec); }; -}; \ No newline at end of file +}; diff --git a/addons/orbat/functions/fnc_findOrbatParent.sqf b/addons/orbat/functions/fnc_findOrbatParent.sqf index 7e6c2643..72b11413 100644 --- a/addons/orbat/functions/fnc_findOrbatParent.sqf +++ b/addons/orbat/functions/fnc_findOrbatParent.sqf @@ -65,4 +65,4 @@ tmf_orbat_fnc_findOrbatParentHelper = { }; } forEach GVAR(orbatRawData); -_parentEntry \ No newline at end of file +_parentEntry diff --git a/addons/orbat/functions/fnc_getGroupMarkerData.sqf b/addons/orbat/functions/fnc_getGroupMarkerData.sqf index 352d171e..a0b54a07 100644 --- a/addons/orbat/functions/fnc_getGroupMarkerData.sqf +++ b/addons/orbat/functions/fnc_getGroupMarkerData.sqf @@ -28,7 +28,7 @@ if (_cachedData isEqualTo -1) exitWith { _parentData params ["_parentMarkerData"]; _parentMarkerData params ["","_parentMarkerShortName","_parentMarkerTexture","_parentMarkerSizeTexture"]; if (_parentMarkerTexture != "") exitWith { - _data = [_parentmarkerTexture,(groupID _group),""]; + _data = [_parentmarkerTexture,(groupId _group),""]; } // private _parentData = [_group] call FUNC(findOrbatParent); // }; @@ -47,19 +47,19 @@ if (_cachedData isEqualTo -1) exitWith { }; call { if (_path find "yellow_" != -1) exitWith { - _idx = _path find "yellow_"; + private _idx = _path find "yellow_"; _path = (_path select [0,_idx]) + _targetColor + (_path select [_idx+7]); }; if (_path find "red_" != -1) exitWith { - _idx = _path find "red_"; + private _idx = _path find "red_"; _path = (_path select [0,_idx]) + _targetColor + (_path select [_idx+4]); }; if (_path find "green_" != -1) exitWith { - _idx = _path find "green_"; + private _idx = _path find "green_"; _path = (_path select [0,_idx]) + _targetColor + (_path select [_idx+6]); }; if (_path find "blue_" != -1) exitWith { - _idx = _path find "blue_"; + private _idx = _path find "blue_"; _path = (_path select [0,_idx]) + _targetColor + (_path select [_idx+5]); }; }; diff --git a/addons/orbat/functions/fnc_loadTeams.sqf b/addons/orbat/functions/fnc_loadTeams.sqf index 081d8546..f10aa62a 100644 --- a/addons/orbat/functions/fnc_loadTeams.sqf +++ b/addons/orbat/functions/fnc_loadTeams.sqf @@ -50,7 +50,7 @@ if (_usingFactions) then { _factions sort false; { _x params ["_playerCount","_unitCount","_faction"]; - private _displayName = getText (configfile >> "CfgFactionClasses" >> _faction >> "displayName"); + private _displayName = getText (configFile >> "CfgFactionClasses" >> _faction >> "displayName"); _displayName = format ["%1 - [Players: %2 All Units: %3]",_displayName,_playerCount,_unitCount]; private _index = _control lbAdd _displayName; private _value = _faction; @@ -63,7 +63,7 @@ if (_usingFactions) then { private _side = _x; [ {side _x == _side && _x in (playableUnits + [player])} count allUnits, - {side _x == _side} count allUnits, + _side countSide allUnits, _side ] }; diff --git a/addons/orbat/functions/fnc_setMarkerUpdateInterval.sqf b/addons/orbat/functions/fnc_setMarkerUpdateInterval.sqf index f054e2ec..36be8fdf 100644 --- a/addons/orbat/functions/fnc_setMarkerUpdateInterval.sqf +++ b/addons/orbat/functions/fnc_setMarkerUpdateInterval.sqf @@ -28,7 +28,7 @@ LOG_1("Setting new marker update interval",_interval); GVAR(markerUpdateInterval) = _interval; -if (isNil QGVAR(PFHandler) || !(time > 0)) exitWith {-1}; +if (isNil QGVAR(PFHandler) || time <= 0) exitWith {-1}; // Remove old handler [GVAR(PFHandler)] call CBA_fnc_removePerFrameHandler; diff --git a/addons/orbat/functions/fnc_updateArray.sqf b/addons/orbat/functions/fnc_updateArray.sqf index 7fb16f9c..165ffc2b 100644 --- a/addons/orbat/functions/fnc_updateArray.sqf +++ b/addons/orbat/functions/fnc_updateArray.sqf @@ -48,15 +48,15 @@ if (count _in > 1) then { _rootNode set[4,_meanPos]; _retPos = _meanPos; } else { - private _thing = _rootNode select ((count _rootNode) -1); + private _thing = _rootNode select -1; private _pos = [0,0,0]; if(_thing isEqualType grpNull) then {_pos = getPos leader _thing}; if(_thing isEqualType objNull) then {_pos = getPos _thing}; - if !(_pos isEqualTo [0,0,0]) then { + if (_pos isNotEqualTo [0,0,0]) then { _rootNode set[4,_pos]; _retPos = _pos; } else { _retPos = _myPos; }; }; -[+_retPos, +_maxDistPos] \ No newline at end of file +[+_retPos, +_maxDistPos] diff --git a/addons/orbat/initSettings.sqf b/addons/orbat/initSettings.sqf index aab24dcd..1d8118cc 100644 --- a/addons/orbat/initSettings.sqf +++ b/addons/orbat/initSettings.sqf @@ -2,7 +2,7 @@ [ QGVAR(markerUpdateInterval), "SLIDER", - ["Marker Update Interval", "Time in seconds between marker updates, 0 for every frame. Lower values are more resource intensive."], + ["ORBAT map marker update interval", "Seconds between updates of the ORBAT group and unit markers on the map. 0 updates every frame. Lower values cost more performance."], ["TMF", "ORBAT"], [ 0, // Min diff --git a/addons/orbat/script_component.hpp b/addons/orbat/script_component.hpp index 6a7e7644..8338e208 100644 --- a/addons/orbat/script_component.hpp +++ b/addons/orbat/script_component.hpp @@ -1,5 +1,9 @@ +#ifndef TMF_ORBAT_SCRIPT_COMPONENT_HPP +#define TMF_ORBAT_SCRIPT_COMPONENT_HPP + #define COMPONENT orbat #include "\x\tmf\addons\main\script_mod.hpp" #include "\x\tmf\addons\main\script_macros.hpp" +#endif // TMF_ORBAT_SCRIPT_COMPONENT_HPP diff --git a/addons/orbat/ui_scripts/GroupMarker_attributeLoad.sqf b/addons/orbat/ui_scripts/GroupMarker_attributeLoad.sqf index b8ab3724..e9e22e60 100644 --- a/addons/orbat/ui_scripts/GroupMarker_attributeLoad.sqf +++ b/addons/orbat/ui_scripts/GroupMarker_attributeLoad.sqf @@ -17,7 +17,7 @@ if (count _groupMarkerArray > 0) then { GroupMarker_numID = _numId; if (_icon != "") then { private _parts = _icon splitString '\'; - private _lastPart = _parts select (count _parts -1); + private _lastPart = _parts select -1; private _parts = _lastPart splitString '_'; private _colour = _parts select 0; @@ -28,17 +28,17 @@ if (count _groupMarkerArray > 0) then { private _colours = ["yellow", "blue", "green", "red", "orange", "gray", "purple"]; - _ctrlColourToolBox lbsetcursel (_colours find _colour); - _ctrlIconToolbox lbsetcursel (_toolBoxIcon find _parts); + _ctrlColourToolBox lbSetCurSel (_colours find _colour); + _ctrlIconToolbox lbSetCurSel (_toolBoxIcon find _parts); }; if (_size != "") then { private _sizeMod = ["x\tmf\addons\orbat\textures\empty.paa", "x\tmf\addons\orbat\textures\modif_o.paa","x\tmf\addons\orbat\textures\modif_dot.paa","x\tmf\addons\orbat\textures\modif_2dot.paa","x\tmf\addons\orbat\textures\modif_3dot.paa", "x\tmf\addons\orbat\textures\modif_company.paa"]; - _ctrlSize lbsetcursel (_sizeMod find _size); + _ctrlSize lbSetCurSel (_sizeMod find _size); }; _ctrlNameEdit ctrlSetText _mName; } else { if (count (get3DENSelected "group") > 0) then { private _entity = (get3DENSelected "group") select 0; - _ctrlNameEdit ctrlSetText (GroupID _entity); + _ctrlNameEdit ctrlSetText (groupId _entity); }; }; diff --git a/addons/orbat/ui_scripts/GroupMarker_attributeSave.sqf b/addons/orbat/ui_scripts/GroupMarker_attributeSave.sqf index ac714fc7..1619abe6 100644 --- a/addons/orbat/ui_scripts/GroupMarker_attributeSave.sqf +++ b/addons/orbat/ui_scripts/GroupMarker_attributeSave.sqf @@ -1,5 +1,5 @@ #include "\x\tmf\addons\orbat\script_component.hpp" -private _ctrlGroup = uiNameSpace getVariable "GroupMarker_ctrlGroup"; +private _ctrlGroup = uiNamespace getVariable "GroupMarker_ctrlGroup"; private _ctrlIconToolbox = _ctrlGroup controlsGroupCtrl 100; private _ctrlColourToolBox = _ctrlGroup controlsGroupCtrl 101; private _ctrlNameEdit = _ctrlGroup controlsGroupCtrl 102; @@ -9,21 +9,21 @@ private _toolBoxIcon = ["", "_inf.paa", "_inf_airmobile.paa", "_inf_mech.paa", " private _colours = ["yellow", "blue", "green", "red", "orange", "gray", "purple"]; private _sizeMod = ["x\tmf\addons\orbat\textures\empty.paa", "x\tmf\addons\orbat\textures\modif_o.paa","x\tmf\addons\orbat\textures\modif_dot.paa","x\tmf\addons\orbat\textures\modif_2dot.paa","x\tmf\addons\orbat\textures\modif_3dot.paa", "x\tmf\addons\orbat\textures\modif_company.paa"]; -private _icon = _toolBoxIcon select (lbcursel _ctrlIconToolbox); +private _icon = _toolBoxIcon select (lbCurSel _ctrlIconToolbox); private _path = ""; if (_icon != "") then { - _path = "x\tmf\addons\orbat\textures\" + (_colours select (lbcursel _ctrlColourToolBox)) + _icon; + _path = "x\tmf\addons\orbat\textures\" + (_colours select (lbCurSel _ctrlColourToolBox)) + _icon; }; -private _idx = (lbcursel _ctrlSize); +private _idx = (lbCurSel _ctrlSize); private _mod = ""; if (_idx > 0) then { _mod = _sizeMod select _idx; }; private _entity = (get3DENSelected "group") select 0; -private _groupMarkerArray = [_path, (ctrlText _ctrlNameEdit), _mod, uiNameSpace getVariable ["GroupMarker_numID",0]]; +private _groupMarkerArray = [_path, (ctrlText _ctrlNameEdit), _mod, uiNamespace getVariable ["GroupMarker_numID",0]]; _entity set3DENAttribute ["TMF_groupMarker",str _groupMarkerArray]; diff --git a/addons/orbat/ui_scripts/GroupMarker_onLoad.sqf b/addons/orbat/ui_scripts/GroupMarker_onLoad.sqf index 60b5a2ec..bc436e18 100644 --- a/addons/orbat/ui_scripts/GroupMarker_onLoad.sqf +++ b/addons/orbat/ui_scripts/GroupMarker_onLoad.sqf @@ -3,5 +3,5 @@ private _ctrlGroup = _params select 0; GroupMarker_ctrlGroup = _ctrlGroup; TRACE_1("GroupMarker onLoad",_ctrlGroup); -_ctrlGroup ctrladdeventhandler ["setfocus",{with uinamespace do {GroupMarker_ctrlGroup = _this select 0;};}]; -_ctrlGroup ctrladdeventhandler ["killfocus",{with uinamespace do {GroupMarker_ctrlGroup = nil;};}]; +_ctrlGroup ctrlAddEventHandler ["SetFocus",{with uiNamespace do {GroupMarker_ctrlGroup = _this select 0;};}]; +_ctrlGroup ctrlAddEventHandler ["KillFocus",{with uiNamespace do {GroupMarker_ctrlGroup = nil;};}]; diff --git a/addons/orbat/ui_scripts/OrbatSettings.sqf b/addons/orbat/ui_scripts/OrbatSettings.sqf index 574d4ae0..81a9a6e8 100644 --- a/addons/orbat/ui_scripts/OrbatSettings.sqf +++ b/addons/orbat/ui_scripts/OrbatSettings.sqf @@ -37,7 +37,7 @@ fn_findNextFreeId = { _root call fn_nextHelper; } forEach OrbatSettings_Array; - if (count _usedIDs == 0) exitWith {0}; + if (_usedIDs isEqualTo []) exitWith {0}; _usedIDs sort false; //Return last ID + 1. Alternatively go conservatively and re-use? (_usedIDs select 0)+1 diff --git a/addons/orbat/ui_scripts/OrbatSettings_editOrbatEntryClickOkay.sqf b/addons/orbat/ui_scripts/OrbatSettings_editOrbatEntryClickOkay.sqf index 391a8493..032e0409 100644 --- a/addons/orbat/ui_scripts/OrbatSettings_editOrbatEntryClickOkay.sqf +++ b/addons/orbat/ui_scripts/OrbatSettings_editOrbatEntryClickOkay.sqf @@ -17,7 +17,7 @@ with uiNamespace do { private _path = ""; if (_icon != "") then { - _path = "x\tmf\addons\orbat\textures\" + (_colours select (lbcursel _ctrlColourToolBox)) + _icon; + _path = "x\tmf\addons\orbat\textures\" + (_colours select (lbCurSel _ctrlColourToolBox)) + _icon; }; private _idx = (lbCurSel _ctrlSize); @@ -42,7 +42,7 @@ with uiNamespace do { // _data set [5, -1]; Do not edit the order thing. }; if (_value isEqualType grpNull) then { - private _groupMarkerArray = [_path, (ctrlText _ctrlNameEdit), _mod, uiNameSpace getVariable ["GroupMarker_numID",0]]; + private _groupMarkerArray = [_path, (ctrlText _ctrlNameEdit), _mod, uiNamespace getVariable ["GroupMarker_numID",0]]; _value set3DENAttribute ["TMF_groupMarker",str _groupMarkerArray]; }; }; diff --git a/addons/orbat/ui_scripts/OrbatSettings_move.sqf b/addons/orbat/ui_scripts/OrbatSettings_move.sqf index dee89276..0ba6e9fb 100644 --- a/addons/orbat/ui_scripts/OrbatSettings_move.sqf +++ b/addons/orbat/ui_scripts/OrbatSettings_move.sqf @@ -10,7 +10,7 @@ with uiNamespace do { { if ((_x select 0) isEqualTo OrbatSelection) exitWith { _idx = _forEachIndex;}; } forEach OrbatSettings_Array; - if ((count cacheAllPlayerGroups == 0) and _idx == -1) exitWith {}; + if ((cacheAllPlayerGroups isEqualTo []) and _idx == -1) exitWith {}; if (_idx == -1) then { //_idx = OrbatSettings_Array pushBack [OrbatSelection,[]]; }; @@ -156,7 +156,7 @@ with uiNamespace do { _swapEntry = -1; }; if (_mode == "moveBottom") then { - _newsSortId = ((orbat_queue select ((count orbat_queue) - 1)) select 0)+1; + _newsSortId = ((orbat_queue select -1) select 0)+1; _swapEntry = -1; }; if (_mode == "moveDown") then { diff --git a/addons/orbat/ui_scripts/OrbatSettings_onLoad.sqf b/addons/orbat/ui_scripts/OrbatSettings_onLoad.sqf index 5d45c7c6..ad258b3e 100644 --- a/addons/orbat/ui_scripts/OrbatSettings_onLoad.sqf +++ b/addons/orbat/ui_scripts/OrbatSettings_onLoad.sqf @@ -8,8 +8,8 @@ private _playableUnits = playableUnits; _playableUnits pushBackUnique player; cacheAllPlayerGroups = allGroups select {{_x in _playableUnits} count (units _x) > 0}; -_ctrlGroup ctrladdeventhandler ["setfocus",{with uinamespace do {OrbatSettings_ctrlGroup = _this select 0;};}]; -_ctrlGroup ctrladdeventhandler ["killfocus",{with uinamespace do {OrbatSettings_ctrlGroup = nil;};}]; +_ctrlGroup ctrlAddEventHandler ["SetFocus",{with uiNamespace do {OrbatSettings_ctrlGroup = _this select 0;};}]; +_ctrlGroup ctrlAddEventHandler ["KillFocus",{with uiNamespace do {OrbatSettings_ctrlGroup = nil;};}]; {(_ctrlGroup controlsGroupCtrl _x) ctrlShow true;} forEach (MAIN_IDCS); {(_ctrlGroup controlsGroupCtrl _x) ctrlShow false;} forEach (EDIT_IDCS); {(_ctrlGroup controlsGroupCtrl _x) ctrlShow false;} forEach (MOVE_IDCS); @@ -97,7 +97,7 @@ if (!isNil "OrbatSelection") then { if (!_found) then { //Default - if (count OrbatSidesPresent > 0) then { + if (OrbatSidesPresent isNotEqualTo []) then { OrbatSelection = OrbatSidesPresent select 0; } else { OrbatSelection = east; @@ -116,7 +116,7 @@ if (OrbatSelection isEqualType east) then { _string = OrbatSelection call EFUNC(common,sideToString); }; if (OrbatSelection isEqualType "") then { - _string = getText (configfile >> "CfgFactionClasses" >> OrbatSelection >> "displayName"); + _string = getText (configFile >> "CfgFactionClasses" >> OrbatSelection >> "displayName"); }; _ctrlToggle ctrlSetText format["< %1 >", _string]; diff --git a/addons/orbat/ui_scripts/OrbatSettings_orbatBinChanged.sqf b/addons/orbat/ui_scripts/OrbatSettings_orbatBinChanged.sqf index 06d055a9..c6f68e87 100644 --- a/addons/orbat/ui_scripts/OrbatSettings_orbatBinChanged.sqf +++ b/addons/orbat/ui_scripts/OrbatSettings_orbatBinChanged.sqf @@ -16,11 +16,9 @@ with uiNamespace do { //ERASE ATTRIBUTES { - private _attrValue = (_x get3DENAttribute "TMF_OrbatParent") select 0; - if (_attrValue == _val) then { _x set3DENAttribute ["TMF_OrbatParent", -1]; }; + _x set3DENAttribute ["TMF_OrbatParent", -1]; { - private _attrValue = (_x get3DENAttribute "TMF_OrbatParent") select 0; - if (_attrValue == _val) then { _x set3DENAttribute ["TMF_OrbatParent", -1]; } + _x set3DENAttribute ["TMF_OrbatParent", -1]; } forEach (units _x); } forEach (cacheAllPlayerGroups); @@ -34,7 +32,7 @@ with uiNamespace do { _string = OrbatSelection call EFUNC(common,sideToString); }; if (OrbatSelection isEqualType "") then { - _string = getText (configfile >> "CfgFactionClasses" >> OrbatSelection >> "displayName"); + _string = getText (configFile >> "CfgFactionClasses" >> OrbatSelection >> "displayName"); }; _ctrlToggle ctrlSetText format["< %1 >", _string]; diff --git a/addons/orbat/ui_scripts/OrbatSettings_orbatToggleButton.sqf b/addons/orbat/ui_scripts/OrbatSettings_orbatToggleButton.sqf index 4724b0de..4a11a14f 100644 --- a/addons/orbat/ui_scripts/OrbatSettings_orbatToggleButton.sqf +++ b/addons/orbat/ui_scripts/OrbatSettings_orbatToggleButton.sqf @@ -18,7 +18,7 @@ with uiNamespace do { _idx = 0; }; OrbatSelection = (OrbatFactionsPresent select _idx); - private _string = getText (configfile >> "CfgFactionClasses" >> OrbatSelection >> "displayName"); + private _string = getText (configFile >> "CfgFactionClasses" >> OrbatSelection >> "displayName"); _ctrlToggle ctrlSetText format["< %1 >", _string]; }; diff --git a/addons/orbat/ui_scripts/OrbatSettings_refreshTree.sqf b/addons/orbat/ui_scripts/OrbatSettings_refreshTree.sqf index d4905c74..4593e253 100644 --- a/addons/orbat/ui_scripts/OrbatSettings_refreshTree.sqf +++ b/addons/orbat/ui_scripts/OrbatSettings_refreshTree.sqf @@ -9,7 +9,7 @@ with uiNamespace do { { if ((_x select 0) isEqualTo OrbatSelection) exitWith { _idx = _forEachIndex;}; } forEach OrbatSettings_Array; - if ((count cacheAllPlayerGroups == 0) and _idx == -1) exitWith {}; + if ((cacheAllPlayerGroups isEqualTo []) and _idx == -1) exitWith {}; if (_idx == -1) then { _idx = OrbatSettings_Array pushBack [OrbatSelection,[]]; }; @@ -218,12 +218,12 @@ with uiNamespace do { if (_isVeh) then { // Get callsign. private _callsign = (_entry get3DENAttribute "TMF_orbat_vehicleCallsign") param [0,""]; - _string = format ["VEHICLE - %1",getText (configfile >> "CfgVehicles" >> (typeOf _entry) >> "displayName")]; + _string = format ["VEHICLE - %1",getText (configOf _entry >> "displayName")]; if (count _callsign > 0) then { _string = _string + format [" (Callsign: %1)",_callsign]; } } else { // Not Veh must be group - _string = format["GROUP - %1", groupID _entry]; + _string = format["GROUP - %1", groupId _entry]; }; if (count _groupMarkerData > 0) then { if ((_groupMarkerData select 1) != "") then { @@ -245,7 +245,7 @@ with uiNamespace do { _unitMarkerData params ["_unitIcon","_mName"]; private _roleDesc = ((_entry get3DENAttribute "description") select 0); if (_roleDesc isEqualTo "") then { - _roleDesc = getText (configfile >> "CfgVehicles" >> (typeOf _entry) >> "displayName"); + _roleDesc = getText (configOf _entry >> "displayName"); }; private _string = format["UNIT - %1", _roleDesc]; if (_mName != "") then { diff --git a/addons/orbat/ui_scripts/OrbatSettings_treeAddClick.sqf b/addons/orbat/ui_scripts/OrbatSettings_treeAddClick.sqf index 60c1b156..d2f05fc6 100644 --- a/addons/orbat/ui_scripts/OrbatSettings_treeAddClick.sqf +++ b/addons/orbat/ui_scripts/OrbatSettings_treeAddClick.sqf @@ -7,7 +7,7 @@ with uiNamespace do { private _treeSel = tvCurSel _ctrlTree; private _value = OrbatTree_Data select (_ctrlTree tvValue _treeSel); - if ((_value isEqualType grpNull) or (_value isEqualType objNull)) exitWith {}; + if ((_value isEqualTypeAny [grpNull, objNull])) exitWith {}; {(OrbatSettings_ctrlGroup controlsGroupCtrl _x) ctrlShow false;} forEach (MAIN_IDCS); {(OrbatSettings_ctrlGroup controlsGroupCtrl _x) ctrlShow true;} forEach (EDIT_IDCS); {(OrbatSettings_ctrlGroup controlsGroupCtrl _x) ctrlShow false;} forEach (MOVE_IDCS); @@ -18,9 +18,9 @@ with uiNamespace do { private _ctrlSize = OrbatSettings_ctrlGroup controlsGroupCtrl 117; private _ctrlFullNameEdit = OrbatSettings_ctrlGroup controlsGroupCtrl 123; - _ctrlColourToolBox lbsetcursel 0; - _ctrlIconToolbox lbsetcursel 0; - _ctrlSize lbsetcursel 0; + _ctrlColourToolBox lbSetCurSel 0; + _ctrlIconToolbox lbSetCurSel 0; + _ctrlSize lbSetCurSel 0; _ctrlNameEdit ctrlSetText ""; _ctrlFullNameEdit ctrlSetText ""; diff --git a/addons/orbat/ui_scripts/OrbatSettings_treeDelClick.sqf b/addons/orbat/ui_scripts/OrbatSettings_treeDelClick.sqf index d3d413f1..110083d0 100644 --- a/addons/orbat/ui_scripts/OrbatSettings_treeDelClick.sqf +++ b/addons/orbat/ui_scripts/OrbatSettings_treeDelClick.sqf @@ -34,10 +34,10 @@ with uiNamespace do { //Ensure all attributes and purged from groups/units with the attribute. { private _attrValue = (_x get3DENAttribute "TMF_OrbatParent") select 0; - if (_attrValue == _val) then { _x set3DENAttribute ["TMF_OrbatParent", -1]; }; + if (_attrValue == _value) then { _x set3DENAttribute ["TMF_OrbatParent", -1]; }; { private _attrValue = (_x get3DENAttribute "TMF_OrbatParent") select 0; - if (_attrValue == _val) then { _x set3DENAttribute ["TMF_OrbatParent", -1]; } + if (_attrValue == _value) then { _x set3DENAttribute ["TMF_OrbatParent", -1]; } } forEach (units _x); } forEach (cacheAllPlayerGroups); }; diff --git a/addons/orbat/ui_scripts/OrbatSettings_treeEditClick.sqf b/addons/orbat/ui_scripts/OrbatSettings_treeEditClick.sqf index 4888a7f7..3ec4da95 100644 --- a/addons/orbat/ui_scripts/OrbatSettings_treeEditClick.sqf +++ b/addons/orbat/ui_scripts/OrbatSettings_treeEditClick.sqf @@ -15,9 +15,9 @@ with uiNamespace do { private _ctrlFullNameEdit = OrbatSettings_ctrlGroup controlsGroupCtrl 123; private _ctrlSize = OrbatSettings_ctrlGroup controlsGroupCtrl 117; _ctrlNameEdit ctrlSetText ""; - _ctrlColourToolBox lbsetcursel 0; - _ctrlIconToolbox lbsetcursel 0; - _ctrlSize lbsetcursel 0; + _ctrlColourToolBox lbSetCurSel 0; + _ctrlIconToolbox lbSetCurSel 0; + _ctrlSize lbSetCurSel 0; //TODO : edit Object/specialist marker if (_value isEqualType objNull) exitWith {}; @@ -68,7 +68,7 @@ with uiNamespace do { GroupMarker_numID = _numId; if (_icon != "") then { private _parts = _icon splitString '\'; - private _lastPart = _parts select (count _parts -1); + private _lastPart = _parts select -1; private _parts = _lastPart splitString '_'; private _colour = _parts select 0; @@ -78,17 +78,17 @@ with uiNamespace do { private _toolBoxIcon = ["", "_inf.paa", "_inf_airmobile.paa", "_inf_mech.paa", "_inf_mech_wheeled.paa", "_inf_motor.paa", "_inf_para.paa", "_amphi.paa", "_amphi_mech_inf.paa", "_airdef.paa", "_airdef_not_a_nipple.paa", "_antitank.paa", "_antitank_rocket.paa", "_armor.paa", "_armor_wheeled.paa", "_arm_airdef.paa", "_arm_spaag.paa", "_artillery.paa", "_rotarywing.paa", "_helo_attack.paa", "_helo_cargo.paa", "_fixedwing.paa", "_hq.paa", "_logistics.paa", "_mg.paa", "_mg_m.paa", "_mg_h.paa", "_mortar.paa", "_motor.paa", "_para.paa", "_para_mech.paa", "_recon.paa", "_recon_mech.paa", "_recon_mech_wheeled.paa", "_recon_motor.paa", "_engineer.paa", "_service.paa", "_sf.paa", "_signal.paa", "_spaag.paa", "_transport.paa", "_uav.paa", ".paa"]; private _colours = ["yellow", "blue", "green", "red", "orange", "gray", "purple"]; - _ctrlColourToolBox lbsetcursel (_colours find _colour); - _ctrlIconToolbox lbsetcursel (_toolBoxIcon find _parts); + _ctrlColourToolBox lbSetCurSel (_colours find _colour); + _ctrlIconToolbox lbSetCurSel (_toolBoxIcon find _parts); }; if (_size != "") then { private _sizeMod = ["x\tmf\addons\orbat\textures\empty.paa", "x\tmf\addons\orbat\textures\modif_o.paa","x\tmf\addons\orbat\textures\modif_dot.paa","x\tmf\addons\orbat\textures\modif_2dot.paa","x\tmf\addons\orbat\textures\modif_3dot.paa", "x\tmf\addons\orbat\textures\modif_company.paa"]; - _ctrlSize lbsetcursel (_sizeMod find _size); + _ctrlSize lbSetCurSel (_sizeMod find _size); }; - _ctrlFullNameEdit ctrlSetText _fName; + _ctrlFullNameEdit ctrlSetText ""; _ctrlNameEdit ctrlSetText _mName; } else { - _ctrlNameEdit ctrlSetText (GroupID _entity); + _ctrlNameEdit ctrlSetText (groupId _value); _ctrlFullNameEdit ctrlSetText ""; }; }; @@ -98,7 +98,7 @@ with uiNamespace do { _data params ["","_mName","_icon","_size", ["_fName",""]]; if (_icon != "") then { private _parts = _icon splitString '\'; - private _lastPart = _parts select (count _parts -1); + private _lastPart = _parts select -1; private _parts = _lastPart splitString '_'; private _colour = _parts select 0; @@ -108,12 +108,12 @@ with uiNamespace do { private _toolBoxIcon = ["", "_inf.paa", "_inf_airmobile.paa", "_inf_mech.paa", "_inf_mech_wheeled.paa", "_inf_motor.paa", "_inf_para.paa", "_amphi.paa", "_amphi_mech_inf.paa", "_airdef.paa", "_airdef_not_a_nipple.paa", "_antitank.paa", "_antitank_rocket.paa", "_armor.paa", "_armor_wheeled.paa", "_arm_airdef.paa", "_arm_spaag.paa", "_artillery.paa", "_rotarywing.paa", "_helo_attack.paa", "_helo_cargo.paa", "_fixedwing.paa", "_hq.paa", "_logistics.paa", "_mg.paa", "_mg_m.paa", "_mg_h.paa", "_mortar.paa", "_motor.paa", "_para.paa", "_para_mech.paa", "_recon.paa", "_recon_mech.paa", "_recon_mech_wheeled.paa", "_recon_motor.paa", "_engineer.paa", "_service.paa", "_sf.paa", "_signal.paa", "_spaag.paa", "_transport.paa", "_uav.paa", ".paa"]; private _colours = ["yellow", "blue", "green", "red", "orange", "gray", "purple"]; - _ctrlColourToolBox lbsetcursel (_colours find _colour); - _ctrlIconToolbox lbsetcursel (_toolBoxIcon find _parts); + _ctrlColourToolBox lbSetCurSel (_colours find _colour); + _ctrlIconToolbox lbSetCurSel (_toolBoxIcon find _parts); }; if (_size != "") then { private _sizeMod = ["x\tmf\addons\orbat\textures\empty.paa", "x\tmf\addons\orbat\textures\modif_o.paa","x\tmf\addons\orbat\textures\modif_dot.paa","x\tmf\addons\orbat\textures\modif_2dot.paa","x\tmf\addons\orbat\textures\modif_3dot.paa", "x\tmf\addons\orbat\textures\modif_company.paa"]; - _ctrlSize lbsetcursel (_sizeMod find _size); + _ctrlSize lbSetCurSel (_sizeMod find _size); }; _ctrlNameEdit ctrlSetText _mName; _ctrlFullNameEdit ctrlSetText _fName; diff --git a/addons/orbat/ui_scripts/UnitMarker_attributeSave.sqf b/addons/orbat/ui_scripts/UnitMarker_attributeSave.sqf index 8ffd64f0..b36c8dcc 100644 --- a/addons/orbat/ui_scripts/UnitMarker_attributeSave.sqf +++ b/addons/orbat/ui_scripts/UnitMarker_attributeSave.sqf @@ -1,5 +1,5 @@ #include "\x\tmf\addons\orbat\script_component.hpp" -private _ctrlGroup = uiNameSpace getVariable "UnitMarker_ctrlGroup"; +private _ctrlGroup = uiNamespace getVariable "UnitMarker_ctrlGroup"; private _ctrlIconToolbox = _ctrlGroup controlsGroupCtrl 100; private _ctrlColourToolBox = _ctrlGroup controlsGroupCtrl 101; private _ctrlNameEdit = _ctrlGroup controlsGroupCtrl 102; @@ -7,11 +7,11 @@ private _ctrlNameEdit = _ctrlGroup controlsGroupCtrl 102; private _toolBoxIcon = ["","_cross.paa","_chevrons.paa","_sl_flag.paa","_sl_flag_s"]; private _colours = ["yellow", "blue", "green", "red", "orange", "gray", "purple"]; -private _icon = _toolBoxIcon select (lbcursel _ctrlIconToolbox); +private _icon = _toolBoxIcon select (lbCurSel _ctrlIconToolbox); private _path = ""; if (_icon != "") then { - _path = "x\tmf\addons\orbat\textures\" + (_colours select (lbcursel _ctrlColourToolBox)) + _icon; + _path = "x\tmf\addons\orbat\textures\" + (_colours select (lbCurSel _ctrlColourToolBox)) + _icon; }; private _entity = (get3DENSelected "object") # 0; diff --git a/addons/orbat/ui_scripts/UnitMarker_onLoad.sqf b/addons/orbat/ui_scripts/UnitMarker_onLoad.sqf index 86a66759..52f4e346 100644 --- a/addons/orbat/ui_scripts/UnitMarker_onLoad.sqf +++ b/addons/orbat/ui_scripts/UnitMarker_onLoad.sqf @@ -6,8 +6,8 @@ UnitMarker_ctrlGroup = _ctrlGroup; private _entity = (get3DENSelected "object") select 0; -_ctrlGroup ctrladdeventhandler ["setfocus",{with uinamespace do {UnitMarker_ctrlGroup = _this select 0;};}]; -_ctrlGroup ctrladdeventhandler ["killfocus",{with uinamespace do {UnitMarker_ctrlGroup = nil;};}]; +_ctrlGroup ctrlAddEventHandler ["SetFocus",{with uiNamespace do {UnitMarker_ctrlGroup = _this select 0;};}]; +_ctrlGroup ctrlAddEventHandler ["KillFocus",{with uiNamespace do {UnitMarker_ctrlGroup = nil;};}]; private _unitMarkerArray = (_entity get3DENAttribute "TMF_SpecialistMarker") # 0; if (_unitMarkerArray isEqualType "") then { @@ -23,7 +23,7 @@ if (count _unitMarkerArray > 0) then { _unitMarkerArray params ["_icon","_mName"]; if (_icon != "") then { private _parts = _icon splitString '\'; - private _lastPart = _parts select (count _parts -1); + private _lastPart = _parts select -1; private _parts = _lastPart splitString '_'; private _colour = _parts select 0; @@ -34,8 +34,8 @@ if (count _unitMarkerArray > 0) then { private _colours = ["yellow", "blue", "green", "red", "orange", "gray", "purple"]; - _ctrlColourToolBox lbsetcursel (_colours find _colour); - _ctrlIconToolbox lbsetcursel (_toolBoxIcon find _parts); + _ctrlColourToolBox lbSetCurSel (_colours find _colour); + _ctrlIconToolbox lbSetCurSel (_toolBoxIcon find _parts); }; _ctrlNameEdit ctrlSetText _mName; } else { diff --git a/addons/patrol/addon.toml b/addons/patrol/addon.toml deleted file mode 100644 index 563690e6..00000000 --- a/addons/patrol/addon.toml +++ /dev/null @@ -1,5 +0,0 @@ -[rapify] -enabled = false # Default: true -exclude = [ - "display3DENEditbox.hpp" -] \ No newline at end of file diff --git a/addons/patrol/config.cpp b/addons/patrol/config.cpp index 45629cb3..c273ccba 100644 --- a/addons/patrol/config.cpp +++ b/addons/patrol/config.cpp @@ -1,6 +1,6 @@ #include "script_component.hpp" -class cfgPatches +class CfgPatches { class ADDON { diff --git a/addons/patrol/display3DEN.hpp b/addons/patrol/display3DEN.hpp index d014c761..3d30ad0b 100644 --- a/addons/patrol/display3DEN.hpp +++ b/addons/patrol/display3DEN.hpp @@ -1,5 +1,5 @@ class ctrlMenu; /*proto*/ -class display3DEN +class Display3DEN { class ContextMenu: ctrlMenu { @@ -10,7 +10,7 @@ class display3DEN { text = "Generate patrol"; action = "findDisplay 313 createDisplay 'tmf_patrol_editBox';"; - conditionShow = selectedGroup; + conditionShow = QUOTE(selectedGroup); value = 0; }; }; diff --git a/addons/patrol/display3DENEditbox.hpp b/addons/patrol/display3DENEditbox.hpp index add80797..ff6fa9d3 100644 --- a/addons/patrol/display3DENEditbox.hpp +++ b/addons/patrol/display3DENEditbox.hpp @@ -1,15 +1,4 @@ // Overload classes -class RscText; -class RscTitle; -class RscListbox; -class RscControlsGroupNoScrollbars; -class RscPicture; -class RscButtonMenu; -class RscButtonMenuOK; -class RscButtonMenuCancel; -class RscStandardDisplay; -class RscVignette; -class RscMap; // Defines #include "\a3\ui_f\hpp\defineDIKCodes.inc" @@ -22,13 +11,8 @@ class RscMap; #define MSGBOX_X 0.25 #define MSGBOX_Y 0.25 -class ctrlDefault; -class ctrlDefaultText;// : ctrlDefault; -class ctrlStatic;// : ctrlDefaultText; -class ctrlListNBox;// : ctrlDefaultText; -class ctrlTree;// : ctrlDefaultText; class ctrlEdit;// : ctrlDefaultText; -class ctrlToolBox;// : ctrlDefaultText; +class ctrlToolbox;// : ctrlDefaultText; class ctrlStaticBackgroundDisableTiles; class ctrlStaticTitle; class ctrlStaticBackground; @@ -49,72 +33,72 @@ class GVAR(editBox) { class Back : ctrlStaticBackgroundDisableTiles { - x = SafeZoneX; y = SafeZoneY; - w = SafeZoneW; h = SafeZoneH; + x = QUOTE(SafeZoneX); y = QUOTE(SafeZoneY); + w = QUOTE(SafeZoneW); h = QUOTE(SafeZoneH); }; class Title: ctrlStaticTitle { idc = IDC_DISPLAY3DENMSGBOX_TITLE; x = (MSGBOX_X); y = (MSGBOX_Y); - w = (MSGBOX_W) * GRID_W; - h = 5 * GRID_H; + w = QUOTE((MSGBOX_W) * GRID_W); + h = QUOTE(5 * GRID_H); text = "Patrol generator"; }; class Background: ctrlStaticBackground { idc = IDC_DISPLAY3DENMSGBOX_BACKGROUND; x = (MSGBOX_X); - y = (MSGBOX_Y) + SIZE_M * GRID_H; - w = (MSGBOX_W) * GRID_W; - h = MSGBOX_H * GRID_H; + y = QUOTE((MSGBOX_Y) + SIZE_M * GRID_H); + w = QUOTE((MSGBOX_W) * GRID_W); + h = QUOTE(MSGBOX_H * GRID_H); }; class BottomBackground: ctrlStaticFooter { idc = IDC_DISPLAY3DENMSGBOX_BOTTOMBACKGROUND; x = (MSGBOX_X); - y = (MSGBOX_Y) + (MSGBOX_H * GRID_H); - w = (MSGBOX_W) * GRID_W; - h = 5 * GRID_H; + y = QUOTE((MSGBOX_Y) + (MSGBOX_H * GRID_H)); + w = QUOTE((MSGBOX_W) * GRID_W); + h = QUOTE(5 * GRID_H); }; class ButtonOK: ctrlButtonOK { idc = 3434; - x = MSGBOX_X + (MSGBOX_W * 1/3) * GRID_W; - y = (MSGBOX_Y) + (MSGBOX_H * GRID_H); - w = (MSGBOX_W * 1/3 - 1) * GRID_W; - h = 5 * GRID_H; + x = QUOTE(MSGBOX_X + (MSGBOX_W * 1/3) * GRID_W); + y = QUOTE((MSGBOX_Y) + (MSGBOX_H * GRID_H)); + w = QUOTE((MSGBOX_W * 1/3 - 1) * GRID_W); + h = QUOTE(5 * GRID_H); onButtonDown = "(ctrlParent (_this select 0)) closeDisplay 1;"; }; class ButtonCancel: ctrlButtonCancel { idc = 3432; - x = MSGBOX_X + (MSGBOX_W * 2/3) * GRID_W; - y = (MSGBOX_Y) + (MSGBOX_H * GRID_H); - w = (MSGBOX_W * 1/3 - 1) * GRID_W; - h = 5 * GRID_H; + x = QUOTE(MSGBOX_X + (MSGBOX_W * 2/3) * GRID_W); + y = QUOTE((MSGBOX_Y) + (MSGBOX_H * GRID_H)); + w = QUOTE((MSGBOX_W * 1/3 - 1) * GRID_W); + h = QUOTE(5 * GRID_H); onButtonDown = "(ctrlParent (_this select 0)) closeDisplay 2;"; }; class PatrolShapeLabel : ctrlStructuredText { x = (MSGBOX_X); - y = (MSGBOX_Y)+ (SIZE_M) * GRID_H; - w = (MSGBOX_W) * GRID_W; - h = 10 * GRID_H; + y = QUOTE((MSGBOX_Y)+ (SIZE_M) * GRID_H); + w = QUOTE((MSGBOX_W) * GRID_W); + h = QUOTE(10 * GRID_H); text = "Shape of patrol path"; }; class PatrolShape : ctrlToolbox { IDC = 1337; x = (MSGBOX_X); - y = (MSGBOX_Y)+ (SIZE_M+5) * GRID_H; - w = (MSGBOX_W) * GRID_W; - h = 15 * GRID_H; + y = QUOTE((MSGBOX_Y)+ (SIZE_M+5) * GRID_H); + w = QUOTE((MSGBOX_W) * GRID_W); + h = QUOTE(15 * GRID_H); rows = 1; columns = 2; tooltips[] = { - $STR_3den_attributes_shapetrigger_ellipse, - $STR_3den_attributes_shapetrigger_rectangle + "$STR_3den_attributes_shapetrigger_ellipse", + "$STR_3den_attributes_shapetrigger_rectangle" }; style = ST_CENTER + ST_PICTURE + ST_KEEP_ASPECT_RATIO; strings[] = { @@ -126,52 +110,52 @@ class GVAR(editBox) class PatrolRadiusLabel : ctrlStructuredText { x = (MSGBOX_X); - y = (MSGBOX_Y)+ (SIZE_M+23) * GRID_H; - w = (MSGBOX_W) * GRID_W; - h = 5 * GRID_H; + y = QUOTE((MSGBOX_Y)+ (SIZE_M+23) * GRID_H); + w = QUOTE((MSGBOX_W) * GRID_W); + h = QUOTE(5 * GRID_H); text = "Radius:"; }; class PatrolRadiusText : ctrlEdit { IDC = 1338; x = (MSGBOX_X)+0.08; - y = (MSGBOX_Y)+ (SIZE_M+23) * GRID_H; - w = (MSGBOX_W-14) * GRID_W; - h = 5 * GRID_H; + y = QUOTE((MSGBOX_Y)+ (SIZE_M+23) * GRID_H); + w = QUOTE((MSGBOX_W-14) * GRID_W); + h = QUOTE(5 * GRID_H); text = "100"; }; class PatrolPointsLabel : ctrlStructuredText { x = (MSGBOX_X); - y = (MSGBOX_Y)+ (SIZE_M+30) * GRID_H; - w = (MSGBOX_W) * GRID_W; - h = 5 * GRID_H; + y = QUOTE((MSGBOX_Y)+ (SIZE_M+30) * GRID_H); + w = QUOTE((MSGBOX_W) * GRID_W); + h = QUOTE(5 * GRID_H); text = "Points:"; }; class PatrolPointsText : ctrlEdit { IDC = 1339; x = (MSGBOX_X)+0.08; - y = (MSGBOX_Y)+ (SIZE_M+30) * GRID_H; - w = (MSGBOX_W-14) * GRID_W; - h = 5 * GRID_H; + y = QUOTE((MSGBOX_Y)+ (SIZE_M+30) * GRID_H); + w = QUOTE((MSGBOX_W-14) * GRID_W); + h = QUOTE(5 * GRID_H); text = "8"; }; class onRoad : ctrlCheckbox { IDC = 1340; x = (MSGBOX_X)+0.005; - y = (MSGBOX_Y)+ (SIZE_M+35) * GRID_H; - w = 7 * GRID_W; - h = 7 * GRID_H; + y = QUOTE((MSGBOX_Y)+ (SIZE_M+35) * GRID_H); + w = QUOTE(7 * GRID_W); + h = QUOTE(7 * GRID_H); text = "Yeah"; }; class onRoadLabel : ctrlStructuredText { x = (MSGBOX_X)+0.005+0.04; - y = (MSGBOX_Y)+ (SIZE_M+35+0.7) * GRID_H; - w = (MSGBOX_W) * GRID_W; - h = 5 * GRID_H; + y = QUOTE((MSGBOX_Y)+ (SIZE_M+35+0.7) * GRID_H); + w = QUOTE((MSGBOX_W) * GRID_W); + h = QUOTE(5 * GRID_H); text = "Force waypoint to road"; }; }; diff --git a/addons/patrol/functions/fnc_3denPatrol.sqf b/addons/patrol/functions/fnc_3denPatrol.sqf index 9316c7ca..823f1b64 100644 --- a/addons/patrol/functions/fnc_3denPatrol.sqf +++ b/addons/patrol/functions/fnc_3denPatrol.sqf @@ -2,16 +2,16 @@ params ["_display","_code"]; if(_code != 1) exitWith {}; -_type = lbCurSel (_display displayCtrl 1337); -_radius = parseNumber (ctrlText (_display displayCtrl 1338)); -_points = parseNumber (ctrlText (_display displayCtrl 1339)); -_onroad = cbChecked (_display displayCtrl 1340); +private _type = lbCurSel (_display displayCtrl 1337); +private _radius = parseNumber (ctrlText (_display displayCtrl 1338)); +private _points = parseNumber (ctrlText (_display displayCtrl 1339)); +private _onroad = cbChecked (_display displayCtrl 1340); -_groups = get3DENSelected "Group"; -_over = get3DENMouseOver; +private _groups = get3DENSelected "Group"; +private _over = get3DENMouseOver; if(count _over > 0 && {(_over select 0) == "Group"}) then {_groups pushBackUnique (_over select 1)}; { - [_x,getpos leader _x,_type,_radius,_points,_onroad] call FUNC(patrol); -} foreach _groups; + [_x,getPos leader _x,_type,_radius,_points,_onroad] call FUNC(patrol); +} forEach _groups; diff --git a/addons/patrol/functions/fnc_patrol.sqf b/addons/patrol/functions/fnc_patrol.sqf index 17ecc15b..7f067622 100644 --- a/addons/patrol/functions/fnc_patrol.sqf +++ b/addons/patrol/functions/fnc_patrol.sqf @@ -12,7 +12,7 @@ switch (_type) do { if(count _empty > 0) then {_point = _empty}; if(_onRoad) then { private _road = [_point] call CFUNC(getNearestRoad); - if(!isNull _road) then {_point = getpos _road}; + if(!isNull _road) then {_point = getPos _road}; }; private _type = "Move"; if(_index == _numOfPoints+1) then {_type = "Cycle"}; @@ -29,7 +29,7 @@ switch (_type) do { private _pos = _this; if(_onRoad) then { private _road = [_this] call CFUNC(getNearestRoad); - if(!isNull _road) then {_pos = getpos _road}; + if(!isNull _road) then {_pos = getPos _road}; }; _pos }; diff --git a/addons/patrol/script_component.hpp b/addons/patrol/script_component.hpp index e0f785e1..eb66902f 100644 --- a/addons/patrol/script_component.hpp +++ b/addons/patrol/script_component.hpp @@ -1,4 +1,9 @@ +#ifndef TMF_PATROL_SCRIPT_COMPONENT_HPP +#define TMF_PATROL_SCRIPT_COMPONENT_HPP + #define COMPONENT patrol #include "\x\tmf\addons\main\script_mod.hpp" #include "\x\tmf\addons\main\script_macros.hpp" + +#endif // TMF_PATROL_SCRIPT_COMPONENT_HPP diff --git a/addons/respawn/addon.toml b/addons/respawn/addon.toml deleted file mode 100644 index b7c555ab..00000000 --- a/addons/respawn/addon.toml +++ /dev/null @@ -1,5 +0,0 @@ -[rapify] -enabled = false # Default: true -exclude = [ - "dialogs.hpp" -] \ No newline at end of file diff --git a/addons/respawn/config.cpp b/addons/respawn/config.cpp index 6b1144dc..e1c8b82e 100644 --- a/addons/respawn/config.cpp +++ b/addons/respawn/config.cpp @@ -1,6 +1,6 @@ #include "script_component.hpp" -class cfgPatches +class CfgPatches { class ADDON { diff --git a/addons/respawn/defines.hpp b/addons/respawn/defines.hpp index 99b88a09..8beae077 100644 --- a/addons/respawn/defines.hpp +++ b/addons/respawn/defines.hpp @@ -1,91 +1,229 @@ // Control types +#ifndef CT_STATIC #define CT_STATIC 0 +#endif +#ifndef CT_BUTTON #define CT_BUTTON 1 +#endif +#ifndef CT_EDIT #define CT_EDIT 2 +#endif +#ifndef CT_SLIDER #define CT_SLIDER 3 +#endif +#ifndef CT_COMBO #define CT_COMBO 4 +#endif +#ifndef CT_LISTBOX #define CT_LISTBOX 5 +#endif +#ifndef CT_TOOLBOX #define CT_TOOLBOX 6 +#endif +#ifndef CT_CHECKBOXES #define CT_CHECKBOXES 7 +#endif +#ifndef CT_PROGRESS #define CT_PROGRESS 8 +#endif +#ifndef CT_HTML #define CT_HTML 9 +#endif +#ifndef CT_STATIC_SKEW #define CT_STATIC_SKEW 10 +#endif +#ifndef CT_ACTIVETEXT #define CT_ACTIVETEXT 11 +#endif +#ifndef CT_TREE #define CT_TREE 12 +#endif +#ifndef CT_STRUCTURED_TEXT #define CT_STRUCTURED_TEXT 13 +#endif +#ifndef CT_CONTEXT_MENU #define CT_CONTEXT_MENU 14 +#endif +#ifndef CT_CONTROLS_GROUP #define CT_CONTROLS_GROUP 15 +#endif +#ifndef CT_SHORTCUTBUTTON #define CT_SHORTCUTBUTTON 16 +#endif +#ifndef CT_XKEYDESC #define CT_XKEYDESC 40 +#endif +#ifndef CT_XBUTTON #define CT_XBUTTON 41 +#endif +#ifndef CT_XLISTBOX #define CT_XLISTBOX 42 +#endif +#ifndef CT_XSLIDER #define CT_XSLIDER 43 +#endif +#ifndef CT_XCOMBO #define CT_XCOMBO 44 +#endif +#ifndef CT_ANIMATED_TEXTURE #define CT_ANIMATED_TEXTURE 45 +#endif +#ifndef CT_OBJECT #define CT_OBJECT 80 +#endif +#ifndef CT_OBJECT_ZOOM #define CT_OBJECT_ZOOM 81 +#endif +#ifndef CT_OBJECT_CONTAINER #define CT_OBJECT_CONTAINER 82 +#endif +#ifndef CT_OBJECT_CONT_ANIM #define CT_OBJECT_CONT_ANIM 83 +#endif +#ifndef CT_LINEBREAK #define CT_LINEBREAK 98 +#endif +#ifndef CT_USER #define CT_USER 99 +#endif +#ifndef CT_MAP #define CT_MAP 100 +#endif +#ifndef CT_MAP_MAIN #define CT_MAP_MAIN 101 +#endif +#ifndef CT_LISTNBOX #define CT_LISTNBOX 102 +#endif // Static styles +#ifndef ST_POS #define ST_POS 0x0F +#endif +#ifndef ST_HPOS #define ST_HPOS 0x03 +#endif +#ifndef ST_VPOS #define ST_VPOS 0x0C +#endif +#ifndef ST_LEFT #define ST_LEFT 0x00 +#endif +#ifndef ST_RIGHT #define ST_RIGHT 0x01 +#endif +#ifndef ST_CENTER #define ST_CENTER 0x02 +#endif +#ifndef ST_DOWN #define ST_DOWN 0x04 +#endif +#ifndef ST_UP #define ST_UP 0x08 +#endif +#ifndef ST_VCENTER #define ST_VCENTER 0x0C +#endif +#ifndef ST_TYPE #define ST_TYPE 0xF0 +#endif +#ifndef ST_SINGLE #define ST_SINGLE 0x00 +#endif +#ifndef ST_MULTI #define ST_MULTI 0x10 +#endif +#ifndef ST_TITLE_BAR #define ST_TITLE_BAR 0x20 +#endif +#ifndef ST_PICTURE #define ST_PICTURE 0x30 +#endif +#ifndef ST_FRAME #define ST_FRAME 0x40 +#endif +#ifndef ST_BACKGROUND #define ST_BACKGROUND 0x50 +#endif +#ifndef ST_HUD_BACKGROUND #define ST_HUD_BACKGROUND 0x80 +#endif +#ifndef ST_TILE_PICTURE #define ST_TILE_PICTURE 0x90 +#endif +#ifndef ST_WITH_RECT #define ST_WITH_RECT 0xA0 +#endif +#ifndef ST_LINE #define ST_LINE 0xB0 +#endif +#ifndef ST_SHADOW #define ST_SHADOW 0x100 +#endif +#ifndef ST_NO_RECT #define ST_NO_RECT 0x200 +#endif +#ifndef ST_KEEP_ASPECT_RATIO #define ST_KEEP_ASPECT_RATIO 0x800 +#endif +#ifndef ST_TITLE #define ST_TITLE ST_TITLE_BAR + ST_CENTER +#endif // Slider styles +#ifndef SL_DIR #define SL_DIR 0x400 +#endif +#ifndef SL_VERT #define SL_VERT 0 +#endif +#ifndef SL_HORZ #define SL_HORZ 0x400 +#endif +#ifndef SL_TEXTURES #define SL_TEXTURES 0x10 +#endif // progress bar +#ifndef ST_VERTICAL #define ST_VERTICAL 0x01 +#endif +#ifndef ST_HORIZONTAL #define ST_HORIZONTAL 0 +#endif // Listbox styles +#ifndef LB_TEXTURES #define LB_TEXTURES 0x10 +#endif +#ifndef LB_MULTI #define LB_MULTI 0x20 +#endif // Tree styles +#ifndef TR_SHOWROOT #define TR_SHOWROOT 1 +#endif +#ifndef TR_AUTOCOLLAPSE #define TR_AUTOCOLLAPSE 2 +#endif // MessageBox styles +#ifndef MB_BUTTON_OK #define MB_BUTTON_OK 1 +#endif +#ifndef MB_BUTTON_CANCEL #define MB_BUTTON_CANCEL 2 +#endif +#ifndef MB_BUTTON_USER #define MB_BUTTON_USER 4 +#endif //////////////// @@ -165,7 +303,7 @@ class respawnMenu_RscCombo text = ""; shadow = 0; font = "PuristaLight"; - sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 50) * 2)"; + sizeEx = "( ( ( ((safeZoneW / safeZoneH) min 1.2) / 1.2) / 50) * 2)"; fixedWidth = 0; arrowEmpty = "\A3\ui_f\data\GUI\RscCommon\rsccombo\arrow_combo_ca.paa"; arrowFull = "\A3\ui_f\data\GUI\RscCommon\rsccombo\arrow_combo_active_ca.paa"; @@ -311,7 +449,7 @@ class respawnMenu_RscListBox { }; style = 528; font = "PuristaMedium"; - sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 50) * 2.1)"; + sizeEx = "( ( ( ((safeZoneW / safeZoneH) min 1.2) / 1.2) / 50) * 2.1)"; //sizeEx = 1; shadow = 0; colorShadow[] = {0, 0, 0, 0.5}; @@ -338,7 +476,7 @@ class respawnMenu_RscEdit colorDisabled[] = {1, 1, 1, 0.25}; font = "TahomaB"; //sizeEx = 0.04; - sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 50) * 1.6)"; + sizeEx = "( ( ( ((safeZoneW / safeZoneH) min 1.2) / 1.2) / 50) * 1.6)"; autocomplete = ""; text = ""; size = 0.2; diff --git a/addons/respawn/dialogs.hpp b/addons/respawn/dialogs.hpp index ca09bd8d..56b4129c 100644 --- a/addons/respawn/dialogs.hpp +++ b/addons/respawn/dialogs.hpp @@ -3,27 +3,27 @@ $[ 1.063, ["respawnTool",[[0,0,1,1],0.025,0.04,"GUI_GRID"],0,1,0], - [1800,"respawnGroupFrame",[1,"",["0.238065 * safezoneW + safezoneX","0.3174 * safezoneH + safezoneY","0.510469 * safezoneW","0.484 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1500,"deadPlayersListBox",[1,"",["0.25147 * safezoneW + safezoneX","0.401 * safezoneH + safezoneY","0.139219 * safezoneW","0.308 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","1"],[]], - [1501,"groupListBox",[1,"",["0.468031 * safezoneW + safezoneX","0.401 * safezoneH + safezoneY","0.20625 * safezoneW","0.308 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1000,"waveRespawnTitle",[1,"Wave Respawn Tool",["0.247344 * safezoneW + safezoneX","0.313 * safezoneH + safezoneY","0.128906 * safezoneW","0.044 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1600,"respawneMenuAddButton",[1,"Add",["0.407199 * safezoneW + safezoneX","0.4494 * safezoneH + safezoneY","0.04125 * safezoneW","0.055 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1601,"respawnMenuRemoteButton",[1,"Remove",["0.407199 * safezoneW + safezoneX","0.5286 * safezoneH + safezoneY","0.04125 * safezoneW","0.055 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1602,"respawnMenuSpawnButton",[1,"Spawn Group",["0.587656 * safezoneW + safezoneX","0.731 * safezoneH + safezoneY","0.0773437 * safezoneW","0.044 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1603,"respawnMenuChangeRoleButton",[1,"Change Role",["0.684594 * safezoneW + safezoneX","0.445 * safezoneH + safezoneY","0.0567187 * safezoneW","0.055 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1604,"respawnMenuChangeRankButton",[1,"Change Rank",["0.684594 * safezoneW + safezoneX","0.544 * safezoneH + safezoneY","0.0567187 * safezoneW","0.055 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1001,"respawnMenuGroupNameText",[1,"INSERT_GROUP_NAME",["0.469062 * safezoneW + safezoneX","0.346 * safezoneH + safezoneY","0.108281 * safezoneW","0.033 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1002,"respawnMenuMarkerName",[1,"INSERT_MARKER_NAME",["0.417509 * safezoneW + safezoneX","0.7376 * safezoneH + safezoneY","0.108281 * safezoneW","0.033 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [2800,"respawnMenuGroupMarkerCheckbox",[1,"Give group Marker",["0.381416 * safezoneW + safezoneX","0.742 * safezoneH + safezoneY","0.0103125 * safezoneW","0.022 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1003,"respawnMenuSpawnMarkerText",[1,"Spawn with Marker?",["0.27623 * safezoneW + safezoneX","0.731 * safezoneH + safezoneY","0.113437 * safezoneW","0.044 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [2100,"respawnMenuSideCombo",[1,"Side",["0.5825 * safezoneW + safezoneX","0.335 * safezoneH + safezoneY","0.0876563 * safezoneW","0.022 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1004,"respawnMenuPlayersText",[1,"Players in Spectator: 0",["0.2525 * safezoneW + safezoneX","0.368 * safezoneH + safezoneY","0.108281 * safezoneW","0.033 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1605,"RscCloseButton",[1,"Close",["0.716563 * safezoneW + safezoneX","0.3196 * safezoneH + safezoneY","0.0309375 * safezoneW","0.022 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [2101,"",[1,"Side",["0.396792 * safezoneW + safezoneX","0.616422 * safezoneH + safezoneY","0.0670312 * safezoneW","0.022 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [2102,"",[1,"Side",["0.397248 * safezoneW + safezoneX","0.663533 * safezoneH + safezoneY","0.0670312 * safezoneW","0.022 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1606,"respawnMenuVOIP",[1,"Toggle Spectator VOIP",["0.365937 * safezoneW + safezoneX","0.346 * safezoneH + safezoneY","0.0979687 * safezoneW","0.022 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"Toggles the spectator channel for you (ACRE/TFAR), so that you can talk to dead players if alive.","-1"],[]], - [2103,"",[1,"Side",["0.5825 * safezoneW + safezoneX","0.368 * safezoneH + safezoneY","0.0876563 * safezoneW","0.022 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [2104,"",[1,"Side",["0.675312 * safezoneW + safezoneX","0.357 * safezoneH + safezoneY","0.0567187 * safezoneW","0.022 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]] + [1800,"respawnGroupFrame",[1,"",["0.238065 * safeZoneW + safeZoneX","0.3174 * safeZoneH + safeZoneY","0.510469 * safeZoneW","0.484 * safeZoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], + [1500,"deadPlayersListBox",[1,"",["0.25147 * safeZoneW + safeZoneX","0.401 * safeZoneH + safeZoneY","0.139219 * safeZoneW","0.308 * safeZoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","1"],[]], + [1501,"groupListBox",[1,"",["0.468031 * safeZoneW + safeZoneX","0.401 * safeZoneH + safeZoneY","0.20625 * safeZoneW","0.308 * safeZoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], + [1000,"waveRespawnTitle",[1,"Wave Respawn Tool",["0.247344 * safeZoneW + safeZoneX","0.313 * safeZoneH + safeZoneY","0.128906 * safeZoneW","0.044 * safeZoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], + [1600,"respawneMenuAddButton",[1,"Add",["0.407199 * safeZoneW + safeZoneX","0.4494 * safeZoneH + safeZoneY","0.04125 * safeZoneW","0.055 * safeZoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], + [1601,"respawnMenuRemoteButton",[1,"Remove",["0.407199 * safeZoneW + safeZoneX","0.5286 * safeZoneH + safeZoneY","0.04125 * safeZoneW","0.055 * safeZoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], + [1602,"respawnMenuSpawnButton",[1,"Spawn Group",["0.587656 * safeZoneW + safeZoneX","0.731 * safeZoneH + safeZoneY","0.0773437 * safeZoneW","0.044 * safeZoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], + [1603,"respawnMenuChangeRoleButton",[1,"Change Role",["0.684594 * safeZoneW + safeZoneX","0.445 * safeZoneH + safeZoneY","0.0567187 * safeZoneW","0.055 * safeZoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], + [1604,"respawnMenuChangeRankButton",[1,"Change Rank",["0.684594 * safeZoneW + safeZoneX","0.544 * safeZoneH + safeZoneY","0.0567187 * safeZoneW","0.055 * safeZoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], + [1001,"respawnMenuGroupNameText",[1,"INSERT_GROUP_NAME",["0.469062 * safeZoneW + safeZoneX","0.346 * safeZoneH + safeZoneY","0.108281 * safeZoneW","0.033 * safeZoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], + [1002,"respawnMenuMarkerName",[1,"INSERT_MARKER_NAME",["0.417509 * safeZoneW + safeZoneX","0.7376 * safeZoneH + safeZoneY","0.108281 * safeZoneW","0.033 * safeZoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], + [2800,"respawnMenuGroupMarkerCheckbox",[1,"Give group Marker",["0.381416 * safeZoneW + safeZoneX","0.742 * safeZoneH + safeZoneY","0.0103125 * safeZoneW","0.022 * safeZoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], + [1003,"respawnMenuSpawnMarkerText",[1,"Spawn with Marker?",["0.27623 * safeZoneW + safeZoneX","0.731 * safeZoneH + safeZoneY","0.113437 * safeZoneW","0.044 * safeZoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], + [2100,"respawnMenuSideCombo",[1,"Side",["0.5825 * safeZoneW + safeZoneX","0.335 * safeZoneH + safeZoneY","0.0876563 * safeZoneW","0.022 * safeZoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], + [1004,"respawnMenuPlayersText",[1,"Players in Spectator: 0",["0.2525 * safeZoneW + safeZoneX","0.368 * safeZoneH + safeZoneY","0.108281 * safeZoneW","0.033 * safeZoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], + [1605,"RscCloseButton",[1,"Close",["0.716563 * safeZoneW + safeZoneX","0.3196 * safeZoneH + safeZoneY","0.0309375 * safeZoneW","0.022 * safeZoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], + [2101,"",[1,"Side",["0.396792 * safeZoneW + safeZoneX","0.616422 * safeZoneH + safeZoneY","0.0670312 * safeZoneW","0.022 * safeZoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], + [2102,"",[1,"Side",["0.397248 * safeZoneW + safeZoneX","0.663533 * safeZoneH + safeZoneY","0.0670312 * safeZoneW","0.022 * safeZoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], + [1606,"respawnMenuVOIP",[1,"Toggle Spectator VOIP",["0.365937 * safeZoneW + safeZoneX","0.346 * safeZoneH + safeZoneY","0.0979687 * safeZoneW","0.022 * safeZoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"Toggles the spectator channel for you (ACRE/TFAR), so that you can talk to dead players if alive.","-1"],[]], + [2103,"",[1,"Side",["0.5825 * safeZoneW + safeZoneX","0.368 * safeZoneH + safeZoneY","0.0876563 * safeZoneW","0.022 * safeZoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], + [2104,"",[1,"Side",["0.675312 * safeZoneW + safeZoneX","0.357 * safeZoneH + safeZoneY","0.0567187 * safeZoneW","0.022 * safeZoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]] ] */ @@ -40,188 +40,188 @@ class respawnMenuDialog class respawnGroupFrame: respawnMenu_RscFrame { idc = -1; - x = 0.238065 * safezoneW + safezoneX; - y = 0.3174 * safezoneH + safezoneY; - w = 0.510469 * safezoneW; - h = 0.484 * safezoneH; + x = "0.238065 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.3174 * safeZoneH + safeZoneY); + w = "0.510469 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.484 * safeZoneH); }; - class deadPlayersListBox: respawnMenu_RscListbox + class deadPlayersListBox: respawnMenu_RscListBox { idc = 26891; - x = 0.25147 * safezoneW + safezoneX; - y = 0.401 * safezoneH + safezoneY; - w = 0.139219 * safezoneW; - h = 0.308 * safezoneH; + x = "0.25147 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.401 * safeZoneH + safeZoneY); + w = "0.139219 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.308 * safeZoneH); }; - class groupListBox: respawnMenu_RscListbox + class groupListBox: respawnMenu_RscListBox { idc = 26892; - x = 0.468031 * safezoneW + safezoneX; - y = 0.401 * safezoneH + safezoneY; - w = 0.20625 * safezoneW; - h = 0.308 * safezoneH; + x = "0.468031 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.401 * safeZoneH + safeZoneY); + w = "0.20625 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.308 * safeZoneH); }; class waveRespawnTitle: respawnMenu_RscText { idc = 1000; text = "Wave Respawn Tool"; - x = 0.247344 * safezoneW + safezoneX; - y = 0.313 * safezoneH + safezoneY; - w = 0.128906 * safezoneW; - h = 0.044 * safezoneH; + x = "0.247344 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.313 * safeZoneH + safeZoneY); + w = "0.128906 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.044 * safeZoneH); }; class respawnMenuAddButton: respawnMenu_RscButton { idc = 1600; text = "Add"; - x = 0.407199 * safezoneW + safezoneX; - y = 0.467 * safezoneH + safezoneY; - w = 0.04125 * safezoneW; - h = 0.055 * safezoneH; + x = "0.407199 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.467 * safeZoneH + safeZoneY); + w = "0.04125 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.055 * safeZoneH); action="['respawnMenuAddAction'] spawn tmf_respawn_fnc_handleRespawnUI"; }; class respawnMenuRemoveButton: respawnMenu_RscButton { idc = 1601; text = "Remove"; - x = 0.407199 * safezoneW + safezoneX; - y = 0.544 * safezoneH + safezoneY; - w = 0.04125 * safezoneW; - h = 0.055 * safezoneH; + x = "0.407199 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.544 * safeZoneH + safeZoneY); + w = "0.04125 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.055 * safeZoneH); action="['respawnMenuRemoveAction'] spawn tmf_respawn_fnc_handleRespawnUI"; }; class respawnMenuSpawnButton: respawnMenu_RscButton { idc = 1602; text = "Spawn Group"; - x = 0.641268 * safezoneW + safezoneX; - y = 0.731 * safezoneH + safezoneY; - w = 0.0773437 * safezoneW; - h = 0.044 * safezoneH; + x = "0.641268 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.731 * safeZoneH + safeZoneY); + w = "0.0773437 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.044 * safeZoneH); action="['respawnMenuRespawnAction'] spawn tmf_respawn_fnc_handleRespawnUI"; }; class respawnMenuChangeRoleButton: respawnMenu_RscButton { idc = 1603; text = "Cycle Role"; - x = 0.684594 * safezoneW + safezoneX; - y = 0.445 * safezoneH + safezoneY; - w = 0.0567187 * safezoneW; - h = 0.055 * safezoneH; + x = "0.684594 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.445 * safeZoneH + safeZoneY); + w = "0.0567187 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.055 * safeZoneH); action="['respawnMenuChangeRoleAction'] spawn tmf_respawn_fnc_handleRespawnUI"; }; class respawnMenuChangeRankButton: respawnMenu_RscButton { idc = 1604; text = "Cycle Rank"; - x = 0.684594 * safezoneW + safezoneX; - y = 0.544 * safezoneH + safezoneY; - w = 0.0567187 * safezoneW; - h = 0.055 * safezoneH; + x = "0.684594 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.544 * safeZoneH + safeZoneY); + w = "0.0567187 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.055 * safeZoneH); action="['respawnMenuChangeRankAction'] spawn tmf_respawn_fnc_handleRespawnUI"; }; class respawnMenuGroupNameText: respawnMenu_RscEdit { idc = 26898; text = "INSERT_GROUP_NAME"; - x = 0.469062 * safezoneW + safezoneX; - y = 0.346 * safezoneH + safezoneY; - w = 0.108281 * safezoneW; - h = 0.033 * safezoneH; + x = "0.469062 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.346 * safeZoneH + safeZoneY); + w = "0.108281 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.033 * safeZoneH); }; class respawnMenuMarkerName: respawnMenu_RscEdit { idc = 26899; text = "INSERT_MARKER_NAME"; - x = 0.376269 * safezoneW + safezoneX; - y = 0.7354 * safezoneH + safezoneY; - w = 0.108281 * safezoneW; - h = 0.033 * safezoneH; + x = "0.376269 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.7354 * safeZoneH + safeZoneY); + w = "0.108281 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.033 * safeZoneH); }; - class respawnMenuGroupMarkerCheckbox: respawnMenu_RscCheckbox + class respawnMenuGroupMarkerCheckbox: respawnMenu_RscCheckBox { idc = 26903; text = "Give group Marker"; - x = 0.352548 * safezoneW + safezoneX; - y = 0.742 * safezoneH + safezoneY; - w = 0.0103125 * safezoneW; - h = 0.022 * safezoneH; + x = "0.352548 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.742 * safeZoneH + safeZoneY); + w = "0.0103125 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.022 * safeZoneH); action = "['respawnMenuToggleGroupCheckbox'] spawn tmf_respawn_fnc_handleRespawnUI"; }; class respawnMenuSpawnMarkerText: respawnMenu_RscText { idc = 1003; text = "Spawn with Marker?"; - x = 0.253548 * safezoneW + safezoneX; - y = 0.731 * safezoneH + safezoneY; - w = 0.113437 * safezoneW; - h = 0.044 * safezoneH; + x = "0.253548 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.731 * safeZoneH + safeZoneY); + w = "0.113437 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.044 * safeZoneH); }; class respawnMenuPlayersText: respawnMenu_RscText { idc = 26895; text = "Players in Spectator: 0"; - x = 0.2525 * safezoneW + safezoneX; - y = 0.368 * safezoneH + safezoneY; - w = 0.108281 * safezoneW; - h = 0.033 * safezoneH; + x = "0.2525 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.368 * safeZoneH + safeZoneY); + w = "0.108281 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.033 * safeZoneH); }; class respawnMenuCloseButton: respawnMenu_RscButton { idc = 26904; text = "Close"; - x = 0.716563 * safezoneW + safezoneX; - y = 0.3196 * safezoneH + safezoneY; - w = 0.0309375 * safezoneW; - h = 0.022 * safezoneH; - action = "closeDialog 26893"; + x = "0.716563 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.3196 * safeZoneH + safeZoneY); + w = "0.0309375 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.022 * safeZoneH); + action = "(findDisplay 26893) closeDisplay 2;"; }; class respawnMenuRscComboRole: respawnMenu_RscCombo { idc = 26896; text = "Role"; - x = 0.396792 * safezoneW + safezoneX; - y = 0.616422 * safezoneH + safezoneY; - w = 0.0670312 * safezoneW; - h = 0.022 * safezoneH; + x = "0.396792 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.616422 * safeZoneH + safeZoneY); + w = "0.0670312 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.022 * safeZoneH); }; class respawnMenuRscComboRank: respawnMenu_RscCombo { idc = 26897; text = "Rank"; - x = 0.396792 * safezoneW + safezoneX; - y = 0.663533 * safezoneH + safezoneY; - w = 0.0670312 * safezoneW; - h = 0.022 * safezoneH; + x = "0.396792 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.663533 * safeZoneH + safeZoneY); + w = "0.0670312 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.022 * safeZoneH); }; //Marker combo boxs class RscCombo_2103: respawnMenu_RscCombo { idc = 26900; text = "Side"; - x = 0.493103 * safezoneW + safezoneX; - y = 0.742822 * safezoneH + safezoneY; - w = 0.0567187 * safezoneW; - h = 0.022 * safezoneH; + x = "0.493103 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.742822 * safeZoneH + safeZoneY); + w = "0.0567187 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.022 * safeZoneH); }; class RscCombo_2104: respawnMenu_RscCombo { idc = 26901; text = "Side"; - x = 0.569973 * safezoneW + safezoneX; - y = 0.743052 * safezoneH + safezoneY; - w = 0.0567187 * safezoneW; - h = 0.022 * safezoneH; + x = "0.569973 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.743052 * safeZoneH + safeZoneY); + w = "0.0567187 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.022 * safeZoneH); }; class respawnMenuVOIP: respawnMenu_RscButton { idc = 26927; text = "Toggle Spectator VOIP"; - x = 0.365937 * safezoneW + safezoneX; - y = 0.346 * safezoneH + safezoneY; - w = 0.0979687 * safezoneW; - h = 0.022 * safezoneH; + x = "0.365937 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.346 * safeZoneH + safeZoneY); + w = "0.0979687 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.022 * safeZoneH); tooltip = "Toggles the spectator channel for you (ACRE/TFAR), so that you can talk to dead players if alive."; action = "['toggleSpectator'] spawn tmf_respawn_fnc_handleRespawnUI"; }; @@ -229,28 +229,28 @@ class respawnMenuDialog { idc = 26894; text = "FactionCategory"; /*Formerly side */ - x = 0.5825 * safezoneW + safezoneX; - y = 0.335 * safezoneH + safezoneY; - w = 0.0876563 * safezoneW; - h = 0.022 * safezoneH; + x = "0.5825 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.335 * safeZoneH + safeZoneY); + w = "0.0876563 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.022 * safeZoneH); }; class respawnMenuFactionCombo: respawnMenu_RscCombo { idc = 26928; text = "Faction"; - x = 0.5825 * safezoneW + safezoneX; - y = 0.368 * safezoneH + safezoneY; - w = 0.0876563 * safezoneW; - h = 0.022 * safezoneH; + x = "0.5825 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.368 * safeZoneH + safeZoneY); + w = "0.0876563 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.022 * safeZoneH); }; class respawnMenuSideCombo: respawnMenu_RscCombo { idc = 26929; text = "Side"; - x = 0.675312 * safezoneW + safezoneX; - y = 0.357 * safezoneH + safezoneY; - w = 0.0567187 * safezoneW; - h = 0.022 * safezoneH; + x = "0.675312 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0.357 * safeZoneH + safeZoneY); + w = "0.0567187 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.022 * safeZoneH); }; }; }; @@ -269,14 +269,14 @@ class respawnMenuMapDialog { { idc = 26902; type = 100; - x = 0 * safezoneW + safezoneX; - y = 0 * safezoneH + safezoneY; - w = 1 * safezoneW; - h = 1 * safezoneH; + x = "0 * (safeZoneW min (safeZoneH * 4 / 3)) + (safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2)"; + y = QUOTE(0 * safeZoneH + safeZoneY); + w = "1 * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(1 * safeZoneH); onDraw = "_this call tmf_respawn_fnc_respawnDrawMapIcons"; onSetFocus = "['respawnMapLoaded'] spawn tmf_respawn_fnc_handleRespawnUI"; onMouseButtonDown = "['respawnMap_onMouseButtonDown',_this] spawn tmf_respawn_fnc_handleRespawnUI"; onKeyUp = "['respawnMap_keyUp',_this] spawn tmf_respawn_fnc_handleRespawnUI"; }; }; -}; \ No newline at end of file +}; diff --git a/addons/respawn/functions/fnc_handleRespawnUI.sqf b/addons/respawn/functions/fnc_handleRespawnUI.sqf index 0b25aa20..cf005687 100644 --- a/addons/respawn/functions/fnc_handleRespawnUI.sqf +++ b/addons/respawn/functions/fnc_handleRespawnUI.sqf @@ -198,7 +198,7 @@ switch _input do { _control = (RESPAWN_DISPLAY displayCtrl 26900); { private _idx = _control lbAdd (_x select 1); - _markerImg = (_x select 0); + private _markerImg = (_x select 0); if (_markerImg != "") then { _control lbSetPicture[_idx,_markerImg]; _control lbSetColor[_idx,[1,1,1,1]]; @@ -255,7 +255,7 @@ switch _input do { [{ params["_input", "_pfhID"]; _input params ["_oldSpectList"]; - _display = findDisplay 26893; + private _display = findDisplay 26893; if (isNull (findDisplay 26893)) exitWith { [_pfhID] call CBA_fnc_removePerFrameHandler;} ; //Recompute who is alive and Dead. @@ -508,7 +508,7 @@ switch _input do { }; // Hand over control to the map dialog. - closeDialog 26893; + (findDisplay 26893) closeDisplay 2; createDialog "respawnMenuMapDialog"; GVAR(respawnGuiParameters) = [_faction, _groupName, _markerType, _markerColor, _markerName]; @@ -519,7 +519,7 @@ switch _input do { if (alive player && !(player isKindOf "tmf_spectator_unit")) then { _pos = getPos player; } else { - if (count playableUnits > 0) then { + if (playableUnits isNotEqualTo []) then { _pos = getPos (playableUnits select 0); } else { if (count allUnits > 0) then { @@ -597,13 +597,13 @@ switch _input do { _x set [2,(respawnMenuRoles select _roleIdx) select 0]; } forEach GVAR(selectedRespawnGroup); - [[_groupName,_position, _faction, GVAR(selectedRespawnGroup), _markerType, _markerColor, _markerName,_halo,GVAR(selectedSide)], QFUNC(respawnWaveServer), false] call BIS_fnc_MP; + [_groupName,_position, _faction, GVAR(selectedRespawnGroup), _markerType, _markerColor, _markerName,_halo,GVAR(selectedSide)] remoteExec [QFUNC(respawnWaveServer), 2]; GVAR(selectedRespawnGroup) = []; // Close the Map ((findDisplay 26950) displayCtrl 26902) ctrlShow false; ((findDisplay 26950) displayCtrl 26902) mapCenterOnCamera false; - closeDialog 26950; + (findDisplay 26950) closeDisplay 2; }; }; //SPACEBAR (HALO TOGGLE) diff --git a/addons/respawn/functions/fnc_loadGear.sqf b/addons/respawn/functions/fnc_loadGear.sqf index 75b90efd..b44073d7 100644 --- a/addons/respawn/functions/fnc_loadGear.sqf +++ b/addons/respawn/functions/fnc_loadGear.sqf @@ -45,4 +45,4 @@ private _classes = []; { _return pushBack [_x,_classes select _forEachIndex] } forEach _factions; -_return \ No newline at end of file +_return diff --git a/addons/respawn/functions/fnc_respawnDrawMapIcons.sqf b/addons/respawn/functions/fnc_respawnDrawMapIcons.sqf index 7edc067c..d484c924 100644 --- a/addons/respawn/functions/fnc_respawnDrawMapIcons.sqf +++ b/addons/respawn/functions/fnc_respawnDrawMapIcons.sqf @@ -7,13 +7,13 @@ params["_fullmapWindow"]; if(alive _x) then { private _name = ""; if(isPlayer _x) then {_name = name _x}; - if(leader _x == _x && {isPlayer _x} count units _x > 0) then {_name = format["%1 - %2",toString(toArray(groupID (group _x)) - [45]),_name]}; - if(vehicle _x != _x && crew (vehicle _x) select 0 == _x || vehicle _x == _x) then + if(leader _x == _x && {isPlayer _x} count units _x > 0) then {_name = format["%1 - %2",toString(toArray(groupId (group _x)) - [45]),_name]}; + if(!isNull objectParent _x && crew (vehicle _x) select 0 == _x || isNull objectParent _x) then { private _icon = (vehicle _x getVariable ["f_cam_icon",""]); - if(_icon == "") then {_icon = gettext (configfile >> "CfgVehicles" >> typeOf (vehicle _x) >> "icon");vehicle _x setVariable ["f_cam_icon",_icon]}; + if(_icon == "") then {_icon = getText (configOf vehicle _x >> "icon");vehicle _x setVariable ["f_cam_icon",_icon]}; private _color = (side _x) call tmf_common_fnc_sideToColor; - _fullmapWindow drawIcon [_icon,_color,getpos _x,19,19,getDir (vehicle _x),_name,1]; + _fullmapWindow drawIcon [_icon,_color,getPos _x,19,19,getDir (vehicle _x),_name,1]; }; }; @@ -23,24 +23,24 @@ params["_fullmapWindow"]; private _markerShape = markerShape _x; private _markerPos = getMarkerPos _x; private _markerSize = getMarkerSize _x; - private _markerColor = (configfile >> "CfgMarkerColors" >> getMarkerColor _x >> "color") call BIS_fnc_colorConfigToRGBA; + private _markerColor = (configFile >> "CfgMarkerColors" >> getMarkerColor _x >> "color") call BIS_fnc_colorConfigToRGBA; private _markerDir = markerDir _x; switch (_markerShape) do { case "RECTANGLE": { - private _markerBrush = getText (configfile >> "cfgMarkerBrushes" >> markerBrush _x >> "texture"); + private _markerBrush = getText (configFile >> "cfgMarkerBrushes" >> markerBrush _x >> "texture"); _fullmapWindow drawRectangle [_markerPos, _markerSize select 0, _markerSize select 1, _markerDir, _markerColor, _markerBrush] }; case "ELLIPSE": { - private _markerBrush = getText (configfile >> "cfgMarkerBrushes" >> markerBrush _x >> "texture"); + private _markerBrush = getText (configFile >> "cfgMarkerBrushes" >> markerBrush _x >> "texture"); _fullmapWindow drawEllipse [_markerPos, _markerSize select 0, _markerSize select 1, _markerDir, _markerColor, _markerBrush] }; case "ICON": { private _markerType = getMarkerType _x; if (_markerType != "Empty") then { - _multiplier = 20; - _markerIcon = getText (configfile >> "CfgMarkers" >> _markerType >> "icon"); - _markerText = markerText _x; + private _multiplier = 20; + private _markerIcon = getText (configFile >> "CfgMarkers" >> _markerType >> "icon"); + private _markerText = markerText _x; _fullmapWindow drawIcon [_markerIcon, _markerColor, _markerPos, (_markerSize select 0) * _multiplier, (_markerSize select 1) * _multiplier, _markerDir, _markerText, 1]; }; }; @@ -71,4 +71,4 @@ if (_mousePos isEqualType []) then { }; _fullmapWindow drawIcon ["\A3\ui_f\data\map\markers\military\start_CA.paa",[1,0,0,1],_mousePos,20,20,0,_text,1]; }; -}; \ No newline at end of file +}; diff --git a/addons/respawn/functions/fnc_respawnGroupMarkerUpdate.sqf b/addons/respawn/functions/fnc_respawnGroupMarkerUpdate.sqf index 2a2c1f28..1897e787 100644 --- a/addons/respawn/functions/fnc_respawnGroupMarkerUpdate.sqf +++ b/addons/respawn/functions/fnc_respawnGroupMarkerUpdate.sqf @@ -39,4 +39,4 @@ if (isNil QGVAR(respawnedGroupsMarkerData)) exitWith {}; }; }; }; -} forEach GVAR(respawnedGroupsMarkerData); \ No newline at end of file +} forEach GVAR(respawnedGroupsMarkerData); diff --git a/addons/respawn/functions/fnc_respawnLocalClient.sqf b/addons/respawn/functions/fnc_respawnLocalClient.sqf index 0a0b7923..1a3af9cd 100644 --- a/addons/respawn/functions/fnc_respawnLocalClient.sqf +++ b/addons/respawn/functions/fnc_respawnLocalClient.sqf @@ -97,7 +97,7 @@ if (isClass(configFile >> "CfgPatches" >> "acre_main")) then { }, 0.1] call CBA_fnc_addPerFrameHandler; }; - _groupVarName = format ["GrpRespawn_%1",_groupNum]; +private _groupVarName = format ["GrpRespawn_%1",_groupNum]; if (_leader) then { //Broadcast group var to everyone so people can join. missionNamespace setVariable[_groupVarName,_dummyGroup]; diff --git a/addons/respawn/functions/fnc_respawnWaveServer.sqf b/addons/respawn/functions/fnc_respawnWaveServer.sqf index a62e35a7..e9a92fa9 100644 --- a/addons/respawn/functions/fnc_respawnWaveServer.sqf +++ b/addons/respawn/functions/fnc_respawnWaveServer.sqf @@ -20,14 +20,13 @@ params ["_groupName", "_position", "_faction", "_selectedRespawnGroup", "_marker private _leader = _forEachIndex==0; - [[GVAR(serverRespawnGroupCounter), + [GVAR(serverRespawnGroupCounter), _position, _faction, _typeOfUnit, _rank, GVAR(serverRespawnPlayerCounter), - _leader,_halo,_side,_groupName], - "tmf_respawn_fnc_respawnLocalClient", _client] call BIS_fnc_MP; + _leader,_halo,_side,_groupName] remoteExec [QFUNC(respawnLocalClient), _client]; //Setup respawned player to die if he disconnects? [GVAR(serverRespawnPlayerCounter)] spawn { @@ -47,7 +46,7 @@ params ["_groupName", "_position", "_faction", "_selectedRespawnGroup", "_marker GVAR(serverRespawnPlayerCounter) = GVAR(serverRespawnPlayerCounter) + 1; } forEach _selectedRespawnGroup; -_groupVarName = format ["GrpRespawn_%1",GVAR(serverRespawnGroupCounter)]; +private _groupVarName = format ["GrpRespawn_%1",GVAR(serverRespawnGroupCounter)]; GVAR(serverRespawnGroupCounter) = GVAR(serverRespawnGroupCounter) + 1; [_groupVarName,_markerType,_markerName,_markerColor,_groupName] spawn { diff --git a/addons/respawn/script_component.hpp b/addons/respawn/script_component.hpp index 4d237c8b..0b6f8c9e 100644 --- a/addons/respawn/script_component.hpp +++ b/addons/respawn/script_component.hpp @@ -1,5 +1,9 @@ +#ifndef TMF_RESPAWN_SCRIPT_COMPONENT_HPP +#define TMF_RESPAWN_SCRIPT_COMPONENT_HPP + #define COMPONENT respawn #include "\x\tmf\addons\main\script_mod.hpp" #include "\x\tmf\addons\main\script_macros.hpp" +#endif // TMF_RESPAWN_SCRIPT_COMPONENT_HPP diff --git a/addons/safestart/BriefingScreenControls.hpp b/addons/safestart/BriefingScreenControls.hpp index f584efb2..97363469 100644 --- a/addons/safestart/BriefingScreenControls.hpp +++ b/addons/safestart/BriefingScreenControls.hpp @@ -2,12 +2,12 @@ class GVAR(safeStartText) : RscText { idc = -1; text = ""; //--- ToDo: Localize; - x = (0.50-0.5/2) * safezoneW + safezoneX; - y = safezoneY; - w = 0.5 * safezoneW; - h = 0.05 * safezoneH; + x = QUOTE((0.50-0.5/2) * safeZoneW + safeZoneX); + y = "safeZoneY + 0.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = QUOTE(0.5 * safeZoneW); + h = "2.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; style = 0x02; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 2)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 2)"; colorText[] = {1,1,1,1}; shadow = 2; font = "PuristaBold"; diff --git a/addons/safestart/CfgModules.hpp b/addons/safestart/CfgModules.hpp index deb81e3e..0ee083ab 100644 --- a/addons/safestart/CfgModules.hpp +++ b/addons/safestart/CfgModules.hpp @@ -6,15 +6,9 @@ class CfgVehicles { class AttributesBase { class Default; - class Edit; // Default edit box (i.e., text input field) - class Combo; // Default combo box (i.e., drop-down menu) - class Checkbox; // Default checkbox (returned value is Bool) - class CheckboxNumber; // Default checkbox (returned value is Number) class ModuleDescription; // Module description - class Units; // Selection of units on which the module is applied }; class ModuleDescription { - class AnyBrain; }; }; class GVAR(module) : Module_F { @@ -24,10 +18,10 @@ class CfgVehicles { category = "Teamwork"; function = QFUNC(moduleInit); functionPriority = 1; - isGlobal = false; - isTriggerActivated = true; - isDisposable = true; - is3DEN = false; + isGlobal = 0; + isTriggerActivated = 1; + isDisposable = 1; + is3DEN = 0; // Module attributes class Attributes: AttributesBase { diff --git a/addons/safestart/CfgNonAIVehicles.hpp b/addons/safestart/CfgNonAIVehicles.hpp index 8b824c50..f4edbbd6 100644 --- a/addons/safestart/CfgNonAIVehicles.hpp +++ b/addons/safestart/CfgNonAIVehicles.hpp @@ -7,7 +7,7 @@ class CfgNonAIVehicles { size2[] = {0,0}; size3[] = {0,0,-1}; condition = QUOTE(time > 0 && not call FUNC(isActive)); - isServerOnly = true; + isServerOnly = 1; }; }; }; diff --git a/addons/safestart/RscTitles.hpp b/addons/safestart/RscTitles.hpp index fc767aa6..f2a19636 100644 --- a/addons/safestart/RscTitles.hpp +++ b/addons/safestart/RscTitles.hpp @@ -11,12 +11,12 @@ class RscTitles { { idc = 101; text = "SAFESTART ACTIVE"; //--- ToDo: Localize; - x = (0.50-0.5/2) * safezoneW + safezoneX; - y = safezoneY; - w = 0.5 * safezoneW; - h = 0.05 * safezoneH; + x = QUOTE((0.50-0.5/2) * safeZoneW + safeZoneX); + y = "safeZoneY + 0.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w = QUOTE(0.5 * safeZoneW); + h = "2.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; style = 0x02; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 2)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 2)"; colorText[] = {1,1,1,1}; shadow = 2; font = "PuristaBold"; @@ -33,12 +33,12 @@ class RscTitles { class Text : RscText { text = "X"; //--- ToDo: Localize; - x = safezoneX; - y = safezoneY + 0.825; - w = safezoneW; - h = 0.1 * safezoneH; + x = QUOTE(safeZoneX); + y = "safeZoneY + 0.825 * safeZoneH"; + w = QUOTE(safeZoneW); + h = "3.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; style = 0x02; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 3)"; + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 3)"; colorText[] = {1,1,1,1}; shadow = 2; font = "EtelkaMonospaceProBold"; diff --git a/addons/safestart/addon.toml b/addons/safestart/addon.toml deleted file mode 100644 index 9493ae6a..00000000 --- a/addons/safestart/addon.toml +++ /dev/null @@ -1,5 +0,0 @@ -[rapify] -enabled = false # Default: true -exclude = [ - "RscDisplayGetReady.hpp" -] \ No newline at end of file diff --git a/addons/safestart/config.cpp b/addons/safestart/config.cpp index 4c8a33c4..fce0178f 100644 --- a/addons/safestart/config.cpp +++ b/addons/safestart/config.cpp @@ -1,13 +1,13 @@ #include "script_component.hpp" -class cfgPatches +class CfgPatches { class ADDON { name = "TMF: Safestart"; author = "Head"; url = "http://www.teamonetactical.com"; - units[] = {GVAR(module)}; + units[] = {QGVAR(module)}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"tmf_common"}; diff --git a/addons/safestart/functions/fnc_briefingText.sqf b/addons/safestart/functions/fnc_briefingText.sqf index 65818573..7c81f43c 100644 --- a/addons/safestart/functions/fnc_briefingText.sqf +++ b/addons/safestart/functions/fnc_briefingText.sqf @@ -21,7 +21,7 @@ Author: ---------------------------------------------------------------------------- */ disableSerialization; -TRACE_1("Briefing Text onLoad", _this); +TRACE_1("Briefing Text onLoad",_this); params [["_ctrl", controlNull]]; @@ -33,10 +33,10 @@ params [["_ctrl", controlNull]]; private _time = [] call FUNC(timeRemaining); if (_time > 0) then { _this ctrlSetText "SAFESTART " + ([_time, "MM:SS"] call BIS_fnc_secondsToString); - TRACE_1("Briefing timer set", _time); + TRACE_1("Briefing timer set",_time); } else { _this ctrlSetText "SAFESTART ACTIVE"; - TRACE_1("Indefinite briefing timer set", _time); + TRACE_1("Indefinite briefing timer set",_time); }; }, _ctrl diff --git a/addons/safestart/functions/fnc_set.sqf b/addons/safestart/functions/fnc_set.sqf index 3cfd389c..5a63f47f 100644 --- a/addons/safestart/functions/fnc_set.sqf +++ b/addons/safestart/functions/fnc_set.sqf @@ -34,6 +34,6 @@ if (isNil QGVAR(instance)) then { GVAR(instance) setVariable ["timer", _duration]; }; -LOG_1("SafeStart set to %1", _duration); +LOG_1("SafeStart set to %1",_duration); nil diff --git a/addons/safestart/functions/pfh_exit.sqf b/addons/safestart/functions/pfh_exit.sqf index 6d1ba421..f3892122 100644 --- a/addons/safestart/functions/pfh_exit.sqf +++ b/addons/safestart/functions/pfh_exit.sqf @@ -1,13 +1,13 @@ #include "\x\tmf\addons\safeStart\script_component.hpp" -INFO_1("Safestart Ended, Mission time: %1", CBA_missionTime); +INFO_1("Safestart Ended, Mission time: %1",CBA_missionTime); // Reenable AI targetting and damage on local units if (GVAR(handleAI)) then { { - TRACE_1("Reenabled AI", _x); + TRACE_1("Reenabled AI",_x); private _EH = _x getVariable [QGVAR(aiEH),-1]; - _x removeEventHandler ["fired",_EH]; + _x removeEventHandler ["Fired",_EH]; _x enableAI "TARGET"; _x enableAI "AUTOTARGET"; _x allowDamage true; @@ -15,7 +15,7 @@ if (GVAR(handleAI)) then { }; // Remove fired eventhandler, left click action -player removeEventHandler ["fired",_firedEH]; +player removeEventHandler ["Fired",_firedEH]; if !(isNil "ace_interaction_fnc_showMouseHint") then { [player,"DefaultAction",_playerAction] call ace_common_fnc_removeActionEventHandler; } else { diff --git a/addons/safestart/functions/pfh_perframe.sqf b/addons/safestart/functions/pfh_perframe.sqf index 15c0d63e..1e7987b9 100644 --- a/addons/safestart/functions/pfh_perframe.sqf +++ b/addons/safestart/functions/pfh_perframe.sqf @@ -11,7 +11,7 @@ if (TIMER > 0) then { }; } else { // Timer is set to infinite - if !(ctrlText _textCtrl isEqualTo "SAFESTART ACTIVE") then { + if (ctrlText _textCtrl isNotEqualTo "SAFESTART ACTIVE") then { _textCtrl ctrlSetText "SAFESTART ACTIVE"; }; }; diff --git a/addons/safestart/functions/pfh_start.sqf b/addons/safestart/functions/pfh_start.sqf index a0840c8e..c5b3cea6 100644 --- a/addons/safestart/functions/pfh_start.sqf +++ b/addons/safestart/functions/pfh_start.sqf @@ -63,7 +63,7 @@ if !(isNil "ace_interaction_fnc_showMouseHint") then { ] call CBA_fnc_addPlayerAction; }; -_firedEH = player addEventHandler ["fired",{ +_firedEH = player addEventHandler ["Fired",{ deleteVehicle (_this select 6); if((_this select 1) == "Throw") then { LOG("Attempted to throw grenade during safestart"); @@ -79,7 +79,7 @@ _firedEH = player addEventHandler ["fired",{ if (GVAR(handleAI)) then { { - private _eh = _x addEventHandler ["fired",{deleteVehicle (_this select 6)}]; + private _eh = _x addEventHandler ["Fired",{deleteVehicle (_this select 6)}]; _x setVariable [QGVAR(aiEH), _eh, true]; // Broadcasted in case AI ownership is transferred. _x disableAI "TARGET"; _x disableAI "AUTOTARGET"; diff --git a/addons/safestart/initSettings.sqf b/addons/safestart/initSettings.sqf index a2b5c787..e6184b27 100644 --- a/addons/safestart/initSettings.sqf +++ b/addons/safestart/initSettings.sqf @@ -2,7 +2,7 @@ [ QGVAR(soundEnabled), "CHECKBOX", - ["Enable Safestart Sounds", "Whether to make countdown sounds during the last few seconds"], + ["Countdown sounds", "Play a beep for each of the last few seconds before safe start ends."], ["TMF", "Safestart"], true ] call CBA_fnc_addSetting; @@ -10,7 +10,7 @@ [ QGVAR(handleAI), "CHECKBOX", - ["Disable AI during safestart", "Whether to disable AI damage and targetting during safestart"], + ["Freeze AI during safe start", "AI cannot take damage or engage targets until safe start ends."], ["TMF", "Safestart"], true, 1, @@ -21,7 +21,7 @@ [ QGVAR(triggerSound), "CHECKBOX", - ["Dry fire sound", "Whether to make a sound when attempting to fire while safestart is active"], + ["Dry-fire click", "Play a click when a player tries to shoot during safe start."], ["TMF", "Safestart"], false, 1 @@ -30,7 +30,7 @@ [ QGVAR(enableDefaultSS), "CHECKBOX", - ["Enable default safestart", "If no safestart module is placed, this will be used."], + ["Safe start without a module", "Run safe start even when the mission has no Safe Start module, using the duration below."], ["TMF", "Safestart"], false, 1, @@ -41,7 +41,7 @@ [ QGVAR(defaultSS), "TIME", - ["Default safestart duration", "0 for infinite"], + ["Default safe start duration", "Used when there is no Safe Start module. 0 keeps safe start on until an admin ends it."], ["TMF", "Safestart"], [0,1800,120], 1, diff --git a/addons/safestart/script_component.hpp b/addons/safestart/script_component.hpp index 171116b2..35f0fb3a 100644 --- a/addons/safestart/script_component.hpp +++ b/addons/safestart/script_component.hpp @@ -1,3 +1,6 @@ +#ifndef TMF_SAFESTART_SCRIPT_COMPONENT_HPP +#define TMF_SAFESTART_SCRIPT_COMPONENT_HPP + #define COMPONENT safestart #include "\x\tmf\addons\main\script_mod.hpp" @@ -6,3 +9,5 @@ #define DIALOG_IDD 5413 #define TIMER (_this getVariable ["timer",-1]) + +#endif // TMF_SAFESTART_SCRIPT_COMPONENT_HPP diff --git a/addons/spectator/CfgEventHandlers.hpp b/addons/spectator/CfgEventHandlers.hpp index 91e0f3a6..66f67fe7 100644 --- a/addons/spectator/CfgEventHandlers.hpp +++ b/addons/spectator/CfgEventHandlers.hpp @@ -4,8 +4,8 @@ XEH_PREINIT; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE( call COMPILE_FILE(XEH_postInit) ); - clientInit = QUOTE( call COMPILE_FILE(XEH_clientPostInit) ); + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + clientInit = QUOTE(call COMPILE_FILE(XEH_clientPostInit)); }; }; diff --git a/addons/spectator/CfgVehicles.hpp b/addons/spectator/CfgVehicles.hpp index d528fdde..75f18deb 100644 --- a/addons/spectator/CfgVehicles.hpp +++ b/addons/spectator/CfgVehicles.hpp @@ -7,11 +7,9 @@ class CfgVehicles { class ArgumentsBaseUnits { - class Units; }; class ModuleDescription { - class AnyBrain; }; }; class GVAR(module) : Module_F @@ -65,7 +63,7 @@ class CfgVehicles class VirtualMan_F; class GVAR(unit) : VirtualMan_F { - author = ADDON; + author = QUOTE(ADDON); displayName = "TMF Spectator"; scope = 2; scopeCurator = 1; diff --git a/addons/spectator/XEH_PREP.hpp b/addons/spectator/XEH_PREP.hpp index 85a7c77a..74fd4289 100644 --- a/addons/spectator/XEH_PREP.hpp +++ b/addons/spectator/XEH_PREP.hpp @@ -36,4 +36,4 @@ PREP(initSpectatorUnit); PREP(testSpectator); PREP(onEntityKilled); PREP(processData); -PREP(onModeSwitch); \ No newline at end of file +PREP(onModeSwitch); diff --git a/addons/spectator/XEH_clientPostInit.sqf b/addons/spectator/XEH_clientPostInit.sqf index c51d87b0..2aa5777a 100644 --- a/addons/spectator/XEH_clientPostInit.sqf +++ b/addons/spectator/XEH_clientPostInit.sqf @@ -19,7 +19,7 @@ LOG("Client PostInit started"); 1 isEqualTo getMissionConfigValue ["Respawn",-1] ); - TRACE_5("Check JIP conditions",_templateActive, _isJIPAllowed, _isAIunit, CBA_missionTime, didJIP); + TRACE_5("Check JIP conditions",_templateActive,_isJIPAllowed,_isAIunit,CBA_missionTime,didJIP); TRACE_1("Check JIP conditions 2",(_templateActive && !(_isJIPAllowed || _isAIunit) && CBA_missionTime > 5 && didJIP)); if (_templateActive && !(_isJIPAllowed || _isAIunit) && CBA_missionTime > 5 && didJIP) then { @@ -43,7 +43,7 @@ LOG("Client PostInit started"); }] call CBA_fnc_addEventHandler; // Hide ST HUD if spectator is OPEN -if (isClass (configfile >> "CfgPatches" >> "STUI_GroupHUD")) then { +if (isClass (configFile >> "CfgPatches" >> "STUI_GroupHUD")) then { [{!isNil "STUI_Canvas_ShownHUD"}, { STUI_Canvas_ShownHUD_old = STUI_Canvas_ShownHUD; STUI_Canvas_ShownHUD = { diff --git a/addons/spectator/addon.toml b/addons/spectator/addon.toml deleted file mode 100644 index 778e682f..00000000 --- a/addons/spectator/addon.toml +++ /dev/null @@ -1,5 +0,0 @@ -[rapify] -enabled = false # Default: true -exclude = [ - "dialog.hpp" -] \ No newline at end of file diff --git a/addons/spectator/config.cpp b/addons/spectator/config.cpp index 24f1a925..5a1555e7 100644 --- a/addons/spectator/config.cpp +++ b/addons/spectator/config.cpp @@ -1,13 +1,13 @@ #include "script_component.hpp" -class cfgPatches +class CfgPatches { class ADDON { name = "TMF: Spectator"; author = "Head"; url = "http://www.teamonetactical.com"; - units[] = {}; + units[] = {QGVAR(module)}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"tmf_common"}; @@ -26,7 +26,6 @@ class CfgRespawnTemplates }; #include "autotest.hpp" #include "CfgEventHandlers.hpp" -#include "display3DEN.hpp" #include "dialog.hpp" #include "CfgVehicles.hpp" #include "tags.hpp" diff --git a/addons/spectator/dialog.hpp b/addons/spectator/dialog.hpp index d31645be..3d6c3f83 100644 --- a/addons/spectator/dialog.hpp +++ b/addons/spectator/dialog.hpp @@ -4,13 +4,8 @@ class RscText; class RscMapControl; class RscTree; class RscControlsGroup; -class IGUIBack; -class RscButtonMenuOK; -class RscTitle; class RscStructuredText; -class RscDebugConsole; class RscPicture; -class RscXSliderH; class ctrlControlsGroupNoScrollbars; class RscControlsGroupNoScrollbars; @@ -43,23 +38,44 @@ class RscSpectatorShortcutButton : RscPicture { }; //--- Spectator +#ifndef IDC_SPECTATOR_TMF_SPECTATOR_UNITLABEL #define IDC_SPECTATOR_TMF_SPECTATOR_UNITLABEL 4945 +#endif +#ifndef IDC_SPECTATOR_TMF_SPECTATOR_UNITLIST #define IDC_SPECTATOR_TMF_SPECTATOR_UNITLIST 7171 +#endif +#ifndef IDC_SPECTATOR_TMF_SPECTATOR_VISION #define IDC_SPECTATOR_TMF_SPECTATOR_VISION 5545 +#endif +#ifndef IDC_SPECTATOR_TMF_SPECTATOR_FILTER #define IDC_SPECTATOR_TMF_SPECTATOR_FILTER 5546 +#endif +#ifndef IDC_SPECTATOR_TMF_SPECTATOR_BUTTON #define IDC_SPECTATOR_TMF_SPECTATOR_BUTTON 5547 +#endif +#ifndef IDC_SPECTATOR_TMF_SPECTATOR_TAGS #define IDC_SPECTATOR_TMF_SPECTATOR_TAGS 5548 +#endif +#ifndef IDC_SPECTATOR_TMF_SPECTATOR_VIEW #define IDC_SPECTATOR_TMF_SPECTATOR_VIEW 5549 +#endif +#ifndef IDC_SPECTATOR_TMF_SPECTATOR_COMPASS #define IDC_SPECTATOR_TMF_SPECTATOR_COMPASS 5453 +#endif +#ifndef IDC_SPECTATOR_TMF_SPECTATOR_COMPASSLEFT #define IDC_SPECTATOR_TMF_SPECTATOR_COMPASSLEFT 5454 +#endif +#ifndef IDC_SPECTATOR_TMF_SPECTATOR_COMPASSRight #define IDC_SPECTATOR_TMF_SPECTATOR_COMPASSRight 5455 +#endif +#ifndef IDC_SPECTATOR_TMF_SPECTATOR_MUTE #define IDC_SPECTATOR_TMF_SPECTATOR_MUTE 5467 +#endif -#define BUTTON_WIDTH 0.02 * safezoneW -#define BUTTON_HEIGHT 0.031 * safezoneH -#define COLUMN(V) (0.002 * safezoneW + safezoneX)+((0.0215 * safezoneW) * V) +#define BUTTON_WIDTH "0.02 * (safeZoneW min (safeZoneH * 4 / 3))" +#define BUTTON_HEIGHT 0.031 * safeZoneH class GVAR(dialog) { idd = DISPLAY_ID; @@ -70,7 +86,7 @@ class GVAR(dialog) { fadeout = 0; duration = 2147483647; type = 0; - controlsBackground[] = {TMF_SPECTATOR_MOUSE,TMF_SPECTATOR_UNITLABEL,TMF_SPECTATOR_Compass,TMF_SPECTATOR_CompassLeft,TMF_SPECTATOR_CompassRight}; + controlsBackground[] = {"TMF_SPECTATOR_MOUSE","TMF_SPECTATOR_UNITLABEL","TMF_SPECTATOR_Compass","TMF_SPECTATOR_CompassLeft","TMF_SPECTATOR_CompassRight"}; onKeyDown = "[0,_this] call tmf_spectator_fnc_keyhandler"; onKeyUp= "[1,_this] call tmf_spectator_fnc_keyhandler"; onLoad = "_this call tmf_spectator_fnc_onLoad"; @@ -78,29 +94,29 @@ class GVAR(dialog) { class TMF_SPECTATOR_UNITLABEL: RscSpectatorText { idc = IDC_SPECTATOR_TMF_SPECTATOR_UNITLABEL; text = ""; //--- ToDo: Localize; - x = (0.50-0.15/2) * safezoneW + safezoneX; - y = 0.025 * safezoneH + safezoneY; - w = 0.15 * safezoneW; - h = 0.020 * safezoneH; + x = "(safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2) + ((0.50-0.15/2)) * (safeZoneW min (safeZoneH * 4 / 3))"; + y = QUOTE(0.025 * safeZoneH + safeZoneY); + w = "(0.15) * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.020 * safeZoneH); font = "PuristaSemiBold"; }; class TMF_SPECTATOR_Compass: RscSpectatorText { idc = IDC_SPECTATOR_TMF_SPECTATOR_COMPASS; text = "NW"; //--- ToDo: Localize; - x = (0.5-(0.07/2)) * safezoneW + safezoneX; - y = 0.005* safezoneH + safezoneY; - w = 0.07 * safezoneW; - h = 0.015 * safezoneH; + x = "(safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2) + ((0.5-(0.07/2))) * (safeZoneW min (safeZoneH * 4 / 3))"; + y = QUOTE(0.005* safeZoneH + safeZoneY); + w = "(0.07) * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.015 * safeZoneH); font = "PuristaBold"; }; class TMF_SPECTATOR_CompassLeft: RscSpectatorText { idc = IDC_SPECTATOR_TMF_SPECTATOR_COMPASSLEFT; text = "NW"; //--- ToDo: Localize; - x = (0.5-(0.14)/2) * safezoneW + safezoneX; - y = 0.005 * safezoneH + safezoneY; - w = 0.07 * safezoneW; - h = 0.015 * safezoneH; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.65)"; + x = "(safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2) + ((0.5-(0.14)/2)) * (safeZoneW min (safeZoneH * 4 / 3))"; + y = QUOTE(0.005 * safeZoneH + safeZoneY); + w = "(0.07) * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.015 * safeZoneH); + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.65)"; colorText[] = { 1, @@ -113,11 +129,11 @@ class GVAR(dialog) { class TMF_SPECTATOR_CompassRight: RscSpectatorText { idc = IDC_SPECTATOR_TMF_SPECTATOR_COMPASSRight; text = "NE"; //--- ToDo: Localize; - x = (0.5) * safezoneW + safezoneX; - y = 0.005 * safezoneH + safezoneY; - w = 0.07 * safezoneW; - h = 0.015 * safezoneH; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.65)"; + x = "(safeZoneX + (safeZoneW - (safeZoneW min (safeZoneH * 4 / 3))) / 2) + ((0.5)) * (safeZoneW min (safeZoneH * 4 / 3))"; + y = QUOTE(0.005 * safeZoneH + safeZoneY); + w = "(0.07) * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.015 * safeZoneH); + SizeEx = "(((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.65)"; colorText[] = { 1, @@ -130,40 +146,40 @@ class GVAR(dialog) { class controls { class TMF_SPECTATOR_FILTER: RscSpectatorShortcutButton { idc = IDC_SPECTATOR_TMF_SPECTATOR_FILTER; - x = COLUMN(1); - y = 0.002 * safezoneH + safezoneY; + x = "safeZoneX + 0.002 * (safeZoneW min (safeZoneH * 4 / 3)) + 0.0215 * (safeZoneW min (safeZoneH * 4 / 3)) * 1"; + y = QUOTE(0.002 * safeZoneH + safeZoneY); w = BUTTON_WIDTH; - h = BUTTON_HEIGHT; + h = QUOTE(BUTTON_HEIGHT); onButtonDown = "['disableAI',_this] call tmf_spectator_fnc_menuhandler;"; text = "\A3\ui_f\data\gui\Rsc\RscDisplayMultiplayerSetup\enabledai_ca.paa"; tooltip = "PLAYERS + AI"; }; class TMF_SPECTATOR_BUTTON: RscSpectatorShortcutButton { idc = IDC_SPECTATOR_TMF_SPECTATOR_BUTTON; - x = COLUMN(0); - y = 0.002 * safezoneH + safezoneY; + x = "safeZoneX + 0.002 * (safeZoneW min (safeZoneH * 4 / 3)) + 0.0215 * (safeZoneW min (safeZoneH * 4 / 3)) * 0"; + y = QUOTE(0.002 * safeZoneH + safeZoneY); w = BUTTON_WIDTH; - h = BUTTON_HEIGHT; + h = QUOTE(BUTTON_HEIGHT); text = "\x\tmf\addons\spectator\images\flag_civil_empty_ca_64.paa"; onButtonDown = "['sidefilter',_this] call tmf_spectator_fnc_menuhandler;"; tooltip = "SHOWING ALL SIDES"; }; class TMF_SPECTATOR_TAGS: RscSpectatorShortcutButton { idc = IDC_SPECTATOR_TMF_SPECTATOR_TAGS; - x = COLUMN(3); - y = 0.002 * safezoneH + safezoneY; + x = "safeZoneX + 0.002 * (safeZoneW min (safeZoneH * 4 / 3)) + 0.0215 * (safeZoneW min (safeZoneH * 4 / 3)) * 3"; + y = QUOTE(0.002 * safeZoneH + safeZoneY); w = BUTTON_WIDTH; - h = BUTTON_HEIGHT; + h = QUOTE(BUTTON_HEIGHT); text = "\A3\ui_f\data\map\Diary\textures_ca.paa"; onButtonDown = "['tags',_this] call tmf_spectator_fnc_menuhandler;"; tooltip = "DISABLE TAGS"; }; class TMF_SPECTATOR_VISION: RscSpectatorShortcutButton { idc = IDC_SPECTATOR_TMF_SPECTATOR_VISION; - x = COLUMN(4); - y = 0.002 * safezoneH + safezoneY; + x = "safeZoneX + 0.002 * (safeZoneW min (safeZoneH * 4 / 3)) + 0.0215 * (safeZoneW min (safeZoneH * 4 / 3)) * 4"; + y = QUOTE(0.002 * safeZoneH + safeZoneY); w = BUTTON_WIDTH; - h = BUTTON_HEIGHT; + h = QUOTE(BUTTON_HEIGHT); onButtonDown = "['vision',_this] call tmf_spectator_fnc_menuhandler;"; text = "\A3\ui_f\data\gui\Rsc\RscDisplayArsenal\nvgs_ca.paa"; tooltip = "CHANGE VISION MODE"; @@ -171,48 +187,48 @@ class GVAR(dialog) { class TMF_SPECTATOR_VIEW: RscSpectatorShortcutButton { idc = IDC_SPECTATOR_TMF_SPECTATOR_VIEW; onButtonDown = "['camera',_this] call tmf_spectator_fnc_menuhandler;"; - x = COLUMN(2); - y = 0.002 * safezoneH + safezoneY; + x = "safeZoneX + 0.002 * (safeZoneW min (safeZoneH * 4 / 3)) + 0.0215 * (safeZoneW min (safeZoneH * 4 / 3)) * 2"; + y = QUOTE(0.002 * safeZoneH + safeZoneY); w = BUTTON_WIDTH; - h = BUTTON_HEIGHT; + h = QUOTE(BUTTON_HEIGHT); text = "\A3\ui_f\data\IGUI\Cfg\IslandMap\iconcamera_ca.paa"; tooltip = "SWITCH TO FIRST PERSON"; }; class TMF_SPECTATOR_MUTE: RscSpectatorShortcutButton { idc = IDC_SPECTATOR_TMF_SPECTATOR_MUTE; onButtonDown = "['mute',_this] call tmf_spectator_fnc_menuhandler;"; - x = COLUMN(5); - y = 0.002 * safezoneH + safezoneY; + x = "safeZoneX + 0.002 * (safeZoneW min (safeZoneH * 4 / 3)) + 0.0215 * (safeZoneW min (safeZoneH * 4 / 3)) * 5"; + y = QUOTE(0.002 * safeZoneH + safeZoneY); w = BUTTON_WIDTH; - h = BUTTON_HEIGHT; + h = QUOTE(BUTTON_HEIGHT); text = "\A3\ui_f\data\gui\Rsc\RscDisplayArsenal\voice_ca.paa"; tooltip = "MUTE SPECTATORS"; }; class TMF_SPECTATOR_RADIO: RscSpectatorShortcutButton { idc = IDC_SPECTATOR_TMF_SPECTATOR_RADIO; onButtonDown = QUOTE([ARR_2('radio',_this)] call FUNC(menuhandler)); - x = COLUMN(6); - y = 0.002 * safezoneH + safezoneY; + x = "safeZoneX + 0.002 * (safeZoneW min (safeZoneH * 4 / 3)) + 0.0215 * (safeZoneW min (safeZoneH * 4 / 3)) * 6"; + y = QUOTE(0.002 * safeZoneH + safeZoneY); w = BUTTON_WIDTH; - h = BUTTON_HEIGHT; + h = QUOTE(BUTTON_HEIGHT); text = "\a3\Ui_f\data\GUI\Cfg\CommunicationMenu\call_ca.paa"; tooltip = "SHOW RADIO MENU"; }; class TMF_SPECTATOR_MAP : RscMapControl { idc = IDC_SPECTATOR_TMF_SPECTATOR_MAP; - x = 0 * safezoneW + safezoneX; - y = 0 * safezoneH + safezoneY; - w = 1 * safezoneW; - h = 1 * safezoneH; + x = QUOTE(0 * safeZoneW + safeZoneX); + y = QUOTE(0 * safeZoneH + safeZoneY); + w = QUOTE(1 * safeZoneW); + h = QUOTE(1 * safeZoneH); onDraw = "_this call tmf_spectator_fnc_drawMap"; onMouseButtonDown = "_this call tmf_spectator_fnc_onMapClick;"; }; class TMF_SPECTATOR_UNITLIST: RscTree { idc = IDC_SPECTATOR_TMF_SPECTATOR_UNITLIST; - x = 0.002 * safezoneW + safezoneX; - y = 0.038 * safezoneH + safezoneY; - w = 0.13 * safezoneW; - h = 0.940001 * safezoneH; + x = "safeZoneX + (0.002) * (safeZoneW min (safeZoneH * 4 / 3))"; + y = QUOTE(0.038 * safeZoneH + safeZoneY); + w = "(0.13) * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.940001 * safeZoneH); shadow = 2; colorBackground[] = {0,0,0,0}; disableKeyboardSearch = 1; @@ -237,10 +253,10 @@ class GVAR(dialog) { }; class TMF_SPECTATOR_KILLLIST : RscControlsGroupNoScrollbars { idc = 2300; - x = 0.763544 * safezoneW + safezoneX; - y = 0.005 * safezoneH + safezoneY; - w = 0.233576 * safezoneW; - h = (0.020*6.5) * safezoneH; + x = "safeZoneX + safeZoneW - 0.236456 * (safeZoneW min (safeZoneH * 4 / 3))"; + y = QUOTE(0.005 * safeZoneH + safeZoneY); + w = "(0.233576) * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE((0.020*6.5) * safeZoneH); style = 16; action = ""; colorBackground[] = {1,0,0,1}; @@ -250,16 +266,16 @@ class GVAR(dialog) { class dummy : RscText { // REQUIRED idc = -1; - x = 0.0 * safezoneW; - y = -5.0 * safezoneH; + x = "(0.0) * (safeZoneW min (safeZoneH * 4 / 3))"; + y = QUOTE(-5.0 * safeZoneH); }; class Label1: RscStructuredText { idc = 6; action = ""; - x = 0.00352533 * safezoneW; - y = 0.0 * safezoneH; - w = 0.230 * safezoneW; - h = 0.020 * safezoneH; + x = "(0.00352533) * (safeZoneW min (safeZoneH * 4 / 3))"; + y = QUOTE(0.0 * safeZoneH); + w = "(0.230) * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.020 * safeZoneH); colorBackground[] = {0,0,0,0.0}; text = ""; style = 0x01; @@ -270,46 +286,46 @@ class GVAR(dialog) { }; class Label2: Label1 { idc = 7; - x = 0.00352533 * safezoneW; - y = (0.020*1) * safezoneH; - w = 0.230 * safezoneW; - h = 0.020 * safezoneH; + x = "(0.00352533) * (safeZoneW min (safeZoneH * 4 / 3))"; + y = QUOTE((0.020*1) * safeZoneH); + w = "(0.230) * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.020 * safeZoneH); colorBackground[] = {0,0,0,0.0}; action = ""; }; class Label3: Label1 { idc = 8; - x = 0.00352533 * safezoneW; - y = (0.020*2) * safezoneH; - w = 0.230 * safezoneW; - h = 0.020 * safezoneH; + x = "(0.00352533) * (safeZoneW min (safeZoneH * 4 / 3))"; + y = QUOTE((0.020*2) * safeZoneH); + w = "(0.230) * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.020 * safeZoneH); colorBackground[] = {0,0,0,0.0}; action = ""; }; class Label4: Label1 { idc = 9; - x = 0.00352533 * safezoneW; - y = (0.020*3) * safezoneH; - w = 0.230 * safezoneW; - h = 0.020 * safezoneH; + x = "(0.00352533) * (safeZoneW min (safeZoneH * 4 / 3))"; + y = QUOTE((0.020*3) * safeZoneH); + w = "(0.230) * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.020 * safeZoneH); colorBackground[] = {0,0,0,0.0}; action = ""; }; class Label5: Label1 { idc = 10; - x = 0.00352533 * safezoneW; - y = (0.020*4) * safezoneH; - w = 0.230 * safezoneW; - h = 0.020 * safezoneH; + x = "(0.00352533) * (safeZoneW min (safeZoneH * 4 / 3))"; + y = QUOTE((0.020*4) * safeZoneH); + w = "(0.230) * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.020 * safeZoneH); colorBackground[] = {0,0,0,0.0}; action = ""; }; class Label6: Label1 { idc = 11; - x = 0.00352533 * safezoneW; - y = (0.020*5) * safezoneH; - w = 0.230 * safezoneW; - h = 0.020 * safezoneH; + x = "(0.00352533) * (safeZoneW min (safeZoneH * 4 / 3))"; + y = QUOTE((0.020*5) * safeZoneH); + w = "(0.230) * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.020 * safeZoneH); colorBackground[] = {0,0,0,0.0}; action = ""; }; @@ -331,8 +347,8 @@ class GVAR(dialog) { onMouseZChanged = "[""MouseZChanged"",_this] call tmf_spectator_fnc_mouseHandler"; onMouseMoving = "['MouseMoving',_this] call tmf_spectator_fnc_mouseHandler"; idc = 123; - x = SafeZoneX; y = SafeZoneY; - w = SafeZoneW; h = SafeZoneH; + x = QUOTE(SafeZoneX); y = QUOTE(SafeZoneY); + w = QUOTE(SafeZoneW); h = QUOTE(SafeZoneH); colorBackground[] = {0.2, 0.0, 0.0, 0.0}; }; }; diff --git a/addons/spectator/display3DEN.hpp b/addons/spectator/display3DEN.hpp deleted file mode 100644 index f4ebcc07..00000000 --- a/addons/spectator/display3DEN.hpp +++ /dev/null @@ -1,22 +0,0 @@ -class ctrlMenuStrip; -class display3DEN -{ - class Controls - { - class MenuStrip : ctrlMenuStrip - { - class Items - { - class TMF_Folder { - items[] += {"TMF_Spectator_Settings"}; - }; - class TMF_Spectator_Settings - { - text = "TMF Spectator Settings"; - action = "edit3DENMissionAttributes 'TMF_Spectator_Settings';"; - picture = "\x\tmf\addons\common\UI\icon_gear_ca"; - }; - }; - }; - }; -}; \ No newline at end of file diff --git a/addons/spectator/functions/fnc_controlSetPicture.sqf b/addons/spectator/functions/fnc_controlSetPicture.sqf index 33254323..04bb08e3 100644 --- a/addons/spectator/functions/fnc_controlSetPicture.sqf +++ b/addons/spectator/functions/fnc_controlSetPicture.sqf @@ -23,7 +23,7 @@ if (_picturePath != "" && {_control getVariable [QGVAR(lastImage),""] != _pictur _image ctrlSetText _picturePath; _control setVariable [QGVAR(lastImage),_picturePath]; }; -if (!(_control getVariable [QGVAR(lastColor),""] isEqualTo _color)) then { +if ((_control getVariable [QGVAR(lastColor),""] isNotEqualTo _color)) then { _image ctrlSetTextColor _color; _control setVariable [QGVAR(lastColor),_color]; }; diff --git a/addons/spectator/functions/fnc_controlSetText.sqf b/addons/spectator/functions/fnc_controlSetText.sqf index aa498430..49ed1ecc 100644 --- a/addons/spectator/functions/fnc_controlSetText.sqf +++ b/addons/spectator/functions/fnc_controlSetText.sqf @@ -24,10 +24,10 @@ private _textControl = controlNull; if (!_subtext) then {_textControl = _control controlsGroupCtrl 2;} else {_textControl = _control controlsGroupCtrl 3;}; -if (!(_textControl getVariable [QGVAR(lastText),""] isEqualTo _text)) then { +if ((_textControl getVariable [QGVAR(lastText),""] isNotEqualTo _text)) then { _textControl ctrlSetText _text; _textControl setVariable [QGVAR(lastText),_text]; }; -if (!isnil "_color" && {count _color == 4}) then { +if (!isNil "_color" && {count _color == 4}) then { _textControl ctrlSetTextColor _color; }; diff --git a/addons/spectator/functions/fnc_createGroupControl.sqf b/addons/spectator/functions/fnc_createGroupControl.sqf index 706b000b..e509b8dd 100644 --- a/addons/spectator/functions/fnc_createGroupControl.sqf +++ b/addons/spectator/functions/fnc_createGroupControl.sqf @@ -5,17 +5,17 @@ disableSerialization; private _control = (uiNamespace getVariable [QGVAR(display),displayNull]) ctrlCreate [QGVAR(GroupTag), -1]; _control ctrlShow false; -private _twGrpMkr = [_x] call EFUNC(orbat,getGroupMarkerData); +private _twGrpMkr = [_grp] call EFUNC(orbat,getGroupMarkerData); if (count _twGrpMkr == 3) then { _twGrpMkr params ["_grpTexture","_gname"]; [_control,_grpTexture,[1,1,1,1]] call FUNC(controlSetPicture); [_control,_gname] call FUNC(controlSetText); } else { - private _grpCache = _x getVariable [QGVAR(grpCache),[[], [1,1,1,1], true]]; + private _grpCache = _grp getVariable [QGVAR(grpCache),[[], [1,1,1,1], true]]; private _grpPos = _grpCache # 0; if (count _grpPos <= 0) then { - _grpCache = ([_x] call FUNC(updateGroupCache)); + _grpCache = ([_grp] call FUNC(updateGroupCache)); }; [_control,"\A3\ui_f\data\map\markers\nato\b_unknown.paa", _grpCache # 1] call FUNC(controlSetPicture); [_control,groupId _grp] call FUNC(controlSetText); diff --git a/addons/spectator/functions/fnc_createGroupNode.sqf b/addons/spectator/functions/fnc_createGroupNode.sqf index 5f4db45f..c08e3486 100644 --- a/addons/spectator/functions/fnc_createGroupNode.sqf +++ b/addons/spectator/functions/fnc_createGroupNode.sqf @@ -20,7 +20,7 @@ disableSerialization; private _twGrpMkr = [_grp] call EFUNC(orbat,getGroupMarkerData); -private _grpName = groupID _grp; +private _grpName = groupId _grp; private _icon = "\A3\ui_f\data\map\markers\nato\b_unknown.paa"; private _color = (side _grp) call CFUNC(sideToColor); diff --git a/addons/spectator/functions/fnc_createUnitNode.sqf b/addons/spectator/functions/fnc_createUnitNode.sqf index 8f2121c8..4ae448b1 100644 --- a/addons/spectator/functions/fnc_createUnitNode.sqf +++ b/addons/spectator/functions/fnc_createUnitNode.sqf @@ -24,8 +24,8 @@ private _unitListControl = (uiNamespace getVariable [QGVAR(unitlist),controlNull private _index = _unitListControl tvAdd [[_parentIndex],_name]; _unitListControl tvSetData [[_parentIndex,_index], _unit call BIS_fnc_netId]; -private _icon = getText (configFile >> "CfgVehicles" >> typeof (vehicle _unit) >> "icon"); -if (isText (configfile >> "CfgVehicleIcons" >> _icon )) then { - _icon = getText (configfile >> "CfgVehicleIcons" >> _icon ); +private _icon = getText (configOf (vehicle _unit) >> "icon"); +if (isText (configFile >> "CfgVehicleIcons" >> _icon )) then { + _icon = getText (configFile >> "CfgVehicleIcons" >> _icon ); }; _unitListControl tvSetPicture [[_parentIndex,_index],_icon]; diff --git a/addons/spectator/functions/fnc_createVehicleControl.sqf b/addons/spectator/functions/fnc_createVehicleControl.sqf index 19f1c038..be0187d6 100644 --- a/addons/spectator/functions/fnc_createVehicleControl.sqf +++ b/addons/spectator/functions/fnc_createVehicleControl.sqf @@ -7,7 +7,7 @@ private _control = (uiNamespace getVariable [QGVAR(display),displayNull]) ctrlCr _control ctrlShow false; [_control,"\a3\ui_f\data\map\Markers\military\box_CA.paa",_color] call FUNC(controlSetPicture); -[_control,getText (configFile >> "CfgVehicles" >> typeof _veh >> "displayName")] call FUNC(controlSetText); +[_control,getText (configOf _veh >> "displayName")] call FUNC(controlSetText); _veh setVariable [QGVAR(tagControl), [_control]]; _control setVariable [QGVAR(attached),_veh]; diff --git a/addons/spectator/functions/fnc_drawGroupMarker.sqf b/addons/spectator/functions/fnc_drawGroupMarker.sqf index b5c1db19..8527a062 100644 --- a/addons/spectator/functions/fnc_drawGroupMarker.sqf +++ b/addons/spectator/functions/fnc_drawGroupMarker.sqf @@ -10,7 +10,7 @@ * N/A */ params ['_map', '_grp','_color', '_pos']; - private _tmfGrpMarkerData = [_x] call EFUNC(orbat,getGroupMarkerData); + private _tmfGrpMarkerData = [_grp] call EFUNC(orbat,getGroupMarkerData); // if we have a framework orbat marker, use it. if(count _tmfGrpMarkerData >= 3) then { _tmfGrpMarkerData params ["_grpTexture","_gname","_grpTextureSize"]; @@ -20,5 +20,5 @@ if(count _tmfGrpMarkerData >= 3) then { } else { // here we draw the default icons if TW grp makers arent present _map drawIcon ["\A3\ui_f\data\map\markers\nato\b_unknown.paa", _color,_pos, 32, 32, 0,"", 0, 0.04 , MAP_FONT]; - _map drawIcon ["#(argb,8,8,3)color(0,0,0,0)", [1,1,1,1], _pos, 32, 32, 0,groupID _x, 0, 0.04 , MAP_FONT]; -}; \ No newline at end of file + _map drawIcon ["#(argb,8,8,3)color(0,0,0,0)", [1,1,1,1], _pos, 32, 32, 0,groupId _grp, 0, 0.04 , MAP_FONT]; +}; diff --git a/addons/spectator/functions/fnc_drawMap.sqf b/addons/spectator/functions/fnc_drawMap.sqf index 2a87c252..0704b41d 100644 --- a/addons/spectator/functions/fnc_drawMap.sqf +++ b/addons/spectator/functions/fnc_drawMap.sqf @@ -51,29 +51,29 @@ _map drawIcon [CAMERA_ICON, [0,0,0,1],getPos GVAR(camera),20,20,getDir GVAR(came private _data = _x getVariable [QGVAR(objectiveData),[]]; if(count _data > 0) then { _data params ["_icon","_text","_color"]; - private _pos = getpos _x; + private _pos = getPos _x; _map drawIcon [_icon, _color,_pos, 32, 32, 0,"", 2,0.04, MAP_FONT]; if(_text != "") then { _map drawIcon ["#(argb,8,8,3)color(0,0,0,0)", [1,1,1,_color select 3],_pos, 32, 32, 0,_text, 2,0.04, MAP_FONT]; }; }; -} foreach GVAR(objectives); +} forEach GVAR(objectives); { _X params ["_unit","_time","_killer","_deadSide","_killerSide",["_dName", ""],"_kName","_weapon","_isPlayer"]; _time = time - _time; - _name = ""; + private _name = ""; if(_isPlayer) then {_name = _dName}; if(_time <= 10) then { - _map drawIcon [KIA_ICON,[1,1,1,1 - (0.1 * _time)],getpos _unit,16,16,0,_name,0,0.04, MAP_FONT]; + _map drawIcon [KIA_ICON,[1,1,1,1 - (0.1 * _time)],getPos _unit,16,16,0,_name,0,0.04, MAP_FONT]; }; -} foreach GVAR(killedUnits); +} forEach GVAR(killedUnits); if(GVAR(tracers)) then { { _x params ["_object","_posArray","_last","_time","_type"]; - _pos = _posArray select (count _posArray-1); + private _pos = _posArray select -1; if(!isNull _object) then { private _pos = (getPosATLVisual _object); if(surfaceIsWater _pos) then {_pos = getPosASLVisual _object;}; @@ -88,11 +88,11 @@ if(GVAR(tracers)) then { _map drawLine [_posArray # 0, _pos, [1,0,0,1]]; }; if(_type == 0 && !isNull _object) then { - _pos = getpos _object; - _futurePos = _pos vectorAdd ((vectorDirVisual _object) vectorAdd (velocity _object vectorMultiply 0.3)); + _pos = getPos _object; + private _futurePos = _pos vectorAdd ((vectorDirVisual _object) vectorAdd (velocity _object vectorMultiply 0.3)); _map drawLine [_pos, _futurePos, [1,0,0,1]]; }; } forEach GVAR(rounds); }; -[QGVAR(draw2D), [_campos]] call CBA_fnc_localEvent; +[QGVAR(draw2D), [getPosVisual GVAR(camera), _map]] call CBA_fnc_localEvent; diff --git a/addons/spectator/functions/fnc_drawTags.sqf b/addons/spectator/functions/fnc_drawTags.sqf index d9e9b3d8..4fe75449 100644 --- a/addons/spectator/functions/fnc_drawTags.sqf +++ b/addons/spectator/functions/fnc_drawTags.sqf @@ -9,7 +9,7 @@ if (GVAR(showMap) || !GVAR(tags)) exitWith { cameraEffectEnableHUD true; private _camPos = getPosVisual GVAR(camera); private _viewDistance = ((getObjectViewDistance) select 0); -private _screenSize = [(0.04 * safezoneW), (0.01 * safezoneH)]; +private _screenSize = [(0.04 * (safeZoneW min (safeZoneH * 4 / 3))), (0.01 * safeZoneH)]; { // grab the group infomation cache @@ -156,7 +156,7 @@ private _screenSize = [(0.04 * safezoneW), (0.01 * safezoneH)]; private _fontSize = 0.04; private _pos = ([_x] call CFUNC(getPosVisual)); - if (_camPos distance2d _pos > 400) then {_fontSize = 0}; + if (_camPos distance2D _pos > 400) then {_fontSize = 0}; // draw icon drawIcon3D [_icon, _color,_pos, 1, 1, 0,"", 2,_fontSize,"PuristaSemibold" ]; @@ -177,7 +177,7 @@ private _screenSize = [(0.04 * safezoneW), (0.01 * safezoneH)]; _pos set [2,(_pos select 2)+1]; private _name = ""; if (_isplayer) then {_name = _dName;}; - if (_time <= 10 && {_camPos distance2d _pos <= 500}) then { + if (_time <= 10 && {_camPos distance2D _pos <= 500}) then { drawIcon3D ["\a3\Ui_F_Curator\Data\CfgMarkers\kia_ca.paa", [1,1,1,1 - (0.1 * _time)],_pos, 0.5, 0.5, 0,_name, 2,0.04,"PuristaSemibold" ]; }; } forEach GVAR(killedUnits); @@ -191,11 +191,11 @@ private _screenSize = [(0.04 * safezoneW), (0.01 * safezoneH)]; if(!GVAR(tracers)) exitWith {}; { _x params ["_object","_posArray","_last","_time","_type"]; - private _pos = _posArray select (count _posArray-1); + private _pos = _posArray select -1; if (!isNull _object) then { private _pos = [_object] call CFUNC(getPosVisual); }; - private _render = (_camPos distance2d _pos <= 400); + private _render = (_camPos distance2D _pos <= 400); if (_type > 0 && _render) then { private _icon = switch (_type) do { case 1 : { GRENADE_ICON }; @@ -211,4 +211,4 @@ if(!GVAR(tracers)) exitWith {}; } forEach GVAR(rounds); // emit event -[QGVAR(draw3D), [_camPos]] call CBA_fnc_localEvent; \ No newline at end of file +[QGVAR(draw3D), [_camPos]] call CBA_fnc_localEvent; diff --git a/addons/spectator/functions/fnc_drawUnitMarker.sqf b/addons/spectator/functions/fnc_drawUnitMarker.sqf index f3c0c6b6..0490ac40 100644 --- a/addons/spectator/functions/fnc_drawUnitMarker.sqf +++ b/addons/spectator/functions/fnc_drawUnitMarker.sqf @@ -14,12 +14,12 @@ private _pos = (getPosVisual _unit); private _icon = _unit getVariable [QGVAR(mapIcon),""]; private _size = 19; if(_icon == "") then { - _icon = getText (configfile >> "CfgVehicles" >> typeOf (vehicle _unit) >> "icon"); + _icon = getText (configOf (vehicle _unit) >> "icon"); _unit setVariable [QGVAR(mapIcon),_icon]; }; -_map drawIcon [_icon,_color,_pos,_size,_size,getdir _unit,"",0,0.04, MAP_FONT]; +_map drawIcon [_icon,_color,_pos,_size,_size,getDir _unit,"",0,0.04, MAP_FONT]; if(isPlayer _unit) then { - _map drawIcon ["#(argb,8,8,3)color(0,0,0,0)",[1,1,1,1],_pos,_size,_size,0,name _x,1,0.04, MAP_FONT]; + _map drawIcon ["#(argb,8,8,3)color(0,0,0,0)",[1,1,1,1],_pos,_size,_size,0,name _unit,1,0.04, MAP_FONT]; }; -if(GVAR(showlines)) then {_map drawLine [_pos,_grpPos,_color]}; \ No newline at end of file +if(GVAR(showlines)) then {_map drawLine [_pos,_grpPos,_color]}; diff --git a/addons/spectator/functions/fnc_drawVehicleMarker.sqf b/addons/spectator/functions/fnc_drawVehicleMarker.sqf index 00cdbca8..bcbfac41 100644 --- a/addons/spectator/functions/fnc_drawVehicleMarker.sqf +++ b/addons/spectator/functions/fnc_drawVehicleMarker.sqf @@ -14,12 +14,12 @@ private _pos = (getPosVisual _veh); private _size = 19; private _icon = _veh getVariable [QGVAR(mapIcon),""]; if(_icon == "") then { - _icon = getText (configfile >> "CfgVehicles" >> typeOf (vehicle _veh) >> "icon"); + _icon = getText (configOf (vehicle _veh) >> "icon"); _veh setVariable [QGVAR(mapIcon),_icon]; }; private _vehicleName = _veh getVariable [QGVAR(_vehicleName),""]; if(_vehicleName == "") then { - _vehicleName = getText ( configFile >> "CfgVehicles" >> typeOf _veh >> "displayname"); + _vehicleName = getText ( configOf _veh >> "displayname"); _veh setVariable [QGVAR(_vehicleName),_vehicleName]; }; if(isPlayer (effectiveCommander _veh)) then { @@ -28,4 +28,4 @@ if(isPlayer (effectiveCommander _veh)) then { private _name = format ["%1 [%2]",_vehicleName, count crew _veh]; _map drawIcon [_icon,_color,_pos,_size,_size,getDir _veh,"",0, 0.04, MAP_FONT]; _map drawIcon ["#(argb,8,8,3)color(0,0,0,0)",[1,1,1,1],_pos,_size,_size,0, _name,0, 0.04,MAP_FONT]; -if(GVAR(showlines)) then {_map drawLine [_pos,_grpPos,_color]}; \ No newline at end of file +if(GVAR(showlines)) then {_map drawLine [_pos,_grpPos,_color]}; diff --git a/addons/spectator/functions/fnc_getCardinal.sqf b/addons/spectator/functions/fnc_getCardinal.sqf index 08430eb0..08faa340 100644 --- a/addons/spectator/functions/fnc_getCardinal.sqf +++ b/addons/spectator/functions/fnc_getCardinal.sqf @@ -1,3 +1,3 @@ params ["_dir"]; if(_dir < 0) then {_dir = 360 + _dir}; -["N","NE","E","SE","S","SW","W","NW","N"] select (round ((_dir mod 360) / 45)); \ No newline at end of file +["N","NE","E","SE","S","SW","W","NW","N"] select (round ((_dir mod 360) / 45)); diff --git a/addons/spectator/functions/fnc_getGroupClusters.sqf b/addons/spectator/functions/fnc_getGroupClusters.sqf index 2ad49032..ec9ebe6d 100644 --- a/addons/spectator/functions/fnc_getGroupClusters.sqf +++ b/addons/spectator/functions/fnc_getGroupClusters.sqf @@ -11,7 +11,7 @@ private _distanceMaX = 100; private _unit = _x; _checkedMen pushBack _x; { - if(_x != _unit && {_x distance2d _unit < _distanceMaX} ) then + if(_x != _unit && {_x distance2D _unit < _distanceMaX} ) then { _cluster pushBack _x; _checkedMen pushBack _x; diff --git a/addons/spectator/functions/fnc_handleCamera.sqf b/addons/spectator/functions/fnc_handleCamera.sqf index 7aa105ad..7e75e3db 100644 --- a/addons/spectator/functions/fnc_handleCamera.sqf +++ b/addons/spectator/functions/fnc_handleCamera.sqf @@ -59,7 +59,7 @@ if(GVAR(mode) == FOLLOWCAM) then { GVAR(relpos) = [(sin(_ax)*_delta)*cos(_ay), (cos(_ax)*_delta)*cos(_ay), _zLevel]; GVAR(camera) camSetRelPos GVAR(relpos); GVAR(camera) camSetFov GVAR(followcam_fov); - if(GVAR(camera) distance2d GVAR(target) > 1000) then { + if(GVAR(camera) distance2D GVAR(target) > 1000) then { _commitTime = 0; }; GVAR(camera) camCommit _commitTime; @@ -84,7 +84,7 @@ if(GVAR(mode) == FREECAM) then { GVAR(freecam_move) params ["_mX","_mY","_mZ"]; GVAR(followcam_angle) params ["_angleX","_angleY"]; - _z = 0; + private _z = 0; _x = (_currPos select 0) + (_mX * (cos _angleX)) + (_mY * (sin _angleX)); _y = (_currPos select 1) - (_mX * (sin _angleX)) + (_mY * (cos _angleX)); _z = ((_currPos select 2) + _mZ); @@ -125,13 +125,13 @@ if(GVAR(mode) == FREECAM) then { if(GVAR(mode) == FIRSTPERSON) then { GVAR(target) switchCamera "internal"; - if(vehicle GVAR(target) != GVAR(target)) then + if(!isNull objectParent GVAR(target)) then { private _vehicle = vehicle GVAR(target); private _mode = "internal"; if((assignedVehicleRole GVAR(target) select 0) != "Cargo") then {_mode = "gunner"}; _vehicle switchCamera _mode; }; - if(vehicle GVAR(target) == GVAR(target) && (GVAR(mButtons) select 1)) then { GVAR(target) switchCamera "gunner"; }; + if(isNull objectParent GVAR(target) && (GVAR(mButtons) select 1)) then { GVAR(target) switchCamera "gunner"; }; }; GVAR(freecam_timestamp) = time; diff --git a/addons/spectator/functions/fnc_handleUnitList.sqf b/addons/spectator/functions/fnc_handleUnitList.sqf index 02843651..750f1e12 100644 --- a/addons/spectator/functions/fnc_handleUnitList.sqf +++ b/addons/spectator/functions/fnc_handleUnitList.sqf @@ -19,7 +19,7 @@ private _items = []; for "_index" from 0 to (_treeView tvCount []) do { private _netId = _treeView tvData [_index]; - _grpIndex = _lookupGroups findIf {(_x # 0) == _netId }; + private _grpIndex = _lookupGroups findIf {(_x # 0) == _netId }; if(_grpIndex >= 0) then { private _grp = ((_lookupGroups # _grpIndex) # 1); _foundGroups pushBack _grp; @@ -31,9 +31,9 @@ for "_index" from 0 to (_treeView tvCount []) do { if(!alive _unit || (group _unit) != _grp) then { _deleteRows pushBack _childIndex; } else { - private _icon = getText (configFile >> "CfgVehicles" >> typeof (vehicle _unit) >> "icon"); - if (isText (configfile >> "CfgVehicleIcons" >> _icon )) then { - _icon = getText (configfile >> "CfgVehicleIcons" >> _icon ); + private _icon = getText (configOf (vehicle _unit) >> "icon"); + if (isText (configFile >> "CfgVehicleIcons" >> _icon )) then { + _icon = getText (configFile >> "CfgVehicleIcons" >> _icon ); }; _treeView tvSetPicture [[_index, _childIndex], _icon]; } diff --git a/addons/spectator/functions/fnc_init.sqf b/addons/spectator/functions/fnc_init.sqf index eae79113..5749fd5a 100644 --- a/addons/spectator/functions/fnc_init.sqf +++ b/addons/spectator/functions/fnc_init.sqf @@ -36,7 +36,7 @@ waitUntil {missionNamespace getVariable ["BIS_fnc_feedback_allowDeathScreen",fal // Disable effects // disable effects death effects -if(!isnil "BIS_fnc_feedback_allowPP") then { BIS_fnc_feedback_allowPP = false; }; +if(!isNil "BIS_fnc_feedback_allowPP") then { BIS_fnc_feedback_allowPP = false; }; if(_isJip) then { [] spawn { @@ -50,7 +50,7 @@ if(isNil QGVAR(unit)) then {GVAR(unit) = objNull}; // Create a Virtual Agent to act as our player to make sure we get to keep Draw3D -if(isNull GVAR(unit) || !(typeOf GVAR(unit) isEqualTo QGVAR(unit))) then { +if(isNull GVAR(unit) || (typeOf GVAR(unit) isNotEqualTo QGVAR(unit))) then { if (isNull GVAR(group)) then { /* Incase spectator group is null */ createCenter sideLogic; diff --git a/addons/spectator/functions/fnc_isOpen.sqf b/addons/spectator/functions/fnc_isOpen.sqf index de630a84..ad0c5cc5 100644 --- a/addons/spectator/functions/fnc_isOpen.sqf +++ b/addons/spectator/functions/fnc_isOpen.sqf @@ -1,3 +1,3 @@ #include "\x\tmf\addons\spectator\script_component.hpp" -_display = findDisplay IDC_SPECTATOR_TMF_SPECTATOR_DIALOG; -!isNull _display \ No newline at end of file +private _display = findDisplay IDC_SPECTATOR_TMF_SPECTATOR_DIALOG; +!isNull _display diff --git a/addons/spectator/functions/fnc_keyhandler.sqf b/addons/spectator/functions/fnc_keyhandler.sqf index 47a1580c..121f1c62 100644 --- a/addons/spectator/functions/fnc_keyhandler.sqf +++ b/addons/spectator/functions/fnc_keyhandler.sqf @@ -103,14 +103,14 @@ params ["_type","_args"]; _args params ["_control","_key","_shift","_ctrl","_alt"]; -_done = true; +private _done = true; switch true do { case (_key == DIK_ESCAPE && _type == KEYDOWN) : { [QGVAR(blackout),false] call BIS_fnc_blackOut; with uiNamespace do { closeDialog 0; - _display = (findDisplay 46) createDisplay (["RscDisplayInterrupt","RscDisplayMPInterrupt"] select isMultiplayer); + private _display = (findDisplay 46) createDisplay (["RscDisplayInterrupt","RscDisplayMPInterrupt"] select isMultiplayer); _display displayAddEventHandler ["Unload", { with missionNamespace do { [player,player,true] call FUNC(init); @@ -171,7 +171,7 @@ switch true do { }; }; case (_key in (actionKeys "NightVision") && _type == KEYDOWN && !GVAR(showmap)) : { - ['vision',[uinamespace getVariable [QGVAR(vision),controlNull]]] call FUNC(menuhandler); + ['vision',[uiNamespace getVariable [QGVAR(vision),controlNull]]] call FUNC(menuhandler); }; case (_key == DIK_Z) : { if(_type == KEYDOWN) then @@ -213,7 +213,7 @@ switch true do { if(_type == KEYDOWN) then { GVAR(showMap) = !GVAR(showMap); with uiNamespace do { - _mapshow = (missionNamespace getVariable [QGVAR(showMap),false]); + private _mapshow = (missionNamespace getVariable [QGVAR(showMap),false]); GVAR(map) ctrlShow _mapshow; GVAR(map) ctrlMapAnimAdd [0,0.05,missionNamespace getVariable [QGVAR(target),GVAR(camera)]]; ctrlMapAnimCommit GVAR(map); @@ -227,13 +227,13 @@ switch true do { }; case (_key == DIK_T && _type == KEYDOWN): { GVAR(tracers) = !GVAR(tracers); - _message = "Tracers have been toggled off"; + private _message = "Tracers have been toggled off"; if(GVAR(tracers)) then {_message = "Tracers have been toggled on"}; systemChat _message; }; case (_key == DIK_K && _type == KEYDOWN): { GVAR(bulletTrails) = !GVAR(bulletTrails); - _message = "Bullet trails have been toggled off"; + private _message = "Bullet trails have been toggled off"; if(GVAR(bulletTrails)) then {_message = "Bullet trails have been toggled on"}; systemChat _message; }; @@ -248,7 +248,7 @@ switch true do { _done = false; }; case (_key == DIK_P && _type == KEYDOWN) : { - _time = ([time,true] call CFUNC(secondsToTime)); + private _time = ([time,true] call CFUNC(secondsToTime)); systemChat format["Mission time: %1:%2:%3",_time select 0,_time select 1,_time select 2]; }; case (_key in (actionKeys "curatorInterface") && _type == KEYDOWN): { @@ -271,7 +271,7 @@ switch true do { }; }; }; - case default { + default { _done =false; if(_type == KEYDOWN) then { [QGVAR(keyDown),_this] call CBA_fnc_localEvent; diff --git a/addons/spectator/functions/fnc_menuHandler.sqf b/addons/spectator/functions/fnc_menuHandler.sqf index 83fe4d43..9468dd3b 100644 --- a/addons/spectator/functions/fnc_menuHandler.sqf +++ b/addons/spectator/functions/fnc_menuHandler.sqf @@ -39,8 +39,8 @@ switch (_button) do { case "disableAI": { GVAR(playersOnly) = !GVAR(playersOnly); - _text = "\A3\ui_f\data\gui\Rsc\RscDisplayMultiplayerSetup\enabledai_ca.paa"; - _messsage = "AI + PLAYERS"; + private _text = "\A3\ui_f\data\gui\Rsc\RscDisplayMultiplayerSetup\enabledai_ca.paa"; + private _messsage = "AI + PLAYERS"; if(GVAR(playersOnly)) then {_messsage = "PLAYERS ONLY";_text = "\A3\ui_f\data\gui\Rsc\RscDisplayMultiplayerSetup\disabledai_ca.paa";}; @@ -81,19 +81,19 @@ switch (_button) do { case "vision" : { GVAR(visionMode) = GVAR(visionMode) +1; if(GVAR(visionMode) > 2) then {GVAR(visionMode) = 0}; - false setCamUseTi 0; + false setCamUseTI 0; camUseNVG false; switch (GVAR(visionMode)) do { case 1: { camUseNVG true; }; case 2: { - true setCamUseTi 0; + true setCamUseTI 0; }; }; - _i = (GVAR(visionMode))+1; + private _i = (GVAR(visionMode))+1; if(_i > 2) then {_i = 0}; - if(isNil "_control" || {isNull _control}) then {_control = uinamespace getVariable [QGVAR(vision),controlNull];}; + if(isNil "_control" || {isNull _control}) then {_control = uiNamespace getVariable [QGVAR(vision),controlNull];}; _control ctrlSetTooltip format ["Switch to %1", GVAR(visionMode_strings) select _i ]; }; case "camera" : { diff --git a/addons/spectator/functions/fnc_mouseHandler.sqf b/addons/spectator/functions/fnc_mouseHandler.sqf index 386539a3..c5474754 100644 --- a/addons/spectator/functions/fnc_mouseHandler.sqf +++ b/addons/spectator/functions/fnc_mouseHandler.sqf @@ -10,7 +10,7 @@ switch (_type) do { private _target = _control getVariable [QGVAR(attached), objNull]; if(_target isEqualType grpNull) then { private _units = units _target select {alive _x}; - if(count _units > 0) then {_target = _units select 0} + if(_units isNotEqualTo []) then {_target = _units select 0} else { _target = objNull }; diff --git a/addons/spectator/functions/fnc_onChange.sqf b/addons/spectator/functions/fnc_onChange.sqf index 72c201a6..c27dd9e8 100644 --- a/addons/spectator/functions/fnc_onChange.sqf +++ b/addons/spectator/functions/fnc_onChange.sqf @@ -12,4 +12,4 @@ if(count _path > 1) then { if(!isNull _group) then { [ leader _group ] call FUNC(setTarget); } -}; \ No newline at end of file +}; diff --git a/addons/spectator/functions/fnc_onEntityKilled.sqf b/addons/spectator/functions/fnc_onEntityKilled.sqf index 816f83ab..58923d30 100644 --- a/addons/spectator/functions/fnc_onEntityKilled.sqf +++ b/addons/spectator/functions/fnc_onEntityKilled.sqf @@ -8,7 +8,7 @@ if(count (_deadMan getVariable [QGVAR(tagControl),[]]) > 0) then { ctrlDelete ((_deadMan getVariable [QGVAR(tagControl),[controlNull]]) select 0); }; -if(!(side _deadMan in [blufor,opfor,independent,civilian]) || !(_deadMan isKindOf "CAManBase" || _deadMan isKindOf "AllVehicles") ) exitwith {}; +if(!(side _deadMan in [blufor,opfor,independent,civilian]) || !(_deadMan isKindOf "CAManBase" || _deadMan isKindOf "AllVehicles") ) exitWith {}; if(isNull _instigator || _instigator == _deadMan) then { _instigator = _deadMan getVariable [QGVAR(lastDamage),objNull]; }; @@ -18,9 +18,9 @@ private _dName = ""; private _isPlayer = isPlayer _deadMan; if(_isPlayer) then {_dName = name (_deadMan);}; if(isPlayer _instigator) then {_kName = name (_instigator);}; -if(_dName == "") then { _dName = getText (configFile >> "CfgVehicles" >> typeOf _deadMan >> "displayName"); }; -if(_kName == "") then { _kName = getText (configFile >> "CfgVehicles" >> typeOf _instigator >> "displayName"); }; +if(_dName == "") then { _dName = getText (configOf _deadMan >> "displayName"); }; +if(_kName == "") then { _kName = getText (configOf _instigator >> "displayName"); }; private _weapon = getText (configFile >> "CfgWeapons" >> currentWeapon _instigator >> "displayName"); -if (!isNull (objectParent _instigator)) then { _weapon = getText (configFile >> "CfgVehicles" >> typeOf (vehicle _instigator) >> "displayName");}; +if (!isNull (objectParent _instigator)) then { _weapon = getText (configOf (vehicle _instigator) >> "displayName");}; GVAR(killList_forceUpdate) = true; -GVAR(killedUnits) pushback [_deadMan,time,_instigator,side group _deadMan,side group _instigator,_dName,_kName,_weapon,_isPlayer]; \ No newline at end of file +GVAR(killedUnits) pushBack [_deadMan,time,_instigator,side group _deadMan,side group _instigator,_dName,_kName,_weapon,_isPlayer]; diff --git a/addons/spectator/functions/fnc_onMapClick.sqf b/addons/spectator/functions/fnc_onMapClick.sqf index f5562353..5ad973f4 100644 --- a/addons/spectator/functions/fnc_onMapClick.sqf +++ b/addons/spectator/functions/fnc_onMapClick.sqf @@ -5,13 +5,13 @@ private _pos = _control ctrlMapScreenToWorld [_x, _y]; switch (GVAR(mode)) do { case FOLLOWCAM: { private _ents = _pos nearEntities ["Man", 15]; - if (count _ents > 0) then {[_ents select 0] call FUNC(setTarget)}; + if (_ents isNotEqualTo []) then {[_ents select 0] call FUNC(setTarget)}; }; case FREECAM: { GVAR(camera) setPosASL [_pos select 0,_pos select 1,(getTerrainHeightASL[_pos select 0,_pos select 1])+2]; }; case FIRSTPERSON: { private _ents = _pos nearEntities ["Man", 15]; - if(count _ents > 0) then {[_ents select 0] call FUNC(setTarget)}; + if(_ents isNotEqualTo []) then {[_ents select 0] call FUNC(setTarget)}; }; }; diff --git a/addons/spectator/functions/fnc_onModeSwitch.sqf b/addons/spectator/functions/fnc_onModeSwitch.sqf index a766924f..af21ceb5 100644 --- a/addons/spectator/functions/fnc_onModeSwitch.sqf +++ b/addons/spectator/functions/fnc_onModeSwitch.sqf @@ -40,4 +40,4 @@ switch(GVAR(mode)) do { GVAR(mode) = FOLLOWCAM; }; }; -}; \ No newline at end of file +}; diff --git a/addons/spectator/functions/fnc_perFrameHandler.sqf b/addons/spectator/functions/fnc_perFrameHandler.sqf index 872484d4..5bfcd233 100644 --- a/addons/spectator/functions/fnc_perFrameHandler.sqf +++ b/addons/spectator/functions/fnc_perFrameHandler.sqf @@ -33,7 +33,7 @@ private _idx = _dirArray find _leftDir; _dirArray = [_leftDir, _dirArray select (_idx + 1), _dirArray select (_idx + 2)]; (uiNamespace getVariable QGVAR(compass)) params ["_compassL","_compass","_compassR"]; -if (!(_dirArray isEqualTo GVAR(lastCompassValue))) then { +if ((_dirArray isNotEqualTo GVAR(lastCompassValue))) then { _compassL ctrlSetText (_dirArray select 0); _compass ctrlSetText (_dirArray select 1); _compassR ctrlSetText (_dirArray select 2); @@ -67,6 +67,6 @@ if(GVAR(killList_update) >= time || GVAR(killList_forceUpdate)) then { GVAR(rounds) set [_forEachIndex,[_object,_posArray,diag_frameNo,_time,_type]]; }; if( _type > 0 && { isNull _object } || _type == 0 && {(time - _time) > 5} ) then { GVAR(rounds) set [_forEachIndex,0]; }; -} foreach GVAR(rounds); +} forEach GVAR(rounds); GVAR(rounds) = GVAR(rounds) - [0]; diff --git a/addons/spectator/functions/fnc_processData.sqf b/addons/spectator/functions/fnc_processData.sqf index 59357d35..ea69ebd2 100644 --- a/addons/spectator/functions/fnc_processData.sqf +++ b/addons/spectator/functions/fnc_processData.sqf @@ -5,4 +5,4 @@ [_x] call FUNC(updateGroupCache); } forEach allGroups; -GVAR(vehicles) = GVAR(vehicles) select {!isNull _x}; \ No newline at end of file +GVAR(vehicles) = GVAR(vehicles) select {!isNull _x}; diff --git a/addons/spectator/functions/fnc_setTarget.sqf b/addons/spectator/functions/fnc_setTarget.sqf index a44ae32f..ce020384 100644 --- a/addons/spectator/functions/fnc_setTarget.sqf +++ b/addons/spectator/functions/fnc_setTarget.sqf @@ -24,16 +24,16 @@ switch (GVAR(mode)) do { _camPos = [_x,_y,(_z max (getTerrainHeightASL[_x,_y] + 10))]; GVAR(camera) setPosASL _camPos; - _dir = (getPos GVAR(camera)) getDir (getpos GVAR(target)); + private _dir = (getPos GVAR(camera)) getDir (getPos GVAR(target)); private _angleY = atan (((_targetPos select 2) - (_camPos select 2))/ (_camPos distance2D _targetPos)); GVAR(followcam_angle) = [_dir,_angleY]; }; case FIRSTPERSON: { - GVAR(target) SwitchCamera "internal"; - if (vehicle GVAR(target) != GVAR(target)) then + GVAR(target) switchCamera "internal"; + if (!isNull objectParent GVAR(target)) then { - _vehicle = vehicle GVAR(target); - _mode = "internal"; + private _vehicle = vehicle GVAR(target); + private _mode = "internal"; if((assignedVehicleRole GVAR(target) select 0) != "Cargo") then {_mode = "gunner"}; _vehicle switchCamera _mode; }; @@ -47,4 +47,4 @@ if(GVAR(showMap)) then { GVAR(map) ctrlMapAnimAdd [0.3,ctrlMapScale GVAR(map),_target ]; ctrlMapAnimCommit GVAR(map); }; -}; \ No newline at end of file +}; diff --git a/addons/spectator/functions/fnc_testSpectator.sqf b/addons/spectator/functions/fnc_testSpectator.sqf index 8dc551e0..8c478053 100644 --- a/addons/spectator/functions/fnc_testSpectator.sqf +++ b/addons/spectator/functions/fnc_testSpectator.sqf @@ -3,7 +3,7 @@ private _output = []; if (!((getMissionConfigValue ["respawn",0] == 1) and ("TMF_Spectator" in (getMissionConfigValue ["respawnTemplates",[]])))) then { - _output pushBack [0,"TMF Spectator is not setup correctly. See wiki for instructions."]; + _output pushBack [0,"TMF spectator is not set up: description.ext needs respawn = 1 and TMF_Spectator in respawnTemplates."]; }; diff --git a/addons/spectator/functions/fnc_updateGroupCache.sqf b/addons/spectator/functions/fnc_updateGroupCache.sqf index d3b71415..b11f7b29 100644 --- a/addons/spectator/functions/fnc_updateGroupCache.sqf +++ b/addons/spectator/functions/fnc_updateGroupCache.sqf @@ -10,7 +10,7 @@ if(_hasPlayers || {GVAR(showGroupMarkers) == 1}) then { private _cluster = ([units _grp] call FUNC(getGroupClusters)); if (count _cluster > 0) then { { - _pos = [_x] call CFUNC(getPosVisual); + private _pos = [_x] call CFUNC(getPosVisual); _avgpos = _avgpos vectorAdd _pos; } forEach _cluster; private _c = count _cluster; @@ -22,7 +22,7 @@ if(_hasPlayers || {GVAR(showGroupMarkers) == 1}) then { _avgpos set [2,(_avgpos select 2)+10]; }; }; -private _grpCache = _x getVariable [QGVAR(grpCache),[[0,0,0],[1,1,1,1],true]]; +private _grpCache = _grp getVariable [QGVAR(grpCache),[[0,0,0],[1,1,1,1],true]]; if((_grpCache # 0) distance (_avgpos) < 1.5) then { _avgpos = _grpCache # 0; // diff is to small, render the same. }; diff --git a/addons/spectator/functions/fnc_updateKillList.sqf b/addons/spectator/functions/fnc_updateKillList.sqf index ddd87237..1a11bbd9 100644 --- a/addons/spectator/functions/fnc_updateKillList.sqf +++ b/addons/spectator/functions/fnc_updateKillList.sqf @@ -1,7 +1,7 @@ #include "\x\tmf\addons\spectator\script_component.hpp" for "_i" from 1 to 6 do { private _index = count GVAR(killedUnits) - _i; - private _control = (uiNamespace getvariable [QGVAR(labels),[]]) select _i; + private _control = (uiNamespace getVariable [QGVAR(labels),[]]) select _i; if(_index < (count GVAR(killedUnits)) && _index >= 0 ) then { private _data = GVAR(killedUnits) select (count GVAR(killedUnits) - _i); _data params ["_unit","_time","_killer","_deadSide","_killerSide","_dName","_kName","_weapon"]; @@ -22,4 +22,4 @@ for "_i" from 1 to 6 do { _control ctrlSetStructuredText parseText " "; } }; -GVAR(killedUnits) = GVAR(killedUnits) - [0]; \ No newline at end of file +GVAR(killedUnits) = GVAR(killedUnits) - [0]; diff --git a/addons/spectator/initSettings.sqf b/addons/spectator/initSettings.sqf index 9ae527e8..068a245f 100644 --- a/addons/spectator/initSettings.sqf +++ b/addons/spectator/initSettings.sqf @@ -2,24 +2,24 @@ [ QGVAR(isJIPAllowed), "LIST", - ["JIP allowed", "If disallowed JIP players are placed in spectator. Only affects TMF spectator."], + ["Join in progress", "Whether players who join after the mission started may play. Players who may not are put into spectator."], ["TMF", "Spectator"], - [[0,1,2],["Disallow", "Allow", "During Safestart"],2], + [[0,1,2],["Spectator only", "Allowed", "Only during safe start"],2], 1 ] call CBA_fnc_addSetting; [ QGVAR(showGroupMarkers), "LIST", - ["Show 3D group markers", ""], + ["Group markers shown", "Which groups get a marker in spectator, in 3D and on the map."], ["TMF", "Spectator"], - [[0,1],["Groups with players only", "All"], 0], + [[0,1],["Player groups only", "All groups, including AI"], 0], 1 ] call CBA_fnc_addSetting; [ QGVAR(followCameraEnabled), "CHECKBOX", - ["Follow camera mode enabled", "Allow the usage of the Orbiting camera mode"], + ["Allow follow camera", "Spectators can use the camera that orbits around a unit."], ["TMF", "Spectator"], true, 1 @@ -27,7 +27,7 @@ [ QGVAR(freeCameraEnabled), "CHECKBOX", - ["Free camera mode enabled", "Allow the usage of the free camera mode"], + ["Allow free camera", "Spectators can fly the camera freely around the map."], ["TMF", "Spectator"], true, 1 @@ -35,7 +35,7 @@ [ QGVAR(firstPersonCameraEnabled), "CHECKBOX", - ["Firstperson camera mode enabled", "Allow the usage of the firstperson camera mode"], + ["Allow first-person camera", "Spectators can view through a unit's eyes."], ["TMF", "Spectator"], true, 1 @@ -43,8 +43,8 @@ [ QGVAR(canSpectateAllSides), "CHECKBOX", - ["Spectate all sides", "Disable to only allow the player to spectate their own side"], + ["Spectate all sides", "When off, spectators can only watch units on their own side."], ["TMF", "Spectator"], true, 1 -] call CBA_fnc_addSetting; \ No newline at end of file +] call CBA_fnc_addSetting; diff --git a/addons/spectator/script_component.hpp b/addons/spectator/script_component.hpp index 06291a96..410e9ee5 100644 --- a/addons/spectator/script_component.hpp +++ b/addons/spectator/script_component.hpp @@ -1,3 +1,6 @@ +#ifndef TMF_SPECTATOR_SCRIPT_COMPONENT_HPP +#define TMF_SPECTATOR_SCRIPT_COMPONENT_HPP + #define COMPONENT spectator #define FOLLOWCAM 0 #define FREECAM 1 @@ -33,3 +36,5 @@ #include "\x\tmf\addons\main\script_mod.hpp" #include "\x\tmf\addons\main\script_macros.hpp" + +#endif // TMF_SPECTATOR_SCRIPT_COMPONENT_HPP diff --git a/addons/spectator/tags.hpp b/addons/spectator/tags.hpp index 3134577c..8d19b225 100644 --- a/addons/spectator/tags.hpp +++ b/addons/spectator/tags.hpp @@ -1,34 +1,26 @@ class GVAR(EntityTag): ctrlControlsGroupNoScrollbars { idc = -1; - x = 0 * safezoneW + safezoneX; - y = 0 * safezoneH + safezoneY; - w = 0.08 * safezoneW; - h = 0.06 * safezoneH; + x = "safeZoneX + (0) * (safeZoneW min (safeZoneH * 4 / 3))"; + y = QUOTE(0 * safeZoneH + safeZoneY); + w = "(0.08) * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.06 * safeZoneH); onMouseZChanged = "[""MouseZChanged"",_this] call tmf_spectator_fnc_mouseHandler"; onMouseButtonDown = "[""MouseButtonDown"",_this] call tmf_spectator_fnc_mouseHandler"; onMouseButtonUp = "[""MouseButtonUp"",_this] call tmf_spectator_fnc_mouseHandler"; onMouseMoving = "['MouseMoving',_this] call tmf_spectator_fnc_mouseHandler"; class controls { - class GVAR(back) : IGUIBACK { - idc = 4; - x = 0.3 * safezoneW; - y = 0; - w = 0.05 * safezoneW; - h = 0.06 * safezoneH; - colorBackground[] = {0,0,0,0.0}; - }; class GVAR(Icon): RscPicture { idc = 1; text = "\A3\ui_f\data\map\markers\military\triangle_CA.paa"; x = 0; y = 0; - w = 0.08 * safezoneW; - h = 0.02 * safezoneH; + w = "(0.08) * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.02 * safeZoneH); style = 48 + 2048 + 0x02; // picture + no stretch + center (not sure if works) + 0x800 - sizeEx = 1 * safeZoneH; + sizeEx = QUOTE(1 * safeZoneH); }; class GVAR(Name): RscText { @@ -38,10 +30,10 @@ class GVAR(EntityTag): ctrlControlsGroupNoScrollbars colorBackground[] = { 1, 1, 1, 0 }; colorText[] = { 1, 1, 1, 1 }; x = 0; - y = 0.02 * safezoneH; - w = 0.08 * safezoneW; - h = 0.02 * safezoneH; - sizeEx = 0.018 * safeZoneH; + y = QUOTE(0.02 * safeZoneH); + w = "(0.08) * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.02 * safeZoneH); + sizeEx = QUOTE(0.018 * safeZoneH); shadow = 2; }; class GVAR(Detail): GVAR(Name) @@ -49,34 +41,26 @@ class GVAR(EntityTag): ctrlControlsGroupNoScrollbars idc = 3; text = ""; //--- ToDo: Localize; x = 0; - y = 0.04 * safezoneH; - w = 0.08 * safezoneW; - h = 0.02 * safezoneH; - sizeEx = 0.013 * safeZoneH; + y = QUOTE(0.04 * safeZoneH); + w = "(0.08) * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.02 * safeZoneH); + sizeEx = QUOTE(0.013 * safeZoneH); }; }; }; class GVAR(GroupTag) : GVAR(EntityTag) { class controls { - class GVAR(back) : IGUIBACK { - idc = 4; - x = 0.3 * safezoneW; - y = 0; - w = 0.05 * safezoneW; - h = 0.06 * safezoneH; - colorBackground[] = {0,0,0,0.0}; - }; class GVAR(Icon): RscPicture { idc = 1; text = "\A3\ui_f\data\map\markers\military\triangle_CA.paa"; x = 0; y = 0; - w = 0.08 * safezoneW; - h = 0.035 * safezoneH; + w = "(0.08) * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.035 * safeZoneH); style = 48 + 2048 + 0x02; // picture + no stretch + center (not sure if works) + 0x800 - sizeEx = 1 * safeZoneH; + sizeEx = QUOTE(1 * safeZoneH); }; class GVAR(Name): RscText { @@ -86,10 +70,10 @@ class GVAR(GroupTag) : GVAR(EntityTag) { colorBackground[] = { 1, 1, 1, 0 }; colorText[] = { 1, 1, 1, 1 }; x = 0; - y = 0.04 * safezoneH; - w = 0.08 * safezoneW; - h = 0.02 * safezoneH; - sizeEx = 0.018 * safeZoneH; + y = QUOTE(0.04 * safeZoneH); + w = "(0.08) * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.02 * safeZoneH); + sizeEx = QUOTE(0.018 * safeZoneH); shadow = 2; }; class GVAR(Detail): GVAR(Name) @@ -97,10 +81,10 @@ class GVAR(GroupTag) : GVAR(EntityTag) { idc = 3; text = ""; //--- ToDo: Localize; x = 0; - y = 0.08 * safezoneH; - w = 0.08 * safezoneW; - h = 0.02 * safezoneH; - sizeEx = 0.013 * safeZoneH; + y = QUOTE(0.08 * safeZoneH); + w = "(0.08) * (safeZoneW min (safeZoneH * 4 / 3))"; + h = QUOTE(0.02 * safeZoneH); + sizeEx = QUOTE(0.013 * safeZoneH); }; }; -}; \ No newline at end of file +}; diff --git a/addons/teamcolour/Cfg3DEN.hpp b/addons/teamcolour/Cfg3DEN.hpp index 79006d9d..159eaef8 100644 --- a/addons/teamcolour/Cfg3DEN.hpp +++ b/addons/teamcolour/Cfg3DEN.hpp @@ -66,4 +66,4 @@ class Cfg3DEN }; }; }; -}; \ No newline at end of file +}; diff --git a/addons/teamcolour/CfgEventHandlers.hpp b/addons/teamcolour/CfgEventHandlers.hpp index 5aa55514..339c9ede 100644 --- a/addons/teamcolour/CfgEventHandlers.hpp +++ b/addons/teamcolour/CfgEventHandlers.hpp @@ -4,4 +4,4 @@ class Extended_InitPost_EventHandlers { init = "(_this select 0) assignTeam (['MAIN','RED','GREEN','BLUE','YELLOW'] select ((_this select 0) getVariable ['TMF_teamColour_colour',0]))"; }; }; -}; \ No newline at end of file +}; diff --git a/addons/teamcolour/config.cpp b/addons/teamcolour/config.cpp index ef74a65e..6de4fc78 100644 --- a/addons/teamcolour/config.cpp +++ b/addons/teamcolour/config.cpp @@ -1,6 +1,6 @@ #include "script_component.hpp" -class cfgPatches +class CfgPatches { class ADDON { @@ -16,4 +16,4 @@ class cfgPatches }; #include "CfgEventHandlers.hpp" -#include "Cfg3DEN.hpp" \ No newline at end of file +#include "Cfg3DEN.hpp" diff --git a/addons/teamcolour/script_component.hpp b/addons/teamcolour/script_component.hpp index 312c31e4..e1f31894 100644 --- a/addons/teamcolour/script_component.hpp +++ b/addons/teamcolour/script_component.hpp @@ -1,4 +1,9 @@ +#ifndef TMF_TEAMCOLOUR_SCRIPT_COMPONENT_HPP +#define TMF_TEAMCOLOUR_SCRIPT_COMPONENT_HPP + #define COMPONENT teamColour #include "\x\tmf\addons\main\script_mod.hpp" -#include "\x\tmf\addons\main\script_macros.hpp" \ No newline at end of file +#include "\x\tmf\addons\main\script_macros.hpp" + +#endif // TMF_TEAMCOLOUR_SCRIPT_COMPONENT_HPP diff --git a/addons/teleport/CfgModules.hpp b/addons/teleport/CfgModules.hpp index 41282663..aaa6b092 100644 --- a/addons/teleport/CfgModules.hpp +++ b/addons/teleport/CfgModules.hpp @@ -6,11 +6,9 @@ class CfgVehicles { class ArgumentsBaseUnits { - class Units; }; class ModuleDescription { - class AnyBrain; }; }; class GVAR(module) : Module_F diff --git a/addons/teleport/config.cpp b/addons/teleport/config.cpp index beaf255a..bbc06997 100644 --- a/addons/teleport/config.cpp +++ b/addons/teleport/config.cpp @@ -1,6 +1,6 @@ #include "script_component.hpp" -class cfgPatches +class CfgPatches { class ADDON { diff --git a/addons/teleport/functions/fnc_deployInit.sqf b/addons/teleport/functions/fnc_deployInit.sqf index 232b7be9..cd0583e2 100644 --- a/addons/teleport/functions/fnc_deployInit.sqf +++ b/addons/teleport/functions/fnc_deployInit.sqf @@ -3,10 +3,10 @@ params ["_logic","_units","_activated"]; if(_activated) then { _units = [_logic] call CFUNC(moduleUnits); - _pos = getpos _logic; + private _pos = getPos _logic; { - _uPos = _pos vectorAdd [random 100 - random 100,random 100 - random 100,random 15 - random 15]; + private _uPos = _pos vectorAdd [random 100 - random 100,random 100 - random 100,random 15 - random 15]; [_x,_uPos] remoteExecCall [QFUNC(paraDrop),_x]; - } foreach _units; + } forEach _units; }; -},_this] call CBA_fnc_waitUntilAndExecute; \ No newline at end of file +},_this] call CBA_fnc_waitUntilAndExecute; diff --git a/addons/teleport/functions/fnc_onAction.sqf b/addons/teleport/functions/fnc_onAction.sqf index e039a88a..1695d9a8 100644 --- a/addons/teleport/functions/fnc_onAction.sqf +++ b/addons/teleport/functions/fnc_onAction.sqf @@ -3,28 +3,28 @@ params ["_target","_caller","_id","_args"]; _args params ["_duration","_alt","_parachute","_leadersOnly"]; GVAR(mapPos) = nil; -["GVAR(mapEvent)", "onMapSingleClick", {GVAR(mapPos) = _pos;}] call BIS_fnc_addStackedEventHandler; +private _mapClickEH = addMissionEventHandler ["MapSingleClick", {GVAR(mapPos) = _this select 1;}]; openMap [true, true]; waitUntil {!isNil QGVAR(mapPos)}; openMap [false, false]; -["GVAR(mapEvent)", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler; -_units = units player; +removeMissionEventHandler ["MapSingleClick", _mapClickEH]; +private _units = units player; if(!_leadersOnly) then {_units = [player]}; -_mapPos = GVAR(mapPos); +private _mapPos = GVAR(mapPos); { - _unit = _x; - _uPos = _mapPos; + private _unit = _x; + private _uPos = _mapPos; if(_alt > 0) then { _uPos = _mapPos vectorAdd [random 100 - random 100,random 100 - random 100,_alt + random 15 - random 15]; } else { _uPos = _mapPos vectorAdd [random 20 - random 20,random 20 - random 20,0]; }; - _unit setpos _uPos; + _unit setPos _uPos; if(_parachute) then { [_unit] remoteExecCall [QFUNC(paraDrop), _unit]; }; diff --git a/addons/teleport/functions/fnc_paraDrop.sqf b/addons/teleport/functions/fnc_paraDrop.sqf index 5f264451..b528758c 100644 --- a/addons/teleport/functions/fnc_paraDrop.sqf +++ b/addons/teleport/functions/fnc_paraDrop.sqf @@ -1,10 +1,10 @@ #include "\x\tmf\addons\teleport\script_component.hpp" params["_unit","_pos"]; _unit setPos _pos; -[{ (getpos (_this select 0) select 2) < 200 },{ +[{ (getPos (_this select 0) select 2) < 200 },{ params ["_unit"]; -_chute = createVehicle ["Steerable_Parachute_F", position _unit, [], direction _unit, 'FLY']; +private _chute = createVehicle ["Steerable_Parachute_F", position _unit, [], direction _unit, 'FLY']; _chute setPos (getPos _unit); _unit assignAsDriver _chute; -_unit moveIndriver _chute; +_unit moveInDriver _chute; }, _this] call CBA_fnc_waitUntilAndExecute; diff --git a/addons/teleport/functions/fnc_paradropEffect.sqf b/addons/teleport/functions/fnc_paradropEffect.sqf index 447053fd..e83d6580 100644 --- a/addons/teleport/functions/fnc_paradropEffect.sqf +++ b/addons/teleport/functions/fnc_paradropEffect.sqf @@ -6,7 +6,7 @@ if (!local _unit) exitWith {}; if(_unit == player) then { [QGVAR(parachute),false] call BIS_fnc_blackOut; }; -_chute = createVehicle ["Steerable_Parachute_F", _pos , [],random 360, 'NONE']; +private _chute = createVehicle ["Steerable_Parachute_F", _pos , [],random 360, 'NONE']; _chute setPos _pos; _unit assignAsDriver _chute; _unit setPos [0,0,0]; diff --git a/addons/teleport/functions/fnc_paradropWaypoint.sqf b/addons/teleport/functions/fnc_paradropWaypoint.sqf index 081a03c5..e028b7d4 100644 --- a/addons/teleport/functions/fnc_paradropWaypoint.sqf +++ b/addons/teleport/functions/fnc_paradropWaypoint.sqf @@ -1,32 +1,32 @@ #include "\x\tmf\addons\teleport\script_component.hpp" params ["_group","_pos","_attached"]; -_units = units _group; -_flyingVehicles = _units select {vehicle _x isKindOf "Air" && effectiveCommander (vehicle _x) == _x}; +private _units = units _group; +private _flyingVehicles = _units select {vehicle _x isKindOf "Air" && effectiveCommander (vehicle _x) == _x}; _flyingVehicles = _flyingVehicles apply {vehicle _x}; _flyingVehicles = _flyingVehicles arrayIntersect _flyingVehicles; { _x spawn { - _vehicle = _this; - _cargo = fullCrew _vehicle select {(toLower (_x select 1) == "cargo") || (_x select 4)}; + private _vehicle = _this; + private _cargo = fullCrew _vehicle select {(toLower (_x select 1) == "cargo") || (_x select 4)}; _cargo = _cargo apply {_x select 0}; _cargo = _cargo arrayIntersect _cargo; - _groups = []; + private _groups = []; { _groups pushBackUnique group _x - } foreach _cargo; + } forEach _cargo; { - private _pos = getpos _vehicle; + private _pos = getPos _vehicle; _pos = _pos vectorAdd (vectorDirVisual _vehicle vectorMultiply -30); [_x,_pos] remoteExecCall [QFUNC(paradropEffect), _x]; sleep 1.5; - } foreach _cargo; + } forEach _cargo; { _x leaveVehicle _vehicle; - } foreach _groups + } forEach _groups }; -} foreach _flyingVehicles; +} forEach _flyingVehicles; true diff --git a/addons/teleport/functions/fnc_playerInit.sqf b/addons/teleport/functions/fnc_playerInit.sqf index 6898ec44..c0cf7d1c 100644 --- a/addons/teleport/functions/fnc_playerInit.sqf +++ b/addons/teleport/functions/fnc_playerInit.sqf @@ -1,17 +1,11 @@ #include "\x\tmf\addons\teleport\script_component.hpp" params ["_duration","_alt","_parachute","_leadersOnly"]; -_str = []; +private _str = []; if(_leadersOnly) then {_str pushBack "group"}; -if(_parachute) then {_str pushback "parachute"}; -_text = ""; +if(_parachute) then {_str pushBack "parachute"}; _str pushBack "teleport"; -{ - if(_forEachIndex != 0) then {_x = " " +_x} - else { - _x = [_x] call CFUNC(capitalize); - }; - _text = _text + _x; -} forEach _str; -_action = player addAction [_text, {_this call FUNC(onAction)}, _this, 6, true, true, "", "_target == _this"]; +_str set [0, [_str select 0] call CFUNC(capitalize)]; +private _text = _str joinString " "; +private _action = player addAction [_text, {_this call FUNC(onAction)}, _this, 6, true, true, "", "_target == _this"]; uiSleep _duration; player removeAction _action; diff --git a/addons/teleport/functions/fnc_serverInit.sqf b/addons/teleport/functions/fnc_serverInit.sqf index 8e655d37..766d2000 100644 --- a/addons/teleport/functions/fnc_serverInit.sqf +++ b/addons/teleport/functions/fnc_serverInit.sqf @@ -2,13 +2,13 @@ params ["_logic","_units","_activated"]; _units = [_logic] call CFUNC(moduleUnits); if(_activated) then { - _duration = _logic getVariable ["TimeLimit",120]; - _alt = _logic getVariable ["Altitude",0]; - _parachute = _logic getVariable ["Parachute",false]; - _leadersOnly = _logic getVariable ["LeadersOnly",true]; + private _duration = _logic getVariable ["TimeLimit",120]; + private _alt = _logic getVariable ["Altitude",0]; + private _parachute = _logic getVariable ["Parachute",false]; + private _leadersOnly = _logic getVariable ["LeadersOnly",true]; if(_leadersOnly) then {_units = _units select {leader _x == _x}}; _units = _units select {isPlayer _x}; - if(count _units > 0) then { + if(_units isNotEqualTo []) then { [_duration,_alt,_parachute,_leadersOnly] remoteExec [QFUNC(playerInit), _units]; }; }; diff --git a/addons/teleport/script_component.hpp b/addons/teleport/script_component.hpp index b8edb16d..1186893b 100644 --- a/addons/teleport/script_component.hpp +++ b/addons/teleport/script_component.hpp @@ -1,4 +1,9 @@ +#ifndef TMF_TELEPORT_SCRIPT_COMPONENT_HPP +#define TMF_TELEPORT_SCRIPT_COMPONENT_HPP + #define COMPONENT teleport #include "\x\tmf\addons\main\script_mod.hpp" #include "\x\tmf\addons\main\script_macros.hpp" + +#endif // TMF_TELEPORT_SCRIPT_COMPONENT_HPP diff --git a/addons/zeus/RscDisplayCurator.hpp b/addons/zeus/RscDisplayCurator.hpp index 3d0ab535..2146bbfc 100644 --- a/addons/zeus/RscDisplayCurator.hpp +++ b/addons/zeus/RscDisplayCurator.hpp @@ -9,38 +9,38 @@ class RscDisplayCurator { class GVAR(zeusControls) : RscControlsGroupNoScrollbars { idc=99575; - x="safezoneX + 12.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - w="safezoneW - 25 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y="(safezoneY + safeZoneH) - (1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))"; - h="1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x="safeZoneX + 12.5 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + w="safeZoneW - 25 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y="(safeZoneY + safeZoneH) - (1.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25))"; + h="1.5 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; class controls { class GVAR(frame): RscFrame { idc=99576; - w="safezoneW - 25 * (((safezoneW / safezoneH) min 1.2) / 40)"; - x="0 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y="0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - h="1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w="safeZoneW - 25 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + x="0 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y="0 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + h="1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; colorText[]={0,0,0,1}; }; class GVAR(background): RscText { idc=99577; - w="safezoneW - 25 * (((safezoneW / safezoneH) min 1.2) / 40)"; - x="0 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y="0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - h="1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w="safeZoneW - 25 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + x="0 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y="0 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + h="1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; colorBackground[]={0.1,0.1,0.1,0.5}; }; class GVAR(logo): RscPicture { idc=99578; - x="(safezoneW - 25 * (((safezoneW / safezoneH) min 1.2) / 40)) / 2 - 0.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x="(safeZoneW - 25 * (((safeZoneW / safeZoneH) min 1.2) / 40)) / 2 - 0.5 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; text="\x\tmf\addons\common\UI\logo_tmf_small_ca.paa"; - y="0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w="1 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h="1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y="0 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w="1 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h="1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; colorText[]={0,0,0,1}; }; class GVAR(label): RscText @@ -48,34 +48,34 @@ class RscDisplayCurator { idc=99577; style=0x02; // Center x = "0"; - w="4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y="0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - h="1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w="4 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y="0 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + h="1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; text = "Add Objects:"; - SizeEx = "((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8"; + SizeEx = "((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.8"; colorBackground[]={0,0,0,0}; }; class GVAR(toggleUnitsZeus): RscButton { idc = IDC_ToggleUnitsZeus; - x ="4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y="0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w="5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h="1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - SizeEx = "((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8"; + x ="4 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + y="0 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + w="5 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; + h="1 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25) * 0.8"; text = "All Units"; action = QUOTE(_this call FUNC(toggleAllUnitsZeus)); tooltip = "Toggle making AI units 'editable'"; }; class GVAR(toggleStaticsZeus): GVAR(toggleUnitsZeus) { idc = IDC_ToggleStaticsZeus; - x ="9 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x ="9 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; text = "Static Objects"; action = QUOTE(_this call FUNC(toggleAllStaticsZeus)); tooltip = "Toggle making Static objects 'editable'"; }; class GVAR(toggleACRESpectator): GVAR(toggleStaticsZeus) { idc = IDC_ToggleACRESpectator; - x ="14 * (((safezoneW / safezoneH) min 1.2) / 40)"; + x ="14 * (((safeZoneW / safeZoneH) min 1.2) / 40)"; text = "ACRE Spectator"; action = QUOTE(_this call FUNC(toggleACRESpectator)); tooltip = "Toggle ACRE Spectator, allowing you to hear specators and in-game players via the Zeus interface."; diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index 4aa7fdd8..66a0324b 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -1,6 +1,6 @@ #include "script_component.hpp" -class cfgPatches +class CfgPatches { class ADDON { diff --git a/addons/zeus/functions/fnc_toggleACRESpectator.sqf b/addons/zeus/functions/fnc_toggleACRESpectator.sqf index 4cef91f6..2ece1e8d 100644 --- a/addons/zeus/functions/fnc_toggleACRESpectator.sqf +++ b/addons/zeus/functions/fnc_toggleACRESpectator.sqf @@ -1 +1 @@ -[!ACRE_IS_SPECTATOR] call acre_api_fnc_setSpectator; \ No newline at end of file +[!ACRE_IS_SPECTATOR] call acre_api_fnc_setSpectator; diff --git a/addons/zeus/script_component.hpp b/addons/zeus/script_component.hpp index 629bd4a8..f6857ed0 100644 --- a/addons/zeus/script_component.hpp +++ b/addons/zeus/script_component.hpp @@ -1,3 +1,6 @@ +#ifndef TMF_ZEUS_SCRIPT_COMPONENT_HPP +#define TMF_ZEUS_SCRIPT_COMPONENT_HPP + #define COMPONENT zeus #include "\x\tmf\addons\main\script_mod.hpp" @@ -6,3 +9,5 @@ #define IDC_ToggleUnitsZeus 93950 #define IDC_ToggleStaticsZeus 93951 #define IDC_ToggleACRESpectator 93952 + +#endif // TMF_ZEUS_SCRIPT_COMPONENT_HPP diff --git a/extensions/tmf_systemtime/tmf_systemtime.cpp b/extensions/tmf_systemtime/tmf_systemtime.cpp index 6d76b382..faa5ed5d 100644 --- a/extensions/tmf_systemtime/tmf_systemtime.cpp +++ b/extensions/tmf_systemtime/tmf_systemtime.cpp @@ -100,4 +100,4 @@ int __stdcall RVExtensionArgs(char *output, int outputSize, const char *function strncpy_s(output, outputSize, msg.c_str(), _TRUNCATE); return 201; } -} \ No newline at end of file +} diff --git a/extras/a3/3DEN/UI/Displays/Display3DENEditAttributes.sqf b/extras/a3/3DEN/UI/Displays/Display3DENEditAttributes.sqf index 6d65d349..e721c9b1 100644 --- a/extras/a3/3DEN/UI/Displays/Display3DENEditAttributes.sqf +++ b/extras/a3/3DEN/UI/Displays/Display3DENEditAttributes.sqf @@ -17,4 +17,4 @@ switch _mode do { //--- Engine restarts the scene after closing the intel window, restore the vision mode -2 spawn bis_fnc_3DENVisionMode }; -}; \ No newline at end of file +}; diff --git a/extras/a3/3DEN/UI/Displays/display3DEN.sqf b/extras/a3/3DEN/UI/Displays/display3DEN.sqf index 567a2ae8..a159fc53 100644 --- a/extras/a3/3DEN/UI/Displays/display3DEN.sqf +++ b/extras/a3/3DEN/UI/Displays/display3DEN.sqf @@ -29,4 +29,4 @@ switch _mode do { } foreach _inits; }; }; -}; \ No newline at end of file +}; diff --git a/extras/a3/3DEN/UI/Displays/display3DENCopy.sqf b/extras/a3/3DEN/UI/Displays/display3DENCopy.sqf index cd52ef3a..67433197 100644 --- a/extras/a3/3DEN/UI/Displays/display3DENCopy.sqf +++ b/extras/a3/3DEN/UI/Displays/display3DENCopy.sqf @@ -26,4 +26,4 @@ switch _mode do { _ctrlEdit ctrlsetposition _ctrlEditPos; _ctrlEdit ctrlcommit 0; }; -}; \ No newline at end of file +}; diff --git a/extras/a3/3DEN/UI/Displays/display3DENEditComposition.sqf b/extras/a3/3DEN/UI/Displays/display3DENEditComposition.sqf index 932ec4a7..fab3b640 100644 --- a/extras/a3/3DEN/UI/Displays/display3DENEditComposition.sqf +++ b/extras/a3/3DEN/UI/Displays/display3DENEditComposition.sqf @@ -8,4 +8,4 @@ switch _mode do { _display = _params select 0; _display call bis_fnc_3dentutorial; }; -}; \ No newline at end of file +}; diff --git a/extras/a3/3DEN/UI/Displays/display3DENMissionStats.sqf b/extras/a3/3DEN/UI/Displays/display3DENMissionStats.sqf index 57898130..dd15bceb 100644 --- a/extras/a3/3DEN/UI/Displays/display3DENMissionStats.sqf +++ b/extras/a3/3DEN/UI/Displays/display3DENMissionStats.sqf @@ -97,4 +97,4 @@ if (_mode == "select") exitwith { all3denentities params ["_objects","_groups","_triggers","_logics","_waypoints","_markers","_layers","_comments"]; set3denselected call compile (_ctrlStats lbdata lbcursel _ctrlStats); _display closedisplay 2; -}; \ No newline at end of file +}; diff --git a/extras/a3/3DEN/UI/Displays/display3DENNew.sqf b/extras/a3/3DEN/UI/Displays/display3DENNew.sqf index 67710a57..a25c16b8 100644 --- a/extras/a3/3DEN/UI/Displays/display3DENNew.sqf +++ b/extras/a3/3DEN/UI/Displays/display3DENNew.sqf @@ -68,4 +68,4 @@ switch _mode do { _ctrlWorldLat ctrlcommit _commitTime; }; default {}; -}; \ No newline at end of file +}; diff --git a/extras/a3/3DEN/UI/Displays/display3DENPlace.sqf b/extras/a3/3DEN/UI/Displays/display3DENPlace.sqf index af71e3d0..b4c1f425 100644 --- a/extras/a3/3DEN/UI/Displays/display3DENPlace.sqf +++ b/extras/a3/3DEN/UI/Displays/display3DENPlace.sqf @@ -36,4 +36,4 @@ switch _mode do { }; }; -}; \ No newline at end of file +}; diff --git a/extras/a3/3DEN/UI/Displays/display3DENRequiredAddons.sqf b/extras/a3/3DEN/UI/Displays/display3DENRequiredAddons.sqf index 66089f7f..eaaea046 100644 --- a/extras/a3/3DEN/UI/Displays/display3DENRequiredAddons.sqf +++ b/extras/a3/3DEN/UI/Displays/display3DENRequiredAddons.sqf @@ -15,4 +15,4 @@ switch _mode do { [_ctrlFilter,_ctrlList,[0,0,1]] spawn bis_fnc_initListNBoxSorting; ctrlsetfocus _ctrlList; }; -}; \ No newline at end of file +}; diff --git a/extras/a3/3DEN/UI/Displays/display3DENSave.sqf b/extras/a3/3DEN/UI/Displays/display3DENSave.sqf index ce10f9a6..dc40f89f 100644 --- a/extras/a3/3DEN/UI/Displays/display3DENSave.sqf +++ b/extras/a3/3DEN/UI/Displays/display3DENSave.sqf @@ -38,4 +38,4 @@ switch _mode do { uinamespace setvariable ["display3DENSave_selected",_selected]; uinamespace setvariable ["display3DENSave_display",nil]; }; -}; \ No newline at end of file +}; diff --git a/extras/a3/3DEN/UI/Displays/display3DENTutorial.sqf b/extras/a3/3DEN/UI/Displays/display3DENTutorial.sqf index 2c3f2c51..f0342668 100644 --- a/extras/a3/3DEN/UI/Displays/display3DENTutorial.sqf +++ b/extras/a3/3DEN/UI/Displays/display3DENTutorial.sqf @@ -118,4 +118,4 @@ switch _mode do { }; uinamespace setvariable ["display3DENTutorial_select",_pathClass]; }; -}; \ No newline at end of file +}; diff --git a/extras/a3/3DEN/UI/Displays/display3DENUpdates.sqf b/extras/a3/3DEN/UI/Displays/display3DENUpdates.sqf index 2df01dd9..80f07aa5 100644 --- a/extras/a3/3DEN/UI/Displays/display3DENUpdates.sqf +++ b/extras/a3/3DEN/UI/Displays/display3DENUpdates.sqf @@ -116,4 +116,4 @@ switch _mode do { profilenamespace setvariable ['3DEN_Updates',count _cfgUpdates]; saveprofilenamespace; }; -}; \ No newline at end of file +}; diff --git a/extras/a3/3DEN/UI/DisplaysTemp/RscDisplayInterrupt.sqf b/extras/a3/3DEN/UI/DisplaysTemp/RscDisplayInterrupt.sqf index cced5f05..1d0bdb26 100644 --- a/extras/a3/3DEN/UI/DisplaysTemp/RscDisplayInterrupt.sqf +++ b/extras/a3/3DEN/UI/DisplaysTemp/RscDisplayInterrupt.sqf @@ -461,4 +461,4 @@ switch _mode do { }; default {}; -}; \ No newline at end of file +}; diff --git a/extras/a3/3DEN/UI/DisplaysTemp/RscDisplayLoading.sqf b/extras/a3/3DEN/UI/DisplaysTemp/RscDisplayLoading.sqf index ca718664..2366d892 100644 --- a/extras/a3/3DEN/UI/DisplaysTemp/RscDisplayLoading.sqf +++ b/extras/a3/3DEN/UI/DisplaysTemp/RscDisplayLoading.sqf @@ -342,4 +342,4 @@ switch _mode do { }; */ }; -}; \ No newline at end of file +}; diff --git a/extras/cba/addons/main/script_macros_common.hpp b/extras/cba/addons/main/script_macros_common.hpp index 564716a6..b6c0fa5c 100644 --- a/extras/cba/addons/main/script_macros_common.hpp +++ b/extras/cba/addons/main/script_macros_common.hpp @@ -1133,4 +1133,4 @@ Macro: OBSOLETE() #define XEH_POST_INIT QUOTE(call COMPILE_FILE(XEH_PostInit_Once)) #define XEH_POST_CINIT QUOTE(call COMPILE_FILE(XEH_PostClientInit_Once)) -#define XEH_POST_SINIT QUOTE(call COMPILE_FILE(XEH_PostServerInit_Once)) \ No newline at end of file +#define XEH_POST_SINIT QUOTE(call COMPILE_FILE(XEH_PostServerInit_Once)) diff --git a/include/a3/ui_f/hpp/defineCommon.inc b/include/a3/ui_f/hpp/defineCommon.inc index deb01f73..ffe09896 100644 --- a/include/a3/ui_f/hpp/defineCommon.inc +++ b/include/a3/ui_f/hpp/defineCommon.inc @@ -55,7 +55,7 @@ //Font used by the engine as default when defined font (e.g. in description.ext) is not found class DefaultFont { - font = GUI_FONT_NORMAL; + font = "RobotoCondensed"; // quoted for rapify (GUI_FONT_NORMAL) }; diff --git a/include/a3/ui_f_curator/UI/Displays/RscDisplayAttributes.sqf b/include/a3/ui_f_curator/UI/Displays/RscDisplayAttributes.sqf index b3028465..14e59881 100644 --- a/include/a3/ui_f_curator/UI/Displays/RscDisplayAttributes.sqf +++ b/include/a3/ui_f_curator/UI/Displays/RscDisplayAttributes.sqf @@ -137,4 +137,4 @@ switch _mode do { case "onUnload": { }; -}; \ No newline at end of file +}; diff --git a/include/x/cba/addons/main/script_macros_common.hpp b/include/x/cba/addons/main/script_macros_common.hpp index d8f83f23..2683f3b0 100644 --- a/include/x/cba/addons/main/script_macros_common.hpp +++ b/include/x/cba/addons/main/script_macros_common.hpp @@ -1832,4 +1832,4 @@ Macro: FILE_EXISTS Author: commy2 ------------------------------------------- */ -#define FILE_EXISTS(FILE) (fileExists (FILE)) \ No newline at end of file +#define FILE_EXISTS(FILE) (fileExists (FILE)) diff --git a/mod.cpp b/mod.cpp index 7c6bacc9..2824e61f 100644 --- a/mod.cpp +++ b/mod.cpp @@ -10,4 +10,4 @@ tooltipOwned = "Teamwork Owned"; overview = "Teamwork is a mission making framework. It focuses on harnessing the full power of the 3D editor. Our goal is to make mission making is more accessible and easier."; author = "TMF Team"; overviewPicture = "\x\tmf\addons\common\UI\logo_tmf_ca.paa"; -overviewText = "Teamwork"; \ No newline at end of file +overviewText = "Teamwork"; diff --git a/tmf_template.vr/briefing/admin.sqf b/tmf_template.vr/briefing/admin.sqf index f5504185..058b7e9f 100644 --- a/tmf_template.vr/briefing/admin.sqf +++ b/tmf_template.vr/briefing/admin.sqf @@ -11,4 +11,4 @@ tmf_briefing_admin = "ADMIN BRIEFING

"; // Insert custom text tmf_briefing_admin = tmf_briefing_admin + "your text here"; -player createDiaryRecord ["diary", ["Admin", tmf_briefing_admin]]; \ No newline at end of file +player createDiaryRecord ["diary", ["Admin", tmf_briefing_admin]]; diff --git a/tmf_template.vr/briefing/briefing_aaf.sqf b/tmf_template.vr/briefing/briefing_aaf.sqf index 63e81a87..dc4f1902 100644 --- a/tmf_template.vr/briefing/briefing_aaf.sqf +++ b/tmf_template.vr/briefing/briefing_aaf.sqf @@ -80,4 +80,4 @@ private _administration = ["diary", ["Administration"," player createDiaryRecord _administration; player createDiaryRecord _execution; player createDiaryRecord _mission; -player createDiaryRecord _situation; \ No newline at end of file +player createDiaryRecord _situation; diff --git a/tmf_template.vr/briefing/briefing_csat.sqf b/tmf_template.vr/briefing/briefing_csat.sqf index 63e81a87..dc4f1902 100644 --- a/tmf_template.vr/briefing/briefing_csat.sqf +++ b/tmf_template.vr/briefing/briefing_csat.sqf @@ -80,4 +80,4 @@ private _administration = ["diary", ["Administration"," player createDiaryRecord _administration; player createDiaryRecord _execution; player createDiaryRecord _mission; -player createDiaryRecord _situation; \ No newline at end of file +player createDiaryRecord _situation; diff --git a/tmf_template.vr/briefing/briefing_example.sqf b/tmf_template.vr/briefing/briefing_example.sqf index 63e81a87..dc4f1902 100644 --- a/tmf_template.vr/briefing/briefing_example.sqf +++ b/tmf_template.vr/briefing/briefing_example.sqf @@ -80,4 +80,4 @@ private _administration = ["diary", ["Administration"," player createDiaryRecord _administration; player createDiaryRecord _execution; player createDiaryRecord _mission; -player createDiaryRecord _situation; \ No newline at end of file +player createDiaryRecord _situation; diff --git a/tmf_template.vr/briefing/briefing_fia.sqf b/tmf_template.vr/briefing/briefing_fia.sqf index 63e81a87..dc4f1902 100644 --- a/tmf_template.vr/briefing/briefing_fia.sqf +++ b/tmf_template.vr/briefing/briefing_fia.sqf @@ -80,4 +80,4 @@ private _administration = ["diary", ["Administration"," player createDiaryRecord _administration; player createDiaryRecord _execution; player createDiaryRecord _mission; -player createDiaryRecord _situation; \ No newline at end of file +player createDiaryRecord _situation; diff --git a/tmf_template.vr/briefing/briefing_nato.sqf b/tmf_template.vr/briefing/briefing_nato.sqf index 63e81a87..dc4f1902 100644 --- a/tmf_template.vr/briefing/briefing_nato.sqf +++ b/tmf_template.vr/briefing/briefing_nato.sqf @@ -80,4 +80,4 @@ private _administration = ["diary", ["Administration"," player createDiaryRecord _administration; player createDiaryRecord _execution; player createDiaryRecord _mission; -player createDiaryRecord _situation; \ No newline at end of file +player createDiaryRecord _situation; diff --git a/tmf_template.vr/description.ext b/tmf_template.vr/description.ext index aa92ca2c..eca4a454 100644 --- a/tmf_template.vr/description.ext +++ b/tmf_template.vr/description.ext @@ -51,9 +51,7 @@ class CfgLoadouts class CfgDebriefingSections { #include "\x\tmf\addons\adminmenu\debriefAdminLog.inc" - class acex_killTracker - { - title = "ACEX Killed Events"; - variable = "acex_killTracker_outputText"; - }; + #if __has_include("\z\ace\addons\killtracker\killtracker.inc") + #include "\z\ace\addons\killtracker\killtracker.inc" + #endif }; diff --git a/tmf_template.vr/loadouts/example_loadout.hpp b/tmf_template.vr/loadouts/example_loadout.hpp index 23c43209..58ff69a2 100644 --- a/tmf_template.vr/loadouts/example_loadout.hpp +++ b/tmf_template.vr/loadouts/example_loadout.hpp @@ -486,4 +486,4 @@ class UAV : car displayName = "UAV Operator"; backpack[] = {"B_UAV_01_backpack_F"}; linkedItems[] += {"B_UavTerminal"}; -}; \ No newline at end of file +}; diff --git a/tools/launch.ps1 b/tools/launch.ps1 new file mode 100644 index 00000000..12d3f90c --- /dev/null +++ b/tools/launch.ps1 @@ -0,0 +1,56 @@ +<# +.SYNOPSIS + Builds TMF with HEMTT and launches Arma 3 with TMF, CBA_A3 and ACRE2. + +.EXAMPLE + .\tools\launch.ps1 + .\tools\launch.ps1 -NoBuild + .\tools\launch.ps1 -ArmaDir "D:\Steam\steamapps\common\Arma 3" -ExtraArgs "-world=Stratis" +#> +param( + # Arma 3 install folder (the one containing arma3_x64.exe and !Workshop) + [string]$ArmaDir = "F:\Games\steamapps\common\Arma 3", + # Skip `hemtt build` and launch with the last build in .hemttout\build + [switch]$NoBuild, + # Extra Arma 3 startup parameters + [string]$ExtraArgs = "" +) + +$ErrorActionPreference = "Stop" +$repo = Split-Path -Parent $PSScriptRoot +$workshop = Join-Path $ArmaDir "!Workshop" +$exe = Join-Path $ArmaDir "arma3_x64.exe" + +if (-not (Test-Path $exe)) { throw "Arma 3 not found: $exe" } + +if (-not $NoBuild) { + Push-Location $repo + try { + hemtt build + if ($LASTEXITCODE -ne 0) { throw "hemtt build failed (exit $LASTEXITCODE)" } + } finally { + Pop-Location + } +} + +$mods = @( + (Join-Path $workshop "@CBA_A3"), + (Join-Path $workshop "@ACRE2"), + (Join-Path $repo ".hemttout\build") +) +foreach ($mod in $mods) { + if (-not (Test-Path (Join-Path $mod "addons"))) { throw "Mod folder missing or not built: $mod" } +} + +$arguments = @( + "-mod=`"$($mods -join ';')`"", + "-skipIntro", + "-noSplash", + "-showScriptErrors", + "-debug" +) +if ($ExtraArgs) { $arguments += $ExtraArgs } + +Write-Host "Launching Arma 3 with:" +$mods | ForEach-Object { Write-Host " $_" } +Start-Process -FilePath $exe -ArgumentList $arguments -WorkingDirectory $ArmaDir