Don't block the menu (#136)

* Don't block the main menu

* Don't block weapon selection
This commit is contained in:
legokidlogan 2023-11-05 17:08:19 -07:00 committed by GitHub
parent da10b4166d
commit 1b308c5f41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,8 @@
local EFFECT_NAME = "NoHud"
local ALLOWED_HUD_ELEMENTS = {
CHudMenu = true,
CHudWeaponSelection = true,
}
CFCUlxCurse.RegisterEffect( {
@ -7,7 +11,9 @@ CFCUlxCurse.RegisterEffect( {
onStart = function( cursedPly )
if SERVER then return end
CFCUlxCurse.AddEffectHook( cursedPly, EFFECT_NAME, "HUDShouldDraw", "NoHudPls", function()
CFCUlxCurse.AddEffectHook( cursedPly, EFFECT_NAME, "HUDShouldDraw", "NoHudPls", function( elementName )
if ALLOWED_HUD_ELEMENTS[elementName] then return end
return false
end )
end,