diff --git a/.vscode/settings.json b/.vscode/settings.json index 54d21e9c8..d5d9a24c5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -51,5 +51,5 @@ "temp/": true, "Temp/": true }, - "dotnet.defaultSolution": "HeavenStudio-AstrlJelly.sln" + "dotnet.defaultSolution": "HeavenStudio.sln" } \ No newline at end of file diff --git a/Assets/Resources/Games/fanClub.prefab b/Assets/Resources/Games/fanClub.prefab index 2f8369628..a97ef4c45 100644 --- a/Assets/Resources/Games/fanClub.prefab +++ b/Assets/Resources/Games/fanClub.prefab @@ -26958,7 +26958,7 @@ MonoBehaviour: - name: crowd_hai sequence: game: 1 - force: 0 + force: 1 clips: - clip: fanClub/crowd_hai_jp beat: 0 @@ -27100,7 +27100,7 @@ MonoBehaviour: - name: crowd_kamone sequence: game: 1 - force: 0 + force: 1 clips: - clip: fanClub/crowd_ka_jp beat: 0 @@ -27133,7 +27133,7 @@ MonoBehaviour: - name: crowd_iina sequence: game: 1 - force: 0 + force: 1 clips: - clip: fanClub/crowd_ii_jp beat: 0 diff --git a/Assets/Resources/Sprites/Games/KarateMan/karateman_main.png b/Assets/Resources/Sprites/Games/KarateMan/karateman_main.png index acb1e94d5..5fbfd1cab 100644 Binary files a/Assets/Resources/Sprites/Games/KarateMan/karateman_main.png and b/Assets/Resources/Sprites/Games/KarateMan/karateman_main.png differ diff --git a/Assets/Scenes/Editor.unity b/Assets/Scenes/Editor.unity index af3a0cdc8..899afd7b1 100644 --- a/Assets/Scenes/Editor.unity +++ b/Assets/Scenes/Editor.unity @@ -26851,7 +26851,7 @@ MonoBehaviour: m_HandleRect: {fileID: 1589389271} m_Direction: 2 m_Value: 1 - m_Size: 0.9989085 + m_Size: 0.9999814 m_NumberOfSteps: 0 m_OnValueChanged: m_PersistentCalls: @@ -32707,7 +32707,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} - m_AnchoredPosition: {x: 0, y: 173.14249} + m_AnchoredPosition: {x: 0, y: 171.91833} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 1} --- !u!222 &1154875945 @@ -39097,8 +39097,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 459.58514, y: -25} - m_SizeDelta: {x: 879.1703, y: 30} + m_AnchoredPosition: {x: 391.79788, y: -25} + m_SizeDelta: {x: 743.59576, y: 30} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1443721748 MonoBehaviour: @@ -39119,6 +39119,7 @@ MonoBehaviour: ColorTable: {fileID: 723094753} colorTableActive: 0 colorPreview: {fileID: 1535224921} + hex: {fileID: 426555699} --- !u!1 &1443971064 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs b/Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs index a3906fec2..4e213411b 100644 --- a/Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs +++ b/Assets/Scripts/Games/ClappyTrio/ClappyTrio.cs @@ -42,11 +42,12 @@ namespace HeavenStudio.Games.Loaders }, new GameAction("sign", "Sign Enter") { - function = delegate { var e = eventCaller.currentEntity; ClappyTrio.instance.Sign(e.beat, e.length, e["ease"], e["down"]); }, + function = delegate { var e = eventCaller.currentEntity; ClappyTrio.instance.Sign(e.beat, e.length, e["ease"], e["down"], e["sfx"]); }, parameters = new List() { new Param("ease", Util.EasingFunction.Ease.Linear, "Ease", "Which ease should the sign move with?"), - new Param("down", true, "Down", "Should the sign go down?") + new Param("down", true, "Down", "Should the sign go down?"), + new Param("sfx", true, "Play SFX", "Should the sign play a sound effect"), }, resizable = true }, @@ -156,9 +157,9 @@ namespace HeavenStudio.Games } } - public void Sign(double beat, float length, int ease, bool down) + public void Sign(double beat, float length, int ease, bool down, bool playSfx) { - SoundByte.PlayOneShotGame("clappyTrio/sign"); + if (playSfx) SoundByte.PlayOneShotGame("clappyTrio/sign"); signStartBeat = beat; signLength = length; lastEase = (Util.EasingFunction.Ease)ease; diff --git a/Assets/Scripts/Games/FanClub/FanClub.cs b/Assets/Scripts/Games/FanClub/FanClub.cs index 2212be69b..d9df1daed 100644 --- a/Assets/Scripts/Games/FanClub/FanClub.cs +++ b/Assets/Scripts/Games/FanClub/FanClub.cs @@ -10,12 +10,13 @@ namespace HeavenStudio.Games.Loaders using static Minigames; public static class NtrIdolLoader { - public static Minigame AddGame(EventCaller eventCaller) { + public static Minigame AddGame(EventCaller eventCaller) + { return new Minigame("fanClub", "Fan Club", "ff78ff", false, false, new List() { new GameAction("bop", "Bop") { - function = delegate { var e = eventCaller.currentEntity; FanClub.instance.Bop(e.beat, e.length, e["type"], e["type2"]); }, + function = delegate { var e = eventCaller.currentEntity; FanClub.instance.Bop(e.beat, e.length, e["type"], e["type2"]); }, resizable = true, parameters = new List() { @@ -25,7 +26,7 @@ namespace HeavenStudio.Games.Loaders }, new GameAction("yeah, yeah, yeah", "Yeah, Yeah, Yeah!") { - function = delegate { var e = eventCaller.currentEntity; FanClub.instance.CallHai(e.beat, e["toggle"], e["toggle2"]); }, + function = delegate { var e = eventCaller.currentEntity; FanClub.instance.CallHai(e.beat, e["toggle"], e["toggle2"]); }, defaultLength = 8, parameters = new List() { @@ -33,12 +34,12 @@ namespace HeavenStudio.Games.Loaders new Param("toggle2", false, "Disable response SFX", "Disable the monkeys's response") }, inactiveFunction = delegate { var e = eventCaller.currentEntity; FanClub.WarnHai(e.beat, e["toggle"]);}, - preFunction = delegate { var e = eventCaller.currentEntity; FanClub.HaiSound(e.beat, e["toggle"]); } + preFunction = delegate { var e = eventCaller.currentEntity; FanClub.HaiSound(e.beat, e["toggle"], e["toggle2"]); } }, new GameAction("I suppose", "I Suppose!") { - function = delegate { var e = eventCaller.currentEntity; FanClub.instance.CallKamone(e.beat, e["toggle"], e["toggle2"], 0, e["type"], e["alt"]); }, - defaultLength = 6, + function = delegate { var e = eventCaller.currentEntity; FanClub.instance.CallKamone(e.beat, e["toggle"], e["toggle2"], 0, e["type"], e["alt"]); }, + defaultLength = 6, parameters = new List() { new Param("type", FanClub.KamoneResponseType.Through, "Response type", "Type of response to use"), @@ -47,11 +48,11 @@ namespace HeavenStudio.Games.Loaders new Param("alt", false, "Alternate cue", "Use an alternate cue") }, inactiveFunction = delegate { var e = eventCaller.currentEntity; FanClub.WarnKamone(e.beat, e["toggle"], 0, e["type"], e["alt"]);}, - preFunction = delegate { var e = eventCaller.currentEntity; FanClub.KamoneSound(e.beat, e["toggle"], 0, e["type"], e["alt"]); } + preFunction = delegate { var e = eventCaller.currentEntity; FanClub.KamoneSound(e.beat, e["toggle"], e["toggle2"], 0, e["type"], e["alt"]); } }, new GameAction("double clap", "Double Clap") { - function = delegate { var e = eventCaller.currentEntity; FanClub.instance.CallBigReady(e.beat, e["toggle"]); }, + function = delegate { var e = eventCaller.currentEntity; FanClub.instance.CallBigReady(e.beat, e["toggle"]); }, defaultLength = 4, parameters = new List() { @@ -63,7 +64,7 @@ namespace HeavenStudio.Games.Loaders new GameAction("play idol animation", "Idol Coreography") { function = delegate { var e = eventCaller.currentEntity; FanClub.instance.PlayAnim(e.beat, e.length, e["type"], e["who"]); }, - resizable = true, + resizable = true, parameters = new List() { new Param("type", FanClub.IdolAnimations.Bop, "Animation", "Animation to play"), @@ -72,8 +73,8 @@ namespace HeavenStudio.Games.Loaders }, new GameAction("play stage animation", "Stage Coreography") { - function = delegate { var e = eventCaller.currentEntity; FanClub.instance.PlayAnimStage(e.beat, e["type"]); }, - resizable = true, + function = delegate { var e = eventCaller.currentEntity; FanClub.instance.PlayAnimStage(e.beat, e["type"]); }, + resizable = true, parameters = new List() { new Param("type", FanClub.StageAnimations.Flash, "Animation", "Animation to play") @@ -83,7 +84,7 @@ namespace HeavenStudio.Games.Loaders { function = delegate { var e = eventCaller.currentEntity; FanClub.instance.DancerTravel(e.beat, e.length, e["exit"], e["instant"]); }, defaultLength = 16f, - resizable = true, + resizable = true, parameters = new List() { new Param("exit", false, "Exit", "Backup dancers exit instead"), @@ -103,12 +104,12 @@ namespace HeavenStudio.Games.Loaders }, new GameAction("finish", "Applause") { - function = delegate { var e = eventCaller.currentEntity; FanClub.instance.FinalCheer(e.beat); }, + function = delegate { var e = eventCaller.currentEntity; FanClub.instance.FinalCheer(e.beat); }, }, }, - new List() {"ntr", "normal"}, + new List() { "ntr", "normal" }, "ntridol", "jp", - new List() {"jp"} + new List() { "jp" } ); } } @@ -117,16 +118,18 @@ namespace HeavenStudio.Games.Loaders namespace HeavenStudio.Games { using Scripts_FanClub; - + public class FanClub : Minigame { - public enum IdolBopType { + public enum IdolBopType + { Both, Idol, Spectators, None } - public enum IdolAnimations { + public enum IdolAnimations + { Bop, PeaceVocal, Peace, @@ -140,23 +143,27 @@ namespace HeavenStudio.Games Dab, None } - public enum KamoneResponseType { + public enum KamoneResponseType + { Through, Jump, ThroughFast, JumpFast, } - public enum StageAnimations { + public enum StageAnimations + { Reset, Flash, Spot } - public enum IdolPerformanceType { + public enum IdolPerformanceType + { Normal, Arrange, // Tour(this one is fan made so ?) } - public enum IdolType { + public enum IdolType + { All, Idol, LeftDancer, @@ -188,7 +195,7 @@ namespace HeavenStudio.Games // end userdata public bool JudgementPaused { get => noJudgement; } - public bool JudgementInputPaused { get => noJudgementInput; set => noJudgementInput = value;} + public bool JudgementInputPaused { get => noJudgementInput; set => noJudgementInput = value; } //arisa's animation controller private Animator idolAnimator; @@ -198,7 +205,7 @@ namespace HeavenStudio.Games // orange's animation controller private Animator backupLAnimator; - + //spectators private NtrIdolFan Player; private List Spectators; @@ -210,11 +217,11 @@ namespace HeavenStudio.Games private GameEvent noSpecBop = new GameEvent(); private double idolJumpStartTime = double.MinValue; - private static int performanceType = (int) IdolPerformanceType.Normal; + private static int performanceType = (int)IdolPerformanceType.Normal; private bool responseToggle = false; private static double wantHais = double.MinValue; private static double wantKamone = double.MinValue; - private static int wantKamoneType = (int) KamoneResponseType.Through; + private static int wantKamoneType = (int)KamoneResponseType.Through; private static bool wantKamoneAlt = false; private static double wantBigReady = double.MinValue; private bool hasJumped = false; @@ -280,7 +287,7 @@ namespace HeavenStudio.Games } } - if (performanceType != (int) IdolPerformanceType.Normal) + if (performanceType != (int)IdolPerformanceType.Normal) { idolAnimator.Play("NoPose" + GetPerformanceSuffix(), -1, 0); } @@ -304,7 +311,7 @@ namespace HeavenStudio.Games } } - FanClub.SetPerformanceType((int) IdolPerformanceType.Normal); + FanClub.SetPerformanceType((int)IdolPerformanceType.Normal); var choreoTypeEvts = EventCaller.GetAllInGameManagerList("fanClub", new string[] { "set performance type" }); foreach (var e in choreoTypeEvts) { @@ -319,14 +326,14 @@ namespace HeavenStudio.Games { switch (performanceType) { - case (int) IdolPerformanceType.Arrange: + case (int)IdolPerformanceType.Arrange: return "Arrange"; default: return ""; } } - - public static void SetPerformanceType(int type = (int) IdolPerformanceType.Normal) + + public static void SetPerformanceType(int type = (int)IdolPerformanceType.Normal) { performanceType = type; if (GameManager.instance.currentGame == "fanClub") @@ -379,7 +386,7 @@ namespace HeavenStudio.Games private void Update() { var cond = Conductor.instance; - + //idol jumping physics float jumpPos = cond.GetPositionFromBeat(idolJumpStartTime, 1f); float IDOL_SHADOW_SCALE = 1.18f; @@ -387,9 +394,9 @@ namespace HeavenStudio.Games { hasJumped = true; float yMul = jumpPos * 2f - 1f; - float yWeight = -(yMul*yMul) + 1f; + float yWeight = -(yMul * yMul) + 1f; ArisaRootMotion.transform.localPosition = new Vector3(0, 2f * yWeight + 0.25f); - ArisaShadow.transform.localScale = new Vector3((1f-yWeight*0.8f) * IDOL_SHADOW_SCALE, (1f-yWeight*0.8f) * IDOL_SHADOW_SCALE, 1f); + ArisaShadow.transform.localScale = new Vector3((1f - yWeight * 0.8f) * IDOL_SHADOW_SCALE, (1f - yWeight * 0.8f) * IDOL_SHADOW_SCALE, 1f); } else { @@ -399,7 +406,7 @@ namespace HeavenStudio.Games } } - public void Bop(double beat, float length, int target = (int) IdolBopType.Both, int targetAuto = (int)IdolBopType.Both) + public void Bop(double beat, float length, int target = (int)IdolBopType.Both, int targetAuto = (int)IdolBopType.Both) { for (int i = 0; i < length; i++) { @@ -543,15 +550,15 @@ namespace HeavenStudio.Games { switch (type) { - case (int) StageAnimations.Reset: + case (int)StageAnimations.Reset: StageAnimator.Play("Bg", -1, 0); ToSpot(); break; - case (int) StageAnimations.Flash: + case (int)StageAnimations.Flash: StageAnimator.Play("Bg_Light", -1, 0); ToSpot(); break; - case (int) StageAnimations.Spot: + case (int)StageAnimations.Spot: StageAnimator.Play("Bg_Spot", -1, 0); ToSpot(false); break; @@ -566,7 +573,7 @@ namespace HeavenStudio.Games if (unspot) spectatorMat.SetColor("_Color", new Color(1, 1, 1, 1)); else - spectatorMat.SetColor("_Color", new Color(117/255f, 177/255f, 209/255f, 1)); + spectatorMat.SetColor("_Color", new Color(117 / 255f, 177 / 255f, 209 / 255f, 1)); } private void DoIdolJump(double beat, float length = 3f) @@ -639,10 +646,10 @@ namespace HeavenStudio.Games responseToggle = false; DisableBop(beat, 8f); - Prepare(beat + 3f); - Prepare(beat + 4f); - Prepare(beat + 5f); - Prepare(beat + 6f); + Prepare(beat + 3f); + Prepare(beat + 4f); + Prepare(beat + 5f); + Prepare(beat + 6f); BeatAction.New(instance, new List() { @@ -657,8 +664,6 @@ namespace HeavenStudio.Games new BeatAction.Action(beat + 6f, delegate { PlayOneClap(beat + 6f); DoIdolClaps();}), new BeatAction.Action(beat + 7f, delegate { PlayOneClap(beat + 7f); DoIdolClaps();}), }); - - if (!noResponse) PlaySoundSequence("fanClub", "crowd_hai", beat + 4f); } public static void WarnHai(double beat, bool noSound = false, int type = 0) @@ -666,8 +671,9 @@ namespace HeavenStudio.Games wantHais = beat; } - public static void HaiSound(double beat, bool noSound = false, int type = 0) + public static void HaiSound(double beat, bool noSound = false, bool noResponse = false, int type = 0) { + if (!noResponse) PlaySoundSequence("fanClub", "crowd_hai", beat + 4f); if (noSound) return; PlaySoundSequence("fanClub", "arisa_hai", beat); } @@ -679,10 +685,10 @@ namespace HeavenStudio.Games } const float CALL_LENGTH = 2.5f; - public void CallKamone(double beat, bool noSound = false, bool noResponse = false, int type = 0, int responseType = (int) KamoneResponseType.Through, bool alt = false) + public void CallKamone(double beat, bool noSound = false, bool noResponse = false, int type = 0, int responseType = (int)KamoneResponseType.Through, bool alt = false) { - bool doJump = (responseType == (int) KamoneResponseType.Jump || responseType == (int) KamoneResponseType.JumpFast); - bool isBig = (responseType == (int) KamoneResponseType.ThroughFast || responseType == (int) KamoneResponseType.JumpFast); + bool doJump = (responseType == (int)KamoneResponseType.Jump || responseType == (int)KamoneResponseType.JumpFast); + bool isBig = (responseType == (int)KamoneResponseType.ThroughFast || responseType == (int)KamoneResponseType.JumpFast); DisableResponse(beat, 2f); responseToggle = true; @@ -705,7 +711,7 @@ namespace HeavenStudio.Games new BeatAction.Action(beat + 3.5f, delegate { PlayOneClap(beat + 3.5f); }), new BeatAction.Action(beat + 4f, delegate { PlayChargeClap(beat + 4f); DoIdolResponse(); Blue.PlayAnimState("Beat"); Orange.PlayAnimState("Beat"); }), new BeatAction.Action(beat + 5f, delegate { PlayJump(beat + 5f); - if (doJump) + if (doJump) { DoIdolJump(beat + 5f); Blue.DoIdolJump(beat + 5f); @@ -714,26 +720,24 @@ namespace HeavenStudio.Games else { DoIdolResponse(); - Blue.PlayAnimState("Beat"); Orange.PlayAnimState("Beat"); + Blue.PlayAnimState("Beat"); Orange.PlayAnimState("Beat"); } }), }); - - - if (!noResponse) PlaySoundSequence("fanClub", alt ? "crowd_iina" : "crowd_kamone", beat + 2f); } - public static void WarnKamone(double beat, bool noSound = false, int type = 0, int responseType = (int) KamoneResponseType.Through, bool alt = false) + public static void WarnKamone(double beat, bool noSound = false, int type = 0, int responseType = (int)KamoneResponseType.Through, bool alt = false) { wantKamone = beat; wantKamoneType = responseType; wantKamoneAlt = alt; } - public static void KamoneSound(double beat, bool noSound = false, int type = 0, int responseType = (int) KamoneResponseType.Through, bool alt = false) + public static void KamoneSound(double beat, bool noSound = false, bool noResponse = false, int type = 0, int responseType = (int)KamoneResponseType.Through, bool alt = false) { + if (!noResponse) PlaySoundSequence("fanClub", alt ? "crowd_iina" : "crowd_kamone", beat + 2f); if (noSound) return; - if (responseType == (int) KamoneResponseType.ThroughFast || responseType == (int) KamoneResponseType.JumpFast) + if (responseType == (int)KamoneResponseType.ThroughFast || responseType == (int)KamoneResponseType.JumpFast) { PlaySoundSequence("fanClub", alt ? "arisa_iina_fast" : "arisa_kamone_fast", beat); } @@ -743,7 +747,7 @@ namespace HeavenStudio.Games } } - public void ContinueKamone(double beat, int type = 0, int responseType = (int) KamoneResponseType.Through, bool alt = false) + public void ContinueKamone(double beat, int type = 0, int responseType = (int)KamoneResponseType.Through, bool alt = false) { CallKamone(beat, true, true, type, responseType, alt); } @@ -753,7 +757,7 @@ namespace HeavenStudio.Games { Prepare(beat + 1.5f); Prepare(beat + 2f); - + DisableSpecBop(beat, 3.75f); PlayAnimationAll("FanBigReady", onlyOverrideBop: true); @@ -793,7 +797,7 @@ namespace HeavenStudio.Games { if (i == 3 && noPlayer) continue; - + if (!Spectators[i].GetComponent().IsAnimationNotPlaying() && !doForced) { if (onlyOverrideBop) @@ -814,7 +818,7 @@ namespace HeavenStudio.Games { if (i == 3 && noPlayer) continue; - + string clipName = Spectators[i].GetComponent().GetCurrentAnimatorClipInfo(0)[0].clip.name; if (!Spectators[i].GetComponent().IsAnimationNotPlaying() && !doForced) { @@ -838,7 +842,7 @@ namespace HeavenStudio.Games private void PlayOneClap(double beat, int who = -1) { - if (who != -1) + if (who != -1) { if (who == 3) { @@ -901,7 +905,7 @@ namespace HeavenStudio.Games { if (i == 3) continue; - + StartJump(i, beat); } } @@ -940,7 +944,7 @@ namespace HeavenStudio.Games BeatAction.New(this, new List() { new BeatAction.Action(beat, delegate { StartClapLoop(beat, 1);}), - + new BeatAction.Action(beat + (2f/3f), delegate { StartClapLoop(beat + (2f/3f), 0);}), new BeatAction.Action(beat + (2f/3f), delegate { StartClapLoop(beat + (2f/3f), 3);}), diff --git a/Assets/Scripts/Games/KarateMan/KarateMan.cs b/Assets/Scripts/Games/KarateMan/KarateMan.cs index ff874a968..cefda7dc5 100644 --- a/Assets/Scripts/Games/KarateMan/KarateMan.cs +++ b/Assets/Scripts/Games/KarateMan/KarateMan.cs @@ -202,7 +202,7 @@ namespace HeavenStudio.Games.Loaders parameters = new List() { new Param("type", KarateMan.KarateManFaces.Happy, "Success Expression", "The facial expression to set Joe to on hit"), - new Param("pitchVoice", false, "Pitch Voice", "Pitch the voice of this cue?", new List() + new Param("pitchVoice", false, "Pitch Voice", "Pitch the voice of this cue", new List() { new Param.CollapseParam((x, _) => (bool)x, new string[] { "forcePitch" }), }), @@ -222,11 +222,11 @@ namespace HeavenStudio.Games.Loaders parameters = new List() { new Param("whichWarning", KarateMan.HitThree.HitThree, "Which Warning", "The warning text to show and the sfx to play"), - new Param("pitchVoice", false, "Auto Pitch Voice", "Pitch the voice of this cue depending on the BPM", new List() + new Param("pitchVoice", false, "Pitch Voice", "Pitch the voice of this cue", new List() { new Param.CollapseParam((x, _) => (bool)x, new string[] { "forcePitch" }), }), - new Param("forcePitch", new EntityTypes.Float(0.5f, 2f, 1f), "Force Pitch", "Pitch the voice of this cue depending on the value"), + new Param("forcePitch", new EntityTypes.Float(0.5f, 2f, 1f), "Force Pitch", "Override the automatic pitching if not set to 1"), new Param("customLength", false, "Custom Length", "Have the warning text appear for the length of the block"), new Param("cutOut", true, "Cut Out Voice", "Will this cue be cut out by another voice?"), }, @@ -238,8 +238,8 @@ namespace HeavenStudio.Games.Loaders new GameAction("special camera", "Special Camera") { function = delegate { var e = eventCaller.currentEntity; KarateMan.DoSpecialCamera(e.beat, e.length, e["toggle"]); }, - defaultLength = 8f, - resizable = true, + defaultLength = 8f, + resizable = true, parameters = new List() { new Param("toggle", true, "Return Camera", "Camera zooms back in?"), @@ -248,23 +248,23 @@ namespace HeavenStudio.Games.Loaders }, new GameAction("prepare", "Preparation Stance") { - function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.Prepare(e.beat, e.length);}, + function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.Prepare(e.beat, e.length);}, resizable = true, }, new GameAction("set gameplay modifiers", "Flow/Gameplay Modifiers") { - function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetGameplayMods(e.beat, e["fxType"], e["type"], e["toggle"]); }, + function = delegate { + var e = eventCaller.currentEntity; + KarateMan.instance.SetGameplayMods(e.beat, e["fxType"], e["type"], e["toggle"]); + }, defaultLength = 0.5f, parameters = new List() { new Param("fxType", KarateMan.BackgroundFXType.None, "FX Type", "The background effect to be displayed"), - new Param("type", KarateMan.NoriMode.None, "Flow Bar type", "The type of Flow bar to use", new List() - { - new Param.CollapseParam((x, _) => (int)x != (int)KarateMan.NoriMode.None, new string[] { "type" }) - }), - new Param("hitsPerHeart", new EntityTypes.Float(0f, 20f, 0f), "Hits Per Heart", "How many hits will it take for each heart to light up? (0 will do it automatically.)"), + new Param("type", KarateMan.NoriMode.None, "Flow Bar type", "The type of Flow bar to use"), + // new Param("hitsPerHeart", new EntityTypes.Float(0f, 20f, 0f), "Hits Per Heart", "How many hits it will take for each heart to light up (0 will do it automatically.)"), new Param("toggle", true, "Enable Combos", "Allow the player to combo? (Contextual combos will still be allowed even when off)"), - //new Param("toggle2", true, "Enable Kicks", "Allow the player to kick? (Contextual kicks will still be allowed even when off)"), + // new Param("toggle2", true, "Enable Kicks", "Allow the player to kick? (Contextual kicks will still be allowed even when off)"), }, }, new GameAction("background appearance", "Background Appearance") @@ -272,13 +272,11 @@ namespace HeavenStudio.Games.Loaders function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.BackgroundColor( - e.beat, e.length, + e.beat, e.length, e["fxType"], e["presetBg"], e["startColor"], e["endColor"], e["ease"], e["shadowType"], e["shadowStart"], e["shadowEnd"], e["textureType"], e["autoColor"], e["startTexture"], e["endTexture"] ); - // backwards compatibility - if (e["fxType"] != 3) KarateMan.instance.currentBgEffect = e["fxType"]; }, defaultLength = 0.5f, resizable = true, @@ -298,6 +296,8 @@ namespace HeavenStudio.Games.Loaders new Param("shadowStart", new Color(), "Start Shadow Color", "The shadow color to start with"), new Param("shadowEnd", new Color(), "End Shadow Color", "The shadow color to end with"), + new Param("fxType", KarateMan.BackgroundFXType.None, "FX Type", "The background effect to be displayed"), + new Param("textureType", KarateMan.BackgroundTextureType.Plain, "Texture", "The type of background texture to use", new List() { new Param.CollapseParam((x, _) => (int)x != (int)KarateMan.BackgroundTextureType.Plain, new string[] { "startTexture", "endTexture" }) @@ -308,10 +308,6 @@ namespace HeavenStudio.Games.Loaders }), new Param("startTexture", new Color(), "Start Texture Color", "The texture color to start with"), new Param("endTexture", new Color(), "End Texture Color", "The texture color to end with"), - new Param("fxType", new EntityTypes.Integer(0, 3, 3), "Check Tooltip", "Ping @AstrlJelly on discord if you see this; it should be hidden.", new List() - { - new Param.CollapseParam((x, _) => false, new string[] { "fxType" }) - }), }, }, // new GameAction("set background effects", "Background Appearance (OLD)") @@ -531,6 +527,7 @@ namespace HeavenStudio.Games static List queuedCues = new(); public static bool IsComboEnable = true; //only stops Out combo inputs, this basically makes combo contextual + // public static bool IsKickEnable = true; //same as above, except with kick inputs public bool IsNoriActive { get { return Nori.MaxNori > 0; } } public float NoriPerformance { get { if (IsNoriActive) return Nori.Nori / Nori.MaxNori; else return 1f; } } @@ -760,15 +757,14 @@ namespace HeavenStudio.Games if (bg != null) { BackgroundColor( - bg.beat, bg.length, + bg.beat, bg.length, bg["fxType"], bg["presetBg"], bg["startColor"], bg["endColor"], bg["ease"], bg["shadowType"], bg["shadowStart"], bg["shadowEnd"], bg["textureType"], bg["autoColor"], bg["startTexture"], bg["endTexture"] ); - if (bg["fxType"] != 3) currentBgEffect = bg["fxType"]; } else { var c = new Color(); - BackgroundColor(0, 0, 0, c, c, (int)Util.EasingFunction.Ease.Instant, 0, c, c, 0, true, c, c); + BackgroundColor(0, 0, 0, 0, c, c, (int)Util.EasingFunction.Ease.Instant, 0, c, c, 0, true, c, c); } if (obj != null) { @@ -779,8 +775,15 @@ namespace HeavenStudio.Games // init modifier(s) RiqEntity bop = prevEntities.FindLast(c => c.beat < beat && c.datamodel == "karateman/bop"); + RiqEntity flow = prevEntities.FindLast(c => c.beat < beat && c.datamodel == "karateman/set gameplay modifiers"); + ToggleBop(0, 0, false, bop?["toggle"] ?? true); + if (flow != null) { + int fxType = bg == null || flow.beat > bg.beat ? flow["fxType"] : bg["fxType"]; + SetGameplayMods(beat, fxType, flow["type"], flow["toggle"]); + } + // get all entities to later check against eachother to cut out voices voiceEntities = prevEntities.FindAll(c => c.beat > beat && (c.datamodel is "karateman/kick" or "karateman/combo")); hitVoiceEntities = prevEntities.FindAll(c => c.beat > beat && (c.datamodel is "karateman/warnings" && c["whichWarning"] <= (int)HitThree.HitFour)); @@ -1081,8 +1084,10 @@ namespace HeavenStudio.Games return mobjDat; } - public void BackgroundColor(double beat, float length, int presetBG, Color colorStart, Color colorEnd, int colorEaseSet, int shadowType, Color shadowStart, Color shadowEnd, int textureType, bool autoColor, Color filterStart, Color filterEnd) + public void BackgroundColor(double beat, float length, int fxType, int presetBG, Color colorStart, Color colorEnd, int colorEaseSet, int shadowType, Color shadowStart, Color shadowEnd, int textureType, bool autoColor, Color filterStart, Color filterEnd) { + currentBgEffect = fxType; + for (int i = 0; i < colorStarts.Length; i++) { colorStartBeats[i] = beat; colorLengths[i] = length; @@ -1144,6 +1149,7 @@ namespace HeavenStudio.Games Nori.SetNoriMode(beat, mode); currentBgEffect = fxType; IsComboEnable = combo; + // IsKickEnable = kick; } public enum StarColorOption diff --git a/Assets/Scripts/Games/KarateMan/KarateManNoriController.cs b/Assets/Scripts/Games/KarateMan/KarateManNoriController.cs index 08cf12db8..9c8a132ea 100644 --- a/Assets/Scripts/Games/KarateMan/KarateManNoriController.cs +++ b/Assets/Scripts/Games/KarateMan/KarateManNoriController.cs @@ -167,7 +167,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan { Nori -= 1; if (Nori < 0) Nori = 0; - NoriHeartAnimators[(int) Nori].Play("NoriNone", -1, (Time.time * PeriodLow) % 1f); + NoriHeartAnimators[(int)Nori].Play("NoriNone", -1, (Time.time * PeriodLow) % 1f); } else { diff --git a/Assets/Scripts/Games/RhythmRally/RhythmRally.cs b/Assets/Scripts/Games/RhythmRally/RhythmRally.cs index 9d08c54c9..f623f93a3 100644 --- a/Assets/Scripts/Games/RhythmRally/RhythmRally.cs +++ b/Assets/Scripts/Games/RhythmRally/RhythmRally.cs @@ -90,7 +90,7 @@ namespace HeavenStudio.Games.Loaders function = delegate { var e = eventCaller.currentEntity; // var rotation = new Vector3(0, e["valA"], 0); - RhythmRally.instance.ChangeCameraAngle(e.beat, e["valA"], e["valB"], e.length, (Util.EasingFunction.Ease)e["type"]); + RhythmRally.instance.ChangeCameraAngle(e.beat, e["valA"], e["valB"], e.length, (Util.EasingFunction.Ease)e["type"], e["additive"]); }, defaultLength = 4, resizable = true, @@ -98,7 +98,7 @@ namespace HeavenStudio.Games.Loaders new Param("valA", new EntityTypes.Integer(-360, 360, 0), "Angle", "The rotation of the camera around the center of the table"), new Param("valB", new EntityTypes.Float(0.5f, 4f, 1), "Zoom", "The camera's level of zoom (Lower value = Zoomed in)"), new Param("type", Util.EasingFunction.Ease.Linear, "Ease", "The easing function to use"), - // new Param("type2", RotateMode.Fast, "Rotation Mode", "The rotation mode to use") + new Param("additive", true, "Additive Rotation", "Add to current angle instead of setting target angle") } }, // todo: background recolouring @@ -407,7 +407,7 @@ namespace HeavenStudio.Games foreach (var entity in cameraEntities) { - ChangeCameraAngle(entity.beat, entity["valA"], entity["valB"], entity.length, (Util.EasingFunction.Ease)entity["type"]); + ChangeCameraAngle(entity.beat, entity["valA"], entity["valB"], entity.length, (Util.EasingFunction.Ease)entity["type"], entity["additive"]); } UpdateCamera(beat); @@ -419,6 +419,7 @@ namespace HeavenStudio.Games { Util.EasingFunction.Function func = Util.EasingFunction.GetEasingFunction(cameraRotateEase); float rotProg = Conductor.instance.GetPositionFromBeat(cameraRotateBeat, cameraRotateLength, true); + rotProg = Mathf.Clamp01(rotProg); float rot = func(cameraRotateLast, cameraRotateNext, rotProg); cameraPivot.rotation = Quaternion.Euler(0, rot, 0); cameraPivot.localScale = Vector3.one * func(cameraScaleLast, cameraScaleNext, rotProg); @@ -558,15 +559,22 @@ namespace HeavenStudio.Games inPose = true; } - public void ChangeCameraAngle(double beat, float rotation, float camZoom, double length, Util.EasingFunction.Ease ease) + public void ChangeCameraAngle(double beat, float rotation, float camZoom, double length, Util.EasingFunction.Ease ease, bool additive = true) { cameraRotateBeat = beat; cameraRotateLength = length; cameraRotateEase = ease; - cameraRotateLast = cameraRotateNext; + cameraRotateLast = cameraRotateNext % 360f; cameraScaleLast = cameraScaleNext; - cameraRotateNext = rotation; cameraScaleNext = camZoom; + if (additive) + { + cameraRotateNext = cameraRotateLast + rotation; + } + else + { + cameraRotateNext = rotation; + } } public void PrepareFastRally(double beat, RallySpeed speedChange, bool muteAudio = false) diff --git a/Assets/Scripts/Games/RhythmTweezers/RhythmTweezers.cs b/Assets/Scripts/Games/RhythmTweezers/RhythmTweezers.cs index 48fd78738..8908ddaf3 100644 --- a/Assets/Scripts/Games/RhythmTweezers/RhythmTweezers.cs +++ b/Assets/Scripts/Games/RhythmTweezers/RhythmTweezers.cs @@ -274,7 +274,7 @@ namespace HeavenStudio.Games public override void OnPlay(double beat) { crHandlerInstance = null; - PersistColor(beat); + PersistBlocks(beat); } private void OnDestroy() @@ -562,15 +562,18 @@ namespace HeavenStudio.Games } //call this in OnPlay(double beat) and OnGameSwitch(double beat) - private void PersistColor(double beat) + private void PersistBlocks(double beat) { - var allEventsBeforeBeat = EventCaller.GetAllInGameManagerList("rhythmTweezers", new string[] { "fade background color" }).FindAll(x => x.beat < beat); - if (allEventsBeforeBeat.Count > 0) + var allEventsBeforeBeat = GameManager.instance.Beatmap.Entities.FindAll(x => x.datamodel.Split('/')[0] == "rhythmTweezers" && x.beat < beat); + var allColorEventsBeforeBeat = allEventsBeforeBeat.FindAll(x => x.datamodel == "rhythmTweezers/fade background color"); + if (allColorEventsBeforeBeat.Count > 0) { - allEventsBeforeBeat.Sort((x, y) => x.beat.CompareTo(y.beat)); //just in case - var lastEvent = allEventsBeforeBeat[^1]; + allColorEventsBeforeBeat.Sort((x, y) => x.beat.CompareTo(y.beat)); //just in case + var lastEvent = allColorEventsBeforeBeat[^1]; BackgroundColor(lastEvent.beat, lastEvent.length, lastEvent["colorA"], lastEvent["colorB"], lastEvent["ease"]); } + var allAltFaceEventsBeforeBeat = allEventsBeforeBeat.FindAll(x => x.datamodel == "rhythmTweezers/altSmile"); + VegetableAnimator.SetBool("UseAltSmile", allAltFaceEventsBeforeBeat.Count % 2 == 1); } public static void PreNoPeeking(double beat, float length, int type) @@ -635,7 +638,7 @@ namespace HeavenStudio.Games queuedIntervals.Clear(); } } - PersistColor(beat); + PersistBlocks(beat); } private void ResetVegetable() diff --git a/Assets/Scripts/GlobalGameManager.cs b/Assets/Scripts/GlobalGameManager.cs index 17d4bbac2..85ebaee0c 100644 --- a/Assets/Scripts/GlobalGameManager.cs +++ b/Assets/Scripts/GlobalGameManager.cs @@ -115,7 +115,7 @@ namespace HeavenStudio Application.targetFrameRate = -1; QualitySettings.vSyncCount = 0; - QualitySettings.maxQueuedFrames = 1; + QualitySettings.maxQueuedFrames = 2; if (PersistentDataManager.gameSettings.isFullscreen) { Screen.SetResolution(Display.main.systemWidth, Display.main.systemHeight, FullScreenMode.ExclusiveFullScreen); @@ -428,21 +428,23 @@ namespace HeavenStudio public static void UpdateDiscordStatus(string details, bool editor = false, bool updateTime = false) { - if (discordDuringTesting || !Application.isEditor) - { - if (PersistentDataManager.gameSettings.discordRPCEnable) - { - try - { - DiscordRPC.DiscordRPC.UpdateActivity(editor ? "In Editor " : "Playing ", details, updateTime); - Debug.Log("Discord status updated"); - } - catch (System.Exception e) - { - Debug.Log("Discord status update failed: " + e.Message); - } - } - } + Debug.Log("Discord Rich Presence temporarily disabled"); + return; + // if (discordDuringTesting || !Application.isEditor) + // { + // if (PersistentDataManager.gameSettings.discordRPCEnable) + // { + // try + // { + // DiscordRPC.DiscordRPC.UpdateActivity(editor ? "In Editor " : "Playing ", details, updateTime); + // Debug.Log("Discord status updated"); + // } + // catch (System.Exception e) + // { + // Debug.Log("Discord status update failed: " + e.Message); + // } + // } + // } } private static void OnQuitting() @@ -453,8 +455,8 @@ namespace HeavenStudio PlayerInput.CleanUp(); Debug.Log("Clearing RIQ Cache..."); Jukebox.RiqFileHandler.ClearCache(); - Debug.Log("Closing Discord GameSDK..."); - DiscordRPC.DiscordController.instance?.Disconnect(); + // Debug.Log("Closing Discord GameSDK..."); + // DiscordRPC.DiscordController.instance?.Disconnect(); HasShutDown = true; } diff --git a/Assets/Scripts/InputSystem/ControllerTypes/InputMouse.cs b/Assets/Scripts/InputSystem/ControllerTypes/InputMouse.cs index e3813c5a7..094055487 100644 --- a/Assets/Scripts/InputSystem/ControllerTypes/InputMouse.cs +++ b/Assets/Scripts/InputSystem/ControllerTypes/InputMouse.cs @@ -91,8 +91,16 @@ namespace HeavenStudio.InputSystem public override void UpdateState() { - if (GameManager.instance == null) return; - Camera cam = GameManager.instance.CursorCam; + Camera cam; + if (GameManager.instance == null || GameManager.instance.CursorCam == null) + { + cam = Camera.main; + } + else + { + cam = GameManager.instance.CursorCam; + } + if (cam == null) return; hasFlicked = false; hasSwiped = false; diff --git a/Assets/Scripts/InputSystem/PlayerInput.cs b/Assets/Scripts/InputSystem/PlayerInput.cs index 9840b42d5..f8668236c 100644 --- a/Assets/Scripts/InputSystem/PlayerInput.cs +++ b/Assets/Scripts/InputSystem/PlayerInput.cs @@ -47,7 +47,7 @@ namespace HeavenStudio public static InputController.ControlStyles CurrentControlStyle = InputController.ControlStyles.Pad; - static List inputDevices; + static List inputDevices = new List(); public delegate InputController[] InputControllerInitializer(); @@ -121,22 +121,12 @@ namespace HeavenStudio public static InputController GetInputController(int player) { - // Needed so Keyboard works on MacOS and Linux -#if UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX - inputDevices = new List(); - if(inputDevices.Count < 1) - { - InputKeyboard keyboard = new InputKeyboard(); - keyboard.SetPlayer(1); - keyboard.InitializeController(); - inputDevices.Add(keyboard); - } -#endif //select input controller that has player field set to player //this will return the first controller that has that player number in the case of controller pairs (eg. Joy-Cons) //so such controllers should have a reference to the other controller in the pair foreach (InputController i in inputDevices) { + if (i == null) continue; if (i.GetPlayer() == player) { return i; @@ -151,21 +141,9 @@ namespace HeavenStudio //this will return the first controller that has that player number in the case of controller pairs (eg. Joy-Cons) //so such controllers should have a reference to the other controller in the pair //controller IDs are determined by connection order (the Keyboard is always first) - - - // Needed so Keyboard works on MacOS and Linux -#if UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX - inputDevices = new List(); - if(inputDevices.Count < 1) - { - InputKeyboard keyboard = new InputKeyboard(); - keyboard.SetPlayer(1); - keyboard.InitializeController(); - inputDevices.Add(keyboard); - } -#endif for (int i = 0; i < inputDevices.Count; i++) { + if (inputDevices[i] == null) continue; if (inputDevices[i].GetPlayer() == player) { return i; @@ -176,19 +154,10 @@ namespace HeavenStudio public static void UpdateInputControllers() { - // Needed so Keyboard works on MacOS and Linux -#if UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX - inputDevices = new List(); - if(inputDevices.Count < 1) - { - InputKeyboard keyboard = new InputKeyboard(); - keyboard.SetPlayer(1); - keyboard.InitializeController(); - inputDevices.Add(keyboard); - } -#endif + if (inputDevices == null) return; foreach (InputController i in inputDevices) { + if (i == null) continue; i.UpdateState(); } } diff --git a/Assets/Scripts/LevelEditor/Editor.cs b/Assets/Scripts/LevelEditor/Editor.cs index 5a954f7c9..661250671 100644 --- a/Assets/Scripts/LevelEditor/Editor.cs +++ b/Assets/Scripts/LevelEditor/Editor.cs @@ -131,6 +131,7 @@ namespace HeavenStudio.Editor public void ShowQuitPopUp(bool show) { + if (fullscreen) Fullscreen(); _confirmQuitMain.SetActive(show); SetAuthoritiveMenu(show); } @@ -167,12 +168,12 @@ namespace HeavenStudio.Editor Fullscreen(); } - if (Input.GetKeyDown(KeyCode.Delete) || Input.GetKeyDown(KeyCode.Backspace)) + if ((Input.GetKeyDown(KeyCode.Delete) || Input.GetKeyDown(KeyCode.Backspace)) && !fullscreen) { CommandManager.Instance.AddCommand(new Commands.Delete(Selections.instance.eventsSelected.Select(c => c.entity.guid).ToList())); } - if (Input.GetKey(KeyCode.LeftControl)) + if (Input.GetKey(KeyCode.LeftControl) && !fullscreen) { if (Input.GetKeyDown(KeyCode.Z)) { @@ -193,20 +194,13 @@ namespace HeavenStudio.Editor { Timeline.instance.Paste(); } - - if (Input.GetKey(KeyCode.LeftShift)) - { - if (Input.GetKeyDown(KeyCode.D)) - { - ToggleDebugCam(); - } - } } if (Input.GetKey(KeyCode.LeftControl)) { if (Input.GetKeyDown(KeyCode.N)) { + if (fullscreen) Fullscreen(); NewBTN.onClick.Invoke(); } else if (Input.GetKeyDown(KeyCode.O)) @@ -224,6 +218,14 @@ namespace HeavenStudio.Editor { SaveRemix(false); } + + if (Input.GetKey(KeyCode.LeftShift)) + { + if (Input.GetKeyDown(KeyCode.D)) + { + ToggleDebugCam(); + } + } } } #endregion @@ -247,33 +249,6 @@ namespace HeavenStudio.Editor PasteBTN.transform.GetChild(0).GetComponent().color = Color.white; else PasteBTN.transform.GetChild(0).GetComponent().color = Color.gray; - - - if (Timeline.instance.timelineState.selected && Editor.instance.canSelect) - { - /* - if (Input.GetMouseButtonUp(0)) - { - List selectedEvents = Timeline.instance.eventObjs.FindAll(c => c.selected == true && c.eligibleToMove == true); - - if (selectedEvents.Count > 0) - { - List result = new List(); - - for (int i = 0; i < selectedEvents.Count; i++) - { - //TODO: this is in LateUpdate, so this will never run! change this to something that works properly - if (!(selectedEvents[i].isCreating || selectedEvents[i].wasDuplicated)) - { - result.Add(selectedEvents[i]); - } - selectedEvents[i].OnUp(); - } - CommandManager.instance.Execute(new Commands.Move(result)); - } - } - */ - } } public static Sprite GameIcon(string name) @@ -360,6 +335,7 @@ namespace HeavenStudio.Editor { if (dialog.GetType() == typeof(RemixPropertiesDialog)) { + if (fullscreen) Fullscreen(); GlobalGameManager.ShowErrorMessage("Set Remix Properties", "Set remix properties before saving."); (dialog as RemixPropertiesDialog).SwitchPropertiesDialog(); (dialog as RemixPropertiesDialog).SetSaveOnClose(true, saveAs); @@ -431,6 +407,7 @@ namespace HeavenStudio.Editor public void LoadRemix(bool create = false) { + if (fullscreen) Fullscreen(); if (create) { GameManager.instance.NewRemix(); @@ -446,6 +423,7 @@ namespace HeavenStudio.Editor public void OpenRemix() { + if (fullscreen) Fullscreen(); var extensions = new[] { new ExtensionFilter("Heaven Studio Remix File ", new string[] { "riq" }), diff --git a/Assets/Scripts/LevelEditor/EventSelector/PropertyPrefabs/ColorPropertyPrefab.cs b/Assets/Scripts/LevelEditor/EventSelector/PropertyPrefabs/ColorPropertyPrefab.cs index 4e69b914d..69b5a16e8 100644 --- a/Assets/Scripts/LevelEditor/EventSelector/PropertyPrefabs/ColorPropertyPrefab.cs +++ b/Assets/Scripts/LevelEditor/EventSelector/PropertyPrefabs/ColorPropertyPrefab.cs @@ -20,6 +20,7 @@ namespace HeavenStudio.Editor public RectTransform ColorTable; public bool colorTableActive; public ColorPreview colorPreview; + public TMP_InputField hex; private Color _defaultColor; @@ -27,6 +28,17 @@ namespace HeavenStudio.Editor { InitProperties(propertyName, caption); + hex.onSelect.AddListener( + _ => + Editor.instance.editingInputField = true + ); + hex.onEndEdit.AddListener( + _ => + {; + Editor.instance.editingInputField = false; + } + ); + colorPreview.colorPicker.onColorChanged += _ => { parameterManager.entity[propertyName] = colorPreview.colorPicker.color; @@ -78,6 +90,7 @@ namespace HeavenStudio.Editor { ColorTable.gameObject.SetActive(false); colorTableActive = false; + Editor.instance.editingInputField = false; } } } diff --git a/Assets/Scripts/LevelEditor/RemixPropertiesDialog/PropertyPrefabs/EnumChartPropertyPrefab.cs b/Assets/Scripts/LevelEditor/RemixPropertiesDialog/PropertyPrefabs/EnumChartPropertyPrefab.cs index 9a66e55c0..89faf4049 100644 --- a/Assets/Scripts/LevelEditor/RemixPropertiesDialog/PropertyPrefabs/EnumChartPropertyPrefab.cs +++ b/Assets/Scripts/LevelEditor/RemixPropertiesDialog/PropertyPrefabs/EnumChartPropertyPrefab.cs @@ -1,14 +1,9 @@ +using UnityEngine; +using System; using System.Collections; using System.Collections.Generic; -using UnityEngine; -using UnityEngine.UI; -using System; using System.Linq; using TMPro; -using Starpelly; - -using HeavenStudio.Util; -using HeavenStudio.Editor; namespace HeavenStudio.Editor { @@ -22,9 +17,9 @@ namespace HeavenStudio.Editor { InitProperties(diag, propertyName, caption); - var enumType = type.GetType(); - var enumVals = Enum.GetValues(enumType); - var enumNames = Enum.GetNames(enumType).ToList(); + Type enumType = type.GetType(); + Array enumVals = Enum.GetValues(enumType); + List enumNames = Enum.GetNames(enumType).ToList(); // Can we assume non-holey enum? // If we can we can simplify to dropdown.value = (int) parameterManager.chart[propertyName] @@ -38,7 +33,7 @@ namespace HeavenStudio.Editor dropdown.value = selected; dropdown.onValueChanged.AddListener(_ => - parameterManager.chart[propertyName] = (int) enumVals.GetValue(dropdown.value) + parameterManager.chart[propertyName] = Enum.ToObject(enumType, (int) enumVals.GetValue(dropdown.value)) ); } diff --git a/Assets/Scripts/LevelEditor/RemixPropertiesDialog/Tabs/ChartInfoProperties.cs b/Assets/Scripts/LevelEditor/RemixPropertiesDialog/Tabs/ChartInfoProperties.cs index 05409f746..79ebc71b3 100644 --- a/Assets/Scripts/LevelEditor/RemixPropertiesDialog/Tabs/ChartInfoProperties.cs +++ b/Assets/Scripts/LevelEditor/RemixPropertiesDialog/Tabs/ChartInfoProperties.cs @@ -25,10 +25,15 @@ namespace HeavenStudio.Editor public void AddParam(RemixPropertiesDialog diag, string propertyName, object type, string caption, bool isReadOnly = false, string tooltip = "") { + if (!Minigames.propertiesModel.ContainsKey(propertyName)) + { + Debug.LogError("Property " + propertyName + " does not exist!"); + return; + } GameObject prefab = diag.IntegerP; GameObject input; - var objType = type.GetType(); + var objType = Minigames.propertiesModel[propertyName].GetType(); if (objType == typeof(EntityTypes.Integer)) { @@ -83,13 +88,13 @@ namespace HeavenStudio.Editor property.SetProperties(diag, propertyName, type, caption); break; default: - Debug.LogError("Can't make property interface of type: " + type.GetType()); + Debug.LogError("Can't make property interface of type: " + objType); return; } } else { - Debug.LogError("Can't make property interface of type: " + type.GetType()); + Debug.LogError("Can't make property interface of type: " + objType); return; } } diff --git a/Assets/Scripts/Minigames.cs b/Assets/Scripts/Minigames.cs index 7baf6cb21..13ce88788 100644 --- a/Assets/Scripts/Minigames.cs +++ b/Assets/Scripts/Minigames.cs @@ -325,6 +325,8 @@ namespace HeavenStudio { if (data.properties[prop.Key].GetType() == typeof(string)) data.properties[prop.Key] = Enum.Parse(mType, (string)data.properties[prop.Key]); + else + data.properties[prop.Key] = Enum.ToObject(mType, data.properties[prop.Key]); } // convert all JObjects to their respective types else if (data.properties[prop.Key].GetType() == typeof(Newtonsoft.Json.Linq.JObject)) diff --git a/Assets/Scripts/TitleManager.cs b/Assets/Scripts/TitleManager.cs index ad392d580..4d2a0eac6 100644 --- a/Assets/Scripts/TitleManager.cs +++ b/Assets/Scripts/TitleManager.cs @@ -141,14 +141,26 @@ namespace HeavenStudio pressAnyKeyAnim.Play("PressKeyFadeOut", 0, 0); SoundByte.PlayOneShot("ui/UIEnter"); + var nextController = newController; + var lastController = PlayerInput.GetInputController(1); + + if ((newController is InputMouse) && (lastController is not InputMouse)) + { + Debug.Log("Mouse used, selecting keyboard instead"); + nextController = controllers[0]; + } Debug.Log("Assigning controller: " + newController.GetDeviceName()); - var lastController = PlayerInput.GetInputController(1); - if (lastController != newController) + if (lastController != nextController) { + if (nextController == null) + { + Debug.Log("invalid controller, using keyboard"); + nextController = controllers[0]; + } lastController.SetPlayer(null); - newController.SetPlayer(1); - PlayerInput.CurrentControlStyle = newController.GetDefaultStyle(); + nextController.SetPlayer(1); + PlayerInput.CurrentControlStyle = nextController.GetDefaultStyle(); usingMouse = PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch; selectedDisplayIcon.SetActive(!usingMouse); @@ -157,10 +169,10 @@ namespace HeavenStudio (lastController as InputJoyshock)?.UnAssignOtherHalf(); } - if ((newController as InputJoyshock) != null) + if ((nextController as InputJoyshock) != null) { - newController.OnSelected(); - (newController as InputJoyshock)?.UnAssignOtherHalf(); + nextController.OnSelected(); + (nextController as InputJoyshock)?.UnAssignOtherHalf(); } } }