diff --git a/OpenTaiko/Databases/SongUnlockables.db3 b/OpenTaiko/Databases/SongUnlockables.db3 index 3d7c44d7..91f45d99 100644 Binary files a/OpenTaiko/Databases/SongUnlockables.db3 and b/OpenTaiko/Databases/SongUnlockables.db3 differ diff --git a/OpenTaiko/src/Databases/DBSongUnlockables.cs b/OpenTaiko/src/Databases/DBSongUnlockables.cs index 1e3a52c9..83b013fb 100644 --- a/OpenTaiko/src/Databases/DBSongUnlockables.cs +++ b/OpenTaiko/src/Databases/DBSongUnlockables.cs @@ -40,6 +40,7 @@ internal class DBSongUnlockables : CSavableT> su.unlockConditions.Values = JsonConvert.DeserializeObject((string)reader["UnlockValues"]) ?? new int[] { 0 }; su.unlockConditions.Type = (string)reader["UnlockType"]; su.unlockConditions.Reference = JsonConvert.DeserializeObject((string)reader["UnlockReferences"]) ?? new string[] { "" }; + su.customUnlockText = JsonConvert.DeserializeObject((string)reader["CustomUnlockText"]) ?? new CLocalizationData(); data[((string)reader["SongUniqueId"])] = su; } @@ -56,6 +57,13 @@ internal class DBSongUnlockables : CSavableT> [JsonProperty("UnlockCondition")] public DBUnlockables.CUnlockConditions unlockConditions; + + [JsonProperty("CustomUnlockText")] + public CLocalizationData customUnlockText; + + public string GetUnlockMessage() { + return customUnlockText.GetString(unlockConditions.tConditionMessage(DBUnlockables.CUnlockConditions.EScreen.SongSelect)); + } } public void tGetUnlockedItems(int _player, ModalQueue mq) { diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelect曲リスト.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelect曲リスト.cs index b247fc71..b35d17c7 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelect曲リスト.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelect曲リスト.cs @@ -2069,7 +2069,7 @@ internal class CActSelect曲リスト : CActivity { var searchType = TitleTextureKey.ResolveTitleTexture(searchTypeKey); var searchText = TitleTextureKey.ResolveTitleTexture(searchTextKey); - searchType?.tUpdateColor4(_contextVars[0] != 0 ? new Color4(0.5f, 0.5f, 0.5f, 1.0f) : new Color4(1.0f, 1.0f ,1.0f ,1.0f)); + searchType?.tUpdateColor4(_contextVars[0] != 0 ? new Color4(0.5f, 0.5f, 0.5f, 1.0f) : new Color4(1.0f, 1.0f, 1.0f, 1.0f)); searchText?.tUpdateColor4(_contextVars[0] != 1 ? new Color4(0.5f, 0.5f, 0.5f, 1.0f) : new Color4(1.0f, 1.0f, 1.0f, 1.0f)); if (_contextVars[0] == 0) @@ -2139,23 +2139,20 @@ internal class CActSelect曲リスト : CActivity { } } - } - else if (emc == eMenuContext.SearchByText) { + } else if (emc == eMenuContext.SearchByText) { if (_contextVars[0] == 0) { OpenTaiko.Skin.soundDecideSFX.tPlay(); _contextVars[0]++; - } - else if (_contextVars[0] == 1 - && !string.IsNullOrWhiteSpace(searchTextInput.Text) - && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)) { + } else if (_contextVars[0] == 1 + && !string.IsNullOrWhiteSpace(searchTextInput.Text) + && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)) { OpenTaiko.Skin.soundDecideSFX.tPlay(); _contextVars[0]++; } if (_contextVars[0] >= 2) return true; - } - else if (emc == eMenuContext.Random) { + } else if (emc == eMenuContext.Random) { OpenTaiko.Skin.soundDecideSFX.tPlay(); _contextVars[5]++; @@ -2183,14 +2180,12 @@ internal class CActSelect曲リスト : CActivity { // Clamp values _contextVars[0] = Math.Max(0, Math.Min((int)Difficulty.Oni, _contextVars[0])); _contextVars[1] = Math.Max(1, Math.Min(13, _contextVars[1])); - } - else if (emc == eMenuContext.SearchByText) { + } else if (emc == eMenuContext.SearchByText) { if (_contextVars[0] == 0) { OpenTaiko.Skin.soundChangeSFX.tPlay(); _contextVars[1] = Math.Max(--_contextVars[1], 0); } - } - else if (emc == eMenuContext.Random) { + } else if (emc == eMenuContext.Random) { OpenTaiko.Skin.soundChangeSFX.tPlay(); _contextVars[_contextVars[5]]--; @@ -2212,14 +2207,12 @@ internal class CActSelect曲リスト : CActivity { // Clamp values _contextVars[0] = Math.Max(0, Math.Min((int)Difficulty.Oni, _contextVars[0])); _contextVars[1] = Math.Max(1, Math.Min(13, _contextVars[1])); - } - else if (emc == eMenuContext.SearchByText) { + } else if (emc == eMenuContext.SearchByText) { if (_contextVars[0] == 0) { OpenTaiko.Skin.soundChangeSFX.tPlay(); _contextVars[1] = Math.Min(++_contextVars[1], 2); } - } - else if (emc == eMenuContext.Random) { + } else if (emc == eMenuContext.Random) { OpenTaiko.Skin.soundChangeSFX.tPlay(); _contextVars[_contextVars[5]]++; @@ -2636,10 +2629,7 @@ internal class CActSelect曲リスト : CActivity { if (IsSongLocked) { var SongUnlockable = OpenTaiko.Databases.DBSongUnlockables.tGetUnlockableByUniqueId(rCurrentlySelectedSong); if (SongUnlockable != null) { - string _cond = "???"; - if (HRarity.tRarityToModalInt(SongUnlockable.rarity) - < HRarity.tRarityToModalInt("Epic")) - _cond = SongUnlockable.unlockConditions.tConditionMessage(DBUnlockables.CUnlockConditions.EScreen.SongSelect); + string _cond = SongUnlockable.GetUnlockMessage(); this.ttkNowUnlockConditionText = new TitleTextureKey(_cond, this.pfBoxText, Color.White, Color.Black, 1000); } } diff --git a/OpenTaiko/src/Stages/11.Heya/CStageHeya.cs b/OpenTaiko/src/Stages/11.Heya/CStageHeya.cs index 8c441fc5..c6404bd5 100644 --- a/OpenTaiko/src/Stages/11.Heya/CStageHeya.cs +++ b/OpenTaiko/src/Stages/11.Heya/CStageHeya.cs @@ -557,10 +557,8 @@ class CStageHeya : CStage { if (this.tMove(-1)) { OpenTaiko.Skin.soundChangeSFX.tPlay(); } - } - else if (iCurrentMenu != CurrentMenu.Name && (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Decide))) - { + } else if (iCurrentMenu != CurrentMenu.Name && (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Decide))) { #region [Decide] @@ -578,8 +576,7 @@ class CStageHeya : CStage { if (iCurrentMenu == CurrentMenu.Puchi) { this.tUpdateUnlockableTextChara(); this.tUpdateUnlockableTextPuchi(); - } - else if (iCurrentMenu == CurrentMenu.Name) { + } else if (iCurrentMenu == CurrentMenu.Name) { textInput.Text = OpenTaiko.SaveFileInstances[iPlayer].data.Name; } } else if (iCurrentMenu == CurrentMenu.Puchi) { @@ -688,10 +685,8 @@ class CStageHeya : CStage { OpenTaiko.Skin.SoundBanapas.tPlay(); // To change with a more appropriate sfx sooner or later #endregion - } - else if (iCurrentMenu != CurrentMenu.Name && (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Cancel))) - { + } else if (iCurrentMenu != CurrentMenu.Name && (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Cancel))) { OpenTaiko.Skin.soundCancelSFX.tPlay(); @@ -708,8 +703,7 @@ class CStageHeya : CStage { return 0; - } - else if (iCurrentMenu == CurrentMenu.Name && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)) { + } else if (iCurrentMenu == CurrentMenu.Name && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)) { OpenTaiko.SaveFileInstances[iPlayer].data.Name = textInput.Text; OpenTaiko.SaveFileInstances[iPlayer].tApplyHeyaChanges(); OpenTaiko.NamePlate.tNamePlateRefreshTitles(iPlayer); @@ -718,8 +712,7 @@ class CStageHeya : CStage { this.tResetOpts(); OpenTaiko.Skin.soundDecideSFX.tPlay(); return 0; - } - else if (iCurrentMenu == CurrentMenu.Name && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) { + } else if (iCurrentMenu == CurrentMenu.Name && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) { OpenTaiko.Skin.soundCancelSFX.tPlay(); iCurrentMenu = CurrentMenu.ReturnToMenu; this.ttkInfoSection = null; @@ -889,10 +882,7 @@ class CStageHeya : CStage { if (OpenTaiko.Tx.Characters[iCharacterCurrent].unlock != null && !OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedCharacters.Contains(OpenTaiko.Skin.Characters_DirName[iCharacterCurrent])) { - string _cond = "???"; - if (HRarity.tRarityToModalInt(OpenTaiko.Tx.Characters[iCharacterCurrent].metadata.Rarity) - < HRarity.tRarityToModalInt("Epic")) - _cond = OpenTaiko.Tx.Characters[iCharacterCurrent].unlock.tConditionMessage(); + string _cond = OpenTaiko.Tx.Characters[iCharacterCurrent].unlock.tConditionMessage(); this.ttkInfoSection = new TitleTextureKey(_cond, this.pfHeyaFont, Color.White, Color.Black, 1000); } else this.ttkInfoSection = null; @@ -929,10 +919,7 @@ class CStageHeya : CStage { if (OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].unlock != null && !OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedPuchicharas.Contains(OpenTaiko.Skin.Puchicharas_Name[iPuchiCharaCurrent])) { - string _cond = "???"; - if (HRarity.tRarityToModalInt(OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].metadata.Rarity) - < HRarity.tRarityToModalInt("Epic")) - _cond = OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].unlock.tConditionMessage(); + string _cond = OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].unlock.tConditionMessage(); this.ttkInfoSection = new TitleTextureKey(_cond, this.pfHeyaFont, Color.White, Color.Black, 1000); } else this.ttkInfoSection = null;