mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-21 20:14:31 +01:00
Merge pull request #10544 from ShadowLarkens/tgui_fixes
Fix jukebox volume slider being derpy
This commit is contained in:
@@ -216,7 +216,8 @@
|
||||
loop_mode = sanitize_inlist(newval, list(JUKEMODE_NEXT, JUKEMODE_RANDOM, JUKEMODE_REPEAT_SONG, JUKEMODE_PLAY_ONCE), loop_mode)
|
||||
return TRUE
|
||||
if("volume")
|
||||
volume = clamp(params["val"], 0, 1)
|
||||
var/newval = text2num(params["val"])
|
||||
volume = clamp(newval, 0, 1)
|
||||
update_music() // To broadcast volume change without restarting song
|
||||
return TRUE
|
||||
if("stop")
|
||||
|
||||
@@ -93,16 +93,16 @@ export const Jukebox = (props, context) => {
|
||||
<LabeledList.Item label="Volume">
|
||||
<Slider
|
||||
minValue={0}
|
||||
step={0.01}
|
||||
value={volume}
|
||||
maxValue={1}
|
||||
step={1}
|
||||
value={volume * 100}
|
||||
maxValue={100}
|
||||
ranges={{
|
||||
good: [.75, Infinity],
|
||||
average: [.25, .75],
|
||||
bad: [0, .25],
|
||||
good: [75, Infinity],
|
||||
average: [25, 75],
|
||||
bad: [0, 25],
|
||||
}}
|
||||
format={val => round(val * 100, 1) + "%"}
|
||||
onChange={(e, val) => act("volume", { val: round(val, 2) })} />
|
||||
format={val => round(val, 1) + "%"}
|
||||
onChange={(e, val) => act("volume", { val: round(val / 100, 2) })} />
|
||||
</LabeledList.Item>
|
||||
</LabeledList>
|
||||
</Section>
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user