diff --git a/Source/Contents/Hotkeys/HotkeyInfo.cpp b/Source/Contents/Hotkeys/HotkeyInfo.cpp index 51dd1e26..c9c4ca31 100644 --- a/Source/Contents/Hotkeys/HotkeyInfo.cpp +++ b/Source/Contents/Hotkeys/HotkeyInfo.cpp @@ -38,25 +38,21 @@ bool SkillUsesPercentSp(int id) { // OFFSET: 0x008224C0 // FUNCTION: fn_10278 std::string SkillTooltipPercent(const char* hotkey, const char* name, int level, int sp, int ap) { - char text[4096]; if (ap != 0) { - _snprintf_s(text, sizeof(text), _TRUNCATE, "%s %s Use Lv %d (Sp : %d%%, Ap : %d)", hotkey, name, level, sp, ap); - } else { - _snprintf_s(text, sizeof(text), _TRUNCATE, "%s %s Use Lv %d (Sp : %d%%)", hotkey, name, level, sp); + return FormatOwnedString("%s %s Use Lv %d (Sp : %d%%, Ap : %d)", hotkey, name, level, sp, ap); } - return text; + + return FormatOwnedString("%s %s Use Lv %d (Sp : %d%%)", hotkey, name, level, sp); } // OFFSET: 0x00822550 // FUNCTION: fn_10279 std::string SkillTooltipFlat(const char* hotkey, const char* name, int level, int sp, int ap) { - char text[4096]; if (ap != 0) { - _snprintf_s(text, sizeof(text), _TRUNCATE, "%s %s Use Lv %d (Sp : %d, Ap : %d)", hotkey, name, level, sp, ap); - } else { - _snprintf_s(text, sizeof(text), _TRUNCATE, "%s %s Use Lv %d (Sp : %d)", hotkey, name, level, sp); + return FormatOwnedString("%s %s Use Lv %d (Sp : %d, Ap : %d)", hotkey, name, level, sp, ap); } - return text; + + return FormatOwnedString("%s %s Use Lv %d (Sp : %d)", hotkey, name, level, sp); } // INLINED diff --git a/Source/Contents/Hotkeys/HotkeyInfo.h b/Source/Contents/Hotkeys/HotkeyInfo.h index 669a8dc6..543e34ca 100644 --- a/Source/Contents/Hotkeys/HotkeyInfo.h +++ b/Source/Contents/Hotkeys/HotkeyInfo.h @@ -1,6 +1,8 @@ #ifndef RAGNAROK_SOURCE_CONTENTS_HOTKEYS_HOTKEYINFO_H #define RAGNAROK_SOURCE_CONTENTS_HOTKEYS_HOTKEYINFO_H +#include "Utility/Text/FormatString.h" + #include #include