Skip to content

Commit

Permalink
TH125: fix #151
Browse files Browse the repository at this point in the history
  • Loading branch information
32th-System committed Jan 30, 2024
1 parent 73dc47e commit e884e07
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 2 deletions.
8 changes: 8 additions & 0 deletions thprac/src/thprac/thprac_games_def.json
Original file line number Diff line number Diff line change
Expand Up @@ -4699,6 +4699,14 @@
}
},

"th125": {
"namespace": "TH125",

"glossary": {
"TH125_SPOILER_HISCORE_FIX": [ "修复了 SP 分数更新错误", "High-score fix for Spoiler scenes", "SPスコア更新バグ修正" ]
}
},

"th128": {

"namespace": "TH128",
Expand Down
75 changes: 74 additions & 1 deletion thprac/src/thprac/thprac_locale_def.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace THPrac {

const char* th_glossary_str[3][905]
const char* th_glossary_str[3][906]
{
{
"",
Expand Down Expand Up @@ -131,6 +131,7 @@ const char* th_glossary_str[3][905]
"信号强度",
"TH11 东方地灵殿 ~ Subterranean Animism.",
"TH12.3 东方非想天则 ~ 追寻特大型人偶之谜",
"修复了 SP 分数更新错误",
"TH12.5 Double Spoiler ~ 东方文花帖",
"冰冻面积",
"冰冻力量",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -1945,6 +1947,7 @@ const char* th_glossary_str[3][905]
"交信強度",
"TH11 東方地霊殿 ~ Subterranean Animism.",
"TH12.3 東方非想天則 ~ 超弩級ギニョルの謎を追え",
"SPスコア更新バグ修正",
"TH12.5 ダブルスポイラー ~ 東方文花帖",
"こおらせた\n面積",
"こおりパワー",
Expand Down Expand Up @@ -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]
Expand Down
20 changes: 19 additions & 1 deletion thprac/src/thprac/thprac_locale_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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];

Expand Down Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions thprac/src/thprac/thprac_th125.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -183,12 +186,24 @@ namespace TH125 {
EndOptGroup();
}

if (BeginOptGroup<TH18_BUG_FIX>()) {
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()
{
Expand Down

0 comments on commit e884e07

Please sign in to comment.