mirror of https://github.com/hykilpikonna/AquaDX
[F] CurrentPlayMsec conflict with speed settings
parent
5bcbffcdf0
commit
6857ae5182
|
@ -90,6 +90,7 @@ public class DebugFeature
|
|||
|
||||
public static double CurrentPlayMsec
|
||||
{
|
||||
[Obsolete("不要用它,它有问题。用 PractiseMode.CurrentPlayMsec")]
|
||||
get
|
||||
{
|
||||
if (IsPolyfill)
|
||||
|
|
|
@ -94,6 +94,26 @@ public class PractiseMode
|
|||
SetSpeed();
|
||||
}
|
||||
|
||||
public static void Seek(int addMsec)
|
||||
{
|
||||
// Debug feature 里面那个 timer 不能感知变速
|
||||
// 为了和魔改版本统一,polyfill 里面不修这个
|
||||
// 这里重新实现一个能感知变速的 Seek
|
||||
var msec = CurrentPlayMsec + addMsec;
|
||||
if (msec < 0)
|
||||
{
|
||||
msec = 0;
|
||||
}
|
||||
|
||||
DebugFeature.CurrentPlayMsec = msec;
|
||||
}
|
||||
|
||||
public static double CurrentPlayMsec
|
||||
{
|
||||
get => NotesManager.GetCurrentMsec() - 91;
|
||||
set => DebugFeature.CurrentPlayMsec = value;
|
||||
}
|
||||
|
||||
public static PractiseModeUI ui;
|
||||
|
||||
[HarmonyPatch(typeof(GameProcess), "OnStart")]
|
||||
|
@ -136,9 +156,9 @@ public class PractiseMode
|
|||
|
||||
if (repeatStart >= 0 && repeatEnd >= 0)
|
||||
{
|
||||
if (DebugFeature.CurrentPlayMsec >= repeatEnd)
|
||||
if (CurrentPlayMsec >= repeatEnd)
|
||||
{
|
||||
DebugFeature.CurrentPlayMsec = repeatStart;
|
||||
CurrentPlayMsec = repeatStart;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ public class PractiseModeUI : MonoBehaviour
|
|||
GUI.Button(GetButtonRect(2, 2), Locale.SpeedUp);
|
||||
GUI.Button(GetButtonRect(1, 3), Locale.SpeedReset);
|
||||
|
||||
GUI.Label(GetButtonRect(0, 3), TimeSpan.FromMilliseconds(DebugFeature.CurrentPlayMsec).ToString(@"mm\:ss\.fff"));
|
||||
GUI.Label(GetButtonRect(0, 3), TimeSpan.FromMilliseconds(PractiseMode.CurrentPlayMsec).ToString(@"mm\:ss\.fff"));
|
||||
GUI.Label(GetButtonRect(2, 3), TimeSpan.FromMilliseconds(NotesManager.Instance().getPlayFinalMsec()).ToString(@"mm\:ss\.fff"));
|
||||
}
|
||||
|
||||
|
@ -90,12 +90,12 @@ public class PractiseModeUI : MonoBehaviour
|
|||
{
|
||||
if (InputManager.GetTouchPanelAreaDown(InputManager.TouchPanelArea.E8))
|
||||
{
|
||||
DebugFeature.Seek(-1000);
|
||||
PractiseMode.Seek(-1000);
|
||||
PractiseMode.SetSpeedCoroutine();
|
||||
}
|
||||
else if (InputManager.GetTouchPanelAreaDown(InputManager.TouchPanelArea.E2))
|
||||
{
|
||||
DebugFeature.Seek(1000);
|
||||
PractiseMode.Seek(1000);
|
||||
PractiseMode.SetSpeedCoroutine();
|
||||
}
|
||||
else if (InputManager.GetTouchPanelAreaDown(InputManager.TouchPanelArea.B8) || InputManager.GetTouchPanelAreaDown(InputManager.TouchPanelArea.B1))
|
||||
|
@ -103,17 +103,17 @@ public class PractiseModeUI : MonoBehaviour
|
|||
DebugFeature.Pause = !DebugFeature.Pause;
|
||||
if (!DebugFeature.Pause)
|
||||
{
|
||||
DebugFeature.Seek(0);
|
||||
PractiseMode.Seek(0);
|
||||
PractiseMode.SetSpeedCoroutine();
|
||||
}
|
||||
}
|
||||
else if (InputManager.GetTouchPanelAreaDown(InputManager.TouchPanelArea.B7) && PractiseMode.repeatStart == -1)
|
||||
{
|
||||
PractiseMode.repeatStart = DebugFeature.CurrentPlayMsec;
|
||||
PractiseMode.repeatStart = PractiseMode.CurrentPlayMsec;
|
||||
}
|
||||
else if (InputManager.GetTouchPanelAreaDown(InputManager.TouchPanelArea.B7) && PractiseMode.repeatEnd == -1)
|
||||
{
|
||||
PractiseMode.SetRepeatEnd(DebugFeature.CurrentPlayMsec);
|
||||
PractiseMode.SetRepeatEnd(PractiseMode.CurrentPlayMsec);
|
||||
}
|
||||
else if (InputManager.GetTouchPanelAreaDown(InputManager.TouchPanelArea.B2))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue