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>
This commit is contained in:
Rolln 2022-10-19 04:21:16 -06:00 committed by GitHub
parent 542fe20782
commit b5fd737cea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -567,7 +567,7 @@ function PLAYERTASK:IlluminateTarget(Power,Height)
if self.Target then if self.Target then
local coordinate = self.Target:GetAverageCoordinate() local coordinate = self.Target:GetAverageCoordinate()
if coordinate then if coordinate then
local bcoord = COORDINATE:NewFromVec2( coordinate:GetVec2(), Height ) local bcoord = COORDINATE:NewFromVec2( coordinate:GetVec2(), Height )
bcoord:IlluminationBomb(Power) bcoord:IlluminationBomb(Power)
end end
end end
@ -918,6 +918,7 @@ do
-- @field #boolean buddylasing -- @field #boolean buddylasing
-- @field Ops.PlayerRecce#PLAYERRECCE PlayerRecce -- @field Ops.PlayerRecce#PLAYERRECCE PlayerRecce
-- @field #number Coalition -- @field #number Coalition
-- @field Core.Menu#MENU_MISSION MenuParent
-- @extends Core.Fsm#FSM -- @extends Core.Fsm#FSM
--- ---
@ -1229,6 +1230,7 @@ PLAYERTASKCONTROLLER = {
buddylasing = false, buddylasing = false,
PlayerRecce = nil, PlayerRecce = nil,
Coalition = nil, Coalition = nil,
MenuParent = nil,
} }
--- ---
@ -1395,7 +1397,7 @@ PLAYERTASKCONTROLLER.Messages = {
--- PLAYERTASK class version. --- PLAYERTASK class version.
-- @field #string version -- @field #string version
PLAYERTASKCONTROLLER.version="0.1.43" PLAYERTASKCONTROLLER.version="0.1.44"
--- Create and run a new TASKCONTROLLER instance. --- Create and run a new TASKCONTROLLER instance.
-- @param #PLAYERTASKCONTROLLER self -- @param #PLAYERTASKCONTROLLER self
@ -3052,7 +3054,7 @@ function PLAYERTASKCONTROLLER:_BuildMenus(Client,enforced,fromsuccess)
end end
else else
-- 1) new player# -- 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] = topmenu
self.PlayerMenu[playername]:SetTag(timer.getAbsTime()) self.PlayerMenu[playername]:SetTag(timer.getAbsTime())
end end
@ -3237,6 +3239,16 @@ function PLAYERTASKCONTROLLER:SetMenuName(Name)
return self return self
end 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 --- [User] Set up INTEL detection
-- @param #PLAYERTASKCONTROLLER self -- @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. -- @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.