forked from TeamUlysses/ulx
xlib: Add helpers for bypassing some replicated cvars when listen server host
- Will help resolve issues where replicated cvar sliders on the gmod admin menu spaz out
This commit is contained in:
parent
97203ca256
commit
3b957bef5e
@ -1227,3 +1227,18 @@ local function fadeAnim_end( data )
|
||||
if data.panelIn then data.panelIn:SetAlpha( 255 ) end
|
||||
end
|
||||
xlib.registerAnimType( "pnlFade", fadeAnim_run, fadeAnim_start, fadeAnim_end )
|
||||
|
||||
|
||||
-------------------------
|
||||
-- Convar/Listen helpers
|
||||
-------------------------
|
||||
|
||||
-- Useful for switching between cvar or replicated cvar depending on if the player is the host
|
||||
xlib.ifListenHost = function(value)
|
||||
if LocalPlayer():IsListenServerHost() then return value end
|
||||
return nil
|
||||
end
|
||||
xlib.ifNotListenHost = function(value)
|
||||
if not LocalPlayer():IsListenServerHost() then return value end
|
||||
return nil
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user