From e884e07fbe28a20e6b99487497c9f38120c50f89 Mon Sep 17 00:00:00 2001 From: 32th-System Date: Tue, 30 Jan 2024 23:45:06 +0100 Subject: [PATCH] TH125: fix #151 --- thprac/src/thprac/thprac_games_def.json | 8 +++ thprac/src/thprac/thprac_locale_def.cpp | 75 ++++++++++++++++++++++++- thprac/src/thprac/thprac_locale_def.h | 20 ++++++- thprac/src/thprac/thprac_th125.cpp | 15 +++++ 4 files changed, 116 insertions(+), 2 deletions(-) diff --git a/thprac/src/thprac/thprac_games_def.json b/thprac/src/thprac/thprac_games_def.json index d244cbc..2e5a78e 100644 --- a/thprac/src/thprac/thprac_games_def.json +++ b/thprac/src/thprac/thprac_games_def.json @@ -4699,6 +4699,14 @@ } }, + "th125": { + "namespace": "TH125", + + "glossary": { + "TH125_SPOILER_HISCORE_FIX": [ "修复了 SP 分数更新错误", "High-score fix for Spoiler scenes", "SPスコア更新バグ修正" ] + } + }, + "th128": { "namespace": "TH128", diff --git a/thprac/src/thprac/thprac_locale_def.cpp b/thprac/src/thprac/thprac_locale_def.cpp index af72bc8..6328c92 100644 --- a/thprac/src/thprac/thprac_locale_def.cpp +++ b/thprac/src/thprac/thprac_locale_def.cpp @@ -7,7 +7,7 @@ namespace THPrac { -const char* th_glossary_str[3][905] +const char* th_glossary_str[3][906] { { "", @@ -131,6 +131,7 @@ const char* th_glossary_str[3][905] "信号强度", "TH11 东方地灵殿 ~ Subterranean Animism.", "TH12.3 东方非想天则 ~ 追寻特大型人偶之谜", + "修复了 SP 分数更新错误", "TH12.5 Double Spoiler ~ 东方文花帖", "冰冻面积", "冰冻力量", @@ -1038,6 +1039,7 @@ const char* th_glossary_str[3][905] "C. Gauge", "TH11 Subterranean Animism", "TH12.3 Touhou Hisoutensoku", + "High-score fix for Spoiler scenes", "TH12.5 Double Spoiler", "Ice Area", "Ice Power", @@ -1945,6 +1947,7 @@ const char* th_glossary_str[3][905] "交信強度", "TH11 東方地霊殿 ~ Subterranean Animism.", "TH12.3 東方非想天則 ~ 超弩級ギニョルの謎を追え", + "SPスコア更新バグ修正", "TH12.5 ダブルスポイラー ~ 東方文花帖", "こおらせた\n面積", "こおりパワー", @@ -11067,6 +11070,76 @@ const th_glossary_t TH12_VENTRA_SELECT[5] } +namespace TH125 { + +const char* th_sections_str[3][4][1] +{ + { + { + "", + }, + { + "", + }, + { + "", + }, + { + "", + }, + }, + { + { + "", + }, + { + "", + }, + { + "", + }, + { + "", + }, + }, + { + { + "", + }, + { + "", + }, + { + "", + }, + { + "", + }, + }, +}; + +const uint8_t th_sections_bgm[1] +{ + 0, +}; + +const th_sections_t th_sections_cba[1][1][2] +{ + { + { }, + }, +}; + +const th_sections_t th_sections_cbt[1][2][1] +{ + { + { }, + { }, + }, +}; + +} + namespace TH128 { const char* th_sections_str[3][4][157] diff --git a/thprac/src/thprac/thprac_locale_def.h b/thprac/src/thprac/thprac_locale_def.h index c6e0598..9e861d1 100644 --- a/thprac/src/thprac/thprac_locale_def.h +++ b/thprac/src/thprac/thprac_locale_def.h @@ -131,6 +131,7 @@ enum th_glossary_t TH11_SIGNAL, TH11_TITLE, TH123_TITLE, + TH125_SPOILER_HISCORE_FIX, TH125_TITLE, TH128_ICE_AREA, TH128_ICE_POWER, @@ -917,7 +918,7 @@ enum th_glossary_t TH_WARP, }; -extern const char* th_glossary_str[3][905]; +extern const char* th_glossary_str[3][906]; extern const th_glossary_t TH_TYPE_SELECT[13]; @@ -1647,6 +1648,23 @@ extern const th_glossary_t TH12_VENTRA_SELECT[5]; } +namespace TH125 { + +enum th_sections_t : uint8_t +{ + A0000ERROR, +}; + +extern const char* th_sections_str[3][4][1]; + +extern const uint8_t th_sections_bgm[1]; + +extern const th_sections_t th_sections_cba[1][1][2]; + +extern const th_sections_t th_sections_cbt[1][2][1]; + +} + namespace TH128 { enum th_sections_t : uint8_t diff --git a/thprac/src/thprac/thprac_th125.cpp b/thprac/src/thprac/thprac_th125.cpp index b40d32f..01e9865 100644 --- a/thprac/src/thprac/thprac_th125.cpp +++ b/thprac/src/thprac/thprac_th125.cpp @@ -134,12 +134,15 @@ namespace TH125 { public: THAdvOptWnd() noexcept { + SetWndFlag(ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove); SetFade(0.8f, 0.8f); SetStyle(ImGuiStyleVar_WindowRounding, 0.0f); SetStyle(ImGuiStyleVar_WindowBorderSize, 0.0f); OnLocaleChange(); + th125_hiscore_fix.Setup(); + FpsInit(); GameplayInit(); } @@ -183,12 +186,24 @@ namespace TH125 { EndOptGroup(); } + if (BeginOptGroup()) { + if (ImGui::Checkbox(S(TH125_SPOILER_HISCORE_FIX), &mHiscoreFix)) { + th125_hiscore_fix.Toggle(mHiscoreFix); + } + + EndOptGroup(); + } + AboutOpt(); ImGui::EndChild(); ImGui::SetWindowFocus(); } adv_opt_ctx mOptCtx; + + PATCH_ST(th125_hiscore_fix, 0x42ea14, "\x90\x90\x90\x90\x90\x90\x90", 7); + + bool mHiscoreFix = false; }; bool UpdateAdvOptWindow() {