C# Класс RAGENativeUI.UIMenu

Base class for RAGENativeUI. Calls the next events: OnIndexChange, OnListChanged, OnCheckboxChange, OnItemSelect, OnMenuClose, OnMenuchange.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
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

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

AddInstructionalButton() публичный Метод

public AddInstructionalButton ( InstructionalButton button ) : void
button InstructionalButton
Результат void

AddItem() публичный Метод

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.
Результат void

BindMenuToItem() публичный Метод

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
Результат void

CheckboxChange() защищенный Метод

protected CheckboxChange ( RAGENativeUI.Elements.UIMenuCheckboxItem sender, bool Checked ) : void
sender RAGENativeUI.Elements.UIMenuCheckboxItem
Checked bool
Результат void

Clear() публичный Метод

Remove all items from the menu.
public Clear ( ) : void
Результат void

DisEnableControls() публичный статический Метод

Enable or disable all controls but the necessary to operate a menu.
public static DisEnableControls ( bool enable ) : void
enable bool
Результат void

DisableInstructionalButtons() публичный Метод

Enable or disable the instructional buttons.
public DisableInstructionalButtons ( bool disable ) : void
disable bool
Результат void

Draw() публичный Метод

Draw the menu and all of it's components.
public Draw ( ) : void
Результат void

DrawBanner() публичный Метод

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.
Результат void

GetSafezoneBounds() публичный статический Метод

Returns the safezone bounds in pixel, relative to the 1080pixel based system.
public static GetSafezoneBounds ( ) : Point
Результат Point

GetScreenResolutionMantainRatio() публичный статический Метод

Returns the 1080pixels-based screen resolution while mantaining current aspect ratio.
public static GetScreenResolutionMantainRatio ( ) : SizeF
Результат System.Drawing.SizeF

GoBack() публичный Метод

Close or go back in a menu chain.
public GoBack ( ) : void
Результат void

GoDown() публичный Метод

Go up the menu if the number of items is less than or equal to the maximum items on screen.
public GoDown ( ) : void
Результат void

GoDownOverflow() публичный Метод

Go down the menu if the number of items is more than maximum items on screen.
public GoDownOverflow ( ) : void
Результат void

GoLeft() публичный Метод

Go left on a MenuListItem.
public GoLeft ( ) : void
Результат void

GoRight() публичный Метод

Go right on a MenuListItem.
public GoRight ( ) : void
Результат void

GoUp() публичный Метод

Go up the menu if the number of items is less than or equal to the maximum items on screen.
public GoUp ( ) : void
Результат void

GoUpOverflow() публичный Метод

Go up the menu if the number of items is more than maximum items on screen.
public GoUpOverflow ( ) : void
Результат void

HasControlJustBeenPressed() публичный Метод

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.
Результат bool

HasControlJustBeenReleaseed() публичный Метод

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.
Результат bool

IndexChange() защищенный Метод

protected IndexChange ( int newindex ) : void
newindex int
Результат void

IsControlBeingPressed() публичный Метод

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
Результат bool

IsMouseInBounds() публичный статический Метод

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.
Результат bool

IsMouseInListItemArrows() публичный Метод

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.
Результат int

ItemSelect() защищенный Метод

protected ItemSelect ( UIMenuItem selecteditem, int index ) : void
selecteditem RAGENativeUI.Elements.UIMenuItem
index int
Результат void

ListChange() защищенный Метод

protected ListChange ( UIMenuListItem sender, int newindex ) : void
sender RAGENativeUI.Elements.UIMenuListItem
newindex int
Результат void

MenuChangeEv() защищенный Метод

protected MenuChangeEv ( UIMenu newmenu, bool forward ) : void
newmenu UIMenu
forward bool
Результат void

MenuCloseEv() защищенный Метод

protected MenuCloseEv ( ) : void
Результат void

ProcessControl() публичный Метод

Process control-stroke. Call this in the Game.FrameRender event or in a loop.
public ProcessControl ( Keys key = Keys.None ) : void
key Keys
Результат void

ProcessKey() публичный Метод

Process keystroke. Call this in the Game.FrameRender event or in a loop.
public ProcessKey ( Keys key ) : void
key Keys
Результат void

ProcessMouse() публичный Метод

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
Результат void

RefreshIndex() публичный Метод

Reset the current selected item to 0. Use this after you add or remove items dynamically.
public RefreshIndex ( ) : void
Результат void

ReleaseMenuFromItem() публичный Метод

Remove menu binding from button.
public ReleaseMenuFromItem ( UIMenuItem releaseFrom ) : bool
releaseFrom RAGENativeUI.Elements.UIMenuItem Button to release from.
Результат bool

RemoveInstructionalButton() публичный Метод

public RemoveInstructionalButton ( InstructionalButton button ) : void
button InstructionalButton
Результат void

RemoveItemAt() публичный Метод

Remove an item at index n.
public RemoveItemAt ( int index ) : void
index int Index to remove the item at.
Результат void

Reset() публичный Метод

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.
Результат void

ResetKey() публичный Метод

Remove all controls on a control.
public ResetKey ( Common control ) : void
control Common
Результат void

SelectItem() публичный Метод

Activate the current selected item.
public SelectItem ( ) : void
Результат void

SetBannerType() публичный Метод

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.
Результат void

SetBannerType() публичный Метод

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.
Результат void

SetBannerType() публичный Метод

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
Результат void

SetKey() публичный Метод

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
Результат void

SetKey() публичный Метод

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
Результат void

SetKey() публичный Метод

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
Результат void

SetMenuWidthOffset() публичный Метод

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.
Результат void

UIMenu() публичный Метод

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.
Результат System

UIMenu() публичный Метод

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.
Результат System

UIMenu() публичный Метод

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.
Результат System

UIMenu() публичный Метод

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.
Результат System

UpdateScaleform() публичный Метод

Manually update the instructional buttons scaleform.
public UpdateScaleform ( ) : void
Результат void

Описание свойств

AUDIO_BACK публичное свойство

public string AUDIO_BACK
Результат string

AUDIO_ERROR публичное свойство

public string AUDIO_ERROR
Результат string

AUDIO_LEFTRIGHT публичное свойство

public string AUDIO_LEFTRIGHT
Результат string

AUDIO_LIBRARY публичное свойство

public string AUDIO_LIBRARY
Результат string

AUDIO_SELECT публичное свойство

public string AUDIO_SELECT
Результат string

AUDIO_UPDOWN публичное свойство

public string AUDIO_UPDOWN
Результат string

AllowCameraMovement публичное свойство

public bool AllowCameraMovement
Результат bool

ControlDisablingEnabled публичное свойство

public bool ControlDisablingEnabled
Результат bool

FormatDescriptions публичное свойство

public bool FormatDescriptions
Результат bool

HoldTimeBeforeScroll публичное свойство

public uint HoldTimeBeforeScroll
Результат uint

MenuItems публичное свойство

public List MenuItems
Результат List

MouseControlsEnabled публичное свойство

public bool MouseControlsEnabled
Результат bool

MouseEdgeEnabled публичное свойство

public bool MouseEdgeEnabled
Результат bool

ResetCursorOnOpen публичное свойство

public bool ResetCursorOnOpen
Результат bool