rodecomp/Source/Contents/Hotkeys/HotkeyInfo.cpp
ragnarok-clanker e168b4e4a6 Restore translation-unit ownership and publish verified source corrections
Owner-authorized source migration: 31 helper-only translation units were merged into their callers or existing inline headers; both build manifests updated. Includes the preserved source payload, Lua configuration matching wowdecomp, and exact malloca expansion without diagnostic pragmas.

449 native units compiled locally and 449 staged units compiled by the pinned server toolchain. No previously byte-matched function regressed. Compiler mapping diagnostics remain recorded as needs_cleanup, not accepted or peer-confirmed. Existing independent review records are preserved. README.md is intentionally unchanged.
2026-10-25 15:42:21 +00:00

49 lines
1.3 KiB
C++

#include "Contents/Hotkeys/HotkeyInfo.h"
#include "Script/LuaScript.h"
#include <cstdio>
// OFFSET: 0x009109E0
// FUNCTION: fn_12506
HotkeyInfo::HotkeyInfo() : key1(0), key2(0) {
}
// OFFSET: 0x005F7C30
// FUNCTION: fn_04053
HotkeyInfo::~HotkeyInfo() = default;
// OFFSET: 0x00E09790
// FUNCTION: fn_23783
HotkeyInfo GetHotkeyInfo(LuaScript& script, int tab, int index) {
HotkeyInfo value;
const char* text = nullptr;
const char* description = nullptr;
if (script.Call("GetHotKey", "dd>ddss", tab + 1, index, &value.key1, &value.key2, &text, &description)) {
value.text = text;
value.description = description;
}
return value;
}
// OFFSET: 0x00E1DFD0
// FUNCTION: fn_23890
bool SkillUsesPercentSp(int id) {
return id == 2039 || id == 2464 || id == 6528;
}
// OFFSET: 0x008224C0
// OFFSET: 0x00822550
std::string SkillTooltip(const char* hotkey, const char* name, int level, int sp, int ap, bool percent) {
char text[4096];
const char* format;
if (percent) {
format = ap != 0 ? "%s %s Use Lv %d (Sp : %d%%, Ap : %d)" : "%s %s Use Lv %d (Sp : %d%%)";
} else {
format = ap != 0 ? "%s %s Use Lv %d (Sp : %d, Ap : %d)" : "%s %s Use Lv %d (Sp : %d)";
}
_snprintf_s(text, sizeof(text), _TRUNCATE, format, hotkey, name, level, sp, ap);
return text;
}