GROUP menus are now working

- Caching the menus on the GROUP object.
- When a new menu is created, it will chech the cache
- When the menu is already in the cache, nothing will be done and the
self is returned.
- When the menu is not in the cache, the menu is created and the cache
is updated.
- The removal of menus now work flawlessly, because the cache is now
used to traverse the path of submenus during removal.
This commit is contained in:
FlightControl
2016-11-29 08:38:19 +01:00
parent a5e3deb272
commit 354a9333c6
2 changed files with 58 additions and 64 deletions

View File

@@ -361,7 +361,7 @@ function TASK_BASE:RemoveMenuForGroup( TaskGroup )
local Mission = self:GetMission()
local MissionName = Mission:GetName()
local MissionMenu = MENU_GROUP:New( TaskGroup, MissionName )
local MissionMenu = Mission:GetMissionMenu( TaskGroup )
MissionMenu:Remove()
end