Skip to content

Commit

Permalink
menuMusicChanger v0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMorc committed Aug 8, 2024
1 parent 65c7ef5 commit 7fb9bd6
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ It includes:
* python server source code for LS2009Chat
* lua source code for LS2009Chat
* lua source code for HideHUD
* lua source code for menuMusicChanger
* original + unpacked dataS and decompiled scripts from Traktor Zetor Simulátor
* original + unpacked dataS and decompiled scripts from Farming Simulator 2009 Gold
* original + unpacked dataS and decompiled scripts from Symulator-Farmy 2009
Expand Down
38 changes: 38 additions & 0 deletions menuMusicChanger/menuMusicChanger.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
-- menuMusicChanger.lua
-- @author Richard Gráčik (mailto:[email protected])
-- @date 8.8.2024

print("[musicMenuChanger] Saving and patching original menuMusic functions")
originalLoadStreamedSample = loadStreamedSample

function patchedLoadStreamedSample()
originalLoadStreamedSample(g_menuMusic, g_modsDirectory .. "/menuMusicChanger/menu.ogg")
end

_G.loadStreamedSample = patchedLoadStreamedSample

modClassEventListener = {};

function modClassEventListener:loadMap(name)

print("[musicMenuChanger] Reverting back to the original menuMusic function")
_G.loadStreamedSample = originalLoadStreamedSample

end;

function modClassEventListener:deleteMap()
end;

function modClassEventListener:mouseEvent(posX, posY, isDown, isUp, button)
end;

function modClassEventListener:keyEvent(unicode, sym, modifier, isDown)
end;

function modClassEventListener:update(dt)
end;

function modClassEventListener:draw()
end;

addModEventListener(modClassEventListener);
9 changes: 9 additions & 0 deletions menuMusicChanger/modDesc.xml
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, Benzinly, GIANTS</author>
<version>0.2</version>

<extraSourceFiles>
<sourceFile filename="menuMusicChanger.lua" />
</extraSourceFiles>
</modDesc>

0 comments on commit 7fb9bd6

Please sign in to comment.