interact_menu: tab to space

This commit is contained in:
Nicolás Badano
2015-02-19 10:49:36 -03:00
parent 53f632c716
commit d055315661
9 changed files with 172 additions and 173 deletions

View File

@ -12,75 +12,74 @@ _distance = _actionData select 5;
EXPLODE_2_PVT(_angles,_centerAngle,_maxAngleSpan);
if((count _this) > 4) then {
_pos = _this select 4;
_pos = _this select 4;
} else {
if(typeName (_actionData select 2) == "ARRAY") then {
_pos = _object modelToWorld (_actionData select 2);
} else {
_pos = _object modelToWorld (_object selectionPosition (_actionData select 2));
};
if(typeName (_actionData select 2) == "ARRAY") then {
_pos = _object modelToWorld (_actionData select 2);
} else {
_pos = _object modelToWorld (_object selectionPosition (_actionData select 2));
};
};
_cursorScreenPos = (positionCameraToWorld [0, 0, 0]);
if(_cursorScreenPos distance _pos <= _distance) then {
_path = [];
if((count _this) > 5) then {
_path = +(_this select 5);
};
_menuDepth = (count GVAR(menuDepthPath));
_path = [];
if((count _this) > 5) then {
_path = +(_this select 5);
};
_menuDepth = (count GVAR(menuDepthPath));
_color = "#FFFFFFFF"; // ARGB Color (First Hex Pair is transparancy)
if(_menuDepth > 0 && _index != (GVAR(menuDepthPath) select (GVAR(renderDepth)))) then {
// ARGB Color (First Hex Pair is transparancy)
_color = "#FFFFFFFF";
if(_menuDepth > 0 && _index != (GVAR(menuDepthPath) select (GVAR(renderDepth)))) then {
_color = format ["#%1FFFFFF", [255 * (((GVAR(renderDepth)/_menuDepth)) max 0.25)] call EFUNC(common,toHex)];
};
_path set[(count _path), _index];
// player sideChat format["r: %1", _actionData select 2];
[_actionData select 0, _color, _pos, 1, 1, 0, _actionData select 1, 0.5, 0.025, "TahomaB"] call FUNC(renderIcon);
GVAR(currentOptions) set[(count GVAR(currentOptions)), [_this, _pos, _path]];
_currentRenderDepth = -1;
_currentRenderDepth = GVAR(renderDepth);
GVAR(renderDepth) = GVAR(renderDepth) + 1;
if(_index == (GVAR(menuDepthPath) select (GVAR(renderDepth)-1))) then {
// Count how many actions are active
private "_numActions";
_numActions = 0;
{
this = _object;
_target = _object;
_player = ACE_player;
_active = [_object, ACE_player] call (_x select 4);
if(_active) then {
_numActions = _numActions + 1;
};
} forEach (_actionData select 6);
systemChat format ["_numActions: %1", _numActions];
};
_path set[(count _path), _index];
// player sideChat format["r: %1", _actionData select 2];
[_actionData select 0, _color, _pos, 1, 1, 0, _actionData select 1, 0.5, 0.025, "TahomaB"] call FUNC(renderIcon);
GVAR(currentOptions) set[(count GVAR(currentOptions)), [_this, _pos, _path]];
_currentRenderDepth = -1;
_currentRenderDepth = GVAR(renderDepth);
GVAR(renderDepth) = GVAR(renderDepth) + 1;
if(_index == (GVAR(menuDepthPath) select (GVAR(renderDepth)-1))) then {
// Count how many actions are active
private "_numActions";
_numActions = 0;
{
this = _object;
_target = _object;
_player = ACE_player;
_active = [_object, ACE_player] call (_x select 4);
if(_active) then {
_numActions = _numActions + 1;
};
} forEach (_actionData select 6);
systemChat format ["_numActions: %1", _numActions];
private "_angleSpan";
_angleSpan = _maxAngleSpan min (35 * (_numActions - 1));
private "_angleSpan";
_angleSpan = _maxAngleSpan min (35 * (_numActions - 1));
private "_angle";
_angle = _centerAngle - _angleSpan / 2;
{
// if(_index != (GVAR(menuDepthPath) select (GVAR(renderDepth)))) then {
this = _object;
_target = _object;
_player = ACE_player;
_active = [_object, ACE_player] call (_x select 4);
// diag_log text format["_active: %1: %2", (_x select 0), _active];
if(_active) then {
systemChat format ["_angle: %1", _angle];
_offset = [GVAR(vecLineMap), _angle] call FUNC(rotateVectLine);
_mod = 0.4 max (0.15 * (_cursorScreenPos distance _pos)); //0.5;//0.1*_distance;
_newPos = [
(_pos select 0) + ((_offset select 0)*_mod),
(_pos select 1) + ((_offset select 1)*_mod),
(_pos select 2) + ((_offset select 2)*_mod)
];
// drawLine3D [_pos, _newPos, [1,0,0,1]];
[_object, _x, _forEachIndex, [_angle, 180], _newPos, _path] call FUNC(renderMenu);
_angle = _angle + _angleSpan / (_numActions);
};
// };
} forEach (_actionData select 6);
};
GVAR(renderDepth) = GVAR(renderDepth) - 1;
private "_angle";
_angle = _centerAngle - _angleSpan / 2;
{
this = _object;
_target = _object;
_player = ACE_player;
_active = [_object, ACE_player] call (_x select 4);
// diag_log text format["_active: %1: %2", (_x select 0), _active];
if(_active) then {
systemChat format ["_angle: %1", _angle];
_offset = [GVAR(vecLineMap), _angle] call FUNC(rotateVectLine);
_mod = 0.4 max (0.15 * (_cursorScreenPos distance _pos)); //0.5;//0.1*_distance;
_newPos = [
(_pos select 0) + ((_offset select 0)*_mod),
(_pos select 1) + ((_offset select 1)*_mod),
(_pos select 2) + ((_offset select 2)*_mod)
];
// drawLine3D [_pos, _newPos, [1,0,0,1]];
[_object, _x, _forEachIndex, [_angle, 180], _newPos, _path] call FUNC(renderMenu);
_angle = _angle + _angleSpan / (_numActions);
};
} forEach (_actionData select 6);
};
GVAR(renderDepth) = GVAR(renderDepth) - 1;
};