mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Found a solution to avoid having to install MOOSE.
Now MOOSE can be copied into the mission file, but you'll need to include a "do file" action of moose.lua in the mission file and copy the rest of the MOOSE files to the MIZ file.
This commit is contained in:
107
Moose/Menu.lua
Normal file
107
Moose/Menu.lua
Normal file
@@ -0,0 +1,107 @@
|
||||
--- Encapsulation of DCS World Menu system in a set of MENU classes.
|
||||
-- @classmod MENU
|
||||
|
||||
Include.File( "Routines" )
|
||||
Include.File( "Base" )
|
||||
|
||||
|
||||
MENU = {
|
||||
ClassName = "MENU",
|
||||
MenuPath = nil,
|
||||
MenuText = "",
|
||||
MenuParentPath = nil
|
||||
}
|
||||
|
||||
---
|
||||
function MENU:New( MenuText, MenuParentPath )
|
||||
|
||||
-- Arrange meta tables
|
||||
local Child = BASE:Inherit( self, BASE:New() )
|
||||
|
||||
Child.MenuPath = nil
|
||||
Child.MenuText = MenuText
|
||||
Child.MenuParentPath = MenuParentPath
|
||||
return Child
|
||||
end
|
||||
|
||||
COMMANDMENU = {
|
||||
ClassName = "COMMANDMENU",
|
||||
CommandMenuFunction = nil,
|
||||
CommandMenuArgument = nil
|
||||
}
|
||||
|
||||
function COMMANDMENU:New( MenuText, ParentMenu, CommandMenuFunction, CommandMenuArgument )
|
||||
|
||||
-- Arrange meta tables
|
||||
|
||||
local MenuParentPath = nil
|
||||
if ParentMenu ~= nil then
|
||||
MenuParentPath = ParentMenu.MenuPath
|
||||
end
|
||||
|
||||
local Child = BASE:Inherit( self, MENU:New( MenuText, MenuParentPath ) )
|
||||
|
||||
Child.MenuPath = missionCommands.addCommand( MenuText, MenuParentPath, CommandMenuFunction, CommandMenuArgument )
|
||||
Child.CommandMenuFunction = CommandMenuFunction
|
||||
Child.CommandMenuArgument = CommandMenuArgument
|
||||
return Child
|
||||
end
|
||||
|
||||
---
|
||||
|
||||
SUBMENU = {
|
||||
ClassName = "SUBMENU"
|
||||
}
|
||||
|
||||
function SUBMENU:New( MenuText, ParentMenu )
|
||||
|
||||
-- Arrange meta tables
|
||||
local MenuParentPath = nil
|
||||
if ParentMenu ~= nil then
|
||||
MenuParentPath = ParentMenu.MenuPath
|
||||
end
|
||||
|
||||
local Child = BASE:Inherit( self, MENU:New( MenuText, MenuParentPath ) )
|
||||
|
||||
Child.MenuPath = missionCommands.addSubMenu( MenuText, MenuParentPath )
|
||||
return Child
|
||||
end
|
||||
|
||||
MENU_SUB_GROUP = {
|
||||
ClassName = "MENU_SUB_GROUP"
|
||||
}
|
||||
|
||||
function MENU_SUB_GROUP:New( GroupID, MenuText, ParentMenu )
|
||||
|
||||
-- Arrange meta tables
|
||||
local MenuParentPath = nil
|
||||
if ParentMenu ~= nil then
|
||||
MenuParentPath = ParentMenu.MenuPath
|
||||
end
|
||||
|
||||
local self = BASE:Inherit( self, MENU:New( MenuText, MenuParentPath ) )
|
||||
|
||||
self.MenuPath = missionCommands.addSubMenuForGroup( GroupID, MenuText, MenuParentPath )
|
||||
return self
|
||||
end
|
||||
|
||||
MENU_COMMAND_GROUP = {
|
||||
ClassName = "MENU_COMMAND_GROUP"
|
||||
}
|
||||
|
||||
function MENU_COMMAND_GROUP:New( GroupID, MenuText, ParentMenu, CommandMenuFunction, CommandMenuArgument )
|
||||
|
||||
-- Arrange meta tables
|
||||
|
||||
local MenuParentPath = nil
|
||||
if ParentMenu ~= nil then
|
||||
MenuParentPath = ParentMenu.MenuPath
|
||||
end
|
||||
|
||||
local self = BASE:Inherit( self, MENU:New( MenuText, MenuParentPath ) )
|
||||
|
||||
self.MenuPath = missionCommands.addCommandForGroup( GroupID, MenuText, MenuParentPath, CommandMenuFunction, CommandMenuArgument )
|
||||
self.CommandMenuFunction = CommandMenuFunction
|
||||
self.CommandMenuArgument = CommandMenuArgument
|
||||
return self
|
||||
end
|
||||
Reference in New Issue
Block a user