Title screen logo skip (#602)
* commit * update --------- Co-authored-by: DoctorStupidest <>
This commit is contained in:
parent
96ff6ddf8b
commit
a4283c93bc
|
@ -122,45 +122,52 @@ namespace HeavenStudio
|
||||||
selectedDisplayAnim.DoNormalizedAnimation("Idle", GetPositionFromBeat(0, 2));
|
selectedDisplayAnim.DoNormalizedAnimation("Idle", GetPositionFromBeat(0, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logoRevealed && !menuMode)
|
if (!menuMode && songPosBeat >= 0.5)
|
||||||
{
|
{
|
||||||
var controllers = PlayerInput.GetInputControllers();
|
var controllers = PlayerInput.GetInputControllers();
|
||||||
foreach (var newController in controllers)
|
foreach (var newController in controllers)
|
||||||
{
|
{
|
||||||
if (newController.GetLastButtonDown(true) > 0)
|
if (newController.GetLastButtonDown(true) > 0)
|
||||||
{
|
{
|
||||||
menuMode = true;
|
if (logoRevealed)
|
||||||
firstPress = true;
|
|
||||||
currentSelectable = defaultSelectable;
|
|
||||||
SetSelectableRectTarget(currentSelectable);
|
|
||||||
selectableLerpTimer = 1;
|
|
||||||
|
|
||||||
menuAnim.Play("Revealed", 0, 0);
|
|
||||||
pressAnyKeyAnim.Play("PressKeyFadeOut", 0, 0);
|
|
||||||
SoundByte.PlayOneShot("ui/UIEnter");
|
|
||||||
|
|
||||||
Debug.Log("Assigning controller: " + newController.GetDeviceName());
|
|
||||||
|
|
||||||
var lastController = PlayerInput.GetInputController(1);
|
|
||||||
if (lastController != newController)
|
|
||||||
{
|
{
|
||||||
lastController.SetPlayer(null);
|
menuMode = true;
|
||||||
newController.SetPlayer(1);
|
firstPress = true;
|
||||||
PlayerInput.CurrentControlStyle = newController.GetDefaultStyle();
|
currentSelectable = defaultSelectable;
|
||||||
usingMouse = PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch;
|
SetSelectableRectTarget(currentSelectable);
|
||||||
selectedDisplayIcon.SetActive(!usingMouse);
|
selectableLerpTimer = 1;
|
||||||
|
|
||||||
if ((lastController as InputJoyshock) != null)
|
menuAnim.Play("Revealed", 0, 0);
|
||||||
{
|
pressAnyKeyAnim.Play("PressKeyFadeOut", 0, 0);
|
||||||
(lastController as InputJoyshock)?.UnAssignOtherHalf();
|
SoundByte.PlayOneShot("ui/UIEnter");
|
||||||
}
|
|
||||||
|
|
||||||
if ((newController as InputJoyshock) != null)
|
Debug.Log("Assigning controller: " + newController.GetDeviceName());
|
||||||
|
|
||||||
|
var lastController = PlayerInput.GetInputController(1);
|
||||||
|
if (lastController != newController)
|
||||||
{
|
{
|
||||||
newController.OnSelected();
|
lastController.SetPlayer(null);
|
||||||
(newController as InputJoyshock)?.UnAssignOtherHalf();
|
newController.SetPlayer(1);
|
||||||
|
PlayerInput.CurrentControlStyle = newController.GetDefaultStyle();
|
||||||
|
usingMouse = PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch;
|
||||||
|
selectedDisplayIcon.SetActive(!usingMouse);
|
||||||
|
|
||||||
|
if ((lastController as InputJoyshock) != null)
|
||||||
|
{
|
||||||
|
(lastController as InputJoyshock)?.UnAssignOtherHalf();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((newController as InputJoyshock) != null)
|
||||||
|
{
|
||||||
|
newController.OnSelected();
|
||||||
|
(newController as InputJoyshock)?.UnAssignOtherHalf();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SkipToBeat(5);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -418,6 +425,16 @@ namespace HeavenStudio
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SkipToBeat(double beat)
|
||||||
|
{
|
||||||
|
if (songPosBeat >= beat) return;
|
||||||
|
double seconds = BeatsToSecs(beat, bpm);
|
||||||
|
time = seconds;
|
||||||
|
songPos = time + offset;
|
||||||
|
songPosBeat = SecsToBeats(songPos);
|
||||||
|
musicSource.time = (float)time;
|
||||||
|
}
|
||||||
|
|
||||||
public void CreatePressed()
|
public void CreatePressed()
|
||||||
{
|
{
|
||||||
if (exiting) return;
|
if (exiting) return;
|
||||||
|
|
Loading…
Reference in a new issue