Skip to content

Commit

Permalink
0.6.0.40 - Force kusudamas into regular balloons in Training Mode (#785)
Browse files Browse the repository at this point in the history
- Force all kusudamas to regular balloon in training mode
  • Loading branch information
DragonRatTiger authored Jan 31, 2025
1 parent ab94adc commit 506e98f
Show file tree
Hide file tree
Showing 7 changed files with 166 additions and 27 deletions.
4 changes: 2 additions & 2 deletions OpenTaiko/src/Common/CSkin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2451,7 +2451,7 @@ void ParseInt32(Action<int> setValue) {
case "SongSelect_Difficulty_Star_Interval": {
string[] strSplit = strParam.Split(',');
for (int i = 0; i < 2; i++) {
SongSelect_Difficulty_Star_Interval[i] = int.Parse(strSplit[i]);
SongSelect_Difficulty_Star_Interval[i] = double.Parse(strSplit[i]);
}
break;
}
Expand Down Expand Up @@ -8111,7 +8111,7 @@ public enum ReferencePoint //テクスチャ描画の基準点を変更可能に

public int[] SongSelect_Difficulty_Star_X = new int[] { 444, 587, 730, 873, 873 };
public int[] SongSelect_Difficulty_Star_Y = new int[] { 459, 459, 459, 459, 459 };
public int[] SongSelect_Difficulty_Star_Interval = new int[] { 10, 0 };
public double[] SongSelect_Difficulty_Star_Interval = new double[] { 10, 0 };

public int[] SongSelect_Difficulty_Number_X = new int[] { 498, 641, 784, 927, 927, 927, 927 };
public int[] SongSelect_Difficulty_Number_Y = new int[] { 435, 435, 435, 435, 435, 435, 435 };
Expand Down
165 changes: 147 additions & 18 deletions OpenTaiko/src/Common/ImGuiDebugWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,34 @@ private static void Profile() {
ImGui.TextColored(new System.Numerics.Vector4(0.4f, 0.8f, 1.0f, 1.0f), "2P is occupied. AI Battle is active.");

ImGui.Text($"ID: {OpenTaiko.SaveFileInstances[save].data.SaveId}");
ImGui.InputText("Name", ref OpenTaiko.SaveFileInstances[save].data.Name, 64);
ImGui.InputText($"Name###NAME{i}", ref OpenTaiko.SaveFileInstances[save].data.Name, 64);

if (ImGui.Button("Update###UPDATE_PROFILE")) {
if (ImGui.Button($"Update###UPDATE_PROFILE{i}")) {
OpenTaiko.SaveFileInstances[save].tApplyHeyaChanges();
OpenTaiko.NamePlate.tNamePlateRefreshTitles(save);
}

string preview = OpenTaiko.SaveFileInstances[save].data.TitleId == -1 ? "初心者" : OpenTaiko.Databases.DBNameplateUnlockables.data[OpenTaiko.SaveFileInstances[save].data.TitleId].nameplateInfo.cld.GetString("");
string preview = OpenTaiko.SaveFileInstances[save].data.Title;

if (ImGui.BeginCombo("Nameplate", preview)) {
if (ImGui.BeginCombo($"Nameplate###NAMEPLATE{i}", preview)) {
if (ImGui.Selectable("(Clear Title)")) {
OpenTaiko.SaveFileInstances[save].data.TitleId = -1;
OpenTaiko.SaveFileInstances[save].data.Title = "";
OpenTaiko.SaveFileInstances[save].data.TitleRarityInt = 1;
OpenTaiko.SaveFileInstances[save].data.TitleType = 0;

OpenTaiko.SaveFileInstances[save].tApplyHeyaChanges();
OpenTaiko.NamePlate.tNamePlateRefreshTitles(save);
}
if (ImGui.Selectable("初心者")) {
OpenTaiko.SaveFileInstances[save].data.TitleId = -1;
OpenTaiko.SaveFileInstances[save].data.Title = "初心者";
OpenTaiko.SaveFileInstances[save].data.TitleRarityInt = 1;
OpenTaiko.SaveFileInstances[save].data.TitleType = 0;

OpenTaiko.SaveFileInstances[save].tApplyHeyaChanges();
OpenTaiko.NamePlate.tNamePlateRefreshTitles(save);
}
foreach (long id in OpenTaiko.Databases.DBNameplateUnlockables.data.Keys) {
bool unlocked = OpenTaiko.SaveFileInstances[save].data.UnlockedNameplateIds.Contains((int)id);

Expand All @@ -201,24 +219,41 @@ private static void Profile() {
ImGui.EndCombo();
}

if (ImGui.TreeNodeEx("Edit Nameplate")) {
if (ImGui.TreeNodeEx($"Edit Nameplate###EDIT_NAMEPLATE{i}")) {

ImGui.InputInt("Title Id", ref OpenTaiko.SaveFileInstances[save].data.TitleId);
ImGui.InputInt($"Title Id###TITLE_ID{i}", ref OpenTaiko.SaveFileInstances[save].data.TitleId);

ImGui.InputText("Title", ref OpenTaiko.SaveFileInstances[save].data.Title, 1024);
ImGui.InputText($"Title###TITLE{i}", ref OpenTaiko.SaveFileInstances[save].data.Title, 1024);

ImGui.InputInt("Title Rarity", ref OpenTaiko.SaveFileInstances[save].data.TitleRarityInt);
ImGui.InputInt($"Title Rarity###TITLE_RARITY{i}", ref OpenTaiko.SaveFileInstances[save].data.TitleRarityInt);

ImGui.InputInt("Title Type", ref OpenTaiko.SaveFileInstances[save].data.TitleType);
ImGui.InputInt($"Title Type###TITLE_TYPE{i}", ref OpenTaiko.SaveFileInstances[save].data.TitleType);

if (ImGui.Button("Update###UPDATE_NAMEPLATE")) {
if (ImGui.Button($"Update###UPDATE_NAMEPLATE{i}")) {
OpenTaiko.SaveFileInstances[save].tApplyHeyaChanges();
OpenTaiko.NamePlate.tNamePlateRefreshTitles(save);
}
ImGui.TreePop();
}

if (ImGui.BeginCombo("Dan Title", OpenTaiko.SaveFileInstances[save].data.Dan)) {
if (ImGui.BeginCombo($"Dan Title###DAN_TITLE{i}", OpenTaiko.SaveFileInstances[save].data.Dan)) {
if (ImGui.Selectable("(Clear Dan)")) {
OpenTaiko.SaveFileInstances[save].data.Dan = "";
OpenTaiko.SaveFileInstances[save].data.DanGold = false;
OpenTaiko.SaveFileInstances[save].data.DanType = 0;

OpenTaiko.SaveFileInstances[save].tApplyHeyaChanges();
OpenTaiko.NamePlate.tNamePlateRefreshTitles(save);
}
if (ImGui.Selectable("新人")) {
OpenTaiko.SaveFileInstances[save].data.Dan = "新人";
OpenTaiko.SaveFileInstances[save].data.DanGold = false;
OpenTaiko.SaveFileInstances[save].data.DanType = 0;

OpenTaiko.SaveFileInstances[save].tApplyHeyaChanges();
OpenTaiko.NamePlate.tNamePlateRefreshTitles(save);

}
foreach (var dan in OpenTaiko.SaveFileInstances[save].data.DanTitles) {
if (ImGui.Selectable(dan.Key)) {
OpenTaiko.SaveFileInstances[save].data.Dan = dan.Key;
Expand All @@ -233,28 +268,50 @@ private static void Profile() {
ImGui.EndCombo();
}

if (ImGui.TreeNodeEx("Edit Dan Title")) {
if (ImGui.TreeNodeEx($"Edit Dan Title###EDIT_DAN_TITLE{i}")) {

ImGui.InputText("Title", ref OpenTaiko.SaveFileInstances[save].data.Dan, 16);
ImGui.InputText($"Title###DAN_TITLE{i}", ref OpenTaiko.SaveFileInstances[save].data.Dan, 16);

ImGui.Checkbox("Gold", ref OpenTaiko.SaveFileInstances[save].data.DanGold);
ImGui.Checkbox($"Gold###DAN_GOLD{i}", ref OpenTaiko.SaveFileInstances[save].data.DanGold);

string[] clear_types = ["Clear", "FC", "Perfect"];
int clear_int = OpenTaiko.SaveFileInstances[save].data.DanType;
if (ImGui.BeginCombo("Clear Type", clear_types[clear_int])) {
if (ImGui.BeginCombo($"Clear Type###CLEAR_TYPE{i}", clear_types[clear_int])) {
for (int clear = 0; clear < clear_types.Length; clear++) {
if (ImGui.Selectable(clear_types[clear], clear_int == clear)) OpenTaiko.SaveFileInstances[save].data.DanType = clear;
}
ImGui.EndCombo();
}

if (ImGui.Button("Update###UPDATE_DAN")) {
if (ImGui.Button($"Update###UPDATE_DAN{i}")) {
OpenTaiko.SaveFileInstances[save].tApplyHeyaChanges();
OpenTaiko.NamePlate.tNamePlateRefreshTitles(save);
}
ImGui.TreePop();
}


int current_chara = OpenTaiko.SaveFileInstances[save].data.Character;
if (OpenTaiko.rCurrentStage.eStageID == CStage.EStage.StartUp) {
ImGui.TextDisabled("Character selection unavailable during StartUp stage.");
}
else if (ImGui.BeginCombo($"Select Character###SELECT_CHARACTER{i}", OpenTaiko.Tx.Characters[current_chara].metadata.tGetName())) {
for (int chara = 0; chara < OpenTaiko.Tx.Characters.Length; chara++) {
if (ImGui.Selectable(OpenTaiko.Tx.Characters[chara].metadata.tGetName(), current_chara == chara)) {
OpenTaiko.Tx.ReloadCharacter(current_chara, chara, save);
OpenTaiko.SaveFileInstances[save].data.Character = chara;

OpenTaiko.SaveFileInstances[save].tUpdateCharacterName(OpenTaiko.Skin.Characters_DirName[chara]);
OpenTaiko.Skin.voiceTitleSanka[save]?.tPlay();
foreach (var animation in Enum.GetValues<CMenuCharacter.ECharacterAnimation>()) {
CMenuCharacter.tMenuResetTimer(animation);
}
OpenTaiko.SaveFileInstances[save].tApplyHeyaChanges();
}
}
ImGui.EndCombo();
}

ImGui.NewLine();

ImGui.Text($"Total Plays: {OpenTaiko.SaveFileInstances[save].data.TotalPlaycount}");
Expand All @@ -275,6 +332,64 @@ private static void Stage() {
System.Numerics.Vector4 normal = new System.Numerics.Vector4(1, 1, 1, 1);
System.Numerics.Vector4 diff = new System.Numerics.Vector4(0.5f, 1, 0.5f, 1);

if (OpenTaiko.rCurrentStage.eStageID == CStage.EStage.SongSelect && ImGui.TreeNodeEx("Current Song", ImGuiTreeNodeFlags.Framed)) {
if (OpenTaiko.stageSongSelect.actSongList.rCurrentlySelectedSong != null) {
CSongListNode song = OpenTaiko.stageSongSelect.actSongList.rCurrentlySelectedSong;

ImGui.Text($"Index: {OpenTaiko.stageSongSelect.actSongList.nSelectSongIndex}");
ImGui.Text($"Open Index: {song.Openindex}");
ImGui.Text($"Is Root: {song.rParentNode == null}");
ImGui.NewLine();
ImGui.Text("Title: " + song.ldTitle.GetString("???"));
ImGui.Text("Node Type: " + song.nodeType);
if (song.nodeType == CSongListNode.ENodeType.SCORE) {
if (ImGui.TreeNodeEx("Song Info")) {
for (int i = 0; i < song.nLevel.Count(); i++) {
if (song.nLevel[i] != -1) ImGui.Text($"{(Difficulty)i}: {song.nLevel[i]}");
}
if (song.nLevel[(int)Difficulty.Dan] != -1) {
if (ImGui.TreeNodeEx("Dan Songs")) {
for (int j = 0; j < song.DanSongs.Count; j++) {
var dan_song = song.DanSongs[j];
Vector4 is_hidden = dan_song.bTitleShow ? new(1, 0.5f, 1, 1) : new(1);
ImGui.TextColored(is_hidden, $"Song {j+1}: {dan_song.Title}{(dan_song.bTitleShow ? " (Hidden)" : "")}");
ImGui.Indent();
ImGui.TextColored(is_hidden, $"Difficulty: {(Difficulty)dan_song.Difficulty}");
ImGui.TextColored(is_hidden, $"Level: {dan_song.Level}");
ImGui.TextColored(is_hidden, $"Subtitle: {dan_song.SubTitle}");
ImGui.TextColored(is_hidden, $"Genre: {dan_song.Genre}");
if (ImGui.TreeNodeEx($"Dan_C###DAN_C{j}")) {
for (int i = 0; i < dan_song.Dan_C.Length; i++) {
if (dan_song.Dan_C[i] != null) {
var dan_c = dan_song.Dan_C[i];
ImGui.Text($"Exam {i+1}: {dan_c.GetExamType()} ({dan_c.GetExamRange()} - {dan_c.GetValue(false)} - {dan_c.GetValue(true)})");
}
else
ImGui.TextDisabled($"Exam {i+1}: null");
}
ImGui.TreePop();
}
ImGui.Unindent();
}
ImGui.TreePop();
}
}
if (song.nLevel[(int)Difficulty.Tower] != -1) {
ImGui.Text($"Side: {song.nSide}");
ImGui.Text($"Floor Count: {song.score[5]?.譜面情報.nTotalFloor.ToString() ?? "???"}");
ImGui.Text($"Life: {song.score[5]?.譜面情報.nLife.ToString() ?? "?"}");
}
ImGui.TreePop();
}
}
ImGui.NewLine();
}
else {
ImGui.TextDisabled("Current Song is null. How is this possible...?");
}
ImGui.TreePop();
}

ImGui.TextColored(OpenTaiko.ConfigIni.SongPlaybackSpeed == 1 ? normal : diff,
String.Format("Song Playback Speed: {0:0.00}", OpenTaiko.ConfigIni.SongPlaybackSpeed));

Expand Down Expand Up @@ -331,6 +446,19 @@ private static void Stage() {
}
break;
case CStage.EStage.Game:
if (OpenTaiko.ConfigIni.bAIBattleMode) {
int level = OpenTaiko.ConfigIni.nAILevel - 1;
ImGui.TextColored(new(0.5f, 1, 1, 1), "AI Battle is Active.");
ImGui.Text("AI Level: " + (level+1));
ImGui.Indent();
ImGui.Text("Current AI Performance:");
ImGui.Text($"Good: {OpenTaiko.ConfigIni.apAIPerformances[level].nPerfectOdds}/1000 ({OpenTaiko.ConfigIni.apAIPerformances[level].nPerfectOdds / 10.0}%)");
ImGui.Text($"Ok: {OpenTaiko.ConfigIni.apAIPerformances[level].nGoodOdds}/1000 ({OpenTaiko.ConfigIni.apAIPerformances[level].nGoodOdds / 10.0}%)");
ImGui.Text($"Bad: {OpenTaiko.ConfigIni.apAIPerformances[level].nBadOdds}/1000 ({OpenTaiko.ConfigIni.apAIPerformances[level].nBadOdds / 10.0}%)");
ImGui.Text($"Mine: {OpenTaiko.ConfigIni.apAIPerformances[level].nMineHitOdds}/1000 ({OpenTaiko.ConfigIni.apAIPerformances[level].nMineHitOdds / 10.0}%)");
ImGui.Text($"Roll Speed: {OpenTaiko.ConfigIni.apAIPerformances[level].nRollSpeed}/s");
ImGui.Unindent();
}
for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) {
if (ImGui.TreeNodeEx($"Player {i + 1}###GAME_CHART_{i}", ImGuiTreeNodeFlags.Framed)) {

Expand Down Expand Up @@ -420,9 +548,10 @@ private static void Textures() {

#region Script.lua Memory Usage
int index = 0;
foreach (CLuaScript luascript in CLuaScript.listScripts)
foreach (CLuaScript luascript in CLuaScript.listScripts) {
currentStageMemoryUsage += CTextureListPopup(luascript.listDisposables.OfType<CTexture>(),
$"Module #{index}", $"MODULE{index++}_TEXTURES");
$"Module #{index}", $"MODULE{index++}_TEXTURES");
}

switch (OpenTaiko.rCurrentStage.eStageID) {
#region Game
Expand Down
4 changes: 3 additions & 1 deletion OpenTaiko/src/Songs/CTja.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4956,7 +4956,9 @@ private void InsertNoteAtDefCursor(int noteType, int iDiv, int divsPerMeasure, E
chip.bGOGOTIME = this.bGOGOTIME;

if (NotesManager.IsKusudama(chip)) {
if (IsEndedBranching) {
if (OpenTaiko.ConfigIni.bTokkunMode) {
chip.nChannelNo = 0x17; // Placeholder until kusudama visuals can be fixed in training mode
} else if (IsEndedBranching) {
} else {
// Balloon in branches
chip.nChannelNo = 0x19;
Expand Down
8 changes: 8 additions & 0 deletions OpenTaiko/src/Stages/04.Config/CActConfigList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,14 @@ public override void DeActivate() {
}
#endregion

for (int i = 0; i < OpenTaiko.MAX_PLAYERS; i++) {
int id = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(i)].data.TitleId;
if (id > 0) {
var title = OpenTaiko.Databases.DBNameplateUnlockables.data[id];
OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(i)].data.Title = title.nameplateInfo.cld.GetString("");
}
OpenTaiko.NamePlate.tNamePlateRefreshTitles(i);
}
// #24820 2013.1.22 yyagi CONFIGでWASAPI/ASIO/DirectSound関連の設定を変更した場合、サウンドデバイスを再構築する。
// #33689 2014.6.17 yyagi CONFIGでSoundTimerTypeの設定を変更した場合も、サウンドデバイスを再構築する。
#region [ サウンドデバイス変更 ]
Expand Down
4 changes: 2 additions & 2 deletions OpenTaiko/src/Stages/05.SongSelect/CActSelect曲リスト.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public void tResetTitleKey() {
this.ttkSelectedSongBPM = null;
}

public bool tBOXに入る() {
public bool tOpenBOX() {
//Trace.TraceInformation( "box enter" );
//Trace.TraceInformation( "Skin現在Current : " + CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) );
//Trace.TraceInformation( "Skin現在System : " + CSkin.strSystemSkinSubfolderFullName );
Expand Down Expand Up @@ -1861,7 +1861,7 @@ public override int Draw() {

if (ctBoxOpen.CurrentValue >= 1620) {
if (bBoxOpen) {
this.tBOXに入る();
this.tOpenBOX();
bBoxOpen = false;
}
if (bBoxClose) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,10 @@ public override int Draw() {
for (int g = 0; g < 10; g++) {
if (level > g + 10) {
OpenTaiko.Tx.Difficulty_Star.color4 = new Color4(1f, 0.2f, 0.2f, 1.0f);
OpenTaiko.Tx.Difficulty_Star?.t2D描画(OpenTaiko.Skin.SongSelect_Difficulty_Star_X[i] + g * OpenTaiko.Skin.SongSelect_Difficulty_Star_Interval[0], OpenTaiko.Skin.SongSelect_Difficulty_Star_Y[i] + g * OpenTaiko.Skin.SongSelect_Difficulty_Star_Interval[1]);
OpenTaiko.Tx.Difficulty_Star?.t2D描画(OpenTaiko.Skin.SongSelect_Difficulty_Star_X[i] + (int)(g * OpenTaiko.Skin.SongSelect_Difficulty_Star_Interval[0]), OpenTaiko.Skin.SongSelect_Difficulty_Star_Y[i] + (int)(g * OpenTaiko.Skin.SongSelect_Difficulty_Star_Interval[1]));
} else if (level > g) {
OpenTaiko.Tx.Difficulty_Star.color4 = new Color4(1f, 1f, 1f, 1.0f);
OpenTaiko.Tx.Difficulty_Star?.t2D描画(OpenTaiko.Skin.SongSelect_Difficulty_Star_X[i] + g * OpenTaiko.Skin.SongSelect_Difficulty_Star_Interval[0], OpenTaiko.Skin.SongSelect_Difficulty_Star_Y[i] + g * OpenTaiko.Skin.SongSelect_Difficulty_Star_Interval[1]);
OpenTaiko.Tx.Difficulty_Star?.t2D描画(OpenTaiko.Skin.SongSelect_Difficulty_Star_X[i] + (int)(g * OpenTaiko.Skin.SongSelect_Difficulty_Star_Interval[0]), OpenTaiko.Skin.SongSelect_Difficulty_Star_Y[i] + (int)(g * OpenTaiko.Skin.SongSelect_Difficulty_Star_Interval[1]));
}

}
Expand Down
4 changes: 2 additions & 2 deletions OpenTaiko/src/Stages/CActNewHeya.cs
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ private ESelectStatus tSelectPuchi() {

if (OpenTaiko.Tx.Puchichara[CurrentIndex].unlock != null
&& !OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedPuchicharas.Contains(OpenTaiko.Skin.Puchicharas_Name[CurrentIndex])) {
(bool, string?) response = OpenTaiko.Tx.Puchichara[CurrentIndex].unlock.tConditionMetWrapper(OpenTaiko.SaveFile);
(bool, string?) response = OpenTaiko.Tx.Puchichara[CurrentIndex].unlock.tConditionMetWrapper(CurrentPlayer);
//tConditionMet(
//new int[] { TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data.Medals });

Expand Down Expand Up @@ -669,7 +669,7 @@ private ESelectStatus tSelectChara() {

if (OpenTaiko.Tx.Characters[CurrentIndex].unlock != null
&& !OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedCharacters.Contains(OpenTaiko.Skin.Characters_DirName[CurrentIndex])) {
(bool, string?) response = OpenTaiko.Tx.Characters[CurrentIndex].unlock.tConditionMetWrapper(OpenTaiko.SaveFile);
(bool, string?) response = OpenTaiko.Tx.Characters[CurrentIndex].unlock.tConditionMetWrapper(CurrentPlayer);
//TJAPlayer3.Tx.Characters[iCharacterCurrent].unlock.tConditionMet(
//new int[] { TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data.Medals });

Expand Down

0 comments on commit 506e98f

Please sign in to comment.