mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
wip1
This commit is contained in:
parent
29d9da9f4d
commit
ce70c72cd6
@ -23,4 +23,10 @@ class ACE_Settings {
|
||||
isClientSetable = 1;
|
||||
displayName = "$STR_ACE_Interact_Menu_AlwaysUseCursorSelfInteraction";
|
||||
};
|
||||
class GVAR(cursorKeepCentered) {
|
||||
value = 0;
|
||||
typeName = "BOOL";
|
||||
isClientSetable = 1;
|
||||
displayName = "Keep cursor centered";
|
||||
};
|
||||
};
|
||||
|
@ -39,8 +39,15 @@ if (GVAR(useCursorMenu)) then {
|
||||
// uiNamespace getVariable QGVAR(dlgCursorMenu);
|
||||
// uiNamespace getVariable QGVAR(cursorMenuOpened);
|
||||
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];
|
||||
} else {
|
||||
GVAR(cursorPos) = [_this select 1, _this select 2, 0];
|
||||
};
|
||||
}];
|
||||
setMousePosition [0.5, 0.5];
|
||||
};
|
||||
|
@ -37,6 +37,13 @@ if(_icon == "") then {
|
||||
};
|
||||
_text = 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, _text];
|
||||
_ctrl ctrlSetStructuredText (parseText _text);
|
||||
_ctrl ctrlSetPosition [(_sPos select 0)-(0.125*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.25*SafeZoneW, 0.1*SafeZoneW];
|
||||
_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 {
|
||||
_pos set [0, ((_pos select 0) - (GVAR(cursorPos) select 0) + 0.5)];
|
||||
_pos set [1, ((_pos select 1) - (GVAR(cursorPos) select 1) + 0.5)];
|
||||
};
|
||||
_ctrl ctrlSetPosition _pos;
|
||||
|
||||
//_ctrl ctrlSetBackgroundColor [1, 0, 0, 0.1];
|
||||
_ctrl ctrlCommit 0;
|
||||
|
@ -25,6 +25,13 @@ _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]);
|
||||
_ctrl ctrlSetPosition [(_sPos select 0)-(0.05*SafeZoneW), (_sPos select 1)-(0.014*SafeZoneW), 0.1*SafeZoneW, 0.035*SafeZoneW];
|
||||
_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 {
|
||||
_pos set [0, ((_pos select 0) - (GVAR(cursorPos) select 0) + 0.5)];
|
||||
_pos set [1, ((_pos select 1) - (GVAR(cursorPos) select 1) + 0.5)];
|
||||
};
|
||||
_ctrl ctrlSetPosition _pos;
|
||||
|
||||
//_ctrl ctrlSetBackgroundColor [1, 0, 0, 0.1];
|
||||
_ctrl ctrlCommit 0;
|
||||
|
Loading…
Reference in New Issue
Block a user