mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2025-12-12 06:14:09 +01:00
chat2: fix hide state being permanently overridden when faded out/paused
This commit is contained in:
@@ -278,13 +278,17 @@ Citizen.CreateThread(function()
|
||||
|
||||
if chatLoaded then
|
||||
local forceHide = IsScreenFadedOut() or IsPauseMenuActive()
|
||||
local wasForceHide = false
|
||||
|
||||
if forceHide then
|
||||
origChatHideState = chatHideState
|
||||
chatHideState = CHAT_HIDE_STATES.ALWAYS_HIDE
|
||||
elseif origChatHideState ~= -1 then
|
||||
if chatHideState ~= CHAT_HIDE_STATES.ALWAYS_HIDE then
|
||||
if forceHide then
|
||||
origChatHideState = chatHideState
|
||||
chatHideState = CHAT_HIDE_STATES.ALWAYS_HIDE
|
||||
end
|
||||
elseif not forceHide and origChatHideState ~= -1 then
|
||||
chatHideState = origChatHideState
|
||||
origChatHideState = -1
|
||||
wasForceHide = true
|
||||
end
|
||||
|
||||
if chatHideState ~= lastChatHideState then
|
||||
@@ -293,7 +297,7 @@ Citizen.CreateThread(function()
|
||||
SendNUIMessage({
|
||||
type = 'ON_SCREEN_STATE_CHANGE',
|
||||
hideState = chatHideState,
|
||||
fromUserInteraction = not forceHide and not isFirstHide
|
||||
fromUserInteraction = not forceHide and not isFirstHide and not wasForceHide
|
||||
})
|
||||
|
||||
isFirstHide = false
|
||||
|
||||
Reference in New Issue
Block a user