diff --git a/README.md b/README.md index ed1c1061a..4780ad7ec 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@

- + +

- Zeus Enhanced Version + Zeus Enhanced Version Zeus Enhanced Issues diff --git a/VERSION b/VERSION index dcc5f763b..332200146 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.13.0.32 +1.14.0.34 diff --git a/addons/attributes/CfgWaypointTypes.hpp b/addons/ai/CfgWaypointTypes.hpp similarity index 72% rename from addons/attributes/CfgWaypointTypes.hpp rename to addons/ai/CfgWaypointTypes.hpp index b2bbd667b..8bb68949f 100644 --- a/addons/attributes/CfgWaypointTypes.hpp +++ b/addons/ai/CfgWaypointTypes.hpp @@ -34,7 +34,7 @@ class ZEN_WaypointTypes { class Land { displayName = "$STR_A3_CfgWaypoints_Land"; type = "SCRIPTED"; - script = QPATHTOEF(ai,functions\fnc_waypointLand.sqf); + script = QPATHTOF(functions\fnc_waypointLand.sqf); }; class Hook { displayName = "$STR_ac_hook"; @@ -54,19 +54,13 @@ class ZEN_WaypointTypes { script = "\a3\functions_f_orange\waypoints\fn_wpDemine.sqf"; }; class Paradrop { - displayName = ECSTRING(ai,Paradrop); + displayName = CSTRING(Paradrop); type = "SCRIPTED"; - script = QPATHTOEF(ai,functions\fnc_waypointParadrop.sqf); - }; - class Fastrope { - displayName = ECSTRING(ai,Fastrope); - type = "SCRIPTED"; - script = QPATHTOEF(ai,functions\fnc_waypointFastrope.sqf); - condition = QUOTE(isClass (configFile >> 'CfgPatches' >> 'ace_fastroping')); + script = QPATHTOF(functions\fnc_waypointParadrop.sqf); }; class SearchBuilding { - displayName = ECSTRING(ai,SearchBuilding); + displayName = CSTRING(SearchBuilding); type = "SCRIPTED"; - script = QPATHTOEF(ai,functions\fnc_waypointSearchBuilding.sqf); + script = QPATHTOF(functions\fnc_waypointSearchBuilding.sqf); }; }; diff --git a/addons/ai/config.cpp b/addons/ai/config.cpp index b1073d100..7e77149c4 100644 --- a/addons/ai/config.cpp +++ b/addons/ai/config.cpp @@ -17,3 +17,4 @@ class CfgPatches { PRELOAD_ADDONS; #include "CfgEventHandlers.hpp" +#include "CfgWaypointTypes.hpp" diff --git a/addons/ai/functions/fnc_unGarrison.sqf b/addons/ai/functions/fnc_unGarrison.sqf index 184341f08..0cfebe46a 100644 --- a/addons/ai/functions/fnc_unGarrison.sqf +++ b/addons/ai/functions/fnc_unGarrison.sqf @@ -33,7 +33,7 @@ group _unit enableAttack true; }; - _unit setVariable [QGVAR(garrisonned), false, true]; + _unit setVariable [QGVAR(garrisoned), false, true]; // End fix for rotating garrisoned units _unit doWatch objNull; diff --git a/addons/ai/stringtable.xml b/addons/ai/stringtable.xml index afd535f40..030058767 100644 --- a/addons/ai/stringtable.xml +++ b/addons/ai/stringtable.xml @@ -12,20 +12,6 @@ 降落 Atterrare - - Fastrope - Спуск по тросу - Corde lisse - Schnelles Abseilen - Zjazd na linach - Cabo rápido - ファストロープ - 패스트로프 - Rapel Rapido - 快速索降 - 快速索降 - Discesa veloce - Paradrop Десант diff --git a/addons/area_markers/CfgContext.hpp b/addons/area_markers/CfgContext.hpp deleted file mode 100644 index b0e50bb1f..000000000 --- a/addons/area_markers/CfgContext.hpp +++ /dev/null @@ -1,9 +0,0 @@ -class EGVAR(context_menu,actions) { - class ADDON { - displayName = CSTRING(CreateAreaMarker); - icon = ICON_MARKERS; - condition = QUOTE(visibleMap); - statement = QUOTE([ARR_2(QQGVAR(createMarker),[_position])] call CBA_fnc_serverEvent); - priority = 100; - }; -}; diff --git a/addons/area_markers/CfgVehicles.hpp b/addons/area_markers/CfgVehicles.hpp deleted file mode 100644 index ed27bd842..000000000 --- a/addons/area_markers/CfgVehicles.hpp +++ /dev/null @@ -1,8 +0,0 @@ -class CfgVehicles { - class EGVAR(modules,moduleBase); - class GVAR(module): EGVAR(modules,moduleBase) { - displayName = CSTRING(CreateAreaMarker); - function = QFUNC(module); - icon = ICON_MARKERS; - }; -}; diff --git a/addons/area_markers/XEH_PREP.hpp b/addons/area_markers/XEH_PREP.hpp index 29e6ca6ef..764cb9539 100644 --- a/addons/area_markers/XEH_PREP.hpp +++ b/addons/area_markers/XEH_PREP.hpp @@ -5,7 +5,6 @@ PREP(createMarker); PREP(deleteIcon); PREP(initDisplayCurator); PREP(isEditable); -PREP(module); PREP(onDraw); PREP(onKeyDown); PREP(onMapToggled); diff --git a/addons/area_markers/XEH_postInit.sqf b/addons/area_markers/XEH_postInit.sqf index cbffcda1f..cbee9c982 100644 --- a/addons/area_markers/XEH_postInit.sqf +++ b/addons/area_markers/XEH_postInit.sqf @@ -16,9 +16,4 @@ if (hasInterface) then { addMissionEventHandler ["MarkerCreated", {call FUNC(onMarkerCreated)}]; addMissionEventHandler ["MarkerDeleted", {call FUNC(onMarkerDeleted)}]; addMissionEventHandler ["MarkerUpdated", {call FUNC(onMarkerUpdated)}]; - - // Manually trigger event for 3DEN placed and already existent (JIP) markers - { - _x call FUNC(onMarkerCreated); - } forEach allMapMarkers; }; diff --git a/addons/area_markers/XEH_preInit.sqf b/addons/area_markers/XEH_preInit.sqf index 469798001..c95627a23 100644 --- a/addons/area_markers/XEH_preInit.sqf +++ b/addons/area_markers/XEH_preInit.sqf @@ -6,6 +6,8 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; +#include "initSettings.sqf" + if (isServer) then { // Unique ID for creating markers GVAR(nextID) = 0; diff --git a/addons/area_markers/config.cpp b/addons/area_markers/config.cpp index f4536c88a..e36509081 100644 --- a/addons/area_markers/config.cpp +++ b/addons/area_markers/config.cpp @@ -3,12 +3,10 @@ class CfgPatches { class ADDON { name = COMPONENT_NAME; - units[] = { - QGVAR(module) - }; + units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"zen_modules"}; + requiredAddons[] = {"zen_common"}; author = ECSTRING(main,Author); authors[] = {"mharis001"}; url = ECSTRING(main,URL); @@ -19,6 +17,4 @@ class CfgPatches { PRELOAD_ADDONS; #include "CfgEventHandlers.hpp" -#include "CfgVehicles.hpp" -#include "CfgContext.hpp" #include "gui.hpp" diff --git a/addons/area_markers/functions/fnc_createMarker.sqf b/addons/area_markers/functions/fnc_createMarker.sqf index 98405a462..5b61293ef 100644 --- a/addons/area_markers/functions/fnc_createMarker.sqf +++ b/addons/area_markers/functions/fnc_createMarker.sqf @@ -6,20 +6,22 @@ * * Arguments: * 0: Position + * 1: Shape (default: "RECTANGLE") + * - Should be either "ELLIPSE" or "RECTANGLE". * * Return Value: * None * * Example: - * [[0, 0, 0]] call zen_area_markers_fnc_createMarker + * [[0, 0, 0], "RECTANGLE"] call zen_area_markers_fnc_createMarker * * Public: No */ -params ["_position"]; +params ["_position", ["_shape", "RECTANGLE"]]; private _marker = createMarker [format [QGVAR(%1), GVAR(nextID)], _position]; -_marker setMarkerShape "RECTANGLE"; +_marker setMarkerShape _shape; _marker setMarkerSize [50, 50]; GVAR(nextID) = GVAR(nextID) + 1; diff --git a/addons/area_markers/functions/fnc_deleteIcon.sqf b/addons/area_markers/functions/fnc_deleteIcon.sqf index de2c4cf27..634c32f42 100644 --- a/addons/area_markers/functions/fnc_deleteIcon.sqf +++ b/addons/area_markers/functions/fnc_deleteIcon.sqf @@ -18,6 +18,5 @@ params ["_marker"]; if (_marker in GVAR(icons)) then { - ctrlDelete (GVAR(icons) get _marker); - GVAR(icons) deleteAt _marker; + ctrlDelete (GVAR(icons) deleteAt _marker); }; diff --git a/addons/area_markers/functions/fnc_isEditable.sqf b/addons/area_markers/functions/fnc_isEditable.sqf index 426cd645d..cdb722de5 100644 --- a/addons/area_markers/functions/fnc_isEditable.sqf +++ b/addons/area_markers/functions/fnc_isEditable.sqf @@ -17,4 +17,6 @@ params ["_marker"]; -markerShape _marker in ["RECTANGLE", "ELLIPSE"] && {GVAR(blacklist) findIf {_x in _marker} == -1} +markerShape _marker in ["RECTANGLE", "ELLIPSE"] +&& {GVAR(blacklist) findIf {_x in _marker} == -1} +&& {GVAR(editableMarkers) == EDITABLE_MARKERS_ALL || {QUOTE(ADDON) in _marker}} diff --git a/addons/area_markers/functions/fnc_module.sqf b/addons/area_markers/functions/fnc_module.sqf deleted file mode 100644 index 382544d79..000000000 --- a/addons/area_markers/functions/fnc_module.sqf +++ /dev/null @@ -1,28 +0,0 @@ -#include "script_component.hpp" -/* - * Author: mharis001 - * Zeus module function to create an area marker. - * - * Arguments: - * 0: Logic - * - * Return Value: - * None - * - * Example: - * [LOGIC] call zen_area_markers_fnc_module - * - * Public: No - */ - -params ["_logic"]; - -deleteVehicle _logic; - -if (!visibleMap) exitWith { - [LSTRING(PlaceOnMap)] call EFUNC(common,showMessage); -}; - -private _ctrlMap = findDisplay IDD_RSCDISPLAYCURATOR displayCtrl IDC_RSCDISPLAYCURATOR_MAINMAP; -private _position = _ctrlMap ctrlMapScreenToWorld getMousePosition; -[QGVAR(createMarker), [_position]] call CBA_fnc_serverEvent; diff --git a/addons/area_markers/gui.hpp b/addons/area_markers/gui.hpp index db12c0f29..5e87c99b6 100644 --- a/addons/area_markers/gui.hpp +++ b/addons/area_markers/gui.hpp @@ -182,8 +182,8 @@ class GVAR(configure): RscControlsGroupNoScrollbars { rows = 1; columns = 2; strings[] = { - "\a3\3DEN\Data\Attributes\Shape\rectangle_ca.paa", - "\a3\3DEN\Data\Attributes\Shape\ellipse_ca.paa" + ICON_RECTANGLE, + ICON_ELLIPSE }; tooltips[] = { "$STR_3den_attributes_shapetrigger_rectangle", diff --git a/addons/area_markers/initSettings.sqf b/addons/area_markers/initSettings.sqf new file mode 100644 index 000000000..c24b2991d --- /dev/null +++ b/addons/area_markers/initSettings.sqf @@ -0,0 +1,25 @@ +[ + QGVAR(editableMarkers), + "LIST", + [LSTRING(EditableMarkers), LSTRING(EditableMarkers_Description)], + [ELSTRING(main,DisplayName), LSTRING(DisplayName)], + [ + [ + EDITABLE_MARKERS_ALL, + EDITABLE_MARKERS_ONLY_ZEUS_CREATED + ], + [ + [LSTRING(AllMarkers), LSTRING(AllMarkers_Description)], + [LSTRING(OnlyZeusCreated), LSTRING(OnlyZeusCreated_Description)] + ], + 0 + ], + true, + { + // Manually trigger event to update editability of all markers based on the setting + // Also handles 3DEN placed and already existent (JIP) markers + { + _x call FUNC(onMarkerUpdated); + } forEach allMapMarkers; + } +] call CBA_fnc_addSetting; diff --git a/addons/area_markers/script_component.hpp b/addons/area_markers/script_component.hpp index 868b15893..898acd973 100644 --- a/addons/area_markers/script_component.hpp +++ b/addons/area_markers/script_component.hpp @@ -26,15 +26,13 @@ #define POS_H(N) ((N) * GUI_GRID_H) #define ICON_SIZE 0.6 - -#define ICON_WIDTH POS_W(ICON_SIZE) +#define ICON_WIDTH POS_W(ICON_SIZE) #define ICON_HEIGHT POS_H(ICON_SIZE) #define OFFSET_X POS_W(ICON_SIZE / 2) #define OFFSET_Y POS_H(ICON_SIZE / 2) #define ICON_CENTER "\a3\3den\data\cfg3den\marker\texturecenter_ca.paa" -#define ICON_MARKERS "\a3\3den\data\displays\display3den\panelright\submode_marker_area_ca.paa" #define ICON_ELLIPSE "\a3\3DEN\Data\Attributes\Shape\ellipse_ca.paa" #define ICON_RECTANGLE "\a3\3DEN\Data\Attributes\Shape\rectangle_ca.paa" @@ -56,3 +54,6 @@ #define IDC_CONFIGURE_CANCEL 42881 #define IDCS_CONFIGURE_EDIT_BOXES [IDC_CONFIGURE_SIZE_A, IDC_CONFIGURE_SIZE_B, IDC_CONFIGURE_ROTATION_EDIT, IDC_CONFIGURE_ALPHA_EDIT] + +#define EDITABLE_MARKERS_ALL 0 +#define EDITABLE_MARKERS_ONLY_ZEUS_CREATED 1 diff --git a/addons/area_markers/stringtable.xml b/addons/area_markers/stringtable.xml index ed733031b..49661f47e 100644 --- a/addons/area_markers/stringtable.xml +++ b/addons/area_markers/stringtable.xml @@ -1,19 +1,26 @@ - - Create Area Marker - Создать Маркер Области - Créer un marqueur de zone - Bereichsmarkierungen erstellen - Crea marcatori di area - Vytvořit značku oblasti - Stwórz Marker Obszarowy - Criar marcador de área - 範囲マーカーを作成 - 영역 표시기 생성 - 创建区域标记 - 創建區域標記 + + Area Markers + + + Editable Markers + + + Controls which area markers are editable through Zeus. + + + All Markers + + + All area markers (including those placed in 3DEN or created through script) are editable unless manually blacklisted. + + + Only Zeus Created + + + Only area markers created through Zeus are editable. EDIT AREA MARKER @@ -29,19 +36,5 @@ 编辑区域标记 編輯區域標記 - - Place On Map - Разместить На Карте - Placer sur la carte - Auf Karte platzieren - Posiziona sulla mappa - Umístit na mapu - Zaznacz Na Mapie - Coloque no mapa - マップ上に設置 - 지도에 배치 - 标记在地图上 - 標記在地圖上 - diff --git a/addons/attributes/XEH_preInit.sqf b/addons/attributes/XEH_preInit.sqf index 0bd28810d..abd6dae3f 100644 --- a/addons/attributes/XEH_preInit.sqf +++ b/addons/attributes/XEH_preInit.sqf @@ -23,5 +23,6 @@ GVAR(previousMarkerColors) = [] call CBA_fnc_createNamespace; // Initialize the core/default attributes #include "initAttributes.sqf" +#include "initSettings.sqf" ADDON = true; diff --git a/addons/attributes/config.cpp b/addons/attributes/config.cpp index da940a041..8580be3e8 100644 --- a/addons/attributes/config.cpp +++ b/addons/attributes/config.cpp @@ -19,5 +19,4 @@ PRELOAD_ADDONS; #include "CfgEventHandlers.hpp" #include "CfgFunctions.hpp" #include "CfgVehicles.hpp" -#include "CfgWaypointTypes.hpp" #include "gui.hpp" diff --git a/addons/attributes/initAttributes.sqf b/addons/attributes/initAttributes.sqf index af31dffb6..d74dfd1f8 100644 --- a/addons/attributes/initAttributes.sqf +++ b/addons/attributes/initAttributes.sqf @@ -6,7 +6,7 @@ "Object", "STR_A3_Arsenal", {_entity call EFUNC(common,openArsenal)}, - {alive _entity && {_entity isKindOf "CAManBase"}}, + {GVAR(enableArsenal) && {alive _entity} && {_entity isKindOf "CAManBase"}}, true ] call FUNC(addButton); @@ -23,7 +23,7 @@ }; }, {name _entity}, - {alive _entity && {_entity isKindOf "CAManBase"}} + {GVAR(enableName) && {alive _entity} && {_entity isKindOf "CAManBase"}} ] call FUNC(addAttribute); [ @@ -37,7 +37,7 @@ } forEach call EFUNC(common,getSelectedUnits); }, {skill _entity}, - {alive _entity && {!isNull group _entity && {side _entity != sideLogic}}} + {GVAR(enableSkill) && {alive _entity} && {!isNull group _entity && {side _entity != sideLogic}}} ] call FUNC(addAttribute); [ @@ -52,7 +52,7 @@ } forEach SELECTED_OBJECTS; }, {1 - damage _entity}, - {alive _entity} + {GVAR(enableHealth) && {alive _entity}} ] call FUNC(addAttribute); [ @@ -66,7 +66,7 @@ } forEach call EFUNC(common,getSelectedVehicles); }, {fuel _entity}, - {alive _entity && {getNumber (configOf _entity >> "fuelCapacity") > 0}} + {GVAR(enableFuel) && {alive _entity} && {getNumber (configOf _entity >> "fuelCapacity") > 0}} ] call FUNC(addAttribute); [ @@ -80,7 +80,7 @@ } forEach call EFUNC(common,getSelectedVehicles); }, {_entity call EFUNC(common,getVehicleAmmo)}, - {alive _entity && {_entity call EFUNC(common,getVehicleAmmo) != -1}} + {GVAR(enableAmmo) && {alive _entity} && {_entity call EFUNC(common,getVehicleAmmo) != -1}} ] call FUNC(addAttribute); [ @@ -102,7 +102,7 @@ } forEach call EFUNC(common,getSelectedUnits); }, {rank _entity}, - {alive _entity && {_entity isKindOf "CAManBase"}} + {GVAR(enableRank) && {alive _entity && {_entity isKindOf "CAManBase"}}} ] call FUNC(addAttribute); [ @@ -121,7 +121,7 @@ } forEach call EFUNC(common,getSelectedUnits); }, {toUpper unitPos _entity}, - {alive _entity && {_entity isKindOf "CAManBase"}} + {GVAR(enableStance) && {alive _entity} && {_entity isKindOf "CAManBase"}} ] call FUNC(addAttribute); [ @@ -140,7 +140,7 @@ } forEach call EFUNC(common,getSelectedVehicles); }, {locked _entity}, - {alive _entity && {_entity isKindOf "LandVehicle" || {_entity isKindOf "Air"} || {_entity isKindOf "Ship"}}} + {GVAR(enableVehicleLock) && {alive _entity} && {_entity isKindOf "LandVehicle" || {_entity isKindOf "Air"} || {_entity isKindOf "Ship"}}} ] call FUNC(addAttribute); [ @@ -157,7 +157,7 @@ } forEach call EFUNC(common,getSelectedVehicles); }, {isEngineOn _entity}, - {alive _entity && {getNumber (configOf _entity >> "fuelCapacity") > 0} && {_entity isKindOf "LandVehicle" || {_entity isKindOf "Air"} || {_entity isKindOf "Ship"}}} + {GVAR(enableEngine) && {alive _entity} && {getNumber (configOf _entity >> "fuelCapacity") > 0} && {_entity isKindOf "LandVehicle" || {_entity isKindOf "Air"} || {_entity isKindOf "Ship"}}} ] call FUNC(addAttribute); [ @@ -182,7 +182,7 @@ } forEach call EFUNC(common,getSelectedVehicles); }, {isLightOn _entity}, - {alive _entity && {"true" configClasses (configOf _entity >> "Reflectors") isNotEqualTo []} && {_entity isKindOf "LandVehicle" || {_entity isKindOf "Air"} || {_entity isKindOf "Ship"}}} + {GVAR(enableLights) && {alive _entity} && {"true" configClasses (configOf _entity >> "Reflectors") isNotEqualTo []} && {_entity isKindOf "LandVehicle" || {_entity isKindOf "Air"} || {_entity isKindOf "Ship"}}} ] call FUNC(addAttribute); [ @@ -195,7 +195,7 @@ [_buildings, _value] call EFUNC(building_markers,set); }, {_entity getVariable [QEGVAR(building_markers,marker), ""] != ""}, - {_entity isKindOf "Building"} + {GVAR(enableBuildingMarker) && {_entity isKindOf "Building"}} ] call FUNC(addAttribute); [ @@ -207,7 +207,7 @@ [QEGVAR(common,setPlateNumber), [_entity, _value], _entity] call CBA_fnc_targetEvent; }, {getPlateNumber _entity}, - {alive _entity && {getText (configOf _entity >> "PlateInfos" >> "name") in selectionNames _entity}} + {GVAR(enablePlateNumber) && {alive _entity} && {getText (configOf _entity >> "PlateInfos" >> "name") in selectionNames _entity}} ] call FUNC(addAttribute); [ @@ -249,7 +249,7 @@ { _entity getVariable [QGVAR(respawnPos), []] param [0, sideEmpty] }, - {alive _entity && {canMove _entity} && {_entity isKindOf "AllVehicles"} && {!(_entity isKindOf "Animal")}} + {GVAR(enableRespawnPosition) && {alive _entity} && {canMove _entity} && {_entity isKindOf "AllVehicles"} && {!(_entity isKindOf "Animal")}} ] call FUNC(addAttribute); [ @@ -298,7 +298,7 @@ _respawnID }, - {_entity isKindOf "LandVehicle" || {_entity isKindOf "Air"} || {_entity isKindOf "Ship"}} + {GVAR(enableRespawnVehicle) && {_entity isKindOf "LandVehicle" || {_entity isKindOf "Air"} || {_entity isKindOf "Ship"}}} ] call FUNC(addAttribute); [ @@ -322,7 +322,8 @@ }, { [isDamageAllowed _entity, simulationEnabled _entity, !isObjectHidden _entity] - } + }, + {GVAR(enableStates)} ] call FUNC(addAttribute); [ @@ -348,7 +349,7 @@ }; }, {""}, - {IS_ADMIN_LOGGED || {!GETMVAR(ZEN_disableCodeExecution,false)}} + {GVAR(enableExecute) && {IS_ADMIN_LOGGED || {!GETMVAR(ZEN_disableCodeExecution,false)}}} ] call FUNC(addAttribute); // - Group -------------------------------------------------------------------- @@ -361,7 +362,8 @@ QGVAR(edit), nil, {_entity setGroupIdGlobal [_value]}, - {groupID _entity} + {groupID _entity}, + {GVAR(enableGroupID)} ] call FUNC(addAttribute); [ @@ -376,7 +378,8 @@ } forEach units _x; } forEach SELECTED_GROUPS; }, - {skill leader _entity} + {skill leader _entity}, + {GVAR(enableGroupSkill)} ] call FUNC(addAttribute); [ @@ -399,7 +402,8 @@ [QEGVAR(common,setFormation), [_x, _value], _x] call CBA_fnc_targetEvent; } forEach SELECTED_GROUPS; }, - {formation _entity} + {formation _entity}, + {GVAR(enableGroupFormation)} ] call FUNC(addAttribute); [ @@ -418,7 +422,8 @@ [QEGVAR(common,setBehaviour), [_x, _value], _x] call CBA_fnc_targetEvent; } forEach SELECTED_GROUPS; }, - {behaviour leader _entity} + {behaviour leader _entity}, + {GVAR(enableGroupBehaviour)} ] call FUNC(addAttribute); [ @@ -437,7 +442,8 @@ [QEGVAR(common,setCombatMode), [_x, _value], _x] call CBA_fnc_targetEvent; } forEach SELECTED_GROUPS; }, - {combatMode _entity} + {combatMode _entity}, + {GVAR(enableGroupCombatMode)} ] call FUNC(addAttribute); [ @@ -454,7 +460,8 @@ [QEGVAR(common,setSpeedMode), [_x, _value], _x] call CBA_fnc_targetEvent; } forEach SELECTED_GROUPS; }, - {speedMode _entity} + {speedMode _entity}, + {GVAR(enableGroupSpeed)} ] call FUNC(addAttribute); [ @@ -474,7 +481,8 @@ } forEach units _x; } forEach SELECTED_GROUPS; }, - {toUpper unitPos leader _entity} + {toUpper unitPos leader _entity}, + {GVAR(enableGroupStance)} ] call FUNC(addAttribute); [ @@ -500,7 +508,7 @@ }; }, {""}, - {IS_ADMIN_LOGGED || {!GETMVAR(ZEN_disableCodeExecution,false)}} + {GVAR(enableGroupExecute) && {IS_ADMIN_LOGGED || {!GETMVAR(ZEN_disableCodeExecution,false)}}} ] call FUNC(addAttribute); // - Waypoint ----------------------------------------------------------------- @@ -518,7 +526,9 @@ _x setWaypointType _type; if (_type == "SCRIPTED") then {_x setWaypointScript _script}; } forEach SELECTED_WAYPOINTS; - } + }, + nil, + {GVAR(enableWaypointType)} ] call FUNC(addAttribute); [ @@ -534,7 +544,7 @@ } forEach SELECTED_WAYPOINTS; }, {waypointLoiterType _entity}, - {waypointType _entity == "LOITER"} + {GVAR(enableWaypointLoiterDirection) && {waypointType _entity == "LOITER"}} ] call FUNC(addAttribute); [ @@ -551,7 +561,7 @@ } forEach SELECTED_WAYPOINTS; }, {str waypointLoiterRadius _entity}, - {waypointType _entity == "LOITER"} + {GVAR(enableWaypointLoiterRadius) && {waypointType _entity == "LOITER"}} ] call FUNC(addAttribute); [ @@ -568,7 +578,7 @@ } forEach SELECTED_WAYPOINTS; }, {str waypointLoiterAltitude _entity}, - {waypointType _entity == "LOITER"} + {GVAR(enableWaypointLoiterAltitude) && {waypointType _entity == "LOITER"}} ] call FUNC(addAttribute); [ @@ -577,7 +587,8 @@ QGVAR(slider), [0, 1800, 15, false, 0], {_entity setWaypointTimeout [_value, _value, _value]}, - {random waypointTimeout _entity} + {random waypointTimeout _entity}, + {GVAR(enableWaypointTimeout)} ] call FUNC(addAttribute); [ @@ -607,7 +618,8 @@ [QEGVAR(common,setWaypointFormation), [_x, _value]] call CBA_fnc_serverEvent; } forEach SELECTED_WAYPOINTS; }, - {waypointFormation _entity} + {waypointFormation _entity}, + {GVAR(enableWaypointFormation)} ] call FUNC(addAttribute); [ @@ -633,7 +645,8 @@ [QEGVAR(common,setWaypointBehaviour), [_x, _value]] call CBA_fnc_serverEvent; } forEach SELECTED_WAYPOINTS; }, - {waypointBehaviour _entity} + {waypointBehaviour _entity}, + {GVAR(enableWaypointBehaviour)} ] call FUNC(addAttribute); [ @@ -659,7 +672,8 @@ [QEGVAR(common,setWaypointCombatMode), [_x, _value]] call CBA_fnc_serverEvent; } forEach SELECTED_WAYPOINTS; }, - {waypointCombatMode _entity} + {waypointCombatMode _entity}, + {GVAR(enableWaypointCombatMode)} ] call FUNC(addAttribute); [ @@ -683,7 +697,8 @@ [QEGVAR(common,setWaypointSpeed), [_x, _value]] call CBA_fnc_serverEvent; } forEach SELECTED_WAYPOINTS; }, - {waypointSpeed _entity} + {waypointSpeed _entity}, + {GVAR(enableWaypointSpeed)} ] call FUNC(addAttribute); // - Marker ------------------------------------------------------------------- @@ -696,7 +711,8 @@ QGVAR(edit), nil, {_entity setMarkerText _value}, - {markerText _entity} + {markerText _entity}, + {GVAR(enableMarkerText)} ] call FUNC(addAttribute); [ @@ -714,7 +730,8 @@ // Set this color to be applied to new markers of this type GVAR(previousMarkerColors) setVariable [markerType _entity, _value]; }, - {markerColor _entity} + {markerColor _entity}, + {GVAR(enableMarkerColor)} ] call FUNC(addAttribute); [ @@ -723,7 +740,8 @@ QGVAR(slider), [0, 1, 0.1, true], {_entity setMarkerAlpha _value}, - {markerAlpha _entity} + {markerAlpha _entity}, + {GVAR(enableMarkerAlpha)} ] call FUNC(addAttribute); // - Skills ------------------------------------------------------------------- @@ -734,7 +752,7 @@ "Object", LSTRING(Skills), {[_entity, "Skills"] call FUNC(open)}, - {alive _entity && {_entity isKindOf "CAManBase"}} + {GVAR(enableSkills) && {alive _entity} && {_entity isKindOf "CAManBase"}} ] call FUNC(addButton); [ @@ -862,7 +880,7 @@ "Object", LSTRING(Abilities), {[_entity, "Abilities"] call FUNC(open)}, - {alive _entity && {_entity isKindOf "CAManBase"}} + {GVAR(enableAbilities) && {alive _entity} && {_entity isKindOf "CAManBase"}} ] call FUNC(addButton); [ @@ -904,7 +922,7 @@ "Object", LSTRING(Traits), {[_entity, "Traits"] call FUNC(open)}, - {alive _entity && {_entity isKindOf "CAManBase"}} + {GVAR(enableTraits) && {alive _entity} && {_entity isKindOf "CAManBase"}} ] call FUNC(addButton); if (isClass (configFile >> "CfgPatches" >> "ace_medical")) then { @@ -999,7 +1017,7 @@ if (isClass (configFile >> "CfgPatches" >> "ace_explosives")) then { "Object", LSTRING(Sensors), {[_entity, "Sensors"] call FUNC(open)}, - {alive _entity && {_entity isKindOf "LandVehicle" || {_entity isKindOf "Air"} || {_entity isKindOf "Ship"}}} + {GVAR(enableSensors) && {alive _entity} && {_entity isKindOf "LandVehicle" || {_entity isKindOf "Air"} || {_entity isKindOf "Ship"}}} ] call FUNC(addButton); [ @@ -1065,7 +1083,8 @@ if (isClass (configFile >> "CfgPatches" >> "ace_explosives")) then { [ "Group", "STR_Eval_TypeSide", - {[_entity, "Side"] call FUNC(open)} + {[_entity, "Side"] call FUNC(open)}, + {GVAR(enableGroupSide)} ] call FUNC(addButton); [ diff --git a/addons/attributes/initSettings.sqf b/addons/attributes/initSettings.sqf new file mode 100644 index 000000000..960270a9f --- /dev/null +++ b/addons/attributes/initSettings.sqf @@ -0,0 +1,385 @@ +// - Object ------------------------------------------------------------------- + +[ + QGVAR(enableName), + "CHECKBOX", + "STR_3DEN_Object_Attribute_UnitName_displayName", + [LSTRING(DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableSkill), + "CHECKBOX", + "STR_3DEN_Object_Attribute_Skill_displayName", + [LSTRING(DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableHealth), + "CHECKBOX", + "STR_3DEN_Object_Attribute_Health_displayName", + [LSTRING(DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableFuel), + "CHECKBOX", + "STR_3DEN_Object_Attribute_Fuel_displayName", + [LSTRING(DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableAmmo), + "CHECKBOX", + "STR_3DEN_Object_Attribute_Ammo_displayName", + [LSTRING(DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableRank), + "CHECKBOX", + "STR_3DEN_Object_Attribute_Rank_displayName", + [LSTRING(DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableStance), + "CHECKBOX", + "STR_A3_RscAttributeUnitPos_Title", + [LSTRING(DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableVehicleLock), + "CHECKBOX", + "STR_3den_object_attribute_lock_displayname", + [LSTRING(DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableEngine), + "CHECKBOX", + LSTRING(Engine), + [LSTRING(DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableLights), + "CHECKBOX", + LSTRING(Lights), + [LSTRING(DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableBuildingMarker), + "CHECKBOX", + ELSTRING(building_markers,BuildingMarker), + [LSTRING(DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enablePlateNumber), + "CHECKBOX", + LSTRING(PlateNumber), + [LSTRING(DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableRespawnPosition), + "CHECKBOX", + LSTRING(RespawnPosition), + [LSTRING(DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableRespawnVehicle), + "CHECKBOX", + LSTRING(RespawnVehicle), + [LSTRING(DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableStates), + "CHECKBOX", + LSTRING(States), + [LSTRING(DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableExecute), + "CHECKBOX", + "STR_a3_rscdebugconsole_expressiontext", + [LSTRING(DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableArsenal), + "CHECKBOX", + "STR_A3_Arsenal", + [LSTRING(DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableSkills), + "CHECKBOX", + LSTRING(Skills), + [LSTRING(DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableAbilities), + "CHECKBOX", + LSTRING(Abilities), + [LSTRING(DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableTraits), + "CHECKBOX", + LSTRING(Traits), + [LSTRING(DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableSensors), + "CHECKBOX", + LSTRING(Sensors), + [LSTRING(DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +// - Group -------------------------------------------------------------------- + +[ + QGVAR(enableGroupID), + "CHECKBOX", + "STR_A3_RscAttributeGroupID_Title", + [LSTRING(DisplayName), "str_a3_rscdisplaycurator_modegroups_tooltip"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableGroupSkill), + "CHECKBOX", + "STR_3DEN_Object_Attribute_Skill_displayName", + [LSTRING(DisplayName), "str_a3_rscdisplaycurator_modegroups_tooltip"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableGroupFormation), + "CHECKBOX", + "STR_3DEN_Group_Attribute_Formation_displayName", + [LSTRING(DisplayName), "str_a3_rscdisplaycurator_modegroups_tooltip"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableGroupBehaviour), + "CHECKBOX", + "STR_3DEN_Group_Attribute_Behaviour_displayName", + [LSTRING(DisplayName), "str_a3_rscdisplaycurator_modegroups_tooltip"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableGroupCombatMode), + "CHECKBOX", + "STR_3DEN_Group_Attribute_CombatMode_displayName", + [LSTRING(DisplayName), "str_a3_rscdisplaycurator_modegroups_tooltip"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableGroupSpeed), + "CHECKBOX", + "STR_HC_Menu_Speed", + [LSTRING(DisplayName), "str_a3_rscdisplaycurator_modegroups_tooltip"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableGroupStance), + "CHECKBOX", + "STR_A3_RscAttributeUnitPos_Title", + [LSTRING(DisplayName), "str_a3_rscdisplaycurator_modegroups_tooltip"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableGroupExecute), + "CHECKBOX", + "STR_a3_rscdebugconsole_expressiontext", + [LSTRING(DisplayName), "str_a3_rscdisplaycurator_modegroups_tooltip"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableGroupSide), + "CHECKBOX", + "STR_Eval_TypeSide", + [LSTRING(DisplayName), "str_a3_rscdisplaycurator_modegroups_tooltip"], + true, + false +] call CBA_fnc_addSetting; + +// - Waypoint ----------------------------------------------------------------- + +[ + QGVAR(enableWaypointType), + "CHECKBOX", + "STR_3DEN_Object_Attribute_Type_displayName", + [LSTRING(DisplayName), "STR_3DEN_Waypoint_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableWaypointLoiterDirection), + "CHECKBOX", + "STR_3DEN_Waypoint_Attribute_LoiterDirection_displayname", + [LSTRING(DisplayName), "STR_3DEN_Waypoint_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableWaypointLoiterRadius), + "CHECKBOX", + "STR_3DEN_Waypoint_Attribute_LoiterRadius_displayname", + [LSTRING(DisplayName), "STR_3DEN_Waypoint_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableWaypointLoiterAltitude), + "CHECKBOX", + "STR_3DEN_Waypoint_Attribute_LoiterAltitude_displayname", + [LSTRING(DisplayName), "STR_3DEN_Waypoint_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableWaypointTimeout), + "CHECKBOX", + LSTRING(Timeout), + [LSTRING(DisplayName), "STR_3DEN_Waypoint_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableWaypointFormation), + "CHECKBOX", + "STR_3DEN_Group_Attribute_Formation_displayName", + [LSTRING(DisplayName), "STR_3DEN_Waypoint_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableWaypointBehaviour), + "CHECKBOX", + "STR_3DEN_Group_Attribute_Behaviour_displayName", + [LSTRING(DisplayName), "STR_3DEN_Waypoint_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableWaypointCombatMode), + "CHECKBOX", + "STR_3DEN_Group_Attribute_CombatMode_displayName", + [LSTRING(DisplayName), "STR_3DEN_Waypoint_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableWaypointSpeed), + "CHECKBOX", + "STR_HC_Menu_Speed", + [LSTRING(DisplayName), "STR_3DEN_Waypoint_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +// - Marker ------------------------------------------------------------------- + +[ + QGVAR(enableMarkerText), + "CHECKBOX", + "STR_3DEN_Marker_Attribute_Text_displayName", + [LSTRING(DisplayName), "STR_3DEN_Marker_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableMarkerColor), + "CHECKBOX", + "STR_3DEN_Marker_Attribute_Color_displayName", + [LSTRING(DisplayName), "STR_3DEN_Marker_textPlural"], + true, + false +] call CBA_fnc_addSetting; + +[ + QGVAR(enableMarkerAlpha), + "CHECKBOX", + "STR_3DEN_Marker_Attribute_Alpha_displayName", + [LSTRING(DisplayName), "STR_3DEN_Marker_textPlural"], + true, + false +] call CBA_fnc_addSetting; diff --git a/addons/attributes/stringtable.xml b/addons/attributes/stringtable.xml index ae0ef148d..30b57de13 100644 --- a/addons/attributes/stringtable.xml +++ b/addons/attributes/stringtable.xml @@ -1,6 +1,22 @@ + + Zeus Enhanced - Attributes + Zeus Enhanced - Atributy + Zeus Enhanced - Attribute + Zeus Enhanced - Атрибуты + Zeus Enhanced - Atrybuty + Zeus Enhanced - Attributi + Zeus Enhanced - Atributos + Zeus Enhanced - Attributs + Zeus Enhanced - 屬性 + Zeus Enhanced - 属性 + Zeus Enhanced - 속성 + Zeus Enhanced - Atributos + Zeus Enhanced - 属性 + Zeus Enhanced - Özellikler + Engine Moteur diff --git a/addons/common/XEH_PREP.hpp b/addons/common/XEH_PREP.hpp index 339b180ce..1754d7b7c 100644 --- a/addons/common/XEH_PREP.hpp +++ b/addons/common/XEH_PREP.hpp @@ -11,6 +11,7 @@ PREP(drawHint); PREP(dumpPerformanceCounters); PREP(earthquake); PREP(ejectPassengers); +PREP(execAfterNFrames); PREP(exportMissionSQF); PREP(exportText); PREP(fireArtillery); diff --git a/addons/common/functions/fnc_execAfterNFrames.sqf b/addons/common/functions/fnc_execAfterNFrames.sqf new file mode 100644 index 000000000..84ec61b8e --- /dev/null +++ b/addons/common/functions/fnc_execAfterNFrames.sqf @@ -0,0 +1,30 @@ +#include "script_component.hpp" +/* + * Author: mharis001 + * Executes the given code after the specified number of frames. + * + * Arguments: + * 0: Function + * 1: Arguments (default: []) + * 2: Frames (default: 0) + * + * Return Value: + * None + * + * Example: + * [{hint "Done!"}, [], 5] call zen_common_fnc_execAfterNFrames + * + * Public: No + */ + +if (canSuspend) exitWith { + [FUNC(execAfterNFrames), _this] call CBA_fnc_directCall; +}; + +params [["_function", {}, [{}]], ["_args", []], ["_frames", 0, [0]]]; + +if (_frames > 0) exitWith { + [FUNC(execAfterNFrames), [_function, _args, _frames - 1]] call CBA_fnc_execNextFrame; +}; + +_args call _function; diff --git a/addons/context_actions/CfgContext.hpp b/addons/context_actions/CfgContext.hpp index 892ab9aba..6c0bc798c 100644 --- a/addons/context_actions/CfgContext.hpp +++ b/addons/context_actions/CfgContext.hpp @@ -385,10 +385,14 @@ class EGVAR(context_menu,actions) { class Remove { displayName = ECSTRING(common,Remove); icon = QPATHTOF(ui\remove_ca.paa); - class 10m { + class Selected { + displayName = CSTRING(Selected); + statement = QUOTE([ARR_3(SELECTED_OBJECTS,false,getAssignedCuratorLogic player)] call EFUNC(common,updateEditableObjects)); + icon = QPATHTOF(ui\remove_ca.paa); + }; + class 10m: Selected { displayName = CSTRING(10m); statement = QUOTE([ARR_3(false,_position,_args)] call FUNC(updateEditableObjects)); - icon = QPATHTOF(ui\remove_ca.paa); args = 10; }; class 50m: 10m { diff --git a/addons/context_actions/stringtable.xml b/addons/context_actions/stringtable.xml index 576b09cf7..2625b9495 100644 --- a/addons/context_actions/stringtable.xml +++ b/addons/context_actions/stringtable.xml @@ -67,6 +67,10 @@ 可編輯對象 Oggetti modificabili + + Selected + Auswahl + 10 m 10 m diff --git a/addons/context_menu/functions/fnc_initDisplayCurator.sqf b/addons/context_menu/functions/fnc_initDisplayCurator.sqf index 33509ed18..b54bfab8b 100644 --- a/addons/context_menu/functions/fnc_initDisplayCurator.sqf +++ b/addons/context_menu/functions/fnc_initDisplayCurator.sqf @@ -82,17 +82,13 @@ if (GVAR(enabled) == 1) exitWith { // Clear selected entities if waypoint placement can occur and restore next frame // Using entities tree as an alternative to the lack of a command to set curator selected entities if (_canPlaceWaypoints) then { - private _ctrlEntities = findDisplay IDD_RSCDISPLAYCURATOR displayCtrl IDC_RSCDISPLAYCURATOR_ENTITIES; - private _selection = tvSelection _ctrlEntities; - _ctrlEntities tvSetCurSel [-1]; - [{ - params ["_ctrlEntities", "_selection"]; + params ["_objects", "_groups", "_waypoints", "_markers"]; + + setCuratorSelected (_objects + _groups + _waypoints + _markers); + }, curatorSelected] call CBA_fnc_execNextFrame; - { - _ctrlEntities tvSetSelected [_x, true]; - } forEach _selection; - }, [_ctrlEntities, _selection]] call CBA_fnc_execNextFrame; + setCuratorSelected []; }; }; }; diff --git a/addons/damage/XEH_preInit.sqf b/addons/damage/XEH_preInit.sqf index 07511da51..7b403d030 100644 --- a/addons/damage/XEH_preInit.sqf +++ b/addons/damage/XEH_preInit.sqf @@ -6,6 +6,8 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; +#include "initSettings.sqf" + [QGVAR(setHitPointsDamage), { params ["_vehicle", "_damageValues"]; @@ -21,7 +23,7 @@ PREP_RECOMPILE_END; [_entity] call FUNC(configure); }, { - alive _entity && {_entity isKindOf "LandVehicle" || {_entity isKindOf "Air"} || {_entity isKindOf "Ship"}} + EGVAR(attributes,enableDamage) && {alive _entity} && {_entity isKindOf "LandVehicle" || {_entity isKindOf "Air"} || {_entity isKindOf "Ship"}} } ] call EFUNC(attributes,addButton); diff --git a/addons/damage/initSettings.sqf b/addons/damage/initSettings.sqf new file mode 100644 index 000000000..348cfb0fc --- /dev/null +++ b/addons/damage/initSettings.sqf @@ -0,0 +1,8 @@ +[ + QEGVAR(attributes,enableDamage), + "CHECKBOX", + "STR_A3_NormalDamage1", + [ELSTRING(attributes,DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; diff --git a/addons/editor/RscDisplayCurator.hpp b/addons/editor/RscDisplayCurator.hpp index aa316a18e..cf1188297 100644 --- a/addons/editor/RscDisplayCurator.hpp +++ b/addons/editor/RscDisplayCurator.hpp @@ -69,14 +69,12 @@ class RscDisplayCurator { text = "\a3\3DEN\Data\Displays\Display3DEN\tree_collapse_ca.paa"; tooltip = "$STR_3DEN_ctrlButtonCollapseAll_text"; x = 8.9 * GUI_GRID_W; - onButtonClick = QUOTE(false call FUNC(handleTreeButtons)); }; class ExpandAll: CollapseAll { idc = IDC_EXPAND_ALL; text = QPATHTOF(ui\tree_expand_ca.paa); tooltip = "$STR_3DEN_ctrlButtonExpandAll_text"; x = 9.9 * GUI_GRID_W; - onButtonClick = QUOTE(true call FUNC(handleTreeButtons)); }; class CreateUnitsWest: RscTree { h = safeZoneH - POS_EDGE(8.1,7.1) * GUI_GRID_H; diff --git a/addons/editor/XEH_PREP.hpp b/addons/editor/XEH_PREP.hpp index cd3108f55..6f8b6ec76 100644 --- a/addons/editor/XEH_PREP.hpp +++ b/addons/editor/XEH_PREP.hpp @@ -1,8 +1,9 @@ PREP(addGroupIcons); PREP(addModIcons); PREP(declutterEmptyTree); -PREP(fixSideButtons); +PREP(handleCuratorPinged); PREP(handleKeyDown); +PREP(handleKeyUp); PREP(handleLoad); PREP(handleModeButtons); PREP(handleObjectPlaced); @@ -14,3 +15,4 @@ PREP(handleSideButtons); PREP(handleTreeButtons); PREP(handleUnload); PREP(moveCamToSelection); +PREP(pingCurators); diff --git a/addons/editor/XEH_postInit.sqf b/addons/editor/XEH_postInit.sqf index 1f43f2f44..0ec57338e 100644 --- a/addons/editor/XEH_postInit.sqf +++ b/addons/editor/XEH_postInit.sqf @@ -2,4 +2,5 @@ ["zen_curatorDisplayLoaded", LINKFUNC(handleLoad)] call CBA_fnc_addEventHandler; ["zen_curatorDisplayUnloaded", LINKFUNC(handleUnload)] call CBA_fnc_addEventHandler; -[QGVAR(modeChanged), LINKFUNC(fixSideButtons)] call CBA_fnc_addEventHandler; +[QGVAR(pingCurators), LINKFUNC(pingCurators)] call CBA_fnc_addEventHandler; +[QGVAR(treeButtonClicked), LINKFUNC(handleTreeButtons)] call CBA_fnc_addEventHandler; diff --git a/addons/editor/XEH_preInit.sqf b/addons/editor/XEH_preInit.sqf index 3a9860073..c6583464f 100644 --- a/addons/editor/XEH_preInit.sqf +++ b/addons/editor/XEH_preInit.sqf @@ -16,6 +16,7 @@ GVAR(includeCrew) = true; params ["_logic"]; _logic addEventHandler ["CuratorObjectPlaced", {call FUNC(handleObjectPlaced)}]; + _logic addEventHandler ["CuratorPinged", {call FUNC(handleCuratorPinged)}]; }, true, [], true] call CBA_fnc_addClassEventHandler; ADDON = true; diff --git a/addons/editor/functions/fnc_fixSideButtons.sqf b/addons/editor/functions/fnc_fixSideButtons.sqf deleted file mode 100644 index 97b98d6f6..000000000 --- a/addons/editor/functions/fnc_fixSideButtons.sqf +++ /dev/null @@ -1,34 +0,0 @@ -#include "script_component.hpp" -/* - * Author: mharis001 - * Fixes disappearing side buttons when changing modes. - * - * Arguments: - * 0: Display - * - * Return Value: - * None - * - * Example: - * [DISPLAY] call zen_editor_fnc_fixSideButtons - * - * Public: No - */ - -params ["_display"]; - -private _sections = missionNamespace getVariable ["RscDisplayCurator_sections", [0, 0]]; -_sections params ["_mode"]; - -// Get side buttons to show based on mode -private _idcs = switch (_mode) do { - case 0; - case 1: {IDCS_SIDE_BUTTONS}; - case 2; - case 3: {[IDC_RSCDISPLAYCURATOR_SIDEEMPTY]}; - default {[]}; -}; - -{ - (_display displayCtrl _x) ctrlShow true; -} forEach _idcs; diff --git a/addons/editor/functions/fnc_handleCuratorPinged.sqf b/addons/editor/functions/fnc_handleCuratorPinged.sqf new file mode 100644 index 000000000..ec163091e --- /dev/null +++ b/addons/editor/functions/fnc_handleCuratorPinged.sqf @@ -0,0 +1,20 @@ +#include "script_component.hpp" +/* + * Author: Ampersand, mharis001 + * Handles receiving a player ping as Zeus. + * + * Arguments: + * 0: Curator (not used) + * 1: Player (not used) + * + * Return Value: + * None + * + * Example: + * [_curator, _player] call zen_editor_fnc_handleCuratorPinged + * + * Public: No + */ + +GVAR(pingTarget) = nil; +GVAR(pingViewed) = nil; diff --git a/addons/editor/functions/fnc_handleKeyDown.sqf b/addons/editor/functions/fnc_handleKeyDown.sqf index 78290aec5..16946fc5a 100644 --- a/addons/editor/functions/fnc_handleKeyDown.sqf +++ b/addons/editor/functions/fnc_handleKeyDown.sqf @@ -1,6 +1,6 @@ #include "script_component.hpp" /* - * Author: mharis001 + * Author: mharis001, Ampersand * Handles the key down event for the Zeus display. * * Arguments: @@ -24,6 +24,50 @@ if (GVAR(moveCamToSelection) > 0 && {_keyCode in actionKeys "curatorMoveCamTo" & true }; +if (_keyCode in actionKeys "curatorPingView" && {!isNil QGVAR(pingTarget)} && {isNil QGVAR(pingViewed)}) exitWith { + if (GVAR(pingTarget) isEqualType objNull) then { + private _distance = 0.5 * sizeOf typeOf GVAR(pingTarget) max 25; + private _position = GVAR(pingTarget) modelToWorldWorld [0, -_distance, 0.8 * _distance]; + curatorCamera setPosASL _position; + curatorCamera camSetTarget GVAR(pingTarget); + curatorCamera camCommit 0; + curatorCamera camSetTarget objNull; + curatorCamera camCommit 0; + } else { + private _camPos = ASLToAGL getPosASL curatorCamera; + private _camDir = getDir curatorCamera; + private _height = (_camPos select 2) max 5; + private _distance = _height * 2; + private _position = GVAR(pingTarget) getPos [_distance, _camDir + 180]; + _position set [2, _height + (GVAR(pingTarget) select 2)]; + + // Workaround for being unable to set a position as the curator camera's target + // Essentially, an unscheduled equivalent of BIS_fnc_setCuratorCamera + private _camera = "camera" camCreate _position; + _camera cameraEffect ["Internal", "BACK"]; + _camera camPrepareTarget GVAR(pingTarget); + _camera camCommitPrepared 0; + + [{ + camCommitted _this + }, { + [{ + curatorCamera setPosASL getPosASL _this; + curatorCamera setVectorDirAndUp [vectorDir _this, vectorUp _this]; + + _this cameraeffect ["Terminate", "BACK"]; + curatorCamera cameraEffect ["Internal", "BACK"]; + cameraEffectEnableHUD true; + camDestroy _this; + }, _this] call CBA_fnc_execNextFrame; + }, _camera] call CBA_fnc_waitUntilAndExecute; + }; + + GVAR(pingViewed) = true; + + true // handled +}; + // One frame later so RscDisplayCurator_sections is updated [{ params ["_display", "_keyCode", "_oldMode"]; diff --git a/addons/editor/functions/fnc_handleKeyUp.sqf b/addons/editor/functions/fnc_handleKeyUp.sqf new file mode 100644 index 000000000..5ffe793d3 --- /dev/null +++ b/addons/editor/functions/fnc_handleKeyUp.sqf @@ -0,0 +1,26 @@ +#include "script_component.hpp" +/* + * Author: mharis001, Ampersand + * Handles the key up event for the Zeus display. + * + * Arguments: + * 0: Display + * 1: Key Code + * + * Return Value: + * Handled + * + * Example: + * [DISPLAY, 0] call zen_editor_fnc_handleKeyUp + * + * Public: No + */ + +params ["_display", "_keyCode"]; + +if (_keyCode in actionKeys "curatorPingView" && {!isNil QGVAR(pingTarget)}) exitWith { + GVAR(pingViewed) = nil; + true // handled +}; + +false diff --git a/addons/editor/functions/fnc_handleLoad.sqf b/addons/editor/functions/fnc_handleLoad.sqf index 58525ce2d..e758a9317 100644 --- a/addons/editor/functions/fnc_handleLoad.sqf +++ b/addons/editor/functions/fnc_handleLoad.sqf @@ -56,6 +56,7 @@ if (GVAR(disableLiveSearch)) then { }; _display displayAddEventHandler ["KeyDown", {call FUNC(handleKeyDown)}]; +_display displayAddEventHandler ["KeyUp", {call FUNC(handleKeyUp)}]; { private _ctrl = _display displayCtrl _x; @@ -110,6 +111,18 @@ _ctrlTreeRecent ctrlAddEventHandler ["TreeSelChanged", { }; }]; +// Trigger events when the tree collapse and expand all buttons are clicked +{ + private _ctrlTreeButton = _display displayCtrl _x; + _ctrlTreeButton ctrlAddEventHandler ["ButtonClick", { + params ["_ctrlTreeButton"]; + + private _display = ctrlParent _ctrlTreeButton; + private _expand = ctrlIDC _ctrlTreeButton == IDC_EXPAND_ALL; + [QGVAR(treeButtonClicked), [_display, _expand]] call CBA_fnc_localEvent; + }]; +} forEach [IDC_COLLAPSE_ALL, IDC_EXPAND_ALL]; + // Initially open the map fully zoomed out and centered if (isNil QGVAR(previousMapState)) then { GVAR(previousMapState) = [1, [worldSize / 2, worldSize / 2]]; @@ -154,9 +167,6 @@ GVAR(iconsVisible) = true; [_display] call FUNC(addGroupIcons); [_display] call FUNC(addModIcons); - // Initially fix side buttons (can be hidden if a tree has no entries) - [FUNC(fixSideButtons), _display] call CBA_fnc_execNextFrame; - { private _ctrl = _display displayCtrl _x; _ctrl call EFUNC(common,collapseTree); diff --git a/addons/editor/functions/fnc_handleTreeButtons.sqf b/addons/editor/functions/fnc_handleTreeButtons.sqf index 1353046e4..a8129fb49 100644 --- a/addons/editor/functions/fnc_handleTreeButtons.sqf +++ b/addons/editor/functions/fnc_handleTreeButtons.sqf @@ -4,18 +4,19 @@ * Handles clicking the tree collapse and expand all buttons. * * Arguments: - * 0: Expand + * 0: Display (not used) + * 1: Expand * * Return Value: * None * * Example: - * [false] call zen_editor_fnc_handleTreeButtons + * [DISPLAY, false] call zen_editor_fnc_handleTreeButtons * * Public: No */ -params ["_expand"]; +params ["", "_expand"]; RscDisplayCurator_sections params ["_mode"]; diff --git a/addons/editor/functions/fnc_pingCurators.sqf b/addons/editor/functions/fnc_pingCurators.sqf new file mode 100644 index 000000000..f4dfc44c0 --- /dev/null +++ b/addons/editor/functions/fnc_pingCurators.sqf @@ -0,0 +1,100 @@ +#include "script_component.hpp" +/* + * Author: Ampersand, mharis001 + * Pings curators to the given target object or position. + * + * Arguments: + * 0: Curator + * 1: Ping Target + * - Positions must be in AGL format. + * 2: Curator's Name (default: "") + * + * Return Value: + * None + * + * Example: + * [_curator, _target] call zen_editor_fnc_pingCurators + * + * Public: No + */ + +#define PING_DRAW_TIME 1.2 +#define PING_DRAW_ICON "\a3\ui_f_curator\data\logos\arma3_curator_eye_512_ca.paa" + +#define PING_SCALE_DELAY 0.1 +#define PING_SCALE_END 0.7 +#define PING_SCALE_MIN 0.8 +#define PING_SCALE_MAX 1 + +#define PING_ALPHA_DELAY 0.8 +#define PING_ALPHA_END 1.2 +#define PING_ALPHA_MIN 0 +#define PING_ALPHA_MAX 1 + +if (isNull curatorCamera) exitWith {}; + +params ["_curator", "_target", ["_name", ""]]; + +GVAR(pingTarget) = _target; + +// Draw 3D icon to indicate the pinged object or position +if (isNil QGVAR(pingDrawMap)) then { + GVAR(pingDrawMap) = createHashMap; +}; + +GVAR(pingDrawMap) set [hashValue _curator, [_target, _name, CBA_missionTime]]; + +if (isNil QGVAR(pingDraw3D)) then { + GVAR(pingDraw3D) = addMissionEventHandler ["Draw3D", { + { + GVAR(pingDrawMap) get _x params ["_target", "_name", "_startTime"]; + + private _elapsedTime = CBA_missionTime - _startTime; + + if (_elapsedTime > PING_DRAW_TIME) then { + GVAR(pingDrawMap) deleteAt _x; + } else { + if (_target isEqualType objNull) then { + _target = unitAimPositionVisual _target; + }; + + private _scale = linearConversion [ + PING_SCALE_DELAY, + PING_SCALE_END, + _elapsedTime, + PING_SCALE_MIN, + PING_SCALE_MAX, + true + ]; + + private _alpha = linearConversion [ + PING_ALPHA_DELAY, + PING_ALPHA_END, + _elapsedTime, + PING_ALPHA_MAX, + PING_ALPHA_MIN, + true + ]; + + // Using two drawIcon3D calls to prevent moving the name text as the icon grows + drawIcon3D [PING_DRAW_ICON, [1, 1, 1, _alpha], _target, _scale, _scale, 0]; + drawIcon3D ["", [1, 1, 1, _alpha], _target, PING_SCALE_MAX, PING_SCALE_MAX, 0, _name]; + }; + } forEach keys GVAR(pingDrawMap); + + if (GVAR(pingDrawMap) isEqualTo createHashMap) then { + removeMissionEventHandler [_thisEvent, _thisEventHandler]; + GVAR(pingDraw3D) = nil; + }; + }]; +}; + +// Play sound (unique for each curator based on name) +private _sounds = getArray (configFile >> "CfgCurator" >> "soundsPing"); +private _random = 0; + +{ + _random = _random + _x; +} forEach toArray _name; + +playSound [_sounds select (_random % count _sounds), true]; diff --git a/addons/editor/initKeybinds.sqf b/addons/editor/initKeybinds.sqf index f45e95d86..4b211ee57 100644 --- a/addons/editor/initKeybinds.sqf +++ b/addons/editor/initKeybinds.sqf @@ -113,6 +113,27 @@ }; }, {}, [DIK_R, [true, true, false]]] call CBA_fnc_addKeybind; // Default: CTRL + SHIFT + R +[ELSTRING(main,DisplayName), QGVAR(pingCurators), [LSTRING(PingCurators), LSTRING(PingCurators_Description)], { + if (!isNull curatorCamera && {!GETMVAR(RscDisplayCurator_search,false)}) then { + private _target = SELECTED_OBJECTS param [0, objNull]; + + if (isNull _target) then { + curatorMouseOver params ["_type", "_entity"]; + + if (_type == "OBJECT") then { + _target = _entity; + } else { + _target = ASLToAGL ([] call EFUNC(common,getPosFromScreen)); + }; + }; + + private _curator = getAssignedCuratorLogic player; + [QGVAR(pingCurators), [_curator, _target, profileName], allCurators] call CBA_fnc_targetEvent; + + true // handled + }; +}, {}, [DIK_U, [false, false, false]]] call CBA_fnc_addKeybind; // Default: U + [[ELSTRING(main,DisplayName), LSTRING(AIControl)], QGVAR(ejectPassengers), [LSTRING(EjectPassengers), LSTRING(EjectPassengers_Description)], { if (!isNull curatorCamera && {!GETMVAR(RscDisplayCurator_search,false)}) then { { diff --git a/addons/editor/stringtable.xml b/addons/editor/stringtable.xml index 74d421fb2..a6e8f39c3 100644 --- a/addons/editor/stringtable.xml +++ b/addons/editor/stringtable.xml @@ -331,6 +331,14 @@ 重新加載Zeus界面。可用於修復鎖定問題。 Ricarica l'interfaccia di Zeus. Può essere utilizzato per risolvere i problemi di blocco. + + Ping Zeus + Zeus anpingen + + + Pings other Zeus curators on the selected/hovered object or cursor position. + Pingt andere Zeus auf ausgewählte Objekte oder Mausposition an. + AI Control diff --git a/addons/garage/XEH_preInit.sqf b/addons/garage/XEH_preInit.sqf index 722ae8119..1c32c3e3f 100644 --- a/addons/garage/XEH_preInit.sqf +++ b/addons/garage/XEH_preInit.sqf @@ -6,6 +6,8 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; +#include "initSettings.sqf" + GVAR(currentTab) = -1; GVAR(helperPos) = [0, 0, -1]; GVAR(camDistance) = 100; @@ -16,7 +18,7 @@ GVAR(camYaw) = -45; "Object", "STR_A3_Garage", {_entity call FUNC(openGarage)}, - {alive _entity && {_entity isKindOf "LandVehicle" || {_entity isKindOf "Air"} || {_entity isKindOf "Ship"}}}, + {EGVAR(attributes,enableGarage) && {alive _entity} && {_entity isKindOf "LandVehicle" || {_entity isKindOf "Air"} || {_entity isKindOf "Ship"}}}, true ] call EFUNC(attributes,addButton); diff --git a/addons/garage/initSettings.sqf b/addons/garage/initSettings.sqf new file mode 100644 index 000000000..25682da04 --- /dev/null +++ b/addons/garage/initSettings.sqf @@ -0,0 +1,8 @@ +[ + QEGVAR(attributes,enableGarage), + "CHECKBOX", + "STR_A3_Garage", + [ELSTRING(attributes,DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; diff --git a/addons/inventory/XEH_preInit.sqf b/addons/inventory/XEH_preInit.sqf index 8cd49f810..d549bdf95 100644 --- a/addons/inventory/XEH_preInit.sqf +++ b/addons/inventory/XEH_preInit.sqf @@ -6,6 +6,8 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; +#include "initSettings.sqf" + // Add inventory button to attribute display [ "Object", @@ -14,7 +16,7 @@ PREP_RECOMPILE_END; [_entity] call FUNC(configure); }, { - alive _entity && {maxLoad _entity > 0} && {!(_entity isKindOf "CAManBase")} + EGVAR(attributes,enableInventory) && {alive _entity} && {maxLoad _entity > 0} && {!(_entity isKindOf "CAManBase")} } ] call EFUNC(attributes,addButton); diff --git a/addons/inventory/initSettings.sqf b/addons/inventory/initSettings.sqf new file mode 100644 index 000000000..d8dddd58e --- /dev/null +++ b/addons/inventory/initSettings.sqf @@ -0,0 +1,8 @@ +[ + QEGVAR(attributes,enableInventory), + "CHECKBOX", + "STR_A3_Gear1", + [ELSTRING(attributes,DisplayName), "STR_3DEN_Object_textPlural"], + true, + false +] call CBA_fnc_addSetting; diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index a8234f1d7..fce004b1a 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -10,7 +10,7 @@ #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD // MINIMAL required version for the Mod. Components can specify others.. -#define REQUIRED_VERSION 2.12 +#define REQUIRED_VERSION 2.14 #define REQUIRED_CBA_VERSION {3,15,8} #ifdef COMPONENT_BEAUTIFIED diff --git a/addons/main/script_version.hpp b/addons/main/script_version.hpp index 0b03653ee..bde886aaf 100644 --- a/addons/main/script_version.hpp +++ b/addons/main/script_version.hpp @@ -1,4 +1,4 @@ #define MAJOR 1 -#define MINOR 13 +#define MINOR 14 #define PATCHLVL 0 -#define BUILD 32 +#define BUILD 34 diff --git a/addons/markers_tree/RscDisplayCurator.hpp b/addons/markers_tree/RscDisplayCurator.hpp index f7a16b7dd..0a18cbc4b 100644 --- a/addons/markers_tree/RscDisplayCurator.hpp +++ b/addons/markers_tree/RscDisplayCurator.hpp @@ -1,9 +1,25 @@ +class RscActivePicture; class RscControlsGroupNoScrollbars; class RscDisplayCurator { class Controls { class Add: RscControlsGroupNoScrollbars { class controls { + class GVAR(modeIcons): RscActivePicture { + idc = IDC_MARKERS_MODE_ICONS; + text = "\a3\3den\data\displays\display3den\panelright\submode_marker_icon_ca.paa"; + tooltip = "$STR_3DEN_Marker_Mode_Icon"; + x = POS_W(7.4/3); + y = POS_H(2.1); + w = POS_W(1.8); + h = POS_H(1.8); + }; + class GVAR(modeAreas): GVAR(modeIcons) { + idc = IDC_MARKERS_MODE_AREAS; + text = "\a3\3den\data\displays\display3den\panelright\submode_marker_area_ca.paa"; + tooltip = "$STR_3DEN_Marker_Mode_Area"; + x = POS_W(1.8 + 2 * 7.4/3); + }; class CreateUnitsWest; class CreateMarkers: CreateUnitsWest { idcSearch = -1; @@ -12,11 +28,15 @@ class RscDisplayCurator { w = 0; h = 0; }; - class ADDON: CreateUnitsWest { - idc = IDC_MARKERS_TREE; + class GVAR(treeIcons): CreateUnitsWest { + idc = IDC_MARKERS_TREE_ICONS; idcSearch = IDC_RSCDISPLAYCURATOR_CREATE_SEARCH; colorPictureSelected[] = {1, 1, 1, 1}; }; + class GVAR(treeAreas): GVAR(treeIcons) { + idc = IDC_MARKERS_TREE_AREAS; + colorPictureSelected[] = {0, 0, 0, 1}; + }; }; }; }; diff --git a/addons/markers_tree/XEH_PREP.hpp b/addons/markers_tree/XEH_PREP.hpp index 226364f45..6eddc77a0 100644 --- a/addons/markers_tree/XEH_PREP.hpp +++ b/addons/markers_tree/XEH_PREP.hpp @@ -1,7 +1,13 @@ PREP(compile); -PREP(handleCustomSelect); +PREP(handleDraw); +PREP(handleAreasSelect); PREP(handleEngineSelect); -PREP(handleModeChange); +PREP(handleIconsSelect); +PREP(handleMouseButtonDown); +PREP(handleMouseButtonUp); +PREP(handleMouseMoving); +PREP(handleSubModeClicked); PREP(handleTreeButtons); +PREP(handleTreeChange); PREP(initDisplayCurator); PREP(populate); diff --git a/addons/markers_tree/XEH_postInit.sqf b/addons/markers_tree/XEH_postInit.sqf index 7fc22bf65..baa07e36d 100644 --- a/addons/markers_tree/XEH_postInit.sqf +++ b/addons/markers_tree/XEH_postInit.sqf @@ -1,4 +1,6 @@ #include "script_component.hpp" ["zen_curatorDisplayLoaded", LINKFUNC(initDisplayCurator)] call CBA_fnc_addEventHandler; -[QEGVAR(editor,modeChanged), LINKFUNC(handleModeChange)] call CBA_fnc_addEventHandler; +[QEGVAR(editor,modeChanged), LINKFUNC(handleTreeChange)] call CBA_fnc_addEventHandler; +[QEGVAR(editor,sideChanged), LINKFUNC(handleTreeChange)] call CBA_fnc_addEventHandler; +[QEGVAR(editor,treeButtonClicked), LINKFUNC(handleTreeButtons)] call CBA_fnc_addEventHandler; diff --git a/addons/markers_tree/XEH_preInit.sqf b/addons/markers_tree/XEH_preInit.sqf index 4f225fcf5..e1c49c563 100644 --- a/addons/markers_tree/XEH_preInit.sqf +++ b/addons/markers_tree/XEH_preInit.sqf @@ -9,4 +9,7 @@ PREP_RECOMPILE_END; // Compiling at preInit since profileNamespace colors are not available at preStart call FUNC(compile); +// Sub-mode for custom marker trees (0: icons, 1: areas) +GVAR(mode) = 0; + ADDON = true; diff --git a/addons/markers_tree/config.cpp b/addons/markers_tree/config.cpp index 79b6bbad7..2eb6ffc24 100644 --- a/addons/markers_tree/config.cpp +++ b/addons/markers_tree/config.cpp @@ -6,7 +6,10 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"zen_editor"}; + requiredAddons[] = { + "zen_area_markers", + "zen_editor" + }; author = ECSTRING(main,Author); authors[] = {"mharis001"}; url = ECSTRING(main,URL); diff --git a/addons/markers_tree/functions/fnc_compile.sqf b/addons/markers_tree/functions/fnc_compile.sqf index 573843e7d..ab76b75ad 100644 --- a/addons/markers_tree/functions/fnc_compile.sqf +++ b/addons/markers_tree/functions/fnc_compile.sqf @@ -24,8 +24,8 @@ private _cfgMarkerClasses = configFile >> "CfgMarkerClasses"; { if (getNumber (_x >> "scope") > 0 && {getText (_x >> "markerClass") != ""}) then { private _class = configName _x; - private _name = getText (_x >> "name"); - private _icon = getText (_x >> "icon"); + private _name = getText (_x >> "name"); + private _icon = getText (_x >> "icon"); private _color = getArray (_x >> "color") apply {if (_x isEqualType "") then {call compile _x} else {_x}}; private _category = getText (_cfgMarkerClasses >> getText (_x >> "markerClass") >> "displayName"); diff --git a/addons/markers_tree/functions/fnc_handleAreasSelect.sqf b/addons/markers_tree/functions/fnc_handleAreasSelect.sqf new file mode 100644 index 000000000..1ed2f1ba4 --- /dev/null +++ b/addons/markers_tree/functions/fnc_handleAreasSelect.sqf @@ -0,0 +1,26 @@ +#include "script_component.hpp" +/* + * Author: mharis001 + * Handles changing the selection in the custom area markers tree. + * + * Arguments: + * 0: Markers Tree + * 1: Selected Path + * + * Return Value: + * None + * + * Example: + * [CONTROL] call zen_markers_tree_fnc_handleAreasSelect + * + * Public: No + */ + +params ["_ctrlTreeAreas", "_selectedPath"]; + +// Clear selected entities when starting placement of an area marker +if (_selectedPath isNotEqualTo []) then { + private _display = ctrlParent _ctrlTreeAreas; + private _ctrlEntities = _display displayCtrl IDC_RSCDISPLAYCURATOR_ENTITIES; + _ctrlEntities tvSetCurSel [-1]; +}; diff --git a/addons/markers_tree/functions/fnc_handleDraw.sqf b/addons/markers_tree/functions/fnc_handleDraw.sqf new file mode 100644 index 000000000..040baaca5 --- /dev/null +++ b/addons/markers_tree/functions/fnc_handleDraw.sqf @@ -0,0 +1,40 @@ +#include "script_component.hpp" +/* + * Author: mharis001 + * Handles drawing area markers on the map to indicate placement. + * + * Arguments: + * 0: Map + * + * Return Value: + * None + * + * Example: + * [CONTROL] call zen_markers_tree_fnc_handleDraw + * + * Public: No + */ + +BEGIN_COUNTER(draw); + +params ["_ctrlMap"]; + +private _display = ctrlParent _ctrlMap; +private _ctrlTreeAreas = _display displayCtrl IDC_MARKERS_TREE_AREAS; +private _shape = _ctrlTreeAreas tvData tvCurSel _ctrlTreeAreas; + +if (ctrlShown _ctrlTreeAreas && {_shape != ""} && EFUNC(common,isCursorOnMouseArea)) then { + private _position = _ctrlMap ctrlMapScreenToWorld getMousePosition; + private _drawArgs = [_position, 50, 50, 0, [0, 0, 0, 0.7], "#(rgb,8,8,3)color(0,0,0,0.7)"]; + + switch (_shape) do { + case "ELLIPSE": { + _ctrlMap drawEllipse _drawArgs; + }; + case "RECTANGLE": { + _ctrlMap drawRectangle _drawArgs; + }; + }; +}; + +END_COUNTER(draw); diff --git a/addons/markers_tree/functions/fnc_handleEngineSelect.sqf b/addons/markers_tree/functions/fnc_handleEngineSelect.sqf index 9d5c6ac32..b589326ff 100644 --- a/addons/markers_tree/functions/fnc_handleEngineSelect.sqf +++ b/addons/markers_tree/functions/fnc_handleEngineSelect.sqf @@ -20,9 +20,9 @@ params ["_ctrlTreeEngine", "_selectedPath"]; if (_selectedPath isEqualTo []) then { private _display = ctrlParent _ctrlTreeEngine; - private _ctrlTreeCustom = _display displayCtrl IDC_MARKERS_TREE; + private _ctrlTreeIcons = _display displayCtrl IDC_MARKERS_TREE_ICONS; - if (count tvCurSel _ctrlTreeCustom == 2) then { - _ctrlTreeCustom tvSetCurSel [-1]; + if (count tvCurSel _ctrlTreeIcons == 2) then { + _ctrlTreeIcons tvSetCurSel [-1]; }; }; diff --git a/addons/markers_tree/functions/fnc_handleCustomSelect.sqf b/addons/markers_tree/functions/fnc_handleIconsSelect.sqf similarity index 73% rename from addons/markers_tree/functions/fnc_handleCustomSelect.sqf rename to addons/markers_tree/functions/fnc_handleIconsSelect.sqf index b3a546444..0a0cbadd7 100644 --- a/addons/markers_tree/functions/fnc_handleCustomSelect.sqf +++ b/addons/markers_tree/functions/fnc_handleIconsSelect.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" /* * Author: mharis001 - * Handles changing the selection in the custom markers tree. + * Handles changing the selection in the custom icon markers tree. * * Arguments: * 0: Markers Tree @@ -11,14 +11,14 @@ * None * * Example: - * [CONTROL] call zen_markers_tree_fnc_handleCustomSelect + * [CONTROL] call zen_markers_tree_fnc_handleIconsSelect * * Public: No */ -params ["_ctrlTreeCustom", "_selectedPath"]; +params ["_ctrlTreeIcons", "_selectedPath"]; -private _display = ctrlParent _ctrlTreeCustom; +private _display = ctrlParent _ctrlTreeIcons; private _ctrlTreeEngine = _display displayCtrl IDC_RSCDISPLAYCURATOR_CREATE_MARKERS; // Fix keyboard input changing tree selection @@ -29,7 +29,7 @@ if (count _selectedPath != 2) exitWith { _ctrlTreeEngine tvSetCurSel [-1]; }; -private _class = _ctrlTreeCustom tvData _selectedPath; +private _class = _ctrlTreeIcons tvData _selectedPath; for "_i" from 0 to ((_ctrlTreeEngine tvCount []) - 1) do { if (_ctrlTreeEngine tvData [_i] == _class) exitWith { diff --git a/addons/markers_tree/functions/fnc_handleModeChange.sqf b/addons/markers_tree/functions/fnc_handleModeChange.sqf deleted file mode 100644 index b4a379349..000000000 --- a/addons/markers_tree/functions/fnc_handleModeChange.sqf +++ /dev/null @@ -1,23 +0,0 @@ -#include "script_component.hpp" -/* - * Author: mharis001 - * Handles changing the mode of the create trees. - * - * Arguments: - * 0: Display - * 1: Mode - * - * Return Value: - * None - * - * Example: - * [DISPLAY, 0] call zen_markers_tree_fnc_handleModeChange - * - * Public: No - */ - -params ["_display", "_mode"]; - -// Show the custom markers tree when the markers mode is selected, otherwise hide -private _ctrlTree = _display displayCtrl IDC_MARKERS_TREE; -_ctrlTree ctrlShow (_mode == 3); diff --git a/addons/markers_tree/functions/fnc_handleMouseButtonDown.sqf b/addons/markers_tree/functions/fnc_handleMouseButtonDown.sqf new file mode 100644 index 000000000..b5e41f93c --- /dev/null +++ b/addons/markers_tree/functions/fnc_handleMouseButtonDown.sqf @@ -0,0 +1,33 @@ +#include "script_component.hpp" +/* + * Author: mharis001 + * Handles pressing a mouse button on the map. + * + * Arguments: + * 0: Map + * 1: Button + * + * Return Value: + * None + * + * Example: + * [CONTROL, 0] call zen_markers_tree_fnc_handleMouseButtonDown + * + * Public: No + */ + +params ["_ctrlMap", "_button"]; + +switch (_button) do { + case 0: { + _ctrlMap setVariable [QGVAR(holdingLMB), true]; + }; + case 1: { + private _display = ctrlParent _ctrlMap; + private _ctrlTreeAreas = _display displayCtrl IDC_MARKERS_TREE_AREAS; + + if (ctrlShown _ctrlTreeAreas) then { + _ctrlTreeAreas tvSetCurSel [-1]; + }; + }; +}; diff --git a/addons/markers_tree/functions/fnc_handleMouseButtonUp.sqf b/addons/markers_tree/functions/fnc_handleMouseButtonUp.sqf new file mode 100644 index 000000000..64580b939 --- /dev/null +++ b/addons/markers_tree/functions/fnc_handleMouseButtonUp.sqf @@ -0,0 +1,54 @@ +#include "script_component.hpp" +/* + * Author: mharis001 + * Handles releasing a mouse button on the map. + * + * Arguments: + * 0: Map + * 1: Button + * 2: X Position + * 3: Y Position + * 4: Shift State (not used) + * 5: Ctrl State + * + * Return Value: + * None + * + * Example: + * [CONTROL, 0, 0.5, 0.5, false, true] call zen_markers_tree_fnc_handleMouseButtonUp + * + * Public: No + */ + +params ["_ctrlMap", "_button", "_posX", "_posY", "", "_ctrl"]; + +if (_button == 0) then { + private _display = ctrlParent _ctrlMap; + private _ctrlTreeAreas = _display displayCtrl IDC_MARKERS_TREE_AREAS; + + if (ctrlShown _ctrlTreeAreas) then { + // Create marker if placement is confirmed (mouse was not moved after pressing LMB) + if (_ctrlMap getVariable [QGVAR(holdingLMB), false]) then { + private _shape = _ctrlTreeAreas tvData tvCurSel _ctrlTreeAreas; + + if (_shape != "") then { + private _position = _ctrlMap ctrlMapScreenToWorld [_posX, _posY]; + [QEGVAR(area_markers,createMarker), [_position, _shape]] call CBA_fnc_serverEvent; + + // If the control key was not held down, stop placing + if (!_ctrl) then { + _ctrlTreeAreas tvSetCurSel [-1]; + }; + }; + } else { + // Need frame delay since curatorSelected is not updated until then + [{ + if (curatorSelected isNotEqualTo [[], [], [], []]) then { + _this tvSetCurSel [-1]; + }; + }, _ctrlTreeAreas] call CBA_fnc_execNextFrame; + }; + }; + + _ctrlMap setVariable [QGVAR(holdingLMB), false]; +}; diff --git a/addons/markers_tree/functions/fnc_handleMouseMoving.sqf b/addons/markers_tree/functions/fnc_handleMouseMoving.sqf new file mode 100644 index 000000000..de673c379 --- /dev/null +++ b/addons/markers_tree/functions/fnc_handleMouseMoving.sqf @@ -0,0 +1,22 @@ +#include "script_component.hpp" +/* + * Author: mharis001 + * Handles moving the mouse on the map. + * + * Arguments: + * 0: Map + * + * Return Value: + * None + * + * Example: + * [CONTROL] call zen_markers_tree_fnc_handleMouseMoving + * + * Public: No + */ + +params ["_ctrlMap"]; + +if (_ctrlMap getVariable [QGVAR(holdingLMB), false]) then { + _ctrlMap setVariable [QGVAR(holdingLMB), false]; +}; diff --git a/addons/markers_tree/functions/fnc_handleSubModeClicked.sqf b/addons/markers_tree/functions/fnc_handleSubModeClicked.sqf new file mode 100644 index 000000000..bfbc550ca --- /dev/null +++ b/addons/markers_tree/functions/fnc_handleSubModeClicked.sqf @@ -0,0 +1,47 @@ +#include "script_component.hpp" +/* + * Author: mharis001 + * Handles clicking a marker sub-mode button. + * + * Arguments: + * 0: Sub-Mode Button + * + * Return Value: + * None + * + * Example: + * [CONTROL] call zen_markers_tree_fnc_handleSubModeClicked + * + * Public: No + */ + +params ["_ctrlMode"]; + +// Set appropriate sub-mode based on button +GVAR(mode) = [IDC_MARKERS_MODE_ICONS, IDC_MARKERS_MODE_AREAS] find ctrlIDC _ctrlMode; + +// Update visuals of sub-mode buttons and show the appropriate markers tree (icons or areas) +private _display = ctrlParent _ctrlMode; + +{ + _x params ["_modeIDC", "_treeIDC"]; + + private _ctrlMode = _display displayCtrl _modeIDC; + private _ctrlTree = _display displayCtrl _treeIDC; + private _selected = GVAR(mode) == _forEachIndex; + + private _scale = [0.8, 1] select _selected; + private _alpha = [0.7, 1] select _selected; + _ctrlMode ctrlSetTextColor [1, 1, 1, _alpha]; + [_ctrlMode, _scale, 0.1] call BIS_fnc_ctrlSetScale; + + _ctrlTree ctrlShow _selected; + + // Cancel any active selection (i.e., placement) for the non-selected tree + if (!_selected) then { + _ctrlTree tvSetCurSel [-1]; + }; +} forEach [ + [IDC_MARKERS_MODE_ICONS, IDC_MARKERS_TREE_ICONS], + [IDC_MARKERS_MODE_AREAS, IDC_MARKERS_TREE_AREAS] +]; diff --git a/addons/markers_tree/functions/fnc_handleTreeButtons.sqf b/addons/markers_tree/functions/fnc_handleTreeButtons.sqf index 44c0f22ed..3de000301 100644 --- a/addons/markers_tree/functions/fnc_handleTreeButtons.sqf +++ b/addons/markers_tree/functions/fnc_handleTreeButtons.sqf @@ -4,26 +4,27 @@ * Handles clicking the tree collapse and expand all buttons. * * Arguments: - * 0: Expand + * 0: Display + * 1: Expand * * Return Value: * None * * Example: - * [false] call zen_markers_tree_fnc_handleTreeButtons + * [DISPLAY, false] call zen_markers_tree_fnc_handleTreeButtons * * Public: No */ -params ["_expand"]; +params ["_display", "_expand"]; -// Only handle the custom markers tree, rest are handled by editor component -if (RscDisplayCurator_sections select 0 != 3) exitWith {}; +// Only handle the custom icon markers tree, rest are handled by editor component +if (RscDisplayCurator_sections select 0 != 3 || {GVAR(mode) != 0}) exitWith {}; -private _ctrlTree = findDisplay IDD_RSCDISPLAYCURATOR displayCtrl IDC_MARKERS_TREE; +private _ctrlTreeIcons = _display displayCtrl IDC_MARKERS_TREE_ICONS; if (_expand) then { - tvExpandAll _ctrlTree; + tvExpandAll _ctrlTreeIcons; } else { - _ctrlTree call EFUNC(common,collapseTree); + _ctrlTreeIcons call EFUNC(common,collapseTree); }; diff --git a/addons/markers_tree/functions/fnc_handleTreeChange.sqf b/addons/markers_tree/functions/fnc_handleTreeChange.sqf new file mode 100644 index 000000000..5af35c092 --- /dev/null +++ b/addons/markers_tree/functions/fnc_handleTreeChange.sqf @@ -0,0 +1,35 @@ +#include "script_component.hpp" +/* + * Author: mharis001 + * Handles changing the currently active tree. + * + * Arguments: + * 0: Display + * 1: Mode + * + * Return Value: + * None + * + * Example: + * [DISPLAY, 0] call zen_markers_tree_fnc_handleTreeChange + * + * Public: No + */ + +params ["_display", "_mode"]; + +// Show empty side control if not in markers mode +private _ctrlSideEmpty = _display displayCtrl IDC_RSCDISPLAYCURATOR_SIDEEMPTY; +_ctrlSideEmpty ctrlShow (_mode != 3); + +// Show marker sub-mode buttons if in markers mode +{ + private _ctrlMode = _display displayCtrl _x; + _ctrlMode ctrlShow (_mode == 3); +} forEach [IDC_MARKERS_MODE_ICONS, IDC_MARKERS_MODE_AREAS]; + +// Show the appropriate custom markers tree (icons or areas) when in markers mode, otherwise hide +{ + private _ctrlTree = _display displayCtrl _x; + _ctrlTree ctrlShow (_mode == 3 && {GVAR(mode) == _forEachIndex}); +} forEach [IDC_MARKERS_TREE_ICONS, IDC_MARKERS_TREE_AREAS]; diff --git a/addons/markers_tree/functions/fnc_initDisplayCurator.sqf b/addons/markers_tree/functions/fnc_initDisplayCurator.sqf index 897d551a3..d20a7717e 100644 --- a/addons/markers_tree/functions/fnc_initDisplayCurator.sqf +++ b/addons/markers_tree/functions/fnc_initDisplayCurator.sqf @@ -20,16 +20,47 @@ params ["_display"]; private _ctrlTreeEngine = _display displayCtrl IDC_RSCDISPLAYCURATOR_CREATE_MARKERS; _ctrlTreeEngine ctrlAddEventHandler ["TreeSelChanged", {call FUNC(handleEngineSelect)}]; -private _ctrlTreeCustom = _display displayCtrl IDC_MARKERS_TREE; -_ctrlTreeCustom ctrlAddEventHandler ["TreeSelChanged", {call FUNC(handleCustomSelect)}]; -_ctrlTreeCustom call FUNC(populate); +private _ctrlTreeIcons = _display displayCtrl IDC_MARKERS_TREE_ICONS; +_ctrlTreeIcons ctrlAddEventHandler ["TreeSelChanged", {call FUNC(handleIconsSelect)}]; +_ctrlTreeIcons call FUNC(populate); -// Handle initially hiding/showing the custom markers tree -private _sections = missionNamespace getVariable ["RscDisplayCurator_sections", [0, 0]]; -_ctrlTreeCustom ctrlShow (_sections select 0 == 3); +private _ctrlTreeAreas = _display displayCtrl IDC_MARKERS_TREE_AREAS; +_ctrlTreeAreas ctrlAddEventHandler ["TreeSelChanged", {call FUNC(handleAreasSelect)}]; -private _ctrlCollapseAll = _display displayCtrl IDC_COLLAPSE_ALL; -_ctrlCollapseAll ctrlAddEventHandler ["ButtonClick", {false call FUNC(handleTreeButtons)}]; +{ + _x params ["_text", "_icon", "_data"]; -private _ctrlExpandAll = _display displayCtrl IDC_EXPAND_ALL; -_ctrlExpandAll ctrlAddEventHandler ["ButtonClick", {true call FUNC(handleTreeButtons)}]; + private _index = _ctrlTreeAreas tvAdd [[], localize _text]; + _ctrlTreeAreas tvSetPicture [[_index], _icon]; + _ctrlTreeAreas tvSetData [[_index], _data]; +} forEach [ + ["str_3den_attributes_shapetrigger_ellipse", "a3\3den\data\cfg3den\marker\iconellipse_ca.paa", "ELLIPSE"], + ["str_3den_attributes_shapetrigger_rectangle", "a3\3den\data\cfg3den\marker\iconrectangle_ca.paa", "RECTANGLE"] +]; + +private _ctrlMap = _display displayCtrl IDC_RSCDISPLAYCURATOR_MAINMAP; +_ctrlMap ctrlAddEventHandler ["MouseButtonDown", {call FUNC(handleMouseButtonDown)}]; +_ctrlMap ctrlAddEventHandler ["MouseButtonUp", {call FUNC(handleMouseButtonUp)}]; +_ctrlMap ctrlAddEventHandler ["MouseMoving", {call FUNC(handleMouseMoving)}]; +_ctrlMap ctrlAddEventHandler ["Draw", {call FUNC(handleDraw)}]; + +{ + private _ctrlMode = _display displayCtrl _x; + _ctrlMode ctrlAddEventHandler ["ButtonClick", {call FUNC(handleSubModeClicked)}]; + + // Handle initially applying the current sub-mode + if (GVAR(mode) == _forEachIndex) then { + _ctrlMode call FUNC(handleSubModeClicked); + }; +} forEach [IDC_MARKERS_MODE_ICONS, IDC_MARKERS_MODE_AREAS]; + +// Handle initially hiding/showing the custom marker trees +missionNamespace getVariable ["RscDisplayCurator_sections", [0, 0]] params ["_mode"]; +[_display, _mode] call FUNC(handleTreeChange); + +// Need frame delay workaround for usage of ctrlActivate by RscDisplayCurator.sqf +// to properly hide the empty side control when initially in markers mode +if (_mode == 3) then { + private _ctrlSideEmpty = _display displayCtrl IDC_RSCDISPLAYCURATOR_SIDEEMPTY; + [{_this ctrlShow false}, _ctrlSideEmpty, 3] call EFUNC(common,execAfterNFrames); +}; diff --git a/addons/markers_tree/functions/fnc_populate.sqf b/addons/markers_tree/functions/fnc_populate.sqf index 209ba3112..3136dfee8 100644 --- a/addons/markers_tree/functions/fnc_populate.sqf +++ b/addons/markers_tree/functions/fnc_populate.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" /* * Author: mharis001 - * Populates the custom markers tree. + * Populates the custom icon markers tree. * * Arguments: * 0: Markers Tree @@ -18,14 +18,12 @@ params ["_ctrlTree"]; { - private _categoryIndex = _ctrlTree tvAdd [[], _x]; + private _index = _ctrlTree tvAdd [[], _x]; { _x params ["_class", "_name", "_icon", "_color"]; - private _index = _ctrlTree tvAdd [[_categoryIndex], _name]; - private _path = [_categoryIndex, _index]; - + private _path = [_index, _ctrlTree tvAdd [[_index], _name]]; _ctrlTree tvSetData [_path, _class]; _ctrlTree tvSetTooltip [_path, _name]; _ctrlTree tvSetPicture [_path, _icon]; diff --git a/addons/markers_tree/script_component.hpp b/addons/markers_tree/script_component.hpp index ba5fe6dd4..e27a2fad2 100644 --- a/addons/markers_tree/script_component.hpp +++ b/addons/markers_tree/script_component.hpp @@ -17,7 +17,16 @@ #include "\x\zen\addons\main\script_macros.hpp" #include "\a3\ui_f\hpp\defineDIKCodes.inc" +#include "\a3\ui_f\hpp\defineCommonGrids.inc" #include "\x\zen\addons\common\defineResinclDesign.inc" #include "\x\zen\addons\editor\script_idc.hpp" -#define IDC_MARKERS_TREE 92892 +#define POS_X(N) ((N) * GUI_GRID_W + GUI_GRID_CENTER_X) +#define POS_Y(N) ((N) * GUI_GRID_H + GUI_GRID_CENTER_Y) +#define POS_W(N) ((N) * GUI_GRID_W) +#define POS_H(N) ((N) * GUI_GRID_H) + +#define IDC_MARKERS_MODE_ICONS 92800 +#define IDC_MARKERS_MODE_AREAS 92810 +#define IDC_MARKERS_TREE_ICONS 92820 +#define IDC_MARKERS_TREE_AREAS 92830 diff --git a/addons/modules/XEH_postInit.sqf b/addons/modules/XEH_postInit.sqf index 75d025931..679f88cf6 100644 --- a/addons/modules/XEH_postInit.sqf +++ b/addons/modules/XEH_postInit.sqf @@ -18,7 +18,7 @@ if (isServer) then { { _x hideObjectGlobal _hide; - } forEach nearestTerrainObjects [_position, _objectTypes, _radius]; + } forEach nearestTerrainObjects [_position, _objectTypes, _radius, false, true]; // Use 2D mode to handle tall objects }] call CBA_fnc_addEventHandler; }; diff --git a/addons/modules/functions/fnc_gui_spawnReinforcements.sqf b/addons/modules/functions/fnc_gui_spawnReinforcements.sqf index 046f35702..b852f3546 100644 --- a/addons/modules/functions/fnc_gui_spawnReinforcements.sqf +++ b/addons/modules/functions/fnc_gui_spawnReinforcements.sqf @@ -22,7 +22,7 @@ params ["_display", "_logic"]; private _selections = GVAR(saved) getVariable [QGVAR(spawnReinforcements), [0, 0, 0, 0, 0, [], -3, 1, 0, 100, -3, 0]]; -_selections params ["_side", "_faction", "_category", "_vehicle", "_treeMode", "_unitList", "_vehicleLZ", "_vehicleBehaviour", "_insertionMethod", "_flyHeight", "_unitRP", "_unitBehaviour"]; +_selections params ["_side", "_faction", "_category", "_vehicle", "_treeMode", "_unitList", "_vehicleLZ", "_vehicleBehaviour", "_insertionMethodIndex", "_flyHeight", "_unitRP", "_unitBehaviour"]; private _position = ASLtoAGL getPosASL _logic; _display setVariable [QGVAR(position), _position]; @@ -234,24 +234,35 @@ private _fnc_vehicleChanged = { private _ctrlFlyHeight = _display displayCtrl IDC_SPAWNREINFORCEMENTS_VEHICLE_HEIGHT; _ctrlFlyHeight ctrlEnable _isAir; - if ( - isClass (configFile >> "CfgPatches" >> "ace_fastroping") - && {getNumber (configFile >> "CfgVehicles" >> _vehicle >> "ace_fastroping_enabled") > 0} - ) then { - if (lbSize _ctrlInsertion < 3) then { - _ctrlInsertion lbAdd localize ELSTRING(ai,Fastrope); - }; - } else { - private _index = lbCurSel _ctrlInsertion; + private _previousMethod = _ctrlInsertion lbData lbCurSel _ctrlInsertion; + _ctrlInsertion lbSetCurSel 0; + lbClear _ctrlInsertion; - // Switch to land if fastroping is not available - if (_index == 2) then { - _index = 0; - }; + { + _x params ["_waypointClass", "_condition"]; - _ctrlInsertion lbDelete 2; - _ctrlInsertion lbSetCurSel _index; - }; + private _waypointConfig = configFile >> "ZEN_WaypointTypes" >> _waypointClass; + + if (isClass _waypointConfig && {_vehicle call _condition}) then { + private _index = _ctrlInsertion lbAdd getText (_waypointConfig >> "displayName"); + _ctrlInsertion lbSetTooltip [_index, getText (_waypointConfig >> "tooltip")]; + _ctrlInsertion lbSetData [_index, _waypointClass]; + + // Special handling for "Land" method (to display a different name) + if (_waypointClass == "TransportUnload") then { + _ctrlInsertion lbSetText [_index, LELSTRING(ai,Land)]; + }; + + if (_waypointClass == _previousMethod) then { + _ctrlInsertion lbSetCurSel _index; + }; + }; + } forEach [ + ["TransportUnload", {true}], + ["Paradrop", {true}], + ["Fastrope", EFUNC(compat_ace,canFastrope)], + ["AdvancedRappel", EFUNC(compat_advanced_rappelling,canRappel)] + ]; }; private _ctrlVehicle = _display displayCtrl IDC_SPAWNREINFORCEMENTS_VEHICLE; @@ -406,7 +417,7 @@ private _ctrlVehicleBehaviour = _display displayCtrl IDC_SPAWNREINFORCEMENTS_VEH _ctrlVehicleBehaviour lbSetCurSel _vehicleBehaviour; private _ctrlInsertion = _display displayCtrl IDC_SPAWNREINFORCEMENTS_VEHICLE_INSERTION; -_ctrlInsertion lbSetCurSel _insertionMethod; +_ctrlInsertion lbSetCurSel _insertionMethodIndex; private _ctrlFlyHeight = _display displayCtrl IDC_SPAWNREINFORCEMENTS_VEHICLE_HEIGHT; _ctrlFlyHeight ctrlSetText str _flyHeight; @@ -437,9 +448,12 @@ private _fnc_onConfirm = { }; private _vehicleBehaviour = lbCurSel (_display displayCtrl IDC_SPAWNREINFORCEMENTS_VEHICLE_BEHAVIOUR); - private _insertionMethod = lbCurSel (_display displayCtrl IDC_SPAWNREINFORCEMENTS_VEHICLE_INSERTION); private _unitBehaviour = lbCurSel (_display displayCtrl IDC_SPAWNREINFORCEMENTS_UNIT_BEHAVIOUR); + private _ctrlInsertion = _display displayCtrl IDC_SPAWNREINFORCEMENTS_VEHICLE_INSERTION; + private _insertionMethodIndex = lbCurSel _ctrlInsertion; + private _insertionMethod = _ctrlInsertion lbData _insertionMethodIndex; + private _flyHeight = parseNumber ctrlText (_display displayCtrl IDC_SPAWNREINFORCEMENTS_VEHICLE_HEIGHT) max 50; private _ctrlVehicleLZ = _display displayCtrl IDC_SPAWNREINFORCEMENTS_VEHICLE_LZ; @@ -448,7 +462,7 @@ private _fnc_onConfirm = { private _ctrlUnitRP = _display displayCtrl IDC_SPAWNREINFORCEMENTS_UNIT_RP; private _unitRP = _ctrlUnitRP lbValue lbCurSel _ctrlUnitRP; - private _selections = [_side, _faction, _category, _vehicle, _treeMode, _unitList, _vehicleLZ, _vehicleBehaviour, _insertionMethod, _flyHeight, _unitRP, _unitBehaviour]; + private _selections = [_side, _faction, _category, _vehicle, _treeMode, _unitList, _vehicleLZ, _vehicleBehaviour, _insertionMethodIndex, _flyHeight, _unitRP, _unitBehaviour]; GVAR(saved) setVariable [QGVAR(spawnReinforcements), _selections]; // Convert vehicle index to type diff --git a/addons/modules/functions/fnc_moduleSpawnReinforcements.sqf b/addons/modules/functions/fnc_moduleSpawnReinforcements.sqf index f44ff252d..0679e7a52 100644 --- a/addons/modules/functions/fnc_moduleSpawnReinforcements.sqf +++ b/addons/modules/functions/fnc_moduleSpawnReinforcements.sqf @@ -10,8 +10,7 @@ * 3: LZ Position * 4: RP Position * 5: RTB and Despawn - * 6: Insertion Method - * - 0: Land, 1: Paradrop, 2: Fastrope + * 6: Insertion Method * 7: Infantry Behaviour * - 0: Default, 1: Relaxed, 2: Cautious, 3: Combat * 8: Fly Height @@ -83,23 +82,14 @@ private _infantryGroup = createGroup [_side, true]; _unit moveInCargo _vehicle; } forEach _infantryTypes; -// Use normal transport unload if fastroping is not available -if (_insertionMethod == 2 && {!isClass (configFile >> "CfgPatches" >> "ace_fastroping") || {getNumber (_vehicleConfig >> "ace_fastroping_enabled") == 0}}) then { - _insertionMethod = 0; -}; - // Add waypoint to make vehicle drop units off at the LZ // Handle insertion method parameter for air vehicles private _waypoint = _vehicleGroup addWaypoint [_positionLZ, WAYPOINT_RADIUS]; -if (_isAir && {_insertionMethod > 0}) then { - private _script = [ - QPATHTOEF(ai,functions\fnc_waypointParadrop.sqf), - QPATHTOEF(ai,functions\fnc_waypointFastrope.sqf) - ] select (_insertionMethod == 2); - - _waypoint setWaypointType "SCRIPTED"; - _waypoint setWaypointScript _script; +if (_isAir) then { + private _waypointConfig = configFile >> "ZEN_WaypointTypes" >> _insertionMethod; + _waypoint setWaypointType getText (_waypointConfig >> "type"); + _waypoint setWaypointScript getText (_waypointConfig >> "script"); } else { _waypoint setWaypointType "TR UNLOAD"; }; diff --git a/addons/modules/gui.hpp b/addons/modules/gui.hpp index 3b0d23826..103a653df 100644 --- a/addons/modules/gui.hpp +++ b/addons/modules/gui.hpp @@ -1139,15 +1139,6 @@ class GVAR(RscSpawnReinforcements): GVAR(RscDisplay) { class Insertion: VehicleLZ { idc = IDC_SPAWNREINFORCEMENTS_VEHICLE_INSERTION; y = POS_H(3.3); - class Items { - class Land { - text = ECSTRING(ai,Land); - default = 1; - }; - class Paradrop { - text = ECSTRING(ai,Paradrop); - }; - }; }; class FlyHeightLabel: VehicleLZLabel { text = CSTRING(ModuleFlyHeight); diff --git a/addons/placement/XEH_postInit.sqf b/addons/placement/XEH_postInit.sqf index 79602cdac..97beff33a 100644 --- a/addons/placement/XEH_postInit.sqf +++ b/addons/placement/XEH_postInit.sqf @@ -23,7 +23,7 @@ private _objectType = _ctrlTreeRecent tvData _selectedPath; - if (!isClass (configFile >> "CfgVehicles" >> _objectType)) then { + if (!isClass (configFile >> "CfgVehicles" >> _objectType) || {_objectType isKindOf "Logic"}) then { _objectType = ""; }; diff --git a/addons/placement/functions/fnc_handleTreeChange.sqf b/addons/placement/functions/fnc_handleTreeChange.sqf index 3ccfda2db..40dba404e 100644 --- a/addons/placement/functions/fnc_handleTreeChange.sqf +++ b/addons/placement/functions/fnc_handleTreeChange.sqf @@ -26,7 +26,7 @@ private _objectType = if (_mode in [0, 4] && {call EFUNC(common,isPlacementActiv private _ctrlTree = call EFUNC(common,getActiveTree); private _data = _ctrlTree tvData tvCurSel _ctrlTree; - if (_mode == 4 && {!isClass (configFile >> "CfgVehicles" >> _data)}) then { + if (_mode == 4 && {!isClass (configFile >> "CfgVehicles" >> _data) || {_data isKindOf "Logic"}}) then { _data = ""; }; diff --git a/extras/assets/logo/black/ZEN-Logo.jpg b/extras/assets/logo/black/ZEN-Logo.jpg new file mode 100644 index 000000000..fe3e7f9eb Binary files /dev/null and b/extras/assets/logo/black/ZEN-Logo.jpg differ diff --git a/extras/assets/logo/black/ZEN-Logo.png b/extras/assets/logo/black/ZEN-Logo.png new file mode 100644 index 000000000..ca7aa1835 Binary files /dev/null and b/extras/assets/logo/black/ZEN-Logo.png differ diff --git a/extras/assets/logo/logo_zen_black.png b/extras/assets/logo/logo_zen_black.png deleted file mode 100644 index aa150df37..000000000 Binary files a/extras/assets/logo/logo_zen_black.png and /dev/null differ diff --git a/extras/assets/logo/white/ZEN-Logo.jpg b/extras/assets/logo/white/ZEN-Logo.jpg new file mode 100644 index 000000000..7d41eabfa Binary files /dev/null and b/extras/assets/logo/white/ZEN-Logo.jpg differ diff --git a/extras/assets/logo/white/ZEN-Logo.png b/extras/assets/logo/white/ZEN-Logo.png new file mode 100644 index 000000000..14454442a Binary files /dev/null and b/extras/assets/logo/white/ZEN-Logo.png differ diff --git a/extras/assets/logo/logo_zen_ca.png b/extras/assets/logo/workshop/logo_zen_ca.png similarity index 100% rename from extras/assets/logo/logo_zen_ca.png rename to extras/assets/logo/workshop/logo_zen_ca.png diff --git a/extras/assets/logo/logo_zen_small_ca.png b/extras/assets/logo/workshop/logo_zen_small_ca.png similarity index 100% rename from extras/assets/logo/logo_zen_small_ca.png rename to extras/assets/logo/workshop/logo_zen_small_ca.png diff --git a/mod.cpp b/mod.cpp index 42d0a76e6..c775052e9 100644 --- a/mod.cpp +++ b/mod.cpp @@ -1,8 +1,8 @@ -name = "Zeus Enhanced 1.13.0"; +name = "Zeus Enhanced 1.14.0"; picture = "logo_zen_ca.paa"; actionName = "GitHub"; action = "https://github.com/zen-mod/ZEN"; -description = "Zeus Enhanced - Version 1.13.0"; +description = "Zeus Enhanced - Version 1.14.0"; logo = "logo_zen_small_ca.paa"; logoOver = "logo_zen_small_ca.paa"; tooltip = "Zeus Enhanced"; diff --git a/optionals/compat_ace/CfgWaypointTypes.hpp b/optionals/compat_ace/CfgWaypointTypes.hpp new file mode 100644 index 000000000..2addff1a0 --- /dev/null +++ b/optionals/compat_ace/CfgWaypointTypes.hpp @@ -0,0 +1,7 @@ +class ZEN_WaypointTypes { + class Fastrope { + displayName = CSTRING(Fastrope); + type = "SCRIPTED"; + script = QPATHTOF(functions\fnc_waypointFastrope.sqf); + }; +}; diff --git a/optionals/compat_ace/XEH_PREP.hpp b/optionals/compat_ace/XEH_PREP.hpp index f7dc50016..63541c91a 100644 --- a/optionals/compat_ace/XEH_PREP.hpp +++ b/optionals/compat_ace/XEH_PREP.hpp @@ -1,2 +1,3 @@ +PREP(canFastrope); PREP(canRemoteControl); PREP(remoteControl); diff --git a/optionals/compat_ace/config.cpp b/optionals/compat_ace/config.cpp index 3404921c4..3997b34a0 100644 --- a/optionals/compat_ace/config.cpp +++ b/optionals/compat_ace/config.cpp @@ -6,7 +6,12 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"zen_modules", "ace_interaction", "ace_zeus"}; + requiredAddons[] = { + "zen_ai", + "zen_modules", + "ace_interaction", + "ace_zeus" + }; author = ECSTRING(main,Author); authors[] = {"mharis001"}; url = ECSTRING(main,URL); @@ -18,4 +23,5 @@ PRELOAD_ADDONS; #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" +#include "CfgWaypointTypes.hpp" #include "ACE_ZeusActions.hpp" diff --git a/optionals/compat_ace/functions/fnc_canFastrope.sqf b/optionals/compat_ace/functions/fnc_canFastrope.sqf new file mode 100644 index 000000000..4b8656ed5 --- /dev/null +++ b/optionals/compat_ace/functions/fnc_canFastrope.sqf @@ -0,0 +1,25 @@ +#include "script_component.hpp" +/* + * Author: Kex + * Checks if the given vehicle can be used for fastroping. + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * Can Fastrope + * + * Example: + * [_vehicle] call zen_compat_ace_fnc_canFastrope + * + * Public: No + */ + +params ["_vehicle"]; + +if (_vehicle isEqualType objNull) then { + _vehicle = typeOf _vehicle; +}; + +isClass (configFile >> "CfgPatches" >> "ace_fastroping") +&& {getNumber (configFile >> "CfgVehicles" >> _vehicle >> QACEGVAR(fastroping,enabled)) > 0} diff --git a/addons/ai/functions/fnc_waypointFastrope.sqf b/optionals/compat_ace/functions/fnc_waypointFastrope.sqf similarity index 83% rename from addons/ai/functions/fnc_waypointFastrope.sqf rename to optionals/compat_ace/functions/fnc_waypointFastrope.sqf index fe1835be2..8689ef09a 100644 --- a/addons/ai/functions/fnc_waypointFastrope.sqf +++ b/optionals/compat_ace/functions/fnc_waypointFastrope.sqf @@ -2,7 +2,7 @@ /* * Author: mharis001 * Scripted waypoint that makes a group fastrope at the waypoint's position. - * Requires ace_fastroping to be loaded. + * Requires ACE Fastroping to be loaded. * * Arguments: * 0: Group @@ -12,7 +12,7 @@ * Waypoint Finished * * Example: - * _waypoint setWaypointScript "\x\zen\addons\ai\functions\fnc_waypointFastrope.sqf" + * _waypoint setWaypointScript "\x\zen\addons\compat_ace\functions\fnc_waypointFastrope.sqf" * * Public: No */ @@ -28,7 +28,7 @@ params ["_group", "_waypointPosition"]; private _waypoint = [_group, currentWaypoint _group]; _waypoint setWaypointDescription localize LSTRING(Fastrope); -// Exit if ace_fastroping is not loaded +// Exit if ACE Fastroping is not loaded if (!isClass (configFile >> "CfgPatches" >> "ace_fastroping")) exitWith {true}; private _vehicle = vehicle leader _group; @@ -36,14 +36,12 @@ private _vehicle = vehicle leader _group; // Exit if the helicopter has no passengers that can be deployed by fastrope if (crew _vehicle findIf {assignedVehicleRole _x select 0 == "cargo"} == -1) exitWith {true}; -private _enabled = getNumber (configOf _vehicle >> "ace_fastroping_enabled"); - // Exit if fastroping is not enabled for the helicopter -if (_enabled == 0) exitWith {true}; +if !(_vehicle call FUNC(canFastrope)) exitWith {true}; // Equip the helicopter with FRIES if necessary -if (_enabled == 2 && {isNull (_vehicle getVariable ["ace_fastroping_FRIES", objNull])}) then { - _vehicle call ace_fastroping_fnc_equipFRIES; +if (isNull (_vehicle getVariable [QACEGVAR(fastroping,FRIES), objNull])) then { + _vehicle call ACEFUNC(fastroping,equipFRIES); }; // Increase the skill of the pilot for better flying @@ -115,14 +113,14 @@ waitUntil { }; // Make units fastrope once the helicopter is in position -[_vehicle, false, false] call ace_fastroping_fnc_deployAI; +[_vehicle, false, false] call ACEFUNC(fastroping,deployAI); // Wait for all units to finish fastroping -waitUntil {_vehicle getVariable ["ace_fastroping_deployedRopes", []] isNotEqualTo []}; -waitUntil {_vehicle getVariable ["ace_fastroping_deployedRopes", []] isEqualTo []}; +waitUntil {_vehicle getVariable [QACEGVAR(fastroping,deployedRopes), []] isNotEqualTo []}; +waitUntil {_vehicle getVariable [QACEGVAR(fastroping,deployedRopes), []] isEqualTo []}; // Stow the helicopter's fastrope system -_vehicle call ace_fastroping_fnc_stowFRIES; +_vehicle call ACEFUNC(fastroping,stowFRIES); _vehicle flyInHeight 100; _driver setSkill _skill; diff --git a/optionals/compat_ace/stringtable.xml b/optionals/compat_ace/stringtable.xml index c8aa98b04..cc01a22b2 100644 --- a/optionals/compat_ace/stringtable.xml +++ b/optionals/compat_ace/stringtable.xml @@ -16,5 +16,19 @@ ACE 제우스에 의해 추가된 모듈을 숨깁니다. 디스플레이 재시작이 필요합니다. ACE Zeus と重複しているモジュールを非表示にします。これには再描画が必要です。 + + Fastrope + Спуск по тросу + Corde lisse + Schnelles Abseilen + Zjazd na linach + Cabo rápido + ファストロープ + 패스트로프 + Rapel Rapido + 快速索降 + 快速索降 + Discesa veloce + diff --git a/optionals/compat_advanced_rappelling/$PBOPREFIX$ b/optionals/compat_advanced_rappelling/$PBOPREFIX$ new file mode 100644 index 000000000..7bc8951ae --- /dev/null +++ b/optionals/compat_advanced_rappelling/$PBOPREFIX$ @@ -0,0 +1 @@ +x\zen\addons\compat_advanced_rappelling diff --git a/optionals/compat_advanced_rappelling/CfgEventHandlers.hpp b/optionals/compat_advanced_rappelling/CfgEventHandlers.hpp new file mode 100644 index 000000000..865276cfb --- /dev/null +++ b/optionals/compat_advanced_rappelling/CfgEventHandlers.hpp @@ -0,0 +1,11 @@ +class Extended_PreStart_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); + }; +}; + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); + }; +}; diff --git a/optionals/compat_advanced_rappelling/CfgWaypointTypes.hpp b/optionals/compat_advanced_rappelling/CfgWaypointTypes.hpp new file mode 100644 index 000000000..f6b583147 --- /dev/null +++ b/optionals/compat_advanced_rappelling/CfgWaypointTypes.hpp @@ -0,0 +1,8 @@ +class ZEN_WaypointTypes { + class AdvancedRappel { + displayName = CSTRING(Rappel); + type = "SCRIPTED"; + script = QPATHTOF(functions\fnc_waypointRappel.sqf); + condition = QUOTE(!isNil 'AR_RAPPELLING_INIT'); + }; +}; diff --git a/optionals/compat_advanced_rappelling/XEH_PREP.hpp b/optionals/compat_advanced_rappelling/XEH_PREP.hpp new file mode 100644 index 000000000..ee8faa910 --- /dev/null +++ b/optionals/compat_advanced_rappelling/XEH_PREP.hpp @@ -0,0 +1 @@ +PREP(canRappel); diff --git a/optionals/compat_advanced_rappelling/XEH_preInit.sqf b/optionals/compat_advanced_rappelling/XEH_preInit.sqf new file mode 100644 index 000000000..b47cf6628 --- /dev/null +++ b/optionals/compat_advanced_rappelling/XEH_preInit.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP_RECOMPILE_START; +#include "XEH_PREP.hpp" +PREP_RECOMPILE_END; + +ADDON = true; diff --git a/optionals/compat_advanced_rappelling/XEH_preStart.sqf b/optionals/compat_advanced_rappelling/XEH_preStart.sqf new file mode 100644 index 000000000..022888575 --- /dev/null +++ b/optionals/compat_advanced_rappelling/XEH_preStart.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +#include "XEH_PREP.hpp" diff --git a/optionals/compat_advanced_rappelling/config.cpp b/optionals/compat_advanced_rappelling/config.cpp new file mode 100644 index 000000000..5f7b86bb1 --- /dev/null +++ b/optionals/compat_advanced_rappelling/config.cpp @@ -0,0 +1,20 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"zen_ai"}; + author = ECSTRING(main,Author); + authors[] = {"Kex"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +PRELOAD_ADDONS; + +#include "CfgEventHandlers.hpp" +#include "CfgWaypointTypes.hpp" diff --git a/optionals/compat_advanced_rappelling/functions/fnc_canRappel.sqf b/optionals/compat_advanced_rappelling/functions/fnc_canRappel.sqf new file mode 100644 index 000000000..f10db30d3 --- /dev/null +++ b/optionals/compat_advanced_rappelling/functions/fnc_canRappel.sqf @@ -0,0 +1,23 @@ +#include "script_component.hpp" +/* + * Author: Kex + * Checks if the given vehicle can be used for rappelling. + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * Can Rappel + * + * Example: + * [_vehicle] call zen_compat_advanced_rappelling_fnc_canRappel + * + * Public: No + */ + +params ["_vehicle"]; + +!isNil "AR_RAPPELLING_INIT" && { + private _supportedVehicles = missionNamespace getVariable ["AR_SUPPORTED_VEHICLES_OVERRIDE", AR_SUPPORTED_VEHICLES]; + _supportedVehicles findIf {_vehicle isKindOf _x} != -1 +} diff --git a/optionals/compat_advanced_rappelling/functions/fnc_waypointRappel.sqf b/optionals/compat_advanced_rappelling/functions/fnc_waypointRappel.sqf new file mode 100644 index 000000000..eee77474c --- /dev/null +++ b/optionals/compat_advanced_rappelling/functions/fnc_waypointRappel.sqf @@ -0,0 +1,50 @@ +#include "script_component.hpp" +/* + * Author: Kex + * Scripted waypoint that makes a group rappel at the waypoint's position. + * Requires Duda's Advanced Rappelling to be loaded. + * + * Arguments: + * 0: Group + * 1: Waypoint Position + * + * Return Value: + * Waypoint Finished + * + * Example: + * _waypoint setWaypointScript "\x\zen\addons\compat_advanced_rappelling\functions\fnc_waypointRappel.sqf" + * + * Public: No + */ + +#define RAPPEL_HEIGHT 15 + +params ["_group", "_waypointPosition"]; + +private _waypoint = [_group, currentWaypoint _group]; +_waypoint setWaypointDescription localize LSTRING(Rappel); + +private _vehicle = vehicle leader _group; + +// Exit if the helicopter has no passengers that can be deployed by rappelling +if (crew _vehicle findIf {assignedVehicleRole _x select 0 == "cargo"} == -1) exitWith {true}; + +// Exit if rappelling is not enabled for the helicopter +if !(_vehicle call FUNC(canRappel)) exitWith {true}; + +// Increase the skill of the pilot for better flying +private _driver = driver _vehicle; +private _skill = skill _driver; +_driver allowFleeing 0; +_driver setSkill 1; + +// Set the group's behaviour to careless to prevent it from flying away in combat +private _behaviour = behaviour _vehicle; +_group setBehaviour "CARELESS"; + +[_vehicle, RAPPEL_HEIGHT, AGLToASL _waypointPosition] call AR_Rappel_All_Cargo; + +_driver setSkill _skill; +_group setBehaviour _behaviour; + +true diff --git a/optionals/compat_advanced_rappelling/functions/script_component.hpp b/optionals/compat_advanced_rappelling/functions/script_component.hpp new file mode 100644 index 000000000..bc445d61c --- /dev/null +++ b/optionals/compat_advanced_rappelling/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\x\zen\addons\compat_advanced_rappelling\script_component.hpp" diff --git a/optionals/compat_advanced_rappelling/script_component.hpp b/optionals/compat_advanced_rappelling/script_component.hpp new file mode 100644 index 000000000..a4ae270a7 --- /dev/null +++ b/optionals/compat_advanced_rappelling/script_component.hpp @@ -0,0 +1,17 @@ +#define COMPONENT compat_advanced_rappelling +#define COMPONENT_BEAUTIFIED Advanced Rappelling Compatibility +#include "\x\zen\addons\main\script_mod.hpp" + +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define ENABLE_PERFORMANCE_COUNTERS + +#ifdef DEBUG_ENABLED_COMPAT_ADVANCED_RAPPELLING + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_COMPAT_ADVANCED_RAPPELLING + #define DEBUG_SETTINGS DEBUG_SETTINGS_COMPAT_ADVANCED_RAPPELLING +#endif + +#include "\x\zen\addons\main\script_macros.hpp" diff --git a/optionals/compat_advanced_rappelling/stringtable.xml b/optionals/compat_advanced_rappelling/stringtable.xml new file mode 100644 index 000000000..31704aad3 --- /dev/null +++ b/optionals/compat_advanced_rappelling/stringtable.xml @@ -0,0 +1,9 @@ + + + + + Rappel + Abseilen + + +