Show / Hide Table of Contents

Class NativeMenu

Menu that looks like the ones used by Rockstar.

Inheritance
object
NativeMenu
Implements
IContainer<NativeItem>
IRecalculable
IProcessable
IEnumerable<NativeItem>
IEnumerable
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: LemonUI.Menus
Assembly: LemonUI.SHVDN3.dll
Syntax
public class NativeMenu : IContainer<NativeItem>, IRecalculable, IProcessable, IEnumerable<NativeItem>, IEnumerable

Constructors

View Source

NativeMenu(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.

View Source

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.

View Source

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.

View Source

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 Source

DefaultActivatedSound

The default Sound played when the current NativeItem is changed or activated.

Declaration
public static readonly Sound DefaultActivatedSound
Field Value
Type Description
Sound
View Source

DefaultCloseSound

The default Sound played when the menu is closed.

Declaration
public static readonly Sound DefaultCloseSound
Field Value
Type Description
Sound
View Source

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
View Source

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
View Source

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 Source

AcceptsInput

If the menu accepts user input for navigation.

Declaration
public bool AcceptsInput { get; set; }
Property Value
Type Description
bool
View Source

Alignment

The alignment of the menu.

Declaration
public Alignment Alignment { get; set; }
Property Value
Type Description
Alignment
View Source

Banner

The banner shown at the top of the menu.

Declaration
public I2Dimensional Banner { get; set; }
Property Value
Type Description
I2Dimensional
View Source

BannerText

The text shown on top of the banner.

Declaration
public ScaledText BannerText { get; set; }
Property Value
Type Description
ScaledText
View Source

Buttons

The instructional buttons shown in the bottom right.

Declaration
public InstructionalButtons Buttons { get; }
Property Value
Type Description
InstructionalButtons
View Source

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
View Source

Description

The description used when this menu is used as a submenu.

Declaration
public string Description { get; set; }
Property Value
Type Description
string
View Source

DescriptionFont

The font of description text.

Declaration
public Font DescriptionFont { get; set; }
Property Value
Type Description
Font
View Source

DisableControls

If the conflictive controls should be disabled while the menu is open.

Declaration
public bool DisableControls { get; set; }
Property Value
Type Description
bool
View Source

HeaderBehavior

The behavior of the black bar showing the name.

Declaration
public HeaderBehavior HeaderBehavior { get; set; }
Property Value
Type Description
HeaderBehavior
View Source

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.

View Source

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
View Source

ItemCountFont

The font of item count text.

Declaration
public Font ItemCountFont { get; set; }
Property Value
Type Description
Font
View Source

Items

The items that this menu contain.

Declaration
public List<NativeItem> Items { get; }
Property Value
Type Description
List<NativeItem>
View Source

KeepNameCasing

Whether the name of the menu should keep its casing or not.

Declaration
public bool KeepNameCasing { get; set; }
Property Value
Type Description
bool
View Source

MaxItems

The maximum allowed number of items in the menu at once.

Declaration
public int MaxItems { get; set; }
Property Value
Type Description
int
View Source

MouseBehavior

The behavior of the mouse when the menu is open.

Declaration
public MenuMouseBehavior MouseBehavior { get; set; }
Property Value
Type Description
MenuMouseBehavior
View Source

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.

View Source

NameFont

The font of name text.

Declaration
public Font NameFont { get; set; }
Property Value
Type Description
Font
View Source

NoItemsText

Text shown when there are no items in the menu.

Declaration
public string NoItemsText { get; set; }
Property Value
Type Description
string
View Source

Offset

The offset of the menu position.

Declaration
public PointF Offset { get; set; }
Property Value
Type Description
PointF
View Source

Parent

The parent menu of this menu.

Declaration
public NativeMenu Parent { get; set; }
Property Value
Type Description
NativeMenu
View Source

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.

View Source

ResetCursorWhenOpened

If the cursor should be reset when the menu is opened.

Declaration
public bool ResetCursorWhenOpened { get; set; }
Property Value
Type Description
bool
View Source

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
View Source

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
View Source

SelectedIndex

The current index of the menu.

Declaration
public int SelectedIndex { get; set; }
Property Value
Type Description
int
View Source

SelectedItem

Returns the currently selected item.

Declaration
public NativeItem SelectedItem { get; set; }
Property Value
Type Description
NativeItem
View Source

SoundActivated

The Sound played when a NativeItem is activated.

Declaration
public Sound SoundActivated { get; set; }
Property Value
Type Description
Sound
View Source

SoundClose

The Sound played when the menu is closed.

Declaration
public Sound SoundClose { get; set; }
Property Value
Type Description
Sound
View Source

SoundDisabled

The Sound played when the user activates a NativeItem that is disabled.

Declaration
public Sound SoundDisabled { get; set; }
Property Value
Type Description
Sound
View Source

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
View Source

SoundOpened

The Sound played when the menu is opened.

Declaration
public Sound SoundOpened { get; set; }
Property Value
Type Description
Sound
View Source

SoundUpDown

The Sound played when the user navigates Up or Down the menu.

Declaration
public Sound SoundUpDown { get; set; }
Property Value
Type Description
Sound
View Source

Subtitle

The name of the menu.

Declaration
[Obsolete("Please use Name instead.", true)]
public string Subtitle { get; set; }
Property Value
Type Description
string
View Source

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
View Source

SubtitleFont

The font of name text.

Declaration
[Obsolete("Please use NameFont instead.", true)]
public Font SubtitleFont { get; set; }
Property Value
Type Description
Font
View Source

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
View Source

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
View Source

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
View Source

Visible

If the menu is visible on the screen.

Declaration
public bool Visible { get; set; }
Property Value
Type Description
bool
View Source

Width

The width of the menu.

Declaration
public float Width { get; set; }
Property Value
Type Description
float

Methods

View Source

Add(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.

View Source

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.

View Source

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.

View Source

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.

View Source

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.

View Source

Back()

Returns to the previous menu or closes the existing one.

Declaration
public void Back()
View Source

Clear()

Removes all of the items from this menu.

Declaration
public void Clear()
View Source

Close()

Closes the menu.

Declaration
[Obsolete("Set Visible to false instead.", true)]
public void Close()
View Source

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
View Source

GetEnumerator()

Declaration
public IEnumerator<NativeItem> GetEnumerator()
Returns
Type Description
IEnumerator<NativeItem>
View Source

Next()

Moves to the next item. Does nothing if the menu has no items.

Declaration
public void Next()
View Source

Open()

Opens the menu.

Declaration
[Obsolete("Set Visible to true instead.", true)]
public void Open()
View Source

Previous()

Moves to the previous item. Does nothing if the menu has no items.

Declaration
public void Previous()
View Source

Process()

Draws the menu and handles the controls.

Declaration
public virtual void Process()
View Source

Recalculate()

Calculates the positions and sizes of the elements.

Declaration
public virtual void Recalculate()
View Source

Remove(NativeItem)

Removes an item from the menu.

Declaration
public void Remove(NativeItem item)
Parameters
Type Name Description
NativeItem item

The item to remove.

View Source

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.

View Source

ResetCursor()

Resets the current position of the cursor.

Declaration
public void ResetCursor()

Events

View Source

Closed

Event triggered when the menu finishes closing.

Declaration
public event EventHandler Closed
Event Type
Type Description
EventHandler
View Source

Closing

Event triggered when the menu starts closing.

Declaration
public event CancelEventHandler Closing
Event Type
Type Description
CancelEventHandler
View Source

ItemActivated

Event triggered when an item in the menu is activated.

Declaration
public event ItemActivatedEventHandler ItemActivated
Event Type
Type Description
ItemActivatedEventHandler
View Source

MenuModified

Event triggered when the contents of the menu are changed.

Declaration
public event MenuModifiedEventHandler MenuModified
Event Type
Type Description
MenuModifiedEventHandler
View Source

Opening

Event triggered when the menu is being opened.

Declaration
public event CancelEventHandler Opening
Event Type
Type Description
CancelEventHandler
View Source

SelectedIndexChanged

Event triggered when the index has been changed.

Declaration
public event SelectedEventHandler SelectedIndexChanged
Event Type
Type Description
SelectedEventHandler
View Source

Shown

Event triggered when the menu is opened and shown to the user.

Declaration
public event EventHandler Shown
Event Type
Type Description
EventHandler

Implements

IContainer<T>
IRecalculable
IProcessable
IEnumerable<T>
IEnumerable
  • View Source
In this article
Back to top Generated by DocFX