mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-10 11:45:09 +00:00
tempo change: clamp on scroll
This commit is contained in:
parent
9229304c52
commit
d8dbd1f44c
2 changed files with 10 additions and 0 deletions
|
@ -72,6 +72,7 @@ namespace HeavenStudio.Editor.Track
|
||||||
GameManager.instance.Beatmap.bpm += increase;
|
GameManager.instance.Beatmap.bpm += increase;
|
||||||
UpdateStartingBPMText();
|
UpdateStartingBPMText();
|
||||||
UpdateStartingBPMFromText(); // In case the scrolled-to value is invalid.
|
UpdateStartingBPMFromText(); // In case the scrolled-to value is invalid.
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -109,6 +110,8 @@ namespace HeavenStudio.Editor.Track
|
||||||
|
|
||||||
// In case the newBPM ended up differing from the inputted string.
|
// In case the newBPM ended up differing from the inputted string.
|
||||||
UpdateStartingBPMText();
|
UpdateStartingBPMText();
|
||||||
|
|
||||||
|
Timeline.instance.FitToSong();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateOffsetFromText()
|
public void UpdateOffsetFromText()
|
||||||
|
@ -160,6 +163,8 @@ namespace HeavenStudio.Editor.Track
|
||||||
}
|
}
|
||||||
|
|
||||||
tempoTimelineObjs.Add(tempoTimelineObj);
|
tempoTimelineObjs.Add(tempoTimelineObj);
|
||||||
|
|
||||||
|
Timeline.instance.FitToSong();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,10 @@ namespace HeavenStudio.Editor.Track
|
||||||
|
|
||||||
tempoChange.tempo += newTempo;
|
tempoChange.tempo += newTempo;
|
||||||
|
|
||||||
|
//make sure tempo is positive
|
||||||
|
if (tempoChange.tempo < 1)
|
||||||
|
tempoChange.tempo = 1;
|
||||||
|
|
||||||
if (Input.GetMouseButtonDown(0))
|
if (Input.GetMouseButtonDown(0))
|
||||||
{
|
{
|
||||||
Vector3 mousePos = Editor.instance.EditorCamera.ScreenToWorldPoint(Input.mousePosition);
|
Vector3 mousePos = Editor.instance.EditorCamera.ScreenToWorldPoint(Input.mousePosition);
|
||||||
|
@ -96,6 +100,7 @@ namespace HeavenStudio.Editor.Track
|
||||||
private void UpdateTempo()
|
private void UpdateTempo()
|
||||||
{
|
{
|
||||||
tempoTXT.text = $"{tempoChange.tempo} BPM";
|
tempoTXT.text = $"{tempoChange.tempo} BPM";
|
||||||
|
Timeline.instance.FitToSong();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue