Difference between revisions of "MenuData Struct - UI"

Jump to navigation Jump to search
Edited incorrect adder on menu flags. Use a bitwise OR, which despite it's name, uses the Math.LogicalOr function.
imported>Qazaaq
(added "empty" flag descriptions for menu)
(Edited incorrect adder on menu flags. Use a bitwise OR, which despite it's name, uses the Math.LogicalOr function.)
Line 20: Line 20:
**'''Default Flags:''' 0x801849D
**'''Default Flags:''' 0x801849D
**<code>0x01</code> PauseGame: Pauses the game world behind the menu.
**<code>0x01</code> PauseGame: Pauses the game world behind the menu.
**<code>0x02</code> DoNotDeleteOnClose:  
**<code>0x02</code> DoNotDeleteOnClose: The menu instance will persist even after the menu is closed.
**<code>0x04</code> ShowCursor: Shows the mouse cursor.
**<code>0x04</code> ShowCursor: Shows the mouse cursor.
**<code>0x08</code> EnableMenuControl:  
**<code>0x08</code> EnableMenuControl: Allows the menu to receive and handle <code>ProcessUserEvent</code> in ActionScript.
**<code>0x20</code> ShaderdWorld:  
**<code>0x20</code> ShaderdWorld:  
**<code>0x40</code> Open:  
**<code>0x40</code> FlagOpen:  
**<code>0x800</code> DoNotPreventGameSave: Allows the game to be saved. Without this flag the save button is greyed out.
**<code>0x800</code> DoNotPreventGameSave: Allows the game to be saved. Without this flag the save button is greyed out while this menu is open.
**<code>0x8000</code> ApplyDropDownFilter:  
**<code>0x8000</code> ApplyDropDownFilter:  
**<code>0x400000</code> BlurBackground: Blurs the game world behind the menu.
**<code>0x400000</code> BlurBackground: Blurs the game world behind the menu.
Line 50: Line 50:
If (!IsMenuRegistered(MyCustomMenuName))
If (!IsMenuRegistered(MyCustomMenuName))
UI:MenuData data = new UI:MenuData
UI:MenuData data = new UI:MenuData
data.MenuFlags = PauseGame | DoNotPreventGameSave | BlurBackground
data.MenuFlags = FlagNone ; clears all the flags and adds these three
data.MenuFlags = Math.LogicalOr(data.MenuFlags, PauseGame)
data.MenuFlags = Math.LogicalOr(data.MenuFlags, DoNotPreventGameSave)
data.MenuFlags = Math.LogicalOr(data.MenuFlags, BlurBackground)
data.ExtendedFlags = FlagNone
data.ExtendedFlags = FlagNone
UI.RegisterCustomMenu(MyCustomMenuName, "My\Path\To\FileNameWithoutExtension", "root1", data)
UI.RegisterCustomMenu(MyCustomMenuName, "My\Path\To\FileNameWithoutExtension", "root1", data)
Line 56: Line 59:
EndEvent
EndEvent


; An example of menu flag definitions.
Group MenuFlags
Group MenuFlags
int Property FlagNone = 0x0 AutoReadOnly
int Property FlagNone = 0x0 AutoReadOnly
int Property PauseGame = 0x01 AutoReadOnly
int Property PauseGame = 0x01 AutoReadOnly
int Property DoNotDeleteOnClose = 0x02 AutoReadOnly
int Property ShowCursor = 0x04 AutoReadOnly
int Property EnableMenuControl = 0x08 AutoReadOnly
int Property FlagOpen = 0x20 AutoReadOnly
int Property FlagOpen = 0x40 AutoReadOnly
int Property DoNotPreventGameSave = 0x800 AutoReadOnly
int Property DoNotPreventGameSave = 0x800 AutoReadOnly
int Property ApplyDropDownFilter = 0x8000 AutoReadOnly
int Property BlurBackground = 0x400000 AutoReadOnly
int Property BlurBackground = 0x400000 AutoReadOnly
EndGroup
EndGroup
150

edits

Navigation menu