diff --git a/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs b/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs index 9fec4153c..5b3d886b4 100644 --- a/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs +++ b/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs @@ -11,7 +11,6 @@ using DG.Tweening; using HeavenStudio.Util; using HeavenStudio.Editor.Track; using System.Text; -using System.Configuration; namespace HeavenStudio.Editor { @@ -278,26 +277,16 @@ namespace HeavenStudio.Editor void SortAlphabet(List mgs) { - var alph = mgs.OrderBy(AlphabetSortKey).ToList(); - - for (int i = 0; i < alph.Count; i++) { - alph[i].SetSiblingIndex(i + fxActive.Count + 1); + for (int i = 0; i < mgsActive.Count; i++) { + mgs[i].SetSiblingIndex(i + fxActive.Count + 1); } } - string AlphabetSortKey(RectTransform minigame) - { - var mg = EventCaller.instance.GetMinigame(minigame.name); - if (mg.displayName.StartsWith("the ", System.StringComparison.InvariantCultureIgnoreCase)) - return mg.displayName[4..]; - else - return mg.displayName; - } // if there are no favorites, the games will sort alphabetically void SortFavorites(List allMgs) { - var favs = allMgs.FindAll(mg => mg.GetComponent().StarActive).OrderBy(AlphabetSortKey).ToList(); - var mgs = allMgs.FindAll(mg => !mg.GetComponent().StarActive).OrderBy(AlphabetSortKey).ToList(); + var favs = allMgs.FindAll(mg => mg.GetComponent().StarActive); + var mgs = allMgs.FindAll(mg => !mg.GetComponent().StarActive); if (Input.GetKey(KeyCode.LeftShift)) { foreach (var fav in favs) @@ -315,13 +304,7 @@ namespace HeavenStudio.Editor void SortChronologic(List mgs) { - - var chrono = mgs.OrderBy(MainSeriesSortKey).ThenBy(ChronologicSortKey).ThenBy(AlphabetSortKey).ToList(); - - for (int i = 0; i < chrono.Count; i++) { - chrono[i].SetSiblingIndex(i + fxActive.Count + 1); - } - /*var systems = new List[] { + var systems = new List[] { new List(), new List(), new List(), @@ -357,46 +340,7 @@ namespace HeavenStudio.Editor system[i].SetSiblingIndex(j); j++; } - }*/ - } - int MainSeriesSortKey(RectTransform minigame) - { - var mg = EventCaller.instance.GetMinigame(minigame.name); - if (mg.tags.Count > 0) - { - return mg.tags[0] switch - { - "agb" or "ntr" or "rvl" or "ctr" => 0, - _ => 1, - }; } - - return 1; - } - uint ChronologicSortKey(RectTransform minigame) - { - var mg = EventCaller.instance.GetMinigame(minigame.name); - if (mg.chronologicalSortKey is uint i) - return i; - - if (mg.tags.Count > 0) - { - switch (mg.tags[0]) - { - case "agb": - return 0608039999; - case "ntr": - return 0807319999; - case "rvl": - return 1107219999; - case "ctr": - return 1506119999; - default: - return 2401159999; - } - } - - return uint.MaxValue; } public void Search() diff --git a/Assets/Scripts/Minigames.cs b/Assets/Scripts/Minigames.cs index 832ec498b..bda685143 100644 --- a/Assets/Scripts/Minigames.cs +++ b/Assets/Scripts/Minigames.cs @@ -368,8 +368,6 @@ namespace HeavenStudio public bool fxOnly; public List actions = new List(); - public uint? chronologicalSortKey; - public List tags; public string defaultLocale = "en"; public string wantAssetBundle = null; @@ -403,7 +401,7 @@ namespace HeavenStudio set => soundSequences = value; } - public Minigame(string name, string displayName, string color, bool hidden, bool fxOnly, List actions, List tags = null, string wantAssetBundle = null, string defaultLocale = "en", List supportedLocales = null, bool inferred = false, uint? chronologicalSortKey = null) + public Minigame(string name, string displayName, string color, bool hidden, bool fxOnly, List actions, List tags = null, string wantAssetBundle = null, string defaultLocale = "en", List supportedLocales = null, bool inferred = false) { this.name = name; this.displayName = displayName; @@ -420,8 +418,6 @@ namespace HeavenStudio this.splitColorL = null; this.splitColorR = null; - - this.chronologicalSortKey = chronologicalSortKey; } public Minigame(string name, string displayName, string color, string splitColorL, string splitColorR, bool hidden, bool fxOnly, List actions, List tags = null, string wantAssetBundle = null, string defaultLocale = "en", List supportedLocales = null, bool inferred = false)