2015-02-21 20:11:03 +00:00
|
|
|
/*
|
2015-03-24 04:18:00 +00:00
|
|
|
* Author: NouberNou and esteldunedain
|
2015-02-21 20:11:03 +00:00
|
|
|
* Render a single interaction icon
|
|
|
|
*
|
|
|
|
* Argument:
|
|
|
|
* 0: Text <STRING>
|
|
|
|
* 1: Color <STRING>
|
2015-03-23 21:08:31 +00:00
|
|
|
* 2: 2d position <ARRAY>
|
2015-02-21 20:11:03 +00:00
|
|
|
* 3: ?
|
|
|
|
* 4: ?
|
|
|
|
* 5: ?
|
|
|
|
* 6: Icon <STRING>
|
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-01-18 18:38:27 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
#define DEFAULT_ICON QUOTE(\z\ace\addons\interaction\ui\dot_ca.paa)
|
2015-03-23 21:08:31 +00:00
|
|
|
private ["_color", "_sPos", "_ctrl", "_icon"];
|
2015-01-18 18:38:27 +00:00
|
|
|
_text = _this select 0;
|
|
|
|
_color = _this select 1;
|
2015-03-23 21:08:31 +00:00
|
|
|
_sPos = _this select 2;
|
2015-01-18 18:38:27 +00:00
|
|
|
_icon = _this select 6;
|
2015-02-21 20:11:03 +00:00
|
|
|
|
2015-03-23 22:16:10 +00:00
|
|
|
//systemChat format ["Icon %1 - %2,%3", _text, _sPos select 0, _sPos select 1];
|
2015-02-27 04:55:16 +00:00
|
|
|
|
2015-03-23 21:08:31 +00:00
|
|
|
if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then {
|
2015-03-23 21:26:20 +00:00
|
|
|
_displayNum = [[46, 12] select visibleMap,91919] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]);
|
2015-03-23 21:08:31 +00:00
|
|
|
GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]);
|
|
|
|
};
|
|
|
|
_ctrl = GVAR(iconCtrls) select GVAR(iconCount);
|
|
|
|
GVAR(iconCount) = GVAR(iconCount) + 1;
|
|
|
|
if(_icon == "") then {
|
|
|
|
_icon = DEFAULT_ICON;
|
2015-01-18 18:38:27 +00:00
|
|
|
};
|
2015-04-12 03:21:05 +00:00
|
|
|
|
2015-04-12 04:15:38 +00:00
|
|
|
_text = if (GVAR(UseListMenu)) then {
|
|
|
|
format ["<img image='%1' color='%2' align='left'/><t color='%3' size='0.80' shadow='1' shadowColor='#000000' shadowOffset='0.07'>%4</t>", _icon, _color, _color, _text]
|
|
|
|
} else {
|
|
|
|
format ["<img image='%1' color='%2' align='center'/><br/><t color='%3' size='0.80' align='center' shadow='1' shadowColor='#000000' shadowOffset='0.07'>%4</t>", _icon, _color, _color, "ace_breakLine" callExtension _text];
|
|
|
|
};
|
2015-04-12 03:21:05 +00:00
|
|
|
|
2015-03-23 21:08:31 +00:00
|
|
|
_ctrl ctrlSetStructuredText (parseText _text);
|
2015-04-12 04:15:38 +00:00
|
|
|
_text = if (GVAR(UseListMenu)) then {
|
|
|
|
_ctrl ctrlSetPosition [(_sPos select 0)-(0.0095*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.20*SafeZoneW, 0.035*SafeZoneW];
|
|
|
|
} else {
|
|
|
|
_ctrl ctrlSetPosition [(_sPos select 0)-(0.0750*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.15*SafeZoneW, 0.100*SafeZoneW];
|
|
|
|
};
|
2015-04-04 04:44:49 +00:00
|
|
|
//_ctrl ctrlSetBackgroundColor [0, 1, 0, 0.1];
|
2015-03-23 21:08:31 +00:00
|
|
|
_ctrl ctrlCommit 0;
|