ACE3/addons/zeus/functions/fnc_ui_attributePosition.sqf
mharis001 bca8b01860 Various additions to ace_zeus (#6036)
* Add search to teleport players UI

* Change group side icons to look better

* Improve teleport UI and add stringtable entries

* Add Assign Repair Vehicle module

* Add Assign Repair Facility module

* Add Assign Engineer module

* Add Full Heal module

* Add Suicide Bomber module

* Make heal module work without ace_medical

* Add suicide bomber module translations

* Improve attribute cargo to use displayName

* Improve set engineer ui

* ACE_Curator for repair modules + author array

* Add angle param to getModuleDestination

* Prevent multiple suicide bomber modules on same target

* Heal module: support BI scripted revive system

* Requested changes
2018-02-24 11:44:57 -06:00

61 lines
1.5 KiB
Plaintext

/*
* Author: SilentSpike
* Initalises the `position` zeus module attribute
*
* Arguments:
* 0: position controls group <CONTROL>
*
* Return Value:
* None
*
* Example:
* [CONTROL] call ace_zeus_fnc_ui_attributePosition
*
* Public: No
*/
#include "script_component.hpp"
//Generic Init:
params ["_control"];
private _display = ctrlParent _control;
private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull);
_control ctrlRemoveAllEventHandlers "setFocus";
//Specific on-load stuff:
private _map = _control controlsGroupCtrl 26469;
// Centre map on the logic initially
_map ctrlMapAnimAdd [0, ctrlMapScale _map, _logic];
ctrlMapAnimCommit _map;
private _fnc_onDraw = {
params ["_map"];
private _display = ctrlParent _map;
private _pos = GETVAR(_display,GVAR(position),[]);
private _radius = GETVAR(_display,GVAR(radius),0);
if !(_pos isEqualTo []) then {
// Works alongside radius attribute
if (_radius == 0) then {
_map drawIcon ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [0,0,0,1], _pos, 19, 19, 0, "", 0, 0];
} else {
_map drawEllipse [_pos, _radius, _radius, 0, [0,0,0,1], ""];
};
};
};
private _fnc_onMapClick = {
params ["_map","_button"];
if (_button == 0) then {
private _display = ctrlParent _map;
SETVAR(_display,GVAR(position),_pos);
};
};
SETVAR(_display,GVAR(position),getPos _logic);
_map ctrlAddEventHandler ["draw",_fnc_onDraw];
_map ctrlAddEventHandler ["mouseButtonDown",_fnc_onMapClick];