diff --git a/Source/Contents/Hotkeys/HotkeyInfo.h b/Source/Contents/Hotkeys/HotkeyInfo.h index 68c0d8c6..669a8dc6 100644 --- a/Source/Contents/Hotkeys/HotkeyInfo.h +++ b/Source/Contents/Hotkeys/HotkeyInfo.h @@ -17,6 +17,7 @@ struct HotkeyInfo { }; HotkeyInfo GetHotkeyInfo(LuaScript& script, int tab, int index); +int HotkeyCount(LuaScript& script, int tab); std::string SkillTooltipPercent(const char* hotkey, const char* name, int level, int sp, int ap); std::string SkillTooltipFlat(const char* hotkey, const char* name, int level, int sp, int ap); std::string SkillTooltip(const char* hotkey, const char* name, int level, int sp, int ap, bool percent); diff --git a/Source/Contents/Hotkeys/UserHotkeyMgr.cpp b/Source/Contents/Hotkeys/UserHotkeyMgr.cpp index e10b6c48..059a5541 100644 --- a/Source/Contents/Hotkeys/UserHotkeyMgr.cpp +++ b/Source/Contents/Hotkeys/UserHotkeyMgr.cpp @@ -1,4 +1,5 @@ #include "Contents/Hotkeys/UserHotkeyMgr.h" +#include "Contents/Hotkeys/HotkeyInfo.h" #include "Network/TextEncoding.h" #include @@ -43,25 +44,6 @@ namespace { } } - // OFFSET: 0x00E0A4C0 - // FUNCTION: fn_23797 - int HotkeyCount(LuaScript& script, int tab) { - int count = 0; - if (script.Call("GetOriginalHotKeyListSize", "d>d", tab + 1, &count)) { - if (tab == 1) { - int hidden = 0; - - for (int index = HK_FIRST_HIDDEN; index < count; ++index) { - hidden += HiddenInterfaceIndex(index); - } - - return count - hidden; - } - } - - return count; - } - // OFFSET: 0x00E12E50 // FUNCTION: fn_23820 int HotkeyIndex(LuaScript& script, int tab, int index) { @@ -77,6 +59,25 @@ namespace { } } +// OFFSET: 0x00E0A4C0 +// FUNCTION: fn_23797 +int HotkeyCount(LuaScript& script, int tab) { + int count = 0; + if (script.Call("GetOriginalHotKeyListSize", "d>d", tab + 1, &count)) { + if (tab == 1) { + int hidden = 0; + + for (int index = HK_FIRST_HIDDEN; index < count; ++index) { + hidden += HiddenInterfaceIndex(index); + } + + return count - hidden; + } + } + + return count; +} + // STATIC: 0x013898E4 // GLOBAL: gl_24356 CUserHotkeyMgr* g_userHotkeyMgr; diff --git a/Source/Script/LuaScript.cpp b/Source/Script/LuaScript.cpp index 792df914..885bbe6d 100644 --- a/Source/Script/LuaScript.cpp +++ b/Source/Script/LuaScript.cpp @@ -8,9 +8,12 @@ #include "Contents/Effects/EmitterEffect.h" #include "Contents/Effects/EvilsPawEffect.h" #include "Contents/Effects/WindEffect.h" +#include "Contents/Hotkeys/HotkeyInfo.h" #include "File/File.h" #include "File/ResourcePath.h" #include "Script/LuaFileOperations.h" +#include "UI/Chat/ChatSuggestions.h" +#include "UI/Window/UIWindow.h" #include "UI/UICheckAttendanceWnd.h" #include "UI/UILapineScrollBar.h" #include "UI/UILapineUpgradeBoxWnd.h" @@ -38,9 +41,6 @@ struct MiniMapPosition { /* 0004 */ float y; }; -// GLOBAL: gl_24791 -LuaScript* g_luaScript; - // GLOBAL: gl_24913 std::map g_exceptionMiniMapPosList; @@ -1249,3 +1249,5 @@ int LuaScript::TableInteger(std::string table, int keyType, std::intptr_t key) { void LuaScript::Register(std::string name, int (*function)(lua_State*)) { lua_register(this->m_state, name.c_str(), function); } + +// OFFSET: 0x00A91200 diff --git a/Source/UI/Window/UIWindowMgr.h b/Source/UI/Window/UIWindowMgr.h index 2415d154..c7e10e79 100644 --- a/Source/UI/Window/UIWindowMgr.h +++ b/Source/UI/Window/UIWindowMgr.h @@ -555,6 +555,7 @@ public: void BroadcastMessage21(); bool HasModalWindow(); int TranslateHotkey(int key, int keyData); + int GetHotkeyBehavior(); std::vector SaveReplayWindows(); bool ProcessHotkeyAction(int action, int pressed); void SendEmotionHotkey(int index);