From ce386d8dbdfb5a13cdd915fb34166398499d377e Mon Sep 17 00:00:00 2001 From: TakaRikka Date: Fri, 17 Jul 2026 18:12:28 -0700 Subject: [PATCH] convert jpn ui/text changes to runtime checks --- include/d/d_menu_option.h | 18 +- include/d/d_msg_class.h | 6 +- include/d/d_msg_unit.h | 4 + include/d/d_timer.h | 2 +- src/d/d_file_sel_info.cpp | 29 +- src/d/d_file_sel_warning.cpp | 23 +- src/d/d_file_select.cpp | 111 ++++++- src/d/d_menu_collect.cpp | 202 ++++++++++-- src/d/d_menu_dmap.cpp | 91 +++++- src/d/d_menu_fishing.cpp | 11 +- src/d/d_menu_fmap2D.cpp | 139 +++++++-- src/d/d_menu_insect.cpp | 27 +- src/d/d_menu_item_explain.cpp | 36 ++- src/d/d_menu_letter.cpp | 233 ++++++++++++-- src/d/d_menu_option.cpp | 573 ++++++++++++++++++++++++++-------- src/d/d_menu_ring.cpp | 147 ++++++--- src/d/d_menu_save.cpp | 131 ++++++-- src/d/d_menu_skill.cpp | 55 +++- src/d/d_meter2_draw.cpp | 14 +- src/d/d_meter2_info.cpp | 39 ++- src/d/d_meter_button.cpp | 83 ++++- src/d/d_msg_class.cpp | 136 ++++++-- src/d/d_msg_object.cpp | 7 + src/d/d_msg_out_font.cpp | 17 +- src/d/d_msg_scrn_3select.cpp | 112 ++++++- src/d/d_msg_scrn_boss.cpp | 7 +- src/d/d_msg_scrn_explain.cpp | 75 ++++- src/d/d_msg_scrn_howl.cpp | 37 ++- src/d/d_msg_scrn_item.cpp | 50 ++- src/d/d_msg_scrn_jimaku.cpp | 53 +++- src/d/d_msg_scrn_kanban.cpp | 45 ++- src/d/d_msg_scrn_place.cpp | 13 +- src/d/d_msg_scrn_talk.cpp | 92 +++++- src/d/d_msg_scrn_tree.cpp | 50 ++- src/d/d_msg_unit.cpp | 205 +++++++++++- src/d/d_save.cpp | 7 +- src/d/d_timer.cpp | 29 +- 37 files changed, 2467 insertions(+), 442 deletions(-) diff --git a/include/d/d_menu_option.h b/include/d/d_menu_option.h index 03aca42808..49e81f98ae 100644 --- a/include/d/d_menu_option.h +++ b/include/d/d_menu_option.h @@ -17,6 +17,20 @@ class dSelect_cursor_c; class dMenu_Option_c : public dDlst_base_c { public: + enum { + PROC_ATTEN_e, +#if TARGET_PC || VERSION == VERSION_GCN_JPN + PROC_RUBY_e, +#endif + PROC_VIB_e, + PROC_SOUND_e, + PROC_CHANGE_MOVE_e, + PROC_CONFIRM_OPEN_MOVE_e, + PROC_CONFIRM_MOVE_MOVE_e, + PROC_CONFIRM_SELECT_MOVE_e, + PROC_CONFIRM_CLOSE_MOVE_e, + }; + dMenu_Option_c(JKRArchive*, STControl*); void _create(); void _delete(); @@ -31,7 +45,7 @@ public: bool _close(); void atten_init(); void atten_move(); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC || VERSION == VERSION_GCN_JPN void ruby_init(); void ruby_move(); #endif @@ -189,7 +203,7 @@ private: /* 0x3E2 */ u8 field_0x3e2; /* 0x3E3 */ u8 field_0x3e3; /* 0x3E4 */ u8 field_0x3e4; -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC || VERSION == VERSION_GCN_JPN /* 0x3E5 */ u8 field_0x3e5_JPN; #endif /* 0x3E5 */ u8 field_0x3e5; diff --git a/include/d/d_msg_class.h b/include/d/d_msg_class.h index 5292eed5d3..a8bba32351 100644 --- a/include/d/d_msg_class.h +++ b/include/d/d_msg_class.h @@ -7,7 +7,11 @@ #include "helpers/endian.h" #include "helpers/string.hpp" -#if REGION_JPN +#if TARGET_PC +#define D_MSG_CLASS_PAGE_CNT_MAX 40 +#define D_MSG_CLASS_CHAR_CNT_MAX 0x210 +#define D_MSG_CLASS_LINE_MAX 12 +#elif REGION_JPN #define D_MSG_CLASS_PAGE_CNT_MAX 30 #define D_MSG_CLASS_CHAR_CNT_MAX 0x210 #define D_MSG_CLASS_LINE_MAX 9 diff --git a/include/d/d_msg_unit.h b/include/d/d_msg_unit.h index c48d89d0e0..59e0a81183 100644 --- a/include/d/d_msg_unit.h +++ b/include/d/d_msg_unit.h @@ -8,6 +8,10 @@ public: dMsgUnit_c(); void setTag(int, int, TEXT_SPAN, bool); +#if TARGET_PC + void setTag_jpn(int, int, TEXT_SPAN, bool); +#endif + virtual ~dMsgUnit_c(); }; diff --git a/include/d/d_timer.h b/include/d/d_timer.h index 9d3bd7ce1f..104a4cae9e 100644 --- a/include/d/d_timer.h +++ b/include/d/d_timer.h @@ -52,7 +52,7 @@ public: s32 createStart(u16); bool checkStartAnimeEnd(); void playBckAnimation(f32); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC || VERSION == VERSION_GCN_JPN bool isLeadByte(int); #endif void drawPikari(int); diff --git a/src/d/d_file_sel_info.cpp b/src/d/d_file_sel_info.cpp index e107d6dacc..70bd101aa0 100644 --- a/src/d/d_file_sel_info.cpp +++ b/src/d/d_file_sel_info.cpp @@ -46,8 +46,19 @@ void dFile_info_c::screenSet() { J2DTextBox* info_text[4]; - - #if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN) + #if TARGET_PC + if (dusk::version::isRegionJpn()) { + info_text[0] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('w_s_t_01')); + info_text[1] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('w_p_t_01')); + mFileInfo.Scr->search(MULTI_CHAR('f_s_t_02'))->hide(); + mFileInfo.Scr->search(MULTI_CHAR('f_p_t_02'))->hide(); + } else { + info_text[0] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('f_s_t_02')); + info_text[1] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('f_p_t_02')); + mFileInfo.Scr->search(MULTI_CHAR('w_s_t_01'))->hide(); + mFileInfo.Scr->search(MULTI_CHAR('w_p_t_01'))->hide(); + } + #elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN) info_text[0] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('w_s_t_01')); info_text[1] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('w_p_t_01')); mFileInfo.Scr->search(MULTI_CHAR('f_s_t_02'))->hide(); @@ -66,7 +77,19 @@ void dFile_info_c::screenSet() { dMeter2Info_getString(0x3D0, info_text[0]->getStringPtr(), NULL); // Save time dMeter2Info_getString(0x3D1, info_text[1]->getStringPtr(), NULL); // Total play time - #if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN) + #if TARGET_PC + if (dusk::version::isRegionJpn()) { + info_text[0] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('w_name01')); + info_text[1] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('w_new_1')); + mFileInfo.Scr->search(MULTI_CHAR('f_name01'))->hide(); + mFileInfo.Scr->search(MULTI_CHAR('f_new_1'))->hide(); + } else { + info_text[0] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('f_name01')); + info_text[1] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('f_new_1')); + mFileInfo.Scr->search(MULTI_CHAR('w_name01'))->hide(); + mFileInfo.Scr->search(MULTI_CHAR('w_new_1'))->hide(); + } + #elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN) info_text[0] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('w_name01')); info_text[1] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('w_new_1')); mFileInfo.Scr->search(MULTI_CHAR('f_name01'))->hide(); diff --git a/src/d/d_file_sel_warning.cpp b/src/d/d_file_sel_warning.cpp index e2d767453b..fc17e05a0d 100644 --- a/src/d/d_file_sel_warning.cpp +++ b/src/d/d_file_sel_warning.cpp @@ -4,13 +4,14 @@ #include "d/dolzel.h" // IWYU pragma: keep +#include "JSystem/J2DGraph/J2DAnmLoader.h" +#include "JSystem/J2DGraph/J2DScreen.h" +#include "JSystem/J2DGraph/J2DTextBox.h" +#include "d/d_com_inf_game.h" #include "d/d_file_sel_warning.h" #include "d/d_msg_string.h" #include "d/d_pane_class.h" -#include "JSystem/J2DGraph/J2DScreen.h" -#include "JSystem/J2DGraph/J2DAnmLoader.h" -#include "JSystem/J2DGraph/J2DTextBox.h" -#include "d/d_com_inf_game.h" +#include "dusk/version.hpp" typedef void (dFile_warning_c::*procFunc)(); static procFunc fileWarningProc[] = {&dFile_warning_c::modeWait, &dFile_warning_c::modeMove}; @@ -63,7 +64,19 @@ void dFile_warning_c::screenSet() { JUT_ASSERT(0, mpRootPane != NULL); field_0x34 = mpRootPane->getTranslateY(); -#if REGION_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + mFileWarn.Scr->search(MULTI_CHAR('ms_for_2'))->hide(); + mFileWarn.Scr->search(MULTI_CHAR('ms_for_3'))->hide(); + + field_0x20 = static_cast(mFileWarn.Scr->search(MULTI_CHAR('w_msg_jp'))); + } else { + mFileWarn.Scr->search(MULTI_CHAR('w_msg_jp'))->hide(); + mFileWarn.Scr->search(MULTI_CHAR('ms_for_2'))->hide(); + + field_0x20 = static_cast(mFileWarn.Scr->search(MULTI_CHAR('ms_for_3'))); + } +#elif REGION_JPN mFileWarn.Scr->search(MULTI_CHAR('ms_for_2'))->hide(); mFileWarn.Scr->search(MULTI_CHAR('ms_for_3'))->hide(); diff --git a/src/d/d_file_select.cpp b/src/d/d_file_select.cpp index f57265aa77..98d60fa195 100644 --- a/src/d/d_file_select.cpp +++ b/src/d/d_file_select.cpp @@ -23,6 +23,8 @@ #include "m_Do/m_Do_graphic.h" #include +#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); diff --git a/src/d/d_menu_collect.cpp b/src/d/d_menu_collect.cpp index 4de8b2c5a4..28f964ec10 100644 --- a/src/d/d_menu_collect.cpp +++ b/src/d/d_menu_collect.cpp @@ -5,36 +5,37 @@ #include "d/dolzel.h" // IWYU pragma: keep -#include "d/d_menu_collect.h" -#include "JSystem/J3DGraphLoader/J3DModelLoader.h" -#include "JSystem/J3DGraphLoader/J3DAnmLoader.h" +#include +#include +#include "JSystem/J2DGraph/J2DAnmLoader.h" +#include "JSystem/J2DGraph/J2DGrafContext.h" #include "JSystem/J2DGraph/J2DTextBox.h" +#include "JSystem/J3DGraphBase/J3DMaterial.h" +#include "JSystem/J3DGraphLoader/J3DAnmLoader.h" +#include "JSystem/J3DGraphLoader/J3DModelLoader.h" #include "JSystem/JKernel/JKRExpHeap.h" #include "JSystem/JKernel/JKRSolidHeap.h" #include "d/actor/d_a_alink.h" -#include "d/d_select_cursor.h" +#include "d/d_item.h" +#include "d/d_lib.h" +#include "d/d_menu_collect.h" #include "d/d_menu_fishing.h" #include "d/d_menu_insect.h" #include "d/d_menu_letter.h" #include "d/d_menu_option.h" #include "d/d_menu_save.h" #include "d/d_menu_skill.h" +#include "d/d_menu_window.h" +#include "d/d_meter2_info.h" #include "d/d_meter_HIO.h" #include "d/d_msg_class.h" #include "d/d_msg_object.h" #include "d/d_msg_string.h" #include "d/d_pane_class.h" -#include "d/d_item.h" -#include "d/d_lib.h" -#include "d/d_meter2_info.h" -#include -#include +#include "d/d_select_cursor.h" +#include "dusk/version.hpp" #include "m_Do/m_Do_graphic.h" #include "m_Do/m_Do_mtx.h" -#include "JSystem/J2DGraph/J2DAnmLoader.h" -#include "JSystem/J2DGraph/J2DGrafContext.h" -#include "d/d_menu_window.h" -#include "JSystem/J3DGraphBase/J3DMaterial.h" #if TARGET_PC #include "dusk/menu_pointer.h" @@ -438,7 +439,21 @@ void dMenu_Collect2D_c::screenSet() { static const u64 text_a_tag[5] = {MULTI_CHAR('atext1_1'), MULTI_CHAR('atext1_2'), MULTI_CHAR('atext1_3'), MULTI_CHAR('atext1_4'), MULTI_CHAR('atext1_5')}; static const u64 text_b_tag[5] = {MULTI_CHAR('btext1_1'), MULTI_CHAR('btext1_2'), MULTI_CHAR('btext1_3'), MULTI_CHAR('btext1_4'), MULTI_CHAR('btext1_5')}; -#if REGION_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + static_cast(mpScreen->search(MULTI_CHAR('t_t00')))->setFont(mDoExt_getRubyFont()); + static_cast(mpScreen->search(MULTI_CHAR('t_t00')))->setString(0x20, ""); + dMeter2Info_getStringKanji( + 0x3E1, static_cast(mpScreen->search(MULTI_CHAR('t_t00')))->getStringPtr(), NULL); + mpScreen->search(MULTI_CHAR('f_t00'))->hide(); + } else { + static_cast(mpScreen->search(MULTI_CHAR('f_t00')))->setFont(mDoExt_getRubyFont()); + static_cast(mpScreen->search(MULTI_CHAR('f_t00')))->setString(0x20, ""); + dMeter2Info_getStringKanji( + 0x3E1, static_cast(mpScreen->search(MULTI_CHAR('f_t00')))->getStringPtr(), NULL); + mpScreen->search(MULTI_CHAR('t_t00'))->hide(); + } +#elif REGION_JPN static_cast(mpScreen->search(MULTI_CHAR('t_t00')))->setFont(mDoExt_getRubyFont()); static_cast(mpScreen->search(MULTI_CHAR('t_t00')))->setString(0x20, ""); dMeter2Info_getStringKanji( @@ -453,7 +468,31 @@ void dMenu_Collect2D_c::screenSet() { #endif for (int i = 0; i < 3; i++) { -#if REGION_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + static_cast(mpScreen->search(text_sv[i]))->setFont(mDoExt_getMesgFont()); + static_cast(mpScreen->search(text_op[i]))->setFont(mDoExt_getMesgFont()); + static_cast(mpScreen->search(text_sv[i]))->setString(0x20, ""); + static_cast(mpScreen->search(text_op[i]))->setString(0x20, ""); + dMeter2Info_getStringKanji( + 0x60, static_cast(mpScreen->search(text_sv[i]))->getStringPtr(), NULL); + dMeter2Info_getStringKanji( + 0x5F, static_cast(mpScreen->search(text_op[i]))->getStringPtr(), NULL); + mpScreen->search(ftext_sv[i])->hide(); + mpScreen->search(ftext_op[i])->hide(); + } else { + static_cast(mpScreen->search(ftext_sv[i]))->setFont(mDoExt_getMesgFont()); + static_cast(mpScreen->search(ftext_op[i]))->setFont(mDoExt_getMesgFont()); + static_cast(mpScreen->search(ftext_sv[i]))->setString(0x20, ""); + static_cast(mpScreen->search(ftext_op[i]))->setString(0x20, ""); + dMeter2Info_getStringKanji( + 0x60, static_cast(mpScreen->search(ftext_sv[i]))->getStringPtr(), NULL); + dMeter2Info_getStringKanji( + 0x5F, static_cast(mpScreen->search(ftext_op[i]))->getStringPtr(), NULL); + mpScreen->search(text_sv[i])->hide(); + mpScreen->search(text_op[i])->hide(); + } +#elif REGION_JPN static_cast(mpScreen->search(text_sv[i]))->setFont(mDoExt_getMesgFont()); static_cast(mpScreen->search(text_op[i]))->setFont(mDoExt_getMesgFont()); static_cast(mpScreen->search(text_sv[i]))->setString(0x20, ""); @@ -487,7 +526,49 @@ void dMenu_Collect2D_c::screenSet() { static_cast(mpScreenIcon->search(text_b_tag[i]))->setString(0x20, ""); } -#if REGION_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + static_cast(mpScreen->search(MULTI_CHAR('item_n00')))->setFont(mDoExt_getMesgFont()); + static_cast(mpScreen->search(MULTI_CHAR('item_n01')))->setFont(mDoExt_getMesgFont()); + static_cast(mpScreen->search(MULTI_CHAR('item_n02')))->setFont(mDoExt_getMesgFont()); + static_cast(mpScreen->search(MULTI_CHAR('item_n03')))->setFont(mDoExt_getMesgFont()); + static_cast(mpScreen->search(MULTI_CHAR('item_n00')))->setString(0x20, ""); + static_cast(mpScreen->search(MULTI_CHAR('item_n01')))->setString(0x20, ""); + static_cast(mpScreen->search(MULTI_CHAR('item_n02')))->setString(0x20, ""); + static_cast(mpScreen->search(MULTI_CHAR('item_n03')))->setString(0x20, ""); + static_cast(mpScreen->search(MULTI_CHAR('i_text1')))->setFont(mDoExt_getMesgFont()); + static_cast(mpScreen->search(MULTI_CHAR('i_text0')))->setFont(mDoExt_getMesgFont()); + static_cast(mpScreen->search(MULTI_CHAR('i_text1')))->setString(0x100, ""); + static_cast(mpScreen->search(MULTI_CHAR('i_text0')))->setString(0x100, ""); + + mpScreen->search(MULTI_CHAR('item_n04'))->hide(); + mpScreen->search(MULTI_CHAR('item_n05'))->hide(); + mpScreen->search(MULTI_CHAR('item_n06'))->hide(); + mpScreen->search(MULTI_CHAR('item_n07'))->hide(); + mpScreen->search(MULTI_CHAR('f_text1'))->hide(); + mpScreen->search(MULTI_CHAR('f_text0'))->hide(); + } else { + static_cast(mpScreen->search(MULTI_CHAR('item_n04')))->setFont(mDoExt_getMesgFont()); + static_cast(mpScreen->search(MULTI_CHAR('item_n05')))->setFont(mDoExt_getMesgFont()); + static_cast(mpScreen->search(MULTI_CHAR('item_n06')))->setFont(mDoExt_getMesgFont()); + static_cast(mpScreen->search(MULTI_CHAR('item_n07')))->setFont(mDoExt_getMesgFont()); + static_cast(mpScreen->search(MULTI_CHAR('item_n04')))->setString(0x20, ""); + static_cast(mpScreen->search(MULTI_CHAR('item_n05')))->setString(0x20, ""); + static_cast(mpScreen->search(MULTI_CHAR('item_n06')))->setString(0x20, ""); + static_cast(mpScreen->search(MULTI_CHAR('item_n07')))->setString(0x20, ""); + static_cast(mpScreen->search(MULTI_CHAR('f_text1')))->setFont(mDoExt_getMesgFont()); + static_cast(mpScreen->search(MULTI_CHAR('f_text0')))->setFont(mDoExt_getMesgFont()); + static_cast(mpScreen->search(MULTI_CHAR('f_text1')))->setString(0x100, ""); + static_cast(mpScreen->search(MULTI_CHAR('f_text0')))->setString(0x100, ""); + + mpScreen->search(MULTI_CHAR('item_n00'))->hide(); + mpScreen->search(MULTI_CHAR('item_n01'))->hide(); + mpScreen->search(MULTI_CHAR('item_n02'))->hide(); + mpScreen->search(MULTI_CHAR('item_n03'))->hide(); + mpScreen->search(MULTI_CHAR('i_text1'))->hide(); + mpScreen->search(MULTI_CHAR('i_text0'))->hide(); + } +#elif REGION_JPN static_cast(mpScreen->search(MULTI_CHAR('item_n00')))->setFont(mDoExt_getMesgFont()); static_cast(mpScreen->search(MULTI_CHAR('item_n01')))->setFont(mDoExt_getMesgFont()); static_cast(mpScreen->search(MULTI_CHAR('item_n02')))->setFont(mDoExt_getMesgFont()); @@ -2337,35 +2418,69 @@ void dMenu_Collect2D_c::_draw() { mpScreen->draw(0.0f, 0.0f, grafPort); if (mItemNameString == 0) { -#if REGION_JPN +#if TARGET_PC + TEXT_SPAN stringPtr1; + if (dusk::version::isRegionJpn()) { + stringPtr1 = static_cast(mpScreen->search(MULTI_CHAR('i_text1')))->getStringPtr(); + } else { + stringPtr1 = static_cast(mpScreen->search(MULTI_CHAR('f_text1')))->getStringPtr(); + } +#elif REGION_JPN TEXT_SPAN stringPtr1 = static_cast(mpScreen->search(MULTI_CHAR('i_text1')))->getStringPtr(); #else TEXT_SPAN stringPtr1 = static_cast(mpScreen->search(MULTI_CHAR('f_text1')))->getStringPtr(); #endif SAFE_STRCPY(stringPtr1, ""); -#if REGION_JPN +#if TARGET_PC + TEXT_SPAN stringPtr0; + if (dusk::version::isRegionJpn()) { + stringPtr0 = static_cast(mpScreen->search(MULTI_CHAR('i_text0')))->getStringPtr(); + } else { + stringPtr0 = static_cast(mpScreen->search(MULTI_CHAR('f_text0')))->getStringPtr(); + } +#elif REGION_JPN TEXT_SPAN stringPtr0 = static_cast(mpScreen->search(MULTI_CHAR('i_text0')))->getStringPtr(); #else TEXT_SPAN stringPtr0 = static_cast(mpScreen->search(MULTI_CHAR('f_text0')))->getStringPtr(); #endif SAFE_STRCPY(stringPtr0, ""); } else { -#if REGION_JPN +#if TARGET_PC + J2DTextBox* textBox1; + if (dusk::version::isRegionJpn()) { + textBox1 = static_cast(mpScreen->search(MULTI_CHAR('i_text1'))); + } else { + textBox1 = static_cast(mpScreen->search(MULTI_CHAR('f_text1'))); + } +#elif REGION_JPN J2DTextBox* textBox1 = static_cast(mpScreen->search(MULTI_CHAR('i_text1'))); #else J2DTextBox* textBox1 = static_cast(mpScreen->search(MULTI_CHAR('f_text1'))); #endif mpString->getString(mItemNameString, textBox1, NULL, NULL, NULL, 0); -#if REGION_JPN +#if TARGET_PC + J2DTextBox* textBox0; + if (dusk::version::isRegionJpn()) { + textBox0 = static_cast(mpScreen->search(MULTI_CHAR('i_text0'))); + } else { + textBox0 = static_cast(mpScreen->search(MULTI_CHAR('f_text0'))); + } +#elif REGION_JPN J2DTextBox* textBox0 = static_cast(mpScreen->search(MULTI_CHAR('i_text0'))); #else J2DTextBox* textBox0 = static_cast(mpScreen->search(MULTI_CHAR('f_text0'))); #endif mpString->getString(mItemNameString, textBox0, NULL, NULL, NULL, 0); -#if REGION_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + textBox0 = static_cast(mpScreen->search(MULTI_CHAR('i_text0'))); + } else { + textBox0 = static_cast(mpScreen->search(MULTI_CHAR('f_text0'))); + } +#elif REGION_JPN textBox0 = static_cast(mpScreen->search(MULTI_CHAR('i_text0'))); #else textBox0 = static_cast(mpScreen->search(MULTI_CHAR('f_text0'))); @@ -2448,7 +2563,29 @@ void dMenu_Collect2D_c::setItemNameString(u8 param_0, u8 param_1) { if (uVar6 == 0) { setItemNameStringNull(); } else { -#if REGION_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + TEXT_SPAN stringPtr = + static_cast(mpScreen->search(MULTI_CHAR('item_n00')))->getStringPtr(); + dMeter2Info_getStringKanji(uVar6, stringPtr, NULL); + stringPtr = static_cast(mpScreen->search(MULTI_CHAR('item_n01')))->getStringPtr(); + dMeter2Info_getStringKanji(uVar6, stringPtr, NULL); + stringPtr = static_cast(mpScreen->search(MULTI_CHAR('item_n02')))->getStringPtr(); + dMeter2Info_getStringKanji(uVar6, stringPtr, NULL); + stringPtr = static_cast(mpScreen->search(MULTI_CHAR('item_n03')))->getStringPtr(); + dMeter2Info_getStringKanji(uVar6, stringPtr, NULL); + } else { + TEXT_SPAN stringPtr = + static_cast(mpScreen->search(MULTI_CHAR('item_n04')))->getStringPtr(); + dMeter2Info_getStringKanji(uVar6, stringPtr, NULL); + stringPtr = static_cast(mpScreen->search(MULTI_CHAR('item_n05')))->getStringPtr(); + dMeter2Info_getStringKanji(uVar6, stringPtr, NULL); + stringPtr = static_cast(mpScreen->search(MULTI_CHAR('item_n06')))->getStringPtr(); + dMeter2Info_getStringKanji(uVar6, stringPtr, NULL); + stringPtr = static_cast(mpScreen->search(MULTI_CHAR('item_n07')))->getStringPtr(); + dMeter2Info_getStringKanji(uVar6, stringPtr, NULL); + } +#elif REGION_JPN TEXT_SPAN stringPtr = static_cast(mpScreen->search(MULTI_CHAR('item_n00')))->getStringPtr(); dMeter2Info_getStringKanji(uVar6, stringPtr, NULL); @@ -2475,7 +2612,26 @@ void dMenu_Collect2D_c::setItemNameString(u8 param_0, u8 param_1) { void dMenu_Collect2D_c::setItemNameStringNull() { mItemNameString = 0; -#if REGION_JPN +#if TARGET_PC + J2DTextBox* textBox; + if (dusk::version::isRegionJpn()) { + textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n00')); + SAFE_STRCPY(textBox->getStringPtr(), ""); + textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n01')); + SAFE_STRCPY(textBox->getStringPtr(), ""); + textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n02')); + SAFE_STRCPY(textBox->getStringPtr(), ""); + textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n03')); + } else { + textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n04')); + SAFE_STRCPY(textBox->getStringPtr(), ""); + textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n05')); + SAFE_STRCPY(textBox->getStringPtr(), ""); + textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n06')); + SAFE_STRCPY(textBox->getStringPtr(), ""); + textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n07')); + } +#elif REGION_JPN J2DTextBox* textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n00')); SAFE_STRCPY(textBox->getStringPtr(), ""); textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n01')); diff --git a/src/d/d_menu_dmap.cpp b/src/d/d_menu_dmap.cpp index 36348b4387..b71c756283 100644 --- a/src/d/d_menu_dmap.cpp +++ b/src/d/d_menu_dmap.cpp @@ -26,6 +26,7 @@ #include "m_Do/m_Do_graphic.h" #include +#include "dusk/version.hpp" #include "helpers/string.hpp" #if TARGET_PC @@ -304,6 +305,16 @@ void dMenu_DmapBg_c::buttonIconScreenInit() { static u64 const cont_bt[5] = {MULTI_CHAR('cont_bt'), MULTI_CHAR('cont_bt1'), MULTI_CHAR('cont_bt2'), MULTI_CHAR('cont_bt3'), MULTI_CHAR('cont_bt4')}; static u64 const font_at[5] = {MULTI_CHAR('font_at'), MULTI_CHAR('font_at1'), MULTI_CHAR('font_at2'), MULTI_CHAR('font_at3'), MULTI_CHAR('font_at4')}; static u64 const font_bt[5] = {MULTI_CHAR('font_bt'), MULTI_CHAR('font_bt1'), MULTI_CHAR('font_bt2'), MULTI_CHAR('font_bt3'), MULTI_CHAR('font_bt4')}; + + #if TARGET_PC + static u64 const c_tag_jpn[2] = { + MULTI_CHAR('c_text_s'), MULTI_CHAR('c_text') + }; + + static u64 const c_tag[2] = { + MULTI_CHAR('f_text_s'), MULTI_CHAR('f_text') + }; + #else static u64 const c_tag[2] = { #if VERSION == VERSION_GCN_JPN MULTI_CHAR('c_text_s'), MULTI_CHAR('c_text') @@ -311,6 +322,7 @@ void dMenu_DmapBg_c::buttonIconScreenInit() { MULTI_CHAR('f_text_s'), MULTI_CHAR('f_text') #endif }; + #endif mButtonScreen = JKR_NEW J2DScreen(); JUT_ASSERT(916, mButtonScreen != NULL); @@ -350,7 +362,23 @@ void dMenu_DmapBg_c::buttonIconScreenInit() { mpJButton = NULL; for (int i = 0; i < 5; i++) { - #if VERSION == VERSION_GCN_JPN + #if TARGET_PC + if (dusk::version::isRegionJpn()) { + ((J2DTextBox*)mButtonScreen->search(cont_at[i]))->setFont(mDoExt_getMesgFont()); + ((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->setFont(mDoExt_getMesgFont()); + ((J2DTextBox*)mButtonScreen->search(cont_at[i]))->setString(32, ""); + ((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->setString(32, ""); + ((J2DTextBox*)mButtonScreen->search(font_at[i]))->hide(); + ((J2DTextBox*)mButtonScreen->search(font_bt[i]))->hide(); + } else { + ((J2DTextBox*)mButtonScreen->search(font_at[i]))->setFont(mDoExt_getMesgFont()); + ((J2DTextBox*)mButtonScreen->search(font_bt[i]))->setFont(mDoExt_getMesgFont()); + ((J2DTextBox*)mButtonScreen->search(font_at[i]))->setString(32, ""); + ((J2DTextBox*)mButtonScreen->search(font_bt[i]))->setString(32, ""); + ((J2DTextBox*)mButtonScreen->search(cont_at[i]))->hide(); + ((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->hide(); + } + #elif VERSION == VERSION_GCN_JPN ((J2DTextBox*)mButtonScreen->search(cont_at[i]))->setFont(mDoExt_getMesgFont()); ((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->setFont(mDoExt_getMesgFont()); ((J2DTextBox*)mButtonScreen->search(cont_at[i]))->setString(32, ""); @@ -372,7 +400,7 @@ void dMenu_DmapBg_c::buttonIconScreenInit() { J2DTextBox* textBox; for (int i = 0; i < 2; i++) { - textBox = ((J2DTextBox*)mButtonScreen->search(c_tag[i])); + textBox = ((J2DTextBox*)mButtonScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? c_tag_jpn[i] : c_tag[i], c_tag[i]))); textBox->setFont(mDoExt_getMesgFont()); textBox->setString(32, ""); } @@ -389,6 +417,14 @@ void dMenu_DmapBg_c::buttonIconScreenInit() { } void dMenu_DmapBg_c::setAButtonString(u32 i_msgNo) { +#if TARGET_PC + static u64 const cont_at_jpn[5] = { + MULTI_CHAR('cont_at'), MULTI_CHAR('cont_at1'), MULTI_CHAR('cont_at2'), MULTI_CHAR('cont_at3'), MULTI_CHAR('cont_at4') + }; + static u64 const cont_at[5] = { + MULTI_CHAR('font_at'), MULTI_CHAR('font_at1'), MULTI_CHAR('font_at2'), MULTI_CHAR('font_at3'), MULTI_CHAR('font_at4') + }; +#else static u64 const cont_at[5] = { #if VERSION == VERSION_GCN_JPN MULTI_CHAR('cont_at'), MULTI_CHAR('cont_at1'), MULTI_CHAR('cont_at2'), MULTI_CHAR('cont_at3'), MULTI_CHAR('cont_at4') @@ -396,16 +432,26 @@ void dMenu_DmapBg_c::setAButtonString(u32 i_msgNo) { MULTI_CHAR('font_at'), MULTI_CHAR('font_at1'), MULTI_CHAR('font_at2'), MULTI_CHAR('font_at3'), MULTI_CHAR('font_at4') #endif }; +#endif + for (int i = 0; i < 5; i++) { if (i_msgNo == 0) { - SAFE_STRCPY(((J2DTextBox*)mButtonScreen->search(cont_at[i]))->getStringPtr(), ""); + SAFE_STRCPY(((J2DTextBox*)mButtonScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? cont_at_jpn[i] : cont_at[i], cont_at[i])))->getStringPtr(), ""); } else { - dMeter2Info_getStringKanji(i_msgNo, ((J2DTextBox*)mButtonScreen->search(cont_at[i]))->getStringPtr(), NULL); + dMeter2Info_getStringKanji(i_msgNo, ((J2DTextBox*)mButtonScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? cont_at_jpn[i] : cont_at[i], cont_at[i])))->getStringPtr(), NULL); } } } void dMenu_DmapBg_c::setBButtonString(u32 i_msgNo) { +#if TARGET_PC + static u64 const cont_bt_jpn[5] = { + MULTI_CHAR('cont_bt'), MULTI_CHAR('cont_bt1'), MULTI_CHAR('cont_bt2'), MULTI_CHAR('cont_bt3'), MULTI_CHAR('cont_bt4') + }; + static u64 const cont_bt[5] = { + MULTI_CHAR('font_bt'), MULTI_CHAR('font_bt1'), MULTI_CHAR('font_bt2'), MULTI_CHAR('font_bt3'), MULTI_CHAR('font_bt4') + }; +#else static u64 const cont_bt[5] = { #if VERSION == VERSION_GCN_JPN MULTI_CHAR('cont_bt'), MULTI_CHAR('cont_bt1'), MULTI_CHAR('cont_bt2'), MULTI_CHAR('cont_bt3'), MULTI_CHAR('cont_bt4') @@ -413,11 +459,13 @@ void dMenu_DmapBg_c::setBButtonString(u32 i_msgNo) { MULTI_CHAR('font_bt'), MULTI_CHAR('font_bt1'), MULTI_CHAR('font_bt2'), MULTI_CHAR('font_bt3'), MULTI_CHAR('font_bt4') #endif }; +#endif + for (int i = 0; i < 5; i++) { if (i_msgNo == 0) { - SAFE_STRCPY(((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->getStringPtr(), ""); + SAFE_STRCPY(((J2DTextBox*)mButtonScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? cont_bt_jpn[i] : cont_bt[i], cont_bt[i])))->getStringPtr(), ""); } else { - dMeter2Info_getStringKanji(i_msgNo, ((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->getStringPtr(), NULL); + dMeter2Info_getStringKanji(i_msgNo, ((J2DTextBox*)mButtonScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? cont_bt_jpn[i] : cont_bt[i], cont_bt[i])))->getStringPtr(), NULL); } } } @@ -429,6 +477,14 @@ static f32 player_py; DUSK_GAME_DATA dMenu_Dmap_c* dMenu_Dmap_c::myclass; void dMenu_DmapBg_c::setCButtonString(u32 i_msgNo) { +#if TARGET_PC + static u64 const c_tag_jpn[2] = { + MULTI_CHAR('c_text_s'), MULTI_CHAR('c_text') + }; + static u64 const c_tag[2] = { + MULTI_CHAR('c_text_s'), MULTI_CHAR('c_text') + }; +#else static u64 const c_tag[2] = { #if VERSION == VERSION_GCN_JPN MULTI_CHAR('c_text_s'), MULTI_CHAR('c_text') @@ -436,6 +492,7 @@ void dMenu_DmapBg_c::setCButtonString(u32 i_msgNo) { MULTI_CHAR('f_text_s'), MULTI_CHAR('f_text') #endif }; +#endif int i; u32 msgNo; @@ -447,12 +504,12 @@ void dMenu_DmapBg_c::setCButtonString(u32 i_msgNo) { if (msgNo == 0) { for (i = 0; i < 2; i++) { - SAFE_STRCPY(((J2DTextBox*)mButtonScreen->search(c_tag[i]))->getStringPtr(), ""); + SAFE_STRCPY(((J2DTextBox*)mButtonScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? c_tag_jpn[i] : c_tag[i], c_tag[i])))->getStringPtr(), ""); } mpCButton->setAlphaRate(0.5f); } else { for (i = 0; i < 2; i++) { - dMeter2Info_getStringKanji(msgNo, ((J2DTextBox*)mButtonScreen->search(c_tag[i]))->getStringPtr(), NULL); + dMeter2Info_getStringKanji(msgNo, ((J2DTextBox*)mButtonScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? c_tag_jpn[i] : c_tag[i], c_tag[i])))->getStringPtr(), NULL); } mpCButton->setAlphaRate(1.0f); } @@ -511,7 +568,16 @@ void dMenu_DmapBg_c::baseScreenInit() { mpDrawCursor->setAlphaRate(1.0f); mpDrawCursor->setParam(0.95f, 0.9f, 0.1f, 0.6f, 0.5f); - #if VERSION == VERSION_GCN_JPN + #if TARGET_PC + J2DTextBox* uVar9; + if (dusk::version::isRegionJpn()) { + uVar9 = (J2DTextBox*)mBaseScreen->search(MULTI_CHAR('t_t00')); + mBaseScreen->search(MULTI_CHAR('f_t_00'))->hide(); + } else { + uVar9 = (J2DTextBox*)mBaseScreen->search(MULTI_CHAR('f_t_00')); + mBaseScreen->search(MULTI_CHAR('t_t00'))->hide(); + } + #elif VERSION == VERSION_GCN_JPN J2DTextBox* uVar9 = (J2DTextBox*)mBaseScreen->search(MULTI_CHAR('t_t00')); mBaseScreen->search(MULTI_CHAR('f_t_00'))->hide(); #else @@ -541,7 +607,12 @@ void dMenu_DmapBg_c::setFloorMessage() { 0x036E, 0x036F, 0x03DC, 0x03DD, 0x03D9, 0x03D8, }; - #if VERSION == VERSION_GCN_JPN + #if TARGET_PC + u64 tag0 = dusk::version::isRegionJpn() ? MULTI_CHAR('ffoor0_0') : MULTI_CHAR('floor0_0'); + #define FLOOR_TAG(A, B) (tag0 | (A<<16) | (B)) + u64 tag1 = dusk::version::isRegionJpn() ? MULTI_CHAR('floor0_0') : MULTI_CHAR('ffoor0_0'); + #define FFOOR_TAG(A, B) (tag1 | (A<<16) | (B)) + #elif VERSION == VERSION_GCN_JPN #define FLOOR_TAG(A, B) (MULTI_CHAR('ffoor0_0') | (A<<16) | (B)) #define FFOOR_TAG(A, B) (MULTI_CHAR('floor0_0') | (A<<16) | (B)) #else diff --git a/src/d/d_menu_fishing.cpp b/src/d/d_menu_fishing.cpp index 2af4291525..eb24852160 100644 --- a/src/d/d_menu_fishing.cpp +++ b/src/d/d_menu_fishing.cpp @@ -305,7 +305,16 @@ void dMenu_Fishing_c::screenSetBase() { mpFishInfoParent[0] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('info_blu'), 0, NULL); mpFishInfoParent[1] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('info_red'), 0, NULL); - #if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN) + #if TARGET_PC + J2DTextBox* textBox; + if (dusk::version::isRegionJpn()) { + textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('t_t00')); + mpScreen->search(MULTI_CHAR('f_t00'))->hide(); + } else { + textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('f_t00')); + mpScreen->search(MULTI_CHAR('t_t00'))->hide(); + } + #elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN) J2DTextBox* textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('t_t00')); mpScreen->search(MULTI_CHAR('f_t00'))->hide(); #else diff --git a/src/d/d_menu_fmap2D.cpp b/src/d/d_menu_fmap2D.cpp index 8b4e4b59b9..9d1d17ca0e 100644 --- a/src/d/d_menu_fmap2D.cpp +++ b/src/d/d_menu_fmap2D.cpp @@ -23,6 +23,8 @@ #endif #include +#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(mpTitleScreen->search(area_name[i]))->setFont(mDoExt_getRubyFont()); + static_cast(mpTitleScreen->search(area_name[i]))->setString(0x40, ""); + mpTitleScreen->search(farea_name[i])->hide(); + } else { + static_cast(mpTitleScreen->search(farea_name[i]))->setFont(mDoExt_getRubyFont()); + static_cast(mpTitleScreen->search(farea_name[i]))->setString(0x40, ""); + mpTitleScreen->search(area_name[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN static_cast(mpTitleScreen->search(area_name[i])) ->setFont(mDoExt_getRubyFont()); static_cast(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(mpTitleScreen->search(sfont_name[i]))->setFont(mDoExt_getRubyFont()); + static_cast(mpTitleScreen->search(sfont_name[i]))->setString(0x40, ""); + mpTitleScreen->search(ffont_name[i])->hide(); + } else { + static_cast(mpTitleScreen->search(ffont_name[i]))->setFont(mDoExt_getRubyFont()); + static_cast(mpTitleScreen->search(ffont_name[i]))->setString(0x40, ""); + mpTitleScreen->search(sfont_name[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN static_cast(mpTitleScreen->search(sfont_name[i])) ->setFont(mDoExt_getRubyFont()); static_cast(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(mpTitleScreen->search(cont_zt[i]))->setFont(mDoExt_getMesgFont()); + static_cast(mpTitleScreen->search(cont_zt[i]))->setString(0x20, ""); + mpTitleScreen->search(font_zt[i])->hide(); + } else { + static_cast(mpTitleScreen->search(font_zt[i]))->setFont(mDoExt_getMesgFont()); + static_cast(mpTitleScreen->search(font_zt[i]))->setString(0x20, ""); + mpTitleScreen->search(cont_zt[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN static_cast(mpTitleScreen->search(cont_zt[i])) ->setFont(mDoExt_getMesgFont()); static_cast(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(mpTitleScreen->search(cont_bt[i]))->setFont(mDoExt_getMesgFont()); + static_cast(mpTitleScreen->search(cont_bt[i]))->setString(0x20, ""); + mpTitleScreen->search(font_bt[i])->hide(); + } else { + static_cast(mpTitleScreen->search(font_bt[i]))->setFont(mDoExt_getMesgFont()); + static_cast(mpTitleScreen->search(font_bt[i]))->setString(0x20, ""); + mpTitleScreen->search(cont_bt[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN static_cast(mpTitleScreen->search(cont_bt[i])) ->setFont(mDoExt_getMesgFont()); static_cast(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(mpTitleScreen->search(cont_at[i]))->setFont(mDoExt_getMesgFont()); + static_cast(mpTitleScreen->search(cont_at[i]))->setString(0x20, ""); + mpTitleScreen->search(font_at[i])->hide(); + } else { + static_cast(mpTitleScreen->search(font_at[i]))->setFont(mDoExt_getMesgFont()); + static_cast(mpTitleScreen->search(font_at[i]))->setString(0x20, ""); + mpTitleScreen->search(cont_at[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN static_cast(mpTitleScreen->search(cont_at[i])) ->setFont(mDoExt_getMesgFont()); static_cast(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(mpTitleScreen->search(juji_c[i]))->setFont(mDoExt_getMesgFont()); + static_cast(mpTitleScreen->search(juji_c[i]))->setString(0x20, ""); + mpTitleScreen->search(fuji_c[i])->hide(); + } else { + static_cast(mpTitleScreen->search(fuji_c[i]))->setFont(mDoExt_getMesgFont()); + static_cast(mpTitleScreen->search(fuji_c[i]))->setString(0x20, ""); + mpTitleScreen->search(juji_c[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN static_cast(mpTitleScreen->search(juji_c[i])) ->setFont(mDoExt_getMesgFont()); static_cast(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(mpTitleScreen->search(ast_c[i]))->setFont(mDoExt_getMesgFont()); + static_cast(mpTitleScreen->search(ast_c[i]))->setString(0x20, ""); + mpTitleScreen->search(fst_c[i])->hide(); + } else { + static_cast(mpTitleScreen->search(fst_c[i]))->setFont(mDoExt_getMesgFont()); + static_cast(mpTitleScreen->search(fst_c[i]))->setString(0x20, ""); + mpTitleScreen->search(ast_c[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN static_cast(mpTitleScreen->search(ast_c[i])) ->setFont(mDoExt_getMesgFont()); static_cast(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(mpTitleScreen->search(juji_c[i])); + J2DTextBox* text_box = static_cast(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(mpTitleScreen->search(juji_c[i])); + J2DTextBox* text_box = static_cast(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(mpTitleScreen->search(ast_c[i])); + J2DTextBox* text_box = static_cast(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(mpTitleScreen->search(ast_c[i])); + J2DTextBox* text_box = static_cast(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(); diff --git a/src/d/d_menu_insect.cpp b/src/d/d_menu_insect.cpp index aa18407b09..e7917532a2 100644 --- a/src/d/d_menu_insect.cpp +++ b/src/d/d_menu_insect.cpp @@ -22,6 +22,8 @@ #include #include +#include "dusk/version.hpp" + #if TARGET_PC #include "dusk/menu_pointer.h" #endif @@ -535,7 +537,16 @@ void dMenu_Insect_c::screenSetBase() { } } } -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + J2DTextBox* textBox; + if (dusk::version::isRegionJpn()) { + textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('t_t00')); + mpScreen->search(MULTI_CHAR('f_t00'))->hide(); + } else { + textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('f_t00')); + mpScreen->search(MULTI_CHAR('t_t00'))->hide(); + } +#elif VERSION == VERSION_GCN_JPN J2DTextBox* textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('t_t00')); mpScreen->search(MULTI_CHAR('f_t00'))->hide(); #else @@ -558,7 +569,19 @@ void dMenu_Insect_c::screenSetExplain() { if (field_0xf6 == 0) { mpExpSubWin[1]->hide(); } -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + mpInfoText = JKR_NEW CPaneMgr(mpExpScreen, MULTI_CHAR('mg_3line'), 0, NULL); + mpExpScreen->search(MULTI_CHAR('n_e4line'))->hide(); + field_0x5c = (J2DTextBox*)mpExpScreen->search(MULTI_CHAR('w_msg_jp')); + mpExpScreen->search(MULTI_CHAR('ms_for_2'))->hide(); + } else { + mpInfoText = JKR_NEW CPaneMgr(mpExpScreen, MULTI_CHAR('mg_e4lin'), 0, NULL); + mpExpScreen->search(MULTI_CHAR('n_3line'))->hide(); + field_0x5c = (J2DTextBox*)mpExpScreen->search(MULTI_CHAR('ms_for_2')); + mpExpScreen->search(MULTI_CHAR('w_msg_jp'))->hide(); + } +#elif VERSION == VERSION_GCN_JPN mpInfoText = JKR_NEW CPaneMgr(mpExpScreen, MULTI_CHAR('mg_3line'), 0, NULL); mpExpScreen->search(MULTI_CHAR('n_e4line'))->hide(); field_0x5c = (J2DTextBox*)mpExpScreen->search(MULTI_CHAR('w_msg_jp')); diff --git a/src/d/d_menu_item_explain.cpp b/src/d/d_menu_item_explain.cpp index bebcb2cdb0..9ef85ed32e 100644 --- a/src/d/d_menu_item_explain.cpp +++ b/src/d/d_menu_item_explain.cpp @@ -5,25 +5,26 @@ #include "d/dolzel.h" // IWYU pragma: keep -#include "d/d_menu_item_explain.h" +#include +#include #include "JSystem/J2DGraph/J2DTextBox.h" #include "JSystem/JKernel/JKRExpHeap.h" #include "JSystem/JUtility/JUTTexture.h" -#include -#include #include "d/actor/d_a_player.h" #include "d/d_com_inf_game.h" #include "d/d_item.h" #include "d/d_kantera_icon_meter.h" #include "d/d_lib.h" -#include "d/d_select_cursor.h" +#include "d/d_menu_item_explain.h" #include "d/d_meter2_info.h" #include "d/d_meter_HIO.h" -#include "d/d_msg_string.h" -#include "m_Do/m_Do_controller_pad.h" -#include "m_Do/m_Do_graphic.h" #include "d/d_msg_scrn_3select.h" #include "d/d_msg_scrn_arrow.h" +#include "d/d_msg_string.h" +#include "d/d_select_cursor.h" +#include "dusk/version.hpp" +#include "m_Do/m_Do_controller_pad.h" +#include "m_Do/m_Do_graphic.h" typedef void (dMenu_ItemExplain_c::*initFunc)(); static initFunc init_process[] = { @@ -103,7 +104,16 @@ dMenu_ItemExplain_c::dMenu_ItemExplain_c(JKRExpHeap* i_heap, JKRArchive* i_archi mDescAlpha = 0.0f; field_0x78 = 0; mAlphaRatio = 201.0f; -#if VERSION == VERSION_GCN_JPN + +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + mpInfoText = JKR_NEW CPaneMgr(mpInfoScreen, MULTI_CHAR('i_text4'), 0, NULL); + mpInfoScreen->search(MULTI_CHAR('i_text1'))->hide(); + } else { + mpInfoText = JKR_NEW CPaneMgr(mpInfoScreen, MULTI_CHAR('i_text1'), 0, NULL); + mpInfoScreen->search(MULTI_CHAR('i_text4'))->hide(); + } +#elif VERSION == VERSION_GCN_JPN mpInfoText = JKR_NEW CPaneMgr(mpInfoScreen, MULTI_CHAR('i_text4'), 0, NULL); mpInfoScreen->search(MULTI_CHAR('i_text1'))->hide(); #else @@ -114,7 +124,15 @@ dMenu_ItemExplain_c::dMenu_ItemExplain_c(JKRExpHeap* i_heap, JKRArchive* i_archi ((J2DTextBox*)(mpInfoText->getPanePtr()))->setString(0x200, ""); mpInfoText->show(); for (int i = 0; i < 4; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + mpNameText[i] = JKR_NEW CPaneMgr(mpInfoScreen, name_tag[i], 0, NULL); + mpInfoScreen->search(fame_tag[i])->hide(); + } else { + mpNameText[i] = JKR_NEW CPaneMgr(mpInfoScreen, fame_tag[i], 0, NULL); + mpInfoScreen->search(name_tag[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN mpNameText[i] = JKR_NEW CPaneMgr(mpInfoScreen, name_tag[i], 0, NULL); mpInfoScreen->search(fame_tag[i])->hide(); #else diff --git a/src/d/d_menu_letter.cpp b/src/d/d_menu_letter.cpp index 3f997bbda5..a1349e9fe5 100644 --- a/src/d/d_menu_letter.cpp +++ b/src/d/d_menu_letter.cpp @@ -21,6 +21,7 @@ #include "dusk/achievements.h" #include "dusk/menu_pointer.h" #include "dusk/ui/touch_controls.hpp" +#include "dusk/version.hpp" static void enable_turn_page_controls(bool enabled) { const auto controlOverride = @@ -30,7 +31,9 @@ static void enable_turn_page_controls(bool enabled) { } #endif -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC +#define D_MENU_LETTER_LINE_MAX (dusk::version::isRegionJpn() ? 9 : 12) +#elif VERSION == VERSION_GCN_JPN #define D_MENU_LETTER_LINE_MAX 9 #else #define D_MENU_LETTER_LINE_MAX 12 @@ -459,7 +462,16 @@ void dMenu_Letter_c::wait_move() { } if (mProcess == 1 || mProcess == 2) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + J2DTextBox* textBox; + if (dusk::version::isRegionJpn()) { + textBox = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('t_t00')); + mpBaseScreen->search(MULTI_CHAR('f_t_00'))->hide(); + } else { + textBox = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('f_t_00')); + mpBaseScreen->search(MULTI_CHAR('t_t00'))->hide(); + } +#elif VERSION == VERSION_GCN_JPN J2DTextBox* textBox = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('t_t00')); mpBaseScreen->search(MULTI_CHAR('f_t_00'))->hide(); #else @@ -811,6 +823,15 @@ void dMenu_Letter_c::screenSetMenu() { static const u64 tag_frame[6] = { MULTI_CHAR('flame_00'), MULTI_CHAR('flame_01'), MULTI_CHAR('flame_02'), MULTI_CHAR('flame_03'), MULTI_CHAR('flame_04'), MULTI_CHAR('flame_05'), }; + +#if TARGET_PC + static const u64 tag_menu0_jpn[6] = { + MULTI_CHAR('menu_t0'), MULTI_CHAR('menu_t1'), MULTI_CHAR('menu_t2'), MULTI_CHAR('menu_t3'), MULTI_CHAR('menu_t4'), MULTI_CHAR('menu_t5'), + }; + static const u64 tag_menu0[6] = { + MULTI_CHAR('fenu_t0'), MULTI_CHAR('fenu_t1'), MULTI_CHAR('fenu_t2'), MULTI_CHAR('fenu_t3'), MULTI_CHAR('fenu_t4'), MULTI_CHAR('fenu_t5'), + }; +#else static const u64 tag_menu0[6] = { #if VERSION == VERSION_GCN_JPN MULTI_CHAR('menu_t0'), MULTI_CHAR('menu_t1'), MULTI_CHAR('menu_t2'), MULTI_CHAR('menu_t3'), MULTI_CHAR('menu_t4'), MULTI_CHAR('menu_t5'), @@ -818,6 +839,16 @@ void dMenu_Letter_c::screenSetMenu() { MULTI_CHAR('fenu_t0'), MULTI_CHAR('fenu_t1'), MULTI_CHAR('fenu_t2'), MULTI_CHAR('fenu_t3'), MULTI_CHAR('fenu_t4'), MULTI_CHAR('fenu_t5'), #endif }; +#endif + +#if TARGET_PC + static const u64 tag_menu1_jpn[6] = { + MULTI_CHAR('menu_f6'), MULTI_CHAR('menu_f7'), MULTI_CHAR('menu_t8'), MULTI_CHAR('menu_t9'), MULTI_CHAR('menu_t10'), MULTI_CHAR('menu_t11'), + }; + static const u64 tag_menu1[6] = { + MULTI_CHAR('fenu_t6'), MULTI_CHAR('fenu_t7'), MULTI_CHAR('fenu_t8'), MULTI_CHAR('fenu_t9'), MULTI_CHAR('fenu_t10'), MULTI_CHAR('fenu_t11'), + }; +#else static const u64 tag_menu1[6] = { #if VERSION == VERSION_GCN_JPN MULTI_CHAR('menu_f6'), MULTI_CHAR('menu_f7'), MULTI_CHAR('menu_t8'), MULTI_CHAR('menu_t9'), MULTI_CHAR('menu_t10'), MULTI_CHAR('menu_t11'), @@ -825,6 +856,8 @@ void dMenu_Letter_c::screenSetMenu() { MULTI_CHAR('fenu_t6'), MULTI_CHAR('fenu_t7'), MULTI_CHAR('fenu_t8'), MULTI_CHAR('fenu_t9'), MULTI_CHAR('fenu_t10'), MULTI_CHAR('fenu_t11'), #endif }; +#endif + static const u64 tag_midoku[6] = { MULTI_CHAR('midoku_0'), MULTI_CHAR('midoku_1'), MULTI_CHAR('midoku_2'), MULTI_CHAR('midoku_3'), MULTI_CHAR('midoku_4'), MULTI_CHAR('midoku_5'), }; @@ -838,7 +871,27 @@ void dMenu_Letter_c::screenSetMenu() { JUT_ASSERT(1161, mpParent[0] != NULL); mpParent[0]->setAlphaRate(0.0f); for (int i = 0; i < 6; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + field_0x124[i][0] = (J2DTextBox*)mpMenuScreen->search(tag_sub0[i]); + field_0x124[i][1] = (J2DTextBox*)mpMenuScreen->search(tag_sub1[i]); + field_0x124[i][2] = (J2DTextBox*)mpMenuScreen->search(tag_name0[i]); + field_0x124[i][3] = (J2DTextBox*)mpMenuScreen->search(tag_name1[i]); + mpMenuScreen->search(ftag_sub0[i])->hide(); + mpMenuScreen->search(ftag_sub1[i])->hide(); + mpMenuScreen->search(ftag_name0[i])->hide(); + mpMenuScreen->search(ftag_name1[i])->hide(); + } else { + field_0x124[i][0] = (J2DTextBox*)mpMenuScreen->search(ftag_sub0[i]); + field_0x124[i][1] = (J2DTextBox*)mpMenuScreen->search(ftag_sub1[i]); + field_0x124[i][2] = (J2DTextBox*)mpMenuScreen->search(ftag_name0[i]); + field_0x124[i][3] = (J2DTextBox*)mpMenuScreen->search(ftag_name1[i]); + mpMenuScreen->search(tag_sub0[i])->hide(); + mpMenuScreen->search(tag_sub1[i])->hide(); + mpMenuScreen->search(tag_name0[i])->hide(); + mpMenuScreen->search(tag_name1[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN field_0x124[i][0] = (J2DTextBox*)mpMenuScreen->search(tag_sub0[i]); field_0x124[i][1] = (J2DTextBox*)mpMenuScreen->search(tag_sub1[i]); field_0x124[i][2] = (J2DTextBox*)mpMenuScreen->search(tag_name0[i]); @@ -868,8 +921,8 @@ void dMenu_Letter_c::screenSetMenu() { } for (int i = 0; i < 6; i++) { field_0x34[i][0] = mpMenuScreen->search(tag_frame[i]); - field_0x34[i][1] = mpMenuScreen->search(tag_menu0[i]); - field_0x34[i][2] = mpMenuScreen->search(tag_menu1[i]); + field_0x34[i][1] = mpMenuScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? tag_menu0_jpn[i] : tag_menu0[i], tag_menu0[i])); + field_0x34[i][2] = mpMenuScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? tag_menu1_jpn[i] : tag_menu1[i], tag_menu1[i])); field_0x34[i][3] = mpMenuScreen->search(tag_letter[i]); field_0x34[i][4] = mpMenuScreen->search(tag_midoku[i]); if (i < field_0x373) { @@ -909,7 +962,27 @@ void dMenu_Letter_c::screenSetMenu() { mpDMYParent = JKR_NEW CPaneMgr(mpMenuDMYScreen, MULTI_CHAR('n_all'), 2, NULL); JUT_ASSERT(1285, mpDMYParent != NULL); for (int i = 0; i < 6; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + field_0x184[i][0] = (J2DTextBox*)mpMenuDMYScreen->search(tag_sub0[i]); + field_0x184[i][1] = (J2DTextBox*)mpMenuDMYScreen->search(tag_sub1[i]); + field_0x184[i][2] = (J2DTextBox*)mpMenuDMYScreen->search(tag_name0[i]); + field_0x184[i][3] = (J2DTextBox*)mpMenuDMYScreen->search(tag_name1[i]); + mpMenuDMYScreen->search(ftag_sub0[i])->hide(); + mpMenuDMYScreen->search(ftag_sub1[i])->hide(); + mpMenuDMYScreen->search(ftag_name0[i])->hide(); + mpMenuDMYScreen->search(ftag_name1[i])->hide(); + } else { + field_0x184[i][0] = (J2DTextBox*)mpMenuDMYScreen->search(ftag_sub0[i]); + field_0x184[i][1] = (J2DTextBox*)mpMenuDMYScreen->search(ftag_sub1[i]); + field_0x184[i][2] = (J2DTextBox*)mpMenuDMYScreen->search(ftag_name0[i]); + field_0x184[i][3] = (J2DTextBox*)mpMenuDMYScreen->search(ftag_name1[i]); + mpMenuDMYScreen->search(tag_sub0[i])->hide(); + mpMenuDMYScreen->search(tag_sub1[i])->hide(); + mpMenuDMYScreen->search(tag_name0[i])->hide(); + mpMenuDMYScreen->search(tag_name1[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN field_0x184[i][0] = (J2DTextBox*)mpMenuDMYScreen->search(tag_sub0[i]); field_0x184[i][1] = (J2DTextBox*)mpMenuDMYScreen->search(tag_sub1[i]); field_0x184[i][2] = (J2DTextBox*)mpMenuDMYScreen->search(tag_name0[i]); @@ -964,7 +1037,16 @@ void dMenu_Letter_c::screenSetBase() { mpParent[1] = JKR_NEW CPaneMgr(mpBaseScreen, MULTI_CHAR('n_all'), 2, NULL); JUT_ASSERT(1372, mpParent[1] != NULL); mpParent[1]->setAlphaRate(0.0f); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + J2DTextBox* piVar9; + if (dusk::version::isRegionJpn()) { + piVar9 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('t_t00')); + mpBaseScreen->search(MULTI_CHAR('f_t_00'))->hide(); + } else { + piVar9 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('f_t_00')); + mpBaseScreen->search(MULTI_CHAR('t_t00'))->hide(); + } +#elif VERSION == VERSION_GCN_JPN J2DTextBox* piVar9 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('t_t00')); mpBaseScreen->search(MULTI_CHAR('f_t_00'))->hide(); #else @@ -975,7 +1057,31 @@ void dMenu_Letter_c::screenSetBase() { piVar9->setFont(mDoExt_getSubFont()); dComIfGp_setMessageCountNumber(field_0x374 + (field_0x36f + 1) * 100); mpString->getString(0x4d6, piVar9, NULL, NULL, NULL, 0); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + J2DTextBox* text1; + J2DTextBox* text2; + J2DTextBox* text3; + J2DTextBox* text4; + if (dusk::version::isRegionJpn()) { + text1 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('wps_text')); + text2 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('w_p_text')); + text3 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('g_ps_txt')); + text4 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('g_p_text')); + mpBaseScreen->search(MULTI_CHAR('fwpstex1'))->hide(); + mpBaseScreen->search(MULTI_CHAR('fwp_tex1'))->hide(); + mpBaseScreen->search(MULTI_CHAR('fgps_tx1'))->hide(); + mpBaseScreen->search(MULTI_CHAR('fgp_tex1'))->hide(); + } else { + text1 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('fwpstex1')); + text2 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('fwp_tex1')); + text3 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('fgps_tx1')); + text4 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('fgp_tex1')); + mpBaseScreen->search(MULTI_CHAR('wps_text'))->hide(); + mpBaseScreen->search(MULTI_CHAR('w_p_text'))->hide(); + mpBaseScreen->search(MULTI_CHAR('g_ps_txt'))->hide(); + mpBaseScreen->search(MULTI_CHAR('g_p_text'))->hide(); + } +#elif VERSION == VERSION_GCN_JPN J2DTextBox* text1 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('wps_text')); J2DTextBox* text2 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('w_p_text')); J2DTextBox* text3 = (J2DTextBox*)mpBaseScreen->search(MULTI_CHAR('g_ps_txt')); @@ -1059,7 +1165,96 @@ void dMenu_Letter_c::screenSetLetter() { JUT_ASSERT(1511, fg != false); dPaneClass_showNullPane(mpLetterScreen[0]); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + if (dComIfGs_getOptRuby() == 0) { + field_0x2ec[0] = JKR_NEW CPaneMgr(mpLetterScreen[0], MULTI_CHAR('t3f_s'), 0, NULL); + field_0x2ec[1] = JKR_NEW CPaneMgr(mpLetterScreen[0], MULTI_CHAR('mg_3flin'), 0, NULL); + field_0x2f4[0] = JKR_NEW CPaneMgr(mpLetterScreen[0], MULTI_CHAR('mg_3f_s'), 0, NULL); + field_0x2f4[1] = JKR_NEW CPaneMgr(mpLetterScreen[0], MULTI_CHAR('mg_3f'), 0, NULL); + mpLetterScreen[0]->search('t4_s')->hide(); + mpLetterScreen[0]->search(MULTI_CHAR('mg_e4lin'))->hide(); + mpLetterScreen[0]->search('t3_s')->hide(); + mpLetterScreen[0]->search(MULTI_CHAR('mg_3line'))->hide(); + mpLineParent = JKR_NEW CPaneMgr(mpLetterScreen[0], MULTI_CHAR('jp_fri_n'), 0, NULL); + JUT_ASSERT(1530, mpLineParent != NULL); + for (int i = 0; i < 12; i++) { + static u64 const line_tag[12] = { + MULTI_CHAR('line00'), MULTI_CHAR('line01'), MULTI_CHAR('line02'), MULTI_CHAR('line03'), MULTI_CHAR('line04'), MULTI_CHAR('line05'), + MULTI_CHAR('line06'), MULTI_CHAR('line07'), MULTI_CHAR('line08'), + }; + + if (line_tag[i] != 0) { + field_0x25c[i] = (J2DTextBox*)mpLetterScreen[0]->search(line_tag[i]); + } else { + field_0x25c[i] = NULL; + } + } + mpLetterScreen[0]->search('jp_n')->hide(); + mpLetterScreen[0]->search('us_n')->hide(); + + ((J2DTextBox*)field_0x2f4[0]->getPanePtr())->setLineSpace(((J2DTextBox*)field_0x2ec[0]->getPanePtr())->getLineSpace()); + ((J2DTextBox*)field_0x2f4[1]->getPanePtr())->setLineSpace(((J2DTextBox*)field_0x2ec[1]->getPanePtr())->getLineSpace()); + } else { + field_0x2ec[0] = JKR_NEW CPaneMgr(mpLetterScreen[0], 't3_s', 0, NULL); + field_0x2ec[1] = JKR_NEW CPaneMgr(mpLetterScreen[0], MULTI_CHAR('mg_3line'), 0, NULL); + for (int i = 0; i < 2; i++) { + field_0x2f4[i] = NULL; + } + mpLetterScreen[0]->search('t4_s')->hide(); + mpLetterScreen[0]->search(MULTI_CHAR('mg_e4lin'))->hide(); + mpLetterScreen[0]->search(MULTI_CHAR('t3f_s'))->hide(); + mpLetterScreen[0]->search(MULTI_CHAR('mg_3flin'))->hide(); + mpLetterScreen[0]->search(MULTI_CHAR('mg_3f_s'))->hide(); + mpLetterScreen[0]->search(MULTI_CHAR('mg_3f'))->hide(); + mpLineParent = JKR_NEW CPaneMgr(mpLetterScreen[0], 'jp_n', 0, NULL); + JUT_ASSERT(1530, mpLineParent != NULL); + for (int i = 0; i < 12; i++) { + static u64 const line_tag[12] = { + MULTI_CHAR('line21'), MULTI_CHAR('line22'), MULTI_CHAR('line23'), MULTI_CHAR('line24'), MULTI_CHAR('line25'), MULTI_CHAR('line26'), + MULTI_CHAR('line27'), MULTI_CHAR('line28'), MULTI_CHAR('line29'), + }; + + if (line_tag[i] != 0) { + field_0x25c[i] = (J2DTextBox*)mpLetterScreen[0]->search(line_tag[i]); + } else { + field_0x25c[i] = NULL; + } + } + + mpLetterScreen[0]->search(MULTI_CHAR('jp_fri_n'))->hide(); + mpLetterScreen[0]->search('us_n')->hide(); + } + } else { + static u64 const line_tag[12] = { + MULTI_CHAR('line09'), MULTI_CHAR('line10'), MULTI_CHAR('line11'), MULTI_CHAR('line12'), MULTI_CHAR('line13'), MULTI_CHAR('line14'), + MULTI_CHAR('line15'), MULTI_CHAR('line16'), MULTI_CHAR('line17'), MULTI_CHAR('line18'), MULTI_CHAR('line19'), MULTI_CHAR('line20'), + }; + + field_0x2ec[0] = JKR_NEW CPaneMgr(mpLetterScreen[0], 't4_s', 0, NULL); + field_0x2ec[1] = JKR_NEW CPaneMgr(mpLetterScreen[0], MULTI_CHAR('mg_e4lin'), 0, NULL); + for (int i = 0; i < 2; i++) { + field_0x2f4[i] = NULL; + } + mpLetterScreen[0]->search(MULTI_CHAR('t3f_s'))->hide(); + mpLetterScreen[0]->search(MULTI_CHAR('mg_3flin'))->hide(); + mpLetterScreen[0]->search(MULTI_CHAR('mg_3f_s'))->hide(); + mpLetterScreen[0]->search(MULTI_CHAR('mg_3f'))->hide(); + mpLetterScreen[0]->search('t3_s')->hide(); + mpLetterScreen[0]->search(MULTI_CHAR('mg_3line'))->hide(); + mpLineParent = JKR_NEW CPaneMgr(mpLetterScreen[0], 'us_n', 0, NULL); + JUT_ASSERT(1530, mpLineParent != NULL); + for (int i = 0; i < 12; i++) { + if (line_tag[i] != 0) { + field_0x25c[i] = (J2DTextBox*)mpLetterScreen[0]->search(line_tag[i]); + } else { + field_0x25c[i] = NULL; + } + } + mpLetterScreen[0]->search(MULTI_CHAR('jp_fri_n'))->hide(); + mpLetterScreen[0]->search('jp_n')->hide(); + } +#elif VERSION == VERSION_GCN_JPN if (dComIfGs_getOptRuby() == 0) { field_0x2ec[0] = JKR_NEW CPaneMgr(mpLetterScreen[0], MULTI_CHAR('t3f_s'), 0, NULL); field_0x2ec[1] = JKR_NEW CPaneMgr(mpLetterScreen[0], MULTI_CHAR('mg_3flin'), 0, NULL); @@ -1148,20 +1343,20 @@ void dMenu_Letter_c::screenSetLetter() { mpLetterScreen[0]->search('jp_n')->hide(); #endif +#if TARGET_PC +#define STR_BUF_LEN 528 +#elif VERSION == VERSION_GCN_JPN +#define STR_BUF_LEN 528 +#else +#define STR_BUF_LEN 512 +#endif + for (int i = 0; i < 2; i++) { ((J2DTextBox*)field_0x2ec[i]->getPanePtr())->setFont(mDoExt_getMesgFont()); -#if VERSION == VERSION_GCN_JPN - ((J2DTextBox*)field_0x2ec[i]->getPanePtr())->setString(0x210, ""); -#else - ((J2DTextBox*)field_0x2ec[i]->getPanePtr())->setString(0x200, ""); -#endif + ((J2DTextBox*)field_0x2ec[i]->getPanePtr())->setString(STR_BUF_LEN, ""); if (field_0x2f4[i] != NULL) { ((J2DTextBox*)field_0x2f4[i]->getPanePtr())->setFont(mDoExt_getMesgFont()); -#if VERSION == VERSION_GCN_JPN - ((J2DTextBox*)field_0x2f4[i]->getPanePtr())->setString(0x210, ""); -#else - ((J2DTextBox*)field_0x2f4[i]->getPanePtr())->setString(0x200, ""); -#endif + ((J2DTextBox*)field_0x2f4[i]->getPanePtr())->setString(STR_BUF_LEN, ""); } } field_0x1e4[0] = (J2DTextBox*)mpLetterScreen[0]->search(MULTI_CHAR('p_texts')); diff --git a/src/d/d_menu_option.cpp b/src/d/d_menu_option.cpp index 94babc8342..cb9af850c0 100644 --- a/src/d/d_menu_option.cpp +++ b/src/d/d_menu_option.cpp @@ -25,6 +25,7 @@ #include #include "JSystem/JAudio2/JASDriverIF.h" +#include "dusk/version.hpp" #if TARGET_PC #include "dusk/menu_pointer.h" @@ -34,7 +35,7 @@ typedef void (dMenu_Option_c::*initFunc)(); static initFunc init[] = { &dMenu_Option_c::atten_init, -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC || VERSION == VERSION_GCN_JPN &dMenu_Option_c::ruby_init, #endif &dMenu_Option_c::vib_init, @@ -46,7 +47,7 @@ static initFunc init[] = { typedef void (dMenu_Option_c::*processFunc)(); static processFunc process[] = { &dMenu_Option_c::atten_move, -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC || VERSION == VERSION_GCN_JPN &dMenu_Option_c::ruby_move, #endif &dMenu_Option_c::vib_move, @@ -68,21 +69,6 @@ static calibrationFunc calibration_process[] = { &dMenu_Option_c::calibration_close2_move, }; -enum SelectType { -#if VERSION == VERSION_GCN_JPN - SelectType0_JPN, -#endif - SelectType0, - SelectType1, - SelectType2, - SelectType3, - SelectType4, - SelectType5, - SelectType6, - SelectType7, - SelectType8, -}; - #if TARGET_PC static dusk::menu_pointer::TargetId option_yes_no_target(u8 index) noexcept { return static_cast(0x100 + index); @@ -271,11 +257,11 @@ void dMenu_Option_c::_create() { field_0x3e1 = 10; field_0x3e2 = 0xff; field_0x3e3 = 0xc0; - field_0x3ef = 0; + field_0x3ef = PROC_ATTEN_e; field_0x3f0 = 0xff; field_0x3f1 = 0xff; field_0x3f2 = 0; - field_0x3f5 = 0; + field_0x3f5 = PROC_ATTEN_e; field_0x3f3 = 5; field_0x3f4 = 5; field_0x334 = 0.0f; @@ -499,9 +485,9 @@ void dMenu_Option_c::_move() { } if (mDoGph_gInf_c::getFader()->getStatus() == 1) { - if (mDoCPd_c::getTrigA(PAD_1) != 0 && field_0x3ef != SelectType3 && field_0x3f3 == 5) { - if (field_0x3f4 == 5 && field_0x3ef != SelectType4 && field_0x3ef != SelectType5 && field_0x3ef != SelectType6 && - field_0x3ef != SelectType7) + if (mDoCPd_c::getTrigA(PAD_1) != 0 && field_0x3ef != PROC_CHANGE_MOVE_e && field_0x3f3 == 5) { + if (field_0x3f4 == 5 && field_0x3ef != PROC_CONFIRM_OPEN_MOVE_e && field_0x3ef != PROC_CONFIRM_MOVE_MOVE_e && field_0x3ef != PROC_CONFIRM_SELECT_MOVE_e && + field_0x3ef != PROC_CONFIRM_CLOSE_MOVE_e) { if (mDoCPd_c::getTrigStart(PAD_1) == 0 && mDoCPd_c::getTrigB(PAD_1) == 0) { if (mDoCPd_c::getTrigUp(PAD_1) == 0 && mDoCPd_c::getTrigDown(PAD_1) == 0 && @@ -509,7 +495,7 @@ void dMenu_Option_c::_move() { { field_0x3f7 = 1; field_0x3f5 = field_0x3ef; - field_0x3ef = SelectType4; + field_0x3ef = PROC_CONFIRM_OPEN_MOVE_e; dMeter2Info_set2DVibration(); (this->*init[field_0x3ef])(); goto skip; @@ -518,8 +504,8 @@ void dMenu_Option_c::_move() { } } - if (mDoCPd_c::getTrigB(PAD_1) != 0 && field_0x3ef != SelectType3 && field_0x3f3 == 5 && - field_0x3ef != SelectType4 && field_0x3ef != SelectType5 && field_0x3ef != SelectType6 && field_0x3ef != SelectType7) + if (mDoCPd_c::getTrigB(PAD_1) != 0 && field_0x3ef != PROC_CHANGE_MOVE_e && field_0x3f3 == 5 && + field_0x3ef != PROC_CONFIRM_OPEN_MOVE_e && field_0x3ef != PROC_CONFIRM_MOVE_MOVE_e && field_0x3ef != PROC_CONFIRM_SELECT_MOVE_e && field_0x3ef != PROC_CONFIRM_CLOSE_MOVE_e) { if (field_0x3f4 == 5 && mDoCPd_c::getTrigStart(PAD_1) == 0 && mDoCPd_c::getTrigA(PAD_1) == 0 && mDoCPd_c::getTrigUp(PAD_1) == 0 && @@ -528,16 +514,16 @@ void dMenu_Option_c::_move() { { field_0x3f7 = 0; field_0x3f5 = field_0x3ef; - field_0x3ef = SelectType4; + field_0x3ef = PROC_CONFIRM_OPEN_MOVE_e; dMeter2Info_set2DVibration(); (this->*init[field_0x3ef])(); } } #if TARGET_PC - if (field_0x3f4 == 5 && field_0x3ef != SelectType3 && field_0x3f3 == 5 && - field_0x3ef != SelectType4 && field_0x3ef != SelectType5 && field_0x3ef != SelectType6 && - field_0x3ef != SelectType7 && pointerConfirmSelect()) + if (field_0x3f4 == 5 && field_0x3ef != PROC_CHANGE_MOVE_e && field_0x3f3 == 5 && + field_0x3ef != PROC_CONFIRM_OPEN_MOVE_e && field_0x3ef != PROC_CONFIRM_MOVE_MOVE_e && field_0x3ef != PROC_CONFIRM_SELECT_MOVE_e && + field_0x3ef != PROC_CONFIRM_CLOSE_MOVE_e && pointerConfirmSelect()) { goto skip; } @@ -545,7 +531,7 @@ void dMenu_Option_c::_move() { } skip: u8 oldValue = field_0x3ef; - if (field_0x3f3 == 5 && oldValue != SelectType4 && oldValue != SelectType5 && oldValue != SelectType6 && oldValue != SelectType7) { + if (field_0x3f3 == 5 && oldValue != PROC_CONFIRM_OPEN_MOVE_e && oldValue != PROC_CONFIRM_MOVE_MOVE_e && oldValue != PROC_CONFIRM_SELECT_MOVE_e && oldValue != PROC_CONFIRM_CLOSE_MOVE_e) { dpdMenuMove(); } @@ -624,8 +610,8 @@ void dMenu_Option_c::drawHaihai() { field_0x3f6 = 0; field_0x3f6 |= 1; field_0x3f6 |= 4; - if (selectType < SelectType4 && field_0x3f6 != 0 && field_0x3f3 == 5 && field_0x3ef != SelectType4 && - field_0x3ef != SelectType5 && field_0x3ef != SelectType6 && field_0x3ef != SelectType7) + if (selectType < PROC_CONFIRM_OPEN_MOVE_e && field_0x3f6 != 0 && field_0x3f3 == 5 && field_0x3ef != PROC_CONFIRM_OPEN_MOVE_e && + field_0x3ef != PROC_CONFIRM_MOVE_MOVE_e && field_0x3ef != PROC_CONFIRM_SELECT_MOVE_e && field_0x3ef != PROC_CONFIRM_CLOSE_MOVE_e) { mpMeterHaihai->_execute(0); Vec haihaiPosL = @@ -766,7 +752,13 @@ void dMenu_Option_c::atten_move() { if (field_0x3f3 != 5) { (this->*tv_process[field_0x3f3])(); } else if (downTrigger) { - field_0x3ef = 1; +#if TARGET_PC + field_0x3ef = dusk::version::isRegionJpn() ? PROC_RUBY_e : PROC_VIB_e; +#elif VERSION == VERSION_GCN_JPN + field_0x3ef = PROC_RUBY_e; +#else + field_0x3ef = PROC_VIB_e; +#endif Z2GetAudioMgr()->seStart(Z2SE_SY_CURSOR_OPTION, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); } else if (leftTrigger) { if (field_0x3e4 == 0) { @@ -776,8 +768,8 @@ void dMenu_Option_c::atten_move() { field_0x3e4 = 0; field_0x3da = -5; } - field_0x3ef = SelectType3; - field_0x3f5 = 0; + field_0x3ef = PROC_CHANGE_MOVE_e; + field_0x3f5 = PROC_ATTEN_e; Z2GetAudioMgr()->seStart(Z2SE_SY_OPTION_SWITCH, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); } else if (rightTrigger) { if (field_0x3e4 == 0) { @@ -787,16 +779,23 @@ void dMenu_Option_c::atten_move() { field_0x3e4 = 0; field_0x3da = 5; } - field_0x3ef = SelectType3; - field_0x3f5 = 0; + field_0x3ef = PROC_CHANGE_MOVE_e; + field_0x3f5 = PROC_ATTEN_e; Z2GetAudioMgr()->seStart(Z2SE_SY_OPTION_SWITCH, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); } else { changeTVCheck(); } } -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC || VERSION == VERSION_GCN_JPN void dMenu_Option_c::ruby_init() { +#if TARGET_PC + if (!dusk::version::isRegionJpn()) { + vib_init(); + return; + } +#endif + mpDrawCursor->setAlphaRate(1.0f); setCursorPos(1); setAButtonString(0x40c); @@ -804,6 +803,12 @@ void dMenu_Option_c::ruby_init() { } void dMenu_Option_c::ruby_move() { +#if TARGET_PC + if (!dusk::version::isRegionJpn()) { + vib_move(); + return; + } +#endif bool upTrigger = mpStick->checkUpTrigger(); bool downTrigger= mpStick->checkDownTrigger(); @@ -813,10 +818,10 @@ void dMenu_Option_c::ruby_move() { if (field_0x3f3 != 5) { (this->*tv_process[field_0x3f3])(); } else if (upTrigger) { - field_0x3ef = SelectType0_JPN; + field_0x3ef = PROC_ATTEN_e; Z2GetAudioMgr()->seStart(Z2SE_SY_CURSOR_OPTION, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); } else if (downTrigger) { - field_0x3ef = SelectType1; + field_0x3ef = PROC_VIB_e; Z2GetAudioMgr()->seStart(Z2SE_SY_CURSOR_OPTION, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); } else if (leftTrigger) { if (field_0x3e5_JPN == 0) { @@ -826,8 +831,8 @@ void dMenu_Option_c::ruby_move() { field_0x3e5_JPN = 0; field_0x3da = -5; } - field_0x3ef = SelectType3; - field_0x3f5 = SelectType0; + field_0x3ef = PROC_CHANGE_MOVE_e; + field_0x3f5 = PROC_RUBY_e; Z2GetAudioMgr()->seStart(Z2SE_SY_OPTION_SWITCH, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); } else if (rightTrigger) { if (field_0x3e5_JPN == 0) { @@ -837,8 +842,8 @@ void dMenu_Option_c::ruby_move() { field_0x3e5_JPN = 0; field_0x3da = 5; } - field_0x3ef = SelectType3; - field_0x3f5 = SelectType0; + field_0x3ef = PROC_CHANGE_MOVE_e; + field_0x3f5 = PROC_RUBY_e; Z2GetAudioMgr()->seStart(Z2SE_SY_OPTION_SWITCH, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); } else { changeTVCheck(); @@ -848,7 +853,7 @@ void dMenu_Option_c::ruby_move() { void dMenu_Option_c::vib_init() { mpDrawCursor->setAlphaRate(1.0f); - setCursorPos(SelectType1); + setCursorPos(PROC_VIB_e); setAButtonString(0x40C); setBButtonString(0x3F9); } @@ -862,10 +867,16 @@ void dMenu_Option_c::vib_move() { if (field_0x3f3 != 5) { (this->*tv_process[field_0x3f3])(); } else if (upTrigger) { - field_0x3ef = SelectType0; +#if TARGET_PC + field_0x3ef = dusk::version::isRegionJpn() ? PROC_RUBY_e : PROC_ATTEN_e; +#elif VERSION == VERSION_GCN_JPN + field_0x3ef = PROC_RUBY_e; +#else + field_0x3ef = PROC_ATTEN_e; +#endif Z2GetAudioMgr()->seStart(Z2SE_SY_CURSOR_OPTION, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); } else if (downTrigger) { - field_0x3ef = SelectType2; + field_0x3ef = PROC_SOUND_e; Z2GetAudioMgr()->seStart(Z2SE_SY_CURSOR_OPTION, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); } else if (leftTrigger) { if (isRumbleSupported()) { @@ -877,8 +888,8 @@ void dMenu_Option_c::vib_move() { field_0x3ea = 0; field_0x3da = -5; } - field_0x3ef = SelectType3; - field_0x3f5 = SelectType1; + field_0x3ef = PROC_CHANGE_MOVE_e; + field_0x3f5 = PROC_VIB_e; Z2GetAudioMgr()->seStart(Z2SE_SY_OPTION_SWITCH, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); } @@ -892,8 +903,8 @@ void dMenu_Option_c::vib_move() { field_0x3ea = 0; field_0x3da = 5; } - field_0x3ef = SelectType3; - field_0x3f5 = SelectType1; + field_0x3ef = PROC_CHANGE_MOVE_e; + field_0x3f5 = PROC_VIB_e; Z2GetAudioMgr()->seStart(Z2SE_SY_OPTION_SWITCH, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); } @@ -904,7 +915,7 @@ void dMenu_Option_c::vib_move() { void dMenu_Option_c::sound_init() { mpDrawCursor->setAlphaRate(1.0f); - setCursorPos(SelectType2); + setCursorPos(PROC_SOUND_e); setAButtonString(0x40C); setBButtonString(0x3F9); } @@ -918,7 +929,7 @@ void dMenu_Option_c::sound_move() { if (field_0x3f3 != 5) { (this->*tv_process[field_0x3f3])(); } else if (upTrigger) { - field_0x3ef = SelectType1; + field_0x3ef = PROC_VIB_e; Z2GetAudioMgr()->seStart(Z2SE_SY_CURSOR_OPTION, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); } else if (leftTrigger) { if (field_0x3e9 == 2) { @@ -943,8 +954,8 @@ void dMenu_Option_c::sound_move() { } mDoAud_setOutputMode(dMo_soundMode[field_0x3e9]); setSoundMode(dMo_soundMode[field_0x3e9]); - field_0x3ef = SelectType3; - field_0x3f5 = SelectType2; + field_0x3ef = PROC_CHANGE_MOVE_e; + field_0x3f5 = PROC_SOUND_e; Z2GetAudioMgr()->seStart(Z2SE_SY_OPTION_SWITCH, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); } else if (rightTrigger) { if (field_0x3e9 == 0) { @@ -969,8 +980,8 @@ void dMenu_Option_c::sound_move() { } mDoAud_setOutputMode(dMo_soundMode[field_0x3e9]); setSoundMode(dMo_soundMode[field_0x3e9]); - field_0x3ef = SelectType3; - field_0x3f5 = SelectType2; + field_0x3ef = PROC_CHANGE_MOVE_e; + field_0x3f5 = PROC_SOUND_e; Z2GetAudioMgr()->seStart(Z2SE_SY_OPTION_SWITCH, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); } else { changeTVCheck(); @@ -992,32 +1003,28 @@ void dMenu_Option_c::change_move() { } u8 index; switch (field_0x3f5) { -#if VERSION == VERSION_GCN_JPN - case SelectType0_JPN: - index = SelectType0_JPN; + case PROC_ATTEN_e: + index = PROC_ATTEN_e; if (field_0x3da == 0) { setAttenString(); } break; -#endif - case SelectType0: - index = SelectType0; + case PROC_RUBY_e: + index = PROC_RUBY_e; if (field_0x3da == 0) { -#if VERSION == VERSION_GCN_JPN + IF_DUSK_BLOCK(dusk::version::isRegionJpn()) setRubyString(); -#else - setAttenString(); -#endif + IF_DUSK_BLOCK_END } break; - case SelectType1: - index = SelectType1; + case PROC_VIB_e: + index = DUSK_IF_ELSE(dusk::version::isRegionJpn() ? 2 : 1, PROC_VIB_e); if (field_0x3da == 0) { setVibString(); } break; - case SelectType2: - index = SelectType2; + case PROC_SOUND_e: + index = DUSK_IF_ELSE(dusk::version::isRegionJpn() ? 3 : 2, PROC_SOUND_e); if (field_0x3da == 0) { setSoundString(); } @@ -1083,7 +1090,7 @@ void dMenu_Option_c::confirm_open_move() { } if (status == 1 && yesNoMenuMove == 1 && field_0x374 == 1.0f) { yesnoCursorShow(); - field_0x3ef = SelectType5; + field_0x3ef = PROC_CONFIRM_MOVE_MOVE_e; } mpWarning->_move(); setAnimation(); @@ -1113,21 +1120,21 @@ void dMenu_Option_c::confirm_move_move() { field_0x3f9 = i; if (clicked) { yesNoSelectStart(); - field_0x3ef = SelectType7; + field_0x3ef = PROC_CONFIRM_CLOSE_MOVE_e; dMeter2Info_set2DVibrationM(); mpWarning->_move(); setAnimation(); return; } yesnoSelectAnmSet(); - field_0x3ef = SelectType6; + field_0x3ef = PROC_CONFIRM_SELECT_MOVE_e; mpWarning->_move(); setAnimation(); return; } if (clicked) { yesNoSelectStart(); - field_0x3ef = SelectType7; + field_0x3ef = PROC_CONFIRM_CLOSE_MOVE_e; dMeter2Info_set2DVibrationM(); mpWarning->_move(); setAnimation(); @@ -1138,12 +1145,12 @@ void dMenu_Option_c::confirm_move_move() { if (mDoCPd_c::getTrigA(PAD_1) != 0) { yesNoSelectStart(); - field_0x3ef = SelectType7; + field_0x3ef = PROC_CONFIRM_CLOSE_MOVE_e; dMeter2Info_set2DVibrationM(); } else if (mDoCPd_c::getTrigB(PAD_1) != 0) { field_0x3f9 = 0; yesnoCancelAnmSet(); - field_0x3ef = SelectType7; + field_0x3ef = PROC_CONFIRM_CLOSE_MOVE_e; dMeter2Info_set2DVibrationM(); } else if (rightTrigger != 0) { if (field_0x3f9 != 0) { @@ -1152,7 +1159,7 @@ void dMenu_Option_c::confirm_move_move() { field_0x3fa = field_0x3f9; field_0x3f9 = 0; yesnoSelectAnmSet(); - field_0x3ef = SelectType6; + field_0x3ef = PROC_CONFIRM_SELECT_MOVE_e; } } else if (leftTrigger != 0) { if (field_0x3f9 != 1) { @@ -1161,7 +1168,7 @@ void dMenu_Option_c::confirm_move_move() { field_0x3fa = field_0x3f9; field_0x3f9 = 1; yesnoSelectAnmSet(); - field_0x3ef = SelectType6; + field_0x3ef = PROC_CONFIRM_SELECT_MOVE_e; } } mpWarning->_move(); @@ -1195,14 +1202,14 @@ void dMenu_Option_c::confirm_select_move() { dusk::menu_pointer::Context::Options, option_yes_no_target(field_0x3f9))) { yesNoSelectStart(); - field_0x3ef = SelectType7; + field_0x3ef = PROC_CONFIRM_CLOSE_MOVE_e; dMeter2Info_set2DVibrationM(); mpWarning->_move(); setAnimation(); return; } #endif - field_0x3ef = SelectType5; + field_0x3ef = PROC_CONFIRM_MOVE_MOVE_e; } mpWarning->_move(); setAnimation(); @@ -1231,8 +1238,8 @@ void dMenu_Option_c::confirm_close_move() { if (field_0x3f9 == 1) { mQuitStatus = 3; dComIfGs_setOptAttentionType(field_0x3e4); -#if VERSION == VERSION_GCN_JPN - if (field_0x3e5_JPN == 0) { +#if TARGET_PC || VERSION == VERSION_GCN_JPN + if (IF_DUSK(dusk::version::isRegionJpn() &&) field_0x3e5_JPN == 0) { dComIfGs_setOptRuby(1); } else { dComIfGs_setOptRuby(0); @@ -1346,7 +1353,14 @@ void dMenu_Option_c::calibration_close2_move() { void dMenu_Option_c::menuVisible() { for (int i = 0; i < 6; i++) { - if (i < SelectType3) { +#if TARGET_PC + if ((dusk::version::isRegionJpn() && i < 4) || i < 3) +#elif VERSION == VERSION_GCN_JPN + if (i < 4) +#else + if (i < 3) +#endif + { menuShow(i); } else { menuHide(i); @@ -1396,7 +1410,16 @@ void dMenu_Option_c::screenSet() { static const u64 tag_frame[6] = { MULTI_CHAR('flame_00'), MULTI_CHAR('flame_01'), MULTI_CHAR('flame_02'), MULTI_CHAR('flame_03'), MULTI_CHAR('flame_04'), MULTI_CHAR('flame_05'), }; -#if VERSION == VERSION_GCN_JPN + +#if TARGET_PC + static const u64 tag_menu0_jpn[6] = { + MULTI_CHAR('menu_t0'), MULTI_CHAR('menu_t1'), MULTI_CHAR('menu_t2'), MULTI_CHAR('menu_t3'), MULTI_CHAR('menu_t4'), MULTI_CHAR('menu_t5'), + }; + + static const u64 tag_menu0[6] = { + MULTI_CHAR('fenu_t0'), MULTI_CHAR('fenu_t1'), MULTI_CHAR('fenu_t2'), MULTI_CHAR('fenu_t3'), MULTI_CHAR('fenu_t4'), MULTI_CHAR('fenu_t5'), + }; +#elif VERSION == VERSION_GCN_JPN static const u64 tag_menu0[6] = { MULTI_CHAR('menu_t0'), MULTI_CHAR('menu_t1'), MULTI_CHAR('menu_t2'), MULTI_CHAR('menu_t3'), MULTI_CHAR('menu_t4'), MULTI_CHAR('menu_t5'), }; @@ -1405,6 +1428,7 @@ void dMenu_Option_c::screenSet() { MULTI_CHAR('fenu_t0'), MULTI_CHAR('fenu_t1'), MULTI_CHAR('fenu_t2'), MULTI_CHAR('fenu_t3'), MULTI_CHAR('fenu_t4'), MULTI_CHAR('fenu_t5'), }; #endif + static const u64 let_n[6] = { MULTI_CHAR('let_00_n'), MULTI_CHAR('let_01_n'), MULTI_CHAR('let_02_n'), MULTI_CHAR('let_03_n'), MULTI_CHAR('let_04_n'), MULTI_CHAR('let_05_n'), }; @@ -1444,7 +1468,34 @@ void dMenu_Option_c::screenSet() { static const u64 ftv_btnA[5] = { MULTI_CHAR('font_a1'), MULTI_CHAR('font_at2'), MULTI_CHAR('font_at3'), MULTI_CHAR('font_at4'), MULTI_CHAR('font_at'), }; -#if VERSION == VERSION_GCN_JPN + +#if TARGET_PC + static const u64 fenu_t0_jpn[2] = {MULTI_CHAR('fenu_t0s'), MULTI_CHAR('fenu_t0')}; + static const u64 menu_t0_jpn[2] = {MULTI_CHAR('menu_t0s'), MULTI_CHAR('menu_t0')}; + static const u64 fenu_t1_jpn[2] = {MULTI_CHAR('fenu_t1s'), MULTI_CHAR('fenu_t1')}; + static const u64 menu_t1_jpn[2] = {MULTI_CHAR('menu_t1s'), MULTI_CHAR('menu_t1')}; + static const u64 fenu_t2_jpn[2] = {MULTI_CHAR('fenu_t2s'), MULTI_CHAR('fenu_t2')}; + static const u64 menu_t2_jpn[2] = {MULTI_CHAR('menu_t2s'), MULTI_CHAR('menu_t2')}; + static const u64 fenu_t3_jpn[2] = {MULTI_CHAR('fenu_t3s'), MULTI_CHAR('fenu_t3')}; + static const u64 menu_t3_jpn[2] = {MULTI_CHAR('menu_t3s'), MULTI_CHAR('menu_t3')}; + static const u64 fenu_t4_jpn[2] = {MULTI_CHAR('fenu_t4s'), MULTI_CHAR('fenu_t4')}; + static const u64 menu_t4_jpn[2] = {MULTI_CHAR('menu_t4s'), MULTI_CHAR('menu_t4')}; + static const u64 fenu_t5_jpn[2] = {MULTI_CHAR('fenu_t5s'), MULTI_CHAR('fenu_t5')}; + static const u64 menu_t5_jpn[2] = {MULTI_CHAR('menu_t5s'), MULTI_CHAR('menu_t5')}; + + static const u64 fenu_t0[2] = {MULTI_CHAR('fenu_t0s'), MULTI_CHAR('fenu_t0')}; + static const u64 menu_t0[2] = {MULTI_CHAR('menu_t0s'), MULTI_CHAR('menu_t0')}; + static const u64 fenu_t2[2] = {MULTI_CHAR('fenu_t1s'), MULTI_CHAR('fenu_t1')}; + static const u64 menu_t2[2] = {MULTI_CHAR('menu_t1s'), MULTI_CHAR('menu_t1')}; + static const u64 fenu_t3[2] = {MULTI_CHAR('fenu_t2s'), MULTI_CHAR('fenu_t2')}; + static const u64 menu_t3[2] = {MULTI_CHAR('menu_t2s'), MULTI_CHAR('menu_t2')}; + static const u64 fenu_t4[2] = {MULTI_CHAR('fenu_t3s'), MULTI_CHAR('fenu_t3')}; + static const u64 menu_t4[2] = {MULTI_CHAR('menu_t3s'), MULTI_CHAR('menu_t3')}; + static const u64 fenu_t1[2] = {MULTI_CHAR('fenu_t4s'), MULTI_CHAR('fenu_t4')}; + static const u64 menu_t1[2] = {MULTI_CHAR('menu_t4s'), MULTI_CHAR('menu_t4')}; + static const u64 fenu_t5[2] = {MULTI_CHAR('fenu_t5s'), MULTI_CHAR('fenu_t5')}; + static const u64 menu_t5[2] = {MULTI_CHAR('menu_t5s'), MULTI_CHAR('menu_t5')}; +#elif VERSION == VERSION_GCN_JPN static const u64 fenu_t0[2] = {MULTI_CHAR('fenu_t0s'), MULTI_CHAR('fenu_t0')}; static const u64 menu_t0[2] = {MULTI_CHAR('menu_t0s'), MULTI_CHAR('menu_t0')}; static const u64 fenu_t1[2] = {MULTI_CHAR('fenu_t1s'), MULTI_CHAR('fenu_t1')}; @@ -1501,7 +1552,15 @@ void dMenu_Option_c::screenSet() { static const u64 fenut_4[6] = { MULTI_CHAR('menut321'), MULTI_CHAR('menut320'), MULTI_CHAR('menut319'), MULTI_CHAR('menut318'), MULTI_CHAR('menut317'), MULTI_CHAR('menut316'), }; -#if VERSION == VERSION_GCN_JPN + +#if TARGET_PC + static const u64 tx_jpn[6] = { + MULTI_CHAR('wps_text'), MULTI_CHAR('w_p_text'), MULTI_CHAR('g_ps_tx3'), MULTI_CHAR('g_p_tex3'), MULTI_CHAR('wps_tex1'), MULTI_CHAR('w_p_tex1'), + }; + static const u64 tx[6] = { + MULTI_CHAR('w_p_tex5'), MULTI_CHAR('w_p_tex6'), MULTI_CHAR('w_p_tex3'), MULTI_CHAR('w_p_tex4'), MULTI_CHAR('fps_tex1'), MULTI_CHAR('f_p_tex1'), + }; +#elif VERSION == VERSION_GCN_JPN static const u64 tx[6] = { MULTI_CHAR('wps_text'), MULTI_CHAR('w_p_text'), MULTI_CHAR('g_ps_tx3'), MULTI_CHAR('g_p_tex3'), MULTI_CHAR('wps_tex1'), MULTI_CHAR('w_p_tex1'), }; @@ -1510,13 +1569,24 @@ void dMenu_Option_c::screenSet() { MULTI_CHAR('w_p_tex5'), MULTI_CHAR('w_p_tex6'), MULTI_CHAR('w_p_tex3'), MULTI_CHAR('w_p_tex4'), MULTI_CHAR('fps_tex1'), MULTI_CHAR('f_p_tex1'), }; #endif + static const u64 op_tx[4] = { MULTI_CHAR('w_text_n'), MULTI_CHAR('w_btn_n'), MULTI_CHAR('w_k_t_n'), MULTI_CHAR('w_abtn_n'), }; static const u64 z_tx[3] = { MULTI_CHAR('z_gc_n'), 0, 0, }; -#if VERSION == VERSION_GCN_JPN + +#if TARGET_PC + static const u64 txTV_jpn[10] = { + MULTI_CHAR('menu_t6s'), MULTI_CHAR('menu_t6'), MULTI_CHAR('menu_t9s'), MULTI_CHAR('menu_t9'), MULTI_CHAR('menut10s'), + MULTI_CHAR('menu_t10'), MULTI_CHAR('menu_t7s'), MULTI_CHAR('menu_t7'), MULTI_CHAR('menu_t8s'), MULTI_CHAR('menu_t8'), + }; + static const u64 txTV[10] = { + MULTI_CHAR('menu_t61'), MULTI_CHAR('menu_t2'), MULTI_CHAR('menu_t91'), MULTI_CHAR('menu_t1'), MULTI_CHAR('menut101'), + MULTI_CHAR('menu_t01'), MULTI_CHAR('menu_t71'), MULTI_CHAR('menu_t3'), MULTI_CHAR('menu_t81'), MULTI_CHAR('menu_t4'), + }; +#elif VERSION == VERSION_GCN_JPN static const u64 txTV[10] = { MULTI_CHAR('menu_t6s'), MULTI_CHAR('menu_t6'), MULTI_CHAR('menu_t9s'), MULTI_CHAR('menu_t9'), MULTI_CHAR('menut10s'), MULTI_CHAR('menu_t10'), MULTI_CHAR('menu_t7s'), MULTI_CHAR('menu_t7'), MULTI_CHAR('menu_t8s'), MULTI_CHAR('menu_t8'), @@ -1533,7 +1603,7 @@ void dMenu_Option_c::screenSet() { mpWarning->mPosY = pos.y + g_drawHIO.mOptionScreen.mBackgroundPosY; for (int i = 0; i < 6; i++) { field_0x280[i] = (J2DPicture*)mpScreen->search(tag_frame[i]); - field_0x298[i] = (J2DTextBox*)mpScreen->search(tag_menu0[i]); + field_0x298[i] = (J2DTextBox*)mpScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? tag_menu0_jpn[i] : tag_menu0[i], tag_menu0[i])); } field_0x2b0[0] = field_0x280[1]->getBlack(); field_0x2c0[0] = field_0x280[1]->getWhite(); @@ -1600,7 +1670,23 @@ void dMenu_Option_c::screenSet() { mpMenuPane32[i] = NULL; } } -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + field_0x270[0] = (J2DTextBox*)mpBackScreen->search(MULTI_CHAR('t_t00')); + field_0x270[1] = (J2DTextBox*)mpBackScreen->search(MULTI_CHAR('t_t01')); + mpBackScreen->search(MULTI_CHAR('f_t00'))->hide(); + mpBackScreen->search(MULTI_CHAR('t_t01'))->hide(); + field_0x270[2] = (J2DTextBox*)mpTVScreen->search(MULTI_CHAR('t_t00')); + mpTVScreen->search(MULTI_CHAR('f_t00'))->hide(); + } else { + field_0x270[0] = (J2DTextBox*)mpBackScreen->search(MULTI_CHAR('f_t00')); + field_0x270[1] = (J2DTextBox*)mpBackScreen->search(MULTI_CHAR('t_t01')); + mpBackScreen->search(MULTI_CHAR('t_t00'))->hide(); + mpBackScreen->search(MULTI_CHAR('t_t01'))->hide(); + field_0x270[2] = (J2DTextBox*)mpTVScreen->search(MULTI_CHAR('f_t00')); + mpTVScreen->search(MULTI_CHAR('t_t00'))->hide(); + } +#elif VERSION == VERSION_GCN_JPN field_0x270[0] = (J2DTextBox*)mpBackScreen->search(MULTI_CHAR('t_t00')); field_0x270[1] = (J2DTextBox*)mpBackScreen->search(MULTI_CHAR('t_t01')); mpBackScreen->search(MULTI_CHAR('f_t00'))->hide(); @@ -1623,7 +1709,15 @@ void dMenu_Option_c::screenSet() { mpString->getString(0x547, field_0x270[1], NULL, NULL, NULL, 0); mpString->getString(0x55C, field_0x270[2], NULL, NULL, NULL, 0); for (int i = 0; i < 5; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + field_0x25c[i] = (J2DTextBox*)mpTVScreen->search(tv_btnA[i]); + mpTVScreen->search(ftv_btnA[i])->hide(); + } else { + field_0x25c[i] = (J2DTextBox*)mpTVScreen->search(ftv_btnA[i]); + mpTVScreen->search(tv_btnA[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN field_0x25c[i] = (J2DTextBox*)mpTVScreen->search(tv_btnA[i]); mpTVScreen->search(ftv_btnA[i])->hide(); #else @@ -1634,8 +1728,17 @@ void dMenu_Option_c::screenSet() { field_0x25c[i]->setString(0x40, ""); mpString->getString(0x564, field_0x25c[i], NULL, NULL, NULL, 0); } + for (int i = 0; i < 2; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + field_0x21c[0][i] = (J2DTextBox*)mpScreen->search(menu_t0_jpn[i]); + mpScreen->search(fenu_t0_jpn[i])->hide(); + } else { + field_0x21c[0][i] = (J2DTextBox*)mpScreen->search(fenu_t0[i]); + mpScreen->search(menu_t0[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN field_0x21c[0][i] = (J2DTextBox*)mpScreen->search(menu_t0[i]); mpScreen->search(fenu_t0[i])->hide(); #else @@ -1647,7 +1750,15 @@ void dMenu_Option_c::screenSet() { mpString->getString(0x548, field_0x21c[0][i], NULL, NULL, NULL, 0); } for (int i = 0; i < 2; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + field_0x21c[1][i] = (J2DTextBox*)mpScreen->search(menu_t1_jpn[i]); + mpScreen->search(fenu_t1_jpn[i])->hide(); + } else { + field_0x21c[1][i] = (J2DTextBox*)mpScreen->search(fenu_t2[i]); + mpScreen->search(menu_t2[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN field_0x21c[1][i] = (J2DTextBox*)mpScreen->search(menu_t1[i]); mpScreen->search(fenu_t1[i])->hide(); #else @@ -1656,14 +1767,29 @@ void dMenu_Option_c::screenSet() { #endif field_0x21c[1][i]->setFont(mpFont); field_0x21c[1][i]->setString(0x40, ""); -#if VERSION == VERSION_GCN_JPN + +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + mpString->getString(0x54B, field_0x21c[1][i], NULL, NULL, NULL, 0); + } else { + mpString->getString(0x54E, field_0x21c[1][i], NULL, NULL, NULL, 0); + } +#elif VERSION == VERSION_GCN_JPN mpString->getString(0x54B, field_0x21c[1][i], NULL, NULL, NULL, 0); #else mpString->getString(0x54E, field_0x21c[1][i], NULL, NULL, NULL, 0); #endif } for (int i = 0; i < 2; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + field_0x21c[2][i] = (J2DTextBox*)mpScreen->search(menu_t2_jpn[i]); + mpScreen->search(fenu_t2_jpn[i])->hide(); + } else { + field_0x21c[2][i] = (J2DTextBox*)mpScreen->search(fenu_t3[i]); + mpScreen->search(menu_t3[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN field_0x21c[2][i] = (J2DTextBox*)mpScreen->search(menu_t2[i]); mpScreen->search(fenu_t2[i])->hide(); #else @@ -1672,14 +1798,29 @@ void dMenu_Option_c::screenSet() { #endif field_0x21c[2][i]->setFont(mpFont); field_0x21c[2][i]->setString(0x40, ""); -#if VERSION == VERSION_GCN_JPN + +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + mpString->getString(0x54E, field_0x21c[2][i], NULL, NULL, NULL, 0); + } else { + mpString->getString(0x54F, field_0x21c[2][i], NULL, NULL, NULL, 0); + } +#elif VERSION == VERSION_GCN_JPN mpString->getString(0x54E, field_0x21c[2][i], NULL, NULL, NULL, 0); #else mpString->getString(0x54F, field_0x21c[2][i], NULL, NULL, NULL, 0); #endif } for (int i = 0; i < 2; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + field_0x21c[3][i] = (J2DTextBox*)mpScreen->search(menu_t3_jpn[i]); + mpScreen->search(fenu_t3_jpn[i])->hide(); + } else { + field_0x21c[3][i] = (J2DTextBox*)mpScreen->search(fenu_t4[i]); + mpScreen->search(menu_t4[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN field_0x21c[3][i] = (J2DTextBox*)mpScreen->search(menu_t3[i]); mpScreen->search(fenu_t3[i])->hide(); #else @@ -1688,12 +1829,25 @@ void dMenu_Option_c::screenSet() { #endif field_0x21c[3][i]->setFont(mpFont); field_0x21c[3][i]->setString(0x40, ""); -#if VERSION == VERSION_GCN_JPN + +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + mpString->getString(0x54F, field_0x21c[3][i], NULL, NULL, NULL, 0); + } +#elif VERSION == VERSION_GCN_JPN mpString->getString(0x54F, field_0x21c[3][i], NULL, NULL, NULL, 0); #endif } for (int i = 0; i < 2; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + field_0x21c[4][i] = (J2DTextBox*)mpScreen->search(menu_t4_jpn[i]); + mpScreen->search(fenu_t4_jpn[i])->hide(); + } else { + field_0x21c[4][i] = (J2DTextBox*)mpScreen->search(fenu_t1[i]); + mpScreen->search(menu_t1[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN field_0x21c[4][i] = (J2DTextBox*)mpScreen->search(menu_t4[i]); mpScreen->search(fenu_t4[i])->hide(); #else @@ -1704,7 +1858,15 @@ void dMenu_Option_c::screenSet() { field_0x21c[4][i]->setString(0x40, ""); } for (int i = 0; i < 2; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + field_0x21c[5][i] = (J2DTextBox*)mpScreen->search(menu_t5_jpn[i]); + mpScreen->search(fenu_t5_jpn[i])->hide(); + } else { + field_0x21c[5][i] = (J2DTextBox*)mpScreen->search(fenu_t5[i]); + mpScreen->search(menu_t5[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN field_0x21c[5][i] = (J2DTextBox*)mpScreen->search(menu_t5[i]); mpScreen->search(fenu_t5[i])->hide(); #else @@ -1716,7 +1878,17 @@ void dMenu_Option_c::screenSet() { mpString->getString(0x554, field_0x21c[5][i], NULL, NULL, NULL, 0); } for (int i = 0; i < 6; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + paneResize(menut_0[i]); + mpMenuText[0][i] = JKR_NEW CPaneMgr(mpClipScreen, menut_0[i], 0, NULL); + mpClipScreen->search(fenut_0[i])->hide(); + } else { + paneResize(fenut_0[i]); + mpMenuText[0][i] = JKR_NEW CPaneMgr(mpClipScreen, fenut_0[i], 0, NULL); + mpClipScreen->search(menut_0[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN paneResize(menut_0[i]); mpMenuText[0][i] = JKR_NEW CPaneMgr(mpClipScreen, menut_0[i], 0, NULL); mpClipScreen->search(fenut_0[i])->hide(); @@ -1730,7 +1902,17 @@ void dMenu_Option_c::screenSet() { mpMenuText[0][i]->getPanePtr()->setBasePosition(J2DBasePosition_4); } for (int i = 0; i < 6; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + paneResize(menut_1[i]); + mpMenuText[1][i] = JKR_NEW CPaneMgr(mpClipScreen, menut_1[i], 0, NULL); + mpClipScreen->search(fenut_1[i])->hide(); + } else { + paneResize(fenut_1[i]); + mpMenuText[1][i] = JKR_NEW CPaneMgr(mpClipScreen, fenut_1[i], 0, NULL); + mpClipScreen->search(menut_1[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN paneResize(menut_1[i]); mpMenuText[1][i] = JKR_NEW CPaneMgr(mpClipScreen, menut_1[i], 0, NULL); mpClipScreen->search(fenut_1[i])->hide(); @@ -1745,7 +1927,17 @@ void dMenu_Option_c::screenSet() { mpMenuText[1][i]->getPanePtr()->setBasePosition(J2DBasePosition_4); } for (int i = 0; i < 6; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + paneResize(menut_2[i]); + mpMenuText[2][i] = JKR_NEW CPaneMgr(mpClipScreen, menut_2[i], 0, NULL); + mpClipScreen->search(fenut_2[i])->hide(); + } else { + paneResize(fenut_2[i]); + mpMenuText[2][i] = JKR_NEW CPaneMgr(mpClipScreen, fenut_2[i], 0, NULL); + mpClipScreen->search(menut_2[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN paneResize(menut_2[i]); mpMenuText[2][i] = JKR_NEW CPaneMgr(mpClipScreen, menut_2[i], 0, NULL); mpClipScreen->search(fenut_2[i])->hide(); @@ -1760,7 +1952,17 @@ void dMenu_Option_c::screenSet() { mpMenuText[2][i]->getPanePtr()->setBasePosition(J2DBasePosition_4); } for (int i = 0; i < 6; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + paneResize(menut_3[i]); + mpMenuText[3][i] = JKR_NEW CPaneMgr(mpClipScreen, menut_3[i], 0, NULL); + mpClipScreen->search(fenut_3[i])->hide(); + } else { + paneResize(fenut_3[i]); + mpMenuText[3][i] = JKR_NEW CPaneMgr(mpClipScreen, fenut_3[i], 0, NULL); + mpClipScreen->search(menut_3[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN paneResize(menut_3[i]); mpMenuText[3][i] = JKR_NEW CPaneMgr(mpClipScreen, menut_3[i], 0, NULL); mpClipScreen->search(fenut_3[i])->hide(); @@ -1775,7 +1977,17 @@ void dMenu_Option_c::screenSet() { mpMenuText[3][i]->getPanePtr()->setBasePosition(J2DBasePosition_4); } for (int i = 0; i < 6; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + paneResize(menut_4[i]); + mpMenuText[4][i] = JKR_NEW CPaneMgr(mpClipScreen, menut_4[i], 0, NULL); + mpClipScreen->search(fenut_4[i])->hide(); + } else { + paneResize(fenut_4[i]); + mpMenuText[4][i] = JKR_NEW CPaneMgr(mpClipScreen, fenut_4[i], 0, NULL); + mpClipScreen->search(menut_4[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN paneResize(menut_4[i]); mpMenuText[4][i] = JKR_NEW CPaneMgr(mpClipScreen, menut_4[i], 0, NULL); mpClipScreen->search(fenut_4[i])->hide(); @@ -1801,7 +2013,16 @@ void dMenu_Option_c::screenSet() { } field_0x3b4 = 0.0f; menuVisible(); -#if VERSION == VERSION_GCN_JPN + +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + mpBackScreen->search(MULTI_CHAR('jpn_n'))->show(); + mpBackScreen->search(MULTI_CHAR('foregn_n'))->hide(); + } else { + mpBackScreen->search(MULTI_CHAR('jpn_n'))->hide(); + mpBackScreen->search(MULTI_CHAR('foregn_n'))->show(); + } +#elif VERSION == VERSION_GCN_JPN mpBackScreen->search(MULTI_CHAR('jpn_n'))->show(); mpBackScreen->search(MULTI_CHAR('foregn_n'))->hide(); #else @@ -1809,7 +2030,7 @@ void dMenu_Option_c::screenSet() { mpBackScreen->search(MULTI_CHAR('foregn_n'))->show(); #endif for (int i = 0; i < 6; i++) { - J2DTextBox* backScreen = (J2DTextBox*)mpBackScreen->search(tx[i]); + J2DTextBox* backScreen = (J2DTextBox*)mpBackScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? tx_jpn[i] : tx[i], tx[i])); backScreen->setFont(mpFont); backScreen->setString(0x80, ""); if (i < 2) { @@ -1832,10 +2053,12 @@ void dMenu_Option_c::screenSet() { } } for (int i = 0; i < 10; i++) { - J2DTextBox* tvScreen = (J2DTextBox*)mpTVScreen->search(txTV[i]); + J2DTextBox* tvScreen = (J2DTextBox*)mpTVScreen->search(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? txTV_jpn[i] : txTV[i], txTV[i])); tvScreen->setFont(mpFont); -#if VERSION != VERSION_GCN_JPN +#if TARGET_PC || VERSION != VERSION_GCN_JPN + IF_DUSK_BLOCK(!dusk::version::isRegionJpn()) tvScreen->setCharSpace(0.0f); + IF_DUSK_BLOCK_END #endif if (i < 2) { @@ -1894,7 +2117,7 @@ void dMenu_Option_c::setAttenString() { } } -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC || VERSION == VERSION_GCN_JPN void dMenu_Option_c::setRubyString() { u16 stringId1; u16 stringId2; @@ -1930,7 +2153,9 @@ void dMenu_Option_c::setVibString() { stringId2 = 0x54C; } for (int i = 0; i < 6; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + const int IDX = dusk::version::isRegionJpn() ? 2 : 1; +#elif VERSION == VERSION_GCN_JPN const int IDX = 2; #else const int IDX = 1; @@ -1964,7 +2189,9 @@ void dMenu_Option_c::setSoundString() { stringId3 = 0x550; } for (int i = 0; i < 6; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + const int IDX = dusk::version::isRegionJpn() ? 3 : 2; +#elif VERSION == VERSION_GCN_JPN const int IDX = 3; #else const int IDX = 2; @@ -1983,10 +2210,25 @@ void dMenu_Option_c::setSoundString() { } void dMenu_Option_c::setCursorPos(u8 i_index) { -#if VERSION != VERSION_GCN_JPN +#if TARGET_PC + if (!dusk::version::isRegionJpn()) { + switch (i_index) { + case PROC_VIB_e: + i_index = 1; + break; + case PROC_SOUND_e: + i_index = 2; + break; + } + } +#endif + +#if TARGET_PC || VERSION != VERSION_GCN_JPN + IF_DUSK_BLOCK(!dusk::version::isRegionJpn()) if (i_index == 4) { i_index = 5; } + IF_DUSK_BLOCK_END #endif Vec pos = mpMenuPane[i_index]->getGlobalVtxCenter(mpMenuPane[i_index]->mPane, false, 0); @@ -2037,13 +2279,33 @@ void dMenu_Option_c::setSelectColor(u8 param_0, bool param_1) { } u8 dMenu_Option_c::getSelectType() { - if (field_0x3ef < SelectType3) { +#if TARGET_PC + u8 proc = 0; + if (field_0x3ef < PROC_CHANGE_MOVE_e) { + proc = field_0x3ef; + } else if (field_0x3f5 < PROC_CHANGE_MOVE_e) { + proc = field_0x3f5; + } + + if (!dusk::version::isRegionJpn()) { + switch (proc) { + case PROC_VIB_e: + return 1; + case PROC_SOUND_e: + return 2; + } + } + + return proc; +#else + if (field_0x3ef < PROC_CHANGE_MOVE_e) { return field_0x3ef; } - if (field_0x3f5 < SelectType3) { + if (field_0x3f5 < PROC_CHANGE_MOVE_e) { return field_0x3f5; } return 0; +#endif } void dMenu_Option_c::changeBarColor(bool i_changeColor) { @@ -2237,7 +2499,7 @@ bool dMenu_Option_c::isRumbleSupported() { #if TARGET_PC bool dMenu_Option_c::pointerConfirmSelect() { dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::Options); - for (u8 i = 0; i < SelectType3; ++i) { + for (u8 i = 0; i < (dusk::version::isRegionJpn() ? 4 : 3); ++i) { if (dusk::menu_pointer::hit_pane(mpMenuPane[i], 8.0f)) { dusk::menu_pointer::set_hover_target(i); return false; @@ -2251,7 +2513,7 @@ bool dMenu_Option_c::pointerConfirmSelect() { field_0x3f7 = 1; field_0x3f5 = field_0x3ef; - field_0x3ef = SelectType4; + field_0x3ef = PROC_CONFIRM_OPEN_MOVE_e; dMeter2Info_set2DVibration(); (this->*init[field_0x3ef])(); return true; @@ -2261,14 +2523,45 @@ bool dMenu_Option_c::pointerConfirmSelect() { bool dMenu_Option_c::dpdMenuMove() { #if TARGET_PC dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::Options); - for (u8 i = 0; i < SelectType3; ++i) { + for (u8 i = 0; i < (dusk::version::isRegionJpn() ? 4 : 3); ++i) { if (!dusk::menu_pointer::hit_pane(mpMenuPane[i], 8.0f)) { continue; } dusk::menu_pointer::set_hover_target(i); + + u8 selectProc = 0; + if (dusk::version::isRegionJpn()) { + switch (i) { + case 0: + selectProc = PROC_ATTEN_e; + break; + case 1: + selectProc = PROC_RUBY_e; + break; + case 2: + selectProc = PROC_VIB_e; + break; + case 3: + selectProc = PROC_SOUND_e; + break; + } + } else { + switch (i) { + case 0: + selectProc = PROC_ATTEN_e; + break; + case 1: + selectProc = PROC_VIB_e; + break; + case 2: + selectProc = PROC_SOUND_e; + break; + } + } + if (getSelectType() != i) { - field_0x3ef = i; - setCursorPos(i); + field_0x3ef = selectProc; + setCursorPos(field_0x3ef); Z2GetAudioMgr()->seStart(Z2SE_SY_CURSOR_OPTION, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); } @@ -2276,29 +2569,41 @@ bool dMenu_Option_c::dpdMenuMove() { return true; } - switch (i) { - case SelectType0: + switch (selectProc) { + case PROC_ATTEN_e: field_0x3e4 ^= 1; field_0x3da = 5; - field_0x3ef = SelectType3; - field_0x3f5 = SelectType0; + field_0x3ef = PROC_CHANGE_MOVE_e; + field_0x3f5 = PROC_ATTEN_e; Z2GetAudioMgr()->seStart(Z2SE_SY_OPTION_SWITCH, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); return true; - case SelectType1: + case PROC_RUBY_e: + if (field_0x3e5_JPN == 0) { + field_0x3e5_JPN = 1; + field_0x3da = 5; + } else if (field_0x3e5_JPN == 1) { + field_0x3e5_JPN = 0; + field_0x3da = 5; + } + field_0x3ef = PROC_CHANGE_MOVE_e; + field_0x3f5 = PROC_RUBY_e; + Z2GetAudioMgr()->seStart(Z2SE_SY_OPTION_SWITCH, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + return true; + case PROC_VIB_e: if (isRumbleSupported()) { field_0x3ea ^= 1; if (field_0x3ea != 0) { mDoCPd_c::startMotorWave(0, &field_0x3e0, JUTGamePad::CRumble::VAL_0, 0x3c); } field_0x3da = 5; - field_0x3ef = SelectType3; - field_0x3f5 = SelectType1; + field_0x3ef = PROC_CHANGE_MOVE_e; + field_0x3f5 = PROC_VIB_e; Z2GetAudioMgr()->seStart(Z2SE_SY_OPTION_SWITCH, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); } return true; - case SelectType2: + case PROC_SOUND_e: if (field_0x3e9 == 0) { field_0x3e9 = 2; } else { @@ -2307,8 +2612,8 @@ bool dMenu_Option_c::dpdMenuMove() { field_0x3da = 5; mDoAud_setOutputMode(dMo_soundMode[field_0x3e9]); setSoundMode(dMo_soundMode[field_0x3e9]); - field_0x3ef = SelectType3; - field_0x3f5 = SelectType2; + field_0x3ef = PROC_CHANGE_MOVE_e; + field_0x3f5 = PROC_SOUND_e; Z2GetAudioMgr()->seStart(Z2SE_SY_OPTION_SWITCH, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); return true; @@ -2333,8 +2638,8 @@ void dMenu_Option_c::paneResize(u64 i_tag) { void dMenu_Option_c::initialize() { field_0x3e4 = dComIfGs_getOptAttentionType(); -#if VERSION == VERSION_GCN_JPN - if (dComIfGs_getOptRuby() == 0) { +#if TARGET_PC || VERSION == VERSION_GCN_JPN + if (IF_DUSK(dusk::version::isRegionJpn() &&) dComIfGs_getOptRuby() == 0) { field_0x3e5_JPN = 1; } else { field_0x3e5_JPN = 0; @@ -2352,8 +2657,10 @@ void dMenu_Option_c::initialize() { field_0x3ea = 0; } setAttenString(); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC || VERSION == VERSION_GCN_JPN + IF_DUSK_BLOCK(dusk::version::isRegionJpn()) setRubyString(); + IF_DUSK_BLOCK_END #endif setVibString(); setSoundString(); diff --git a/src/d/d_menu_ring.cpp b/src/d/d_menu_ring.cpp index a50d6def3a..3fe55c2b6c 100644 --- a/src/d/d_menu_ring.cpp +++ b/src/d/d_menu_ring.cpp @@ -29,6 +29,8 @@ #include +#include "dusk/version.hpp" + #if TARGET_PC #include "dusk/frame_interpolation.h" #include "dusk/game_clock.h" @@ -341,7 +343,16 @@ dMenu_Ring_c::dMenu_Ring_c(JKRExpHeap* i_heap, STControl* i_stick, CSTControl* i } mpString = JKR_NEW dMsgString_c(); for (i = 0; i < 5; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + J2DTextBox* fxy_TextBox; + if (dusk::version::isRegionJpn()) { + fxy_TextBox = (J2DTextBox*)mpScreen->search(xy_text[i]); + mpScreen->search(fxy_text[i])->hide(); + } else { + fxy_TextBox = (J2DTextBox*)mpScreen->search(fxy_text[i]); + mpScreen->search(xy_text[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN J2DTextBox* fxy_TextBox = (J2DTextBox*)mpScreen->search(xy_text[i]); mpScreen->search(fxy_text[i])->hide(); #else @@ -353,75 +364,77 @@ dMenu_Ring_c::dMenu_Ring_c(JKRExpHeap* i_heap, STControl* i_stick, CSTControl* i field_0x580[0] = mpString->getString(0x380, fxy_TextBox, NULL, NULL, NULL, 0); } for (i = 0; i < 5; i++) { -#if VERSION == VERSION_GCN_JPN - #if TARGET_PC +#if TARGET_PC J2DTextBox* fc_TextBox; - if (dusk::getSettings().game.swapDirectSelect) { - fc_TextBox = (J2DTextBox*)mpScreen->search(c_text1[i]); - mpScreen->search(fc_text1[i])->hide(); + if (dusk::version::isRegionJpn()) { + if (dusk::getSettings().game.swapDirectSelect) { + fc_TextBox = (J2DTextBox*)mpScreen->search(c_text1[i]); + mpScreen->search(fc_text1[i])->hide(); + } else { + fc_TextBox = (J2DTextBox*)mpScreen->search(c_text[i]); + mpScreen->search(fc_text[i])->hide(); + } } else { - fc_TextBox = (J2DTextBox*)mpScreen->search(c_text[i]); - mpScreen->search(fc_text[i])->hide(); + if (dusk::getSettings().game.swapDirectSelect) { + fc_TextBox = (J2DTextBox*)mpScreen->search(fc_text1[i]); + mpScreen->search(c_text1[i])->hide(); + } else { + fc_TextBox = (J2DTextBox*)mpScreen->search(fc_text[i]); + mpScreen->search(c_text[i])->hide(); + } } - #else +#elif VERSION == VERSION_GCN_JPN J2DTextBox* fc_TextBox = (J2DTextBox*)mpScreen->search(c_text[i]); mpScreen->search(fc_text[i])->hide(); - #endif #else - #if TARGET_PC - J2DTextBox* fc_TextBox; - if (dusk::getSettings().game.swapDirectSelect) { - fc_TextBox = (J2DTextBox*)mpScreen->search(fc_text1[i]); - mpScreen->search(c_text1[i])->hide(); - } else { - fc_TextBox = (J2DTextBox*)mpScreen->search(fc_text[i]); - mpScreen->search(c_text[i])->hide(); - } - #else J2DTextBox* fc_TextBox = (J2DTextBox*)mpScreen->search(fc_text[i]); mpScreen->search(c_text[i])->hide(); - #endif #endif fc_TextBox->setFont(mDoExt_getMesgFont()); fc_TextBox->setString(0x40, ""); field_0x580[1] = mpString->getString(0x37F, fc_TextBox, NULL, NULL, NULL, 0); } for (i = 0; i < 5; i++) { -#if VERSION == VERSION_GCN_JPN - #if TARGET_PC +#if TARGET_PC J2DTextBox* fc1_TextBox; - if (dusk::getSettings().game.swapDirectSelect) { - fc1_TextBox = (J2DTextBox*)mpScreen->search(c_text[i]); - mpScreen->search(fc_text[i])->hide(); + if (dusk::version::isRegionJpn()) { + if (dusk::getSettings().game.swapDirectSelect) { + fc1_TextBox = (J2DTextBox*)mpScreen->search(c_text[i]); + mpScreen->search(fc_text[i])->hide(); + } else { + fc1_TextBox = (J2DTextBox*)mpScreen->search(c_text1[i]); + mpScreen->search(fc_text1[i])->hide(); + } } else { - fc1_TextBox = (J2DTextBox*)mpScreen->search(c_text1[i]); - mpScreen->search(fc_text1[i])->hide(); + if (dusk::getSettings().game.swapDirectSelect) { + fc1_TextBox = (J2DTextBox*)mpScreen->search(fc_text[i]); + mpScreen->search(c_text[i])->hide(); + } else { + fc1_TextBox = (J2DTextBox*)mpScreen->search(fc_text1[i]); + mpScreen->search(c_text1[i])->hide(); + } } - #else +#elif VERSION == VERSION_GCN_JPN J2DTextBox* fc1_TextBox = (J2DTextBox*)mpScreen->search(c_text1[i]); mpScreen->search(fc_text1[i])->hide(); - #endif #else - #if TARGET_PC - J2DTextBox* fc1_TextBox; - if (dusk::getSettings().game.swapDirectSelect) { - fc1_TextBox = (J2DTextBox*)mpScreen->search(fc_text[i]); - mpScreen->search(c_text[i])->hide(); - } else { - fc1_TextBox = (J2DTextBox*)mpScreen->search(fc_text1[i]); - mpScreen->search(c_text1[i])->hide(); - } - #else J2DTextBox* fc1_TextBox = (J2DTextBox*)mpScreen->search(fc_text1[i]); mpScreen->search(c_text1[i])->hide(); - #endif #endif fc1_TextBox->setFont(mDoExt_getMesgFont()); fc1_TextBox->setString(0x40, ""); field_0x580[2] = mpString->getString(0x4CD, fc1_TextBox, NULL, NULL, NULL, 0); } for (int i = 0; i < 5; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + mpComboOffString[i] = (J2DTextBox*)mpScreen->search(t_on[i]); + mpScreen->search(ft_on[i])->hide(); + } else { + mpComboOffString[i] = (J2DTextBox*)mpScreen->search(ft_on[i]); + mpScreen->search(t_on[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN mpComboOffString[i] = (J2DTextBox*)mpScreen->search(t_on[i]); mpScreen->search(ft_on[i])->hide(); #else @@ -433,7 +446,15 @@ dMenu_Ring_c::dMenu_Ring_c(JKRExpHeap* i_heap, STControl* i_stick, CSTControl* i mpString->getString(0x4D2, mpComboOffString[i], NULL, NULL, NULL, 0); } for (int i = 0; i < 5; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + mpBowArrowComboString[i] = (J2DTextBox*)mpScreen->search(t_off[i]); + mpScreen->search(ft_off[i])->hide(); + } else { + mpBowArrowComboString[i] = (J2DTextBox*)mpScreen->search(ft_off[i]); + mpScreen->search(t_off[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN mpBowArrowComboString[i] = (J2DTextBox*)mpScreen->search(t_off[i]); mpScreen->search(ft_off[i])->hide(); #else @@ -464,7 +485,31 @@ dMenu_Ring_c::dMenu_Ring_c(JKRExpHeap* i_heap, STControl* i_stick, CSTControl* i mpNameParent = JKR_NEW CPaneMgr(mpCenterScreen, MULTI_CHAR('label_n'), 1, NULL); mpCircle = JKR_NEW CPaneMgr(mpCenterScreen, MULTI_CHAR('circle_n'), 2, NULL); J2DTextBox* textBox[4]; -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + textBox[0] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n04')); + textBox[1] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n05')); + textBox[2] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n06')); + textBox[3] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n07')); + J2DPane* pane = mpCenterScreen->search(MULTI_CHAR('fitem_n1')); + pane->mVisible = false; + pane = mpCenterScreen->search(MULTI_CHAR('fitem_n2')); + pane->mVisible = false; + pane = mpCenterScreen->search(MULTI_CHAR('fitem_n3')); + pane->mVisible = false; + pane = mpCenterScreen->search(MULTI_CHAR('fitem_n4')); + pane->mVisible = false; + } else { + textBox[0] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('fitem_n1')); + textBox[1] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('fitem_n2')); + textBox[2] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('fitem_n3')); + textBox[3] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('fitem_n4')); + mpCenterScreen->search(MULTI_CHAR('item_n04')); + mpCenterScreen->search(MULTI_CHAR('item_n05')); + mpCenterScreen->search(MULTI_CHAR('item_n06')); + mpCenterScreen->search(MULTI_CHAR('item_n07')); + } +#elif VERSION == VERSION_GCN_JPN textBox[0] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n04')); textBox[1] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n05')); textBox[2] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n06')); @@ -1246,7 +1291,19 @@ void dMenu_Ring_c::setScale() { void dMenu_Ring_c::setNameString(u32 i_stringID) { J2DTextBox* textBox[4]; -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + textBox[0] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n04')); + textBox[1] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n05')); + textBox[2] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n06')); + textBox[3] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n07')); + } else { + textBox[0] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('fitem_n1')); + textBox[1] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('fitem_n2')); + textBox[2] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('fitem_n3')); + textBox[3] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('fitem_n4')); + } +#elif VERSION == VERSION_GCN_JPN textBox[0] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n04')); textBox[1] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n05')); textBox[2] = (J2DTextBox*)mpCenterScreen->search(MULTI_CHAR('item_n06')); diff --git a/src/d/d_menu_save.cpp b/src/d/d_menu_save.cpp index 78ebd3e064..e9be233f6b 100644 --- a/src/d/d_menu_save.cpp +++ b/src/d/d_menu_save.cpp @@ -1,25 +1,26 @@ #include "d/dolzel.h" // IWYU pragma: keep -#include "d/d_menu_save.h" -#include "JSystem/JKernel/JKRExpHeap.h" -#include "JSystem/JKernel/JKRMemArchive.h" #include #include +#include "JSystem/J2DGraph/J2DAnmLoader.h" +#include "JSystem/JKernel/JKRExpHeap.h" +#include "JSystem/JKernel/JKRMemArchive.h" #include "d/d_com_inf_game.h" -#include "d/d_lib.h" -#include "d/d_select_cursor.h" #include "d/d_file_sel_info.h" #include "d/d_file_sel_warning.h" +#include "d/d_lib.h" +#include "d/d_menu_save.h" #include "d/d_meter2_info.h" +#include "d/d_msg_scrn_explain.h" #include "d/d_msg_string.h" +#include "d/d_select_cursor.h" +#include "dusk/version.hpp" +#include "f_op/f_op_msg_mng.h" #include "m_Do/m_Do_MemCard.h" #include "m_Do/m_Do_MemCardRWmng.h" #include "m_Do/m_Do_Reset.h" #include "m_Do/m_Do_controller_pad.h" #include "m_Do/m_Do_graphic.h" -#include "d/d_msg_scrn_explain.h" -#include "JSystem/J2DGraph/J2DAnmLoader.h" -#include "f_op/f_op_msg_mng.h" #if TARGET_PC #include "dusk/frame_interpolation.h" @@ -179,7 +180,15 @@ void dMenu_save_c::screenSet() { static u64 l_tagName10[2] = {MULTI_CHAR('w_no_g'), MULTI_CHAR('w_yes_g')}; static u64 l_tagName11[2] = {MULTI_CHAR('w_no_gr'), MULTI_CHAR('w_yes_gr')}; static u64 l_tagName12[3] = {MULTI_CHAR('w_bk_l00'), MULTI_CHAR('w_bk_l01'), MULTI_CHAR('w_bk_l02')}; -#if VERSION == VERSION_GCN_JPN + +#if TARGET_PC + static u64 l_tagName21_jpn[2] = {MULTI_CHAR('w_tabi_s'), MULTI_CHAR('w_tabi_x')}; + static u64 l_tagName20_jpn[2] = {MULTI_CHAR('w_er_msg'), MULTI_CHAR('w_er_msR')}; + static u64 l_tagName21[2] = {MULTI_CHAR('t_for'), MULTI_CHAR('t_for1')}; + static u64 l_tagName211[10] = {MULTI_CHAR('tmoyou00'), MULTI_CHAR('tmoyou01'), MULTI_CHAR('tmoyou02'), MULTI_CHAR('tmoyou03'), MULTI_CHAR('tmoyou04'), + MULTI_CHAR('tmoyou05'), MULTI_CHAR('tmoyou06'), MULTI_CHAR('tmoyou07'), MULTI_CHAR('tmoyou08'), MULTI_CHAR('tmoyou09')}; + static u64 l_tagName20[2] = {MULTI_CHAR('er_for0'), MULTI_CHAR('er_for1')}; +#elif VERSION == VERSION_GCN_JPN static u64 l_tagName21[2] = {MULTI_CHAR('w_tabi_s'), MULTI_CHAR('w_tabi_x')}; static u64 l_tagName20[2] = {MULTI_CHAR('w_er_msg'), MULTI_CHAR('w_er_msR')}; #else @@ -188,6 +197,7 @@ void dMenu_save_c::screenSet() { MULTI_CHAR('tmoyou05'), MULTI_CHAR('tmoyou06'), MULTI_CHAR('tmoyou07'), MULTI_CHAR('tmoyou08'), MULTI_CHAR('tmoyou09')}; static u64 l_tagName20[2] = {MULTI_CHAR('er_for0'), MULTI_CHAR('er_for1')}; #endif + static u64 l_tagName13[3] = {MULTI_CHAR('w_dat_i0'), MULTI_CHAR('w_dat_i1'), MULTI_CHAR('w_dat_i2')}; static u8 l_msgNum0[2] = {0x08, 0x07}; static u8 l_msgNum[2] = {0x54, 0x55}; @@ -221,7 +231,15 @@ void dMenu_save_c::screenSet() { mpNoYes[1] = JKR_NEW CPaneMgr(mSaveSel.Scr, MULTI_CHAR('w_yes_n'), 0, NULL); for (int i = 0; i < 2; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + mpNoYesTxt[i] = JKR_NEW CPaneMgr(mSaveSel.Scr, l_tagName000[i], 0, NULL); + mSaveSel.Scr->search(l_tagName000U[i])->hide(); + } else { + mpNoYesTxt[i] = JKR_NEW CPaneMgr(mSaveSel.Scr, l_tagName000U[i], 0, NULL); + mSaveSel.Scr->search(l_tagName000[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN mpNoYesTxt[i] = JKR_NEW CPaneMgr(mSaveSel.Scr, l_tagName000[i], 0, NULL); mSaveSel.Scr->search(l_tagName000U[i])->hide(); #else @@ -240,7 +258,15 @@ void dMenu_save_c::screenSet() { mpBBtnIcon = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, MULTI_CHAR('w_nbbtn'), 2, NULL); mpABtnIcon = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, MULTI_CHAR('w_nabtn'), 2, NULL); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + mpBackTxt = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, MULTI_CHAR('w_modo'), 2, NULL); + mpConfirmTxt = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, MULTI_CHAR('w_kete'), 2, NULL); + } else { + mpBackTxt = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, MULTI_CHAR('f_modo'), 2, NULL); + mpConfirmTxt = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, MULTI_CHAR('f_kete'), 2, NULL); + } +#elif VERSION == VERSION_GCN_JPN mpBackTxt = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, MULTI_CHAR('w_modo'), 2, NULL); mpConfirmTxt = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, MULTI_CHAR('w_kete'), 2, NULL); #else @@ -255,7 +281,15 @@ void dMenu_save_c::screenSet() { for (int i = 0; i < 2; i++) { J2DTextBox* tbox[2]; -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + tbox[i] = (J2DTextBox*)mSaveSel.Scr->search(l_tagName00[i]); + mSaveSel.Scr->search(l_tagName00U[i])->hide(); + } else { + tbox[i] = (J2DTextBox*)mSaveSel.Scr->search(l_tagName00U[i]); + mSaveSel.Scr->search(l_tagName00[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN tbox[i] = (J2DTextBox*)mSaveSel.Scr->search(l_tagName00[i]); mSaveSel.Scr->search(l_tagName00U[i])->hide(); #else @@ -330,7 +364,19 @@ void dMenu_save_c::screenSet() { mpBookWaku[i]->setAlpha(0); } -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + mSaveSel.Scr->search(MULTI_CHAR('t_for'))->hide(); + mSaveSel.Scr->search(MULTI_CHAR('t_for1'))->hide(); + } else { + mSaveSel.Scr->search(MULTI_CHAR('w_tabi_s'))->hide(); + mSaveSel.Scr->search(MULTI_CHAR('w_tabi_x'))->hide(); + + for (int i = 0; i < 10; i++) { + mSaveSel.Scr->search(l_tagName211[i])->hide(); + } + } +#elif VERSION == VERSION_GCN_JPN mSaveSel.Scr->search(MULTI_CHAR('t_for'))->hide(); mSaveSel.Scr->search(MULTI_CHAR('t_for1'))->hide(); #else @@ -343,11 +389,21 @@ void dMenu_save_c::screenSet() { #endif for (int i = 0; i < 2; i++) { - mpHeaderTxtPane[i] = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, l_tagName21[i], 0, NULL); + mpHeaderTxtPane[i] = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, DUSK_IF_ELSE(dusk::version::isRegionJpn() ? l_tagName21_jpn[i] : l_tagName21[i], l_tagName21[i]), 0, NULL); ((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setFont(mSaveSel.font[0]); ((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setString(0x100, ""); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + ((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setFontSize(21.0f, 21.0f); + ((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setLineSpace(22.0f); + ((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setCharSpace(2.0f); + } else { + ((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setFontSize(19.0f, 19.0f); + ((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setLineSpace(20.0f); + ((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setCharSpace(0.0f); + } +#elif VERSION == VERSION_GCN_JPN ((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setFontSize(21.0f, 21.0f); ((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setLineSpace(22.0f); ((J2DTextBox*)mpHeaderTxtPane[i]->getPanePtr())->setCharSpace(2.0f); @@ -364,7 +420,15 @@ void dMenu_save_c::screenSet() { mHeaderTxtType = 0; field_0xb4 = mSaveSel.Scr->search(MULTI_CHAR('w_er_n')); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + mSaveSel.Scr->search(MULTI_CHAR('er_for0'))->hide(); + mSaveSel.Scr->search(MULTI_CHAR('er_for1'))->hide(); + } else { + mSaveSel.Scr->search(MULTI_CHAR('w_er_msg'))->hide(); + mSaveSel.Scr->search(MULTI_CHAR('w_er_msR'))->hide(); + } +#elif VERSION == VERSION_GCN_JPN mSaveSel.Scr->search(MULTI_CHAR('er_for0'))->hide(); mSaveSel.Scr->search(MULTI_CHAR('er_for1'))->hide(); #else @@ -373,7 +437,9 @@ void dMenu_save_c::screenSet() { #endif for (int i = 0; i < 2; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + mpErrTxtPane[i] = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, DUSK_IF_ELSE(dusk::version::isRegionJpn() ? l_tagName20_jpn[i] : l_tagName20[i], l_tagName20[i]), 0, NULL); +#elif VERSION == VERSION_GCN_JPN mpErrTxtPane[i] = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, l_tagName20[i], 0, NULL); #else mpErrTxtPane[i] = JKR_NEW CPaneMgrAlpha(mSaveSel.Scr, l_tagName20[i], 0, NULL); @@ -381,7 +447,18 @@ void dMenu_save_c::screenSet() { ((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setFont(mSaveSel.font[0]); ((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setString(0x200, ""); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + ((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setFontSize(21.0f, 21.0f); + ((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setLineSpace(22.0f); + ((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setCharSpace(2.0f); + } else { + ((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->resize(440.0f, 198.0f); + ((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setFontSize(21.0f, 21.0f); + ((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setLineSpace(21.0f); + ((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setCharSpace(1.0f); + } +#elif VERSION == VERSION_GCN_JPN ((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setFontSize(21.0f, 21.0f); ((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setLineSpace(22.0f); ((J2DTextBox*)mpErrTxtPane[i]->getPanePtr())->setCharSpace(2.0f); @@ -2468,7 +2545,23 @@ bool dMenu_save_c::selectDataBaseMoveAnm() { mpSelectMoveBase->getPanePtr()->animationTransform(); return false; } else { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + if (mDataBaseMoveAnmFrame == 33) { + field_0x64 = 1; + } else { + field_0x64 = 0; + } + field_0x65 = 0; + } else { + if (mDataBaseMoveAnmFrame == 33) { + field_0x64 = 1; + field_0x65 = 0; + } else { + field_0x64 = 0; + } + } +#elif VERSION == VERSION_GCN_JPN if (mDataBaseMoveAnmFrame == 33) { field_0x64 = 1; } else { diff --git a/src/d/d_menu_skill.cpp b/src/d/d_menu_skill.cpp index 0c970e76c3..90d4a3f92b 100644 --- a/src/d/d_menu_skill.cpp +++ b/src/d/d_menu_skill.cpp @@ -18,6 +18,8 @@ #include "m_Do/m_Do_graphic.h" #include +#include "dusk/version.hpp" + #if TARGET_PC #include "dusk/menu_pointer.h" #endif @@ -467,7 +469,27 @@ void dMenu_Skill_c::screenSetMenu() { mpParent = JKR_NEW CPaneMgr(mpMenuScreen, MULTI_CHAR('n_all'), 2, NULL); mpParent->setAlphaRate(0.0f); for (int i = 0; i < 7; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + mpFTagPicture[i][0] = (J2DTextBox*)mpMenuScreen->search(tag_sub0[i]); + mpFTagPicture[i][1] = (J2DTextBox*)mpMenuScreen->search(tag_sub1[i]); + mpFTagPicture[i][2] = (J2DTextBox*)mpMenuScreen->search(tag_name0[i]); + mpFTagPicture[i][3] = (J2DTextBox*)mpMenuScreen->search(tag_name1[i]); + mpMenuScreen->search(ftag_sub0[i])->hide(); + mpMenuScreen->search(ftag_sub1[i])->hide(); + mpMenuScreen->search(ftag_name0[i])->hide(); + mpMenuScreen->search(ftag_name1[i])->hide(); + } else { + mpFTagPicture[i][0] = (J2DTextBox*)mpMenuScreen->search(ftag_sub0[i]); + mpFTagPicture[i][1] = (J2DTextBox*)mpMenuScreen->search(ftag_sub1[i]); + mpFTagPicture[i][2] = (J2DTextBox*)mpMenuScreen->search(ftag_name0[i]); + mpFTagPicture[i][3] = (J2DTextBox*)mpMenuScreen->search(ftag_name1[i]); + mpMenuScreen->search(tag_sub0[i])->hide(); + mpMenuScreen->search(tag_sub1[i])->hide(); + mpMenuScreen->search(tag_name0[i])->hide(); + mpMenuScreen->search(tag_name1[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN mpFTagPicture[i][0] = (J2DTextBox*)mpMenuScreen->search(tag_sub0[i]); mpFTagPicture[i][1] = (J2DTextBox*)mpMenuScreen->search(tag_sub1[i]); mpFTagPicture[i][2] = (J2DTextBox*)mpMenuScreen->search(tag_name0[i]); @@ -522,7 +544,16 @@ void dMenu_Skill_c::screenSetMenu() { mSelectWhite[i] = mpFTagPicture[1][i]->getWhite(); } } -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + J2DTextBox* textBox; + if (dusk::version::isRegionJpn()) { + textBox = (J2DTextBox*)mpMenuScreen->search(MULTI_CHAR('t_t00')); + mpMenuScreen->search(MULTI_CHAR('f_t00'))->hide(); + } else { + textBox = (J2DTextBox*)mpMenuScreen->search(MULTI_CHAR('f_t00')); + mpMenuScreen->search(MULTI_CHAR('t_t00'))->hide(); + } +#elif VERSION == VERSION_GCN_JPN J2DTextBox* textBox = (J2DTextBox*)mpMenuScreen->search(MULTI_CHAR('t_t00')); mpMenuScreen->search(MULTI_CHAR('f_t00'))->hide(); #else @@ -551,7 +582,15 @@ void dMenu_Skill_c::screenSetLetter() { mpLetterScreen = JKR_NEW J2DScreen(); mpLetterScreen->setPriority("zelda_ougi_info.blo", 0x20000, mpArchive); dPaneClass_showNullPane(mpLetterScreen); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + mpTextPane = JKR_NEW CPaneMgr(mpLetterScreen, MULTI_CHAR('mg_3line'), 0, NULL); + mpLetterScreen->search(MULTI_CHAR('n_e4line'))->hide(); + } else { + mpTextPane = JKR_NEW CPaneMgr(mpLetterScreen, MULTI_CHAR('mg_e4lin'), 0, NULL); + mpLetterScreen->search(MULTI_CHAR('n_3line'))->hide(); + } +#elif VERSION == VERSION_GCN_JPN mpTextPane = JKR_NEW CPaneMgr(mpLetterScreen, MULTI_CHAR('mg_3line'), 0, NULL); mpLetterScreen->search(MULTI_CHAR('n_e4line'))->hide(); #else @@ -564,7 +603,15 @@ void dMenu_Skill_c::screenSetLetter() { J2DTextBox* paneString = (J2DTextBox*)mpTextPane->getPanePtr(); paneString->setString(0x200, ""); for (int i = 0; i < 4; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + mpNameString[i] = (J2DTextBox*)mpLetterScreen->search(name_tag[i]); + mpLetterScreen->search(fame_tag[i])->hide(); + } else { + mpNameString[i] = (J2DTextBox*)mpLetterScreen->search(fame_tag[i]); + mpLetterScreen->search(name_tag[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN mpNameString[i] = (J2DTextBox*)mpLetterScreen->search(name_tag[i]); mpLetterScreen->search(fame_tag[i])->hide(); #else diff --git a/src/d/d_meter2_draw.cpp b/src/d/d_meter2_draw.cpp index 7ce7bb29d4..f4e96c6fbe 100644 --- a/src/d/d_meter2_draw.cpp +++ b/src/d/d_meter2_draw.cpp @@ -23,6 +23,8 @@ #include "dusk/frame_interpolation.h" #include +#include "dusk/version.hpp" + #if TARGET_PC #include "dusk/settings.h" #include "dusk/ui/icon_provider.hpp" @@ -59,6 +61,14 @@ void dAnchorHudScale(CPaneMgr* i_pane, HudCorner i_corner, f32* io_x, f32* io_y, #endif dMeter2Draw_c::dMeter2Draw_c(JKRExpHeap* mp_heap) { +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + g_drawHIO.mButtonATextSpacing = -2.0f; + } else { + g_drawHIO.mButtonATextSpacing = 1.0f; + } +#endif + OS_REPORT("enter dMeter2Draw_c::dMeter2Draw_c(JKRExpHeap *mp_heap)\n"); heap = mp_heap; @@ -161,7 +171,8 @@ dMeter2Draw_c::dMeter2Draw_c(JKRExpHeap* mp_heap) { } J2DTextBox::TFontSize font_size; -#if VERSION != VERSION_GCN_JPN +#if TARGET_PC || VERSION != VERSION_GCN_JPN + IF_DUSK_BLOCK(!dusk::version::isRegionJpn()) font_size.mSizeX = 17.0f; font_size.mSizeY = 20.0f; for (int i = 0; i < 5; i++) { @@ -171,6 +182,7 @@ dMeter2Draw_c::dMeter2Draw_c(JKRExpHeap* mp_heap) { static_cast(mpXYText[i][1]->getPanePtr())->setFontSize(font_size); static_cast(mpXYText[i][2]->getPanePtr())->setFontSize(font_size); } + IF_DUSK_BLOCK_END #endif init(); diff --git a/src/d/d_meter2_info.cpp b/src/d/d_meter2_info.cpp index 6309e83a86..4e55a330f9 100644 --- a/src/d/d_meter2_info.cpp +++ b/src/d/d_meter2_info.cpp @@ -15,6 +15,7 @@ #include +#include "dusk/version.hpp" #include "helpers/string.hpp" enum ITEMICON_RES_FILE_ID { @@ -534,13 +535,18 @@ f32 dMeter2Info_c::getStringLength(J2DTextBox* i_textbox, char* i_string) { str_width = 0.0f; } else { int c = (u8)*string; -#if VERSION == VERSION_GCN_JPN - bool unkFlag1 = false; - if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xfc)) { - unkFlag1 = true; - } - if (unkFlag1) { - c = (c << 8) | (u8)*++string; +#if TARGET_PC || VERSION == VERSION_GCN_JPN + #if TARGET_PC + if (dusk::version::isRegionJpn()) + #endif + { + bool unkFlag1 = false; + if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xfc)) { + unkFlag1 = true; + } + if (unkFlag1) { + c = (c << 8) | (u8)*++string; + } } #endif str_width += charSpace + (fontSize.mSizeX * ((f32)font->getWidth(c) / (f32)font->getCellWidth())); @@ -566,13 +572,18 @@ f32 dMeter2Info_c::getStringLength(JUTFont* i_font, f32 param_2, f32 param_3, ch str_width = 0.0f; } else { int c = (u8)*string; -#if VERSION == VERSION_GCN_JPN - bool unkFlag1 = false; - if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xfc)) { - unkFlag1 = true; - } - if (unkFlag1) { - c = (c << 8) | (u8)*++string; +#if TARGET_PC || VERSION == VERSION_GCN_JPN + #if TARGET_PC + if (dusk::version::isRegionJpn()) + #endif + { + bool unkFlag1 = false; + if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xfc)) { + unkFlag1 = true; + } + if (unkFlag1) { + c = (c << 8) | (u8)*++string; + } } #endif str_width += param_3 + param_2 * ((f32)i_font->getWidth(c) / (f32)i_font->getCellWidth()); diff --git a/src/d/d_meter_button.cpp b/src/d/d_meter_button.cpp index 0e3354e76e..573147f888 100644 --- a/src/d/d_meter_button.cpp +++ b/src/d/d_meter_button.cpp @@ -19,11 +19,15 @@ #include "dusk/frame_interpolation.h" #include +#include "dusk/version.hpp" + #if TARGET_PC #include "helpers/string.hpp" #endif -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC +#define STR_BUF_LEN 528 +#elif VERSION == VERSION_GCN_JPN #define STR_BUF_LEN 528 #else #define STR_BUF_LEN 512 @@ -261,7 +265,15 @@ void dMeterButton_c::draw() { SAFE_STRCPY(tmp_buf, static_cast(mpTm_c[0]->getPanePtr())->getStringPtr()); mpTextScreen->draw(0.0f, 0.0f, graf_ctx); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + mpString_c->getString(mMsgID, static_cast(mpTm_c[0]->getPanePtr()), NULL, NULL, + NULL, 12); + } else { + mpString_c->getString(mMsgID, static_cast(mpTm_c[0]->getPanePtr()), NULL, NULL, + NULL, 8); + } +#elif VERSION == VERSION_GCN_JPN mpString_c->getString(mMsgID, static_cast(mpTm_c[0]->getPanePtr()), NULL, NULL, NULL, 12); #else @@ -1195,7 +1207,15 @@ void dMeterButton_c::screenInitButton() { field_0x4d9 = 0xFF; for (int i = 0; i < 10; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + mpTextBox[i] = (J2DTextBox*)mpButtonScreen->search(text_tag[i]); + mpButtonScreen->search(ftext_tag[i])->hide(); + } else { + mpTextBox[i] = (J2DTextBox*)mpButtonScreen->search(ftext_tag[i]); + mpButtonScreen->search(text_tag[i])->hide(); + } +#elif VERSION == VERSION_GCN_JPN mpTextBox[i] = (J2DTextBox*)mpButtonScreen->search(text_tag[i]); mpButtonScreen->search(ftext_tag[i])->hide(); #else @@ -1468,7 +1488,50 @@ void dMeterButton_c::screenInitText() { mpTmRoot_c = JKR_NEW CPaneMgr(mpTextScreen, MULTI_CHAR('mg_null'), 0, NULL); JUT_ASSERT(2499, mpTmRoot_c != NULL); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + if (dComIfGs_getOptRuby() == 0) { + mpTm_c[0] = JKR_NEW CPaneMgr(mpTextScreen, MULTI_CHAR('mg_3flin'), 0, NULL); + + mpTm_c[1] = JKR_NEW CPaneMgr(mpTextScreen, MULTI_CHAR('t3f_s'), 0, NULL); + + field_0x0ec[0] = JKR_NEW CPaneMgr(mpTextScreen, MULTI_CHAR('mg_3f'), 0, NULL); + + field_0x0ec[1] = JKR_NEW CPaneMgr(mpTextScreen, MULTI_CHAR('mg_3f_s'), 0, NULL); + + mpTextScreen->search(MULTI_CHAR('n_3line'))->hide(); + mpTextScreen->search(MULTI_CHAR('n_3fline'))->show(); + mpTextScreen->search(MULTI_CHAR('n_e4line'))->hide(); + } else { + mpTm_c[0] = JKR_NEW CPaneMgr(mpTextScreen, MULTI_CHAR('mg_3line'), 0, NULL); + + mpTm_c[1] = JKR_NEW CPaneMgr(mpTextScreen, 't3_s', 0, NULL); + + field_0x0ec[0] = NULL; + field_0x0ec[1] = NULL; + OS_REPORT("[%s] %d\n", __FILE__, __LINE__); + + mpTextScreen->search(MULTI_CHAR('n_3line'))->show(); + mpTextScreen->search(MULTI_CHAR('n_3fline'))->hide(); + mpTextScreen->search(MULTI_CHAR('n_e4line'))->hide(); + } + } else { + mpTm_c[0] = JKR_NEW CPaneMgr(mpTextScreen, MULTI_CHAR('mg_e4lin'), 0, NULL); + JUT_ASSERT(2504, mpTm_c[0] != NULL); + + mpTm_c[1] = JKR_NEW CPaneMgr(mpTextScreen, 't4_s', 0, NULL); + JUT_ASSERT(2507, mpTm_c[1] != NULL); + + field_0x0ec[0] = NULL; + field_0x0ec[1] = NULL; + + OS_REPORT("[%s] %d\n", __FILE__, 2512); + + mpTextScreen->search(MULTI_CHAR('n_3line'))->hide(); + mpTextScreen->search(MULTI_CHAR('n_3fline'))->hide(); + mpTextScreen->search(MULTI_CHAR('n_e4line'))->show(); + } +#elif VERSION == VERSION_GCN_JPN if (dComIfGs_getOptRuby() == 0) { mpTm_c[0] = JKR_NEW CPaneMgr(mpTextScreen, MULTI_CHAR('mg_3flin'), 0, NULL); @@ -1516,19 +1579,11 @@ void dMeterButton_c::screenInitText() { f32 line_space = static_cast(mpTm_c[0]->getPanePtr())->getLineSpace(); for (int i = 0; i < 2; i++) { static_cast(mpTm_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont()); -#if VERSION == VERSION_GCN_JPN - static_cast(mpTm_c[i]->getPanePtr())->setString(0x210, ""); -#else - static_cast(mpTm_c[i]->getPanePtr())->setString(0x200, ""); -#endif + static_cast(mpTm_c[i]->getPanePtr())->setString(STR_BUF_LEN, ""); if (field_0x0ec[i] != NULL) { static_cast(field_0x0ec[i]->getPanePtr())->setFont(mDoExt_getMesgFont()); -#if VERSION == VERSION_GCN_JPN - static_cast(field_0x0ec[i]->getPanePtr())->setString(0x210, ""); -#else - static_cast(field_0x0ec[i]->getPanePtr())->setString(0x200, ""); -#endif + static_cast(field_0x0ec[i]->getPanePtr())->setString(STR_BUF_LEN, ""); static_cast(field_0x0ec[i]->getPanePtr())->setLineSpace(line_space); } } diff --git a/src/d/d_msg_class.cpp b/src/d/d_msg_class.cpp index 8dc2a82c01..5dbc00a1d2 100644 --- a/src/d/d_msg_class.cpp +++ b/src/d/d_msg_class.cpp @@ -1,23 +1,33 @@ #include "d/dolzel.h" // IWYU pragma: keep -#include "d/d_msg_class.h" #include #include -#include "d/d_meter2_info.h" -#include "d/d_msg_object.h" -#include "d/d_msg_unit.h" #include "JSystem/J2DGraph/J2DTextBox.h" -#include "d/d_msg_out_font.h" -#include "m_Do/m_Do_graphic.h" -#include "d/d_lib.h" #include "JSystem/JUtility/JUTFont.h" +#include "d/d_lib.h" +#include "d/d_meter2_info.h" +#include "d/d_msg_class.h" +#include "d/d_msg_object.h" +#include "d/d_msg_out_font.h" +#include "d/d_msg_unit.h" +#include "dusk/version.hpp" +#include "m_Do/m_Do_graphic.h" #if TARGET_PC #include "dusk/menu_pointer.h" #include "dusk/scope_guard.hpp" #endif -#if REGION_JPN +#if TARGET_PC +#define CHAR_CODE_MALE_ICON (dusk::version::isRegionJpn() ? 0x8189 : 0xB2) +#define CHAR_CODE_FEMALE_ICON (dusk::version::isRegionJpn() ? 0x818A : 0xB3) +#define CHAR_CODE_STAR_ICON (dusk::version::isRegionJpn() ? 0x819A : 0xB1) +#define CHAR_CODE_REFMARK (dusk::version::isRegionJpn() ? 0x81A6 : 0x89) +#define CHAR_CODE_THIN_LEFT_ARROW (dusk::version::isRegionJpn() ? 0x81A9 : 0xB9) +#define CHAR_CODE_THIN_RIGHT_ARROW (dusk::version::isRegionJpn() ? 0x81A8 : 0xBC) +#define CHAR_CODE_THIN_UP_ARROW (dusk::version::isRegionJpn() ? 0x81AA : 0xBD) +#define CHAR_CODE_THIN_DOWN_ARROW (dusk::version::isRegionJpn() ? 0x81AB : 0xBE) +#elif REGION_JPN #define CHAR_CODE_MALE_ICON 0x8189 #define CHAR_CODE_FEMALE_ICON 0x818A #define CHAR_CODE_STAR_ICON 0x819A @@ -431,8 +441,33 @@ void jmessage_tReference::calcDistance() { u8 jmessage_tReference::getLineMax() { int line_max; - -#if REGION_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + if (isKanban()) { + line_max = 6; + } else if (isBook()) { + line_max = 7; + } else if (isStaffRoll()) { + line_max = 10; + } else if (isSaveSeq()) { + line_max = 5; + } else { + line_max = 3; + } + } else { + if (isKanban()) { + line_max = 7; + } else if (isBook()) { + line_max = 9; + } else if (isStaffRoll()) { + line_max = 10; + } else if (isSaveSeq()) { + line_max = 6; + } else { + line_max = 4; + } + } +#elif REGION_JPN if (isKanban()) { line_max = 6; } else if (isBook()) { @@ -895,7 +930,7 @@ void jmessage_tMeasureProcessor::do_begin(void const* pEntry, char const* pszTex mSeSpeaker = ((JMSMesgEntry_c*)pEntry)->se_speaker; mSeMood = ((JMSMesgEntry_c*)pEntry)->se_mood; - for (int i = 0; i < D_MSG_CLASS_PAGE_CNT_MAX; i++) { + for (int i = 0; i < DUSK_IF_ELSE((dusk::version::isRegionJpn() ? 30 : D_MSG_CLASS_PAGE_CNT_MAX), D_MSG_CLASS_PAGE_CNT_MAX); i++) { pReference->setLineLength(i, 0.0f, 0.0f); pReference->setPageLine(i, 0); pReference->setPageLineMax(i, 0); @@ -912,7 +947,11 @@ void jmessage_tMeasureProcessor::do_begin(void const* pEntry, char const* pszTex pReference->setLineArrange(i, 1); } -#if !REGION_JPN +#if TARGET_PC + if (!dusk::version::isRegionJpn() && ((JMSMesgEntry_c*)pEntry)->unk_0xd == 0) { + pReference->setLineArrange(i, 1); + } +#elif !REGION_JPN if (((JMSMesgEntry_c*)pEntry)->unk_0xd == 0) { pReference->setLineArrange(i, 1); } @@ -1591,8 +1630,8 @@ void jmessage_tMeasureProcessor::do_scale(f32 i_scale) { mPageLineMax--; JUT_ASSERT(0x930, mPageLineMax > 0); -#if REGION_JPN - if (field_0x3e == 0) { +#if TARGET_PC || REGION_JPN + if (IF_DUSK(dusk::version::isRegionJpn() &&) field_0x3e == 0) { pReference->setPageType(field_0x40, 2); } #else @@ -1762,7 +1801,10 @@ void jmessage_tMeasureProcessor::do_pageType(int param_0) { void jmessage_tMeasureProcessor::do_name1() { const char* name = dComIfGs_getPlayerName(); -#if REGION_JPN +#if TARGET_PC || REGION_JPN + if (!dusk::version::isRegionJpn()) + return; + int c = (((char)name[0] & 0xFF) << 8) | ((char)name[1] & 0xFF); // if first character is hiragana or katakana if ((c >= 0x829F && c <= 0x82F1) || (c >= 0x8340 && c <= 0x8396)) { @@ -2041,7 +2083,7 @@ bool jmessage_tSequenceProcessor::do_isReady() { field_0xae = 1; field_0xa4 = 0; pReference->onBatchFlag(); - pReference->setCharCnt(D_MSG_CLASS_CHAR_CNT_MAX); + pReference->setCharCnt(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? D_MSG_CLASS_CHAR_CNT_MAX : 0x200, D_MSG_CLASS_CHAR_CNT_MAX)); field_0xa4 = field_0xa8; return true; } @@ -2061,7 +2103,7 @@ bool jmessage_tSequenceProcessor::do_isReady() { field_0xae = 1; field_0xa4 = 0; pReference->onBatchFlag(); - pReference->setCharCnt(D_MSG_CLASS_CHAR_CNT_MAX); + pReference->setCharCnt(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? D_MSG_CLASS_CHAR_CNT_MAX : 0x200, D_MSG_CLASS_CHAR_CNT_MAX)); return true; } @@ -2084,7 +2126,7 @@ bool jmessage_tSequenceProcessor::do_isReady() { if (mDoCPd_c::getTrigA(PAD_1) || field_0xb2 != 0 IF_DUSK(|| (dusk::getSettings().game.instantText && mDoCPd_c::getHoldB(0)))) { field_0xa4 = 0; pReference->onBatchFlag(); - pReference->setCharCnt(D_MSG_CLASS_CHAR_CNT_MAX); + pReference->setCharCnt(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? D_MSG_CLASS_CHAR_CNT_MAX : 0x200, D_MSG_CLASS_CHAR_CNT_MAX)); } break; case 1: @@ -2093,7 +2135,7 @@ bool jmessage_tSequenceProcessor::do_isReady() { case 9: field_0xa4 = 0; pReference->onBatchFlag(); - pReference->setCharCnt(D_MSG_CLASS_CHAR_CNT_MAX); + pReference->setCharCnt(DUSK_IF_ELSE(dusk::version::isRegionJpn() ? D_MSG_CLASS_CHAR_CNT_MAX : 0x200, D_MSG_CLASS_CHAR_CNT_MAX)); break; case 2: if (field_0xb2 != 0) { @@ -2108,8 +2150,8 @@ bool jmessage_tSequenceProcessor::do_isReady() { } field_0xa6++; -#if REGION_JPN - if (field_0xa6 >= 1) { +#if TARGET_PC || REGION_JPN + if (IF_DUSK(dusk::version::isRegionJpn() &&) field_0xa6 >= 1) { #else if (field_0xa6 >= 2) { #endif @@ -2533,7 +2575,10 @@ bool jmessage_tSequenceProcessor::do_jump_isReady() { void jmessage_tSequenceProcessor::do_name1() { const char* name = dComIfGs_getPlayerName(); -#if REGION_JPN +#if TARGET_PC || REGION_JPN + if (!dusk::version::isRegionJpn()) + return; + int c = (((char)name[0] & 0xFF) << 8) | ((char)name[1] & 0xFF); // if first character is hiragana or katakana if ((c >= 0x829F && c <= 0x82F1) || (c >= 0x8340 && c <= 0x8396)) { @@ -3357,9 +3402,9 @@ void jmessage_tRenderingProcessor::do_heightcenter() { } break; } -#if REGION_JPN +#if TARGET_PC || REGION_JPN case 2: - if ((s8)pReference->getLineMax() == 3) { + if (IF_DUSK(dusk::version::isRegionJpn() &&) (s8)pReference->getLineMax() == 3) { int nowPageLine = pReference->getNowPageLine(); field_0x138 = pReference->getLineSpace() * (0.5f * (pReference->getLineMax() - (s16)nowPageLine)); var_f31 += field_0x138; @@ -3368,13 +3413,24 @@ void jmessage_tRenderingProcessor::do_heightcenter() { if (field_0x142 == 0) { field_0x138 = pReference->getLineSpace(); var_f31 += field_0x138; - } else if (field_0x142 == 1) { + } +#if TARGET_PC + else if (!dusk::version::isRegionJpn() || (dusk::version::isRegionJpn() && field_0x142 == 1)) +#else + else if (field_0x142 == 1) +#endif + { field_0x138 = 0.5f * pReference->getLineSpace(); var_f31 += field_0x138; } break; case 3: { - if (field_0x142 == 1) { +#if TARGET_PC + if (!dusk::version::isRegionJpn() || (dusk::version::isRegionJpn() && field_0x142 == 1)) +#else + if (field_0x142 == 1) +#endif + { int nowPageLine = pReference->getNowPageLine(); field_0x138 = pReference->getLineSpace() * (0.5f * (pReference->getLineMax() - (s16)nowPageLine)); var_f31 += field_0x138; @@ -3383,8 +3439,25 @@ void jmessage_tRenderingProcessor::do_heightcenter() { break; } case 4: { + #if TARGET_PC + if (!dusk::version::isRegionJpn() && field_0x142 == 0) { + int nowPageLine = pReference->getNowPageLine(); + field_0x138 = pReference->getLineSpace() * (0.5f * (pReference->getLineMax() - (s16)nowPageLine)); + var_f31 += field_0x138; + } + #endif + if (field_0x142 == 1) { + #if TARGET_PC + if (!dusk::version::isRegionJpn()) { + field_0x138 = 0.5f * pReference->getLineSpace(); + var_f31 += field_0x138; + } else { + var_f31 += 0.5f * pReference->getLineSpace(); + } + #else var_f31 += 0.5f * pReference->getLineSpace(); + #endif } f32 sp8 = pReference->getLineScale(field_0x142) / 100.0f; @@ -3662,7 +3735,7 @@ void jmessage_tRenderingProcessor::do_strcat(char* i_str, bool param_2, bool par } else { JUT_WARN(5316, "%s", "TextBox Alloc Byte Over!!"); } - } else if (field_0x11c < D_MSG_CLASS_CHAR_CNT_MAX) { + } else if (field_0x11c < DUSK_IF_ELSE((dusk::version::isRegionJpn() ? D_MSG_CLASS_CHAR_CNT_MAX : 0x200), D_MSG_CLASS_CHAR_CNT_MAX)) { if (param_2) { field_0x146++; if (pReference->getBatchColorFlag() != 0) { @@ -3697,7 +3770,7 @@ void jmessage_tRenderingProcessor::do_strcat(char* i_str, bool param_2, bool par int length = 0; length = strlen(buffer); - if (field_0x11c + length < D_MSG_CLASS_CHAR_CNT_MAX) { + if (field_0x11c + length < DUSK_IF_ELSE((dusk::version::isRegionJpn() ? D_MSG_CLASS_CHAR_CNT_MAX : 0x200), D_MSG_CLASS_CHAR_CNT_MAX)) { field_0x148 = strlen(pReference->getTextPtr()); field_0x14a = strlen(pReference->getTextSPtr()); @@ -3792,7 +3865,10 @@ void jmessage_tRenderingProcessor::do_rubystrcat(char* i_src, TEXT_SPAN i_dst, f void jmessage_tRenderingProcessor::do_name1() { const char* name = dComIfGs_getPlayerName(); -#if REGION_JPN +#if TARGET_PC || REGION_JPN + if (!dusk::version::isRegionJpn()) + return; + int c = (((char)name[0] & 0xFF) << 8) | ((char)name[1] & 0xFF); // if first character is hiragana or katakana if ((c >= 0x829F && c <= 0x82F1) || (c >= 0x8340 && c <= 0x8396)) { @@ -3889,7 +3965,7 @@ void jmessage_string_tReference::init(J2DTextBox* panePtr, J2DTextBox* runyPaneP mRubyPanePtr = runyPanePtr; mOutFontPtr = outFontPtr; mLineCount = 0; - mLineMax = D_MSG_CLASS_LINE_MAX; + mLineMax = DUSK_IF_ELSE(dusk::version::isRegionJpn() ? 9 : D_MSG_CLASS_LINE_MAX, D_MSG_CLASS_LINE_MAX); mNowPage = 0; mFlags = flags; if (font != NULL) { diff --git a/src/d/d_msg_object.cpp b/src/d/d_msg_object.cpp index 712ee61584..fc6b03d6df 100644 --- a/src/d/d_msg_object.cpp +++ b/src/d/d_msg_object.cpp @@ -314,6 +314,13 @@ dMsgObject_HIO_c::dMsgObject_HIO_c() { } int dMsgObject_c::_create(msg_class* param_1) { +#if TARGET_PC + if (dusk::version::isRegionJpn()) + g_MsgObject_HIO_c.mBoxTalkScaleX = 1.1f; + else + g_MsgObject_HIO_c.mBoxTalkScaleX = 1.2f; +#endif + field_0x124 = NULL; field_0x100 = param_1; field_0x16c = -1; diff --git a/src/d/d_msg_out_font.cpp b/src/d/d_msg_out_font.cpp index efc655d529..79bbad5ebb 100644 --- a/src/d/d_msg_out_font.cpp +++ b/src/d/d_msg_out_font.cpp @@ -1,11 +1,12 @@ #include "d/dolzel.h" // IWYU pragma: keep -#include "d/d_msg_out_font.h" #include "JSystem/J2DGraph/J2DTextBox.h" #include "JSystem/JUtility/JUTTexture.h" #include "d/d_meter2_info.h" #include "d/d_msg_object.h" +#include "d/d_msg_out_font.h" #include "dusk/frame_interpolation.h" +#include "dusk/version.hpp" #include "f_op/f_op_msg_mng.h" COutFontSet_c::COutFontSet_c() { @@ -289,8 +290,10 @@ void COutFont_c::initialize() { void COutFont_c::drawFont(J2DTextBox* i_textbox, u8 i_type, f32 i_posX, f32 i_posY, f32 i_sizeX, f32 i_sizeY, u32 i_color, u8 i_alpha) { -#if VERSION != VERSION_GCN_JPN +#if TARGET_PC || VERSION != VERSION_GCN_JPN + IF_DUSK_BLOCK(!dusk::version::isRegionJpn()) i_posY += 1.0f; + IF_DUSK_BLOCK_END; #endif for (int i = 0; i < 35; i++) { if (mpOfs[i]->getType() == 0x47) { @@ -380,7 +383,15 @@ void COutFont_c::draw(J2DTextBox* i_textbox, f32 param_1, f32 param_2, f32 param break; case 5: case 6: { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + posY -= 2.0f; + sizeY -= 2.0f; + } else { + posY += 1.0f; + sizeY -= 3.0f; + } +#elif VERSION == VERSION_GCN_JPN posY -= 2.0f; sizeY -= 2.0f; #else diff --git a/src/d/d_msg_scrn_3select.cpp b/src/d/d_msg_scrn_3select.cpp index 2f19f23c83..b3a41a2988 100644 --- a/src/d/d_msg_scrn_3select.cpp +++ b/src/d/d_msg_scrn_3select.cpp @@ -5,16 +5,17 @@ #include "d/dolzel.h" // IWYU pragma: keep -#include "d/d_msg_scrn_3select.h" +#include #include "JSystem/J2DGraph/J2DAnmLoader.h" #include "JSystem/J2DGraph/J2DGrafContext.h" #include "JSystem/J2DGraph/J2DScreen.h" #include "JSystem/J2DGraph/J2DTextBox.h" -#include #include "d/d_com_inf_game.h" -#include "d/d_select_cursor.h" #include "d/d_msg_object.h" +#include "d/d_msg_scrn_3select.h" #include "d/d_pane_class.h" +#include "d/d_select_cursor.h" +#include "dusk/version.hpp" #if TARGET_PC #include "dusk/menu_pointer.h" @@ -118,7 +119,97 @@ dMsgScrn3Select_c::dMsgScrn3Select_c() { mCursorPos[i] = mpCursor_c[i]->getGlobalVtxCenter(true, 0); } -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + if (dComIfGs_getOptRuby() == 0) { + mpTmSel_c[0] = JKR_NEW CPaneMgr(mpScreen, 'a_tf', 0, NULL); + + mpTmSel_c[1] = JKR_NEW CPaneMgr(mpScreen, 'b_tf', 0, NULL); + + mpTmSel_c[2] = JKR_NEW CPaneMgr(mpScreen, 'c_tf', 0, NULL); + + mpTmrSel_c[0] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('a_tf_f'), 0, NULL); + + mpTmrSel_c[1] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('b_tf_f'), 0, NULL); + + mpTmrSel_c[2] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('c_tf_f'), 0, NULL); + + for (int i = 0; i < 3; i++) { + ((J2DTextBox*)(mpTmSel_c[i]->getPanePtr()))->setString(64, ""); + ((J2DTextBox*)(mpTmSel_c[i]->getPanePtr()))->setFont(mDoExt_getMesgFont()); + + ((J2DTextBox*)(mpTmrSel_c[i]->getPanePtr()))->setString(64, ""); + ((J2DTextBox*)(mpTmrSel_c[i]->getPanePtr()))->setFont(mDoExt_getMesgFont()); + } + + mpScreen->search(MULTI_CHAR('a_t_e'))->hide(); + mpScreen->search(MULTI_CHAR('b_t_e'))->hide(); + mpScreen->search(MULTI_CHAR('c_t_e'))->hide(); + mpScreen->search('a_tf')->show(); + mpScreen->search('b_tf')->show(); + mpScreen->search('c_tf')->show(); + mpScreen->search(MULTI_CHAR('a_tf_f'))->show(); + mpScreen->search(MULTI_CHAR('b_tf_f'))->show(); + mpScreen->search(MULTI_CHAR('c_tf_f'))->show(); + mpScreen->search('a_t')->hide(); + mpScreen->search('b_t')->hide(); + mpScreen->search('c_t')->hide(); + } else { + mpTmSel_c[0] = JKR_NEW CPaneMgr(mpScreen, 'a_t', 0, NULL); + + mpTmSel_c[1] = JKR_NEW CPaneMgr(mpScreen, 'b_t', 0, NULL); + + mpTmSel_c[2] = JKR_NEW CPaneMgr(mpScreen, 'c_t', 0, NULL); + + for (int i = 0; i < 3; i++) { + ((J2DTextBox*)(mpTmSel_c[i]->getPanePtr()))->setString(64, ""); + ((J2DTextBox*)(mpTmSel_c[i]->getPanePtr()))->setFont(mDoExt_getMesgFont()); + mpTmrSel_c[i] = NULL; + } + + mpScreen->search(MULTI_CHAR('a_t_e'))->hide(); + mpScreen->search(MULTI_CHAR('b_t_e'))->hide(); + mpScreen->search(MULTI_CHAR('c_t_e'))->hide(); + mpScreen->search('a_tf')->hide(); + mpScreen->search('b_tf')->hide(); + mpScreen->search('c_tf')->hide(); + mpScreen->search(MULTI_CHAR('a_tf_f'))->hide(); + mpScreen->search(MULTI_CHAR('b_tf_f'))->hide(); + mpScreen->search(MULTI_CHAR('c_tf_f'))->hide(); + mpScreen->search('a_t')->show(); + mpScreen->search('b_t')->show(); + mpScreen->search('c_t')->show(); + } + } else { + mpTmSel_c[0] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('a_t_e'), 0, NULL); + JUT_ASSERT(0, mpTmSel_c[0] != NULL); + + mpTmSel_c[1] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('b_t_e'), 0, NULL); + JUT_ASSERT(0, mpTmSel_c[1] != NULL); + + mpTmSel_c[2] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('c_t_e'), 0, NULL); + JUT_ASSERT(0, mpTmSel_c[2] != NULL); + + for (int i = 0; i < 3; i++) { + ((J2DTextBox*)(mpTmSel_c[i]->getPanePtr()))->setString(64, ""); + ((J2DTextBox*)(mpTmSel_c[i]->getPanePtr()))->setFont(mDoExt_getMesgFont()); + mpTmrSel_c[i] = NULL; + } + + mpScreen->search(MULTI_CHAR('a_t_e'))->show(); + mpScreen->search(MULTI_CHAR('b_t_e'))->show(); + mpScreen->search(MULTI_CHAR('c_t_e'))->show(); + mpScreen->search('a_tf')->hide(); + mpScreen->search('b_tf')->hide(); + mpScreen->search('c_tf')->hide(); + mpScreen->search(MULTI_CHAR('a_tf_f'))->hide(); + mpScreen->search(MULTI_CHAR('b_tf_f'))->hide(); + mpScreen->search(MULTI_CHAR('c_tf_f'))->hide(); + mpScreen->search('a_t')->hide(); + mpScreen->search('b_t')->hide(); + mpScreen->search('c_t')->hide(); + } +#elif VERSION == VERSION_GCN_JPN if (dComIfGs_getOptRuby() == 0) { mpTmSel_c[0] = JKR_NEW CPaneMgr(mpScreen, 'a_tf', 0, NULL); @@ -966,7 +1057,18 @@ void dMsgScrn3Select_c::selectTrans() { f32 sp68[3]; for (int i = 0; i < 3; i++) { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + if (dComIfGs_getOptRuby() == 0 && (field_0x112 & (u8)(1 << i)) != 0) { + sp68[i] = 0.0f; + } else { + f32 temp = mpTmSel_c[i]->getInitPosY(); + sp68[i] = mpScreen->search(tag_n[i])->getBounds().i.y - temp; + } + } else { + sp68[i] = 0.0f; + } +#elif VERSION == VERSION_GCN_JPN if (dComIfGs_getOptRuby() == 0 && (field_0x112 & (u8)(1 << i)) != 0) { sp68[i] = 0.0f; } else { diff --git a/src/d/d_msg_scrn_boss.cpp b/src/d/d_msg_scrn_boss.cpp index 54938ceb72..b747887316 100644 --- a/src/d/d_msg_scrn_boss.cpp +++ b/src/d/d_msg_scrn_boss.cpp @@ -1,10 +1,11 @@ #include "d/dolzel.h" // IWYU pragma: keep -#include "d/d_msg_scrn_boss.h" #include "JSystem/J2DGraph/J2DGrafContext.h" #include "JSystem/J2DGraph/J2DScreen.h" #include "d/d_msg_object.h" +#include "d/d_msg_scrn_boss.h" #include "d/d_pane_class.h" +#include "dusk/version.hpp" #if TARGET_PC #include "dusk/settings.h" @@ -37,8 +38,10 @@ dMsgScrnBoss_c::dMsgScrnBoss_c() { for (int i = 0; i < 7; i++) { mpTm_c[i] = JKR_NEW CPaneMgr(mpScreen, t_tag[i], 0, NULL); ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(mDoExt_getRubyFont()); -#if VERSION != VERSION_GCN_JPN +#if TARGET_PC || VERSION != VERSION_GCN_JPN + IF_DUSK_BLOCK(!dusk::version::isRegionJpn()) ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setCharSpace(1.0f); + IF_DUSK_BLOCK_END #endif ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x100, ""); } diff --git a/src/d/d_msg_scrn_explain.cpp b/src/d/d_msg_scrn_explain.cpp index 29a88590ee..9460ce8921 100644 --- a/src/d/d_msg_scrn_explain.cpp +++ b/src/d/d_msg_scrn_explain.cpp @@ -14,7 +14,9 @@ #include #include -#if VERSION == VERSION_GCN_JPN +#include "dusk/version.hpp" + +#if TARGET_PC || VERSION == VERSION_GCN_JPN #define STR_BUF_LEN 528 #else #define STR_BUF_LEN 512 @@ -95,7 +97,13 @@ dMsgScrnExplain_c::dMsgScrnExplain_c(STControl* i_stick, u8 param_1, bool i_isUs mpTxScreen->search(MULTI_CHAR('n_3fline'))->hide(); mpTxScreen->search(MULTI_CHAR('n_e4line'))->hide(); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + field_0x50 = 0.0f; + } else { + field_0x50 = -10.0f; + } +#elif VERSION == VERSION_GCN_JPN field_0x50 = 0.0f; #else field_0x50 = -10.0f; @@ -109,7 +117,48 @@ dMsgScrnExplain_c::dMsgScrnExplain_c(STControl* i_stick, u8 param_1, bool i_isUs mpScreen->search(MULTI_CHAR('n_all'))->scale(g_MsgObject_HIO_c.mBoxTalkScaleX, g_MsgObject_HIO_c.mBoxTalkScaleY); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + field_0x50 = 0.0f; + + if (dComIfGs_getOptRuby() == 0) { + mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3flin'), 0, NULL); + mpTm_c[1] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3f_s'), 0, NULL); + + mpTmr_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3f'), 0, NULL); + mpTmr_c[1] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3f_s'), 0, NULL); + + mpTxScreen->search(MULTI_CHAR('n_3line'))->hide(); + mpTxScreen->search(MULTI_CHAR('n_3fline'))->show(); + mpTxScreen->search(MULTI_CHAR('n_e4line'))->hide(); + } else { + mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3line'), 0, NULL); + mpTm_c[1] = JKR_NEW CPaneMgr(mpTxScreen, 't3_s', 0, NULL); + + mpTmr_c[0] = NULL; + mpTmr_c[1] = NULL; + + mpTxScreen->search(MULTI_CHAR('n_3line'))->show(); + mpTxScreen->search(MULTI_CHAR('n_3fline'))->hide(); + mpTxScreen->search(MULTI_CHAR('n_e4line'))->hide(); + } + } else { + field_0x50 = -10.0f; + + mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_e4lin'), 0, NULL); + JUT_ASSERT(162, mpTm_c[0] != NULL); + + mpTm_c[1] = JKR_NEW CPaneMgr(mpTxScreen, 't4_s', 0, NULL); + JUT_ASSERT(165, mpTm_c[1] != NULL); + + mpTmr_c[0] = NULL; + mpTmr_c[1] = NULL; + + mpTxScreen->search(MULTI_CHAR('n_3line'))->hide(); + mpTxScreen->search(MULTI_CHAR('n_3fline'))->hide(); + mpTxScreen->search(MULTI_CHAR('n_e4line'))->show(); + } +#elif VERSION == VERSION_GCN_JPN field_0x50 = 0.0f; if (dComIfGs_getOptRuby() == 0) { @@ -160,20 +209,12 @@ dMsgScrnExplain_c::dMsgScrnExplain_c(STControl* i_stick, u8 param_1, bool i_isUs f32 lineSpace = ((J2DTextBox*)mpTm_c[0]->getPanePtr())->getLineSpace(); for (int i = 0; i < 2; i++) { ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont()); -#if VERSION == VERSION_GCN_JPN - ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x210, ""); -#else - ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x200, ""); -#endif + ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(STR_BUF_LEN, ""); ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setLineSpace(lineSpace); if (mpTmr_c[i] != NULL) { ((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont()); -#if VERSION == VERSION_GCN_JPN - ((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setString(0x210, ""); -#else - ((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setString(0x200, ""); -#endif + ((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setString(STR_BUF_LEN, ""); ((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setLineSpace(lineSpace); } } @@ -320,7 +361,13 @@ void dMsgScrnExplain_c::draw(J2DOrthoGraph* i_graf) { SAFE_STRCPY(string_buf, ((J2DTextBox*)mpTm_c[0]->getPanePtr())->getStringPtr()); mpTxScreen->draw(0.0f, 0.0f, (J2DGrafContext*)i_graf); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + mpString_c->getString(mOpenMsgId, (J2DTextBox*)mpTm_c[0]->getPanePtr(), NULL, NULL, NULL, 12); + } else { + mpString_c->getString(mOpenMsgId, (J2DTextBox*)mpTm_c[0]->getPanePtr(), NULL, NULL, NULL, 8); + } +#elif VERSION == VERSION_GCN_JPN mpString_c->getString(mOpenMsgId, (J2DTextBox*)mpTm_c[0]->getPanePtr(), NULL, NULL, NULL, 12); #else mpString_c->getString(mOpenMsgId, (J2DTextBox*)mpTm_c[0]->getPanePtr(), NULL, NULL, NULL, 8); diff --git a/src/d/d_msg_scrn_howl.cpp b/src/d/d_msg_scrn_howl.cpp index c701ea0b2b..4e5c59546c 100644 --- a/src/d/d_msg_scrn_howl.cpp +++ b/src/d/d_msg_scrn_howl.cpp @@ -4,20 +4,21 @@ #include "d/dolzel.h" // IWYU pragma: keep -#include "d/d_msg_scrn_howl.h" -#include "m_Do/m_Do_controller_pad.h" -#include "m_Do/m_Do_graphic.h" -#include "d/d_msg_object.h" -#include "d/d_pane_class.h" +#include "JSystem/J2DGraph/J2DGrafContext.h" +#include "JSystem/J2DGraph/J2DScreen.h" +#include "JSystem/JUtility/JUTAssert.h" +#include "JSystem/JUtility/JUTTexture.h" +#include "Z2AudioLib/Z2WolfHowlMgr.h" #include "d/actor/d_a_alink.h" #include "d/d_meter2.h" #include "d/d_meter2_draw.h" #include "d/d_meter2_info.h" -#include "JSystem/JUtility/JUTTexture.h" -#include "JSystem/JUtility/JUTAssert.h" -#include "JSystem/J2DGraph/J2DGrafContext.h" -#include "JSystem/J2DGraph/J2DScreen.h" -#include "Z2AudioLib/Z2WolfHowlMgr.h" +#include "d/d_msg_object.h" +#include "d/d_msg_scrn_howl.h" +#include "d/d_pane_class.h" +#include "dusk/version.hpp" +#include "m_Do/m_Do_controller_pad.h" +#include "m_Do/m_Do_graphic.h" #if TARGET_PC #include "dusk/frame_interpolation.h" @@ -89,7 +90,21 @@ dMsgScrnHowl_c::dMsgScrnHowl_c() { JUT_ASSERT(96, mpButtonIcon[1] != NULL); mpButtonText[1] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('gr_txt_n'), 2, NULL); JUT_ASSERT(98, mpButtonText[1] != NULL); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + J2DTextBox* piStack_19c; + J2DTextBox* piStack_1a0; + if (dusk::version::isRegionJpn()) { + piStack_19c = (J2DTextBox*)mpScreen->search(MULTI_CHAR('g_l_info')); + piStack_1a0 = (J2DTextBox*)mpScreen->search(MULTI_CHAR('g_r_info')); + mpScreen->search(MULTI_CHAR('fgr_info'))->hide(); + mpScreen->search(MULTI_CHAR('fgl_info'))->hide(); + } else { + piStack_19c = (J2DTextBox*)mpScreen->search(MULTI_CHAR('fgl_info')); + piStack_1a0 = (J2DTextBox*)mpScreen->search(MULTI_CHAR('fgr_info')); + mpScreen->search(MULTI_CHAR('g_l_info'))->hide(); + mpScreen->search(MULTI_CHAR('g_r_info'))->hide(); + } +#elif VERSION == VERSION_GCN_JPN J2DTextBox* piStack_19c = (J2DTextBox*)mpScreen->search(MULTI_CHAR('g_l_info')); J2DTextBox* piStack_1a0 = (J2DTextBox*)mpScreen->search(MULTI_CHAR('g_r_info')); mpScreen->search(MULTI_CHAR('fgr_info'))->hide(); diff --git a/src/d/d_msg_scrn_item.cpp b/src/d/d_msg_scrn_item.cpp index 26a741e320..ab91739acc 100644 --- a/src/d/d_msg_scrn_item.cpp +++ b/src/d/d_msg_scrn_item.cpp @@ -24,6 +24,8 @@ #include "JSystem/JUtility/JUTTexture.h" #include +#include "dusk/version.hpp" + dMsgScrnItem_c::dMsgScrnItem_c(u8 param_1, u8 param_2, JKRExpHeap* param_3) { if (param_3 != NULL) { field_0x138 = param_3; @@ -198,7 +200,53 @@ dMsgScrnItem_c::dMsgScrnItem_c(u8 param_1, u8 param_2, JKRExpHeap* param_3) { mpPmP_c->scale(g_MsgObject_HIO_c.mBoxItemScaleX, g_MsgObject_HIO_c.mBoxItemScaleY); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + if (dComIfGs_getOptRuby() == 0) { + mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3flin'), 0, NULL); + JUT_ASSERT(407, mpTm_c[0] != NULL); + + mpTm_c[1] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3f_s'), 0, NULL); + JUT_ASSERT(410, mpTm_c[1] != NULL); + + mpTm_c[2] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3f_w'), 0, NULL); + JUT_ASSERT(413, mpTm_c[2] != NULL); + + mpTmr_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3f'), 0, NULL); + JUT_ASSERT(416, mpTmr_c[0] != NULL); + + mpTmr_c[1] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3f_s'), 0, NULL); + JUT_ASSERT(419, mpTmr_c[1] != NULL); + + mpTmr_c[2] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3f_w'), 0, NULL); + JUT_ASSERT(422, mpTmr_c[2] != NULL); + + mpTxScreen->search(MULTI_CHAR('n_3line'))->hide(); + mpTxScreen->search(MULTI_CHAR('n_3fline'))->show(); + mpTxScreen->search(MULTI_CHAR('n_e4line'))->hide(); + } else { + mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3line'), 0, NULL); + JUT_ASSERT(407, mpTm_c[0] != NULL); + mpTm_c[1] = JKR_NEW CPaneMgr(mpTxScreen, 't3_s', 0, NULL); + JUT_ASSERT(410, mpTm_c[1] != NULL); + mpTm_c[2] = JKR_NEW CPaneMgr(mpTxScreen, 't3_w', 0, NULL); + JUT_ASSERT(413, mpTm_c[2] != NULL); + mpTxScreen->search(MULTI_CHAR('n_3line'))->show(); + mpTxScreen->search(MULTI_CHAR('n_3fline'))->hide(); + mpTxScreen->search(MULTI_CHAR('n_e4line'))->hide(); + } + } else { + mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_e4lin'), 0, NULL); + JUT_ASSERT(407, mpTm_c[0] != NULL); + mpTm_c[1] = JKR_NEW CPaneMgr(mpTxScreen, 't4_s', 0, NULL); + JUT_ASSERT(410, mpTm_c[1] != NULL); + mpTm_c[2] = JKR_NEW CPaneMgr(mpTxScreen, 't4_w', 0, NULL); + JUT_ASSERT(413, mpTm_c[2] != NULL); + mpTxScreen->search(MULTI_CHAR('n_3line'))->hide(); + mpTxScreen->search(MULTI_CHAR('n_3fline'))->hide(); + mpTxScreen->search(MULTI_CHAR('n_e4line'))->show(); + } +#elif VERSION == VERSION_GCN_JPN if (dComIfGs_getOptRuby() == 0) { mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3flin'), 0, NULL); JUT_ASSERT(407, mpTm_c[0] != NULL); diff --git a/src/d/d_msg_scrn_jimaku.cpp b/src/d/d_msg_scrn_jimaku.cpp index ce059bd194..832befb543 100644 --- a/src/d/d_msg_scrn_jimaku.cpp +++ b/src/d/d_msg_scrn_jimaku.cpp @@ -15,6 +15,14 @@ #include "d/d_pane_class.h" #include +#include "dusk/version.hpp" + +#if TARGET_PC || VERSION == VERSION_GCN_JPN +#define STR_BUF_LEN 528 +#else +#define STR_BUF_LEN 512 +#endif + dMsgScrnJimaku_c::dMsgScrnJimaku_c(u8 param_0, JKRExpHeap* i_heap) { if (i_heap != NULL) { heap = i_heap; @@ -46,7 +54,38 @@ dMsgScrnJimaku_c::dMsgScrnJimaku_c(u8 param_0, JKRExpHeap* i_heap) { field_0xcc = g_MsgObject_HIO_c.mBoxPos[0][5]; mpPmP_c->paneTrans(0.0f, field_0xcc); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + if (dComIfGs_getOptRuby() == 0) { + mpTm_c[0] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('mg_3flin'), 0, NULL); + mpTm_c[1] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('t3f_s'), 0, NULL); + + mpTmr_c[0] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('mg_3f'), 0, NULL); + mpTmr_c[1] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('mg_3f_s'), 0, NULL); + + mpScreen->search(MULTI_CHAR('n_3line'))->hide(); + mpScreen->search(MULTI_CHAR('n_3fline'))->show(); + mpScreen->search(MULTI_CHAR('n_e4line'))->hide(); + } else { + mpTm_c[0] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('mg_3line'), 0, NULL); + mpTm_c[1] = JKR_NEW CPaneMgr(mpScreen, 't3_s', 0, NULL); + + mpScreen->search(MULTI_CHAR('n_3line'))->show(); + mpScreen->search(MULTI_CHAR('n_3fline'))->hide(); + mpScreen->search(MULTI_CHAR('n_e4line'))->hide(); + } + } else { + mpTm_c[0] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('mg_e4lin'), 0, NULL); + JUT_ASSERT(0, mpTm_c[0] != NULL); + + mpTm_c[1] = JKR_NEW CPaneMgr(mpScreen, 't4_s', 0, NULL); + JUT_ASSERT(0, mpTm_c[1] != NULL); + + mpScreen->search(MULTI_CHAR('n_3line'))->hide(); + mpScreen->search(MULTI_CHAR('n_3fline'))->hide(); + mpScreen->search(MULTI_CHAR('n_e4line'))->show(); + } +#elif VERSION == VERSION_GCN_JPN if (dComIfGs_getOptRuby() == 0) { mpTm_c[0] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('mg_3flin'), 0, NULL); mpTm_c[1] = JKR_NEW CPaneMgr(mpScreen, MULTI_CHAR('t3f_s'), 0, NULL); @@ -79,21 +118,13 @@ dMsgScrnJimaku_c::dMsgScrnJimaku_c(u8 param_0, JKRExpHeap* i_heap) { for (int i = 0; i < 2; i++) { ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont()); -#if VERSION == VERSION_GCN_JPN - ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x210, ""); -#else - ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x200, ""); -#endif + ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(STR_BUF_LEN, ""); mpTm_c[i]->setBlackWhite(g_MsgObject_HIO_c.mBoxStartBlack[i][4], g_MsgObject_HIO_c.mBoxStartWhite[i][4]); if (mpTmr_c[i] != NULL) { ((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont()); -#if VERSION == VERSION_GCN_JPN - ((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setString(0x210, ""); -#else - ((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setString(0x200, ""); -#endif + ((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setString(STR_BUF_LEN, ""); mpTmr_c[i]->setBlackWhite(g_MsgObject_HIO_c.mBoxStartBlack[i][4], g_MsgObject_HIO_c.mBoxStartWhite[i][4]); } diff --git a/src/d/d_msg_scrn_kanban.cpp b/src/d/d_msg_scrn_kanban.cpp index d6e91b12f6..8e2346feab 100644 --- a/src/d/d_msg_scrn_kanban.cpp +++ b/src/d/d_msg_scrn_kanban.cpp @@ -4,14 +4,15 @@ #include "d/dolzel.h" // IWYU pragma: keep -#include "d/d_msg_scrn_kanban.h" #include "JSystem/J2DGraph/J2DAnmLoader.h" #include "JSystem/J2DGraph/J2DGrafContext.h" #include "JSystem/J2DGraph/J2DScreen.h" #include "JSystem/JKernel/JKRExpHeap.h" #include "d/d_msg_object.h" #include "d/d_msg_out_font.h" +#include "d/d_msg_scrn_kanban.h" #include "d/d_pane_class.h" +#include "dusk/version.hpp" #if TARGET_PC #include "dusk/settings.h" @@ -60,8 +61,48 @@ dMsgScrnKanban_c::dMsgScrnKanban_c(JKRExpHeap* param_0) { mpSpot_c->getPanePtr()->setAnimation(field_0xd0); +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + if (dComIfGs_getOptRuby() != 0) { + static u64 const t_tag[3] = {MULTI_CHAR('mg_3line'), 't3_w', 't3_s'}; + for (int i = 0; i < 3; i++) { + mpTm_c[i] = JKR_NEW CPaneMgr(mpScreen, t_tag[i], 0, NULL); + ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont()); + } -#if VERSION == VERSION_GCN_JPN + mpScreen->search(MULTI_CHAR('n_3line'))->show(); + mpScreen->search(MULTI_CHAR('n_3fline'))->hide(); + mpScreen->search(MULTI_CHAR('n_e4line'))->hide(); + } else { + static u64 const t_tag_2[3] = {MULTI_CHAR('t3fline'), MULTI_CHAR('t3f_w'), MULTI_CHAR('t3f_s')}; + static u64 const tr_tag[3] = {MULTI_CHAR('mg_3f'), MULTI_CHAR('mg_3f_w'), MULTI_CHAR('mg_3f_s')}; + + for (int i = 0; i < 3; i++) { + mpTm_c[i] = JKR_NEW CPaneMgr(mpScreen, t_tag_2[i], 0, NULL); + ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont()); + + mpTmr_c[i] = JKR_NEW CPaneMgr(mpScreen, tr_tag[i], 0, NULL); + ((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont()); + } + + mpScreen->search(MULTI_CHAR('n_3line'))->hide(); + mpScreen->search(MULTI_CHAR('n_3fline'))->show(); + mpScreen->search(MULTI_CHAR('n_e4line'))->hide(); + } + } else { + static u64 const t_tag[3] = {MULTI_CHAR('mg_e4lin'), 'f4_w', 't4_s'}; + + for (int i = 0; i < 3; i++) { + mpTm_c[i] = JKR_NEW CPaneMgr(mpScreen, t_tag[i], 0, NULL); + JUT_ASSERT(81, mpTm_c[i] != NULL); + ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont()); + } + + mpScreen->search(MULTI_CHAR('n_3line'))->hide(); + mpScreen->search(MULTI_CHAR('n_3fline'))->hide(); + mpScreen->search(MULTI_CHAR('n_e4line'))->show(); + } +#elif VERSION == VERSION_GCN_JPN if (dComIfGs_getOptRuby() != 0) { static u64 const t_tag[3] = {MULTI_CHAR('mg_3line'), 't3_w', 't3_s'}; for (int i = 0; i < 3; i++) { diff --git a/src/d/d_msg_scrn_place.cpp b/src/d/d_msg_scrn_place.cpp index 93c2ec7c20..31718f6d49 100644 --- a/src/d/d_msg_scrn_place.cpp +++ b/src/d/d_msg_scrn_place.cpp @@ -5,12 +5,13 @@ #include "d/dolzel.h" // IWYU pragma: keep -#include "d/d_msg_scrn_place.h" #include "JSystem/J2DGraph/J2DGrafContext.h" #include "JSystem/J2DGraph/J2DScreen.h" #include "d/d_camera.h" #include "d/d_msg_object.h" +#include "d/d_msg_scrn_place.h" #include "d/d_pane_class.h" +#include "dusk/version.hpp" #if TARGET_PC #include "dusk/settings.h" @@ -32,7 +33,13 @@ dMsgScrnPlace_c::dMsgScrnPlace_c() { } mpScreen = JKR_NEW J2DScreen(); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + mpScreen->setPriority("zelda_stage_title.blo", 0x20000, dComIfGp_getMsgArchive(4)); + } else { + mpScreen->setPriority("zelda_stage_title_foreign.blo", 0x20000, dComIfGp_getMsgArchive(4)); + } +#elif VERSION == VERSION_GCN_JPN mpScreen->setPriority("zelda_stage_title.blo", 0x20000, dComIfGp_getMsgArchive(4)); #else mpScreen->setPriority("zelda_stage_title_foreign.blo", 0x20000, dComIfGp_getMsgArchive(4)); @@ -59,7 +66,9 @@ dMsgScrnPlace_c::dMsgScrnPlace_c() { ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(mDoExt_getRubyFont()); ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x80, ""); #if VERSION != VERSION_GCN_JPN + IF_DUSK_BLOCK(!dusk::version::isRegionJpn()) ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setCharSpace(1.0f); + IF_DUSK_BLOCK_END #endif } diff --git a/src/d/d_msg_scrn_talk.cpp b/src/d/d_msg_scrn_talk.cpp index 5cf1b184da..6a30d08c47 100644 --- a/src/d/d_msg_scrn_talk.cpp +++ b/src/d/d_msg_scrn_talk.cpp @@ -20,10 +20,20 @@ #include "JSystem/J2DGraph/J2DScreen.h" #include +#include "dusk/version.hpp" + #if TARGET_PC #include "dusk/settings.h" #endif +#if TARGET_PC +#define STR_BUF_LEN 528 +#elif VERSION == VERSION_GCN_JPN +#define STR_BUF_LEN 528 +#else +#define STR_BUF_LEN 512 +#endif + dMsgScrnTalk_c::dMsgScrnTalk_c(u8 param_1, u8 param_2, JKRExpHeap* param_3) { if (param_3 != NULL) { field_0xe4 = param_3; @@ -100,7 +110,12 @@ dMsgScrnTalk_c::dMsgScrnTalk_c(u8 param_1, u8 param_2, JKRExpHeap* param_3) { JUT_ASSERT(153, mpMg_c[1] != NULL); OSInitFastCast(); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) + field_0xf4 = 0.0f; + else + field_0xf4 = -10.0f; +#elif VERSION == VERSION_GCN_JPN field_0xf4 = 0.0f; #else field_0xf4 = -10.0f; @@ -110,7 +125,68 @@ dMsgScrnTalk_c::dMsgScrnTalk_c(u8 param_1, u8 param_2, JKRExpHeap* param_3) { JUT_ASSERT(176, mpPmP_c != NULL); mpPmP_c->scale(g_MsgObject_HIO_c.mBoxTalkScaleX, g_MsgObject_HIO_c.mBoxTalkScaleY); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + if (dComIfGs_getOptRuby() == 0) { + mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3flin'), 0, NULL); + mpTm_c[1] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3f_s'), 0, NULL); + + mpTmr_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3f'), 0, NULL); + if (dMsgObject_getMsgObjectClass()->getFukiKind() == 8) { + mpTm_c[2] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3f_s1'), 0, NULL); + mpTm_c[3] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3f_s2'), 0, NULL); + mpTm_c[4] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3f_s3'), 0, NULL); + mpTm_c[5] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3f_s4'), 0, NULL); + mpTmr_c[1] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3f_s1'), 0, NULL); + mpTmr_c[2] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3f_s2'), 0, NULL); + } else { + mpTmr_c[1] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3f_s'), 0, NULL); + } + + mpTxScreen->search(MULTI_CHAR('n_3line'))->hide(); + mpTxScreen->search(MULTI_CHAR('n_3fline'))->show(); + mpTxScreen->search(MULTI_CHAR('n_e4line'))->hide(); + } else { + mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3line'), 0, NULL); + mpTm_c[1] = JKR_NEW CPaneMgr(mpTxScreen, 't3_s', 0, NULL); + + if (dMsgObject_getMsgObjectClass()->getFukiKind() == 8) { + mpTm_c[2] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3_s1'), 0, NULL); + JUT_ASSERT(189, mpTm_c[2] != NULL); + mpTm_c[3] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3_s2'), 0, NULL); + JUT_ASSERT(191, mpTm_c[3] != NULL); + mpTm_c[4] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3_s3'), 0, NULL); + JUT_ASSERT(193, mpTm_c[4] != NULL); + mpTm_c[5] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3_s4'), 0, NULL); + JUT_ASSERT(193, mpTm_c[5] != NULL); + } + + mpTxScreen->search(MULTI_CHAR('n_3line'))->show(); + mpTxScreen->search(MULTI_CHAR('n_3fline'))->hide(); + mpTxScreen->search(MULTI_CHAR('n_e4line'))->hide(); + } + } else { + mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_e4lin'), 0, NULL); + JUT_ASSERT(182, mpTm_c[0] != NULL); + mpTm_c[1] = JKR_NEW CPaneMgr(mpTxScreen, 't4_s', 0, NULL); + JUT_ASSERT(185, mpTm_c[1] != NULL); + + if (dMsgObject_getMsgObjectClass()->getFukiKind() == 8) { + mpTm_c[2] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t4_s1'), 0, NULL); + JUT_ASSERT(189, mpTm_c[2] != NULL); + mpTm_c[3] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t4_s2'), 0, NULL); + JUT_ASSERT(191, mpTm_c[3] != NULL); + mpTm_c[4] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t4_s3'), 0, NULL); + JUT_ASSERT(193, mpTm_c[4] != NULL); + mpTm_c[5] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t4_s4'), 0, NULL); + JUT_ASSERT(193, mpTm_c[5] != NULL); + } + + mpTxScreen->search(MULTI_CHAR('n_3line'))->hide(); + mpTxScreen->search(MULTI_CHAR('n_3fline'))->hide(); + mpTxScreen->search(MULTI_CHAR('n_e4line'))->show(); + } +#elif VERSION == VERSION_GCN_JPN if (dComIfGs_getOptRuby() == 0) { mpTm_c[0] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('mg_3flin'), 0, NULL); mpTm_c[1] = JKR_NEW CPaneMgr(mpTxScreen, MULTI_CHAR('t3f_s'), 0, NULL); @@ -173,19 +249,11 @@ dMsgScrnTalk_c::dMsgScrnTalk_c(u8 param_1, u8 param_2, JKRExpHeap* param_3) { for (int i = 0; i < 6; i++) { if (mpTm_c[i] != NULL) { ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont()); -#if VERSION == VERSION_GCN_JPN - ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x210, ""); -#else - ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x200, ""); -#endif + ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(STR_BUF_LEN, ""); } if (mpTmr_c[i] != NULL) { ((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setFont(mDoExt_getMesgFont()); -#if VERSION == VERSION_GCN_JPN - ((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setString(0x210, ""); -#else - ((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setString(0x200, ""); -#endif + ((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setString(STR_BUF_LEN, ""); } } if (dMsgObject_getMsgObjectClass()->getFukiKind() != 8) { diff --git a/src/d/d_msg_scrn_tree.cpp b/src/d/d_msg_scrn_tree.cpp index 899a8f449a..440b2702d3 100644 --- a/src/d/d_msg_scrn_tree.cpp +++ b/src/d/d_msg_scrn_tree.cpp @@ -1,13 +1,14 @@ #include "d/dolzel.h" // IWYU pragma: keep -#include "d/d_msg_scrn_tree.h" #include "JSystem/J2DGraph/J2DAnmLoader.h" #include "JSystem/J2DGraph/J2DGrafContext.h" #include "JSystem/J2DGraph/J2DScreen.h" #include "JSystem/JKernel/JKRExpHeap.h" #include "d/d_msg_object.h" #include "d/d_msg_out_font.h" +#include "d/d_msg_scrn_tree.h" #include "d/d_pane_class.h" +#include "dusk/version.hpp" #if TARGET_PC #include "dusk/settings.h" @@ -61,7 +62,52 @@ dMsgScrnTree_c::dMsgScrnTree_c(JUTFont* param_0, JKRExpHeap* param_1) { mpScreen->search(MULTI_CHAR('white_m'))->setAnimation(field_0xd4); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + if (dComIfGs_getOptRuby() != 0) { + for (int i = 0; i < 3; i++) { + static u64 const t_tag[3] = {MULTI_CHAR('mg_3line'), 't3_w', 't3_s'}; + + mpTm_c[i] = JKR_NEW CPaneMgr(mpScreen, t_tag[i], 0, NULL); + ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(field_0x54); + ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x210, ""); + } + + mpScreen->search(MULTI_CHAR('n_3line'))->show(); + mpScreen->search(MULTI_CHAR('n_3fline'))->hide(); + mpScreen->search(MULTI_CHAR('n_e4line'))->hide(); + } else { + for (int i = 0; i < 3; i++) { + static u64 const t_tag[3] = {MULTI_CHAR('t3fline'), MULTI_CHAR('t3f_w'), MULTI_CHAR('t3f_s')}; + static u64 const tr_tag[3] = {MULTI_CHAR('mg_3f'), MULTI_CHAR('mg_3f_w'), MULTI_CHAR('mg_3f_s')}; + + mpTm_c[i] = JKR_NEW CPaneMgr(mpScreen, t_tag[i], 0, NULL); + ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(field_0x54); + ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x210, ""); + + mpTmr_c[i] = JKR_NEW CPaneMgr(mpScreen, tr_tag[i], 0, NULL); + ((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setFont(field_0x54); + ((J2DTextBox*)mpTmr_c[i]->getPanePtr())->setString(0x210, ""); + } + + mpScreen->search(MULTI_CHAR('n_3line'))->hide(); + mpScreen->search(MULTI_CHAR('n_3fline'))->show(); + mpScreen->search(MULTI_CHAR('n_e4line'))->hide(); + } + } else { + for (int i = 0; i < 3; i++) { + static u64 const t_tag[3] = {MULTI_CHAR('mg_e4lin'), 'f4_w', 't4_s'}; + + mpTm_c[i] = JKR_NEW CPaneMgr(mpScreen, t_tag[i], 0, NULL); + ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setFont(field_0x54); + ((J2DTextBox*)mpTm_c[i]->getPanePtr())->setString(0x200, ""); + } + + mpScreen->search(MULTI_CHAR('n_3line'))->hide(); + mpScreen->search(MULTI_CHAR('n_3fline'))->hide(); + mpScreen->search(MULTI_CHAR('n_e4line'))->show(); + } +#elif VERSION == VERSION_GCN_JPN if (dComIfGs_getOptRuby() != 0) { for (int i = 0; i < 3; i++) { static u64 const t_tag[3] = {MULTI_CHAR('mg_3line'), 't3_w', 't3_s'}; diff --git a/src/d/d_msg_unit.cpp b/src/d/d_msg_unit.cpp index 130b5da906..057e6cc3fc 100644 --- a/src/d/d_msg_unit.cpp +++ b/src/d/d_msg_unit.cpp @@ -1,11 +1,12 @@ #include "d/dolzel.h" // IWYU pragma: keep -#include "d/d_msg_unit.h" -#include "d/d_com_inf_game.h" #include #include +#include "d/d_com_inf_game.h" #include "d/d_kankyo.h" #include "d/d_meter2_info.h" +#include "d/d_msg_unit.h" +#include "dusk/version.hpp" // temporary until a better solution is found typedef struct dMsgUnit_inf1_entry { @@ -41,6 +42,199 @@ dMsgUnit_c::dMsgUnit_c() {} dMsgUnit_c::~dMsgUnit_c() {} +#if TARGET_PC +typedef struct dMsgUnit_inf1_entry_JPN { + BE(u32) dat1EntryOffset; + BE(u16) field_0x04; + BE(u16) field_0x06; + BE(u16) field_0x08; + BE(u16) field_0x0a; + BE(u16) field_0x0c; + BE(u16) field_0x0e; + BE(u16) field_0x10; + BE(u16) field_0x12; + BE(u16) field_0x14; + BE(u16) field_0x16; + BE(u16) field_0x18; + BE(u16) startFrame; + BE(u16) endFrame; +} dMsgUnit_inf1_entry_JPN; + +typedef struct dMsgUnit_inf1_section_JPN { + /* 0x00 */ BE(u32) msgType; // sectionType + /* 0x04 */ BE(u32) size; // total size of the section + /* 0x08 */ BE(u16) entryCount; + /* 0x0A */ BE(u16) entryLength; + /* 0x0C */ BE(u16) msgArchiveId; + /* 0x10 */ dMsgUnit_inf1_entry_JPN entries[0]; +} dMsgUnit_inf1_section_JPN; + +void dMsgUnit_c::setTag_jpn(int i_type, int i_value, TEXT_SPAN o_buffer, bool param_4) { + *o_buffer = 0; + bool stack9 = false; + bool stack8 = false; + int value = i_value; + + if (i_type == 0x10000) { + SAFE_SPRINTF(o_buffer, "%d", i_value); + return; + } + + if (i_type == 0x10001) { + int tens_digit = i_value / 10; + int ones_digit = i_value % 10; + SAFE_SPRINTF(o_buffer, "%d-%d", tens_digit, ones_digit); + return; + } + + if ((i_type == 4 && param_4 == true) || (i_type == 5 && param_4 == false)) { + int seconds = i_value / 1000; + int minutes = seconds / 60; + seconds -= minutes * 60; + if (minutes > 99) { + minutes = 99; + seconds = 59; + } + + if (minutes == 0 && seconds == 0) { + if (strcmp(dComIfGp_getStartStageName(), "F_SP00") == 0) { + return; + } + } + + if (i_type == 4) { + i_value = minutes; + if (minutes == 0) { + stack9 = true; + } + } + + if (i_type == 5) { + if (seconds == 0 && minutes != 0) { + return; + } + i_value = seconds; + } + } + + if ((i_type == 3 && param_4 == true) || i_type == 4 && param_4 == false) { + f32 dayTime = g_env_light.getDaytime(); + f32 hour = dayTime / 15.0f; + + f32 iVar8b = ((s32)(1000000.0f * dayTime) % 15000000) / 1000000.0f; + f32 minute = 60.0f * (iVar8b / 15.0f); + // not sure why this affects codegen, in theory it should be optimized out + f32 minute2 = 60.0f * (iVar8b / 15.0f); + if (i_type == 3) { + i_value = (s32)hour; + } + + if (i_type == 4) { + i_value = (s32)minute; + } + } + + if (i_type == 9 && param_4 == true) { + SAFE_SPRINTF(o_buffer, "%d", i_value); + stack8 = true; + } + + if (!stack9) { + bmg_header_t* pHeader = (bmg_header_t*)dMeter2Info_getMsgUnitResource(); + dMsgUnit_inf1_section_JPN* pInfoBlock = NULL; + const void* pMsgDataBlock = NULL; + str1_section_t* pStrAttributeBlock = NULL; + int filepos = sizeof(bmg_header_t); + u32 filesize = pHeader->size; + bmg_section_t* pSection = (bmg_section_t*)(((u8*)pHeader) + filepos); + + for (; filepos < filesize; filepos += pSection->size) { + switch(pSection->magic) { + case 'FLW1': + break; + case 'FLI1': + break; + case 'INF1': + pInfoBlock = (dMsgUnit_inf1_section_JPN*)pSection; + break; + case 'DAT1': + pMsgDataBlock = pSection; + break; + case 'STR1': + pStrAttributeBlock = (str1_section_t*)pSection; + break; + } + pSection = (bmg_section_t*)((u8*)pSection + pSection->size); + } + + u16 vals[12]; + vals[0] = pInfoBlock->entries[i_type].field_0x04; + vals[1] = pInfoBlock->entries[i_type].field_0x06; + vals[2] = pInfoBlock->entries[i_type].field_0x08; + vals[3] = pInfoBlock->entries[i_type].field_0x0a; + vals[4] = pInfoBlock->entries[i_type].field_0x0c; + vals[5] = pInfoBlock->entries[i_type].field_0x0e; + vals[6] = pInfoBlock->entries[i_type].field_0x10; + vals[7] = pInfoBlock->entries[i_type].field_0x12; + vals[8] = pInfoBlock->entries[i_type].field_0x14; + vals[9] = pInfoBlock->entries[i_type].field_0x16; + vals[10] = pInfoBlock->entries[i_type].field_0x18; + int entryOff = pInfoBlock->entries[i_type].dat1EntryOffset; + + char* value2 = (char*)((uintptr_t)pMsgDataBlock + entryOff + 8); + + const char* uVar5; + if (i_value == 0) { + uVar5 = pStrAttributeBlock->entries->str + vals[0]; + } else { + if ((i_value % 10) == 0) { + uVar5 = pStrAttributeBlock->entries->str + (vals[10]); + } else { + uVar5 = pStrAttributeBlock->entries->str + vals[i_value % 10]; + } + } + + int uVar5Len = strlen(uVar5); + if (uVar5Len == 0) { + if (stack8) { + SAFE_STRCAT(o_buffer, value2); + } else { + SAFE_SPRINTF(o_buffer, "%d%s", i_value, value2); + } + } else { + char unkCharArr[7]; + unkCharArr[0] = 26; + unkCharArr[1] = uVar5Len + 6; + unkCharArr[2] = -1; + unkCharArr[3] = -1; + unkCharArr[4] = 2; + unkCharArr[5] = strlen(value2) / 2; + unkCharArr[6] = 0; + + if (stack8) { + SAFE_STRCAT(o_buffer, unkCharArr); + SAFE_STRCAT(o_buffer, uVar5); + SAFE_STRCAT(o_buffer, value2); + } else { + SAFE_SPRINTF(o_buffer, "%d%s%s%s", i_value, unkCharArr, uVar5, value2); + } + } + } + + if (i_type == 3 && param_4 == true) { + char buffer[20]; + setTag(4, 0, buffer, false); + SAFE_STRCAT(o_buffer, buffer); + } + + if (i_type == 4 && param_4 == true) { + char buffer[20]; + setTag(5, value, buffer, false); + SAFE_STRCAT(o_buffer, buffer); + } +} +#endif + #if REGION_JPN void dMsgUnit_c::setTag(int i_type, int i_value, TEXT_SPAN o_buffer, bool param_4) { *o_buffer = 0; @@ -208,6 +402,13 @@ void dMsgUnit_c::setTag(int i_type, int i_value, TEXT_SPAN o_buffer, bool param_ } #else void dMsgUnit_c::setTag(int i_type, int i_value, TEXT_SPAN o_buffer, bool param_4) { +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + setTag_jpn(i_type, i_value, o_buffer, param_4); + return; + } +#endif + *o_buffer = 0; bool stack9 = false; bool stack8 = false; diff --git a/src/d/d_save.cpp b/src/d/d_save.cpp index 22729ad43e..cdd5c467ef 100644 --- a/src/d/d_save.cpp +++ b/src/d/d_save.cpp @@ -1016,7 +1016,12 @@ void dSv_player_info_c::init() { } void dSv_player_config_c::init() { -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) + mRuby = 0; + else + mRuby = 1; +#elif VERSION == VERSION_GCN_JPN mRuby = 0; #else mRuby = 1; diff --git a/src/d/d_timer.cpp b/src/d/d_timer.cpp index 1b4febc9f4..e07cc3af80 100644 --- a/src/d/d_timer.cpp +++ b/src/d/d_timer.cpp @@ -24,6 +24,7 @@ #include #include "dusk/frame_interpolation.h" +#include "dusk/version.hpp" static int dTimer_createStart2D(s32 param_0, u16 param_1); @@ -1430,7 +1431,7 @@ void dDlst_TimerScrnDraw_c::playBckAnimation(f32 i_frame) { mpGetInParent->getPanePtr()->setAnimation((J2DAnmTransform*)NULL); } -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC || VERSION == VERSION_GCN_JPN bool dDlst_TimerScrnDraw_c::isLeadByte(int i_char) { return (i_char >= 0x81 && i_char <= 0x9f) || (i_char >= 0xe0 && i_char <= 0xfc); } @@ -1466,7 +1467,18 @@ void dDlst_TimerScrnDraw_c::drawPikari(int i_no) { var_f25 * static_cast(mpGetInText->getPanePtr())->getCharSpace(); } -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + if (isLeadByte(c)) { + c = ((string[str_idx] & 0xFF) << 8) | (string[str_idx + 1] & 0xFF); + str_idx++; + } else { + c = string[str_idx] & 0xFF; + } + } else { + c = string[str_idx] & 0xFF; + } +#elif VERSION == VERSION_GCN_JPN if (isLeadByte(c)) { c = ((string[str_idx] & 0xFF) << 8) | (string[str_idx + 1] & 0xFF); str_idx++; @@ -1492,7 +1504,18 @@ void dDlst_TimerScrnDraw_c::drawPikari(int i_no) { var_f25 * static_cast(mpGetInText->getPanePtr())->getCharSpace(); } -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (dusk::version::isRegionJpn()) { + if (isLeadByte(c)) { + c = ((string[str_idx] & 0xFF) << 8) | (string[str_idx + 1] & 0xFF); + str_idx++; + } else { + c = string[str_idx] & 0xFF; + } + } else { + c = string[str_idx] & 0xFF; + } +#elif VERSION == VERSION_GCN_JPN if (isLeadByte(c)) { c = ((string[str_idx] & 0xFF) << 8) | (string[str_idx + 1] & 0xFF); str_idx++;