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
|
if chatLoaded then
|
||||||
local forceHide = IsScreenFadedOut() or IsPauseMenuActive()
|
local forceHide = IsScreenFadedOut() or IsPauseMenuActive()
|
||||||
|
local wasForceHide = false
|
||||||
|
|
||||||
if forceHide then
|
if chatHideState ~= CHAT_HIDE_STATES.ALWAYS_HIDE then
|
||||||
origChatHideState = chatHideState
|
if forceHide then
|
||||||
chatHideState = CHAT_HIDE_STATES.ALWAYS_HIDE
|
origChatHideState = chatHideState
|
||||||
elseif origChatHideState ~= -1 then
|
chatHideState = CHAT_HIDE_STATES.ALWAYS_HIDE
|
||||||
|
end
|
||||||
|
elseif not forceHide and origChatHideState ~= -1 then
|
||||||
chatHideState = origChatHideState
|
chatHideState = origChatHideState
|
||||||
origChatHideState = -1
|
origChatHideState = -1
|
||||||
|
wasForceHide = true
|
||||||
end
|
end
|
||||||
|
|
||||||
if chatHideState ~= lastChatHideState then
|
if chatHideState ~= lastChatHideState then
|
||||||
@@ -293,7 +297,7 @@ Citizen.CreateThread(function()
|
|||||||
SendNUIMessage({
|
SendNUIMessage({
|
||||||
type = 'ON_SCREEN_STATE_CHANGE',
|
type = 'ON_SCREEN_STATE_CHANGE',
|
||||||
hideState = chatHideState,
|
hideState = chatHideState,
|
||||||
fromUserInteraction = not forceHide and not isFirstHide
|
fromUserInteraction = not forceHide and not isFirstHide and not wasForceHide
|
||||||
})
|
})
|
||||||
|
|
||||||
isFirstHide = false
|
isFirstHide = false
|
||||||
|
|||||||
Reference in New Issue
Block a user