RadialMenu - manups4e/ScaleformUI GitHub Wiki

RadialMenu is the most recent addition to the ScaleformUI family. image


RadialMenu is a customizable WeaponWheel menu, it's divided in 8 segments (RadialSegment) that can be selected, and to each segment you can add any amount of items (SegmentItem) you want.

These are the parameters you can handle: C#

bool Enable3D // Enables / disables the 3D effects on the wheel (default true)
bool Visible // Opens / Closes the menu
SegmentItem[] Segments // An 8 items array, each item represents a segment of the wheel (clockwise)
List<InstructionalButton> InstructionalButtons // the instructional buttons to show while the menu is Visible
int CurrentSegment // The current selected segment of the wheel
void AddInstructionalButton(InstructionalButton button) // adds an instructional button to the current menu
void RemoveInstructionalButton(InstructionalButton button) // removes the desired instructional button
void RemoveInstructionalButton(int index) // removes the desired instructional button
MenuOpenedEvent OnMenuOpen // Triggered when menu is opened
MenuClosedEvent OnMenuClose // Triggered when menu is closed
SegmentChanged OnSegmentHighlight // Triggered when a segment is highlighted
IndexChanged OnSegmentIndexChange // Triggered when an SegmentItem is changed (left/right)
SegmentSelected OnSegmentSelect // Triggered when a segment is selected

Lua

.Segments -- An 8 items table, each item represents a segment of the wheel (clockwise)
.InstructionalButtons -- the instructional buttons to show while the menu is Visible
:Enable3D(enable) -- Enables / disables the 3D effects on the wheel (default true)
:Visible(bool) -- Opens / Closes the menu
:AddInstructionButton(button) -- adds an instructional button to the current menu
:RemoveInstructionButton(button) -- removes the desired instructional button
:CurrentSelection(index) -- The current selected segment of the wheel [number]
:SwitchTo(newMenu, newMenuCurrentSelection, inheritOldMenuParams) -- linked to MenuHandler
.OnMenuOpen = function(menu, data) -- Triggered when menu is opened
.OnMenuClose = function(menu) -- Triggered when menu is closed
.OnSegmentHighlight = function(segment) -- Triggered when a segment is highlighted
.OnSegmentIndexChange = function(segment, index) -- Triggered when an SegmentItem is changed (left/right)
.OnSegmentSelect = function(segment) -- Triggered when a segment is selected

RadialSegment

Each one of the segments of the wheel is instantiated as a RadialSegment.

These are the parameters: C#

List<SegmentItem> Items // The items connected to this segment
RadialMenu Parent // The RadialMenu parent to this segment
int Index // the index of this segment (from 0 to 7 clockwise)
bool Selected // True if the segment is highlighted
int CurrentSelection // The currently selected item in the segment
void AddItem(SegmentItem item) // Adds an item to the segment
void RemoveItem(SegmentItem item) // Removes the desired item from the segment
void RemoveItemAt(int index) // Removes the desired item from the segment

Lua

.Parent -- The RadialMenu parent to this segment
.Items -- the table containing the items linked to this segment
:CurrentSelection() -- The currently selected item in the segment
:Index() -- the index of this segment (from 1 to 8 clockwise)
:AddItem(item) -- Adds an item to the segment
:RemoveItem(item) -- Removes the desired item from the segment

SegmentItem

This is what every segment contains, an undefined number of this class, you can define a custom texture, a label, a description, and even the quantity of this item.

These are the available parameters:

C#

public SegmentItem(string label, string desc, string txd, string txn, int txwidth, int txheight, HudColor color) // constructor
string Label // The scrollable label
string Description // The description of this item
string TextureDict // The texture dictionary
string TextureName // The name of the texture inside the ytd dictionary
int TextureWidth // The desired size width of the texture
int TextureHeight // The desired size height of the texture
HudColor Color // the color desired of the Segment for this item
void SetQuantity(int qtty, int max = 0) // Sets a desired quantity for the item, if qtty > 0 and max == 0 the "/" won't be visible.

Lua

SegmentItem.New(_label, _desc, _txd, _txn, _txwidth, _txheight, _color) -- contructor
:Label(label) -- The scrollable label
:Description(desc) -- The description of this item
:TextureDict(txd) -- The texture dictionary
:TextureName(txn) -- The name of the texture inside the ytd dictionary
:TextureWidth(width) -- The desired size width of the texture
:TextureHeight(height) -- The desired size height of the texture
:Color(color) -- the color desired of the Segment for this item (Colours table)
:SetQuantity(qtty, max --[ defaulted 0](/manups4e/ScaleformUI/wiki/-defaulted-0)) // Sets a desired quantity for the item, if qtty > 0 and max == 0 the "/" won't be visible.