From c6e1835a5543022de87bfbbe28e3c82d06cc1735 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Tue, 30 Aug 2022 15:46:53 +0100 Subject: [PATCH] tweak: es_extended -> better esx textui error handling --- [esx]/es_extended/client/functions.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/[esx]/es_extended/client/functions.lua b/[esx]/es_extended/client/functions.lua index 8c21ae27..c2d94581 100644 --- a/[esx]/es_extended/client/functions.lua +++ b/[esx]/es_extended/client/functions.lua @@ -94,11 +94,21 @@ function ESX.ShowNotification(message, type, length) end function ESX.TextUI(message, type) - exports["esx_textui"]:TextUI(message, type) + if GetResourceState("esx_textui") ~= "missing" then + exports["esx_textui"]:TextUI(message, type) + else + print("[ERROR] Missing ESX TextUI!") + return + end end function ESX.HideUI() - exports["esx_textui"]:HideUI() + if GetResourceState("esx_textui") ~= "missing" then + exports["esx_textui"]:HideUI() + else + print("[ERROR] Missing ESX TextUI!") + return + end end function ESX.ShowAdvancedNotification(sender, subject, msg, textureDict, iconType, flash, saveToBrief, hudColorIndex)