From d3ee80c9cc53f4a30a946307a55b2e98897b3659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=95=E3=83=9E=E3=82=B8=E3=83=A1?= <161014075+fu-majime@users.noreply.github.com> Date: Fri, 12 Apr 2024 10:40:19 +0900 Subject: [PATCH] Glee Club fix (#860) * gleeclub * Add shorter instantiation and better C offset --------- Co-authored-by: EpicGamer2469 --- Assets/Scripts/Games/GleeClub/GleeClub.cs | 24 +++++++++---------- .../PropertyPrefabs/NotePropertyPrefab.cs | 7 ++++-- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/Assets/Scripts/Games/GleeClub/GleeClub.cs b/Assets/Scripts/Games/GleeClub/GleeClub.cs index f9b84705..57ff5b4d 100644 --- a/Assets/Scripts/Games/GleeClub/GleeClub.cs +++ b/Assets/Scripts/Games/GleeClub/GleeClub.cs @@ -26,17 +26,17 @@ namespace HeavenStudio.Games.Loaders resizable = true, parameters = new List() { - new Param("semiTones", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, -5, 4, 5, "gleeClub/WailLoop"), "Semitones", "Set the number of semitones up or down this note should be pitched."), - new Param("semiTones1", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, -1, 4, 5, "gleeClub/WailLoop"), "Semitones (Next)", "Set the number of semitones up or down this note should be pitched."), - new Param("semiTonesPlayer", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 2, 4, 5, "gleeClub/WailLoop"), "Semitones (Player)", "Set the number of semitones up or down this note should be pitched."), + new Param("semiTones", new EntityTypes.Note(-5, 11, 4, "gleeClub/WailLoop"), "Semitones", "Set the number of semitones up or down this note should be pitched."), + new Param("semiTones1", new EntityTypes.Note(-1, 11, 4, "gleeClub/WailLoop"), "Semitones (Next)", "Set the number of semitones up or down this note should be pitched."), + new Param("semiTonesPlayer", new EntityTypes.Note(2, 11, 4, "gleeClub/WailLoop"), "Semitones (Player)", "Set the number of semitones up or down this note should be pitched."), new Param("close", GleeClub.MouthOpenClose.Both, "Close/Open Mouth", "Choose if the chorus kids should close or open their mouth."), new Param("repeat", false, "Repeating", "Toggle if the left and middle chorus kid should repeat this singing cue.", new List() { new Param.CollapseParam((x, _) => (bool)x, new string[] { "semiTonesLeft2", "semiTonesLeft3", "semiTonesMiddle2" }) }), - new Param("semiTonesLeft2", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0, 4, 5, "gleeClub/WailLoop"), "Semitones (Repeat Left First)", "Set the number of semitones up or down this note should be pitched."), - new Param("semiTonesLeft3", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0, 4, 5, "gleeClub/WailLoop"), "Semitones (Repeat Left Last)", "Set the number of semitones up or down this note should be pitched."), - new Param("semiTonesMiddle2", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0, 4, 5, "gleeClub/WailLoop"), "Semitones (Repeat Middle)", "Set the number of semitones up or down this note should be pitched."), + new Param("semiTonesLeft2", new EntityTypes.Note(0, 11, 4, "gleeClub/WailLoop"), "Semitones (Repeat Left First)", "Set the number of semitones up or down this note should be pitched."), + new Param("semiTonesLeft3", new EntityTypes.Note(0, 11, 4, "gleeClub/WailLoop"), "Semitones (Repeat Left Last)", "Set the number of semitones up or down this note should be pitched."), + new Param("semiTonesMiddle2", new EntityTypes.Note(0, 11, 4, "gleeClub/WailLoop"), "Semitones (Repeat Middle)", "Set the number of semitones up or down this note should be pitched."), } }, new GameAction("baton", "Baton") @@ -50,9 +50,9 @@ namespace HeavenStudio.Games.Loaders defaultLength = 4f, parameters = new List() { - new Param("semiTones", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, -1, 4, 5, "gleeClub/WailLoop"), "Semitones", "Set the number of semitones up or down this note should be pitched."), - new Param("semiTones1", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 4, 4, 5, "gleeClub/WailLoop"), "Semitones (Next)", "Set the number of semitones up or down this note should be pitched."), - new Param("semiTonesPlayer", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 10, 4, 5, "gleeClub/WailLoop"), "Semitones (Player)", "Set the number of semitones up or down this note should be pitched."), + new Param("semiTones", new EntityTypes.Note(-1, 11, 4, "gleeClub/WailLoop"), "Semitones", "Set the number of semitones up or down this note should be pitched."), + new Param("semiTones1", new EntityTypes.Note(4, 11, 4, "gleeClub/WailLoop"), "Semitones (Next)", "Set the number of semitones up or down this note should be pitched."), + new Param("semiTonesPlayer", new EntityTypes.Note(10, 11, 4, "gleeClub/WailLoop"), "Semitones (Player)", "Set the number of semitones up or down this note should be pitched."), new Param("pitch", new EntityTypes.Float(0f, 5f, 1f), "Conductor Voice Pitch", "Choose the pitch of the conductor's voice. 1 is normal pitch.") } }, @@ -62,9 +62,9 @@ namespace HeavenStudio.Games.Loaders defaultLength = 0.5f, parameters = new List() { - new Param("semiTones", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0, 4, 5, "gleeClub/WailLoop"), "Semitones", "Set the number of semitones up or down this note should be pitched."), - new Param("semiTones1", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0, 4, 5, "gleeClub/WailLoop"), "Semitones (Next)", "Set the number of semitones up or down this note should be pitched."), - new Param("semiTonesPlayer", new EntityTypes.Note(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0, 4, 5, "gleeClub/WailLoop"), "Semitones (Player)", "Set the number of semitones up or down this note should be pitched."), + new Param("semiTones", new EntityTypes.Note(0, 11, 4, "gleeClub/WailLoop"), "Semitones", "Set the number of semitones up or down this note should be pitched."), + new Param("semiTones1", new EntityTypes.Note(0, 11, 4, "gleeClub/WailLoop"), "Semitones (Next)", "Set the number of semitones up or down this note should be pitched."), + new Param("semiTonesPlayer", new EntityTypes.Note(0, 11, 4, "gleeClub/WailLoop"), "Semitones (Player)", "Set the number of semitones up or down this note should be pitched."), } }, new GameAction("presence", "Toggle Chorus Kids") diff --git a/Assets/Scripts/LevelEditor/EventSelector/PropertyPrefabs/NotePropertyPrefab.cs b/Assets/Scripts/LevelEditor/EventSelector/PropertyPrefabs/NotePropertyPrefab.cs index cc49aabd..57b7e805 100644 --- a/Assets/Scripts/LevelEditor/EventSelector/PropertyPrefabs/NotePropertyPrefab.cs +++ b/Assets/Scripts/LevelEditor/EventSelector/PropertyPrefabs/NotePropertyPrefab.cs @@ -83,8 +83,11 @@ public class NotePropertyPrefab : NumberPropertyPrefab slider.wholeNumbers = true; offsetFromC = 0; - if(note.offsetToC) - offsetFromC = 3 - note.sampleNote; + if (note.offsetToC) { + int sameC = 3 - note.sampleNote; + int upperC = 15 - note.sampleNote; + offsetFromC = Mathf.Abs(sameC) < Mathf.Abs(upperC) ? sameC : upperC; + } int lastValue = (int)slider.value; slider.value = Convert.ToSingle(parameterManager.entity[propertyName]) - offsetFromC;