mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-23 19:45:29 +00:00
Disable Settings Menu for each individual player. Settings menus are by default on, but can be disabled by calling _SETTINGS:SetPlayerMenuOff().
This commit is contained in:
@@ -41,6 +41,7 @@
|
|||||||
-- @field #SETTINGS
|
-- @field #SETTINGS
|
||||||
SETTINGS = {
|
SETTINGS = {
|
||||||
ClassName = "SETTINGS",
|
ClassName = "SETTINGS",
|
||||||
|
ShowPlayerMenu = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -411,13 +412,30 @@ do -- SETTINGS
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #SETTINGS self
|
--- Sets the player menus on, so that they will show to the players.
|
||||||
-- @param RootMenu
|
-- @param #SETTINGS self
|
||||||
|
-- @return #SETTINGS
|
||||||
|
function SETTINGS:SetPlayerMenuOn()
|
||||||
|
self.ShowPlayerMenu = true
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Sets the player menus off, so that they will hide from the players.
|
||||||
|
-- @param #SETTINGS self
|
||||||
|
-- @return #SETTINGS
|
||||||
|
function SETTINGS:SetPlayerMenuOff()
|
||||||
|
self.ShowPlayerMenu = false
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--- Updates the menu of the player seated in the PlayerUnit.
|
||||||
|
-- @param #SETTINGS self
|
||||||
-- @param Wrapper.Client#CLIENT PlayerUnit
|
-- @param Wrapper.Client#CLIENT PlayerUnit
|
||||||
-- @param #string MenuText
|
|
||||||
-- @return #SETTINGS
|
-- @return #SETTINGS
|
||||||
function SETTINGS:SetPlayerMenu( PlayerUnit )
|
function SETTINGS:SetPlayerMenu( PlayerUnit )
|
||||||
|
|
||||||
|
if _SETTINGS.ShowPlayerMenu == true then
|
||||||
|
|
||||||
local PlayerGroup = PlayerUnit:GetGroup()
|
local PlayerGroup = PlayerUnit:GetGroup()
|
||||||
local PlayerName = PlayerUnit:GetPlayerName()
|
local PlayerName = PlayerUnit:GetPlayerName()
|
||||||
local PlayerNames = PlayerGroup:GetPlayerNames()
|
local PlayerNames = PlayerGroup:GetPlayerNames()
|
||||||
@@ -545,18 +563,20 @@ do -- SETTINGS
|
|||||||
MENU_GROUP_COMMAND:New( PlayerGroup, "2 minutes", DetailedReportsMenu, self.MenuGroupMessageTimingsSystem, self, PlayerUnit, PlayerGroup, PlayerName, MESSAGE.Type.DetailedReportsMenu, 120 )
|
MENU_GROUP_COMMAND:New( PlayerGroup, "2 minutes", DetailedReportsMenu, self.MenuGroupMessageTimingsSystem, self, PlayerUnit, PlayerGroup, PlayerName, MESSAGE.Type.DetailedReportsMenu, 120 )
|
||||||
MENU_GROUP_COMMAND:New( PlayerGroup, "3 minutes", DetailedReportsMenu, self.MenuGroupMessageTimingsSystem, self, PlayerUnit, PlayerGroup, PlayerName, MESSAGE.Type.DetailedReportsMenu, 180 )
|
MENU_GROUP_COMMAND:New( PlayerGroup, "3 minutes", DetailedReportsMenu, self.MenuGroupMessageTimingsSystem, self, PlayerUnit, PlayerGroup, PlayerName, MESSAGE.Type.DetailedReportsMenu, 180 )
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Removes the player menu from the PlayerUnit.
|
||||||
--- @param #SETTINGS self
|
--- @param #SETTINGS self
|
||||||
-- @param RootMenu
|
|
||||||
-- @param Wrapper.Client#CLIENT PlayerUnit
|
-- @param Wrapper.Client#CLIENT PlayerUnit
|
||||||
-- @return #SETTINGS
|
-- @return #SETTINGS
|
||||||
function SETTINGS:RemovePlayerMenu( PlayerUnit )
|
function SETTINGS:RemovePlayerMenu( PlayerUnit )
|
||||||
|
|
||||||
if self.PlayerMenu then
|
if self.PlayerMenu then
|
||||||
self.PlayerMenu:Remove()
|
self.PlayerMenu:Remove()
|
||||||
|
self.PlayerMenu = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|||||||
@@ -10,4 +10,5 @@ _SCHEDULEDISPATCHER = SCHEDULEDISPATCHER:New() -- Core.Timer#SCHEDULEDISPATCHER
|
|||||||
_DATABASE = DATABASE:New() -- Core.Database#DATABASE
|
_DATABASE = DATABASE:New() -- Core.Database#DATABASE
|
||||||
|
|
||||||
_SETTINGS = SETTINGS:Set()
|
_SETTINGS = SETTINGS:Set()
|
||||||
|
_SETTINGS:SetPlayerMenuOn()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user