Skip to content

Commit

Permalink
lobby music is now in its own folder
Browse files Browse the repository at this point in the history
  • Loading branch information
linnpap committed Jan 13, 2023
1 parent c9b9483 commit 6ba033c
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 19 deletions.
38 changes: 21 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
#ignore misc BYOND files
Thumbs.db
vchat.db
vchat.db*
*.log
*.int
*.rsc
*.dmb
*.lk
*.backup
*.before
*.pyc
data/
cfg/

node_modules/
package-lock.json
#ignore misc BYOND files
Thumbs.db
vchat.db
vchat.db*
*.log
*.int
*.rsc
*.dmb
*.lk
*.backup
*.before
*.pyc
data/
cfg/

node_modules/
package-lock.json

#FLIPPER EDIT - ignore title music
!/config/title_music/sounds/exclude
/config/title_music/sounds/*
2 changes: 1 addition & 1 deletion code/datums/audio/_audio.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

// No VV editing anything about music tracks
/decl/music_track/VV_static()
return ..() + vars
return ..() + vars
32 changes: 32 additions & 0 deletions code/game/sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,41 @@

/client/proc/playtitlemusic()
if(is_preference_enabled(/datum/client_preference/play_lobby_music))
/*
// FLIPPER EDIT - rewriting the way music tracks are handled, I NEED MY ELECTRIC WIZARD
if(!using_map.lobby_track)
using_map.lobby_track = using_map.get_lobby_track()
using_map.lobby_track.play_to(src)
*/

var/list/byond_sound_formats = list(
"mid" = TRUE,
"midi" = TRUE,
"mod" = TRUE,
"it" = TRUE,
"s3m" = TRUE,
"xm" = TRUE,
"oxm" = TRUE,
"wav" = TRUE,
"ogg" = TRUE,
"raw" = TRUE,
"wma" = TRUE,
"aiff" = TRUE,
)

var/list/possible_tracks = flist("config/title_music/sounds/")
var/list/music = list()

for(var/songs in possible_tracks)
var/list/L = splittext(songs,".")
if(L.len >= 2)
var/ext = lowertext(L[L.len]) //pick the real extension, no 'honk.ogg.exe' nonsense here
if(byond_sound_formats[ext])
music += songs

if(length(music) > 0)
var/final_song = pick(music)
src << sound("config/title_music/sounds/[final_song]", repeat = 1, wait = 0, volume = 70, channel = 1)

/proc/get_sfx(soundin)
if(istext(soundin))
Expand Down
30 changes: 29 additions & 1 deletion code/modules/client/preference_setup/global/setting_datums.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,35 @@ var/global/list/_client_preferences_by_type

/datum/client_preference/play_lobby_music/toggled(var/mob/preference_mob, var/enabled)
if(enabled)
using_map.lobby_track.play_to(preference_mob)
//using_map.lobby_track.play_to(preference_mob) // FLIPPER REMOVAL - changing the way music works
var/list/byond_sound_formats = list(
"mid" = TRUE,
"midi" = TRUE,
"mod" = TRUE,
"it" = TRUE,
"s3m" = TRUE,
"xm" = TRUE,
"oxm" = TRUE,
"wav" = TRUE,
"ogg" = TRUE,
"raw" = TRUE,
"wma" = TRUE,
"aiff" = TRUE,
)

var/list/possible_tracks = flist("config/title_music/sounds/")
var/list/music = list()

for(var/songs in possible_tracks)
var/list/L = splittext(songs,".")
if(L.len >= 2)
var/ext = lowertext(L[L.len]) //pick the real extension, no 'honk.ogg.exe' nonsense here
if(byond_sound_formats[ext])
music += songs

if(length(music) > 0)
var/final_song = pick(music)
preference_mob << sound("config/title_music/sounds/[final_song]", repeat = 1, wait = 0, volume = 70, channel = 1)
else
preference_mob << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1)

Expand Down
31 changes: 31 additions & 0 deletions code/modules/mob/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,37 @@

if(!is_preference_enabled(/datum/client_preference/play_lobby_music))
return
/*
// FLIPPER EDIT - changing the way music works
var/decl/music_track/new_track = using_map.get_lobby_track(using_map.lobby_track.type)
if(new_track)
new_track.play_to(src)
*/
var/list/byond_sound_formats = list(
"mid" = TRUE,
"midi" = TRUE,
"mod" = TRUE,
"it" = TRUE,
"s3m" = TRUE,
"xm" = TRUE,
"oxm" = TRUE,
"wav" = TRUE,
"ogg" = TRUE,
"raw" = TRUE,
"wma" = TRUE,
"aiff" = TRUE,
)

var/list/possible_tracks = flist("config/title_music/sounds/")
var/list/music = list()

for(var/songs in possible_tracks)
var/list/L = splittext(songs,".")
if(L.len >= 2)
var/ext = lowertext(L[L.len]) //pick the real extension, no 'honk.ogg.exe' nonsense here
if(byond_sound_formats[ext])
music += songs

if(length(music) > 0)
var/final_song = pick(music)
src << sound("config/title_music/sounds/[final_song]", repeat = 1, wait = 0, volume = 70, channel = 1)
Empty file.
1 change: 1 addition & 0 deletions polaris.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3324,6 +3324,7 @@
#include "maps\submaps\surface_submaps\wilderness\wilderness.dm"
#include "maps\submaps\surface_submaps\wilderness\wilderness_areas.dm"
#include "maps\~map_system\maps.dm"
#include "modular_flipper\code\datums\audio\_audio.dm"
#include "modular_flipper\code\modules\combat_indicator\combat_indicator.dm"
#include "modular_flipper\code\modules\mob\mob.dm"
#include "modular_flipper\code\modules\mob\living\emote_popup.dm"
Expand Down

0 comments on commit 6ba033c

Please sign in to comment.