From b5fd737ceac54d206dc82d2e91a26149b77488b4 Mon Sep 17 00:00:00 2001 From: Rolln Date: Wed, 19 Oct 2022 04:21:16 -0600 Subject: [PATCH] Playertaskcontroller parent menu (#1806) * Ability to set parent menu of PlayerTaskController * Updated Docmentation * Update PlayerTask.lua Co-authored-by: Thomas <72444570+Applevangelist@users.noreply.github.com> --- Moose Development/Moose/Ops/PlayerTask.lua | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Ops/PlayerTask.lua b/Moose Development/Moose/Ops/PlayerTask.lua index df77e83ae..5bbc4d56f 100644 --- a/Moose Development/Moose/Ops/PlayerTask.lua +++ b/Moose Development/Moose/Ops/PlayerTask.lua @@ -567,7 +567,7 @@ function PLAYERTASK:IlluminateTarget(Power,Height) if self.Target then local coordinate = self.Target:GetAverageCoordinate() if coordinate then - local bcoord = COORDINATE:NewFromVec2( coordinate:GetVec2(), Height ) + local bcoord = COORDINATE:NewFromVec2( coordinate:GetVec2(), Height ) bcoord:IlluminationBomb(Power) end end @@ -918,6 +918,7 @@ do -- @field #boolean buddylasing -- @field Ops.PlayerRecce#PLAYERRECCE PlayerRecce -- @field #number Coalition +-- @field Core.Menu#MENU_MISSION MenuParent -- @extends Core.Fsm#FSM --- @@ -1229,6 +1230,7 @@ PLAYERTASKCONTROLLER = { buddylasing = false, PlayerRecce = nil, Coalition = nil, + MenuParent = nil, } --- @@ -1395,7 +1397,7 @@ PLAYERTASKCONTROLLER.Messages = { --- PLAYERTASK class version. -- @field #string version -PLAYERTASKCONTROLLER.version="0.1.43" +PLAYERTASKCONTROLLER.version="0.1.44" --- Create and run a new TASKCONTROLLER instance. -- @param #PLAYERTASKCONTROLLER self @@ -3052,7 +3054,7 @@ function PLAYERTASKCONTROLLER:_BuildMenus(Client,enforced,fromsuccess) end else -- 1) new player# - topmenu = MENU_GROUP_DELAYED:New(group,menuname,nil) + topmenu = MENU_GROUP_DELAYED:New(group,menuname,self.MenuParent) self.PlayerMenu[playername] = topmenu self.PlayerMenu[playername]:SetTag(timer.getAbsTime()) end @@ -3237,6 +3239,16 @@ function PLAYERTASKCONTROLLER:SetMenuName(Name) return self end +--- [User] Set the top menu to be a sub-menu of another MENU entry. +-- @param #PLAYERTASKCONTROLLER self +-- @param Core.Menu#MENU_MISSION Menu +-- @return #PLAYERTASKCONTROLLER self +function PLAYERTASKCONTROLLER:SetParentName(Menu) + self:T(self.lid.."SetParentName") + self.MenuParent = Menu + return self +end + --- [User] Set up INTEL detection -- @param #PLAYERTASKCONTROLLER self -- @param #string RecceName This name will be used to build a detection group set. All groups with this string somewhere in their group name will be added as Recce.