2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2016-11-15 12:07:48 +00:00
|
|
|
/*
|
2018-04-24 17:46:59 +00:00
|
|
|
* Author: Fisher, SilentSpike, mharis001
|
|
|
|
* Initializes the "Editable Objects" Zeus module display.
|
2016-11-15 12:07:48 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: editableObjects controls group <CONTROL>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [CONTROL] call ace_zeus_fnc_ui_editableObjects
|
|
|
|
*
|
2016-11-15 12:07:48 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_control"];
|
|
|
|
|
2018-04-24 17:46:59 +00:00
|
|
|
// Generic Init
|
2016-11-15 12:07:48 +00:00
|
|
|
private _display = ctrlParent _control;
|
|
|
|
private _ctrlButtonOK = _display displayCtrl 1; //IDC_OK
|
|
|
|
private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull);
|
2018-04-24 17:46:59 +00:00
|
|
|
TRACE_1("Logic Object",_logic);
|
2016-11-15 12:07:48 +00:00
|
|
|
|
2018-04-24 17:46:59 +00:00
|
|
|
_control ctrlRemoveAllEventHandlers "SetFocus";
|
2016-11-15 12:07:48 +00:00
|
|
|
|
2018-04-24 17:46:59 +00:00
|
|
|
// Specific onLoad stuff
|
|
|
|
(_display displayCtrl 19181) lbSetCurSel 1;
|
|
|
|
(_display displayCtrl 19182) lbSetCurSel 1;
|
2016-11-15 12:07:48 +00:00
|
|
|
|
|
|
|
private _fnc_onUnload = {
|
|
|
|
private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull);
|
|
|
|
if (isNull _logic) exitWith {};
|
|
|
|
|
2018-04-24 17:46:59 +00:00
|
|
|
deleteVehicle _logic;
|
2016-11-15 12:07:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
private _fnc_onConfirm = {
|
|
|
|
params [["_ctrlButtonOK", controlNull, [controlNull]]];
|
|
|
|
|
|
|
|
private _display = ctrlParent _ctrlButtonOK;
|
|
|
|
if (isNull _display) exitWith {};
|
|
|
|
|
|
|
|
private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull);
|
|
|
|
if (isNull _logic) exitWith {};
|
|
|
|
|
2018-04-24 17:46:59 +00:00
|
|
|
private _radius = GETVAR(_display,GVAR(radius),100);
|
|
|
|
private _editingMode = lbCurSel (_display displayCtrl 19181) > 0;
|
2018-09-13 13:40:55 +00:00
|
|
|
private _allCurators = [getAssignedCuratorLogic player, objNull] select lbCurSel (_display displayCtrl 19182);
|
|
|
|
private _additionalObjects = lbCurSel (_display displayCtrl 19183);
|
|
|
|
|
|
|
|
private _objects = nearestObjects [_logic, ["All"], _radius];
|
|
|
|
if (_additionalObjects == 1) then {
|
|
|
|
_objects append call CBA_fnc_players;
|
|
|
|
} else {
|
|
|
|
if (_additionalObjects == 2) then {
|
|
|
|
_objects append (allUnits + allDeadMen select {!(_x isKindOf "HeadlessClient_F")});
|
|
|
|
};
|
|
|
|
};
|
2016-11-15 12:07:48 +00:00
|
|
|
|
2018-04-24 17:46:59 +00:00
|
|
|
if (_editingMode) then {
|
|
|
|
[QGVAR(addObjects), [_objects, _allCurators]] call CBA_fnc_serverEvent;
|
2016-11-15 12:07:48 +00:00
|
|
|
} else {
|
2018-04-24 17:46:59 +00:00
|
|
|
[QGVAR(removeObjects), [_objects, _allCurators]] call CBA_fnc_serverEvent;
|
2016-11-15 12:07:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
deleteVehicle _logic;
|
|
|
|
};
|
|
|
|
|
2018-04-24 17:46:59 +00:00
|
|
|
_display displayAddEventHandler ["Unload", _fnc_onUnload];
|
|
|
|
_ctrlButtonOK ctrlAddEventHandler ["ButtonClick", _fnc_onConfirm];
|