Add credits volume client preference. Credits are 25% quieter by default. (#22365)

* Add credits volume client preference. Credits are 25% quieter.

* Update episode_name.dm

* Maybe this will work
This commit is contained in:
I-VAPE-VOX-CLOACA-EVERY-DAY-OF-MY-LIFE
2019-04-12 19:32:39 -03:00
committed by jknpj
parent 0f3203eb30
commit 0898b71dd2
8 changed files with 44 additions and 5 deletions

View File

@@ -133,6 +133,7 @@ var/const/MAX_SAVE_SLOTS = 8
var/language = "None" //Secondary language
var/hear_instruments = 1
var/ambience_volume = 25
var/credits_volume = 75
//Mob preview
var/icon/preview_icon = null
@@ -394,6 +395,8 @@ var/const/MAX_SAVE_SLOTS = 8
<a href='?_src_=prefs;preference=credits'><b>[credits]</b></a><br>
<b>Server Shutdown Jingle <span title='These jingles will only play if credits don&#39;t roll for you that round. &#39;Classics&#39; will only play &#39;APC Destroyed&#39; and &#39;Banging Donk&#39;, &#39;All&#39; will play the previous plus retro videogame sounds.'>(?):</span><b>
<a href='?_src_=prefs;preference=jingle'><b>[jingle]</b></a><br>
<b>Credits/Jingle Volume:</b>
<a href='?_src_=prefs;preference=credits_volume'><b>[credits_volume]</b></a><br>
</div>
</div>"}
@@ -1467,6 +1470,9 @@ NOTE: The change will take effect AFTER any current recruiting periods."}
if(JINGLE_ALL)
jingle = JINGLE_NEVER
if("credits_volume")
credits_volume = min(max(input(user, "Enter the new volume you wish to use. (0-100, default is 75)","Credits/Jingle Volume", credits_volume), 0), 100)
if(user.client.holder)
switch(href_list["preference"])
if("hear_ahelp")

View File

@@ -101,6 +101,7 @@
hear_voicesound = text2num(preference_list_client["hear_voicesound"])
hear_instruments = text2num(preference_list_client["hear_instruments"])
ambience_volume = text2num(preference_list_client["ambience_volume"])
credits_volume = text2num(preference_list_client["credits_volume"])
credits = preference_list_client["credits"]
jingle = preference_list_client["jingle"]
@@ -129,6 +130,7 @@
hear_voicesound = sanitize_integer(hear_voicesound, 0, 1, initial(hear_voicesound))
hear_instruments = sanitize_integer(hear_instruments, 0, 1, initial(hear_instruments))
ambience_volume = sanitize_integer(ambience_volume, 0, 100, initial(ambience_volume))
credits_volume = sanitize_integer(credits_volume, 0, 100, initial(credits_volume))
initialize_preferences()
return 1
@@ -210,15 +212,15 @@
check.Add("SELECT ckey FROM client WHERE ckey = ?", ckey)
if(check.Execute(db))
if(!check.NextRow())
q.Add("INSERT into client (ckey, ooc_color, lastchangelog, UI_style, default_slot, toggles, UI_style_color, UI_style_alpha, warns, warnbans, randomslot, volume, usewmp, special, usenanoui, tooltips, progress_bars, space_parallax, space_dust, parallax_speed, stumble, attack_animation, pulltoggle, credits, jingle, hear_voicesound, hear_instruments, ambience_volume) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",\
ckey, ooccolor, lastchangelog, UI_style, default_slot, toggles, UI_style_color, UI_style_alpha, warns, warnbans, randomslot, volume, usewmp, special_popup, usenanoui, tooltips, progress_bars, space_parallax, space_dust, parallax_speed, stumble, attack_animation, pulltoggle, credits, jingle, hear_voicesound, hear_instruments, ambience_volume)
q.Add("INSERT into client (ckey, ooc_color, lastchangelog, UI_style, default_slot, toggles, UI_style_color, UI_style_alpha, warns, warnbans, randomslot, volume, usewmp, special, usenanoui, tooltips, progress_bars, space_parallax, space_dust, parallax_speed, stumble, attack_animation, pulltoggle, credits, jingle, hear_voicesound, hear_instruments, ambience_volume, credits_volume) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",\
ckey, ooccolor, lastchangelog, UI_style, default_slot, toggles, UI_style_color, UI_style_alpha, warns, warnbans, randomslot, volume, usewmp, special_popup, usenanoui, tooltips, progress_bars, space_parallax, space_dust, parallax_speed, stumble, attack_animation, pulltoggle, credits, jingle, hear_voicesound, hear_instruments, ambience_volume, credits_volume)
if(!q.Execute(db))
message_admins("Error in save_preferences_sqlite [__FILE__] ln:[__LINE__] #: [q.Error()] - [q.ErrorMsg()]")
WARNING("Error in save_preferences_sqlite [__FILE__] ln:[__LINE__] #:[q.Error()] - [q.ErrorMsg()]")
return 0
else
q.Add("UPDATE client SET ooc_color=?,lastchangelog=?,UI_style=?,default_slot=?,toggles=?,UI_style_color=?,UI_style_alpha=?,warns=?,warnbans=?,randomslot=?,volume=?,usewmp=?,special=?,usenanoui=?,tooltips=?,progress_bars=?,space_parallax=?,space_dust=?,parallax_speed=?, stumble=?, attack_animation=?, pulltoggle=?, credits=?, jingle=?, hear_voicesound=?, hear_instruments=?, ambience_volume=? WHERE ckey = ?",\
ooccolor, lastchangelog, UI_style, default_slot, toggles, UI_style_color, UI_style_alpha, warns, warnbans, randomslot, volume, usewmp, special_popup, usenanoui, tooltips, progress_bars, space_parallax, space_dust, parallax_speed, stumble, attack_animation, pulltoggle, credits, jingle, hear_voicesound, hear_instruments, ambience_volume, ckey)
q.Add("UPDATE client SET ooc_color=?,lastchangelog=?,UI_style=?,default_slot=?,toggles=?,UI_style_color=?,UI_style_alpha=?,warns=?,warnbans=?,randomslot=?,volume=?,usewmp=?,special=?,usenanoui=?,tooltips=?,progress_bars=?,space_parallax=?,space_dust=?,parallax_speed=?, stumble=?, attack_animation=?, pulltoggle=?, credits=?, jingle=?, hear_voicesound=?, hear_instruments=?, ambience_volume=?, credits_volume=? WHERE ckey = ?",\
ooccolor, lastchangelog, UI_style, default_slot, toggles, UI_style_color, UI_style_alpha, warns, warnbans, randomslot, volume, usewmp, special_popup, usenanoui, tooltips, progress_bars, space_parallax, space_dust, parallax_speed, stumble, attack_animation, pulltoggle, credits, jingle, hear_voicesound, hear_instruments, ambience_volume, credits_volume, ckey)
if(!q.Execute(db))
message_admins("Error in save_preferences_sqlite [__FILE__] ln:[__LINE__] #: [q.Error()] - [q.ErrorMsg()]")
WARNING("Error in save_preferences_sqlite [__FILE__] ln:[__LINE__] #:[q.Error()] - [q.ErrorMsg()]")
@@ -264,6 +266,7 @@
S["hear_voicesound"]<< hear_voicesound
S["hear_instruments"]<< hear_instruments
S["ambience_volume"]<< ambience_volume
S["credits_volume"]<< credits_volume
return 1
//saving volume changes