Difference between revisions of "UI.SimpleMenu"
From Nomad DB
Line 5: | Line 5: | ||
This function has to be called from inside a [[WD2 ScriptHook: Script|Script]]. | This function has to be called from inside a [[WD2 ScriptHook: Script|Script]]. | ||
− | == Syntax == | + | ==Syntax== |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
UI.SimpleMenu() | UI.SimpleMenu() | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | == Remarks == | + | *'''Returns''' UISimpleMenu instance |
+ | |||
+ | ==Remarks== | ||
The Menu will be invisible until a call to [[UISimpleMenu:Activate]] or [[UISimpleMenu:Toggle]]. You can easily bind a Menu to a Key, see [[UISimpleMenu:Toggle]] for more information. | The Menu will be invisible until a call to [[UISimpleMenu:Activate]] or [[UISimpleMenu:Toggle]]. You can easily bind a Menu to a Key, see [[UISimpleMenu:Toggle]] for more information. | ||
− | === Entry and Entry Index === | + | ===Entry and Entry Index=== |
Every item inside the SimpleMenu is called ''Entry''. There are different types of Entry (Button, Checkbox, Search, etc.). Every entry that is added to a SimpleMenu receives an "index" which can be used to modify it. | Every item inside the SimpleMenu is called ''Entry''. There are different types of Entry (Button, Checkbox, Search, etc.). Every entry that is added to a SimpleMenu receives an "index" which can be used to modify it. | ||
− | == Methods == | + | ==Methods== |
− | * [[UISimpleMenu:SetTitle]] | + | |
− | * [[UISimpleMenu:GetTitle]] | + | *[[UISimpleMenu:SetTitle]] |
− | ==== Menu State ==== | + | *[[UISimpleMenu:GetTitle]] |
− | + | ||
− | + | ====Menu State==== | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | == Controls == | + | *[[UISimpleMenu:Activate]] |
+ | *[[UISimpleMenu:Deactivate]] | ||
+ | *[[UISimpleMenu:Toggle]] | ||
+ | *[[UISimpleMenu:IsActive]] | ||
+ | |||
+ | ====Entries==== | ||
+ | |||
+ | *[[UISimpleMenu:SetEntryEnabled]] | ||
+ | *[[UISimpleMenu:IsEntryEnabled]] | ||
+ | *[[UISimpleMenu:SetEntryText]] | ||
+ | *[[UISimpleMenu:AddSearch]] | ||
+ | |||
+ | =====Button===== | ||
+ | |||
+ | *[[UISimpleMenu:AddButton]] | ||
+ | |||
+ | =====Checkbox===== | ||
+ | |||
+ | *[[UISimpleMenu:AddCheckbox]] | ||
+ | *[[UISimpleMenu:IsChecked]] | ||
+ | *[[UISimpleMenu:SetChecked]] | ||
+ | |||
+ | ====Events==== | ||
+ | |||
+ | *[[UISimpleMenu:OnUpdate]] | ||
+ | |||
+ | ==Controls== | ||
{{WD2SH:MenuControls}} | {{WD2SH:MenuControls}} | ||
− | == Related Pages == | + | ==Related Pages== |
− | * [[WD2 ScriptHook: UI|UI Overview]] | + | |
− | * [[WD2 ScriptHook: Trainer]] | + | *[[WD2 ScriptHook: UI|UI Overview]] |
+ | *[[WD2 ScriptHook: Trainer]] | ||
− | [[Category:WD2 ScriptHook]] [[Category:WD2 ScriptHook Lua]] | + | [[Category:WD2 ScriptHook]] |
+ | [[Category:WD2 ScriptHook Lua]] |
Revision as of 16:59, 3 May 2020
Creates a SimpleMenu, an ingame menu which can be controlled by the arrow keys & numpad keys. The name comes from its (currently) limited functionality and aims to provide very basic, but useful menu functionality.
This function has to be called from inside a Script.
Contents
Syntax
UI.SimpleMenu()
- Returns UISimpleMenu instance
Remarks
The Menu will be invisible until a call to UISimpleMenu:Activate or UISimpleMenu:Toggle. You can easily bind a Menu to a Key, see UISimpleMenu:Toggle for more information.
Entry and Entry Index
Every item inside the SimpleMenu is called Entry. There are different types of Entry (Button, Checkbox, Search, etc.). Every entry that is added to a SimpleMenu receives an "index" which can be used to modify it.
Methods
Menu State
Entries
- UISimpleMenu:SetEntryEnabled
- UISimpleMenu:IsEntryEnabled
- UISimpleMenu:SetEntryText
- UISimpleMenu:AddSearch
Button
Checkbox
Events
Controls
Up/Down Arrows | Navigation |
Numpad 8(Up), Numpad 9 (Down) | |
Enter | Confirm Option |
Numpad 5 | |
Delete Key, Numpad 0 | Return back to previous menu |
ESC | Close the menu |