Update from release 1 branch (#472)

* Integration of Jukebox Library (#451)

* 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

* a lot

* munchy monk input + mustache fixes
* fork lifter and pajama party bopping
* meat grinder miss bop fix
* cloud monkey Real
* marching orders Go! was broken
* force march doesn't break when it's too early from a game switch
* you can use the March! block without the marching now

* convert float to double and all that

* editor fixes (#459)

* ditch loading dialog

doesn't show up when it's supposed to

* format song offset in editor

* remove VorbisPlugin

* Update Editor.cs

* add updater for marching orders turn

* make base datamodels for special entity reading (#463)

* make base datamodels for special entity reading

* fix crop stomp breaking when no game switch or remix end is set

* fix save shortcut

fix loading charts with no music

* don't infer track when importing a v0 riq from another program

* You can now place inputs on top of pass turn for rhythm tweezers

* Rockers can do it too now

* Some new curves

* Converted everything to new curves and made playerballs handle themselves input-wise

* working dough converted, need to fix eveerything though

* ball transporter anims for pass turn

* update Jukebox to latest version

fixes for inferred entity loading

* new sounds

* OnSpawnBall reimplemented

* Proper inactive handling now

* gandw on balls has been added

* Rhythm tweezers pass turn now works like working dough

* modernised rockers pass turn

* Fixed small balls not working in working dough

* Fixed weird curve stuff on game switch in working dough

* let play mode start if no song file is loaded

fix issue with loading large audio files

* add "updater" for the old marching entity

---------

Co-authored-by: AstrlJelly <bdlawson115@gmail.com>
Co-authored-by: Rapandrasmus <78219215+Rapandrasmus@users.noreply.github.com>
This commit is contained in:
minenice55
2023-06-13 18:47:52 -04:00
committed by GitHub
parent 3425052a98
commit 81384fe7fb
202 changed files with 6594 additions and 7376 deletions

View File

@ -6,8 +6,7 @@ using UnityEngine;
using Starpelly;
using Jukebox;
using Jukebox.Legacy;
using Newtonsoft.Json;
using HeavenStudio.Util;
using HeavenStudio.Games;
using HeavenStudio.Common;
@ -47,6 +46,9 @@ namespace HeavenStudio
[NonSerialized] public RiqEntity currentSection, nextSection;
public double sectionProgress { get; private set; }
bool AudioLoadDone;
bool ChartLoadError;
public event Action<double> onBeatChanged;
public event Action<RiqEntity> onSectionChange;
@ -105,6 +107,8 @@ namespace HeavenStudio
public void Init(bool preLoaded = false)
{
AudioLoadDone = false;
ChartLoadError = false;
currentPreEvent= 0;
currentPreSwitch = 0;
currentPreSequence = 0;
@ -142,6 +146,7 @@ namespace HeavenStudio
}
else
{
RiqFileHandler.ClearCache();
NewRemix();
}
@ -164,7 +169,8 @@ namespace HeavenStudio
}
public void NewRemix()
{
{
AudioLoadDone = false;
Beatmap = new("1", "HeavenStudio");
Beatmap.data.properties = Minigames.propertiesModel;
Beatmap.AddNewTempoChange(0, 120f);
@ -172,10 +178,12 @@ namespace HeavenStudio
Beatmap.data.offset = 0f;
Conductor.instance.musicSource.clip = null;
RiqFileHandler.WriteRiq(Beatmap);
AudioLoadDone = true;
}
public IEnumerator LoadMusic()
{
ChartLoadError = false;
IEnumerator load = RiqFileHandler.LoadSong();
while (true)
{
@ -192,20 +200,27 @@ namespace HeavenStudio
{
Debug.LogWarning("chart has no music: " + f.Message);
Conductor.instance.musicSource.clip = null;
AudioLoadDone = true;
yield break;
}
catch (Exception e)
{
Debug.LogError($"Failed to load music: {e.Message}");
GlobalGameManager.ShowErrorMessage("Error Loading Music", e.Message + "\n\n" + e.StackTrace);
AudioLoadDone = true;
ChartLoadError = true;
yield break;
}
yield return current;
}
Conductor.instance.musicSource.clip = RiqFileHandler.StreamedAudioClip;
AudioLoadDone = true;
}
public void LoadRemix(bool editor = false)
{
AudioLoadDone = false;
ChartLoadError = false;
try
{
Beatmap = RiqFileHandler.ReadRiq();
@ -214,6 +229,7 @@ namespace HeavenStudio
{
Debug.LogError($"Failed to load remix: {e.Message}");
GlobalGameManager.ShowErrorMessage("Error Loading RIQ", e.Message + "\n\n" + e.StackTrace);
ChartLoadError = true;
return;
}
if (!editor)
@ -237,6 +253,15 @@ namespace HeavenStudio
{
SetGame("noGame");
}
if (editor)
{
Debug.Log(Beatmap.data.riqOrigin);
if (Beatmap.data.riqOrigin != "HeavenStudio")
{
GlobalGameManager.ShowErrorMessage("Warning", "This chart was made for another game,\nand thus may not be playable in Heaven Studio.\n<color=\"yellow\">You may be able to edit this chart in Heaven Studio to be used in its original game.</color>\n\n<alpha=#AA>Chart Origin: " + Beatmap.data.riqOrigin.DisplayName());
}
}
}
public void ScoreInputAccuracy(double accuracy, bool late, double time, double weight = 1, bool doDisplay = true)
@ -551,7 +576,7 @@ namespace HeavenStudio
// wait for first game to be loaded
yield return new WaitUntil(() => Beatmap != null && Beatmap.Entities.Count > 0);
//wait for audio clip to be loaded
yield return new WaitUntil(() => Conductor.instance.musicSource.clip != null);
yield return new WaitUntil(() => AudioLoadDone || (ChartLoadError && !GlobalGameManager.IsShowingDialog));
SkillStarManager.instance.KillStar();
TimingAccuracyDisplay.instance.StopStarFlash();