Tempo changes restored (#92)

* Prepwork for seeking + tempo change fixes

TODO: make playing after seeking function (I'll need help with the offset stuff so if anyone can push to this branch please do)

* functions to get the beat from a song position

will need more testing but I think it works well enough to get into prod
thanks @wooningcharithri#7419 for the psuedo-code
This commit is contained in:
minenice55
2022-06-06 12:54:57 -04:00
committed by GitHub
parent a4d6537f9c
commit d3a528a43a
4 changed files with 108 additions and 13 deletions

View File

@ -129,11 +129,7 @@ namespace HeavenStudio.Editor.Track
}
private void AddTempoChange(bool create, Beatmap.TempoChange tempoChange_ = null)
{
// TEMP: DISABLED UNTIL CRITICAL FIXES
if (create)
return;
{
GameObject tempoChange = Instantiate(RefTempoChange.gameObject, this.transform);
tempoChange.transform.GetChild(0).GetComponent<Image>().color = EditorTheme.theme.properties.TempoLayerCol.Hex2RGB();

View File

@ -296,7 +296,7 @@ namespace HeavenStudio.Editor.Track
if (movingPlayback)
{
RectTransformUtility.ScreenPointToLocalPointInRectangle(TimelineContent, Input.mousePosition, Editor.instance.EditorCamera, out lastMousePos);
TimelineSlider.localPosition = new Vector3(Mathf.Clamp(Mathp.Round2Nearest(lastMousePos.x + 0.12f, Timeline.SnapInterval()), 0, Mathf.Infinity), TimelineSlider.transform.localPosition.y);
TimelineSlider.localPosition = new Vector3(Mathf.Max(Mathp.Round2Nearest(lastMousePos.x + 0.12f, Timeline.SnapInterval()), 0), TimelineSlider.transform.localPosition.y);
if (TimelineSlider.localPosition.x != lastBeatPos)
Conductor.instance.SetBeat(TimelineSlider.transform.localPosition.x);