1
0
mirror of synced 2025-02-06 14:24:21 +01:00

0.6.0.34 - Support for custom song unlockable text, no longer display ??? as unlockable message for Epic rarity assets

- Support for custom song unlockable text
- No longer display "???" as unlockable message for Epic rarity assets
This commit is contained in:
0auBSQ 2025-01-05 23:50:37 +09:00
parent 76303955b8
commit 1d154683a2
4 changed files with 28 additions and 43 deletions

View File

@ -40,6 +40,7 @@ internal class DBSongUnlockables : CSavableT<Dictionary<string, SongUnlockable>>
su.unlockConditions.Values = JsonConvert.DeserializeObject<int[]>((string)reader["UnlockValues"]) ?? new int[] { 0 };
su.unlockConditions.Type = (string)reader["UnlockType"];
su.unlockConditions.Reference = JsonConvert.DeserializeObject<string[]>((string)reader["UnlockReferences"]) ?? new string[] { "" };
su.customUnlockText = JsonConvert.DeserializeObject<CLocalizationData>((string)reader["CustomUnlockText"]) ?? new CLocalizationData();
data[((string)reader["SongUniqueId"])] = su;
}
@ -56,6 +57,13 @@ internal class DBSongUnlockables : CSavableT<Dictionary<string, SongUnlockable>>
[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) {

View File

@ -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);
}
}

View File

@ -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;