Skip to content

Commit 125bbdb

Browse files
committed
HideHUD v0.02 - fix possible issue with mod order and priority
1 parent 70243b3 commit 125bbdb

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

HideHUD/hidehud.lua

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
-- HideHUD Mod - hidehud.lua
22
-- possibly the only file needed for it all
33
-- @author Richard Gráčik (mailto:r.gracik@gmail.com)
4-
-- @date 13.10.2021
5-
6-
print("[HideHUD Mod] saving original draw and keyEvent functions")
4+
-- @date 13.10.2021 - 14.10.2021
75

86
HideHUDenabled=false
97

10-
original = {
11-
draw = draw,
12-
keyEvent = keyEvent
13-
}
14-
158
--draw function that does exactly nothing
169
function HideHUDdraw()
1710
end
@@ -29,14 +22,20 @@ function HideHUDkeyEvent(unicode, sym, modifier, isDown)
2922

3023
end
3124

32-
print("[HideHUD Mod] overriding the keyEvent function")
33-
_G.keyEvent = HideHUDkeyEvent
34-
3525
modClassEventListener = {};
3626

3727

3828
function modClassEventListener:loadMap(name)
39-
29+
30+
print("[HideHUD Mod] saving original draw and keyEvent functions")
31+
original = {
32+
draw = draw,
33+
keyEvent = keyEvent
34+
}
35+
36+
print("[HideHUD Mod] overriding the keyEvent function")
37+
_G.keyEvent = HideHUDkeyEvent
38+
4039
end;
4140

4241
function modClassEventListener:deleteMap()
@@ -48,6 +47,7 @@ function modClassEventListener:mouseEvent(posX, posY, isDown, isUp, button)
4847
end;
4948

5049
function modClassEventListener:keyEvent(unicode, sym, modifier, isDown)
50+
5151
if isDown and sym == 291 then
5252
HideHUDenabled = not HideHUDenabled
5353

@@ -59,6 +59,7 @@ function modClassEventListener:keyEvent(unicode, sym, modifier, isDown)
5959
print("[HideHUD Mod] disabling HideHUD - F10 key")
6060
end
6161
end
62+
6263
end;
6364

6465
function modClassEventListener:update(dt)

HideHUD/modDesc.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
22
<modDesc descVersion="1">
33
<author>Morc</author>
4-
<version>0.01</version>
4+
<version>0.02</version>
55

66
<extraSourceFiles>
77
<sourceFile filename="hidehud.lua" />

0 commit comments

Comments
 (0)