Skip to content
This repository has been archived by the owner on Apr 7, 2023. It is now read-only.

Update cl_chat.lua #208

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion resources/[gameplay]/chat/cl_chat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,12 @@ if not isRDR then
end, false)
end

local lastChatHideState = -1

Citizen.CreateThread(function()
SetTextChatEnabled(false)
SetNuiFocus(false)

local lastChatHideState = -1
local origChatHideState = -1

while true do
Expand Down Expand Up @@ -306,3 +307,25 @@ Citizen.CreateThread(function()
end
end
end)

local function setHideState(state,setLastState)
if type(state) == 'string' then
state = CHAT_HIDE_STATES[state]
end

chatHideState = state

if setLastState then
lastChatHideState = state
end
end
Copy link

@ItsANoBrainer ItsANoBrainer Mar 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
end
SetResourceKvp('hideState', tostring(chatHideState))
end

Save changes to KVP.


local function getHideState()
return chatHideState
end

exports('setHideState',setHideState)
exports('getHideState',getHideState)

AddEventHandler('chat:setHideState',setHideState)
AddEventHandler('chat:getHideState',getHideState)