From d2638cf8b50c5d6fc6a0f050bb65577ffee6741d Mon Sep 17 00:00:00 2001 From: Remco Speekenbrink <98remco@gmail.com> Date: Fri, 11 Nov 2016 15:16:15 +0100 Subject: [PATCH 01/21] Added Zeus Module: Simulation ModuleSimulation toggles simulation for objects --- addons/zeus/CfgVehicles.hpp | 5 +++ addons/zeus/XEH_PREP.hpp | 1 + addons/zeus/config.cpp | 1 + .../zeus/functions/fnc_moduleSimulation.sqf | 32 +++++++++++++++++++ addons/zeus/stringtable.xml | 3 ++ 5 files changed, 42 insertions(+) create mode 100644 addons/zeus/functions/fnc_moduleSimulation.sqf diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index 4ab9ad871c3..21e4ec7a390 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -156,6 +156,11 @@ class CfgVehicles { displayName = CSTRING(ModuleSetMedicalVehicle_DisplayName); function = QFUNC(moduleSetMedicalVehicle); icon = QPATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa); + }; + class GVAR(moduleSimulation): GVAR(moduleBase) { + curatorCanAttach = 1; + displayName = CSTRING(ModuleSimulation_DisplayName); + function = QFUNC(moduleSimulation); }; class GVAR(moduleSurrender): GVAR(moduleBase) { curatorCanAttach = 1; diff --git a/addons/zeus/XEH_PREP.hpp b/addons/zeus/XEH_PREP.hpp index eb70a8529d3..0327a9eda94 100644 --- a/addons/zeus/XEH_PREP.hpp +++ b/addons/zeus/XEH_PREP.hpp @@ -14,6 +14,7 @@ PREP(moduleSearchNearby); PREP(moduleSetMedic); PREP(moduleSetMedicalVehicle); PREP(moduleSetMedicalFacility); +PREP(moduleSimulation); PREP(moduleSurrender); PREP(moduleTeleportPlayers); PREP(moduleUnconscious); diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index ac7ac9832a1..9fdf76355c3 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -10,6 +10,7 @@ class CfgPatches { QGVAR(modulePatrolArea), QGVAR(moduleSearchArea), QGVAR(moduleSearchNearby), + QGVAR(moduleSimulation), QGVAR(moduleTeleportPlayers) }; weapons[] = {}; diff --git a/addons/zeus/functions/fnc_moduleSimulation.sqf b/addons/zeus/functions/fnc_moduleSimulation.sqf new file mode 100644 index 00000000000..c31ec529537 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleSimulation.sqf @@ -0,0 +1,32 @@ +/* + * Author: Fisher + * Toggle Simulation on object + * + * Arguments: + * 0: The module logic + * + * Return Value: + * None + * + * + * Public: No + */ + + #include "script_component.hpp" + + params ["_logic"]; + private ["_object","_mouseOver"]; + + if !(local _logic) exitWith {}; + + _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); +if ((_mouseOver select 0) != "OBJECT") then { + [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); +} else { + _object = effectivecommander (_mouseOver select 1); + if !(alive _object) then { + [LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured); + } else { + _object enableSimulationGlobal (!(simulationEnabled _object)); + }; +}; \ No newline at end of file diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index 317f423b4e5..7efb348f030 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -694,6 +694,9 @@ 無効な半径が入力されました Wpisano nieprawidłowy promień Ungültiger Radius eingegeben + + + Toggle Simulation \ No newline at end of file From 933210126b39c00412e86fbdb0000a12da73ea1c Mon Sep 17 00:00:00 2001 From: Remco Speekenbrink <98remco@gmail.com> Date: Sat, 12 Nov 2016 01:46:23 +0100 Subject: [PATCH 02/21] Added AddObjects and Remove Objects & ACE Util Category --- addons/zeus/CfgVehicles.hpp | 13 +++- addons/zeus/XEH_PREP.hpp | 2 + addons/zeus/config.cpp | 10 +++ .../zeus/functions/fnc_moduleSimulation.sqf | 20 +++--- addons/zeus/functions/fnc_ui_AddObjects.sqf | 64 +++++++++++++++++++ .../zeus/functions/fnc_ui_RemoveObjects.sqf | 64 +++++++++++++++++++ addons/zeus/stringtable.xml | 6 ++ addons/zeus/ui/RscAttributes.hpp | 36 +++++++++++ 8 files changed, 203 insertions(+), 12 deletions(-) create mode 100644 addons/zeus/functions/fnc_ui_AddObjects.sqf create mode 100644 addons/zeus/functions/fnc_ui_RemoveObjects.sqf diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index 21e4ec7a390..38b97b729de 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -97,6 +97,12 @@ class CfgVehicles { displayName = CSTRING(ModuleAddSpareTrack_DisplayName); function = QFUNC(moduleAddSpareTrack); icon = QPATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa);//@todo + }; + class GVAR(moduleAddObjects): GVAR(moduleBase) { + curatorCanAttach = 1; + category = "ACE_Util"; + displayName = CSTRING(AddObjectsToCurator); + curatorInfoType = QGVAR(RscAddObjects); }; class GVAR(moduleAddSpareWheel): GVAR(moduleBase) { curatorCanAttach = 1; @@ -128,6 +134,11 @@ class CfgVehicles { curatorCanAttach = 1; displayName = CSTRING(ModulePatrolArea_DisplayName); curatorInfoType = QGVAR(RscPatrolArea); + }; + class GVAR(moduleRemoveObjects): GVAR(moduleAddObjects) { + curatorCanAttach = 1; + displayName = CSTRING(RemoveObjectsToCurator); + curatorInfoType = QGVAR(RscRemoveObjects); }; class GVAR(moduleSearchArea): GVAR(moduleBase) { curatorCanAttach = 1; @@ -157,7 +168,7 @@ class CfgVehicles { function = QFUNC(moduleSetMedicalVehicle); icon = QPATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa); }; - class GVAR(moduleSimulation): GVAR(moduleBase) { + class GVAR(moduleSimulation): GVAR(moduleAddObjects) { curatorCanAttach = 1; displayName = CSTRING(ModuleSimulation_DisplayName); function = QFUNC(moduleSimulation); diff --git a/addons/zeus/XEH_PREP.hpp b/addons/zeus/XEH_PREP.hpp index 0327a9eda94..26e2b23238a 100644 --- a/addons/zeus/XEH_PREP.hpp +++ b/addons/zeus/XEH_PREP.hpp @@ -21,11 +21,13 @@ PREP(moduleUnconscious); PREP(moduleZeusSettings); PREP(ui_attributeCargo); //PREP(ui_attributePosition); +PREP(ui_AddObjects); PREP(ui_attributeRadius); PREP(ui_defendArea); PREP(ui_globalSetSkill); PREP(ui_groupSide); PREP(ui_patrolArea); +PREP(ui_RemoveObjects); PREP(ui_searchArea); PREP(ui_teleportPlayers); PREP(zeusAttributes); diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index 9fdf76355c3..e9ff494a19b 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -4,10 +4,12 @@ class CfgPatches { class ADDON { name = COMPONENT_NAME; units[] = { + QGVAR(moduleAddObjects), QGVAR(moduleDefendArea), QGVAR(moduleGlobalSetSkill), QGVAR(moduleGroupSide), QGVAR(modulePatrolArea), + QGVAR(moduleRemoveObjects), QGVAR(moduleSearchArea), QGVAR(moduleSearchNearby), QGVAR(moduleSimulation), @@ -50,6 +52,14 @@ class ACE_Curator { GVAR(cargoAndRepair)[] = {"ace_cargo", "ace_repair"}; }; +class CfgFactionClasses { + class ACE_Util { + displayName = "ACE Util"; + priority = 2; + side = 7; + }; +}; + #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "ACE_Settings.hpp" diff --git a/addons/zeus/functions/fnc_moduleSimulation.sqf b/addons/zeus/functions/fnc_moduleSimulation.sqf index c31ec529537..238fa7c5d6a 100644 --- a/addons/zeus/functions/fnc_moduleSimulation.sqf +++ b/addons/zeus/functions/fnc_moduleSimulation.sqf @@ -15,18 +15,16 @@ #include "script_component.hpp" params ["_logic"]; - private ["_object","_mouseOver"]; + private ["_object","_simulationEnabled"]; if !(local _logic) exitWith {}; - _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); -if ((_mouseOver select 0) != "OBJECT") then { - [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); + _object = attachedTo _logic; +if (isNull _object) then { + [LSTRING(NoObjectSelected)] call EFUNC(common,displayTextStructured); } else { - _object = effectivecommander (_mouseOver select 1); - if !(alive _object) then { - [LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured); - } else { - _object enableSimulationGlobal (!(simulationEnabled _object)); - }; -}; \ No newline at end of file + _simulationEnabled = simulationEnabled _object; + _object enableSimulationGlobal (!_simulationEnabled); +}; + +deleteVehicle _logic; \ No newline at end of file diff --git a/addons/zeus/functions/fnc_ui_AddObjects.sqf b/addons/zeus/functions/fnc_ui_AddObjects.sqf new file mode 100644 index 00000000000..3de1ed67dbf --- /dev/null +++ b/addons/zeus/functions/fnc_ui_AddObjects.sqf @@ -0,0 +1,64 @@ +/* + * Author: Fisher + * Adds all objects in given radius to all curators + * + * Arguments: + * 0: dummy controls group + * + * Return Value: + * none + * + * Public: No + */ + +#include "script_component.hpp" + +disableSerialization; + +params ["_control"]; +private _display = ctrlParent _control; +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + +_control ctrlRemoveAllEventHandlers "setFocus"; + +scopeName "Main"; +private _fnc_errorAndClose = { + params ["_msg"]; + _display closeDisplay 0; + deleteVehicle _logic; + [_msg] call EFUNC(common,displayTextStructured); + breakOut "Main"; +}; + +private _fnc_onUnload = { + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + if (isNull _logic) exitWith {}; + + if (_this select 1 == 2) then { + deleteVehicle _logic; + }; +}; + +private _fnc_onConfirm = { + params [["_ctrlButtonOK", controlNull, [controlNull]]]; + + private _display = ctrlparent _ctrlButtonOK; + if (isNull _display) exitWith {}; + + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + if (isNull _logic) exitWith {}; + + private _radius = GETVAR(_display,GVAR(radius),50); + private _position = GETVAR(_display,GVAR(position),getPos _logic); + private _objectsToAdd = nearestObjects [_position, ["All"], _radius]; + + { + _y = _x; + { _x addCuratorEditableObjects [[_y], true]; } foreach allCurators; + } foreach _objectsToAdd; + + deleteVehicle _logic; +}; + +_display displayAddEventHandler ["unload", _fnc_onUnload]; +_control ctrlAddEventHandler ["buttonClick", _fnc_onConfirm]; \ No newline at end of file diff --git a/addons/zeus/functions/fnc_ui_RemoveObjects.sqf b/addons/zeus/functions/fnc_ui_RemoveObjects.sqf new file mode 100644 index 00000000000..61a2a024b91 --- /dev/null +++ b/addons/zeus/functions/fnc_ui_RemoveObjects.sqf @@ -0,0 +1,64 @@ +/* + * Author: Fisher + * Removes all objects in given radius for all curators + * + * Arguments: + * 0: dummy controls group + * + * Return Value: + * none + * + * Public: No + */ + +#include "script_component.hpp" + +disableSerialization; + +params ["_control"]; +private _display = ctrlParent _control; +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + +_control ctrlRemoveAllEventHandlers "setFocus"; + +scopeName "Main"; +private _fnc_errorAndClose = { + params ["_msg"]; + _display closeDisplay 0; + deleteVehicle _logic; + [_msg] call EFUNC(common,displayTextStructured); + breakOut "Main"; +}; + +private _fnc_onUnload = { + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + if (isNull _logic) exitWith {}; + + if (_this select 1 == 2) then { + deleteVehicle _logic; + }; +}; + +private _fnc_onConfirm = { + params [["_ctrlButtonOK", controlNull, [controlNull]]]; + + private _display = ctrlparent _ctrlButtonOK; + if (isNull _display) exitWith {}; + + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + if (isNull _logic) exitWith {}; + + private _radius = GETVAR(_display,GVAR(radius),50); + private _position = GETVAR(_display,GVAR(position),getPos _logic); + private _objectsToAdd = nearestObjects [_position, ["All"], _radius]; + + { + _y = _x; + { _x removeCuratorEditableObjects [[_y], true]; } foreach allCurators; + } foreach _objectsToAdd; + + deleteVehicle _logic; +}; + +_display displayAddEventHandler ["unload", _fnc_onUnload]; +_control ctrlAddEventHandler ["buttonClick", _fnc_onConfirm]; \ No newline at end of file diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index 7efb348f030..c781e32cd54 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -606,6 +606,9 @@ Semmi sincs az egér alatt Piazza su una unità ユニットの上に設置 + + + Place on a object Requires an addon that is not present @@ -643,6 +646,9 @@ Ajoute n'importe quel objet spawné à tous les curateurs de la mission Fügt jedes gespawnte Objekt allen Kuratoren der Mission hinzu ミッション内で作成されたオブジェクトに全キュレーターを追加 + + + Remove Objects from Curator Cargo: diff --git a/addons/zeus/ui/RscAttributes.hpp b/addons/zeus/ui/RscAttributes.hpp index 1efcde2c663..d1acce00b53 100644 --- a/addons/zeus/ui/RscAttributes.hpp +++ b/addons/zeus/ui/RscAttributes.hpp @@ -308,6 +308,42 @@ class GVAR(RscSearchArea): RscDisplayAttributes { }; }; +class GVAR(RscAddObjects): RscDisplayAttributes { + onLoad = QUOTE([ARR_3('onLoad', _this, QUOTE(QGVAR(RscAddObjects)))] call FUNC(zeusAttributes)); + onUnload = QUOTE([ARR_3('onUnload', _this, QUOTE(QGVAR(RscAddObjects)))] call FUNC(zeusAttributes)); + class Controls: Controls { + class Background: Background {}; + class Title: Title {}; + class Content: Content { + class Controls { + class radius: GVAR(AttributeRadius) {}; + }; + }; + class ButtonOK: ButtonOK { + onSetFocus = QUOTE(_this call FUNC(ui_AddObjects)); + }; + class ButtonCancel: ButtonCancel {}; + }; +}; + +class GVAR(RscRemoveObjects): RscDisplayAttributes { + onLoad = QUOTE([ARR_3('onLoad', _this, QUOTE(QGVAR(RscRemoveObjects)))] call FUNC(zeusAttributes)); + onUnload = QUOTE([ARR_3('onUnload', _this, QUOTE(QGVAR(RscRemoveObjects)))] call FUNC(zeusAttributes)); + class Controls: Controls { + class Background: Background {}; + class Title: Title {}; + class Content: Content { + class Controls { + class radius: GVAR(AttributeRadius) {}; + }; + }; + class ButtonOK: ButtonOK { + onSetFocus = QUOTE(_this call FUNC(ui_RemoveObjects)); + }; + class ButtonCancel: ButtonCancel {}; + }; +}; + class GVAR(RscTeleportPlayers): RscDisplayAttributes { onLoad = QUOTE([ARR_3('onLoad', _this, QUOTE(QGVAR(RscTeleportPlayers)))] call FUNC(zeusAttributes)); onUnload = QUOTE([ARR_3('onUnload', _this, QUOTE(QGVAR(RscTeleportPlayers)))] call FUNC(zeusAttributes)); From d27c68c23c1f464ae8110c6f32d5c0f6fc567816 Mon Sep 17 00:00:00 2001 From: Remco Speekenbrink <98remco@gmail.com> Date: Sat, 12 Nov 2016 02:04:35 +0100 Subject: [PATCH 03/21] Removed Tabs --- addons/zeus/CfgVehicles.hpp | 8 ++++---- addons/zeus/config.cpp | 6 +++--- addons/zeus/functions/fnc_moduleSimulation.sqf | 4 ++-- addons/zeus/functions/fnc_ui_AddObjects.sqf | 13 ++++++------- addons/zeus/functions/fnc_ui_RemoveObjects.sqf | 14 +++++++------- 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index 38b97b729de..153495afbe0 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -98,9 +98,9 @@ class CfgVehicles { function = QFUNC(moduleAddSpareTrack); icon = QPATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa);//@todo }; - class GVAR(moduleAddObjects): GVAR(moduleBase) { + class GVAR(moduleAddObjects): GVAR(moduleBase) { curatorCanAttach = 1; - category = "ACE_Util"; + category = "ACE_Util"; displayName = CSTRING(AddObjectsToCurator); curatorInfoType = QGVAR(RscAddObjects); }; @@ -135,7 +135,7 @@ class CfgVehicles { displayName = CSTRING(ModulePatrolArea_DisplayName); curatorInfoType = QGVAR(RscPatrolArea); }; - class GVAR(moduleRemoveObjects): GVAR(moduleAddObjects) { + class GVAR(moduleRemoveObjects): GVAR(moduleAddObjects) { curatorCanAttach = 1; displayName = CSTRING(RemoveObjectsToCurator); curatorInfoType = QGVAR(RscRemoveObjects); @@ -168,7 +168,7 @@ class CfgVehicles { function = QFUNC(moduleSetMedicalVehicle); icon = QPATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa); }; - class GVAR(moduleSimulation): GVAR(moduleAddObjects) { + class GVAR(moduleSimulation): GVAR(moduleAddObjects) { curatorCanAttach = 1; displayName = CSTRING(ModuleSimulation_DisplayName); function = QFUNC(moduleSimulation); diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index e9ff494a19b..54873f38c76 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -4,15 +4,15 @@ class CfgPatches { class ADDON { name = COMPONENT_NAME; units[] = { - QGVAR(moduleAddObjects), + QGVAR(moduleAddObjects), QGVAR(moduleDefendArea), QGVAR(moduleGlobalSetSkill), QGVAR(moduleGroupSide), QGVAR(modulePatrolArea), - QGVAR(moduleRemoveObjects), + QGVAR(moduleRemoveObjects), QGVAR(moduleSearchArea), QGVAR(moduleSearchNearby), - QGVAR(moduleSimulation), + QGVAR(moduleSimulation), QGVAR(moduleTeleportPlayers) }; weapons[] = {}; diff --git a/addons/zeus/functions/fnc_moduleSimulation.sqf b/addons/zeus/functions/fnc_moduleSimulation.sqf index 238fa7c5d6a..33f7042420c 100644 --- a/addons/zeus/functions/fnc_moduleSimulation.sqf +++ b/addons/zeus/functions/fnc_moduleSimulation.sqf @@ -23,8 +23,8 @@ if (isNull _object) then { [LSTRING(NoObjectSelected)] call EFUNC(common,displayTextStructured); } else { - _simulationEnabled = simulationEnabled _object; - _object enableSimulationGlobal (!_simulationEnabled); + _simulationEnabled = simulationEnabled _object; + _object enableSimulationGlobal (!_simulationEnabled); }; deleteVehicle _logic; \ No newline at end of file diff --git a/addons/zeus/functions/fnc_ui_AddObjects.sqf b/addons/zeus/functions/fnc_ui_AddObjects.sqf index 3de1ed67dbf..d49ed036f40 100644 --- a/addons/zeus/functions/fnc_ui_AddObjects.sqf +++ b/addons/zeus/functions/fnc_ui_AddObjects.sqf @@ -50,13 +50,12 @@ private _fnc_onConfirm = { private _radius = GETVAR(_display,GVAR(radius),50); private _position = GETVAR(_display,GVAR(position),getPos _logic); - private _objectsToAdd = nearestObjects [_position, ["All"], _radius]; - - { - _y = _x; - { _x addCuratorEditableObjects [[_y], true]; } foreach allCurators; - } foreach _objectsToAdd; - + private _objectsToAdd = nearestObjects [_position, ["All"], _radius]; + + { + _y = _x; + { _x addCuratorEditableObjects [[_y], true]; } foreach allCurators; + } foreach _objectsToAdd; deleteVehicle _logic; }; diff --git a/addons/zeus/functions/fnc_ui_RemoveObjects.sqf b/addons/zeus/functions/fnc_ui_RemoveObjects.sqf index 61a2a024b91..8e729cfbb13 100644 --- a/addons/zeus/functions/fnc_ui_RemoveObjects.sqf +++ b/addons/zeus/functions/fnc_ui_RemoveObjects.sqf @@ -50,13 +50,13 @@ private _fnc_onConfirm = { private _radius = GETVAR(_display,GVAR(radius),50); private _position = GETVAR(_display,GVAR(position),getPos _logic); - private _objectsToAdd = nearestObjects [_position, ["All"], _radius]; - - { - _y = _x; - { _x removeCuratorEditableObjects [[_y], true]; } foreach allCurators; - } foreach _objectsToAdd; - + private _objectsToAdd = nearestObjects [_position, ["All"], _radius]; + + { + _y = _x; + { _x removeCuratorEditableObjects [[_y], true]; } foreach allCurators; + } foreach _objectsToAdd; + deleteVehicle _logic; }; From f3294054d38ab9a17aab5a4cf526f932faa6f9a0 Mon Sep 17 00:00:00 2001 From: Remco Speekenbrink <98remco@gmail.com> Date: Sat, 12 Nov 2016 09:45:37 +0100 Subject: [PATCH 04/21] Code Cleanup --- addons/zeus/CfgFactionClasses.hpp | 7 +++++++ addons/zeus/CfgVehicles.hpp | 4 ++-- addons/zeus/XEH_PREP.hpp | 4 ++-- addons/zeus/config.cpp | 8 +------- .../zeus/functions/fnc_moduleSimulation.sqf | 20 +++++++++---------- addons/zeus/functions/fnc_ui_AddObjects.sqf | 17 ++++++++-------- .../zeus/functions/fnc_ui_RemoveObjects.sqf | 17 ++++++++-------- addons/zeus/stringtable.xml | 4 ++-- addons/zeus/ui/RscAttributes.hpp | 4 ++-- 9 files changed, 43 insertions(+), 42 deletions(-) create mode 100644 addons/zeus/CfgFactionClasses.hpp diff --git a/addons/zeus/CfgFactionClasses.hpp b/addons/zeus/CfgFactionClasses.hpp new file mode 100644 index 00000000000..835fc828c70 --- /dev/null +++ b/addons/zeus/CfgFactionClasses.hpp @@ -0,0 +1,7 @@ +class CfgFactionClasses { + class ACE_UI_Util { + displayName = "ACE Util"; + priority = 2; + side = 7; + }; +}; \ No newline at end of file diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index 153495afbe0..479319ed1ba 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -100,7 +100,7 @@ class CfgVehicles { }; class GVAR(moduleAddObjects): GVAR(moduleBase) { curatorCanAttach = 1; - category = "ACE_Util"; + category = "ACE_UI_Util"; displayName = CSTRING(AddObjectsToCurator); curatorInfoType = QGVAR(RscAddObjects); }; @@ -137,7 +137,7 @@ class CfgVehicles { }; class GVAR(moduleRemoveObjects): GVAR(moduleAddObjects) { curatorCanAttach = 1; - displayName = CSTRING(RemoveObjectsToCurator); + displayName = CSTRING(RemoveObjectsFromCurator); curatorInfoType = QGVAR(RscRemoveObjects); }; class GVAR(moduleSearchArea): GVAR(moduleBase) { diff --git a/addons/zeus/XEH_PREP.hpp b/addons/zeus/XEH_PREP.hpp index 26e2b23238a..1f30d782957 100644 --- a/addons/zeus/XEH_PREP.hpp +++ b/addons/zeus/XEH_PREP.hpp @@ -21,13 +21,13 @@ PREP(moduleUnconscious); PREP(moduleZeusSettings); PREP(ui_attributeCargo); //PREP(ui_attributePosition); -PREP(ui_AddObjects); +PREP(ui_addObjects); PREP(ui_attributeRadius); PREP(ui_defendArea); PREP(ui_globalSetSkill); PREP(ui_groupSide); PREP(ui_patrolArea); -PREP(ui_RemoveObjects); +PREP(ui_removeObjects); PREP(ui_searchArea); PREP(ui_teleportPlayers); PREP(zeusAttributes); diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index 54873f38c76..5bf504632f1 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -52,14 +52,8 @@ class ACE_Curator { GVAR(cargoAndRepair)[] = {"ace_cargo", "ace_repair"}; }; -class CfgFactionClasses { - class ACE_Util { - displayName = "ACE Util"; - priority = 2; - side = 7; - }; -}; +#include "CfgFactionClasses.hpp" #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "ACE_Settings.hpp" diff --git a/addons/zeus/functions/fnc_moduleSimulation.sqf b/addons/zeus/functions/fnc_moduleSimulation.sqf index 33f7042420c..8dd2d857765 100644 --- a/addons/zeus/functions/fnc_moduleSimulation.sqf +++ b/addons/zeus/functions/fnc_moduleSimulation.sqf @@ -1,13 +1,12 @@ /* * Author: Fisher - * Toggle Simulation on object + * Toggle Simulation on object. * * Arguments: * 0: The module logic * * Return Value: - * None - * + * None * * Public: No */ @@ -15,16 +14,15 @@ #include "script_component.hpp" params ["_logic"]; - private ["_object","_simulationEnabled"]; if !(local _logic) exitWith {}; - _object = attachedTo _logic; -if (isNull _object) then { + private _object = attachedTo _logic; + if (isNull _object) then { [LSTRING(NoObjectSelected)] call EFUNC(common,displayTextStructured); -} else { - _simulationEnabled = simulationEnabled _object; - _object enableSimulationGlobal (!_simulationEnabled); -}; + } else { + private _simulationEnabled = simulationEnabled _object; + [[_object, (!_simulationEnabled)]],"enableSimulationGlobal",false] call BIS_fnc_MP; + }; -deleteVehicle _logic; \ No newline at end of file + deleteVehicle _logic; \ No newline at end of file diff --git a/addons/zeus/functions/fnc_ui_AddObjects.sqf b/addons/zeus/functions/fnc_ui_AddObjects.sqf index d49ed036f40..a91b4f404f3 100644 --- a/addons/zeus/functions/fnc_ui_AddObjects.sqf +++ b/addons/zeus/functions/fnc_ui_AddObjects.sqf @@ -1,12 +1,12 @@ /* * Author: Fisher - * Adds all objects in given radius to all curators + * Adds all objects in given radius to all curators. * * Arguments: - * 0: dummy controls group + * 0: Dummy controls group * * Return Value: - * none + * None * * Public: No */ @@ -17,7 +17,7 @@ disableSerialization; params ["_control"]; private _display = ctrlParent _control; -private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); _control ctrlRemoveAllEventHandlers "setFocus"; @@ -31,7 +31,7 @@ private _fnc_errorAndClose = { }; private _fnc_onUnload = { - private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); if (isNull _logic) exitWith {}; if (_this select 1 == 2) then { @@ -45,7 +45,7 @@ private _fnc_onConfirm = { private _display = ctrlparent _ctrlButtonOK; if (isNull _display) exitWith {}; - private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); if (isNull _logic) exitWith {}; private _radius = GETVAR(_display,GVAR(radius),50); @@ -53,8 +53,9 @@ private _fnc_onConfirm = { private _objectsToAdd = nearestObjects [_position, ["All"], _radius]; { - _y = _x; - { _x addCuratorEditableObjects [[_y], true]; } foreach allCurators; + { + _x addCuratorEditableObjects [_objectsToAdd, true]; + } foreach allCurators; } foreach _objectsToAdd; deleteVehicle _logic; }; diff --git a/addons/zeus/functions/fnc_ui_RemoveObjects.sqf b/addons/zeus/functions/fnc_ui_RemoveObjects.sqf index 8e729cfbb13..28833e17958 100644 --- a/addons/zeus/functions/fnc_ui_RemoveObjects.sqf +++ b/addons/zeus/functions/fnc_ui_RemoveObjects.sqf @@ -1,12 +1,12 @@ /* * Author: Fisher - * Removes all objects in given radius for all curators + * Removes all objects in given radius for all curators. * * Arguments: - * 0: dummy controls group + * 0: Dummy controls group * * Return Value: - * none + * None * * Public: No */ @@ -17,7 +17,7 @@ disableSerialization; params ["_control"]; private _display = ctrlParent _control; -private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); _control ctrlRemoveAllEventHandlers "setFocus"; @@ -31,7 +31,7 @@ private _fnc_errorAndClose = { }; private _fnc_onUnload = { - private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); if (isNull _logic) exitWith {}; if (_this select 1 == 2) then { @@ -45,7 +45,7 @@ private _fnc_onConfirm = { private _display = ctrlparent _ctrlButtonOK; if (isNull _display) exitWith {}; - private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); + private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); if (isNull _logic) exitWith {}; private _radius = GETVAR(_display,GVAR(radius),50); @@ -53,8 +53,9 @@ private _fnc_onConfirm = { private _objectsToAdd = nearestObjects [_position, ["All"], _radius]; { - _y = _x; - { _x removeCuratorEditableObjects [[_y], true]; } foreach allCurators; + { + _x removeCuratorEditableObjects [_objectsToAdd, true]; + } foreach allCurators; } foreach _objectsToAdd; deleteVehicle _logic; diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index c781e32cd54..a773713e034 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -608,7 +608,7 @@ ユニットの上に設置 - Place on a object + Place on an object Requires an addon that is not present @@ -647,7 +647,7 @@ Fügt jedes gespawnte Objekt allen Kuratoren der Mission hinzu ミッション内で作成されたオブジェクトに全キュレーターを追加 - + Remove Objects from Curator diff --git a/addons/zeus/ui/RscAttributes.hpp b/addons/zeus/ui/RscAttributes.hpp index d1acce00b53..56a6168113e 100644 --- a/addons/zeus/ui/RscAttributes.hpp +++ b/addons/zeus/ui/RscAttributes.hpp @@ -320,7 +320,7 @@ class GVAR(RscAddObjects): RscDisplayAttributes { }; }; class ButtonOK: ButtonOK { - onSetFocus = QUOTE(_this call FUNC(ui_AddObjects)); + onSetFocus = QUOTE(_this call FUNC(ui_addObjects)); }; class ButtonCancel: ButtonCancel {}; }; @@ -338,7 +338,7 @@ class GVAR(RscRemoveObjects): RscDisplayAttributes { }; }; class ButtonOK: ButtonOK { - onSetFocus = QUOTE(_this call FUNC(ui_RemoveObjects)); + onSetFocus = QUOTE(_this call FUNC(ui_removeObjects)); }; class ButtonCancel: ButtonCancel {}; }; From 703767698668ed437a564850e219f87f0efeae1c Mon Sep 17 00:00:00 2001 From: Remco Speekenbrink <98remco@gmail.com> Date: Sat, 12 Nov 2016 09:49:48 +0100 Subject: [PATCH 05/21] Fix array in fnc_moduleSimulation.sqf --- addons/zeus/functions/fnc_moduleSimulation.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/zeus/functions/fnc_moduleSimulation.sqf b/addons/zeus/functions/fnc_moduleSimulation.sqf index 8dd2d857765..2df3797f03a 100644 --- a/addons/zeus/functions/fnc_moduleSimulation.sqf +++ b/addons/zeus/functions/fnc_moduleSimulation.sqf @@ -22,7 +22,7 @@ [LSTRING(NoObjectSelected)] call EFUNC(common,displayTextStructured); } else { private _simulationEnabled = simulationEnabled _object; - [[_object, (!_simulationEnabled)]],"enableSimulationGlobal",false] call BIS_fnc_MP; + [[_object, (!_simulationEnabled)],"enableSimulationGlobal",false] call BIS_fnc_MP; }; deleteVehicle _logic; \ No newline at end of file From 2398ac9a2e37136f9cbd8cb3b956e85dfb35246a Mon Sep 17 00:00:00 2001 From: Remco Speekenbrink <98remco@gmail.com> Date: Sat, 12 Nov 2016 09:56:15 +0100 Subject: [PATCH 06/21] Tab and Newline Cleanup --- addons/zeus/config.cpp | 1 - addons/zeus/functions/fnc_ui_AddObjects.sqf | 3 ++- addons/zeus/functions/fnc_ui_RemoveObjects.sqf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index 5bf504632f1..805ce54dfd8 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -52,7 +52,6 @@ class ACE_Curator { GVAR(cargoAndRepair)[] = {"ace_cargo", "ace_repair"}; }; - #include "CfgFactionClasses.hpp" #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" diff --git a/addons/zeus/functions/fnc_ui_AddObjects.sqf b/addons/zeus/functions/fnc_ui_AddObjects.sqf index a91b4f404f3..6996fb53002 100644 --- a/addons/zeus/functions/fnc_ui_AddObjects.sqf +++ b/addons/zeus/functions/fnc_ui_AddObjects.sqf @@ -54,9 +54,10 @@ private _fnc_onConfirm = { { { - _x addCuratorEditableObjects [_objectsToAdd, true]; + _x addCuratorEditableObjects [_objectsToAdd, true]; } foreach allCurators; } foreach _objectsToAdd; + deleteVehicle _logic; }; diff --git a/addons/zeus/functions/fnc_ui_RemoveObjects.sqf b/addons/zeus/functions/fnc_ui_RemoveObjects.sqf index 28833e17958..02fcb91d709 100644 --- a/addons/zeus/functions/fnc_ui_RemoveObjects.sqf +++ b/addons/zeus/functions/fnc_ui_RemoveObjects.sqf @@ -54,7 +54,7 @@ private _fnc_onConfirm = { { { - _x removeCuratorEditableObjects [_objectsToAdd, true]; + _x removeCuratorEditableObjects [_objectsToAdd, true]; } foreach allCurators; } foreach _objectsToAdd; From 5a87acf6966e1a4eef8e76bf1768380394bdf1f5 Mon Sep 17 00:00:00 2001 From: Remco Speekenbrink Date: Sat, 12 Nov 2016 09:59:47 +0100 Subject: [PATCH 07/21] Filename Upercase on remote fix (fnc_removeObjects) --- .../{fnc_ui_RemoveObjects.sqf => fnc_ui_removeObjects.sqf} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename addons/zeus/functions/{fnc_ui_RemoveObjects.sqf => fnc_ui_removeObjects.sqf} (96%) diff --git a/addons/zeus/functions/fnc_ui_RemoveObjects.sqf b/addons/zeus/functions/fnc_ui_removeObjects.sqf similarity index 96% rename from addons/zeus/functions/fnc_ui_RemoveObjects.sqf rename to addons/zeus/functions/fnc_ui_removeObjects.sqf index 02fcb91d709..1811fa09a7f 100644 --- a/addons/zeus/functions/fnc_ui_RemoveObjects.sqf +++ b/addons/zeus/functions/fnc_ui_removeObjects.sqf @@ -62,4 +62,4 @@ private _fnc_onConfirm = { }; _display displayAddEventHandler ["unload", _fnc_onUnload]; -_control ctrlAddEventHandler ["buttonClick", _fnc_onConfirm]; \ No newline at end of file +_control ctrlAddEventHandler ["buttonClick", _fnc_onConfirm]; From aa3289df1e583381ba4c7dd695c171c366eb99ec Mon Sep 17 00:00:00 2001 From: Remco Speekenbrink Date: Sat, 12 Nov 2016 10:00:11 +0100 Subject: [PATCH 08/21] Filename Upercase on remote fix (fnc_addObjects) --- .../functions/{fnc_ui_AddObjects.sqf => fnc_ui_addObjects.sqf} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename addons/zeus/functions/{fnc_ui_AddObjects.sqf => fnc_ui_addObjects.sqf} (96%) diff --git a/addons/zeus/functions/fnc_ui_AddObjects.sqf b/addons/zeus/functions/fnc_ui_addObjects.sqf similarity index 96% rename from addons/zeus/functions/fnc_ui_AddObjects.sqf rename to addons/zeus/functions/fnc_ui_addObjects.sqf index 6996fb53002..8b046b43f79 100644 --- a/addons/zeus/functions/fnc_ui_AddObjects.sqf +++ b/addons/zeus/functions/fnc_ui_addObjects.sqf @@ -62,4 +62,4 @@ private _fnc_onConfirm = { }; _display displayAddEventHandler ["unload", _fnc_onUnload]; -_control ctrlAddEventHandler ["buttonClick", _fnc_onConfirm]; \ No newline at end of file +_control ctrlAddEventHandler ["buttonClick", _fnc_onConfirm]; From 221d0aecf49c373dbfdbe576a399ddb87edd4d93 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sat, 12 Nov 2016 11:37:45 +0000 Subject: [PATCH 09/21] Reduce network traffic of toggle simulation module Module will run on the server only via the module framework (removing the need for any back and fourth). --- addons/zeus/CfgVehicles.hpp | 3 ++- addons/zeus/functions/fnc_moduleSimulation.sqf | 17 +++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index 479319ed1ba..b953bfc9646 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -168,10 +168,11 @@ class CfgVehicles { function = QFUNC(moduleSetMedicalVehicle); icon = QPATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa); }; - class GVAR(moduleSimulation): GVAR(moduleAddObjects) { + class GVAR(moduleSimulation): GVAR(moduleBase) { curatorCanAttach = 1; displayName = CSTRING(ModuleSimulation_DisplayName); function = QFUNC(moduleSimulation); + isGlobal = 0; }; class GVAR(moduleSurrender): GVAR(moduleBase) { curatorCanAttach = 1; diff --git a/addons/zeus/functions/fnc_moduleSimulation.sqf b/addons/zeus/functions/fnc_moduleSimulation.sqf index 2df3797f03a..1ec8c43fe14 100644 --- a/addons/zeus/functions/fnc_moduleSimulation.sqf +++ b/addons/zeus/functions/fnc_moduleSimulation.sqf @@ -1,6 +1,6 @@ /* * Author: Fisher - * Toggle Simulation on object. + * Toggle Simulation on object (runs on server only via module framework). * * Arguments: * 0: The module logic @@ -10,19 +10,20 @@ * * Public: No */ - + #include "script_component.hpp" - + params ["_logic"]; - - if !(local _logic) exitWith {}; private _object = attachedTo _logic; if (isNull _object) then { [LSTRING(NoObjectSelected)] call EFUNC(common,displayTextStructured); } else { - private _simulationEnabled = simulationEnabled _object; - [[_object, (!_simulationEnabled)],"enableSimulationGlobal",false] call BIS_fnc_MP; + if (isMultiplayer) then { + _object enableSimulationGlobal !(simulationEnabled _object); + } else { + _object enableSimulation !(simulationEnabled _object); + }; }; - deleteVehicle _logic; \ No newline at end of file + deleteVehicle _logic; From 40ba9effb38d20e22cef3530d043fc2018e104f1 Mon Sep 17 00:00:00 2001 From: Remco Speekenbrink <98remco@gmail.com> Date: Sat, 12 Nov 2016 12:38:57 +0100 Subject: [PATCH 10/21] Edited functions to meet Review --- addons/zeus/CfgFactionClasses.hpp | 2 +- addons/zeus/functions/fnc_moduleSimulation.sqf | 5 +++-- addons/zeus/functions/fnc_ui_addObjects.sqf | 6 ++---- addons/zeus/functions/fnc_ui_removeObjects.sqf | 6 ++---- addons/zeus/stringtable.xml | 2 +- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/addons/zeus/CfgFactionClasses.hpp b/addons/zeus/CfgFactionClasses.hpp index 835fc828c70..bb05f07c5d4 100644 --- a/addons/zeus/CfgFactionClasses.hpp +++ b/addons/zeus/CfgFactionClasses.hpp @@ -4,4 +4,4 @@ class CfgFactionClasses { priority = 2; side = 7; }; -}; \ No newline at end of file +}; diff --git a/addons/zeus/functions/fnc_moduleSimulation.sqf b/addons/zeus/functions/fnc_moduleSimulation.sqf index 2df3797f03a..ab5989529f2 100644 --- a/addons/zeus/functions/fnc_moduleSimulation.sqf +++ b/addons/zeus/functions/fnc_moduleSimulation.sqf @@ -22,7 +22,8 @@ [LSTRING(NoObjectSelected)] call EFUNC(common,displayTextStructured); } else { private _simulationEnabled = simulationEnabled _object; - [[_object, (!_simulationEnabled)],"enableSimulationGlobal",false] call BIS_fnc_MP; + _object enableSimulationGlobal (!_simulationEnabled); }; - deleteVehicle _logic; \ No newline at end of file + deleteVehicle _logic; + \ No newline at end of file diff --git a/addons/zeus/functions/fnc_ui_addObjects.sqf b/addons/zeus/functions/fnc_ui_addObjects.sqf index 8b046b43f79..cc9421cf3af 100644 --- a/addons/zeus/functions/fnc_ui_addObjects.sqf +++ b/addons/zeus/functions/fnc_ui_addObjects.sqf @@ -53,10 +53,8 @@ private _fnc_onConfirm = { private _objectsToAdd = nearestObjects [_position, ["All"], _radius]; { - { - _x addCuratorEditableObjects [_objectsToAdd, true]; - } foreach allCurators; - } foreach _objectsToAdd; + _x addCuratorEditableObjects [_objectsToAdd, true]; + } forEach allCurators; deleteVehicle _logic; }; diff --git a/addons/zeus/functions/fnc_ui_removeObjects.sqf b/addons/zeus/functions/fnc_ui_removeObjects.sqf index 1811fa09a7f..51bac2f293a 100644 --- a/addons/zeus/functions/fnc_ui_removeObjects.sqf +++ b/addons/zeus/functions/fnc_ui_removeObjects.sqf @@ -53,10 +53,8 @@ private _fnc_onConfirm = { private _objectsToAdd = nearestObjects [_position, ["All"], _radius]; { - { - _x removeCuratorEditableObjects [_objectsToAdd, true]; - } foreach allCurators; - } foreach _objectsToAdd; + _x removeCuratorEditableObjects [_objectsToAdd, true]; + } forEach allCurators; deleteVehicle _logic; }; diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index a773713e034..cf25ce7928c 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -705,4 +705,4 @@ Toggle Simulation - \ No newline at end of file + From be7c4d6f95b6368c6f482f8c494d7fbceec61f0c Mon Sep 17 00:00:00 2001 From: Remco Speekenbrink Date: Sat, 12 Nov 2016 15:24:02 +0100 Subject: [PATCH 11/21] Remove fnc_errorAndClose from fnc_ui_addObjects.sqf --- addons/zeus/functions/fnc_ui_addObjects.sqf | 7 ------- 1 file changed, 7 deletions(-) diff --git a/addons/zeus/functions/fnc_ui_addObjects.sqf b/addons/zeus/functions/fnc_ui_addObjects.sqf index cc9421cf3af..1949705d422 100644 --- a/addons/zeus/functions/fnc_ui_addObjects.sqf +++ b/addons/zeus/functions/fnc_ui_addObjects.sqf @@ -22,13 +22,6 @@ private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); _control ctrlRemoveAllEventHandlers "setFocus"; scopeName "Main"; -private _fnc_errorAndClose = { - params ["_msg"]; - _display closeDisplay 0; - deleteVehicle _logic; - [_msg] call EFUNC(common,displayTextStructured); - breakOut "Main"; -}; private _fnc_onUnload = { private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); From 4b690e86a2d40b235948f063efa7aa1c9a2481c1 Mon Sep 17 00:00:00 2001 From: Remco Speekenbrink <98remco@gmail.com> Date: Sat, 12 Nov 2016 15:27:14 +0100 Subject: [PATCH 12/21] Remove White Space from fnc_moduleSImulation --- addons/zeus/functions/fnc_moduleSimulation.sqf | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/zeus/functions/fnc_moduleSimulation.sqf b/addons/zeus/functions/fnc_moduleSimulation.sqf index cf101c6c8c2..7bfc5eccdfe 100644 --- a/addons/zeus/functions/fnc_moduleSimulation.sqf +++ b/addons/zeus/functions/fnc_moduleSimulation.sqf @@ -11,20 +11,20 @@ * Public: No */ - #include "script_component.hpp" +#include "script_component.hpp" - params ["_logic"]; +params ["_logic"]; - private _object = attachedTo _logic; - if (isNull _object) then { +private _object = attachedTo _logic; +if (isNull _object) then { [LSTRING(NoObjectSelected)] call EFUNC(common,displayTextStructured); - } else { +} else { if (isMultiplayer) then { _object enableSimulationGlobal !(simulationEnabled _object); } else { _object enableSimulation !(simulationEnabled _object); }; - }; +}; - deleteVehicle _logic; +deleteVehicle _logic; \ No newline at end of file From a1ebaed9b02e6a2f3099e0e48c372917e3ce1cd6 Mon Sep 17 00:00:00 2001 From: Remco Speekenbrink Date: Sat, 12 Nov 2016 15:29:12 +0100 Subject: [PATCH 13/21] _fnc_errorAndClose & removed from fnc_ui_removeObjects --- addons/zeus/functions/fnc_ui_removeObjects.sqf | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/addons/zeus/functions/fnc_ui_removeObjects.sqf b/addons/zeus/functions/fnc_ui_removeObjects.sqf index 51bac2f293a..3b6c55675f9 100644 --- a/addons/zeus/functions/fnc_ui_removeObjects.sqf +++ b/addons/zeus/functions/fnc_ui_removeObjects.sqf @@ -12,9 +12,7 @@ */ #include "script_component.hpp" - -disableSerialization; - + params ["_control"]; private _display = ctrlParent _control; private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); @@ -22,14 +20,6 @@ private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); _control ctrlRemoveAllEventHandlers "setFocus"; scopeName "Main"; -private _fnc_errorAndClose = { - params ["_msg"]; - _display closeDisplay 0; - deleteVehicle _logic; - [_msg] call EFUNC(common,displayTextStructured); - breakOut "Main"; -}; - private _fnc_onUnload = { private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); if (isNull _logic) exitWith {}; From dd85fcb425b6e9a2ff7452379b9f8e30dfcf815a Mon Sep 17 00:00:00 2001 From: Remco Speekenbrink Date: Sat, 12 Nov 2016 15:40:09 +0100 Subject: [PATCH 14/21] Space @ EOF removed :) --- addons/zeus/functions/fnc_moduleSimulation.sqf | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/zeus/functions/fnc_moduleSimulation.sqf b/addons/zeus/functions/fnc_moduleSimulation.sqf index 7bfc5eccdfe..e6266b22031 100644 --- a/addons/zeus/functions/fnc_moduleSimulation.sqf +++ b/addons/zeus/functions/fnc_moduleSimulation.sqf @@ -27,4 +27,3 @@ if (isNull _object) then { }; deleteVehicle _logic; - \ No newline at end of file From 59ef96c66e3e7772f78c8744134fcbb1d11a8b2a Mon Sep 17 00:00:00 2001 From: Remco Speekenbrink Date: Sat, 12 Nov 2016 17:04:21 +0100 Subject: [PATCH 15/21] simplified code (Tested in MP & SP) --- addons/zeus/functions/fnc_moduleSimulation.sqf | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/addons/zeus/functions/fnc_moduleSimulation.sqf b/addons/zeus/functions/fnc_moduleSimulation.sqf index e6266b22031..f2e6c7593ec 100644 --- a/addons/zeus/functions/fnc_moduleSimulation.sqf +++ b/addons/zeus/functions/fnc_moduleSimulation.sqf @@ -19,11 +19,7 @@ private _object = attachedTo _logic; if (isNull _object) then { [LSTRING(NoObjectSelected)] call EFUNC(common,displayTextStructured); } else { - if (isMultiplayer) then { - _object enableSimulationGlobal !(simulationEnabled _object); - } else { - _object enableSimulation !(simulationEnabled _object); - }; + _object enableSimulationGlobal !(simulationEnabled _object); }; deleteVehicle _logic; From 1c733557e2c52a31f34a2d6bb2794b9bc90381f6 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sat, 12 Nov 2016 16:41:28 +0000 Subject: [PATCH 16/21] Merge add/remove editable objects zeus modules - Merges the add/remove curator editable objects modules into one with a checkbox to specific behaviour. - Adds a checkbox to specify whether to effect all curators or only the local curator - Fixes locality handling of the module code --- addons/zeus/CfgVehicles.hpp | 11 +--- addons/zeus/XEH_PREP.hpp | 3 +- addons/zeus/XEH_postInit.sqf | 23 +++++++ addons/zeus/config.cpp | 3 +- ...Objects.sqf => fnc_ui_editableObjects.sqf} | 39 +++++++---- .../zeus/functions/fnc_ui_removeObjects.sqf | 53 --------------- addons/zeus/stringtable.xml | 26 ++++++-- addons/zeus/ui/RscAttributes.hpp | 65 ++++++++++++------- 8 files changed, 113 insertions(+), 110 deletions(-) rename addons/zeus/functions/{fnc_ui_addObjects.sqf => fnc_ui_editableObjects.sqf} (52%) delete mode 100644 addons/zeus/functions/fnc_ui_removeObjects.sqf diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index b953bfc9646..b8bbef7dced 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -98,11 +98,11 @@ class CfgVehicles { function = QFUNC(moduleAddSpareTrack); icon = QPATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa);//@todo }; - class GVAR(moduleAddObjects): GVAR(moduleBase) { + class GVAR(moduleEditableObjects): GVAR(moduleBase) { curatorCanAttach = 1; category = "ACE_UI_Util"; - displayName = CSTRING(AddObjectsToCurator); - curatorInfoType = QGVAR(RscAddObjects); + displayName = CSTRING(ModuleEditableObjects_DisplayName); + curatorInfoType = QGVAR(RscEditableObjects); }; class GVAR(moduleAddSpareWheel): GVAR(moduleBase) { curatorCanAttach = 1; @@ -135,11 +135,6 @@ class CfgVehicles { displayName = CSTRING(ModulePatrolArea_DisplayName); curatorInfoType = QGVAR(RscPatrolArea); }; - class GVAR(moduleRemoveObjects): GVAR(moduleAddObjects) { - curatorCanAttach = 1; - displayName = CSTRING(RemoveObjectsFromCurator); - curatorInfoType = QGVAR(RscRemoveObjects); - }; class GVAR(moduleSearchArea): GVAR(moduleBase) { curatorCanAttach = 1; displayName = CSTRING(ModuleSearchArea_DisplayName); diff --git a/addons/zeus/XEH_PREP.hpp b/addons/zeus/XEH_PREP.hpp index 1f30d782957..4a54c039206 100644 --- a/addons/zeus/XEH_PREP.hpp +++ b/addons/zeus/XEH_PREP.hpp @@ -21,13 +21,12 @@ PREP(moduleUnconscious); PREP(moduleZeusSettings); PREP(ui_attributeCargo); //PREP(ui_attributePosition); -PREP(ui_addObjects); PREP(ui_attributeRadius); PREP(ui_defendArea); +PREP(ui_editableObjects); PREP(ui_globalSetSkill); PREP(ui_groupSide); PREP(ui_patrolArea); -PREP(ui_removeObjects); PREP(ui_searchArea); PREP(ui_teleportPlayers); PREP(zeusAttributes); diff --git a/addons/zeus/XEH_postInit.sqf b/addons/zeus/XEH_postInit.sqf index 9062ae5e9a4..2906d8e79e4 100644 --- a/addons/zeus/XEH_postInit.sqf +++ b/addons/zeus/XEH_postInit.sqf @@ -14,3 +14,26 @@ QGVAR(GlobalSkillAI) addPublicVariableEventHandler FUNC(moduleGlobalSetSkill); [QGVAR(modulePatrolArea), CBA_fnc_taskPatrol] call CBA_fnc_addEventHandler; [QGVAR(moduleSearchNearby), CBA_fnc_searchNearby] call CBA_fnc_addEventHandler; [QGVAR(moduleSearchArea), CBA_fnc_taskSearchArea] call CBA_fnc_addEventHandler; + +// Editable object commands must be ran on server, this events are used in the respective module +if (isServer) then { + [QGVAR(addObjects), { + params ["_objects", "_curator"]; + + if !(isNull _curator) exitWith { _curator addCuratorEditableObjects [_objects, true]; }; + + { + _x addCuratorEditableObjects [_objects, true]; + } forEach allCurators; + }] call CBA_fnc_addEventHandler; + + [QGVAR(removeObjects), { + params ["_objects", "_curator"]; + + if !(isNull _curator) exitWith { _curator removeCuratorEditableObjects [_objects, true]; }; + + { + _x removeCuratorEditableObjects [_objects, true]; + } forEach allCurators; + }] call CBA_fnc_addEventHandler; +}; diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index 805ce54dfd8..84659b0641c 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -4,12 +4,11 @@ class CfgPatches { class ADDON { name = COMPONENT_NAME; units[] = { - QGVAR(moduleAddObjects), QGVAR(moduleDefendArea), + QGVAR(moduleEditableObjects), QGVAR(moduleGlobalSetSkill), QGVAR(moduleGroupSide), QGVAR(modulePatrolArea), - QGVAR(moduleRemoveObjects), QGVAR(moduleSearchArea), QGVAR(moduleSearchNearby), QGVAR(moduleSimulation), diff --git a/addons/zeus/functions/fnc_ui_addObjects.sqf b/addons/zeus/functions/fnc_ui_editableObjects.sqf similarity index 52% rename from addons/zeus/functions/fnc_ui_addObjects.sqf rename to addons/zeus/functions/fnc_ui_editableObjects.sqf index 1949705d422..f1deca8e19c 100644 --- a/addons/zeus/functions/fnc_ui_addObjects.sqf +++ b/addons/zeus/functions/fnc_ui_editableObjects.sqf @@ -1,6 +1,6 @@ /* - * Author: Fisher - * Adds all objects in given radius to all curators. + * Author: Fisher, SilentSpike + * Updated all/local curator with objects in the module radius. * * Arguments: * 0: Dummy controls group @@ -10,18 +10,23 @@ * * Public: No */ - + #include "script_component.hpp" - -disableSerialization; - + params ["_control"]; + +disableSerialization; + +//Generic Init: private _display = ctrlParent _control; -private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); +private _ctrlButtonOK = _display displayCtrl 1; //IDC_OK +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +TRACE_1("logicObject",_logic); _control ctrlRemoveAllEventHandlers "setFocus"; -scopeName "Main"; +//Specific on-load stuff: +(_display displayCtrl 16188) cbSetChecked true; private _fnc_onUnload = { private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); @@ -35,7 +40,7 @@ private _fnc_onUnload = { private _fnc_onConfirm = { params [["_ctrlButtonOK", controlNull, [controlNull]]]; - private _display = ctrlparent _ctrlButtonOK; + private _display = ctrlParent _ctrlButtonOK; if (isNull _display) exitWith {}; private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); @@ -43,14 +48,20 @@ private _fnc_onConfirm = { private _radius = GETVAR(_display,GVAR(radius),50); private _position = GETVAR(_display,GVAR(position),getPos _logic); - private _objectsToAdd = nearestObjects [_position, ["All"], _radius]; + private _allCurators = cbChecked (_display displayCtrl 16188); + private _removeObjects = cbChecked (_display displayCtrl 16189); - { - _x addCuratorEditableObjects [_objectsToAdd, true]; - } forEach allCurators; + private _objects = nearestObjects [_position, ["All"], _radius]; + private _localCurator = [getAssignedCuratorLogic player, objNull] select _allCurators; + + if (_removeObjects) then { + [QGVAR(removeObjects), [_objects, _localCurator]] call CBA_fnc_serverEvent; + } else { + [QGVAR(addObjects), [_objects, _localCurator]] call CBA_fnc_serverEvent; + }; deleteVehicle _logic; }; _display displayAddEventHandler ["unload", _fnc_onUnload]; -_control ctrlAddEventHandler ["buttonClick", _fnc_onConfirm]; +_ctrlButtonOK ctrlAddEventHandler ["buttonClick", _fnc_onConfirm]; diff --git a/addons/zeus/functions/fnc_ui_removeObjects.sqf b/addons/zeus/functions/fnc_ui_removeObjects.sqf deleted file mode 100644 index 3b6c55675f9..00000000000 --- a/addons/zeus/functions/fnc_ui_removeObjects.sqf +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Author: Fisher - * Removes all objects in given radius for all curators. - * - * Arguments: - * 0: Dummy controls group - * - * Return Value: - * None - * - * Public: No - */ - -#include "script_component.hpp" - -params ["_control"]; -private _display = ctrlParent _control; -private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); - -_control ctrlRemoveAllEventHandlers "setFocus"; - -scopeName "Main"; -private _fnc_onUnload = { - private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); - if (isNull _logic) exitWith {}; - - if (_this select 1 == 2) then { - deleteVehicle _logic; - }; -}; - -private _fnc_onConfirm = { - params [["_ctrlButtonOK", controlNull, [controlNull]]]; - - private _display = ctrlparent _ctrlButtonOK; - if (isNull _display) exitWith {}; - - private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); - if (isNull _logic) exitWith {}; - - private _radius = GETVAR(_display,GVAR(radius),50); - private _position = GETVAR(_display,GVAR(position),getPos _logic); - private _objectsToAdd = nearestObjects [_position, ["All"], _radius]; - - { - _x removeCuratorEditableObjects [_objectsToAdd, true]; - } forEach allCurators; - - deleteVehicle _logic; -}; - -_display displayAddEventHandler ["unload", _fnc_onUnload]; -_control ctrlAddEventHandler ["buttonClick", _fnc_onConfirm]; diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index cf25ce7928c..972fe8c50c1 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -205,6 +205,21 @@ Osłaniaj obszar Verteidige Gebiet + + Update Editable Objects + + + All Curators + + + Apply changes to all curators + + + Remove Objects + + + Remove existing instead of adding new + Global AI Skill Compétence global de l'IA @@ -465,6 +480,9 @@ Assigner installation médicale 医療施設として割り当て + + Toggle Simulation + Add Spare Wheel Adicionar roda sobressalente @@ -646,9 +664,6 @@ Ajoute n'importe quel objet spawné à tous les curateurs de la mission Fügt jedes gespawnte Objekt allen Kuratoren der Mission hinzu ミッション内で作成されたオブジェクトに全キュレーターを追加 - - - Remove Objects from Curator Cargo: @@ -700,9 +715,6 @@ 無効な半径が入力されました Wpisano nieprawidłowy promień Ungültiger Radius eingegeben - - - Toggle Simulation diff --git a/addons/zeus/ui/RscAttributes.hpp b/addons/zeus/ui/RscAttributes.hpp index 56a6168113e..23b0a8b5119 100644 --- a/addons/zeus/ui/RscAttributes.hpp +++ b/addons/zeus/ui/RscAttributes.hpp @@ -308,38 +308,55 @@ class GVAR(RscSearchArea): RscDisplayAttributes { }; }; -class GVAR(RscAddObjects): RscDisplayAttributes { - onLoad = QUOTE([ARR_3('onLoad', _this, QUOTE(QGVAR(RscAddObjects)))] call FUNC(zeusAttributes)); - onUnload = QUOTE([ARR_3('onUnload', _this, QUOTE(QGVAR(RscAddObjects)))] call FUNC(zeusAttributes)); - class Controls: Controls { - class Background: Background {}; - class Title: Title {}; - class Content: Content { - class Controls { - class radius: GVAR(AttributeRadius) {}; - }; - }; - class ButtonOK: ButtonOK { - onSetFocus = QUOTE(_this call FUNC(ui_addObjects)); - }; - class ButtonCancel: ButtonCancel {}; - }; -}; - -class GVAR(RscRemoveObjects): RscDisplayAttributes { - onLoad = QUOTE([ARR_3('onLoad', _this, QUOTE(QGVAR(RscRemoveObjects)))] call FUNC(zeusAttributes)); - onUnload = QUOTE([ARR_3('onUnload', _this, QUOTE(QGVAR(RscRemoveObjects)))] call FUNC(zeusAttributes)); +class GVAR(RscEditableObjects): RscDisplayAttributes { + onLoad = QUOTE([ARR_3('onLoad', _this, QQGVAR(RscEditableObjects))] call FUNC(zeusAttributes)); + onUnload = QUOTE([ARR_3('onUnload', _this, QQGVAR(RscEditableObjects))] call FUNC(zeusAttributes)); class Controls: Controls { class Background: Background {}; class Title: Title {}; class Content: Content { class Controls { class radius: GVAR(AttributeRadius) {}; + //class position: GVAR(AttributePosition) {}; + class editableObjects: RscControlsGroupNoScrollbars { + onSetFocus = QUOTE(_this call FUNC(ui_editableObjects)); + idc = 26422; + x = 0; + y = 0; + w = W_PART(11.1); + h = H_PART(2.5); + class controls { + class Label: RscText { + idc = -1; + text = CSTRING(ModuleEditableObjects_curators); + toolTip = CSTRING(ModuleEditableObjects_curators_desc); + x = 0; + y = 0; + w = W_PART(10); + h = H_PART(1); + colorBackground[] = {0,0,0,0.5}; + }; + class AllCurators: RscCheckBox { + idc = 16188; + x = W_PART(10.1); + y = 0; + w = W_PART(1); + h = H_PART(1); + }; + class Label2: Label { + text = CSTRING(ModuleEditableObjects_removal); + toolTip = CSTRING(ModuleEditableObjects_removal_desc); + y = H_PART(1.1); + }; + class EditingMode: AllCurators { + idc = 16189; + y = H_PART(1.1); + }; + }; + }; }; }; - class ButtonOK: ButtonOK { - onSetFocus = QUOTE(_this call FUNC(ui_removeObjects)); - }; + class ButtonOK: ButtonOK {}; class ButtonCancel: ButtonCancel {}; }; }; From 30c694d62035726f9dda4398f823624f816b9f0d Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sat, 12 Nov 2016 17:21:26 +0000 Subject: [PATCH 17/21] Clean up ace_zeus - Standardise function headers (remove examples where not applicable) - Add module categories (and make display names beautiful) - Alphabetise some classes --- addons/zeus/CfgFactionClasses.hpp | 24 +++- addons/zeus/CfgVehicles.hpp | 28 ++++- .../zeus/functions/fnc_bi_moduleCurator.sqf | 4 +- addons/zeus/functions/fnc_bi_moduleMine.sqf | 2 +- .../functions/fnc_bi_moduleProjectile.sqf | 2 +- .../functions/fnc_bi_moduleRemoteControl.sqf | 2 +- .../functions/fnc_handleZeusUnitAssigned.sqf | 2 +- addons/zeus/functions/fnc_moduleCaptive.sqf | 2 +- .../functions/fnc_moduleGlobalSetSkill.sqf | 5 +- addons/zeus/functions/fnc_moduleGroupSide.sqf | 2 +- .../zeus/functions/fnc_moduleSearchNearby.sqf | 2 +- addons/zeus/functions/fnc_moduleSetMedic.sqf | 2 +- .../fnc_moduleSetMedicalFacility.sqf | 2 +- .../functions/fnc_moduleSetMedicalVehicle.sqf | 2 +- addons/zeus/functions/fnc_moduleSurrender.sqf | 2 +- .../functions/fnc_moduleTeleportPlayers.sqf | 2 +- .../zeus/functions/fnc_moduleUnconscious.sqf | 2 +- .../zeus/functions/fnc_moduleZeusSettings.sqf | 2 +- .../zeus/functions/fnc_ui_attributeCargo.sqf | 5 +- .../functions/fnc_ui_attributePosition.sqf | 2 +- .../zeus/functions/fnc_ui_attributeRadius.sqf | 2 +- addons/zeus/functions/fnc_ui_defendArea.sqf | 2 +- .../zeus/functions/fnc_ui_editableObjects.sqf | 2 +- .../zeus/functions/fnc_ui_globalSetSkill.sqf | 5 +- addons/zeus/functions/fnc_ui_groupSide.sqf | 5 +- addons/zeus/functions/fnc_ui_patrolArea.sqf | 2 +- addons/zeus/functions/fnc_ui_searchArea.sqf | 2 +- .../zeus/functions/fnc_ui_teleportPlayers.sqf | 5 +- addons/zeus/functions/fnc_zeusAttributes.sqf | 2 +- addons/zeus/ui/RscAttributes.hpp | 106 +++++++++--------- 30 files changed, 125 insertions(+), 104 deletions(-) diff --git a/addons/zeus/CfgFactionClasses.hpp b/addons/zeus/CfgFactionClasses.hpp index bb05f07c5d4..7d758adfc08 100644 --- a/addons/zeus/CfgFactionClasses.hpp +++ b/addons/zeus/CfgFactionClasses.hpp @@ -1,6 +1,26 @@ class CfgFactionClasses { - class ACE_UI_Util { - displayName = "ACE Util"; + class GVAR(AI) { + displayName = "ACE AI"; + priority = 2; + side = 7; + }; + class GVAR(Captive) { + displayName = "ACE Captive"; + priority = 2; + side = 7; + }; + class GVAR(Medical) { + displayName = "ACE Medical"; + priority = 2; + side = 7; + }; + class GVAR(Repair) { + displayName = "ACE Repair"; + priority = 2; + side = 7; + }; + class GVAR(Utility) { + displayName = "ACE Utility"; priority = 2; side = 7; }; diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index b8bbef7dced..23adbac5a80 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -94,94 +94,110 @@ class CfgVehicles { }; class GVAR(moduleAddSpareTrack): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(Repair); displayName = CSTRING(ModuleAddSpareTrack_DisplayName); function = QFUNC(moduleAddSpareTrack); icon = QPATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa);//@todo }; - class GVAR(moduleEditableObjects): GVAR(moduleBase) { - curatorCanAttach = 1; - category = "ACE_UI_Util"; - displayName = CSTRING(ModuleEditableObjects_DisplayName); - curatorInfoType = QGVAR(RscEditableObjects); - }; class GVAR(moduleAddSpareWheel): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(Repair); displayName = CSTRING(ModuleAddSpareWheel_DisplayName); function = QFUNC(moduleAddSpareWheel); icon = QPATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa);//@todo }; class GVAR(moduleCaptive): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(Captive); displayName = CSTRING(ModuleCaptive_DisplayName); function = QFUNC(moduleCaptive); icon = QPATHTOF(UI\Icon_Module_Zeus_Captive_ca.paa); }; class GVAR(moduleDefendArea): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(AI); displayName = CSTRING(ModuleDefendArea_DisplayName); curatorInfoType = QGVAR(RscDefendArea); }; + class GVAR(moduleEditableObjects): GVAR(moduleBase) { + curatorCanAttach = 1; + category = QGVAR(Utility); + displayName = CSTRING(ModuleEditableObjects_DisplayName); + curatorInfoType = QGVAR(RscEditableObjects); + }; class GVAR(moduleGlobalSetSkill): GVAR(moduleBase) { + category = QGVAR(AI); displayName = CSTRING(ModuleGlobalSetSkill_DisplayName); curatorInfoType = QGVAR(RscGlobalSetSkill); }; class GVAR(moduleGroupSide): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(Utility); displayName = CSTRING(ModuleGroupSide_DisplayName); curatorInfoType = QGVAR(RscGroupSide); }; class GVAR(modulePatrolArea): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(AI); displayName = CSTRING(ModulePatrolArea_DisplayName); curatorInfoType = QGVAR(RscPatrolArea); }; class GVAR(moduleSearchArea): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(AI); displayName = CSTRING(ModuleSearchArea_DisplayName); curatorInfoType = QGVAR(RscSearchArea); }; class GVAR(moduleSearchNearby): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(AI); displayName = CSTRING(ModuleSearchNearby_DisplayName); function = QFUNC(moduleSearchNearby); }; class GVAR(moduleSetMedic): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(Medical); displayName = CSTRING(ModuleSetMedic_DisplayName); function = QFUNC(moduleSetMedic); icon = QPATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa); }; class GVAR(moduleSetMedicalFacility): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(Medical); displayName = CSTRING(ModuleSetMedicalFacility_DisplayName); function = QFUNC(moduleSetMedicalFacility); icon = QPATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa); }; class GVAR(moduleSetMedicalVehicle): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(Medical); displayName = CSTRING(ModuleSetMedicalVehicle_DisplayName); function = QFUNC(moduleSetMedicalVehicle); icon = QPATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa); }; class GVAR(moduleSimulation): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(Utility); displayName = CSTRING(ModuleSimulation_DisplayName); function = QFUNC(moduleSimulation); isGlobal = 0; }; class GVAR(moduleSurrender): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(Captive); displayName = CSTRING(ModuleSurrender_DisplayName); function = QFUNC(moduleSurrender); icon = QPATHTOF(UI\Icon_Module_Zeus_Surrender_ca.paa); }; class GVAR(moduleTeleportPlayers): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(Utility); displayName = CSTRING(ModuleTeleportPlayers_DisplayName); curatorInfoType = QGVAR(RscTeleportPlayers); }; class GVAR(moduleUnconscious): GVAR(moduleBase) { curatorCanAttach = 1; + category = QGVAR(Medical); displayName = CSTRING(ModuleUnconscious_DisplayName); function = QFUNC(moduleUnconscious); icon = QPATHTOF(UI\Icon_Module_Zeus_Unconscious_ca.paa); diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index 231f2cb08dd..66395fbb0c3 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -10,7 +10,7 @@ * 2: activated * * Return Value: - * nil + * None * * Public: No */ @@ -98,7 +98,7 @@ if (_activated) then { //--- Handle ownership [_logic,_ownerVar,_ownerUID,_adminVar] spawn { scriptname "BIS_fnc_moduleCurator: Owner"; - + params ["_logic", "_ownerVar", "_ownerUID", "_adminVar"]; if (_adminVar != "") then {_ownerVar = _adminVar;}; diff --git a/addons/zeus/functions/fnc_bi_moduleMine.sqf b/addons/zeus/functions/fnc_bi_moduleMine.sqf index 5a14fbe218b..940dd94f382 100644 --- a/addons/zeus/functions/fnc_bi_moduleMine.sqf +++ b/addons/zeus/functions/fnc_bi_moduleMine.sqf @@ -9,7 +9,7 @@ * 2: activated * * Return Value: - * nil + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf index 1a9da0ab02e..70002cc215a 100644 --- a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf +++ b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf @@ -10,7 +10,7 @@ * 2: activated * * Return Value: - * nil + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf index f32afef130c..79cd35477f5 100644 --- a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf +++ b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf @@ -9,7 +9,7 @@ * 2: activated * * Return Value: - * nil + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_handleZeusUnitAssigned.sqf b/addons/zeus/functions/fnc_handleZeusUnitAssigned.sqf index 65663e65fd5..fada3f1e324 100644 --- a/addons/zeus/functions/fnc_handleZeusUnitAssigned.sqf +++ b/addons/zeus/functions/fnc_handleZeusUnitAssigned.sqf @@ -12,7 +12,7 @@ * 1: The zeus player * * Return Value: - * nil + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_moduleCaptive.sqf b/addons/zeus/functions/fnc_moduleCaptive.sqf index 7d1c46f873b..732c165fa43 100644 --- a/addons/zeus/functions/fnc_moduleCaptive.sqf +++ b/addons/zeus/functions/fnc_moduleCaptive.sqf @@ -8,7 +8,7 @@ * 2: Activated * * Return Value: - * None + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_moduleGlobalSetSkill.sqf b/addons/zeus/functions/fnc_moduleGlobalSetSkill.sqf index 35c6476cc05..58e7ad19c5c 100644 --- a/addons/zeus/functions/fnc_moduleGlobalSetSkill.sqf +++ b/addons/zeus/functions/fnc_moduleGlobalSetSkill.sqf @@ -7,10 +7,7 @@ * 1: Variable new value * * Return Value: - * None - * - * Example: - * "ace_zeus_GlobalSkillAI" addPublicVariableEventHandler ace_zeus_fnc_moduleGlobalSetSkill + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_moduleGroupSide.sqf b/addons/zeus/functions/fnc_moduleGroupSide.sqf index fa37ca34633..050b92a9fcb 100644 --- a/addons/zeus/functions/fnc_moduleGroupSide.sqf +++ b/addons/zeus/functions/fnc_moduleGroupSide.sqf @@ -7,7 +7,7 @@ * 1: Chosen side * * Return Value: - * None + * None * * Example: * [this, west] call ace_zeus_fnc_moduleGroupSide diff --git a/addons/zeus/functions/fnc_moduleSearchNearby.sqf b/addons/zeus/functions/fnc_moduleSearchNearby.sqf index 48f35bbfeeb..76f77c489e6 100644 --- a/addons/zeus/functions/fnc_moduleSearchNearby.sqf +++ b/addons/zeus/functions/fnc_moduleSearchNearby.sqf @@ -8,7 +8,7 @@ * 2: Activated * * Return Value: - * None + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_moduleSetMedic.sqf b/addons/zeus/functions/fnc_moduleSetMedic.sqf index d4acda3f541..14dfca4f6f6 100644 --- a/addons/zeus/functions/fnc_moduleSetMedic.sqf +++ b/addons/zeus/functions/fnc_moduleSetMedic.sqf @@ -8,7 +8,7 @@ * 2: Activated * * Return Value: - * None + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf b/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf index 1e710bf41b3..4c26ccdd712 100644 --- a/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf +++ b/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf @@ -8,7 +8,7 @@ * 2: Activated * * Return Value: - * None + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf b/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf index 4ffec3460ea..abbc26b1ed7 100644 --- a/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf +++ b/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf @@ -8,7 +8,7 @@ * 2: Activated * * Return Value: - * None + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_moduleSurrender.sqf b/addons/zeus/functions/fnc_moduleSurrender.sqf index e14501feb04..d6d030a4c58 100644 --- a/addons/zeus/functions/fnc_moduleSurrender.sqf +++ b/addons/zeus/functions/fnc_moduleSurrender.sqf @@ -8,7 +8,7 @@ * 2: Activated * * Return Value: - * None + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_moduleTeleportPlayers.sqf b/addons/zeus/functions/fnc_moduleTeleportPlayers.sqf index 2a43f26ed19..4a1855ba65f 100644 --- a/addons/zeus/functions/fnc_moduleTeleportPlayers.sqf +++ b/addons/zeus/functions/fnc_moduleTeleportPlayers.sqf @@ -8,7 +8,7 @@ * 2: Teleport group * * Return Value: - * None + * None * * Example: * [player, "5854854754", false] call ace_zeus_fnc_moduleTeleportPlayers diff --git a/addons/zeus/functions/fnc_moduleUnconscious.sqf b/addons/zeus/functions/fnc_moduleUnconscious.sqf index d9f9031ceed..502847feda3 100644 --- a/addons/zeus/functions/fnc_moduleUnconscious.sqf +++ b/addons/zeus/functions/fnc_moduleUnconscious.sqf @@ -8,7 +8,7 @@ * 2: Activated * * Return Value: - * None + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_moduleZeusSettings.sqf b/addons/zeus/functions/fnc_moduleZeusSettings.sqf index 0f3d720599b..0b4e3b4027e 100644 --- a/addons/zeus/functions/fnc_moduleZeusSettings.sqf +++ b/addons/zeus/functions/fnc_moduleZeusSettings.sqf @@ -8,7 +8,7 @@ * 2: activated * * Return Value: - * None + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_ui_attributeCargo.sqf b/addons/zeus/functions/fnc_ui_attributeCargo.sqf index 444fa5e7e23..a92e826b895 100644 --- a/addons/zeus/functions/fnc_ui_attributeCargo.sqf +++ b/addons/zeus/functions/fnc_ui_attributeCargo.sqf @@ -7,10 +7,7 @@ * 0: ace_cargo controls group * * Return Value: - * None - * - * Example: - * onSetFocus = "_this call ace_zeus_fnc_ui_vehCargo" + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_ui_attributePosition.sqf b/addons/zeus/functions/fnc_ui_attributePosition.sqf index 95557a891b4..a424e26e00d 100644 --- a/addons/zeus/functions/fnc_ui_attributePosition.sqf +++ b/addons/zeus/functions/fnc_ui_attributePosition.sqf @@ -6,7 +6,7 @@ * 0: position controls group * * Return Value: - * None + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_ui_attributeRadius.sqf b/addons/zeus/functions/fnc_ui_attributeRadius.sqf index c26f8ac97d9..e5263dd36f6 100644 --- a/addons/zeus/functions/fnc_ui_attributeRadius.sqf +++ b/addons/zeus/functions/fnc_ui_attributeRadius.sqf @@ -6,7 +6,7 @@ * 0: radius controls group * * Return Value: - * None + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_ui_defendArea.sqf b/addons/zeus/functions/fnc_ui_defendArea.sqf index 6fcb4a17d56..9c20e0288eb 100644 --- a/addons/zeus/functions/fnc_ui_defendArea.sqf +++ b/addons/zeus/functions/fnc_ui_defendArea.sqf @@ -6,7 +6,7 @@ * 0: dummy controls group * * Return Value: - * None + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_ui_editableObjects.sqf b/addons/zeus/functions/fnc_ui_editableObjects.sqf index f1deca8e19c..ccbd3720eef 100644 --- a/addons/zeus/functions/fnc_ui_editableObjects.sqf +++ b/addons/zeus/functions/fnc_ui_editableObjects.sqf @@ -3,7 +3,7 @@ * Updated all/local curator with objects in the module radius. * * Arguments: - * 0: Dummy controls group + * 0: editableObjects controls group * * Return Value: * None diff --git a/addons/zeus/functions/fnc_ui_globalSetSkill.sqf b/addons/zeus/functions/fnc_ui_globalSetSkill.sqf index 8dcac19bce7..e0e7a591156 100644 --- a/addons/zeus/functions/fnc_ui_globalSetSkill.sqf +++ b/addons/zeus/functions/fnc_ui_globalSetSkill.sqf @@ -6,10 +6,7 @@ * 0: globalSetSkill controls group * * Return Value: - * None - * - * Example: - * onSetFocus = "_this call ace_zeus_fnc_ui_globalSetSkill" + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_ui_groupSide.sqf b/addons/zeus/functions/fnc_ui_groupSide.sqf index be3298c8daf..6c040389d9d 100644 --- a/addons/zeus/functions/fnc_ui_groupSide.sqf +++ b/addons/zeus/functions/fnc_ui_groupSide.sqf @@ -6,10 +6,7 @@ * 0: groupSide controls group * * Return Value: - * NONE - * - * Example: - * onSetFocus = "_this call ace_zeus_fnc_ui_groupSide" + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_ui_patrolArea.sqf b/addons/zeus/functions/fnc_ui_patrolArea.sqf index d4fbc092a0c..1e4e24831f6 100644 --- a/addons/zeus/functions/fnc_ui_patrolArea.sqf +++ b/addons/zeus/functions/fnc_ui_patrolArea.sqf @@ -6,7 +6,7 @@ * 0: dummy controls group * * Return Value: - * None + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_ui_searchArea.sqf b/addons/zeus/functions/fnc_ui_searchArea.sqf index 3da147b963f..758454868cb 100644 --- a/addons/zeus/functions/fnc_ui_searchArea.sqf +++ b/addons/zeus/functions/fnc_ui_searchArea.sqf @@ -6,7 +6,7 @@ * 0: dummy controls group * * Return Value: - * None + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_ui_teleportPlayers.sqf b/addons/zeus/functions/fnc_ui_teleportPlayers.sqf index bdcd8ae93ff..182ed4f2909 100644 --- a/addons/zeus/functions/fnc_ui_teleportPlayers.sqf +++ b/addons/zeus/functions/fnc_ui_teleportPlayers.sqf @@ -6,10 +6,7 @@ * 0: teleportPlayers controls group * * Return Value: - * NONE - * - * Example: - * onSetFocus = "_this call ace_zeus_fnc_ui_teleportPlayers" + * None * * Public: No */ diff --git a/addons/zeus/functions/fnc_zeusAttributes.sqf b/addons/zeus/functions/fnc_zeusAttributes.sqf index dcbef695104..5481120cd38 100644 --- a/addons/zeus/functions/fnc_zeusAttributes.sqf +++ b/addons/zeus/functions/fnc_zeusAttributes.sqf @@ -9,7 +9,7 @@ * 2: Display class name * * Return Value: - * None + * None * * Example: * onLoad = "['onLoad',_this,'RscDisplayExample'] call ace_zeus_fnc_zeusAttributes" diff --git a/addons/zeus/ui/RscAttributes.hpp b/addons/zeus/ui/RscAttributes.hpp index 23b0a8b5119..27f89d89c08 100644 --- a/addons/zeus/ui/RscAttributes.hpp +++ b/addons/zeus/ui/RscAttributes.hpp @@ -97,6 +97,59 @@ class GVAR(RscDefendArea): RscDisplayAttributes { }; }; +class GVAR(RscEditableObjects): RscDisplayAttributes { + onLoad = QUOTE([ARR_3('onLoad', _this, QQGVAR(RscEditableObjects))] call FUNC(zeusAttributes)); + onUnload = QUOTE([ARR_3('onUnload', _this, QQGVAR(RscEditableObjects))] call FUNC(zeusAttributes)); + class Controls: Controls { + class Background: Background {}; + class Title: Title {}; + class Content: Content { + class Controls { + class radius: GVAR(AttributeRadius) {}; + //class position: GVAR(AttributePosition) {}; + class editableObjects: RscControlsGroupNoScrollbars { + onSetFocus = QUOTE(_this call FUNC(ui_editableObjects)); + idc = 26422; + x = 0; + y = 0; + w = W_PART(11.1); + h = H_PART(2.5); + class controls { + class Label: RscText { + idc = -1; + text = CSTRING(ModuleEditableObjects_curators); + toolTip = CSTRING(ModuleEditableObjects_curators_desc); + x = 0; + y = 0; + w = W_PART(10); + h = H_PART(1); + colorBackground[] = {0,0,0,0.5}; + }; + class AllCurators: RscCheckBox { + idc = 16188; + x = W_PART(10.1); + y = 0; + w = W_PART(1); + h = H_PART(1); + }; + class Label2: Label { + text = CSTRING(ModuleEditableObjects_removal); + toolTip = CSTRING(ModuleEditableObjects_removal_desc); + y = H_PART(1.1); + }; + class EditingMode: AllCurators { + idc = 16189; + y = H_PART(1.1); + }; + }; + }; + }; + }; + class ButtonOK: ButtonOK {}; + class ButtonCancel: ButtonCancel {}; + }; +}; + class GVAR(RscGlobalSetSkill): RscDisplayAttributes { onLoad = QUOTE([ARR_3('onLoad', _this, QUOTE(QGVAR(RscGlobalSetSkill)))] call FUNC(zeusAttributes)); onUnload = QUOTE([ARR_3('onUnload', _this, QUOTE(QGVAR(RscGlobalSetSkill)))] call FUNC(zeusAttributes)); @@ -308,59 +361,6 @@ class GVAR(RscSearchArea): RscDisplayAttributes { }; }; -class GVAR(RscEditableObjects): RscDisplayAttributes { - onLoad = QUOTE([ARR_3('onLoad', _this, QQGVAR(RscEditableObjects))] call FUNC(zeusAttributes)); - onUnload = QUOTE([ARR_3('onUnload', _this, QQGVAR(RscEditableObjects))] call FUNC(zeusAttributes)); - class Controls: Controls { - class Background: Background {}; - class Title: Title {}; - class Content: Content { - class Controls { - class radius: GVAR(AttributeRadius) {}; - //class position: GVAR(AttributePosition) {}; - class editableObjects: RscControlsGroupNoScrollbars { - onSetFocus = QUOTE(_this call FUNC(ui_editableObjects)); - idc = 26422; - x = 0; - y = 0; - w = W_PART(11.1); - h = H_PART(2.5); - class controls { - class Label: RscText { - idc = -1; - text = CSTRING(ModuleEditableObjects_curators); - toolTip = CSTRING(ModuleEditableObjects_curators_desc); - x = 0; - y = 0; - w = W_PART(10); - h = H_PART(1); - colorBackground[] = {0,0,0,0.5}; - }; - class AllCurators: RscCheckBox { - idc = 16188; - x = W_PART(10.1); - y = 0; - w = W_PART(1); - h = H_PART(1); - }; - class Label2: Label { - text = CSTRING(ModuleEditableObjects_removal); - toolTip = CSTRING(ModuleEditableObjects_removal_desc); - y = H_PART(1.1); - }; - class EditingMode: AllCurators { - idc = 16189; - y = H_PART(1.1); - }; - }; - }; - }; - }; - class ButtonOK: ButtonOK {}; - class ButtonCancel: ButtonCancel {}; - }; -}; - class GVAR(RscTeleportPlayers): RscDisplayAttributes { onLoad = QUOTE([ARR_3('onLoad', _this, QUOTE(QGVAR(RscTeleportPlayers)))] call FUNC(zeusAttributes)); onUnload = QUOTE([ARR_3('onUnload', _this, QUOTE(QGVAR(RscTeleportPlayers)))] call FUNC(zeusAttributes)); From aab2cb732c6afb38f3d5fa590cb93604bf7d9da2 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sat, 12 Nov 2016 17:37:02 +0000 Subject: [PATCH 18/21] Clean up some camel case --- addons/zeus/functions/fnc_ui_attributeCargo.sqf | 2 +- addons/zeus/functions/fnc_ui_attributePosition.sqf | 2 +- addons/zeus/functions/fnc_ui_defendArea.sqf | 2 +- addons/zeus/functions/fnc_ui_editableObjects.sqf | 2 +- addons/zeus/functions/fnc_ui_globalSetSkill.sqf | 6 +++--- addons/zeus/functions/fnc_ui_groupSide.sqf | 6 +++--- addons/zeus/functions/fnc_ui_patrolArea.sqf | 2 +- addons/zeus/functions/fnc_ui_searchArea.sqf | 2 +- addons/zeus/functions/fnc_ui_teleportPlayers.sqf | 6 +++--- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/addons/zeus/functions/fnc_ui_attributeCargo.sqf b/addons/zeus/functions/fnc_ui_attributeCargo.sqf index a92e826b895..49e5c6b2ea6 100644 --- a/addons/zeus/functions/fnc_ui_attributeCargo.sqf +++ b/addons/zeus/functions/fnc_ui_attributeCargo.sqf @@ -17,7 +17,7 @@ params ["_control"]; TRACE_1("params",_control); -private _veh = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +private _veh = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); TRACE_1("",_veh); private _loaded = _veh getVariable [QEGVAR(cargo,loaded), []]; diff --git a/addons/zeus/functions/fnc_ui_attributePosition.sqf b/addons/zeus/functions/fnc_ui_attributePosition.sqf index a424e26e00d..7632eafbdb0 100644 --- a/addons/zeus/functions/fnc_ui_attributePosition.sqf +++ b/addons/zeus/functions/fnc_ui_attributePosition.sqf @@ -18,7 +18,7 @@ disableSerialization; //Generic Init: params ["_control"]; private _display = ctrlParent _control; -private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); _control ctrlRemoveAllEventHandlers "setFocus"; diff --git a/addons/zeus/functions/fnc_ui_defendArea.sqf b/addons/zeus/functions/fnc_ui_defendArea.sqf index 9c20e0288eb..e6b2eaf9bff 100644 --- a/addons/zeus/functions/fnc_ui_defendArea.sqf +++ b/addons/zeus/functions/fnc_ui_defendArea.sqf @@ -18,7 +18,7 @@ disableSerialization; //Generic Init: params ["_control"]; private _display = ctrlParent _control; -private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); _control ctrlRemoveAllEventHandlers "setFocus"; diff --git a/addons/zeus/functions/fnc_ui_editableObjects.sqf b/addons/zeus/functions/fnc_ui_editableObjects.sqf index ccbd3720eef..85096bd2bf4 100644 --- a/addons/zeus/functions/fnc_ui_editableObjects.sqf +++ b/addons/zeus/functions/fnc_ui_editableObjects.sqf @@ -20,7 +20,7 @@ disableSerialization; //Generic Init: private _display = ctrlParent _control; private _ctrlButtonOK = _display displayCtrl 1; //IDC_OK -private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); TRACE_1("logicObject",_logic); _control ctrlRemoveAllEventHandlers "setFocus"; diff --git a/addons/zeus/functions/fnc_ui_globalSetSkill.sqf b/addons/zeus/functions/fnc_ui_globalSetSkill.sqf index e0e7a591156..1b3e351ad16 100644 --- a/addons/zeus/functions/fnc_ui_globalSetSkill.sqf +++ b/addons/zeus/functions/fnc_ui_globalSetSkill.sqf @@ -19,9 +19,9 @@ params ["_control"]; TRACE_1("params",_control); //Generic Init: -private _display = ctrlparent _control; -private _ctrlButtonOK = _display displayctrl 1; //IDC_OK -private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +private _display = ctrlParent _control; +private _ctrlButtonOK = _display displayCtrl 1; //IDC_OK +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); TRACE_1("logicObject",_logic); _control ctrlRemoveAllEventHandlers "setFocus"; diff --git a/addons/zeus/functions/fnc_ui_groupSide.sqf b/addons/zeus/functions/fnc_ui_groupSide.sqf index 6c040389d9d..9ab818674d9 100644 --- a/addons/zeus/functions/fnc_ui_groupSide.sqf +++ b/addons/zeus/functions/fnc_ui_groupSide.sqf @@ -19,9 +19,9 @@ disableSerialization; params ["_control"]; //Generic Init: -private _display = ctrlparent _control; -private _ctrlButtonOK = _display displayctrl 1; //IDC_OK -private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +private _display = ctrlParent _control; +private _ctrlButtonOK = _display displayCtrl 1; //IDC_OK +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); TRACE_1("logicObject",_logic); _control ctrlRemoveAllEventHandlers "setFocus"; diff --git a/addons/zeus/functions/fnc_ui_patrolArea.sqf b/addons/zeus/functions/fnc_ui_patrolArea.sqf index 1e4e24831f6..2a2d9bcd8ee 100644 --- a/addons/zeus/functions/fnc_ui_patrolArea.sqf +++ b/addons/zeus/functions/fnc_ui_patrolArea.sqf @@ -18,7 +18,7 @@ disableSerialization; //Generic Init: params ["_control"]; private _display = ctrlParent _control; -private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); _control ctrlRemoveAllEventHandlers "setFocus"; diff --git a/addons/zeus/functions/fnc_ui_searchArea.sqf b/addons/zeus/functions/fnc_ui_searchArea.sqf index 758454868cb..9f4d4ebf678 100644 --- a/addons/zeus/functions/fnc_ui_searchArea.sqf +++ b/addons/zeus/functions/fnc_ui_searchArea.sqf @@ -18,7 +18,7 @@ disableSerialization; //Generic Init: params ["_control"]; private _display = ctrlParent _control; -private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); _control ctrlRemoveAllEventHandlers "setFocus"; diff --git a/addons/zeus/functions/fnc_ui_teleportPlayers.sqf b/addons/zeus/functions/fnc_ui_teleportPlayers.sqf index 182ed4f2909..402a2b1dfb3 100644 --- a/addons/zeus/functions/fnc_ui_teleportPlayers.sqf +++ b/addons/zeus/functions/fnc_ui_teleportPlayers.sqf @@ -18,9 +18,9 @@ disableSerialization; params ["_control"]; //Generic Init: -private _display = ctrlparent _control; -private _ctrlButtonOK = _display displayctrl 1; //IDC_OK -private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull); +private _display = ctrlParent _control; +private _ctrlButtonOK = _display displayCtrl 1; //IDC_OK +private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); TRACE_1("logicObject",_logic); _control ctrlRemoveAllEventHandlers "setFocus"; From 438255af12f3b40e0f2a0b03b54830c22b3486eb Mon Sep 17 00:00:00 2001 From: Remco Speekenbrink Date: Sun, 13 Nov 2016 00:47:22 +0100 Subject: [PATCH 19/21] Remove disableSerialization from fnc_ui_editableObjects --- addons/zeus/functions/fnc_ui_editableObjects.sqf | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/zeus/functions/fnc_ui_editableObjects.sqf b/addons/zeus/functions/fnc_ui_editableObjects.sqf index 85096bd2bf4..040bd2630fe 100644 --- a/addons/zeus/functions/fnc_ui_editableObjects.sqf +++ b/addons/zeus/functions/fnc_ui_editableObjects.sqf @@ -15,8 +15,6 @@ params ["_control"]; -disableSerialization; - //Generic Init: private _display = ctrlParent _control; private _ctrlButtonOK = _display displayCtrl 1; //IDC_OK From 008bb40002d0c22ffd3a11bcafb1077985643384 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sun, 13 Nov 2016 15:23:52 +0000 Subject: [PATCH 20/21] Fix zeus feedback of toggle simulation module - Module must run on zeus client so that feedback can be shown if validation fails - Use event in common to run the `enableSimulationGlobal` command - Can use existing localised string - Also adds default value to the editable objects events --- addons/zeus/CfgVehicles.hpp | 1 - addons/zeus/XEH_postInit.sqf | 4 ++-- addons/zeus/functions/fnc_moduleSimulation.sqf | 10 ++++++---- addons/zeus/stringtable.xml | 3 --- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index 23adbac5a80..22d827e16f6 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -180,7 +180,6 @@ class CfgVehicles { category = QGVAR(Utility); displayName = CSTRING(ModuleSimulation_DisplayName); function = QFUNC(moduleSimulation); - isGlobal = 0; }; class GVAR(moduleSurrender): GVAR(moduleBase) { curatorCanAttach = 1; diff --git a/addons/zeus/XEH_postInit.sqf b/addons/zeus/XEH_postInit.sqf index 2906d8e79e4..1ddcaf30d8d 100644 --- a/addons/zeus/XEH_postInit.sqf +++ b/addons/zeus/XEH_postInit.sqf @@ -18,7 +18,7 @@ QGVAR(GlobalSkillAI) addPublicVariableEventHandler FUNC(moduleGlobalSetSkill); // Editable object commands must be ran on server, this events are used in the respective module if (isServer) then { [QGVAR(addObjects), { - params ["_objects", "_curator"]; + params ["_objects", ["_curator",objNull]]; if !(isNull _curator) exitWith { _curator addCuratorEditableObjects [_objects, true]; }; @@ -28,7 +28,7 @@ if (isServer) then { }] call CBA_fnc_addEventHandler; [QGVAR(removeObjects), { - params ["_objects", "_curator"]; + params ["_objects", ["_curator",objNull]]; if !(isNull _curator) exitWith { _curator removeCuratorEditableObjects [_objects, true]; }; diff --git a/addons/zeus/functions/fnc_moduleSimulation.sqf b/addons/zeus/functions/fnc_moduleSimulation.sqf index f2e6c7593ec..fab59e48eb3 100644 --- a/addons/zeus/functions/fnc_moduleSimulation.sqf +++ b/addons/zeus/functions/fnc_moduleSimulation.sqf @@ -1,6 +1,6 @@ /* - * Author: Fisher - * Toggle Simulation on object (runs on server only via module framework). + * Author: Fisher, SilentSpike + * Toggle Simulation on object. * * Arguments: * 0: The module logic @@ -15,11 +15,13 @@ params ["_logic"]; +if !(local _logic) exitWith {}; + private _object = attachedTo _logic; if (isNull _object) then { - [LSTRING(NoObjectSelected)] call EFUNC(common,displayTextStructured); + [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); } else { - _object enableSimulationGlobal !(simulationEnabled _object); + [QEGVAR(common,enableSimulationGlobal), [_object, !(simulationEnabled _object)]] call CBA_fnc_serverEvent; }; deleteVehicle _logic; diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index 972fe8c50c1..a120c27c081 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -624,9 +624,6 @@ Semmi sincs az egér alatt Piazza su una unità ユニットの上に設置 - - - Place on an object Requires an addon that is not present From 6c6bb5888fac2417c0b4061b687d32080a928453 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sun, 13 Nov 2016 15:40:42 +0000 Subject: [PATCH 21/21] Remove unnecessary `disableSerialization` usage --- addons/zeus/functions/fnc_ui_attributePosition.sqf | 2 -- addons/zeus/functions/fnc_ui_attributeRadius.sqf | 2 -- addons/zeus/functions/fnc_ui_defendArea.sqf | 2 -- addons/zeus/functions/fnc_ui_globalSetSkill.sqf | 2 -- addons/zeus/functions/fnc_ui_groupSide.sqf | 2 -- addons/zeus/functions/fnc_ui_patrolArea.sqf | 2 -- addons/zeus/functions/fnc_ui_searchArea.sqf | 2 -- addons/zeus/functions/fnc_ui_teleportPlayers.sqf | 2 -- 8 files changed, 16 deletions(-) diff --git a/addons/zeus/functions/fnc_ui_attributePosition.sqf b/addons/zeus/functions/fnc_ui_attributePosition.sqf index 7632eafbdb0..d6ae581ae48 100644 --- a/addons/zeus/functions/fnc_ui_attributePosition.sqf +++ b/addons/zeus/functions/fnc_ui_attributePosition.sqf @@ -13,8 +13,6 @@ #include "script_component.hpp" -disableSerialization; - //Generic Init: params ["_control"]; private _display = ctrlParent _control; diff --git a/addons/zeus/functions/fnc_ui_attributeRadius.sqf b/addons/zeus/functions/fnc_ui_attributeRadius.sqf index e5263dd36f6..7330d1b170b 100644 --- a/addons/zeus/functions/fnc_ui_attributeRadius.sqf +++ b/addons/zeus/functions/fnc_ui_attributeRadius.sqf @@ -13,8 +13,6 @@ #include "script_component.hpp" -disableSerialization; - //Generic Init: params ["_control"]; private _display = ctrlParent _control; diff --git a/addons/zeus/functions/fnc_ui_defendArea.sqf b/addons/zeus/functions/fnc_ui_defendArea.sqf index e6b2eaf9bff..492f74cf481 100644 --- a/addons/zeus/functions/fnc_ui_defendArea.sqf +++ b/addons/zeus/functions/fnc_ui_defendArea.sqf @@ -13,8 +13,6 @@ #include "script_component.hpp" -disableSerialization; - //Generic Init: params ["_control"]; private _display = ctrlParent _control; diff --git a/addons/zeus/functions/fnc_ui_globalSetSkill.sqf b/addons/zeus/functions/fnc_ui_globalSetSkill.sqf index 1b3e351ad16..68ffc950334 100644 --- a/addons/zeus/functions/fnc_ui_globalSetSkill.sqf +++ b/addons/zeus/functions/fnc_ui_globalSetSkill.sqf @@ -13,8 +13,6 @@ #include "script_component.hpp" -disableSerialization; - params ["_control"]; TRACE_1("params",_control); diff --git a/addons/zeus/functions/fnc_ui_groupSide.sqf b/addons/zeus/functions/fnc_ui_groupSide.sqf index 9ab818674d9..46418a71fc4 100644 --- a/addons/zeus/functions/fnc_ui_groupSide.sqf +++ b/addons/zeus/functions/fnc_ui_groupSide.sqf @@ -14,8 +14,6 @@ #include "script_component.hpp" #define IDCs [31201,31200,31202,31203] -disableSerialization; - params ["_control"]; //Generic Init: diff --git a/addons/zeus/functions/fnc_ui_patrolArea.sqf b/addons/zeus/functions/fnc_ui_patrolArea.sqf index 2a2d9bcd8ee..9db2df9773c 100644 --- a/addons/zeus/functions/fnc_ui_patrolArea.sqf +++ b/addons/zeus/functions/fnc_ui_patrolArea.sqf @@ -13,8 +13,6 @@ #include "script_component.hpp" -disableSerialization; - //Generic Init: params ["_control"]; private _display = ctrlParent _control; diff --git a/addons/zeus/functions/fnc_ui_searchArea.sqf b/addons/zeus/functions/fnc_ui_searchArea.sqf index 9f4d4ebf678..d30af4e234d 100644 --- a/addons/zeus/functions/fnc_ui_searchArea.sqf +++ b/addons/zeus/functions/fnc_ui_searchArea.sqf @@ -13,8 +13,6 @@ #include "script_component.hpp" -disableSerialization; - //Generic Init: params ["_control"]; private _display = ctrlParent _control; diff --git a/addons/zeus/functions/fnc_ui_teleportPlayers.sqf b/addons/zeus/functions/fnc_ui_teleportPlayers.sqf index 402a2b1dfb3..cd5fd82d8da 100644 --- a/addons/zeus/functions/fnc_ui_teleportPlayers.sqf +++ b/addons/zeus/functions/fnc_ui_teleportPlayers.sqf @@ -13,8 +13,6 @@ #include "script_component.hpp" -disableSerialization; - params ["_control"]; //Generic Init: