Monolith-RP / issues

This is the Monolith-RP issue tracker. You can report bugs, and request features here.
4 stars 3 forks source link

Staff On Duty: Fullbright toggle #234

Open JacubRSTNC opened 2 years ago

JacubRSTNC commented 2 years ago

Describe The Feature

The ability for staff to turn on / off fullbright in order to spectate in dark environments.

Why Would You Like This Feature?

As of currently, it is near impossible to spectate players in a dark environment as you cant see shit. So having fullbright / a clientside light would make this easier, as using the flashlight in noclip is still visible to other players.

Suggested Solution

Add a console command, or chat command to toggle fullbright for Staff on Duty.

Considered Alternatives

An alternative to this would be a clientside light for SoD, but Fullbright seems easier on both the development & users end.

DevulTj commented 2 years ago
local LightingModeChanged = false
hook.Add( "PreRender", "fullbright", function()
    render.SetLightingMode( 1 )
    LightingModeChanged = true
end )

local function EndOfLightingMod()
    if LightingModeChanged then
        render.SetLightingMode( 0 )
        LightingModeChanged = false
    end
end
hook.Add( "PostRender", "fullbright", EndOfLightingMod )
hook.Add( "PreDrawHUD", "fullbright", EndOfLightingMod )

Sample psuedocode from the gmod wiki that we can work with