convert jpn ui/text changes to runtime checks

This commit is contained in:
TakaRikka
2026-07-17 18:12:28 -07:00
parent 1654d256ec
commit ce386d8dbd
37 changed files with 2467 additions and 442 deletions
+121 -18
View File
@@ -23,6 +23,8 @@
#endif
#include <cstring>
#include "dusk/version.hpp"
#if TARGET_PC
void dMenu_Fmap2DBack_c::fMapBackWide() {
mpBaseScreen->scale(mDoGph_gInf_c::hudAspectScaleUp, 1.0f);
@@ -2417,7 +2419,17 @@ dMenu_Fmap2DTop_c::dMenu_Fmap2DTop_c(JKRExpHeap* i_heap, STControl* i_stick) {
static const u64 area_name[3] = {MULTI_CHAR('i_name_s'), MULTI_CHAR('i_name') ,MULTI_CHAR('i_name1')};
static const u64 farea_name[3] = {MULTI_CHAR('f_name_1'), MULTI_CHAR('f_name3'), MULTI_CHAR('f_name2')};
for (int i = 0; i < 3; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
static_cast<J2DTextBox*>(mpTitleScreen->search(area_name[i]))->setFont(mDoExt_getRubyFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(area_name[i]))->setString(0x40, "");
mpTitleScreen->search(farea_name[i])->hide();
} else {
static_cast<J2DTextBox*>(mpTitleScreen->search(farea_name[i]))->setFont(mDoExt_getRubyFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(farea_name[i]))->setString(0x40, "");
mpTitleScreen->search(area_name[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
static_cast<J2DTextBox*>(mpTitleScreen->search(area_name[i]))
->setFont(mDoExt_getRubyFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(area_name[i]))->setString(0x40, "");
@@ -2445,7 +2457,17 @@ dMenu_Fmap2DTop_c::dMenu_Fmap2DTop_c(JKRExpHeap* i_heap, STControl* i_stick) {
};
#endif
for (int i = 0; i < 7; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
static_cast<J2DTextBox*>(mpTitleScreen->search(sfont_name[i]))->setFont(mDoExt_getRubyFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(sfont_name[i]))->setString(0x40, "");
mpTitleScreen->search(ffont_name[i])->hide();
} else {
static_cast<J2DTextBox*>(mpTitleScreen->search(ffont_name[i]))->setFont(mDoExt_getRubyFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(ffont_name[i]))->setString(0x40, "");
mpTitleScreen->search(sfont_name[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
static_cast<J2DTextBox*>(mpTitleScreen->search(sfont_name[i]))
->setFont(mDoExt_getRubyFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(sfont_name[i]))->setString(0x40, "");
@@ -2462,7 +2484,17 @@ dMenu_Fmap2DTop_c::dMenu_Fmap2DTop_c(JKRExpHeap* i_heap, STControl* i_stick) {
static const u64 cont_zt[5] = {MULTI_CHAR('cont_zt'), MULTI_CHAR('cont_zt1'), MULTI_CHAR('cont_zt2'), MULTI_CHAR('cont_zt3'), MULTI_CHAR('cont_zt4')};
static const u64 font_zt[5] = {MULTI_CHAR('font_zt1'), MULTI_CHAR('font_zt2'), MULTI_CHAR('font_zt3'), MULTI_CHAR('font_zt4'), MULTI_CHAR('font_zt5')};
for (int i = 0; i < 5; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_zt[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_zt[i]))->setString(0x20, "");
mpTitleScreen->search(font_zt[i])->hide();
} else {
static_cast<J2DTextBox*>(mpTitleScreen->search(font_zt[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(font_zt[i]))->setString(0x20, "");
mpTitleScreen->search(cont_zt[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_zt[i]))
->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_zt[i]))->setString(0x20, "");
@@ -2483,7 +2515,17 @@ dMenu_Fmap2DTop_c::dMenu_Fmap2DTop_c(JKRExpHeap* i_heap, STControl* i_stick) {
static const u64 font_bt[5] = {MULTI_CHAR('font_bt1'), MULTI_CHAR('font_bt2'), MULTI_CHAR('font_bt3'), MULTI_CHAR('font_bt4'), MULTI_CHAR('font_bt5')};
#endif
for (int i = 0; i < 5; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_bt[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_bt[i]))->setString(0x20, "");
mpTitleScreen->search(font_bt[i])->hide();
} else {
static_cast<J2DTextBox*>(mpTitleScreen->search(font_bt[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(font_bt[i]))->setString(0x20, "");
mpTitleScreen->search(cont_bt[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_bt[i]))
->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_bt[i]))->setString(0x20, "");
@@ -2500,7 +2542,17 @@ dMenu_Fmap2DTop_c::dMenu_Fmap2DTop_c(JKRExpHeap* i_heap, STControl* i_stick) {
static const u64 cont_at[5] = {MULTI_CHAR('cont_at'), MULTI_CHAR('cont_at1'), MULTI_CHAR('cont_at2'), MULTI_CHAR('cont_at3'), MULTI_CHAR('cont_at4')};
static const u64 font_at[5] = {MULTI_CHAR('font_at1'), MULTI_CHAR('font_at2'), MULTI_CHAR('font_at3'), MULTI_CHAR('font_at4'), MULTI_CHAR('font_at5')};
for (int i = 0; i < 5; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_at[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_at[i]))->setString(0x20, "");
mpTitleScreen->search(font_at[i])->hide();
} else {
static_cast<J2DTextBox*>(mpTitleScreen->search(font_at[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(font_at[i]))->setString(0x20, "");
mpTitleScreen->search(cont_at[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_at[i]))
->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(cont_at[i]))->setString(0x20, "");
@@ -2518,7 +2570,17 @@ dMenu_Fmap2DTop_c::dMenu_Fmap2DTop_c(JKRExpHeap* i_heap, STControl* i_stick) {
static const u64 juji_c[5] = {MULTI_CHAR('juji_c00'), MULTI_CHAR('juji_c01'), MULTI_CHAR('juji_c02'), MULTI_CHAR('juji_c03'), MULTI_CHAR('juji_c04')};
static const u64 fuji_c[5] = {MULTI_CHAR('fuji_c00'), MULTI_CHAR('fuji_c01'), MULTI_CHAR('fuji_c02'), MULTI_CHAR('fuji_c03'), MULTI_CHAR('fuji_c04')};
for (int i = 0; i < 5; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
static_cast<J2DTextBox*>(mpTitleScreen->search(juji_c[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(juji_c[i]))->setString(0x20, "");
mpTitleScreen->search(fuji_c[i])->hide();
} else {
static_cast<J2DTextBox*>(mpTitleScreen->search(fuji_c[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(fuji_c[i]))->setString(0x20, "");
mpTitleScreen->search(juji_c[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
static_cast<J2DTextBox*>(mpTitleScreen->search(juji_c[i]))
->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(juji_c[i]))->setString(0x20, "");
@@ -2535,7 +2597,17 @@ dMenu_Fmap2DTop_c::dMenu_Fmap2DTop_c(JKRExpHeap* i_heap, STControl* i_stick) {
static const u64 ast_c[5] = {MULTI_CHAR('ast_00'), MULTI_CHAR('ast_01'), MULTI_CHAR('ast_02'), MULTI_CHAR('ast_03'), MULTI_CHAR('ast_04')};
static const u64 fst_c[5] = {MULTI_CHAR('fst_00'), MULTI_CHAR('fst_01'), MULTI_CHAR('fst_02'), MULTI_CHAR('fst_03'), MULTI_CHAR('fst_04')};
for (int i = 0; i < 5; i++) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
static_cast<J2DTextBox*>(mpTitleScreen->search(ast_c[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(ast_c[i]))->setString(0x20, "");
mpTitleScreen->search(fst_c[i])->hide();
} else {
static_cast<J2DTextBox*>(mpTitleScreen->search(fst_c[i]))->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(fst_c[i]))->setString(0x20, "");
mpTitleScreen->search(ast_c[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
static_cast<J2DTextBox*>(mpTitleScreen->search(ast_c[i]))
->setFont(mDoExt_getMesgFont());
static_cast<J2DTextBox*>(mpTitleScreen->search(ast_c[i]))->setString(0x20, "");
@@ -2784,7 +2856,16 @@ void dMenu_Fmap2DTop_c::setMoyaAlpha(u8 i_alpha) {
}
void dMenu_Fmap2DTop_c::setTitleNameString(u32 param_0) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
static const u64 sfont_name[7] = {
MULTI_CHAR('sfont00'), MULTI_CHAR('sfontl0'), MULTI_CHAR('sfontl1'), MULTI_CHAR('sfontl2'), MULTI_CHAR('sfontb0'), MULTI_CHAR('sfontb1'), MULTI_CHAR('sfontb2')
};
static const u64 ffont_name[7] = {
MULTI_CHAR('ffont00'), MULTI_CHAR('ffontl0'), MULTI_CHAR('ffontl1'), MULTI_CHAR('ffontl2'), MULTI_CHAR('ffontb0'), MULTI_CHAR('ffontb3'), MULTI_CHAR('ffontb4')
};
auto setTitleNameString_font_name = dusk::version::isRegionJpn() ? sfont_name : ffont_name;
#elif VERSION == VERSION_GCN_JPN
static const u64 sfont_name[7] = {
MULTI_CHAR('sfont00'), MULTI_CHAR('sfontl0'), MULTI_CHAR('sfontl1'), MULTI_CHAR('sfontl2'), MULTI_CHAR('sfontb0'), MULTI_CHAR('sfontb1'), MULTI_CHAR('sfontb2')
};
@@ -2816,7 +2897,11 @@ void dMenu_Fmap2DTop_c::setTitleNameString(u32 param_0) {
}
void dMenu_Fmap2DTop_c::setAreaNameString(u32 param_0) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
static const u64 iarea_name[3] = {MULTI_CHAR('i_name_s'), MULTI_CHAR('i_name'), MULTI_CHAR('i_name1')};
static const u64 farea_name[3] = {MULTI_CHAR('f_name_1'), MULTI_CHAR('f_name3'), MULTI_CHAR('f_name2')};
auto setAreaNameString_area_name = dusk::version::isRegionJpn() ? iarea_name : farea_name;
#elif VERSION == VERSION_GCN_JPN
static const u64 iarea_name[3] = {MULTI_CHAR('i_name_s'), MULTI_CHAR('i_name'), MULTI_CHAR('i_name1')};
#define setAreaNameString_area_name iarea_name
#else
@@ -2849,7 +2934,11 @@ void dMenu_Fmap2DTop_c::setZButtonString(u32 param_0, u8 i_alpha) {
dusk::ui::ControlOverride::Default);
#endif
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
static const u64 cont_zt[5] = {MULTI_CHAR('cont_zt'), MULTI_CHAR('cont_zt1'), MULTI_CHAR('cont_zt2'), MULTI_CHAR('cont_zt3'), MULTI_CHAR('cont_zt4')};
static const u64 font_zt[5] = {MULTI_CHAR('font_zt1'), MULTI_CHAR('font_zt2'), MULTI_CHAR('font_zt3'), MULTI_CHAR('font_zt4'), MULTI_CHAR('font_zt5')};
auto setZButtonString_font_zt = dusk::version::isRegionJpn() ? cont_zt : font_zt;
#elif VERSION == VERSION_GCN_JPN
static const u64 cont_zt[5] = {MULTI_CHAR('cont_zt'), MULTI_CHAR('cont_zt1'), MULTI_CHAR('cont_zt2'), MULTI_CHAR('cont_zt3'), MULTI_CHAR('cont_zt4')};
#define setZButtonString_font_zt cont_zt
#else
@@ -2883,7 +2972,11 @@ void dMenu_Fmap2DTop_c::setZButtonString(u32 param_0, u8 i_alpha) {
}
void dMenu_Fmap2DTop_c::setBButtonString(u32 param_0, u8 i_alpha) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
static const u64 cont_bt[5] = {MULTI_CHAR('cont_bt1'), MULTI_CHAR('cont_bt2'), MULTI_CHAR('cont_bt3'), MULTI_CHAR('cont_bt4'), MULTI_CHAR('cont_bt')};
static const u64 font_bt[5] = {MULTI_CHAR('font_bt1'), MULTI_CHAR('font_bt2'), MULTI_CHAR('font_bt3'), MULTI_CHAR('font_bt4'), MULTI_CHAR('font_bt5')};
auto setBButtonString_font_bt = dusk::version::isRegionJpn() ? cont_bt : font_bt;
#elif VERSION == VERSION_GCN_JPN
static const u64 cont_bt[5] = {MULTI_CHAR('cont_bt1'), MULTI_CHAR('cont_bt2'), MULTI_CHAR('cont_bt3'), MULTI_CHAR('cont_bt4'), MULTI_CHAR('cont_bt')};
#define setBButtonString_font_bt cont_bt
#else
@@ -2909,7 +3002,11 @@ void dMenu_Fmap2DTop_c::setBButtonString(u32 param_0, u8 i_alpha) {
}
void dMenu_Fmap2DTop_c::setAButtonString(u32 param_0, u8 i_alpha) {
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
static const u64 cont_at[5] = {MULTI_CHAR('cont_at'), MULTI_CHAR('cont_at1'), MULTI_CHAR('cont_at2'), MULTI_CHAR('cont_at3'), MULTI_CHAR('cont_at4')};
static const u64 font_at[5] = {MULTI_CHAR('font_at1'), MULTI_CHAR('font_at2'), MULTI_CHAR('font_at3'), MULTI_CHAR('font_at4'), MULTI_CHAR('font_at5')};
auto setAButtonString_font_at = dusk::version::isRegionJpn() ? cont_at : font_at;
#elif VERSION == VERSION_GCN_JPN
static const u64 cont_at[5] = {MULTI_CHAR('cont_at'), MULTI_CHAR('cont_at1'), MULTI_CHAR('cont_at2'), MULTI_CHAR('cont_at3'), MULTI_CHAR('cont_at4')};
#define setAButtonString_font_at cont_at
#else
@@ -2936,21 +3033,24 @@ void dMenu_Fmap2DTop_c::setAButtonString(u32 param_0, u8 i_alpha) {
void dMenu_Fmap2DTop_c::setCrossLRString(u32 param_0) {
#if PLATFORM_GCN || (VERSION == VERSION_SHIELD)
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
static const u64 juji_c_jpn[5] = {MULTI_CHAR('juji_c00'), MULTI_CHAR('juji_c01'), MULTI_CHAR('juji_c02'), MULTI_CHAR('juji_c03'), MULTI_CHAR('juji_c04')};
static const u64 juji_c[5] = {MULTI_CHAR('fuji_c00'), MULTI_CHAR('fuji_c01'), MULTI_CHAR('fuji_c02'), MULTI_CHAR('fuji_c03'), MULTI_CHAR('fuji_c04')};
#elif VERSION == VERSION_GCN_JPN
static const u64 juji_c[5] = {MULTI_CHAR('juji_c00'), MULTI_CHAR('juji_c01'), MULTI_CHAR('juji_c02'), MULTI_CHAR('juji_c03'), MULTI_CHAR('juji_c04')};
#else
static const u64 juji_c[5] = {MULTI_CHAR('fuji_c00'), MULTI_CHAR('fuji_c01'), MULTI_CHAR('fuji_c02'), MULTI_CHAR('fuji_c03'), MULTI_CHAR('fuji_c04')};
#endif
if (param_0 == 0) {
for (int i = 0; i < 5; i++) {
J2DTextBox* text_box = static_cast<J2DTextBox*>(mpTitleScreen->search(juji_c[i]));
J2DTextBox* text_box = static_cast<J2DTextBox*>(mpTitleScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? juji_c_jpn[i] : juji_c[i], juji_c[i])));
SAFE_STRCPY(text_box->getStringPtr(), "");
}
mpTitleScreen->search(MULTI_CHAR('juy_sha0'))->show();
mAlphaDpad = 1;
} else {
for (int i = 0; i < 5; i++) {
J2DTextBox* text_box = static_cast<J2DTextBox*>(mpTitleScreen->search(juji_c[i]));
J2DTextBox* text_box = static_cast<J2DTextBox*>(mpTitleScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? juji_c_jpn[i] : juji_c[i], juji_c[i])));
dMeter2Info_getStringKanji(param_0, text_box->getStringPtr(), NULL);
}
mpTitleScreen->search(MULTI_CHAR('juy_sha0'))->show();
@@ -2961,21 +3061,24 @@ void dMenu_Fmap2DTop_c::setCrossLRString(u32 param_0) {
void dMenu_Fmap2DTop_c::set3DStickString(u32 param_0) {
#if PLATFORM_GCN || (VERSION == VERSION_SHIELD)
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
static const u64 ast_c_jpn[5] = {MULTI_CHAR('ast_00'), MULTI_CHAR('ast_01'), MULTI_CHAR('ast_02'), MULTI_CHAR('ast_03'), MULTI_CHAR('ast_04')};
static const u64 ast_c[5] = {MULTI_CHAR('fst_00'), MULTI_CHAR('fst_01'), MULTI_CHAR('fst_02'), MULTI_CHAR('fst_03'), MULTI_CHAR('fst_04')};
#elif VERSION == VERSION_GCN_JPN
static const u64 ast_c[5] = {MULTI_CHAR('ast_00'), MULTI_CHAR('ast_01'), MULTI_CHAR('ast_02'), MULTI_CHAR('ast_03'), MULTI_CHAR('ast_04')};
#else
static const u64 ast_c[5] = {MULTI_CHAR('fst_00'), MULTI_CHAR('fst_01'), MULTI_CHAR('fst_02'), MULTI_CHAR('fst_03'), MULTI_CHAR('fst_04')};
#endif
if (param_0 == 0) {
for (int i = 0; i < 5; i++) {
J2DTextBox* text_box = static_cast<J2DTextBox*>(mpTitleScreen->search(ast_c[i]));
J2DTextBox* text_box = static_cast<J2DTextBox*>(mpTitleScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? ast_c_jpn[i] : ast_c[i], ast_c[i])));
SAFE_STRCPY(text_box->getStringPtr(), "");
}
mpTitleScreen->search(MULTI_CHAR('as_sha0'))->show();
mAlphaAnalogStick = 1;
} else {
for (int i = 0; i < 5; i++) {
J2DTextBox* text_box = static_cast<J2DTextBox*>(mpTitleScreen->search(ast_c[i]));
J2DTextBox* text_box = static_cast<J2DTextBox*>(mpTitleScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? ast_c_jpn[i] : ast_c[i], ast_c[i])));
dMeter2Info_getStringKanji(param_0, text_box->getStringPtr(), NULL);
}
mpTitleScreen->search(MULTI_CHAR('as_sha0'))->show();