From 7617908ad363970e5935c1bee310d719592f71b5 Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Sat, 4 Apr 2015 01:44:49 -0300 Subject: [PATCH] Make menu open linearly to the right of the action point --- addons/interact_menu/functions/fnc_renderIcon.sqf | 6 +++--- addons/interact_menu/functions/fnc_renderMenu.sqf | 6 +++--- addons/interact_menu/functions/fnc_renderSelector.sqf | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/interact_menu/functions/fnc_renderIcon.sqf b/addons/interact_menu/functions/fnc_renderIcon.sqf index 8054e9d800..018b3e2865 100644 --- a/addons/interact_menu/functions/fnc_renderIcon.sqf +++ b/addons/interact_menu/functions/fnc_renderIcon.sqf @@ -35,8 +35,8 @@ GVAR(iconCount) = GVAR(iconCount) + 1; if(_icon == "") then { _icon = DEFAULT_ICON; }; -_text = format ["
%4", _icon, _color, _color, _text]; +_text = format ["%4", _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]; -//_ctrl ctrlSetBackgroundColor [1, 0, 0, 0.1]; +_ctrl ctrlSetPosition [(_sPos select 0)-(0.0095*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.10*SafeZoneW, 0.035*SafeZoneW]; +//_ctrl ctrlSetBackgroundColor [0, 1, 0, 0.1]; _ctrl ctrlCommit 0; diff --git a/addons/interact_menu/functions/fnc_renderMenu.sqf b/addons/interact_menu/functions/fnc_renderMenu.sqf index 42e8de16a2..b3e3d3b401 100644 --- a/addons/interact_menu/functions/fnc_renderMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderMenu.sqf @@ -92,7 +92,7 @@ if (_numChildren == 1) then { }; // Scale menu based on the amount of children -_scale = 0.17 * (((0.8 * (0.46 / sin (0.5 * _angleInterval))) min 1.1) max 0.5); +_scale = 0.17; // Animate menu scale if (_menuInSelectedPath && (_menuDepth == count _path)) then { _scale = _scale * (0.3 + 0.7 * (((diag_tickTime - GVAR(expandedTime)) * 8) min 1)); @@ -106,8 +106,8 @@ _angle = _centerAngle - _angleSpan / 2; { //BEGIN_COUNTER(children); private ["_offset","_newPos"]; - _newPos = [(_sPos select 0) -_scale * cos _angle, - (_sPos select 1) +_scale * (sin _angle) * 4/3]; + _newPos = [(_sPos select 0) + _scale * 1.10, + (_sPos select 1) + _scale * 0.30 * 4/3 * (_foreachindex - _numChildren/2 + 0.5)]; //drawLine3D [_pos, _newPos, [1,0,0,0.8]]; //END_COUNTER(children); diff --git a/addons/interact_menu/functions/fnc_renderSelector.sqf b/addons/interact_menu/functions/fnc_renderSelector.sqf index 44ed15e9c4..099d917c0f 100644 --- a/addons/interact_menu/functions/fnc_renderSelector.sqf +++ b/addons/interact_menu/functions/fnc_renderSelector.sqf @@ -24,7 +24,7 @@ private "_ctrl"; _ctrl = GVAR(iconCtrls) select GVAR(iconCount); GVAR(iconCount) = GVAR(iconCount) + 1; -_ctrl ctrlSetStructuredText (parseText format ["", _icon]); -_ctrl ctrlSetPosition [(_sPos select 0)-(0.05*SafeZoneW), (_sPos select 1)-(0.014*SafeZoneW), 0.1*SafeZoneW, 0.035*SafeZoneW]; +_ctrl ctrlSetStructuredText (parseText format ["", _icon]); +_ctrl ctrlSetPosition [(_sPos select 0)-(0.014*SafeZoneW), (_sPos select 1)-(0.014*SafeZoneW), 0.05*SafeZoneW, 0.035*SafeZoneW]; //_ctrl ctrlSetBackgroundColor [1, 0, 0, 0.1]; _ctrl ctrlCommit 0;