1
0
mirror of https://github.com/Earu/EasyChat.git synced 2025-03-04 03:13:20 -05:00

Hiding game menu by hook OnPauseMenuShow (#125)

This commit is contained in:
SergeyZet1 2024-08-06 13:47:12 +03:00 committed by GitHub
parent 36d6e843b5
commit 268e5e46e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2677,19 +2677,16 @@ if CLIENT then
end
end)
hook.Add("PreRender", TAG, function()
if not input.IsKeyDown(KEY_ESCAPE) then return end
hook.Add("OnPauseMenuShow", TAG, function()
if IsValid(EasyChat.Settings) and EasyChat.Settings:IsVisible() then
EasyChat.Settings:SetVisible(false)
return false
end
-- handle settings menu if opened, stop there for now
if IsValid(EasyChat.Settings) and EasyChat.Settings:IsVisible() then
EasyChat.Settings:SetVisible(false)
return
end
if EasyChat.IsOpened() then
close_chatbox()
gui.HideGameUI()
end
if EasyChat.IsOpened() then
close_chatbox()
return false
end
end)
hook.Add("GUIMousePressed", TAG, function(mouse_code)