Decompile 3 functions in Source/Contents/Hotkeys/UserHotkeyMgr.cpp, Source/Contents/Hotkeys/UserHotkeyMgr.h, ...

Batch #18539 by eAthena: 0 byte-identical, 3 confirmed by peer review.

- fn_03464 CUserHotkeyMgr::LoadV2: logic confirmed by peer review
- fn_03473 CUserHotkeyMgr::LoadUserHotkeyTab: logic confirmed by peer review
- fn_03465 CAccountLinkedUserDataMgr::CompleteLoad: logic confirmed by peer review

Peer-reviewed-by: ragnarok-clanker, alisonrag, bibinir, kyoshi
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-11-12 15:48:27 +00:00
commit d70ade1bc1
5 changed files with 12 additions and 16 deletions

View file

@ -160,18 +160,18 @@ void CUserHotkeyMgr::Reset() {
// OFFSET: 0x005BC420
// FUNCTION: fn_03464
void CUserHotkeyMgr::LoadV2(LuaScript& script, Json::Value& data) {
void CUserHotkeyMgr::LoadV2(Json::Value& data) {
Json::Value values = data["UserHotkey_V2"];
if (values.empty()) {
this->m_version2 = false;
} else {
this->m_version2 = true;
ClearUserHotkeys(script);
LoadUserHotkeyTab(script, values["SkillBar_1Tab"], 0);
LoadUserHotkeyTab(script, values["SkillBar_2Tab"], 3);
LoadUserHotkeyTab(script, values["InterfaceTab"], 1);
LoadUserHotkeyTab(script, values["EmotionTab"], 2);
SaveUserHotkeys(script);
ClearUserHotkeys();
this->LoadUserHotkeyTab(values["SkillBar_1Tab"], 0);
this->LoadUserHotkeyTab(values["SkillBar_2Tab"], 3);
this->LoadUserHotkeyTab(values["InterfaceTab"], 1);
this->LoadUserHotkeyTab(values["EmotionTab"], 2);
SaveUserHotkeys();
}
}

View file

@ -16,7 +16,8 @@ public:
static void Shutdown();
void Reset();
int TabAt(int position) const;
void LoadV2(LuaScript& script, Json::Value& data);
void LoadV2(Json::Value& data);
void LoadUserHotkeyTab(Json::Value& values, int tab);
void Capture();
bool HasUserAssignments(LuaScript& script) const;
bool HasChanges() const;

View file

@ -1,4 +1,5 @@
#include "Client/Session/Session.h"
#include "Contents/Hotkeys/UserHotkeyMgr.h"
#include "Contents/Hotkeys/UserHotkeyScript.h"
#include "Network/TextEncoding.h"
@ -34,7 +35,7 @@ void __stdcall ChangeUserHotkey(int tab, int index, int key1, int key2, const st
// OFFSET: 0x005BD660
// FUNCTION: fn_03473
void LoadUserHotkeyTab(Json::Value& values, int tab) {
void CUserHotkeyMgr::LoadUserHotkeyTab(Json::Value& values, int tab) {
Json::Value entries = values;
for (auto item = entries.begin(); item != entries.end(); ++item) {

View file

@ -9,7 +9,6 @@
void ClearUserHotkeys();
void SaveUserHotkeys();
void __stdcall ChangeUserHotkey(int tab, int index, int key1, int key2, const std::string& description);
void LoadUserHotkeyTab(Json::Value& values, int tab);
// INLINED
inline void ClearUserHotkeys(LuaScript&) {
@ -26,9 +25,4 @@ inline void ChangeUserHotkey(LuaScript&, int tab, int index, int key1, int key2,
ChangeUserHotkey(tab, index, key1, key2, description);
}
// INLINED
inline void LoadUserHotkeyTab(LuaScript&, Json::Value& values, int tab) {
LoadUserHotkeyTab(values, tab);
}
#endif

View file

@ -109,7 +109,7 @@ void CAccountLinkedUserDataMgr::CompleteLoad(
g_session.m_emotionHotkeys.Load(root[DecryptText<0x2FF3C5036D070127ULL>(emotionSource)]);
constexpr std::array<std::uint8_t, 5> hotkeySourceArray = CRYPT_NAME("data", 0x17359BF953C367B3ULL);
const std::uint8_t (&hotkeySource)[5] = hotkeySourceArray._Elems;
g_userHotkeyMgr->LoadV2(*g_session.m_hotkeyScript, root[DecryptText<0x17359BF953C367B3ULL>(hotkeySource)]);
g_userHotkeyMgr->LoadV2(root[DecryptText<0x17359BF953C367B3ULL>(hotkeySource)]);
}
[[fallthrough]];
case 2: