mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-13 12:57:40 +02:00
* 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:
@ -16,8 +16,8 @@ namespace HeavenStudio.Games.Scripts_OctopusMachine
|
||||
public bool isSqueezed;
|
||||
public bool isPreparing;
|
||||
public bool queuePrepare;
|
||||
public float lastReportedBeat = 0f;
|
||||
float lastSqueezeBeat;
|
||||
public double lastReportedBeat = 0f;
|
||||
double lastSqueezeBeat;
|
||||
bool isActive = true;
|
||||
|
||||
private OctopusMachine game;
|
||||
@ -42,13 +42,13 @@ namespace HeavenStudio.Games.Scripts_OctopusMachine
|
||||
{
|
||||
if (PlayerInput.Pressed() && !game.IsExpectingInputNow(InputType.STANDARD_DOWN)) {
|
||||
OctoAction("Squeeze");
|
||||
Jukebox.PlayOneShotGame("nearMiss");
|
||||
SoundByte.PlayOneShotGame("nearMiss");
|
||||
game.hasMissed = true;
|
||||
}
|
||||
|
||||
if (PlayerInput.PressedUp() && !game.IsExpectingInputNow(InputType.STANDARD_UP)) {
|
||||
OctoAction(PlayerInput.Pressing(true) ? "Pop" : "Release");
|
||||
Jukebox.PlayOneShotGame("nearMiss");
|
||||
SoundByte.PlayOneShotGame("nearMiss");
|
||||
game.hasMissed = true;
|
||||
}
|
||||
}
|
||||
@ -79,6 +79,7 @@ namespace HeavenStudio.Games.Scripts_OctopusMachine
|
||||
1 => "Happy",
|
||||
2 => "Angry",
|
||||
3 => "Oops",
|
||||
_ => "Bop"
|
||||
}, 0.5f);
|
||||
isPreparing =
|
||||
isSqueezed = false;
|
||||
@ -99,8 +100,8 @@ namespace HeavenStudio.Games.Scripts_OctopusMachine
|
||||
|
||||
public void OctoAction(string action)
|
||||
{
|
||||
if (action != "Release" || (Conductor.instance.songPositionInBeats - lastSqueezeBeat) > 0.15f) Jukebox.PlayOneShotGame($"octopusMachine/{action.ToLower()}");
|
||||
if (action == "Squeeze") lastSqueezeBeat = Conductor.instance.songPositionInBeats;
|
||||
if (action != "Release" || (Conductor.instance.songPositionInBeatsAsDouble - lastSqueezeBeat) > 0.15f) SoundByte.PlayOneShotGame($"octopusMachine/{action.ToLower()}");
|
||||
if (action == "Squeeze") lastSqueezeBeat = Conductor.instance.songPositionInBeatsAsDouble;
|
||||
|
||||
anim.DoScaledAnimationAsync(action, 0.5f);
|
||||
isSqueezed = (action == "Squeeze");
|
||||
|
@ -188,13 +188,13 @@ namespace HeavenStudio.Games
|
||||
int bopIterate = 0;
|
||||
bool intervalStarted;
|
||||
bool autoAction;
|
||||
float intervalStartBeat;
|
||||
double intervalStartBeat;
|
||||
float beatInterval = 1f;
|
||||
float lastReportedBeat;
|
||||
double lastReportedBeat;
|
||||
|
||||
static List<float> queuedSqueezes = new List<float>();
|
||||
static List<float> queuedReleases = new List<float>();
|
||||
static List<float> queuedPops = new List<float>();
|
||||
static List<double> queuedSqueezes = new();
|
||||
static List<double> queuedReleases = new();
|
||||
static List<double> queuedPops = new();
|
||||
|
||||
public static OctopusMachine instance;
|
||||
|
||||
@ -257,7 +257,7 @@ namespace HeavenStudio.Games
|
||||
}
|
||||
}
|
||||
|
||||
public static void Prepare(float beat, float prepBeats)
|
||||
public static void Prepare(double beat, float prepBeats)
|
||||
{
|
||||
if (GameManager.instance.currentGame != "octopusMachine") {
|
||||
OctopusMachine.queuePrepare = true;
|
||||
@ -306,7 +306,7 @@ namespace HeavenStudio.Games
|
||||
}
|
||||
}
|
||||
|
||||
public void OctoAction(float beat, float length, string action)
|
||||
public void OctoAction(double beat, float length, string action)
|
||||
{
|
||||
if (action != "Squeeze" && !octopodes[0].isSqueezed) return;
|
||||
if (!intervalStarted) StartInterval(beat, length);
|
||||
@ -319,7 +319,7 @@ namespace HeavenStudio.Games
|
||||
queuedList.Add(beat - intervalStartBeat);
|
||||
}
|
||||
|
||||
public void Bop(float length, int whichBop, bool singleBop, bool keepBop)
|
||||
public void Bop(double length, int whichBop, bool singleBop, bool keepBop)
|
||||
{
|
||||
foreach (var octo in octopodes) {
|
||||
if (singleBop) octo.PlayAnimation(whichBop);
|
||||
@ -349,7 +349,7 @@ namespace HeavenStudio.Games
|
||||
foreach (var octo in octopodes) octo.AnimationColor(octo.isSqueezed ? 1 : 0);
|
||||
}
|
||||
|
||||
public void OctopusModifiers(float beat, float oct1x, float oct2x, float oct3x, float oct1y, float oct2y, float oct3y, bool oct1, bool oct2, bool oct3)
|
||||
public void OctopusModifiers(double beat, float oct1x, float oct2x, float oct3x, float oct1y, float oct2y, float oct3y, bool oct1, bool oct2, bool oct3)
|
||||
{
|
||||
octopodes[0].OctopusModifiers(oct1x, oct1y, oct1);
|
||||
octopodes[1].OctopusModifiers(oct2x, oct2y, oct2);
|
||||
@ -361,7 +361,7 @@ namespace HeavenStudio.Games
|
||||
foreach (var octo in octopodes) octo.ForceSqueeze();
|
||||
}
|
||||
|
||||
public void StartInterval(float beat, float length)
|
||||
public void StartInterval(double beat, float length)
|
||||
{
|
||||
intervalStartBeat = beat;
|
||||
beatInterval = length;
|
||||
@ -373,7 +373,7 @@ namespace HeavenStudio.Games
|
||||
});
|
||||
}
|
||||
|
||||
public void PassTurn(float beat)
|
||||
public void PassTurn(double beat)
|
||||
{
|
||||
intervalStarted = false;
|
||||
var queuedInputs = new List<BeatAction.Action>();
|
||||
@ -402,19 +402,19 @@ namespace HeavenStudio.Games
|
||||
private void SqueezeHit(PlayerActionEvent caller, float state)
|
||||
{
|
||||
octopodes[2].OctoAction("Squeeze");
|
||||
if (state <= -1f || state >= 1f) Jukebox.PlayOneShotGame("nearMiss");
|
||||
if (state <= -1f || state >= 1f) SoundByte.PlayOneShotGame("nearMiss");
|
||||
}
|
||||
|
||||
private void ReleaseHit(PlayerActionEvent caller, float state)
|
||||
{
|
||||
octopodes[2].OctoAction("Release");
|
||||
if (state <= -1f || state >= 1f) Jukebox.PlayOneShotGame("nearMiss");
|
||||
if (state <= -1f || state >= 1f) SoundByte.PlayOneShotGame("nearMiss");
|
||||
}
|
||||
|
||||
private void PopHit(PlayerActionEvent caller, float state)
|
||||
{
|
||||
octopodes[2].OctoAction("Pop");
|
||||
if (state <= -1f || state >= 1f) Jukebox.PlayOneShotGame("nearMiss");
|
||||
if (state <= -1f || state >= 1f) SoundByte.PlayOneShotGame("nearMiss");
|
||||
}
|
||||
|
||||
private void Miss(PlayerActionEvent caller) { }
|
||||
|
Reference in New Issue
Block a user