Merge pull request #3445 from acemod/preventSelfIMFromClosing

Prevent Self Interact Menu from bugging out during animations
This commit is contained in:
Thomas Kooi 2016-02-27 20:35:18 +01:00
commit f758a90351
2 changed files with 22 additions and 14 deletions

View File

@ -77,19 +77,29 @@ if (GVAR(useCursorMenu)) then {
GVAR(selfMenuOffset) = (AGLtoASL (positionCameraToWorld [0, 0, 2])) vectorDiff (AGLtoASL (positionCameraToWorld [0, 0, 0])); GVAR(selfMenuOffset) = (AGLtoASL (positionCameraToWorld [0, 0, 2])) vectorDiff (AGLtoASL (positionCameraToWorld [0, 0, 0]));
if (GVAR(menuAnimationSpeed) > 0) then {
//Auto expand the first level when self, mounted vehicle or zeus (skips the first animation as there is only one choice) //Auto expand the first level when self, mounted vehicle or zeus (skips the first animation as there is only one choice)
if (GVAR(openedMenuType) == 0) then { if (GVAR(openedMenuType) == 0) then {
if (isNull curatorCamera) then { if (isNull curatorCamera) then {
if (vehicle ACE_player != ACE_player) then { if (vehicle ACE_player != ACE_player) then {
GVAR(menuDepthPath) = [["ACE_SelfActions", (vehicle ACE_player)]]; GVAR(menuDepthPath) = [["ACE_SelfActions", (vehicle ACE_player)]];
GVAR(expanded) = true;
GVAR(expandedTime) = ACE_diagTime;
GVAR(lastPath) = +GVAR(menuDepthPath);
GVAR(startHoverTime) = -1000;
}; };
} else { } else {
GVAR(menuDepthPath) = [["ACE_ZeusActions", (getAssignedCuratorLogic player)]]; GVAR(menuDepthPath) = [["ACE_ZeusActions", (getAssignedCuratorLogic player)]];
GVAR(expanded) = true;
GVAR(expandedTime) = ACE_diagTime;
GVAR(lastPath) = +GVAR(menuDepthPath);
GVAR(startHoverTime) = -1000;
}; };
} else { } else {
GVAR(menuDepthPath) = [["ACE_SelfActions", ACE_player]]; GVAR(menuDepthPath) = [["ACE_SelfActions", ACE_player]];
}; GVAR(expanded) = true;
GVAR(expandedTime) = ACE_diagTime;
GVAR(lastPath) = +GVAR(menuDepthPath);
GVAR(startHoverTime) = -1000;
}; };
["interactMenuOpened", [_menuType]] call EFUNC(common,localEvent); ["interactMenuOpened", [_menuType]] call EFUNC(common,localEvent);

View File

@ -116,8 +116,6 @@ if (GVAR(openedMenuType) >= 0) then {
if(!_foundTarget && GVAR(actionSelected)) then { if(!_foundTarget && GVAR(actionSelected)) then {
GVAR(actionSelected) = false; GVAR(actionSelected) = false;
GVAR(expanded) = false;
GVAR(lastPath) = [];
}; };
for "_i" from GVAR(iconCount) to (count GVAR(iconCtrls))-1 do { for "_i" from GVAR(iconCount) to (count GVAR(iconCtrls))-1 do {
ctrlDelete (GVAR(iconCtrls) select _i); ctrlDelete (GVAR(iconCtrls) select _i);