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
This commit is contained in:
minenice55
2023-06-10 15:13:29 -04:00
committed by GitHub
parent b7afd697ce
commit bb2ae74339
176 changed files with 4868 additions and 3013 deletions

View File

@ -3,13 +3,15 @@ using System.Linq;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using Jukebox;
using Jukebox.Legacy;
namespace HeavenStudio
{
public class EventCaller : MonoBehaviour
{
public Transform GamesHolder;
public DynamicBeatmap.DynamicEntity currentEntity = new DynamicBeatmap.DynamicEntity();
public RiqEntity currentEntity = new RiqEntity();
public string currentSwitchGame;
public delegate void EventCallback();
@ -37,15 +39,15 @@ namespace HeavenStudio
{
instance = this;
currentEntity = new DynamicBeatmap.DynamicEntity();
currentEntity = new RiqEntity();
Minigames.Init(this);
List<Minigames.Minigame> minigamesInBeatmap = new List<Minigames.Minigame>();
for (int i = 0; i < GameManager.instance.Beatmap.entities.Count; i++)
for (int i = 0; i < GameManager.instance.Beatmap.Entities.Count; i++)
{
//go through every entity in the timeline and add the game that they're from to the minigamesInBeatmap list (ignore entities from FX only categories, i.e. Game Manager and Count-Ins)
Minigames.Minigame game = GetMinigame(GameManager.instance.Beatmap.entities[i].datamodel.Split('/')[0]);
Minigames.Minigame game = GetMinigame(GameManager.instance.Beatmap.Entities[i].datamodel.Split('/')[0]);
if (!minigamesInBeatmap.Contains(game) && !FXOnlyGames().Contains(game))
{
minigamesInBeatmap.Add(game);
@ -63,7 +65,7 @@ namespace HeavenStudio
}
public void CallEvent(DynamicBeatmap.DynamicEntity entity, bool gameActive)
public void CallEvent(RiqEntity entity, bool gameActive)
{
string[] details = entity.datamodel.Split('/');
Minigames.Minigame game = minigames.Find(c => c.name == details[0]);
@ -89,7 +91,7 @@ namespace HeavenStudio
}
}
public void CallPreEvent(DynamicBeatmap.DynamicEntity entity)
public void CallPreEvent(RiqEntity entity)
{
string[] details = entity.datamodel.Split('/');
Minigames.Minigame game = minigames.Find(c => c.name == details[0]);
@ -106,10 +108,10 @@ namespace HeavenStudio
}
}
public static List<DynamicBeatmap.DynamicEntity> GetAllInGameManagerList(string gameName, string[] include)
public static List<RiqEntity> GetAllInGameManagerList(string gameName, string[] include)
{
List<DynamicBeatmap.DynamicEntity> temp1 = GameManager.instance.Beatmap.entities.FindAll(c => c.datamodel.Split('/')[0] == gameName);
List<DynamicBeatmap.DynamicEntity> temp2 = new List<DynamicBeatmap.DynamicEntity>();
List<RiqEntity> temp1 = GameManager.instance.Beatmap.Entities.FindAll(c => c.datamodel.Split('/')[0] == gameName);
List<RiqEntity> temp2 = new List<RiqEntity>();
foreach (string s in include)
{
temp2.AddRange(temp1.FindAll(c => c.datamodel.Split('/')[1].Equals(s)));
@ -117,10 +119,10 @@ namespace HeavenStudio
return temp2;
}
public static List<DynamicBeatmap.DynamicEntity> GetAllInGameManagerListExclude(string gameName, string[] exclude)
public static List<RiqEntity> GetAllInGameManagerListExclude(string gameName, string[] exclude)
{
List<DynamicBeatmap.DynamicEntity> temp1 = GameManager.instance.Beatmap.entities.FindAll(c => c.datamodel.Split('/')[0] == gameName);
List<DynamicBeatmap.DynamicEntity> temp2 = new List<DynamicBeatmap.DynamicEntity>();
List<RiqEntity> temp1 = GameManager.instance.Beatmap.Entities.FindAll(c => c.datamodel.Split('/')[0] == gameName);
List<RiqEntity> temp2 = new List<RiqEntity>();
foreach (string s in exclude)
{
temp2.AddRange(temp1.FindAll(c => !c.datamodel.Split('/')[1].Equals(s)));