Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown-gd committed Apr 5, 2024
1 parent 65beea5 commit 06547b6
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions lua/autorun/!!!random-patches.yue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CLIENT = CLIENT
SERVER = SERVER
pairs = pairs

addonName = "Random Patches v5.17.5"
addonName = "Random Patches v5.18.0"

getHookName = ( patchName, hookName ) ->
return addonName .. "::" .. patchName .. ( hookName or "" )
Expand Down Expand Up @@ -599,6 +599,7 @@ do
Simple 0.25, ->
if IsValid( ply )
ply\RemoveAllDecals!
return

PRE_HOOK )

Expand All @@ -614,7 +615,7 @@ do
PLAYER.LagCompensation = ( bool ) =>
if @m_bLagCompensation ~= bool
@m_bLagCompensation = bool
cLagCompensation( @, bool )
return cLagCompensation( @, bool )

do

Expand Down Expand Up @@ -722,6 +723,7 @@ if SERVER

stop = ->
hook_Remove "EntityRemoved", hookName
return

hook_Add "PostCleanupMap", hookName, start, PRE_HOOK
hook_Add "PreCleanupMap", hookName, stop, PRE_HOOK
Expand Down Expand Up @@ -772,6 +774,7 @@ if SERVER
hook_Add( "OnEntityCreated", hookName, ( entity ) ->
if GetClass( entity ) == "prop_vehicle_prisoner_pod"
entity\AddEFlags( EFL_NO_THINK_FUNCTION )
return

PRE_HOOK )

Expand Down Expand Up @@ -925,7 +928,7 @@ if CLIENT and not MENU_DLL

cam.StartOrthoView = ( a, b, c, d ) ->
camStack += 1
cStartOrthoView( a, b, c, d )
return cStartOrthoView( a, b, c, d )

cEndOrthoView = cam.CEndOrthoView
unless cEndOrthoView
Expand All @@ -941,7 +944,7 @@ if CLIENT and not MENU_DLL
if camStack < 0
camStack = 0

cEndOrthoView!
return cEndOrthoView!

do

Expand All @@ -964,12 +967,12 @@ if CLIENT and not MENU_DLL

PRE_HOOK )

do

Register( "Screen Capture Fix", ( hookName ) ->
:IsGameUIVisible, :ActivateGameUI, :HideGameUI = gui
:CursorVisible = vgui

lastState = nil
hook_Add( "Think", getHookName( "False Screen Capture Fix" ), ->
hook_Add( "Think", hookName, ->
if HasFocus!
if lastState ~= nil
if lastState
Expand All @@ -978,12 +981,18 @@ if CLIENT and not MENU_DLL
lastState = nil

elseif lastState == nil
if CursorVisible!
return

lastState = not IsGameUIVisible!
if lastState
ActivateGameUI!
return

PRE_HOOK )
( hookName ) ->
hook_Remove "Think", hookName
)

MsgC( SERVER and Color( 50, 100, 250 ) or Color( 250, 100, 50 ), "[" .. addonName .. "] ", color_white, table.Random( {
"Here For You ♪", "Game Patched!", "OK", "Successfully initialized!",
Expand Down

0 comments on commit 06547b6

Please sign in to comment.