UIMenuSliderItem
UIMenuListItem
itemsItemsCollection
for future updatesBackColor
, HighlightedBackColor
, ForeColor
and HighlightedForeColor
to UIMenuItem
const NativeUI = require("nativeui");
const Menu = NativeUI.Menu;
const UIMenuItem = NativeUI.UIMenuItem;
const UIMenuListItem = NativeUI.UIMenuListItem;
const UIMenuCheckboxItem = NativeUI.UIMenuCheckboxItem;
const UIMenuSliderItem = NativeUI.UIMenuSliderItem;
const BadgeStyle = NativeUI.BadgeStyle;
const Point = NativeUI.Point;
const ItemsCollection = NativeUI.ItemsCollection;
const Color = NativeUI.Color;
const ListItem = NativeUI.ListItem;
mp.gui.cursor.visible = false;
mp.gui.chat.show(false);
const ui = new Menu("Test UI", "Test UI Subtitle", new Point(50, 50));
ui.AddItem(new UIMenuListItem(
"List Item",
"Fugiat pariatur consectetur ex duis magna nostrud et dolor laboris est do pariatur amet sint.",
new ItemsCollection(["Item 1", "Item 2", "Item 3"])
));
ui.AddItem(new UIMenuSliderItem(
"Slider Item",
["Fugiat", "pariatur", "consectetur", "ex", "duis", "magna", "nostrud", "et", "dolor", "laboris"],
5,
"Fugiat pariatur consectetur ex duis magna nostrud et dolor laboris est do pariatur amet sint.",
true
));
ui.AddItem(new UIMenuCheckboxItem(
"Checkbox Item",
false,
"Fugiat pariatur consectetur ex duis magna nostrud et dolor laboris est do pariatur amet sint."
));
ui.ItemSelect.on(item => {
if (item instanceof UIMenuListItem) {
console.log(item.SelectedItem.DisplayText, item.SelectedItem.Data);
} else if (item instanceof UIMenuSliderItem) {
console.log(item.Text, item.Index, item.IndexToItem(item.Index));
} else {
console.log(item.Text);
}
});
// ui.SliderChange.on((item, index, value) => {
// console.log(item.Text, index, value);
// });
mp.keys.bind(0x71, false, () => {
if (ui.Visible) ui.Close();
else ui.Open();
});
new Menu(Title, Subtitle, Offset, spriteLibrary = "commonmenu", spriteName = "interaction_bgd")
AddItem(UIMenuItem)
BindMenuToItem(NativeUI, UIMenuItem)
ReleaseMenuFromItem(UIMenuItem)
Open()
Close()
IndexChange: (Index)
ListChange: (UIMenuListItem, Index)
CheckboxChange: (UIMenuCheckboxItem, Checked)
ItemSelect: (UIMenuItem, Index)
SliderChange: (UIMenuSliderItem, Index, Value)
MenuClose: ()
MenuChange: (Menu)
new UIMenuItem(Caption, Description = "")
SetLeftBadge(BadgeStyle)
SetRightBadge(BadgeStyle)
SetRightLabel(Text)
Text: String
Description: String
Enabled: Boolean
BackColor: Color
HighlightedBackColor: Color
ForeColor: Color
HighlightedForeColor: Color
new UIMenuListItem(Caption, Description = "", collection = new ItemsCollection([]), startIndex = 0)
(Extends UIMenuItem
)
Does not support SetRightBadge
and SetRightLabel
Collection: ItemsCollection
SelectedItem: string
SelectedValue: string
new UIMenuCheckboxItem(Caption, checked = false, Description = "")
(Extends UIMenuItem
)
Does not support SetRightBadge
and SetRightLabel
Checked: boolean
CheckedChanged: (Checked)
new UIMenuSliderItem(Caption, Items, Startindex, Description = "", Divider = false)
(Extends UIMenuItem
)
Does not support SetRightBadge
and SetRightLabel
Index: number
IndexToItem: any
new Point(X, Y)
X: number
Y: number
new Size(Width, Height)
Width: number
Height: number
new Color(Red, Green, Blue, Alpha = 255)
R: number
G: number
B: number
A: number
new ItemsCollection(Array)
enum BadgeStyle {
None,
BronzeMedal,
GoldMedal,
SilverMedal,
Alert,
Crown,
Ammo,
Armour,
Barber,
Clothes,
Franklin,
Bike,
Car,
Gun,
Heart,
Makeup,
Mask,
Michael,
Star,
Tatoo,
Trevor,
Lock,
Tick
}
enum Font {
ChaletLondon = 0,
HouseScript = 1,
Monospace = 2,
CharletComprimeColonge = 4,
Pricedown = 7
}