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
+94 -17
View File
@@ -23,6 +23,8 @@
#include "m_Do/m_Do_graphic.h"
#include <cstring>
#include "dusk/version.hpp"
#if TARGET_PC
#include "dusk/menu_pointer.h"
#include "helpers/string.hpp"
@@ -3184,8 +3186,10 @@ void dFile_select_c::screenSet() {
static u64 l_nouseTag[15] = {MULTI_CHAR('w_mcheck'), MULTI_CHAR('w_tabi1'), MULTI_CHAR('w_tabi2'), MULTI_CHAR('w_tabi3'), MULTI_CHAR('w_doko_c'),
MULTI_CHAR('w_uwa_c'), MULTI_CHAR('w_cp_chu'), MULTI_CHAR('w_cpsita'), MULTI_CHAR('w_cp_x'), 'w_de',
MULTI_CHAR('w_de_chu'), MULTI_CHAR('w_desita'), MULTI_CHAR('w_de_x'), MULTI_CHAR('w_name'), MULTI_CHAR('w_h_name')};
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
#if TARGET_PC
static u64 l_tagName21_jpn[2] = {MULTI_CHAR('w_tabi_s'), MULTI_CHAR('w_tabi_x')};
static u64 l_tagName21[2] = {MULTI_CHAR('t_for'), MULTI_CHAR('t_for1')};
#elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
static u64 l_tagName21[2] = {MULTI_CHAR('w_tabi_s'), MULTI_CHAR('w_tabi_x')};
#else
static u64 l_tagName21[2] = {MULTI_CHAR('t_for'), MULTI_CHAR('t_for1')};
@@ -3194,7 +3198,10 @@ void dFile_select_c::screenSet() {
static u64 l_tagName18[3] = {MULTI_CHAR('w_de_ef0'), MULTI_CHAR('w_de_ef1'), MULTI_CHAR('w_de_ef2')};
static u64 l_tagName19[3] = {MULTI_CHAR('w_cp_ef0'), MULTI_CHAR('w_cp_ef1'), MULTI_CHAR('w_cp_ef2')};
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
#if TARGET_PC
static u64 l_tagName20_jpn[2] = {MULTI_CHAR('w_er_msg'), MULTI_CHAR('w_er_msR')};
static u64 l_tagName20[2] = {MULTI_CHAR('er_for0'), MULTI_CHAR('er_for1')};
#elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
static u64 l_tagName20[2] = {MULTI_CHAR('w_er_msg'), MULTI_CHAR('w_er_msR')};
#else
static u64 l_tagName20[2] = {MULTI_CHAR('er_for0'), MULTI_CHAR('er_for1')};
@@ -3230,7 +3237,19 @@ void dFile_select_c::screenSet() {
mBbtnPane = JKR_NEW CPaneMgrAlpha(fileSel.Scr, MULTI_CHAR('w_n_bbtn'), 2, NULL);
mAbtnPane = JKR_NEW CPaneMgrAlpha(fileSel.Scr, MULTI_CHAR('w_n_abtn'), 2, NULL);
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
mModoruTxtPane = JKR_NEW CPaneMgrAlpha(fileSel.Scr, MULTI_CHAR('w_modo'), 2, NULL);
mKetteiTxtPane = JKR_NEW CPaneMgrAlpha(fileSel.Scr, MULTI_CHAR('w_kete'), 2, NULL);
fileSel.Scr->search(MULTI_CHAR('f_modo'))->hide();
fileSel.Scr->search(MULTI_CHAR('f_kete'))->hide();
} else {
mModoruTxtPane = JKR_NEW CPaneMgrAlpha(fileSel.Scr, MULTI_CHAR('f_modo'), 2, NULL);
mKetteiTxtPane = JKR_NEW CPaneMgrAlpha(fileSel.Scr, MULTI_CHAR('f_kete'), 2, NULL);
fileSel.Scr->search(MULTI_CHAR('w_modo'))->hide();
fileSel.Scr->search(MULTI_CHAR('w_kete'))->hide();
}
#elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
mModoruTxtPane = JKR_NEW CPaneMgrAlpha(fileSel.Scr, MULTI_CHAR('w_modo'), 2, NULL);
mKetteiTxtPane = JKR_NEW CPaneMgrAlpha(fileSel.Scr, MULTI_CHAR('w_kete'), 2, NULL);
fileSel.Scr->search(MULTI_CHAR('f_modo'))->hide();
@@ -3306,7 +3325,17 @@ void dFile_select_c::screenSet() {
fileSel.Scr->search(l_nouseTag[i])->hide();
}
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
fileSel.Scr->search(MULTI_CHAR('t_for'))->hide();
fileSel.Scr->search(MULTI_CHAR('t_for1'))->hide();
} else {
fileSel.Scr->search(MULTI_CHAR('w_tabi_s'))->hide();
fileSel.Scr->search(MULTI_CHAR('w_tabi_x'))->hide();
fileSel.Scr->search(MULTI_CHAR('w_mgn1'))->hide();
fileSel.Scr->search(MULTI_CHAR('w_mgn2'))->hide();
}
#elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
fileSel.Scr->search(MULTI_CHAR('t_for'))->hide();
fileSel.Scr->search(MULTI_CHAR('t_for1'))->hide();
#else
@@ -3317,10 +3346,20 @@ void dFile_select_c::screenSet() {
#endif
for (int i = 0; i < 2; i++) {
mHeaderTxtPane[i] = JKR_NEW CPaneMgrAlpha(fileSel.Scr, l_tagName21[i], 0, NULL);
mHeaderTxtPane[i] = JKR_NEW CPaneMgrAlpha(fileSel.Scr, DUSK_IF_ELSE(dusk::version::isRegionJpn() ? l_tagName21_jpn[i] : l_tagName21[i], l_tagName21[i]), 0, NULL);
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setFont(fileSel.font[0]);
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setString(512, "");
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setFontSize(21.0f, 21.0f);
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setLineSpace(22.0f);
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setCharSpace(2.0f);
} else {
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setFontSize(24.0f, 24.0f);
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setLineSpace(20.0f);
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setCharSpace(0.0f);
}
#elif VERSION == VERSION_GCN_JPN
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setFontSize(21.0f, 21.0f);
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setLineSpace(22.0f);
((J2DTextBox*)mHeaderTxtPane[i]->getPanePtr())->setCharSpace(2.0f);
@@ -3361,8 +3400,15 @@ void dFile_select_c::screenSet() {
field_0x0208 = 0;
field_0x0209 = 0;
mErrorMsgPane = fileSel.Scr->search(MULTI_CHAR('w_er_n'));
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
fileSel.Scr->search(MULTI_CHAR('er_for0'))->hide();
fileSel.Scr->search(MULTI_CHAR('er_for1'))->hide();
} else {
fileSel.Scr->search(MULTI_CHAR('w_er_msg'))->hide();
fileSel.Scr->search(MULTI_CHAR('w_er_msR'))->hide();
}
#elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
fileSel.Scr->search(MULTI_CHAR('er_for0'))->hide();
fileSel.Scr->search(MULTI_CHAR('er_for1'))->hide();
#else
@@ -3373,17 +3419,27 @@ void dFile_select_c::screenSet() {
fileSel.Scr->search(MULTI_CHAR('w_er_msE'))->hide();
for (int i = 0; i < 2; i++) {
mErrorMsgTxtPane[i] = JKR_NEW CPaneMgrAlpha(fileSel.Scr, l_tagName20[i], 0, NULL);
mErrorMsgTxtPane[i] = JKR_NEW CPaneMgrAlpha(fileSel.Scr, DUSK_IF_ELSE(dusk::version::isRegionJpn() ? l_tagName20_jpn[i] : l_tagName20[i], l_tagName20[i]), 0, NULL);
((J2DTextBox*)mErrorMsgTxtPane[i]->getPanePtr())->setFont(fileSel.font[0]);
((J2DTextBox*)mErrorMsgTxtPane[i]->getPanePtr())->setString(512, "");
#if (VERSION != VERSION_GCN_JPN) && (VERSION != VERSION_WII_JPN)
#if TARGET_PC || ((VERSION != VERSION_GCN_JPN) && (VERSION != VERSION_WII_JPN))
IF_DUSK_BLOCK(!dusk::version::isRegionJpn())
mErrorMsgTxtPane[i]->getPanePtr()->resize(440.0f, 198.0f);
IF_DUSK_BLOCK_END
#endif
((J2DTextBox*)mErrorMsgTxtPane[i]->getPanePtr())->setFontSize(21.0f, 21.0f);
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
((J2DTextBox*)mErrorMsgTxtPane[i]->getPanePtr())->setLineSpace(22.0f);
((J2DTextBox*)mErrorMsgTxtPane[i]->getPanePtr())->setCharSpace(2.0f);
} else {
((J2DTextBox*)mErrorMsgTxtPane[i]->getPanePtr())->setLineSpace(21.0f);
((J2DTextBox*)mErrorMsgTxtPane[i]->getPanePtr())->setCharSpace(1.0f);
}
#elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
((J2DTextBox*)mErrorMsgTxtPane[i]->getPanePtr())->setLineSpace(22.0f);
((J2DTextBox*)mErrorMsgTxtPane[i]->getPanePtr())->setCharSpace(2.0f);
#else
@@ -3579,7 +3635,15 @@ void dFile_select_c::screenSetYesNo() {
for (int i = 0; i < 2; i++) {
mYnSelPane[i] = JKR_NEW CPaneMgr(mYnSel.ScrYn, l_tagName012[i], 0, NULL);
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
mYnSelTxtPane[i] = JKR_NEW CPaneMgr(mYnSel.ScrYn, l_tagName013[i], 0, NULL);
mYnSel.ScrYn->search(l_tagName013U[i])->hide();
} else {
mYnSelTxtPane[i] = JKR_NEW CPaneMgr(mYnSel.ScrYn, l_tagName013U[i], 0, NULL);
mYnSel.ScrYn->search(l_tagName013[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
mYnSelTxtPane[i] = JKR_NEW CPaneMgr(mYnSel.ScrYn, l_tagName013[i], 0, NULL);
mYnSel.ScrYn->search(l_tagName013U[i])->hide();
#else
@@ -3657,7 +3721,15 @@ void dFile_select_c::screenSet3Menu() {
for (int i = 0; i < 3; i++) {
m3mSelPane[i] = JKR_NEW CPaneMgr(m3mSel.Scr3m, l_tagName1[i], 0, NULL);
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
m3mSelTextPane[i] = JKR_NEW CPaneMgr(m3mSel.Scr3m, l_tagName011[i], 0, NULL);
m3mSel.Scr3m->search(l_tagName011U[i])->hide();
} else {
m3mSelTextPane[i] = JKR_NEW CPaneMgr(m3mSel.Scr3m, l_tagName011U[i], 0, NULL);
m3mSel.Scr3m->search(l_tagName011[i])->hide();
}
#elif VERSION == VERSION_GCN_JPN
m3mSelTextPane[i] = JKR_NEW CPaneMgr(m3mSel.Scr3m, l_tagName011[i], 0, NULL);
m3mSel.Scr3m->search(l_tagName011U[i])->hide();
#else
@@ -3777,7 +3849,12 @@ void dFile_select_c::headerTxtSet(u16 i_msgId, u8 i_type, u8 param_3) {
SAFE_STRCPY(mHeaderStringPtr[dispIdx], "");
} else {
static f32 fontsize[2] = {21.0f, 27.0f};
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
static f32 linespace_jpn[2] = {22.0f, 20.0f};
static f32 charspace_jpn[2] = {2.0f, 3.0f};
static f32 linespace[2] = {21.0f, 20.0f};
static f32 charspace[2] = {0.0f, 0.0f};
#elif VERSION == VERSION_GCN_JPN
static f32 linespace[2] = {22.0f, 20.0f};
static f32 charspace[2] = {2.0f, 3.0f};
#else
@@ -3787,8 +3864,8 @@ void dFile_select_c::headerTxtSet(u16 i_msgId, u8 i_type, u8 param_3) {
((J2DTextBox*)mHeaderTxtPane[dispIdx]->getPanePtr())->setFont(fileSel.font[i_type]);
((J2DTextBox*)mHeaderTxtPane[dispIdx]->getPanePtr())->setFontSize(fontsize[i_type], fontsize[i_type]);
((J2DTextBox*)mHeaderTxtPane[dispIdx]->getPanePtr())->setLineSpace(linespace[i_type]);
((J2DTextBox*)mHeaderTxtPane[dispIdx]->getPanePtr())->setCharSpace(charspace[i_type]);
((J2DTextBox*)mHeaderTxtPane[dispIdx]->getPanePtr())->setLineSpace(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? linespace_jpn[i_type] : linespace[i_type], linespace[i_type]));
((J2DTextBox*)mHeaderTxtPane[dispIdx]->getPanePtr())->setCharSpace(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? charspace_jpn[i_type] : charspace[i_type], charspace[i_type]));
fileSel.mMessageString->getString(i_msgId,
((J2DTextBox*)mHeaderTxtPane[dispIdx]->getPanePtr()), NULL,
fileSel.font[i_type], NULL, 0);