From 8cb620dfe1721c865ff2609503334e0f624ce8a7 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sat, 26 Nov 2022 17:12:39 +0000 Subject: [PATCH] fix(esx_textui): Correctly Fix TextUI fixes 'id' issue, also fixes the "TextUI Is not displaying!" issues :) --- [esx]/esx_textui/TextUI.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/[esx]/esx_textui/TextUI.lua b/[esx]/esx_textui/TextUI.lua index 2cc04528..37020fbc 100644 --- a/[esx]/esx_textui/TextUI.lua +++ b/[esx]/esx_textui/TextUI.lua @@ -1,16 +1,21 @@ Debug = ESX.GetConfig().EnableDebug - +local IsShowing = false ---@param message any ----@param type string +---@param Type string local function TextUI(message, type) + IsShowing = true SendNUIMessage({ action = 'show', message = message and message or 'ESX-TextUI', - type = type ~= 0 and type or 'info' + type = type == 0 and "info" or type }) end local function HideUI() + if not IsShowing then + return + end + IsShowing = false SendNUIMessage({ action = 'hide' })