Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions addons/modules/functions/fnc_gui_editableObjects.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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"];

Expand Down Expand Up @@ -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;

Expand All @@ -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
Expand All @@ -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;
Expand Down
17 changes: 12 additions & 5 deletions addons/modules/functions/fnc_moduleEditableObjects.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
* 0: Position <ARRAY>
* 1: Editing Mode <BOOL>
* 2: Curator <OBJECT>
* 3: Range <NUMBER>
* 4: Filter <ARRAY>
* 3: Alive mode <NUMBER> (0: Both, 1: Alive, 2: Dead)
* 4: Range <NUMBER>
* 5: Filter <ARRAY>
*
* 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 = [];
Expand Down Expand Up @@ -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);
45 changes: 30 additions & 15 deletions addons/modules/gui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -395,79 +395,94 @@ 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));
};
class FilterAllText: RscText {
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));
shadow = 0;
};
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));
};
};
};
Expand Down
1 change: 1 addition & 0 deletions addons/modules/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
59 changes: 59 additions & 0 deletions addons/modules/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,65 @@
<Italian>Aggiorna oggetti modificabili</Italian>
<French>Mise à jour des objets éditables</French>
</Key>
<Key ID="STR_ZEN_Modules_ModuleEditableObjects_Alive">
<English>Alive</English>
<Russian>Живой</Russian>
<German>Lebendig</German>
<Polish>Żywy</Polish>
<Japanese>生存</Japanese>
<Korean>살아있는</Korean>
<Chinesesimp>活着</Chinesesimp>
<Chinese>活著</Chinese>
<Italian>Vivo</Italian>
<French>Vivant</French>
</Key>
<Key ID="STR_ZEN_Modules_ModuleEditableObjects_Alive_Tooltip">
<English>Controls whether the objects should be alive, dead or both.</English>
<Russian>Определяет, должны ли объекты быть живыми, мертвыми или и тем и другим</Russian>
<German>Steuert, ob die Objekte lebendig, tot oder beides sein sollen.</German>
<Polish>Ustala czy obiekty mają być żywe, martwe czy oba.</Polish>
<Japanese>オブジェクトが生存しているか、死亡しているか、またはその両方であるかを制御します。</Japanese>
<Chinesesimp>控制物体是活着、死了还是两者都有。</Chinesesimp>
<Chinese>控制物體是活著、死了還是兩者都有。</Chinese>
<Italian>Controlla se gli oggetti devono essere vivi, morti o entrambi.</Italian>
<French>Contrôle si les objets doivent être vivants, morts ou les deux.</French>
</Key>
<Key ID="STR_ZEN_Modules_ModuleEditableObjects_Alive_Alive">
<English>Alive</English>
<Russian>Живой</Russian>
<German>Lebendig</German>
<Polish>Żywy</Polish>
<Japanese>生存</Japanese>
<Korean>살아있는</Korean>
<Chinesesimp>活着</Chinesesimp>
<Chinese>活著</Chinese>
<Italian>Vivo</Italian>
<French>Vivant</French>
</Key>
<Key ID="STR_ZEN_Modules_ModuleEditableObjects_Alive_Both">
<English>Both</English>
<Russian>Оба</Russian>
<German>Beides</German>
<Polish>Oba</Polish>
<Japanese>両方</Japanese>
<Korean>둘 다</Korean>
<Chinesesimp>两者都有</Chinesesimp>
<Chinese>兩者都有</Chinese>
<Italian>Entrambi</Italian>
<French>Les deux</French>
</Key>
<Key ID="STR_ZEN_Modules_ModuleEditableObjects_Alive_Dead">
<English>Dead</English>
<Russian>Мертвый</Russian>
<German>Tot</German>
<Polish>Martwy</Polish>
<Japanese>死亡</Japanese>
<Korean>죽은</Korean>
<Chinesesimp>死了</Chinesesimp>
<Chinese>死了</Chinese>
<Italian>Morto</Italian>
<French>Mort</French>
</Key>
<Key ID="STR_ZEN_Modules_ModuleEditableObjects_EditingMode">
<English>Editing Mode</English>
<Russian>Режим редактирования</Russian>
Expand Down