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

@ -112,10 +112,8 @@ namespace HeavenStudio.Games
[SerializeField] GameObject giraffe;
bool goBop = true, isPrep;
bool hasJumped, isFinalJump;
public float jumpStartTime = Single.MinValue;
public double jumpStartTime = double.MinValue;
float jumpPos;
public float time;
bool once;
public bool crIsRunning;
[SerializeField] GameObject bg;
bool giraffeIsIn;
@ -137,7 +135,7 @@ namespace HeavenStudio.Games
}
jumpPos = Conductor.instance.GetPositionFromBeat(jumpStartTime, 1f);
if (Conductor.instance.songPositionInBeats >= jumpStartTime && Conductor.instance.songPositionInBeats < jumpStartTime + 1f)
if (Conductor.instance.songPositionInBeatsAsDouble >= jumpStartTime && Conductor.instance.songPositionInBeatsAsDouble < jumpStartTime + 1f)
{
float yMul = jumpPos * 2f - 1f;
float yWeight = -(yMul * yMul) + 1f;
@ -166,7 +164,7 @@ namespace HeavenStudio.Games
if (PlayerInput.Pressed() && !IsExpectingInputNow())
{
player.anim.Play("Tap", 0, 0);
Jukebox.PlayOneShotGame("tapTrial/tonk");
SoundByte.PlayOneShotGame("tapTrial/tonk");
}
}
}
@ -181,7 +179,7 @@ namespace HeavenStudio.Games
}
}
public void Bop(float beat, float length, bool isBopping, bool autoBop)
public void Bop(double beat, float length, bool isBopping, bool autoBop)
{
goBop = autoBop;
if (isBopping)
@ -196,10 +194,10 @@ namespace HeavenStudio.Games
}
}
public void Tap(float beat)
public void Tap(double beat)
{
isPrep = true;
Jukebox.PlayOneShotGame("tapTrial/ook");
SoundByte.PlayOneShotGame("tapTrial/ook");
player.anim.DoScaledAnimationAsync("TapPrepare", 0.5f);
//Monkey Tap Prepare Anim
@ -219,7 +217,7 @@ namespace HeavenStudio.Games
});
}
public void DoubleTap(float beat)
public void DoubleTap(double beat)
{
isPrep = true;
MultiSound.Play(new MultiSound.Sound[]
@ -257,7 +255,7 @@ namespace HeavenStudio.Games
ScheduleInput(beat, 1.5f, InputType.STANDARD_DOWN, OnDoubleTap, OnTapMiss, OnEmpty);
}
public void TripleTap(float beat)
public void TripleTap(double beat)
{
isPrep = true;
MultiSound.Play(new MultiSound.Sound[]
@ -309,16 +307,16 @@ namespace HeavenStudio.Games
});
}
public void JumpTap(float beat)
public void JumpTap(double beat)
{
isPrep = true;
hasJumped = true;
Jukebox.PlayOneShotGame("tapTrial/jumptap1");
SoundByte.PlayOneShotGame("tapTrial/jumptap1");
player.anim.Play("JumpTap", 0, 0);
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate {jumpStartTime = Conductor.instance.songPositionInBeats;}),
new BeatAction.Action(beat, delegate {jumpStartTime = Conductor.instance.songPositionInBeatsAsDouble;}),
new BeatAction.Action(beat, delegate {monkeys[0].Play("JumpTap", 0, 0); }),
new BeatAction.Action(beat, delegate {monkeys[1].Play("JumpTap", 0, 0); }),
new BeatAction.Action(beat + 1f, delegate { particleEffectMonkeys(); monkeys[0].Play("Jumpactualtap", 0, 0); monkeys[1].Play("Jumpactualtap", 0, 0); }),
@ -333,7 +331,7 @@ namespace HeavenStudio.Games
});
}
public void JumpTapPrep(float beat)
public void JumpTapPrep(double beat)
{
isPrep = true;
monkeys[0].Play("JumpPrepare", 0, 0);
@ -341,17 +339,17 @@ namespace HeavenStudio.Games
player.anim.Play("JumpPrepare", 0, 0);
}
public void FinalJumpTap(float beat)
public void FinalJumpTap(double beat)
{
isPrep = true;
hasJumped = true;
isFinalJump = true;
Jukebox.PlayOneShotGame("tapTrial/jumptap2");
SoundByte.PlayOneShotGame("tapTrial/jumptap2");
player.anim.Play("FinalJump");
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate {jumpStartTime = Conductor.instance.songPositionInBeats;}),
new BeatAction.Action(beat, delegate {jumpStartTime = Conductor.instance.songPositionInBeatsAsDouble;}),
new BeatAction.Action(beat, delegate {monkeys[0].Play("Jump", 0, 0); }),
new BeatAction.Action(beat, delegate {monkeys[1].Play("Jump", 0, 0); }),
new BeatAction.Action(beat + 1f, delegate { monkeys[0].Play("FinalJumpTap", 0, 0); particleEffectMonkeys(); particleEffectMonkeys_2(); }),
@ -409,31 +407,31 @@ namespace HeavenStudio.Games
#region Player Action Scripts
public void OnTap(PlayerActionEvent caller, float beat)
{
Jukebox.PlayOneShotGame("tapTrial/tap");
SoundByte.PlayOneShotGame("tapTrial/tap");
player.anim.DoScaledAnimationAsync("Tap", 0.6f);
player_effects[0].GetComponent<ParticleSystem>().Play();
}
public void OnDoubleTap(PlayerActionEvent caller, float beat)
{
Jukebox.PlayOneShotGame("tapTrial/tap");
SoundByte.PlayOneShotGame("tapTrial/tap");
player.anim.DoScaledAnimationAsync("DoubleTap", 0.6f);
player_effects[1].GetComponent<ParticleSystem>().Play();
}
public void OnTapMiss(PlayerActionEvent caller)
{
Jukebox.PlayOneShotGame("tapTrial/tapMonkey", pitch: 1.5f, volume: .3f);
SoundByte.PlayOneShotGame("tapTrial/tapMonkey", pitch: 1.5f, volume: .3f);
}
public void OnJumpTapMiss(PlayerActionEvent caller)
{
Jukebox.PlayOneShotGame("tapTrial/tapMonkey", pitch: 1.5f, volume: .3f);
SoundByte.PlayOneShotGame("tapTrial/tapMonkey", pitch: 1.5f, volume: .3f);
player.anim.Play("JumpTap_Miss", 0, 0);
}
public void OnFinalJumpTapMiss(PlayerActionEvent caller)
{
Jukebox.PlayOneShotGame("tapTrial/tapMonkey", pitch: 1.5f, volume: .3f);
SoundByte.PlayOneShotGame("tapTrial/tapMonkey", pitch: 1.5f, volume: .3f);
player.anim.Play("FinalJump_Miss", 0, 0);
}
@ -460,18 +458,18 @@ namespace HeavenStudio.Games
player.tripleOffset += 1;
}
player_effects[0].GetComponent<ParticleSystem>().Play();
Jukebox.PlayOneShotGame("tapTrial/tap");
SoundByte.PlayOneShotGame("tapTrial/tap");
}
public void OnJumpTap(PlayerActionEvent caller, float beat)
{
Jukebox.PlayOneShotGame("tapTrial/tap");
SoundByte.PlayOneShotGame("tapTrial/tap");
player.anim.Play("JumpTap_Success", 0, 0);
player_effects[0].GetComponent<ParticleSystem>().Play();
player_effects[1].GetComponent<ParticleSystem>().Play();
}
public void OnJumpFinalTap(PlayerActionEvent caller, float beat)
{
Jukebox.PlayOneShotGame("tapTrial/tap");
SoundByte.PlayOneShotGame("tapTrial/tap");
player.anim.Play("FinalJump_Tap");
player_effects[0].GetComponent<ParticleSystem>().Play();
player_effects[1].GetComponent<ParticleSystem>().Play();