Menu State Music

I spent this afternoon investigating the menu state, and I ended up with this

i figured someone might find some use from it

It works in-game too, however your music will be paused during the loading screen and you will need to re-open it afterwards.

Because the menu is kind of locked in, you need to install it like this:

  1. Download folder.
  2. Navigate to garrysmod\lua\menu
  3. Place the music.lua file into the menu folder.
  4. Add this line to menu.lua:
    [LUA]
    include( “music.lua” )
    [/LUA]
  5. Put your sounds into garrysmod\sound\menumusic, it can be .wav, .mp3, or .ogg

You can set a default song to play by going to garrysmod/data/menumusic/config.txt, and setting “DefaultSong” to the path of the song you want.
You can rename songs by rightclicking -> add name
The rest is self explanatory.

Download here

This is essentially just a test, but I’m satisfied with it.
also dont look too hard at the code im semi conscious right now
Feel free to suggest anything.

cough http://forum.facepunch.com/showthread.php?t=1330977 cough

I was actually inspired by https://github.com/Facepunch/garrysmod-requests/issues/124
:v:

Quite a handy thing! If there is a random song from the list picked everytime you start the game, or even another song played when a first one ends, then surely a useful job- gonna test it now. But for anyone wishing to just play a single song with minimum startup lag, I recommend to put “play songname.mp3” ("" marks not needed) into autoexec.cfg, which is in the garrysmod/cfg folder, and the songname.mp3 has to be in garrysmod/sound folder (which you may have to create).

But thanks for refering me here, rejax!