From aa8f905768c004857e30b2f8126a90a073ac4758 Mon Sep 17 00:00:00 2001 From: PJB3005 Date: Mon, 18 May 2026 21:23:03 +0200 Subject: [PATCH] Fix truncating button name Fixes https://github.com/TwilitRealm/dusklight/issues/1549 --- include/d/d_meter_button.h | 3 ++- src/d/d_meter_button.cpp | 10 ---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/include/d/d_meter_button.h b/include/d/d_meter_button.h index 0f05d32440..2d9a4bb5d8 100644 --- a/include/d/d_meter_button.h +++ b/include/d/d_meter_button.h @@ -1,6 +1,7 @@ #ifndef D_METER_D_METER_BUTTON_H #define D_METER_D_METER_BUTTON_H +#include "global.h" #include "JSystem/J2DGraph/J2DScreen.h" #include "JSystem/J2DGraph/J2DTextBox.h" #include "d/d_drawlist.h" @@ -194,7 +195,7 @@ public: /* 0x0FC */ CPaneMgr* field_0x0fc[4]; /* 0x10C */ JKRHeap* mpHeap; /* 0x110 */ void* mpFishingTex; - /* 0x114 */ char mButtonText[2][15]; + /* 0x114 */ char mButtonText[2][DUSK_IF_ELSE(32, 15)]; /* 0x132 */ u8 field_0x132[0x134 - 0x132]; /* 0x134 */ f32 field_0x134; /* 0x138 */ f32 field_0x138; diff --git a/src/d/d_meter_button.cpp b/src/d/d_meter_button.cpp index b39a234056..f89a483c39 100644 --- a/src/d/d_meter_button.cpp +++ b/src/d/d_meter_button.cpp @@ -2930,12 +2930,6 @@ bool dMeterButton_c::isClose() { } void dMeterButton_c::setString(char* i_string, u8 i_button, u8 param_2, u8 param_3) { -#if TARGET_PC - char* i_string_full = i_string; - char i_string_buf[sizeof(mButtonText[0])]; - dusk::SafeStringCopyTruncate(i_string_buf, i_string); - i_string = i_string_buf; -#endif if (strcmp(mButtonText[param_2], i_string) != 0 || field_0x4be[param_2] != i_button) { if (param_2 == 0 && strcmp(mButtonText[1], i_string) == 0 && ((i_button == BUTTON_A_e && field_0x4be[1] == BUTTON_A_e) || @@ -3031,10 +3025,6 @@ void dMeterButton_c::setString(char* i_string, u8 i_button, u8 param_2, u8 param strcpy(mButtonText[param_2], i_string); -#if TARGET_PC - i_string = i_string_full; -#endif - if (param_2 == 0) { if (param_3 != 0) { field_0x4d9 = param_2;