Skip to content

Commit e97cacb

Browse files
committed
rename HUD -> Hud to conform to convention
1 parent 058345e commit e97cacb

File tree

10 files changed

+37
-29
lines changed

10 files changed

+37
-29
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
---
22
template: lua-hook.html
3-
title: HUDPaint
3+
title: HudDraw
44
icon: lua-client
55
tags:
66
- lua
77
- client
88
- needs-verification
99
- needs-example
1010
lua:
11-
function: HUDPaint
11+
function: HudDraw
1212
realm: client
1313
description: ""
1414
arguments:
15-
15+
1616
returns:
17-
17+
1818
---
1919

2020
<div class="lua__search__keywords">
21-
hook HUDPaint &#x2013; ""
21+
hook HudDraw &#x2013; ""
2222
</div>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
---
22
template: lua-hook.html
3-
title: HUDShouldDraw
3+
title: HudShouldDraw
44
icon: lua-client
55
tags:
66
- lua
77
- client
88
- needs-verification
99
- needs-example
1010
lua:
11-
function: HUDShouldDraw
11+
function: HudShouldDraw
1212
realm: client
1313
description: ""
1414
arguments:
15-
15+
1616
returns:
1717
- type: unknown
1818
description: ""
1919
---
2020

2121
<div class="lua__search__keywords">
22-
hook HUDShouldDraw &#x2013; ""
22+
hook HudShouldDraw &#x2013; ""
2323
</div>
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
---
22
template: lua-hook.html
3-
title: HUDDrawScoreBoard
3+
title: ScoreboardDraw
44
icon: lua-client
55
tags:
66
- lua
77
- client
88
- needs-verification
99
- needs-example
1010
lua:
11-
function: HUDDrawScoreBoard
11+
function: ScoreboardDraw
1212
realm: client
1313
description: ""
1414
arguments:
15-
15+
1616
returns:
17-
17+
1818
---
1919

2020
<div class="lua__search__keywords">
21-
hook HUDDrawScoreBoard &#x2013; ""
21+
hook ScoreboardDraw &#x2013; ""
2222
</div>

game/experiment/addons/gmod_compatibility/scripts/lua/includes/modules/gmod_compatibility/sh_init.lua

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,11 +1931,23 @@ if (CLIENT) then
19311931
hook.Run("OnContextMenuClose")
19321932
end)
19331933

1934-
hook.Add("LevelInitPostEntity", "GModCompatibility.CallInitPostEntityHooks", function()
1934+
hook.Add("LevelInitPostEntity", "GModCompatibility.CallInitPostEntityHook", function()
19351935
hook.Run("InitPostEntity")
1936+
end)
1937+
1938+
hook.Add("HudDraw", "GModCompatibility.CallHUDPaintHook", function()
1939+
hook.Run("HUDPaint")
1940+
end)
1941+
1942+
hook.Add("HudShouldDraw", "GModCompatibility.CallHUDShouldDrawHook", function()
1943+
hook.Run("HUDShouldDraw")
1944+
end)
1945+
1946+
hook.Add("ScoreboardDraw", "GModCompatibility.CallHUDDrawScoreBoardHook", function()
1947+
hook.Run("HUDDrawScoreBoard")
19361948
end)
19371949
else
1938-
hook.Add("ServerActivate", "GModCompatibility.CallInitPostEntityHooks", function()
1950+
hook.Add("ServerActivate", "GModCompatibility.CallInitPostEntityHook", function()
19391951
hook.Run("InitPostEntity")
19401952
end)
19411953

@@ -1944,7 +1956,7 @@ else
19441956
end)
19451957
end
19461958

1947-
hook.Add("CanPhysgunPickup", "GModCompatibility.CallCanPhysgunPickupHooks", function(client, entity)
1959+
hook.Add("CanPhysgunPickup", "GModCompatibility.CallCanPhysgunPickupHook", function(client, entity)
19481960
return hook.Run("PhysgunPickup", client, entity)
19491961
end)
19501962

game/experiment/gamemodes/hl2sb/gamemode/cl_init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function test()
8282
end
8383
Timers.Simple(2, test)
8484

85-
function GM:HUDPaint()
85+
function GM:HudDraw()
8686
if (not STOP) then -- TODO: How to detect freed material textures?
8787
Surfaces.SetMaterial(testMat)
8888
Surfaces.DrawSetColor(255, 255, 255, 255)

game/experiment/gamemodes/super/gamemode/cl_init.lua

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ end
2121
function GM:HideClientUI()
2222
end
2323

24-
function GM:HUDShouldDraw(elementName)
24+
function GM:HudShouldDraw(elementName)
2525
end
2626

27-
function GM:HUDPaint()
27+
function GM:HudDraw()
2828
end
2929

3030
function GM:KeyInput(down, keyNumber, currentBinding)
@@ -62,7 +62,3 @@ end
6262

6363
function GM:ShouldDrawViewModel()
6464
end
65-
66-
function GM:HUDPaint()
67-
-- Here for GMod compatibility.
68-
end

game/experiment/scripts/lua/utilities/test/gmod_texture_filters.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ filters[TEXFILTER.POINT] = "POINT"
1717
filters[TEXFILTER.LINEAR] = "LINEAR"
1818
filters[TEXFILTER.ANISOTROPIC] = "ANISOTROPIC"
1919

20-
hook.Add("HUDPaint", "PutAUniqueHookNameHere", function()
20+
hook.Add("HudDraw", "PutAUniqueHookNameHere", function()
2121
surface.SetDrawColor(255, 255, 255, 255) -- Set the drawing color
2222
surface.SetMaterial(ourMat) -- Use our cached material
2323

src/game/client/game_controls/ClientScoreBoardDialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ CClientScoreBoardDialog::~CClientScoreBoardDialog()
100100
void CClientScoreBoardDialog::Paint()
101101
{
102102
#ifdef LUA_SDK
103-
LUA_CALL_HOOK_BEGIN( "HUDDrawScoreBoard" );
103+
LUA_CALL_HOOK_BEGIN( "ScoreboardDraw" );
104104
LUA_CALL_HOOK_END( 0, 0 );
105105
#endif
106106
}

src/game/client/hud.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ bool CHudElement::ShouldDraw( void )
297297
C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer();
298298
if ( pPlayer )
299299
{
300-
LUA_CALL_HOOK_BEGIN( "HUDShouldDraw" );
300+
LUA_CALL_HOOK_BEGIN( "HudShouldDraw" );
301301
lua_pushstring( L, GetName() );
302302
LUA_CALL_HOOK_END( 1, 1 );
303303

@@ -992,7 +992,7 @@ bool CHud::IsHidden( int iHudFlags )
992992
if ( ( iHudFlags & HIDEHUD_NEEDSUIT ) && ( !pPlayer->IsSuitEquipped() ) )
993993
return true;
994994

995-
// Hide all HUD elements during screenshot if the user's set hud_freezecamhide ( TF2 )
995+
// Hide all HUD elements during screenshot if the user's set hud_freezecamhide ( TF2 )
996996
#if defined( TF_CLIENT_DLL )
997997
extern bool IsTakingAFreezecamScreenshot();
998998
extern ConVar hud_freezecamhide;

src/game/client/scripted_controls/scriptedhudviewport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ void CScriptedHudViewport::SetParent( vgui::VPANEL parent )
5252

5353
void CScriptedHudViewport::Paint()
5454
{
55-
LUA_CALL_HOOK_BEGIN( "HUDPaint" );
55+
LUA_CALL_HOOK_BEGIN( "HudDraw" );
5656
LUA_CALL_HOOK_END( 0, 0 );
5757
}

0 commit comments

Comments
 (0)