Fehler : http://prntscr.com/lvt24o
JavaScript
const misc = require('../cMisc');
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);
mp.events.add({
"cMenu-Open" : (lang, inject) => {
misc.prepareToCef(1);
misc.openCef("package://RP/Browsers/Menu/Menu.html", lang);
misc.injectCef(inject);
},
"cXMenu-Open" : () => {
if (ui.Visible) ui.Close();
else ui.Open();
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);
}
});
},
});
Alles anzeigen
Danke falls Jemand helfen will.