Class NativeMenu
Menu that looks like the ones used by Rockstar.
Inherited Members
Namespace: LemonUI.Menus
Assembly: LemonUI.SHVDN3.dll
Syntax
public class NativeMenu : IContainer<NativeItem>, IRecalculable, IProcessable, IEnumerable<NativeItem>, IEnumerable
Constructors
View SourceNativeMenu(string)
Creates a new menu with the specified title.
Declaration
public NativeMenu(string title)
Parameters
| Type | Name | Description |
|---|---|---|
| string | title | The title of the menu. |
NativeMenu(string, string)
Creates a new menu with the specified banner text and name.
Declaration
public NativeMenu(string bannerText, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | bannerText | The title of the menu. |
| string | name | The name of this menu. |
NativeMenu(string, string, string)
Creates a new menu with the specified banner text, name and description.
Declaration
public NativeMenu(string bannerText, string name, string description)
Parameters
| Type | Name | Description |
|---|---|---|
| string | bannerText | The title of the menu. |
| string | name | The name of this menu. |
| string | description | The description used for submenus. |
NativeMenu(string, string, string, I2Dimensional)
Creates a new menu with the specified banner text, name, description and banner.
Declaration
public NativeMenu(string bannerText, string name, string description, I2Dimensional banner)
Parameters
| Type | Name | Description |
|---|---|---|
| string | bannerText | The title of the menu. |
| string | name | The name of this menu. |
| string | description | The description used for submenus. |
| I2Dimensional | banner | The drawable to use as the banner. |
Fields
View SourceDefaultActivatedSound
The default Sound played when the current NativeItem is changed or activated.
Declaration
public static readonly Sound DefaultActivatedSound
Field Value
| Type | Description |
|---|---|
| Sound |
DefaultCloseSound
The default Sound played when the menu is closed.
Declaration
public static readonly Sound DefaultCloseSound
Field Value
| Type | Description |
|---|---|
| Sound |
DefaultDisabledSound
The default Sound played when the user activates a NativeItem that is disabled.
Declaration
public static readonly Sound DefaultDisabledSound
Field Value
| Type | Description |
|---|---|
| Sound |
DefaultLeftRightSound
The default Sound played when the user navigates Left and Right on a NativeSlidableItem.
Declaration
public static readonly Sound DefaultLeftRightSound
Field Value
| Type | Description |
|---|---|
| Sound |
DefaultUpDownSound
The default Sound played when the user navigates Up and Down.
Declaration
public static readonly Sound DefaultUpDownSound
Field Value
| Type | Description |
|---|---|
| Sound |
Properties
View SourceAcceptsInput
If the menu accepts user input for navigation.
Declaration
public bool AcceptsInput { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Alignment
The alignment of the menu.
Declaration
public Alignment Alignment { get; set; }
Property Value
| Type | Description |
|---|---|
| Alignment |
Banner
The banner shown at the top of the menu.
Declaration
public I2Dimensional Banner { get; set; }
Property Value
| Type | Description |
|---|---|
| I2Dimensional |
BannerText
The text shown on top of the banner.
Declaration
public ScaledText BannerText { get; set; }
Property Value
| Type | Description |
|---|---|
| ScaledText |
Buttons
The instructional buttons shown in the bottom right.
Declaration
public InstructionalButtons Buttons { get; }
Property Value
| Type | Description |
|---|---|
| InstructionalButtons |
CloseOnInvalidClick
If the menu should be closed when the user clicks out of bounds (aka anywhere else other than the items).
Declaration
public bool CloseOnInvalidClick { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Description
The description used when this menu is used as a submenu.
Declaration
public string Description { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
DescriptionFont
The font of description text.
Declaration
public Font DescriptionFont { get; set; }
Property Value
| Type | Description |
|---|---|
| Font |
DisableControls
If the conflictive controls should be disabled while the menu is open.
Declaration
public bool DisableControls { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
HeaderBehavior
The behavior of the black bar showing the name.
Declaration
public HeaderBehavior HeaderBehavior { get; set; }
Property Value
| Type | Description |
|---|---|
| HeaderBehavior |
HeldTime
The time between item changes when holding left, right, up or down.
Declaration
public int HeldTime { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Remarks
This property can be set to zero to completely disable it.
ItemCount
If the count of items should be shown on the right of the name.
Declaration
public CountVisibility ItemCount { get; set; }
Property Value
| Type | Description |
|---|---|
| CountVisibility |
ItemCountFont
The font of item count text.
Declaration
public Font ItemCountFont { get; set; }
Property Value
| Type | Description |
|---|---|
| Font |
Items
The items that this menu contain.
Declaration
public List<NativeItem> Items { get; }
Property Value
| Type | Description |
|---|---|
| List<NativeItem> |
KeepNameCasing
Whether the name of the menu should keep its casing or not.
Declaration
public bool KeepNameCasing { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
MaxItems
The maximum allowed number of items in the menu at once.
Declaration
public int MaxItems { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
MouseBehavior
The behavior of the mouse when the menu is open.
Declaration
public MenuMouseBehavior MouseBehavior { get; set; }
Property Value
| Type | Description |
|---|---|
| MenuMouseBehavior |
Name
The name of this menu.
Declaration
public string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
This is shown under the menu banner, and by the menu items when added as a submenu.
NameFont
The font of name text.
Declaration
public Font NameFont { get; set; }
Property Value
| Type | Description |
|---|---|
| Font |
NoItemsText
Text shown when there are no items in the menu.
Declaration
public string NoItemsText { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Offset
The offset of the menu position.
Declaration
public PointF Offset { get; set; }
Property Value
| Type | Description |
|---|---|
| PointF |
Parent
The parent menu of this menu.
Declaration
public NativeMenu Parent { get; set; }
Property Value
| Type | Description |
|---|---|
| NativeMenu |
RequiredControls
The controls that are required for some menu operations.
Declaration
public List<Control> RequiredControls { get; }
Property Value
| Type | Description |
|---|---|
| List<Control> |
Remarks
Add controls to this list when you want to detect them as pressed while the menu is open.
ResetCursorWhenOpened
If the cursor should be reset when the menu is opened.
Declaration
public bool ResetCursorWhenOpened { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
RotateCamera
If the camera should be rotated when the cursor is on the left and right corners of the screen.
Declaration
public bool RotateCamera { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
SafeZoneAware
If this menu should be aware of the Safe Zone when doing calculations.
Declaration
public bool SafeZoneAware { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
SelectedIndex
The current index of the menu.
Declaration
public int SelectedIndex { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
SelectedItem
Returns the currently selected item.
Declaration
public NativeItem SelectedItem { get; set; }
Property Value
| Type | Description |
|---|---|
| NativeItem |
SoundActivated
The Sound played when a NativeItem is activated.
Declaration
public Sound SoundActivated { get; set; }
Property Value
| Type | Description |
|---|---|
| Sound |
SoundClose
The Sound played when the menu is closed.
Declaration
public Sound SoundClose { get; set; }
Property Value
| Type | Description |
|---|---|
| Sound |
SoundDisabled
The Sound played when the user activates a NativeItem that is disabled.
Declaration
public Sound SoundDisabled { get; set; }
Property Value
| Type | Description |
|---|---|
| Sound |
SoundLeftRight
The Sound played when the user navigates Left and Right on a NativeSlidableItem.
Declaration
public Sound SoundLeftRight { get; set; }
Property Value
| Type | Description |
|---|---|
| Sound |
SoundOpened
The Sound played when the menu is opened.
Declaration
public Sound SoundOpened { get; set; }
Property Value
| Type | Description |
|---|---|
| Sound |
SoundUpDown
The Sound played when the user navigates Up or Down the menu.
Declaration
public Sound SoundUpDown { get; set; }
Property Value
| Type | Description |
|---|---|
| Sound |
Subtitle
The name of the menu.
Declaration
[Obsolete("Please use Name instead.", true)]
public string Subtitle { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
SubtitleBehavior
The behavior of the black bar showing the name.
Declaration
[Obsolete("Please use NameBehavior instead.", true)]
public SubtitleBehavior SubtitleBehavior { get; set; }
Property Value
| Type | Description |
|---|---|
| SubtitleBehavior |
SubtitleFont
The font of name text.
Declaration
[Obsolete("Please use NameFont instead.", true)]
public Font SubtitleFont { get; set; }
Property Value
| Type | Description |
|---|---|
| Font |
Title
The text shown on top of the banner.
Declaration
[Obsolete("Please use BannerText instead.", true)]
public ScaledText Title { get; set; }
Property Value
| Type | Description |
|---|---|
| ScaledText |
TitleFont
The font of the text shown on top of the banner.
Declaration
[Obsolete("Please use BannerText.Font instead.", true)]
public Font TitleFont { get; set; }
Property Value
| Type | Description |
|---|---|
| Font |
UseMouse
If the mouse should be used for navigating the menu.
Declaration
[Obsolete("This parameter is ambiguous, please use the MouseBehavior property instead instead.", true)]
public bool UseMouse { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Visible
If the menu is visible on the screen.
Declaration
public bool Visible { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Width
The width of the menu.
Declaration
public float Width { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
View SourceAdd(NativeItem)
Adds an item at the end of the menu.
Declaration
public void Add(NativeItem item)
Parameters
| Type | Name | Description |
|---|---|---|
| NativeItem | item | The item to add. |
Add(NativeMenu)
Adds a specific menu as a submenu with an item.
Declaration
public void Add(NativeMenu menu)
Parameters
| Type | Name | Description |
|---|---|---|
| NativeMenu | menu | The menu to add. |
Add(int, NativeItem)
Adds an item at the specified position.
Declaration
public virtual void Add(int position, NativeItem item)
Parameters
| Type | Name | Description |
|---|---|---|
| int | position | The position of the item. |
| NativeItem | item | The item to add. |
AddSubMenu(NativeMenu)
Adds a specific menu as a submenu with an item.
Declaration
public NativeSubmenuItem AddSubMenu(NativeMenu menu)
Parameters
| Type | Name | Description |
|---|---|---|
| NativeMenu | menu | The menu to add. |
Returns
| Type | Description |
|---|---|
| NativeSubmenuItem | The item that points to the submenu. |
AddSubMenu(NativeMenu, string)
Adds a specific menu as a submenu with an item and endlabel string.
Declaration
public NativeSubmenuItem AddSubMenu(NativeMenu menu, string endlabel)
Parameters
| Type | Name | Description |
|---|---|---|
| NativeMenu | menu | The menu to add. |
| string | endlabel | The alternative title of the item, shown on the right. |
Returns
| Type | Description |
|---|---|
| NativeSubmenuItem | The item that points to the submenu. |
Back()
Returns to the previous menu or closes the existing one.
Declaration
public void Back()
Clear()
Removes all of the items from this menu.
Declaration
public void Clear()
Close()
Closes the menu.
Declaration
[Obsolete("Set Visible to false instead.", true)]
public void Close()
Contains(NativeItem)
Checks if an item is part of the menu.
Declaration
public bool Contains(NativeItem item)
Parameters
| Type | Name | Description |
|---|---|---|
| NativeItem | item | The item to check. |
Returns
| Type | Description |
|---|---|
| bool |
GetEnumerator()
Declaration
public IEnumerator<NativeItem> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<NativeItem> |
Next()
Moves to the next item. Does nothing if the menu has no items.
Declaration
public void Next()
Open()
Opens the menu.
Declaration
[Obsolete("Set Visible to true instead.", true)]
public void Open()
Previous()
Moves to the previous item. Does nothing if the menu has no items.
Declaration
public void Previous()
Process()
Draws the menu and handles the controls.
Declaration
public virtual void Process()
Recalculate()
Calculates the positions and sizes of the elements.
Declaration
public virtual void Recalculate()
Remove(NativeItem)
Removes an item from the menu.
Declaration
public void Remove(NativeItem item)
Parameters
| Type | Name | Description |
|---|---|---|
| NativeItem | item | The item to remove. |
Remove(Func<NativeItem, bool>)
Removes the items that match the predicate.
Declaration
public void Remove(Func<NativeItem, bool> pred)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<NativeItem, bool> | pred | The function to use as a check. |
ResetCursor()
Resets the current position of the cursor.
Declaration
public void ResetCursor()
Events
View SourceClosed
Event triggered when the menu finishes closing.
Declaration
public event EventHandler Closed
Event Type
| Type | Description |
|---|---|
| EventHandler |
Closing
Event triggered when the menu starts closing.
Declaration
public event CancelEventHandler Closing
Event Type
| Type | Description |
|---|---|
| CancelEventHandler |
ItemActivated
Event triggered when an item in the menu is activated.
Declaration
public event ItemActivatedEventHandler ItemActivated
Event Type
| Type | Description |
|---|---|
| ItemActivatedEventHandler |
MenuModified
Event triggered when the contents of the menu are changed.
Declaration
public event MenuModifiedEventHandler MenuModified
Event Type
| Type | Description |
|---|---|
| MenuModifiedEventHandler |
Opening
Event triggered when the menu is being opened.
Declaration
public event CancelEventHandler Opening
Event Type
| Type | Description |
|---|---|
| CancelEventHandler |
SelectedIndexChanged
Event triggered when the index has been changed.
Declaration
public event SelectedEventHandler SelectedIndexChanged
Event Type
| Type | Description |
|---|---|
| SelectedEventHandler |
Shown
Event triggered when the menu is opened and shown to the user.
Declaration
public event EventHandler Shown
Event Type
| Type | Description |
|---|---|
| EventHandler |