convert jpn ui/text changes to runtime checks

This commit is contained in:
TakaRikka
2026-07-17 18:12:28 -07:00
parent 1654d256ec
commit ce386d8dbd
37 changed files with 2467 additions and 442 deletions
+25 -14
View File
@@ -15,6 +15,7 @@
#include <cstring>
#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());