Fixes the inputs for the linear and exponential sustain options of the song editor. (#65008)

This commit is contained in:
Ghom
2022-03-06 02:52:46 +01:00
committed by GitHub
parent df1069a1fe
commit 8527da5541
3 changed files with 18 additions and 11 deletions
+1 -1
View File
@@ -370,7 +370,7 @@
* Setter for setting linear falloff duration.
*/
/datum/song/proc/set_linear_falloff_duration(duration)
sustain_linear_duration = clamp(round(duration * 10, world.tick_lag), 0.1, INSTRUMENT_MAX_TOTAL_SUSTAIN)
sustain_linear_duration = clamp(round(duration * 10, world.tick_lag), world.tick_lag, INSTRUMENT_MAX_TOTAL_SUSTAIN)
update_sustain()
updateDialog()
+2 -2
View File
@@ -185,12 +185,12 @@
stop_playing()
else if(href_list["setlinearfalloff"])
var/amount = tgui_input_number(usr, "Set linear sustain duration in seconds", "Linear Sustain Duration", 0.1, INSTRUMENT_MAX_TOTAL_SUSTAIN, 0.1)
var/amount = tgui_input_number(usr, "Set linear sustain duration in seconds", "Linear Sustain Duration", 0.1, INSTRUMENT_MAX_TOTAL_SUSTAIN, 0.1, round_value = FALSE)
if(!isnull(amount))
set_linear_falloff_duration(amount)
else if(href_list["setexpfalloff"])
var/amount = tgui_input_number(usr, "Set exponential sustain factor", "Exponential sustain factor", INSTRUMENT_EXP_FALLOFF_MIN, INSTRUMENT_EXP_FALLOFF_MAX, INSTRUMENT_EXP_FALLOFF_MIN)
var/amount = tgui_input_number(usr, "Set exponential sustain factor", "Exponential sustain factor", INSTRUMENT_EXP_FALLOFF_MIN, INSTRUMENT_EXP_FALLOFF_MAX, INSTRUMENT_EXP_FALLOFF_MIN, round_value = FALSE)
if(!isnull(amount))
set_exponential_drop_rate(amount)