From fee2950a35a13fb9f58cf2653ee82450d944bf25 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Fri, 29 Apr 2022 03:02:28 +1000 Subject: [PATCH] feat(resource): throw an error if the UI is not built --- resource/main.lua | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/resource/main.lua b/resource/main.lua index afe0650..d559307 100644 --- a/resource/main.lua +++ b/resource/main.lua @@ -1,7 +1,3 @@ --- Creates exports from values assigned to lib --- Hacky workaround for Lua Language Server support ---- Alias for `exports.ox_lib` - lib = setmetatable({}, { __newindex = function(self, name, fn) exports(name, fn) @@ -9,9 +5,6 @@ lib = setmetatable({}, { end }) -function lib.setClipboard(value) - SendNUIMessage({ - action = 'setClipboard', - data = value - }) -end \ No newline at end of file +if not LoadResourceFile('ox_lib', 'web/build/index.html') then + error('Unable to load UI. Build ox_lib or download the latest release.\n ^3https://github.com/overextended/ox_lib/releases/latest/download/ox_lib.zip^0') +end