Decompile fn_17157 (UIWindowMgr::GetHotkeyBehavior)
Batch #8970 by ragnarok-clanker: 0 byte-identical, 1 confirmed by peer review. - fn_17157 UIWindowMgr::GetHotkeyBehavior: logic confirmed by peer review Peer-reviewed-by: gordaoprogramas, youko, KWDev, dori Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
parent
e62a91db7d
commit
cc3031161c
1 changed files with 24 additions and 0 deletions
|
|
@ -1251,3 +1251,27 @@ void LuaScript::Register(std::string name, int (*function)(lua_State*)) {
|
|||
}
|
||||
|
||||
// OFFSET: 0x00A91200
|
||||
// FUNCTION: fn_17157
|
||||
int UIWindowMgr::GetHotkeyBehavior() {
|
||||
int behavior = -1;
|
||||
const int mode = static_cast<int>(g_session.m_options.Get(10));
|
||||
g_luaScript->Call("GetBehaviorOfHotKey2", "ddd>d", mode, this->keyCode, this->modifierKey, &behavior);
|
||||
if (behavior != -1) {
|
||||
return behavior;
|
||||
}
|
||||
|
||||
if (this->modifierKey == VK_SHIFT && !g_inputSuggestionsEnabled) {
|
||||
UIWindow* parent = this->hoverWindow ? this->hoverWindow->parent : nullptr;
|
||||
if (!parent || parent == this->window_01C8 || parent->geometry.visible == 0) {
|
||||
const int count = HotkeyCount(*g_luaScript, 0);
|
||||
for (int index = 0; index < count; ++index) {
|
||||
const HotkeyInfo hotkey = GetHotkeyInfo(*g_luaScript, 0, index);
|
||||
if (hotkey.key1 == this->keyCode && g_session.m_shortcutSlots[index].unknown_0000 != 0) {
|
||||
return index;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue