replaced "toggle pregame music" with button in pregame screen that saves between games

This commit is contained in:
Tastyfish
2011-12-27 19:53:02 -05:00
parent 7faae09595
commit 0e222e838f
4 changed files with 25 additions and 5 deletions
+18 -2
View File
@@ -21,8 +21,6 @@
mind.key = key
mind.current = src
spawn() Playmusic() // git some tunes up in heeyaa~
var/starting_loc = pick(newplayer_start)
if(!starting_loc) starting_loc = locate(1,1,1)
loc = starting_loc
@@ -47,6 +45,9 @@
preferences.lastchangelog = lastchangelog
preferences.savefile_save(src, 1)
if(preferences.pregame_music)
spawn() Playmusic() // git some tunes up in heeyaa~
new_player_panel()
//PDA Resource Initialisation =======================================================>
/*
@@ -125,6 +126,8 @@
output += "<BR><a href='byond://?src=\ref[src];observe=1'>Observe</A><BR>"
output += "<BR><a href='byond://?src=\ref[src];pregame_music=1'>Lobby Music</A><BR>"
src << browse(output,"window=playersetup;size=250x233;can_close=0")
return
@@ -143,6 +146,9 @@
src << sound(ticker.login_music, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS
proc/Stopmusic()
src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // stop the jamsz
Stat()
..()
@@ -208,6 +214,16 @@
del(src)
return 1
if(href_list["pregame_music"])
preferences.pregame_music = !preferences.pregame_music
if(preferences.pregame_music)
Playmusic()
else
Stopmusic()
// only save this 1 pref, so current slot doesn't get saved w/o user's knowledge
var/savefile/F = new(preferences.savefile_path(src))
F["pregame_music"] << preferences.pregame_music
if(href_list["late_join"])
LateChoices()
@@ -52,6 +52,8 @@ datum/preferences
be_special = 0
//Play admin midis
midis = 1
//Play pregame music
pregame_music = 1
//Saved changlog filesize to detect if there was a change
lastchangelog = 0
+2
View File
@@ -134,6 +134,7 @@ datum/preferences/proc/savefile_save(mob/user, slot)
F["be_special"] << src.be_special
F["UI"] << src.UI
F["midis"] << src.midis
F["pregame_music"] << src.pregame_music
F["ooccolor"] << src.ooccolor
F["lastchangelog"] << src.lastchangelog
@@ -193,6 +194,7 @@ datum/preferences/proc/savefile_load(mob/user, slot)
F["underwear"] >> src.underwear
F["name_is_always_random"] >> src.be_random_name
F["midis"] >> src.midis
F["pregame_music"] >> src.pregame_music
F["ooccolor"] >> src.ooccolor
F["lastchangelog"] >> src.lastchangelog
F["UI"] >> src.UI