Skip to content

Commit 32a0eda

Browse files
bctixNexIsDumb
andauthored
Add extra charter controls (#412)
* add new charter controls * typo.... * boundin fix --------- Co-authored-by: ⍚~Nex <87421482+NexIsDumb@users.noreply.github.com>
1 parent 454bb73 commit 32a0eda

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

source/funkin/editors/charter/Charter.hx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ class Charter extends UIState {
341341
null,
342342
{
343343
label: "↑ Speed 25%",
344+
keybind: [PERIOD],
344345
onSelect: _playback_speed_raise
345346
},
346347
{
@@ -349,6 +350,7 @@ class Charter extends UIState {
349350
},
350351
{
351352
label: "↓ Speed 25%",
353+
keybind: [COMMA],
352354
onSelect: _playback_speed_lower
353355
},
354356
null,
@@ -362,6 +364,22 @@ class Charter extends UIState {
362364
keybind: [D],
363365
onSelect: _playback_forward
364366
},
367+
{
368+
label: "Go to start of section",
369+
keybind: [SHIFT, S],
370+
onSelect: _playback_section_start
371+
},
372+
null,
373+
{
374+
label: "Go back a step",
375+
keybind: [W],
376+
onSelect: _playback_back_step
377+
},
378+
{
379+
label: "Go forward a step",
380+
keybind: [S],
381+
onSelect: _playback_forward_step
382+
},
365383
null,
366384
{
367385
label: "Metronome",
@@ -1579,6 +1597,18 @@ class Charter extends UIState {
15791597
if (FlxG.sound.music.playing) return;
15801598
Conductor.songPosition += (Conductor.beatsPerMeasure * __crochet);
15811599
}
1600+
function _playback_section_start(_) {
1601+
if(FlxG.sound.music.playing) return;
1602+
Conductor.songPosition = (Conductor.beatsPerMeasure * (60000 / Conductor.bpm)) * curMeasure;
1603+
}
1604+
function _playback_back_step(_) {
1605+
if (FlxG.sound.music.playing) return;
1606+
Conductor.songPosition -= Conductor.stepCrochet;
1607+
}
1608+
function _playback_forward_step(_) {
1609+
if (FlxG.sound.music.playing) return;
1610+
Conductor.songPosition += Conductor.stepCrochet;
1611+
}
15821612
function _song_start(_) {
15831613
if (FlxG.sound.music.playing) return;
15841614
Conductor.songPosition = 0;

source/funkin/editors/ui/UISlider.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class UISlider extends UISprite {
2626

2727
public var value(default, set):Float = 0;
2828
public function set_value(newVal:Float):Float {
29+
newVal = FlxMath.bound(newVal, segments[0].start, segments[segments.length-1].end);
2930
__barProgress = __calcProgress(newVal); if (onChange != null) onChange(newVal);
3031
if (valueStepper != null) valueStepper.value = newVal;
3132
return value = newVal;

0 commit comments

Comments
 (0)