Make the list menu optional via a client setting

This commit is contained in:
esteldunedain 2015-04-12 01:15:38 -03:00
parent 69f147b202
commit 630a2a0f7a
5 changed files with 39 additions and 8 deletions

View File

@ -23,4 +23,10 @@ class ACE_Settings {
isClientSetable = 1;
displayName = "$STR_ACE_Interact_Menu_AlwaysUseCursorSelfInteraction";
};
class GVAR(UseListMenu) {
value = 0;
typeName = "BOOL";
isClientSetable = 1;
displayName = "$STR_ACE_Interact_Menu_UseListMenu";
};
};

View File

@ -36,10 +36,17 @@ if(_icon == "") then {
_icon = DEFAULT_ICON;
};
_text = 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];
//_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, "ace_breakLine" callExtension _text];
_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];
};
_ctrl ctrlSetStructuredText (parseText _text);
_ctrl ctrlSetPosition [(_sPos select 0)-(0.0095*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.10*SafeZoneW, 0.035*SafeZoneW];
_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];
};
//_ctrl ctrlSetBackgroundColor [0, 1, 0, 0.1];
_ctrl ctrlCommit 0;

View File

@ -92,7 +92,12 @@ if (_numChildren == 1) then {
};
// Scale menu based on the amount of children
_scale = 0.17;
_scale = if (GVAR(UseListMenu)) then {
0.17
} else {
0.17 * (((0.8 * (0.46 / sin (0.5 * _angleInterval))) min 1.1) max 0.5)
};
// Animate menu scale
if (_menuInSelectedPath && (_menuDepth == count _path)) then {
_scale = _scale * (0.3 + 0.7 * (((diag_tickTime - GVAR(expandedTime)) * 8) min 1));
@ -106,8 +111,13 @@ _angle = _centerAngle - _angleSpan / 2;
{
//BEGIN_COUNTER(children);
private ["_offset","_newPos"];
_newPos = [(_sPos select 0) + _scale * 1.10,
(_sPos select 1) + _scale * 0.30 * 4/3 * (_foreachindex - _numChildren/2 + 0.5)];
_newPos = if (GVAR(UseListMenu)) then {
[(_sPos select 0) + _scale * 1.10,
(_sPos select 1) + _scale * 0.30 * 4/3 * (_foreachindex - _numChildren/2 + 0.5)];
} else {
[(_sPos select 0) -_scale * cos _angle,
(_sPos select 1) +_scale * (sin _angle) * 4/3];
};
//drawLine3D [_pos, _newPos, [1,0,0,0.8]];
//END_COUNTER(children);

View File

@ -24,7 +24,12 @@ private "_ctrl";
_ctrl = GVAR(iconCtrls) select GVAR(iconCount);
GVAR(iconCount) = GVAR(iconCount) + 1;
_ctrl ctrlSetStructuredText (parseText format ["<img image='%1' color='#FF0000' size='1.6'/>", _icon]);
_ctrl ctrlSetPosition [(_sPos select 0)-(0.014*SafeZoneW), (_sPos select 1)-(0.014*SafeZoneW), 0.05*SafeZoneW, 0.035*SafeZoneW];
if (GVAR(UseListMenu)) then {
_ctrl ctrlSetStructuredText (parseText format ["<img image='%1' color='#FF0000' size='1.6'/>", _icon]);
_ctrl ctrlSetPosition [(_sPos select 0)-(0.014*SafeZoneW), (_sPos select 1)-(0.014*SafeZoneW), 0.05*SafeZoneW, 0.035*SafeZoneW];
} else {
_ctrl ctrlSetStructuredText (parseText format ["<img image='%1' color='#FF0000' size='1.6' align='center'/>", _icon]);
_ctrl ctrlSetPosition [(_sPos select 0)-(0.050*SafeZoneW), (_sPos select 1)-(0.014*SafeZoneW), 0.1*SafeZoneW, 0.035*SafeZoneW];
};
//_ctrl ctrlSetBackgroundColor [1, 0, 0, 0.1];
_ctrl ctrlCommit 0;

View File

@ -7,6 +7,9 @@
<German>Immer den Cursor für Selbst-Interaktionen anzeigen.</German>
<Spanish>Mostrar siempre el cursor para la interacción propia</Spanish>
</Key>
<Key ID="STR_ACE_Interact_Menu_UseListMenu">
<English>Display interact menu as a list</English>
</Key>
<Key ID="STR_ACE_Interact_Menu_InteractKey">
<English>Interact Key</English>
<German>Interaktionstaste</German>