Integration of Jukebox Library (#451) (#457)

* add Jukebox library

todo:
- saving / loading of new format
- inferrence of unknown data like past versions
- move the temporary float casts to proper use of double
- make sound related functions take double for timing
- inform people that the Jukebox sound player was renamed to SoundByte lol

* make sound, input scheduling, and super curve use double precision

* successfully load charts

* editor works again

v1 riqs can be saved and loaded

* first tempo and volume markers are unmovable

fix loading of charts' easing values

* use gsync / freesync

* update Jukebox refs to SoundByte

* game events use double part 1

Air Rally - Glee Club converted

* don't load song if chart load fails

* finish conversion of all minigames

* remove editor waveform toggle

* timeline now respects added song offset length

clear cache files on app close
prepped notes for dsp sync

* update timeline length when offset changed

* update to latest Jukebox

* make error panel object in global game manager

* improve conductor music scheduling

* added error message box

fix first game events sometimes not playing
This commit is contained in:
minenice55
2023-06-10 15:17:06 -04:00
committed by GitHub
parent b7afd697ce
commit b1fab52ad9
176 changed files with 4868 additions and 3013 deletions

View File

@ -16,7 +16,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
public GameObject Projectile_Root;
public Animator anim;
float startJumpTime = Single.MinValue;
double startJumpTime = double.MinValue;
float jumpLength = 0;
float jumpHeight = 0;
bool jumpNg = false;
@ -27,7 +27,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
private bool charging = false;
private bool canCharge = true;
float startThrowTime = Single.MinValue;
double startThrowTime = double.MinValue;
float throwLength = 0;
float throwHeight = 0;
// true = throw, false = dropped ("Out")
@ -51,8 +51,8 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
if (PlayerInput.Pressed() && canJump && !PajamaParty.instance.IsExpectingInputNow(InputType.STANDARD_DOWN))
{
Jukebox.PlayOneShot("miss");
PlayerJump(cond.songPositionInBeats, true, false);
SoundByte.PlayOneShot("miss");
PlayerJump(cond.songPositionInBeatsAsDouble, true, false);
PajamaParty.instance.ScoreMiss();
}
if (PlayerInput.AltPressed() && canCharge)
@ -61,8 +61,8 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
}
if (PlayerInput.AltPressedUp() && charging && !PajamaParty.instance.IsExpectingInputNow(InputType.STANDARD_ALT_UP))
{
Jukebox.PlayOneShot("miss");
EndCharge(cond.songPositionInBeats, false, false);
SoundByte.PlayOneShot("miss");
EndCharge(cond.songPositionInBeatsAsDouble, false, false);
PajamaParty.instance.ScoreMiss();
}
@ -94,7 +94,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
anim.DoScaledAnimationAsync("MakoLand");
jumpNg = false;
}
startJumpTime = Single.MinValue;
startJumpTime = double.MinValue;
Player.transform.localPosition = new Vector3(0, 0);
Shadow.transform.localScale = new Vector3(1.65f, 1f, 1f);
}
@ -118,7 +118,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
}
else
{
startThrowTime = Single.MinValue;
startThrowTime = double.MinValue;
Projectile_Root.transform.localPosition = new Vector3(0, 0);
if (hasThrown)
{
@ -133,7 +133,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
anim.DoUnscaledAnimation("MakoCatch");
}
//TODO: change when locales are a thing
Jukebox.PlayOneShotGame("pajamaParty/catch" + UnityEngine.Random.Range(0, 2)); //bruh
SoundByte.PlayOneShotGame("pajamaParty/catch" + UnityEngine.Random.Range(0, 2)); //bruh
Projectile.SetActive(false);
hasThrown = false;
@ -145,7 +145,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
}
}
public void ProjectileThrow(float beat, bool drop = false, bool ng = false)
public void ProjectileThrow(double beat, bool drop = false, bool ng = false)
{
throwNg = ng;
Projectile.SetActive(true);
@ -165,7 +165,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
}
}
public void PlayerJump(float beat, bool pressout = false, bool ng = false)
public void PlayerJump(double beat, bool pressout = false, bool ng = false)
{
startJumpTime = beat;
canCharge = false;
@ -184,7 +184,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
charging = true;
}
public void EndCharge(float beat, bool hit = true, bool ng = false)
public void EndCharge(double beat, bool hit = true, bool ng = false)
{
ProjectileThrow(beat, !hit, ng);
var cond = Conductor.instance;
@ -201,7 +201,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
beat + 0.5f,
delegate {
anim.DoScaledAnimationAsync("MakoPickUp");
Jukebox.PlayOneShotGame("pajamaParty/catch" + UnityEngine.Random.Range(0, 2)); //bruh
SoundByte.PlayOneShotGame("pajamaParty/catch" + UnityEngine.Random.Range(0, 2)); //bruh
Projectile.SetActive(false);
canCharge = true;
canJump = true;
@ -211,7 +211,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
}
}
public void PlayerThrough(float beat)
public void PlayerThrough(double beat)
{
var cond = Conductor.instance;
anim.DoScaledAnimationAsync("MakoThrough", 0.5f);
@ -231,7 +231,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
}
// jumping cues (timings for both are the same)
public void ScheduleJump(float beat)
public void ScheduleJump(double beat)
{
PajamaParty.instance.ScheduleInput(beat, 2f, InputType.STANDARD_DOWN, JumpJustOrNg, JumpThrough, JumpOut);
}
@ -243,13 +243,13 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
var cond = Conductor.instance;
if (state <= -1f || state >= 1f)
{
Jukebox.PlayOneShot("miss");
PlayerJump(cond.songPositionInBeats, false, true);
SoundByte.PlayOneShot("miss");
PlayerJump(cond.songPositionInBeatsAsDouble, false, true);
}
else
{
Jukebox.PlayOneShotGame("pajamaParty/jumpJust");
PlayerJump(cond.songPositionInBeats, false, false);
SoundByte.PlayOneShotGame("pajamaParty/jumpJust");
PlayerJump(cond.songPositionInBeatsAsDouble, false, false);
}
caller.CanHit(false);
}
@ -262,13 +262,13 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
if (canJump)
{
var cond = Conductor.instance;
PlayerThrough(cond.songPositionInBeats);
PlayerThrough(cond.songPositionInBeatsAsDouble);
}
}
//////
// throw cue
public void ScheduleThrow(float beat)
public void ScheduleThrow(double beat)
{
PajamaParty.instance.ScheduleInput(beat, 2f, InputType.STANDARD_ALT_DOWN, ChargeJustOrNg, ThrowThrough, JumpOut);
PajamaParty.instance.ScheduleInput(beat, 3f, InputType.STANDARD_ALT_UP, ThrowJustOrNg, ThrowThrough, JumpOut);
@ -277,7 +277,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
public void ChargeJustOrNg(PlayerActionEvent caller, float state) {
StartCharge();
throwNg = (state <= -1f || state >= 1f);
Jukebox.PlayOneShotGame("pajamaParty/throw4");
SoundByte.PlayOneShotGame("pajamaParty/throw4");
}
public void ThrowJustOrNg(PlayerActionEvent caller, float state)
@ -287,13 +287,13 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
var cond = Conductor.instance;
if (state <= -1f || state >= 1f)
{
Jukebox.PlayOneShot("miss");
EndCharge(cond.songPositionInBeats, true, true);
SoundByte.PlayOneShot("miss");
EndCharge(cond.songPositionInBeatsAsDouble, true, true);
}
else
{
Jukebox.PlayOneShotGame("pajamaParty/throw5");
EndCharge(cond.songPositionInBeats, true, (throwNg || false));
SoundByte.PlayOneShotGame("pajamaParty/throw5");
EndCharge(cond.songPositionInBeatsAsDouble, true, (throwNg || false));
}
caller.CanHit(false);
}
@ -304,13 +304,13 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
if (canCharge)
{
var cond = Conductor.instance;
PlayerThrough(cond.songPositionInBeats);
PlayerThrough(cond.songPositionInBeatsAsDouble);
}
}
//
// sleep cue
public void StartSleepSequence(float beat, bool alt, int action)
public void StartSleepSequence(double beat, bool alt, int action)
{
if (hasJumped)
{
@ -318,12 +318,12 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
PajamaParty.instance.DoBedImpact();
jumpNg = false;
}
startJumpTime = Single.MinValue;
startJumpTime = double.MinValue;
Player.transform.localPosition = new Vector3(0, 0);
Shadow.transform.localScale = new Vector3(1.65f, 1f, 1f);
Projectile.GetComponent<Animator>().Play("NoPose", -1, 0);
startThrowTime = Single.MinValue;
startThrowTime = double.MinValue;
Projectile_Root.transform.localPosition = new Vector3(0, 0);
Projectile.transform.rotation = Quaternion.Euler(0, 0, 0);
if (hasThrown)
@ -347,7 +347,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
anim.DoScaledAnimationAsync("MakoLand");
}
startJumpTime = Single.MinValue;
startJumpTime = double.MinValue;
Player.transform.localPosition = new Vector3(0, 0);
Shadow.transform.localScale = new Vector3(1.65f, 1f, 1f);
@ -400,7 +400,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
anim.DoUnscaledAnimation("MakoSleepNg");
else
{
Jukebox.PlayOneShotGame("pajamaParty/siesta4");
SoundByte.PlayOneShotGame("pajamaParty/siesta4");
anim.DoScaledAnimationAsync("MakoSleepJust");
if (!longSleep)
@ -411,7 +411,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
caller.startBeat + 7f,
delegate {
anim.DoScaledAnimationAsync("MakoAwake");
Jukebox.PlayOneShotGame("pajamaParty/siestaDone");
SoundByte.PlayOneShotGame("pajamaParty/siestaDone");
}
),
});
@ -438,7 +438,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
if (canSleep)
{
anim.DoScaledAnimationAsync("MakoSleepOut", 0.5f);
Jukebox.PlayOneShotGame("pajamaParty/siestaBad");
SoundByte.PlayOneShotGame("pajamaParty/siestaBad");
caller.CanHit(false);
canSleep = false;
}