-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
-- HideHUD Mod - hidehud.lua | ||
-- possibly the only file needed for it all | ||
-- @author Richard Gráčik (mailto:[email protected]) | ||
-- @date 13.10.2021 | ||
|
||
print("[HideHUD Mod] saving original draw and keyEvent functions") | ||
|
||
HideHUDenabled=false | ||
|
||
original = { | ||
draw = draw, | ||
keyEvent = keyEvent | ||
} | ||
|
||
--draw function that does exactly nothing | ||
function HideHUDdraw() | ||
end | ||
|
||
--since gameMenuSystem from main.lua has a higher priority than modClassEventListener's keyEvent then we need a workaround | ||
function HideHUDkeyEvent(unicode, sym, modifier, isDown) | ||
|
||
original.keyEvent(unicode, sym, modifier, isDown) | ||
|
||
if gameMenuSystem.currentMenu ~= nil and HideHUDenabled then | ||
_G.draw = original.draw | ||
print("[HideHUD Mod] disabling HideHUD - in game menu open") | ||
HideHUDenabled = false | ||
end | ||
|
||
end | ||
|
||
print("[HideHUD Mod] overriding the keyEvent function") | ||
_G.keyEvent = HideHUDkeyEvent | ||
|
||
modClassEventListener = {}; | ||
|
||
|
||
function modClassEventListener:loadMap(name) | ||
|
||
end; | ||
|
||
function modClassEventListener:deleteMap() | ||
|
||
end; | ||
|
||
function modClassEventListener:mouseEvent(posX, posY, isDown, isUp, button) | ||
|
||
end; | ||
|
||
function modClassEventListener:keyEvent(unicode, sym, modifier, isDown) | ||
if isDown and sym == 291 then | ||
HideHUDenabled = not HideHUDenabled | ||
|
||
if HideHUDenabled then | ||
_G.draw = HideHUDdraw | ||
print("[HideHUD Mod] enabling HideHUD - F10 key") | ||
else | ||
_G.draw = original.draw | ||
print("[HideHUD Mod] disabling HideHUD - F10 key") | ||
end | ||
end | ||
end; | ||
|
||
function modClassEventListener:update(dt) | ||
end; | ||
|
||
function modClassEventListener:draw() | ||
|
||
end; | ||
|
||
addModEventListener(modClassEventListener); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?> | ||
<modDesc descVersion="1"> | ||
<author>Morc</author> | ||
<version>0.01</version> | ||
|
||
<extraSourceFiles> | ||
<sourceFile filename="hidehud.lua" /> | ||
</extraSourceFiles> | ||
</modDesc> |