From 67f709c88dfc791d968b75cb6eba8ab4ca043ada Mon Sep 17 00:00:00 2001 From: Oliver Schieche Date: Fri, 21 Aug 2026 12:59:21 +0200 Subject: [PATCH] Added object alive state filter in editable objects dialog --- .../functions/fnc_gui_editableObjects.sqf | 14 +++-- .../functions/fnc_moduleEditableObjects.sqf | 17 ++++-- addons/modules/gui.hpp | 45 +++++++++----- addons/modules/script_component.hpp | 1 + addons/modules/stringtable.xml | 59 +++++++++++++++++++ 5 files changed, 112 insertions(+), 24 deletions(-) diff --git a/addons/modules/functions/fnc_gui_editableObjects.sqf b/addons/modules/functions/fnc_gui_editableObjects.sqf index ba4b3e75b..00f9bf56e 100644 --- a/addons/modules/functions/fnc_gui_editableObjects.sqf +++ b/addons/modules/functions/fnc_gui_editableObjects.sqf @@ -18,8 +18,8 @@ params ["_display", "_logic"]; -private _selections = GVAR(saved) getVariable [QGVAR(editableObjects), [1, 1, 0, 100, [true, true, true, true]]]; -_selections params ["_editingMode", "_curators", "_rangeMode", "_range", "_filter"]; +private _selections = GVAR(saved) getVariable [QGVAR(editableObjects), [1, 1, 0, 0, 100, [true, true, true, true]]]; +_selections params ["_editingMode", "_curators", "_alive", "_rangeMode", "_range", "_filter"]; _display setVariable [QGVAR(position), ASLToAGL getPosASL _logic]; deleteVehicle _logic; @@ -30,6 +30,9 @@ _ctrlEditingMode lbSetCurSel _editingMode; private _ctrlCurators = _display displayCtrl IDC_EDITABLEOBJECTS_CURATORS; _ctrlCurators lbSetCurSel _curators; +private _ctrlAlive = _display displayCtrl IDC_EDITABLEOBJECTS_ALIVE; +_ctrlAlive lbSetCurSel _alive; + private _fnc_rangeModeChanged = { params ["_ctrlRangeMode", "_index"]; @@ -98,6 +101,9 @@ private _fnc_onConfirm = { private _ctrlCurators = _display displayCtrl IDC_EDITABLEOBJECTS_CURATORS; private _curators = lbCurSel _ctrlCurators; + private _ctrlAlive = _display displayCtrl IDC_EDITABLEOBJECTS_ALIVE; + private _alive = lbCurSel _ctrlAlive; + private _ctrlRangeMode = _display displayCtrl IDC_EDITABLEOBJECTS_RANGE_MODE; private _rangeMode = lbCurSel _ctrlRangeMode; @@ -111,7 +117,7 @@ private _fnc_onConfirm = { cbChecked (_display displayCtrl IDC_EDITABLEOBJECTS_FILTER_STATIC) ]; - private _selections = [_editingMode, _curators, _rangeMode, _range, _filter]; + private _selections = [_editingMode, _curators, _alive, _rangeMode, _range, _filter]; GVAR(saved) setVariable [QGVAR(editableObjects), _selections]; // Use objNull for all curators @@ -122,7 +128,7 @@ private _fnc_onConfirm = { _range = -1; }; - [QGVAR(moduleEditableObjects), [_position, _editingMode > 0, _curator, _range, _filter]] call CBA_fnc_serverEvent; + [QGVAR(moduleEditableObjects), [_position, _editingMode > 0, _curator, _alive, _range, _filter]] call CBA_fnc_serverEvent; }; private _ctrlButtonOK = _display displayCtrl IDC_OK; diff --git a/addons/modules/functions/fnc_moduleEditableObjects.sqf b/addons/modules/functions/fnc_moduleEditableObjects.sqf index eebfcabc5..9aac0b976 100644 --- a/addons/modules/functions/fnc_moduleEditableObjects.sqf +++ b/addons/modules/functions/fnc_moduleEditableObjects.sqf @@ -7,19 +7,19 @@ * 0: Position * 1: Editing Mode * 2: Curator - * 3: Range - * 4: Filter + * 3: Alive mode (0: Both, 1: Alive, 2: Dead) + * 4: Range + * 5: Filter * * Return Value: * None * * Example: - * [[0, 0, 0], true, objNull, -1, [true, true, true, true]] call zen_modules_fnc_moduleEditableObjects + * [[0, 0, 0], true, objNull, 0, -1, [true, true, true, true]] call zen_modules_fnc_moduleEditableObjects * * Public: No */ - -params ["_position", "_editingMode", "_curator", "_range", "_filter"]; +params ["_position", "_editingMode", "_curator", "_alive", "_range", "_filter"]; _filter params ["_allowAll", "_allowUnits", "_allowVehicles", "_allowStatic"]; private _objects = []; @@ -62,4 +62,11 @@ if (_range == -1) then { _objects = nearestObjects [_position, _types, _range, true]; }; +if (_alive isNotEqualTo 0) then { + private _required = (_alive isEqualTo 1); + _objects = _objects select { + alive _x isEqualTo _required; + }; +}; + [_objects, _editingMode, _curator] call EFUNC(common,updateEditableObjects); diff --git a/addons/modules/gui.hpp b/addons/modules/gui.hpp index 72a011fa5..09795760f 100644 --- a/addons/modules/gui.hpp +++ b/addons/modules/gui.hpp @@ -370,7 +370,7 @@ class GVAR(RscEditableObjects): GVAR(RscDisplay) { class Title: Title {}; class Background: Background {}; class Content: Content { - h = QUOTE(POS_H(8.2)); + h = QUOTE(POS_H(9.3)); class controls { class EditingModeLabel: EGVAR(common,RscLabel) { text = CSTRING(ModuleEditableObjects_EditingMode); @@ -395,43 +395,58 @@ class GVAR(RscEditableObjects): GVAR(RscDisplay) { idc = IDC_EDITABLEOBJECTS_CURATORS; y = QUOTE(POS_H(1.1)); }; + class AliveLabel: EGVAR(common,RscLabel) { + text = CSTRING(ModuleEditableObjects_Alive); + tooltip = CSTRING(ModuleEditableObjects_Alive_Tooltip); + y = QUOTE(POS_H(2.2)); + }; + class Alive: ctrlToolbox { + idc = IDC_EDITABLEOBJECTS_ALIVE; + x = QUOTE(POS_W(10.1)); + y = QUOTE(POS_H(2.2)); + w = QUOTE(POS_W(15.9)); + h = QUOTE(POS_H(1)); + rows = 1; + columns = 3; + strings[] = {CSTRING(ModuleEditableObjects_Alive_Both), CSTRING(ModuleEditableObjects_Alive_Alive), CSTRING(ModuleEditableObjects_Alive_Dead)}; + }; class RangeLabel: EGVAR(common,RscLabel) { text = ECSTRING(common,Range); - y = QUOTE(POS_H(2.2)); + y = QUOTE(POS_H(3.3)); h = QUOTE(POS_H(2.1)); }; class RangeMode: EditingMode { idc = IDC_EDITABLEOBJECTS_RANGE_MODE; - y = QUOTE(POS_H(2.2)); + y = QUOTE(POS_H(3.3)); strings[] = {ECSTRING(common,Radius), CSTRING(ModuleEditableObjects_AllMissionObjects)}; }; class RangeSlider: ctrlXSliderH { idc = IDC_EDITABLEOBJECTS_RANGE_SLIDER; x = QUOTE(POS_W(10.1)); - y = QUOTE(POS_H(3.3)); + y = QUOTE(POS_H(4.4)); w = QUOTE(POS_W(13.4)); h = QUOTE(POS_H(1)); }; class RangeEdit: EGVAR(common,RscEdit) { idc = IDC_EDITABLEOBJECTS_RANGE_EDIT; x = QUOTE(POS_W(23.6)); - y = QUOTE(POS_H(3.3)); + y = QUOTE(POS_H(4.4)); w = QUOTE(POS_W(2.4)); h = QUOTE(POS_H(1)); }; class FilterLabel: EGVAR(common,RscLabel) { text = ECSTRING(common,Filter); - y = QUOTE(POS_H(4.4)); + y = QUOTE(POS_H(5.5)); h = QUOTE(POS_H(3.8)); }; class FilterBackground: EGVAR(common,RscBackground) { - y = QUOTE(POS_H(4.4)); + y = QUOTE(POS_H(5.5)); h = QUOTE(POS_H(3.8)); }; class FilterAll: ctrlCheckbox { idc = IDC_EDITABLEOBJECTS_FILTER_ALL; x = QUOTE(POS_W(10.1)); - y = QUOTE(POS_H(4.5)); + y = QUOTE(POS_H(5.6)); w = QUOTE(POS_W(0.9)); h = QUOTE(POS_H(0.9)); }; @@ -439,7 +454,7 @@ class GVAR(RscEditableObjects): GVAR(RscDisplay) { idc = -1; text = ECSTRING(common,All); x = QUOTE(POS_W(11)); - y = QUOTE(POS_H(4.5)); + y = QUOTE(POS_H(5.6)); w = QUOTE(POS_W(10)); h = QUOTE(POS_H(0.9)); sizeEx = QUOTE(POS_H(0.9)); @@ -447,27 +462,27 @@ class GVAR(RscEditableObjects): GVAR(RscDisplay) { }; class FilterUnits: FilterAll { idc = IDC_EDITABLEOBJECTS_FILTER_UNITS; - y = QUOTE(POS_H(5.4)); + y = QUOTE(POS_H(6.5)); }; class FilterUnitsText: FilterAllText { text = ECSTRING(common,Units); - y = QUOTE(POS_H(5.4)); + y = QUOTE(POS_H(6.5)); }; class FilterVehicles: FilterAll { idc = IDC_EDITABLEOBJECTS_FILTER_VEHICLES; - y = QUOTE(POS_H(6.3)); + y = QUOTE(POS_H(7.4)); }; class FilterVehiclesText: FilterAllText { text = ECSTRING(common,Vehicles); - y = QUOTE(POS_H(6.3)); + y = QUOTE(POS_H(7.4)); }; class FilterStatic: FilterAll { idc = IDC_EDITABLEOBJECTS_FILTER_STATIC; - y = QUOTE(POS_H(7.2)); + y = QUOTE(POS_H(8.3)); }; class FilterStaticText: FilterAllText { text = ECSTRING(common,Static); - y = QUOTE(POS_H(7.2)); + y = QUOTE(POS_H(8.3)); }; }; }; diff --git a/addons/modules/script_component.hpp b/addons/modules/script_component.hpp index e76287a1a..c7186e5a5 100644 --- a/addons/modules/script_component.hpp +++ b/addons/modules/script_component.hpp @@ -91,6 +91,7 @@ #define IDC_EDITABLEOBJECTS_FILTER_UNITS 61907 #define IDC_EDITABLEOBJECTS_FILTER_VEHICLES 61908 #define IDC_EDITABLEOBJECTS_FILTER_STATIC 61909 +#define IDC_EDITABLEOBJECTS_ALIVE 61910 #define IDC_EXECUTECODE 62100 #define IDC_EXECUTECODE_HISTORY 62101 diff --git a/addons/modules/stringtable.xml b/addons/modules/stringtable.xml index a7ec07c98..a1ea2eb1c 100644 --- a/addons/modules/stringtable.xml +++ b/addons/modules/stringtable.xml @@ -1064,6 +1064,65 @@ Aggiorna oggetti modificabili Mise à jour des objets éditables + + Alive + Живой + Lebendig + Żywy + 生存 + 살아있는 + 活着 + 活著 + Vivo + Vivant + + + Controls whether the objects should be alive, dead or both. + Определяет, должны ли объекты быть живыми, мертвыми или и тем и другим + Steuert, ob die Objekte lebendig, tot oder beides sein sollen. + Ustala czy obiekty mają być żywe, martwe czy oba. + オブジェクトが生存しているか、死亡しているか、またはその両方であるかを制御します。 + 控制物体是活着、死了还是两者都有。 + 控制物體是活著、死了還是兩者都有。 + Controlla se gli oggetti devono essere vivi, morti o entrambi. + Contrôle si les objets doivent être vivants, morts ou les deux. + + + Alive + Живой + Lebendig + Żywy + 生存 + 살아있는 + 活着 + 活著 + Vivo + Vivant + + + Both + Оба + Beides + Oba + 両方 + 둘 다 + 两者都有 + 兩者都有 + Entrambi + Les deux + + + Dead + Мертвый + Tot + Martwy + 死亡 + 죽은 + 死了 + 死了 + Morto + Mort + Editing Mode Режим редактирования