disable timeline pitch change when song is paused
enable perfect challenge if no marker is set to do so
This commit is contained in:
parent
4edf062ceb
commit
f8f7aafd71
|
|
@ -1,8 +1,8 @@
|
|||
using System;
|
||||
|
||||
public static class AppInfo {
|
||||
public const string Version = "0.0.1017";
|
||||
public static readonly DateTime Date = new DateTime(2023, 11, 12, 04, 10, 42, 238, DateTimeKind.Utc);
|
||||
public const string Version = "0.0.1018";
|
||||
public static readonly DateTime Date = new DateTime(2023, 12, 21, 03, 53, 15, 934, DateTimeKind.Utc);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@ namespace HeavenStudio
|
|||
private float timelinePitch = 1f;
|
||||
private float minigamePitch = 1f;
|
||||
public float SongPitch { get => isPaused ? 0f : (timelinePitch * minigamePitch); }
|
||||
public float TimelinePitch { get => timelinePitch; }
|
||||
private float musicScheduledPitch = 1f;
|
||||
private double musicScheduledTime = 0;
|
||||
|
||||
|
|
@ -95,6 +96,7 @@ namespace HeavenStudio
|
|||
|
||||
public void SetTimelinePitch(float pitch)
|
||||
{
|
||||
if (isPaused) return;
|
||||
if (pitch != 0 && pitch * minigamePitch != SongPitch)
|
||||
{
|
||||
Debug.Log("added pitch change " + pitch * minigamePitch + " at" + absTime);
|
||||
|
|
|
|||
|
|
@ -718,6 +718,24 @@ namespace HeavenStudio
|
|||
if (miniGame != null)
|
||||
miniGame.OnPlay(beat);
|
||||
onPlay?.Invoke(beat);
|
||||
|
||||
bool hasStartPerfect = false;
|
||||
foreach (RiqEntity marker in Beatmap.SectionMarkers)
|
||||
{
|
||||
if (marker["startPerfect"])
|
||||
{
|
||||
hasStartPerfect = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (OverlaysManager.OverlaysEnabled && !hasStartPerfect)
|
||||
{
|
||||
if (PersistentDataManager.gameSettings.perfectChallengeType != PersistentDataManager.PerfectChallengeType.Off)
|
||||
{
|
||||
GoForAPerfect.instance.Enable(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -397,6 +397,8 @@ namespace HeavenStudio.Editor.Track
|
|||
MouseInTimeline = RectTransformUtility.RectangleContainsScreenPoint(TimelineScroll.viewport,
|
||||
Input.mousePosition, Editor.instance.EditorCamera);
|
||||
|
||||
PlaybackSpeed.interactable = !Conductor.instance.isPaused;
|
||||
|
||||
foreach (var rect in GameObject.FindGameObjectsWithTag("BlocksEditor"))
|
||||
{
|
||||
if (!rect.activeInHierarchy) continue;
|
||||
|
|
@ -1113,15 +1115,30 @@ namespace HeavenStudio.Editor.Track
|
|||
const float SpeedSnap = 0.25f;
|
||||
public void SetPlaybackSpeed(float speed)
|
||||
{
|
||||
float spd = Mathp.Round2Nearest(speed, SpeedSnap);
|
||||
PlaybackSpeed.transform.GetChild(3).GetComponent<TMP_Text>().text = $"Playback Speed: {spd}x";
|
||||
Conductor.instance.SetTimelinePitch(spd);
|
||||
PlaybackSpeed.value = spd;
|
||||
if (Conductor.instance.isPaused)
|
||||
{
|
||||
float spd = Conductor.instance.TimelinePitch;
|
||||
PlaybackSpeed.transform.GetChild(3).GetComponent<TMP_Text>().text = $"Playback Speed: {spd}x";
|
||||
PlaybackSpeed.value = spd;
|
||||
}
|
||||
else
|
||||
{
|
||||
float spd = Mathp.Round2Nearest(speed, SpeedSnap);
|
||||
PlaybackSpeed.transform.GetChild(3).GetComponent<TMP_Text>().text = $"Playback Speed: {spd}x";
|
||||
Conductor.instance.SetTimelinePitch(spd);
|
||||
PlaybackSpeed.value = spd;
|
||||
}
|
||||
}
|
||||
|
||||
public void ResetPlaybackSpeed()
|
||||
{
|
||||
if (Input.GetMouseButton(1))
|
||||
if (Conductor.instance.isPaused)
|
||||
{
|
||||
float spd = Conductor.instance.TimelinePitch;
|
||||
PlaybackSpeed.transform.GetChild(3).GetComponent<TMP_Text>().text = $"Playback Speed: {spd}x";
|
||||
PlaybackSpeed.value = spd;
|
||||
}
|
||||
else if (Input.GetMouseButton(1))
|
||||
{
|
||||
PlaybackSpeed.transform.GetChild(3).GetComponent<TMP_Text>().text = $"Playback Speed: 1x";
|
||||
PlaybackSpeed.value = 1f;
|
||||
|
|
|
|||
Loading…
Reference in a new issue