Make it optional

This commit is contained in:
PabstMirror 2015-04-07 22:57:58 -05:00
parent ce70c72cd6
commit 03dbe8e6c5
3 changed files with 4 additions and 5 deletions

View File

@ -41,7 +41,6 @@ if (GVAR(useCursorMenu)) then {
ctrlEnable [91921, true];
GVAR(cursorPos) = [0.5,0.5,0];
((finddisplay 91919) displayctrl 91921) ctrlAddEventHandler ["MouseMoving", {
if (GVAR(cursorKeepCentered)) then {
GVAR(cursorPos) = GVAR(cursorPos) vectorAdd [_this select 1, _this select 2, 0] vectorDiff [0.5, 0.5, 0];
setMousePosition [0.5, 0.5];

View File

@ -18,7 +18,7 @@
*/
#include "script_component.hpp"
#define DEFAULT_ICON QUOTE(\z\ace\addons\interaction\ui\dot_ca.paa)
private ["_color", "_sPos", "_ctrl", "_icon"];
private ["_color", "_sPos", "_ctrl", "_icon", "_pos"];
_text = _this select 0;
_color = _this select 1;
_sPos = _this select 2;
@ -39,7 +39,7 @@ _text = format ["<img image='%1' color='%2' align='center'/><br/><t color='%3' s
_ctrl ctrlSetStructuredText (parseText _text);
_pos = [(_sPos select 0)-(0.125*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.25*SafeZoneW, 0.1*SafeZoneW];
if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then {
if (GVAR(cursorKeepCentered) && {uiNamespace getVariable [QGVAR(cursorMenuOpened),false]}) then {
_pos set [0, ((_pos select 0) - (GVAR(cursorPos) select 0) + 0.5)];
_pos set [1, ((_pos select 1) - (GVAR(cursorPos) select 1) + 0.5)];
};

View File

@ -20,14 +20,14 @@ if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then {
GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]);
};
private "_ctrl";
private ["_ctrl", "_pos"];
_ctrl = GVAR(iconCtrls) select GVAR(iconCount);
GVAR(iconCount) = GVAR(iconCount) + 1;
_ctrl ctrlSetStructuredText (parseText format ["<img image='%1' color='#FF0000' size='1.6' align='center'/>", _icon]);
_pos = [(_sPos select 0)-(0.05*SafeZoneW), (_sPos select 1)-(0.014*SafeZoneW), 0.1*SafeZoneW, 0.035*SafeZoneW];
if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then {
if (GVAR(cursorKeepCentered) && {uiNamespace getVariable [QGVAR(cursorMenuOpened),false]}) then {
_pos set [0, ((_pos select 0) - (GVAR(cursorPos) select 0) + 0.5)];
_pos set [1, ((_pos select 1) - (GVAR(cursorPos) select 1) + 0.5)];
};