C# Class RAGENativeUI.UIMenu

Base class for RAGENativeUI. Calls the next events: OnIndexChange, OnListChanged, OnCheckboxChange, OnItemSelect, OnMenuClose, OnMenuchange.
Afficher le fichier Open project: alexguirre/RAGENativeUI Class Usage Examples

Méthodes publiques

Свойство Type Description
AUDIO_BACK string
AUDIO_ERROR string
AUDIO_LEFTRIGHT string
AUDIO_LIBRARY string
AUDIO_SELECT string
AUDIO_UPDOWN string
AllowCameraMovement bool
ControlDisablingEnabled bool
FormatDescriptions bool
HoldTimeBeforeScroll uint
MenuItems List
MouseControlsEnabled bool
MouseEdgeEnabled bool
ResetCursorOnOpen bool

Méthodes publiques

Méthode Description
AddInstructionalButton ( InstructionalButton button ) : void
AddItem ( UIMenuItem item ) : void

Add an item to the menu.

BindMenuToItem ( UIMenu menuToBind, UIMenuItem itemToBindTo ) : void

Bind a menu to a button. When the button is clicked that menu will open.

Clear ( ) : void

Remove all items from the menu.

DisEnableControls ( bool enable ) : void

Enable or disable all controls but the necessary to operate a menu.

DisableInstructionalButtons ( bool disable ) : void

Enable or disable the instructional buttons.

Draw ( ) : void

Draw the menu and all of it's components.

DrawBanner ( Rage g ) : void

Draw your custom banner.

To prevent flickering call it inside a Game.RawFrameRender event handler.

GetSafezoneBounds ( ) : Point

Returns the safezone bounds in pixel, relative to the 1080pixel based system.

GetScreenResolutionMantainRatio ( ) : SizeF

Returns the 1080pixels-based screen resolution while mantaining current aspect ratio.

GoBack ( ) : void

Close or go back in a menu chain.

GoDown ( ) : void

Go up the menu if the number of items is less than or equal to the maximum items on screen.

GoDownOverflow ( ) : void

Go down the menu if the number of items is more than maximum items on screen.

GoLeft ( ) : void

Go left on a MenuListItem.

GoRight ( ) : void

Go right on a MenuListItem.

GoUp ( ) : void

Go up the menu if the number of items is less than or equal to the maximum items on screen.

GoUpOverflow ( ) : void

Go up the menu if the number of items is more than maximum items on screen.

HasControlJustBeenPressed ( Common control, Keys key = Keys.None ) : bool

Check whether a menucontrol has been pressed.

HasControlJustBeenReleaseed ( Common control, Keys key = Keys.None ) : bool

Check whether a menucontrol has been released.

IsControlBeingPressed ( Common control, Keys key = Keys.None ) : bool

Checks whether a menucontrol is being pressed and if selected item is UIListItem, uses UIListItem variables

IsMouseInBounds ( Point topLeft, Size boxSize ) : bool

Chech whether the mouse is inside the specified rectangle.

IsMouseInListItemArrows ( UIMenuListItem item, Point topLeft, Point safezone ) : int

Function to get whether the cursor is in an arrow space, or in label of an MenuListItem.

ProcessControl ( Keys key = Keys.None ) : void

Process control-stroke. Call this in the Game.FrameRender event or in a loop.

ProcessKey ( Keys key ) : void

Process keystroke. Call this in the Game.FrameRender event or in a loop.

ProcessMouse ( ) : void

Process the mouse's position and check if it's hovering over any Element. Call this in Game.FrameRender or in a loop.

RefreshIndex ( ) : void

Reset the current selected item to 0. Use this after you add or remove items dynamically.

ReleaseMenuFromItem ( UIMenuItem releaseFrom ) : bool

Remove menu binding from button.

RemoveInstructionalButton ( InstructionalButton button ) : void
RemoveItemAt ( int index ) : void

Remove an item at index n.

Reset ( bool resetLists, bool resetCheckboxes ) : void

Sets the index of all lists to 0 and unchecks all the checkboxes.

ResetKey ( Common control ) : void

Remove all controls on a control.

SelectItem ( ) : void

Activate the current selected item.

SetBannerType ( RAGENativeUI.Elements.ResRectangle rectangle ) : void

Set the banner to your own Rectangle.

SetBannerType ( Sprite spriteBanner ) : void

Set the banner to your own Sprite object.

SetBannerType ( Texture texture ) : void

Set the banner to your own custom texture. Set it to null if you want to restore the banner.

SetKey ( Common control, GameControl gtaControl ) : void

Set a Rage.GameControl to control a menu. Can be multiple controls. This applies it to all indexes.

SetKey ( Common control, GameControl gtaControl, int controlIndex ) : void

Set a Rage.GameControl to control a menu only on a specific index.

SetKey ( Common control, Keys keyToSet ) : void

Set a key to control a menu. Can be multiple keys for each control.

SetMenuWidthOffset ( int widthOffset ) : void

Change the menu's width. The width is calculated as DefaultWidth + WidthOffset, so a width offset of 10 would enlarge the menu by 10 pixels.

UIMenu ( string title, string subtitle ) : System

Basic Menu constructor.

UIMenu ( string title, string subtitle, Point offset ) : System

Basic Menu constructor with an offset.

UIMenu ( string title, string subtitle, Point offset, Texture customBanner ) : System

Initialise a menu with a custom texture banner.

UIMenu ( string title, string subtitle, Point offset, string spriteLibrary, string spriteName ) : System

Advanced Menu constructor that allows custom title banner.

UpdateScaleform ( ) : void

Manually update the instructional buttons scaleform.

Méthodes protégées

Méthode Description
CheckboxChange ( RAGENativeUI.Elements.UIMenuCheckboxItem sender, bool Checked ) : void
IndexChange ( int newindex ) : void
ItemSelect ( UIMenuItem selecteditem, int index ) : void
ListChange ( UIMenuListItem sender, int newindex ) : void
MenuChangeEv ( UIMenu newmenu, bool forward ) : void
MenuCloseEv ( ) : void

Private Methods

Méthode Description
DrawBanner ( GraphicsEventArgs e ) : void
EnableCameraMovement ( ) : void
FormatDescription ( string input ) : string

Formats the input string so it doesn't go out of bounds of the description box.

RecaulculateDescriptionPosition ( ) : void

Method Details

AddInstructionalButton() public méthode

public AddInstructionalButton ( InstructionalButton button ) : void
button InstructionalButton
Résultat void

AddItem() public méthode

Add an item to the menu.
public AddItem ( UIMenuItem item ) : void
item RAGENativeUI.Elements.UIMenuItem Item object to be added. Can be normal item, checkbox or list item.
Résultat void

BindMenuToItem() public méthode

Bind a menu to a button. When the button is clicked that menu will open.
public BindMenuToItem ( UIMenu menuToBind, UIMenuItem itemToBindTo ) : void
menuToBind UIMenu
itemToBindTo RAGENativeUI.Elements.UIMenuItem
Résultat void

CheckboxChange() protected méthode

protected CheckboxChange ( RAGENativeUI.Elements.UIMenuCheckboxItem sender, bool Checked ) : void
sender RAGENativeUI.Elements.UIMenuCheckboxItem
Checked bool
Résultat void

Clear() public méthode

Remove all items from the menu.
public Clear ( ) : void
Résultat void

DisEnableControls() public static méthode

Enable or disable all controls but the necessary to operate a menu.
public static DisEnableControls ( bool enable ) : void
enable bool
Résultat void

DisableInstructionalButtons() public méthode

Enable or disable the instructional buttons.
public DisableInstructionalButtons ( bool disable ) : void
disable bool
Résultat void

Draw() public méthode

Draw the menu and all of it's components.
public Draw ( ) : void
Résultat void

DrawBanner() public méthode

Draw your custom banner.

To prevent flickering call it inside a Game.RawFrameRender event handler.

public DrawBanner ( Rage g ) : void
g Rage The to draw on.
Résultat void

GetSafezoneBounds() public static méthode

Returns the safezone bounds in pixel, relative to the 1080pixel based system.
public static GetSafezoneBounds ( ) : Point
Résultat Point

GetScreenResolutionMantainRatio() public static méthode

Returns the 1080pixels-based screen resolution while mantaining current aspect ratio.
public static GetScreenResolutionMantainRatio ( ) : SizeF
Résultat System.Drawing.SizeF

GoBack() public méthode

Close or go back in a menu chain.
public GoBack ( ) : void
Résultat void

GoDown() public méthode

Go up the menu if the number of items is less than or equal to the maximum items on screen.
public GoDown ( ) : void
Résultat void

GoDownOverflow() public méthode

Go down the menu if the number of items is more than maximum items on screen.
public GoDownOverflow ( ) : void
Résultat void

GoLeft() public méthode

Go left on a MenuListItem.
public GoLeft ( ) : void
Résultat void

GoRight() public méthode

Go right on a MenuListItem.
public GoRight ( ) : void
Résultat void

GoUp() public méthode

Go up the menu if the number of items is less than or equal to the maximum items on screen.
public GoUp ( ) : void
Résultat void

GoUpOverflow() public méthode

Go up the menu if the number of items is more than maximum items on screen.
public GoUpOverflow ( ) : void
Résultat void

HasControlJustBeenPressed() public méthode

Check whether a menucontrol has been pressed.
public HasControlJustBeenPressed ( Common control, Keys key = Keys.None ) : bool
control Common Control to check for.
key Keys Key if you're using keys.
Résultat bool

HasControlJustBeenReleaseed() public méthode

Check whether a menucontrol has been released.
public HasControlJustBeenReleaseed ( Common control, Keys key = Keys.None ) : bool
control Common Control to check for.
key Keys Key if you're using keys.
Résultat bool

IndexChange() protected méthode

protected IndexChange ( int newindex ) : void
newindex int
Résultat void

IsControlBeingPressed() public méthode

Checks whether a menucontrol is being pressed and if selected item is UIListItem, uses UIListItem variables
public IsControlBeingPressed ( Common control, Keys key = Keys.None ) : bool
control Common
key Keys
Résultat bool

IsMouseInBounds() public static méthode

Chech whether the mouse is inside the specified rectangle.
public static IsMouseInBounds ( Point topLeft, Size boxSize ) : bool
topLeft Point top left point of your rectangle.
boxSize System.Drawing.Size size of your rectangle.
Résultat bool

IsMouseInListItemArrows() public méthode

Function to get whether the cursor is in an arrow space, or in label of an MenuListItem.
public IsMouseInListItemArrows ( UIMenuListItem item, Point topLeft, Point safezone ) : int
item RAGENativeUI.Elements.UIMenuListItem What item to check
topLeft Point top left point of the item.
safezone Point safezone size.
Résultat int

ItemSelect() protected méthode

protected ItemSelect ( UIMenuItem selecteditem, int index ) : void
selecteditem RAGENativeUI.Elements.UIMenuItem
index int
Résultat void

ListChange() protected méthode

protected ListChange ( UIMenuListItem sender, int newindex ) : void
sender RAGENativeUI.Elements.UIMenuListItem
newindex int
Résultat void

MenuChangeEv() protected méthode

protected MenuChangeEv ( UIMenu newmenu, bool forward ) : void
newmenu UIMenu
forward bool
Résultat void

MenuCloseEv() protected méthode

protected MenuCloseEv ( ) : void
Résultat void

ProcessControl() public méthode

Process control-stroke. Call this in the Game.FrameRender event or in a loop.
public ProcessControl ( Keys key = Keys.None ) : void
key Keys
Résultat void

ProcessKey() public méthode

Process keystroke. Call this in the Game.FrameRender event or in a loop.
public ProcessKey ( Keys key ) : void
key Keys
Résultat void

ProcessMouse() public méthode

Process the mouse's position and check if it's hovering over any Element. Call this in Game.FrameRender or in a loop.
public ProcessMouse ( ) : void
Résultat void

RefreshIndex() public méthode

Reset the current selected item to 0. Use this after you add or remove items dynamically.
public RefreshIndex ( ) : void
Résultat void

ReleaseMenuFromItem() public méthode

Remove menu binding from button.
public ReleaseMenuFromItem ( UIMenuItem releaseFrom ) : bool
releaseFrom RAGENativeUI.Elements.UIMenuItem Button to release from.
Résultat bool

RemoveInstructionalButton() public méthode

public RemoveInstructionalButton ( InstructionalButton button ) : void
button InstructionalButton
Résultat void

RemoveItemAt() public méthode

Remove an item at index n.
public RemoveItemAt ( int index ) : void
index int Index to remove the item at.
Résultat void

Reset() public méthode

Sets the index of all lists to 0 and unchecks all the checkboxes.
public Reset ( bool resetLists, bool resetCheckboxes ) : void
resetLists bool If true the index of all lists will be set to 0.
resetCheckboxes bool If true all the checkboxes will be unchecked.
Résultat void

ResetKey() public méthode

Remove all controls on a control.
public ResetKey ( Common control ) : void
control Common
Résultat void

SelectItem() public méthode

Activate the current selected item.
public SelectItem ( ) : void
Résultat void

SetBannerType() public méthode

Set the banner to your own Rectangle.
public SetBannerType ( RAGENativeUI.Elements.ResRectangle rectangle ) : void
rectangle RAGENativeUI.Elements.ResRectangle UIResRectangle object. Position and size does not matter.
Résultat void

SetBannerType() public méthode

Set the banner to your own Sprite object.
public SetBannerType ( Sprite spriteBanner ) : void
spriteBanner RAGENativeUI.Elements.Sprite Sprite object. The position and size does not matter.
Résultat void

SetBannerType() public méthode

Set the banner to your own custom texture. Set it to null if you want to restore the banner.
public SetBannerType ( Texture texture ) : void
texture Texture Rage.Texture object
Résultat void

SetKey() public méthode

Set a Rage.GameControl to control a menu. Can be multiple controls. This applies it to all indexes.
public SetKey ( Common control, GameControl gtaControl ) : void
control Common
gtaControl GameControl
Résultat void

SetKey() public méthode

Set a Rage.GameControl to control a menu only on a specific index.
public SetKey ( Common control, GameControl gtaControl, int controlIndex ) : void
control Common
gtaControl GameControl
controlIndex int
Résultat void

SetKey() public méthode

Set a key to control a menu. Can be multiple keys for each control.
public SetKey ( Common control, Keys keyToSet ) : void
control Common
keyToSet Keys
Résultat void

SetMenuWidthOffset() public méthode

Change the menu's width. The width is calculated as DefaultWidth + WidthOffset, so a width offset of 10 would enlarge the menu by 10 pixels.
public SetMenuWidthOffset ( int widthOffset ) : void
widthOffset int New width offset.
Résultat void

UIMenu() public méthode

Basic Menu constructor.
public UIMenu ( string title, string subtitle ) : System
title string Title that appears on the big banner.
subtitle string Subtitle that appears in capital letters in a small black bar.
Résultat System

UIMenu() public méthode

Basic Menu constructor with an offset.
public UIMenu ( string title, string subtitle, Point offset ) : System
title string Title that appears on the big banner.
subtitle string Subtitle that appears in capital letters in a small black bar. Set to "" if you dont want a subtitle.
offset Point Point object with X and Y data for offsets. Applied to all menu elements.
Résultat System

UIMenu() public méthode

Initialise a menu with a custom texture banner.
public UIMenu ( string title, string subtitle, Point offset, Texture customBanner ) : System
title string Title that appears on the big banner. Set to "" if you don't want a title.
subtitle string Subtitle that appears in capital letters in a small black bar. Set to "" if you dont want a subtitle.
offset Point Point object with X and Y data for offsets. Applied to all menu elements.
customBanner Texture Your custom Rage.Texture.
Résultat System

UIMenu() public méthode

Advanced Menu constructor that allows custom title banner.
public UIMenu ( string title, string subtitle, Point offset, string spriteLibrary, string spriteName ) : System
title string Title that appears on the big banner. Set to "" if you are using a custom banner.
subtitle string Subtitle that appears in capital letters in a small black bar.
offset Point Point object with X and Y data for offsets. Applied to all menu elements.
spriteLibrary string Sprite library name for the banner.
spriteName string Sprite name for the banner.
Résultat System

UpdateScaleform() public méthode

Manually update the instructional buttons scaleform.
public UpdateScaleform ( ) : void
Résultat void

Property Details

AUDIO_BACK public_oe property

public string AUDIO_BACK
Résultat string

AUDIO_ERROR public_oe property

public string AUDIO_ERROR
Résultat string

AUDIO_LEFTRIGHT public_oe property

public string AUDIO_LEFTRIGHT
Résultat string

AUDIO_LIBRARY public_oe property

public string AUDIO_LIBRARY
Résultat string

AUDIO_SELECT public_oe property

public string AUDIO_SELECT
Résultat string

AUDIO_UPDOWN public_oe property

public string AUDIO_UPDOWN
Résultat string

AllowCameraMovement public_oe property

public bool AllowCameraMovement
Résultat bool

ControlDisablingEnabled public_oe property

public bool ControlDisablingEnabled
Résultat bool

FormatDescriptions public_oe property

public bool FormatDescriptions
Résultat bool

HoldTimeBeforeScroll public_oe property

public uint HoldTimeBeforeScroll
Résultat uint

MenuItems public_oe property

public List MenuItems
Résultat List

MouseControlsEnabled public_oe property

public bool MouseControlsEnabled
Résultat bool

MouseEdgeEnabled public_oe property

public bool MouseEdgeEnabled
Résultat bool

ResetCursorOnOpen public_oe property

public bool ResetCursorOnOpen
Résultat bool