Can someone explain how I can import a resource (NativeUI) to client.
My current setup:
I have been writing my gamemode using a typescript boiler plate (https://github.com/MarkCavalli/rage-server-start-template)
So files in app folder client get compliled to client_packages and same for server into packages
However when I try to require a third party script (NativeUI) I get an error TypeError Point is not a constructor
I'm importing it into the client via:
const NativeUi = require('../libs/nativeui.js')
mp.events.add("PlayerJoin", () => {
const Menu = NativeUI.Menu;
const Point = NativeUI.Point;
const UIMenuListItem = NativeUI.UIMenuListItem;
const ItemsCollection = NativeUI.ItemsCollection;
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"])
));
})
Can anyone help me? I'm completely stuck for ideas on how I can get this to work.