diff --git a/src/os/win/Gui.cpp b/src/os/win/Gui.cpp index c3741f4..85f157f 100644 --- a/src/os/win/Gui.cpp +++ b/src/os/win/Gui.cpp @@ -20,14 +20,7 @@ void* OsGuiGetWindow(int32_t type) { } bool OsGuiIsModifierKeyDown(int32_t key) { - switch (key) { - case 0: - return (GetKeyState(17) & 0xF000) != 0; - case 1: - return (GetKeyState(16) & 0xF000) != 0; - case 2: - return (GetKeyState(18) & 0xF000) != 0; - } + // TODO return false; } diff --git a/src/os/win/Input.cpp b/src/os/win/Input.cpp index 4f704c2..2869146 100644 --- a/src/os/win/Input.cpp +++ b/src/os/win/Input.cpp @@ -671,22 +671,11 @@ int32_t OsWindowProc(void* window, uint32_t message, uintptr_t wparam, intptr_t auto keyDown = message == WM_KEYDOWN || message == WM_SYSKEYDOWN; if (wparam == VK_SHIFT) { - if (!keyDown) { - OsQueuePut(OS_INPUT_KEY_UP, 0, 0, 0, 0); - OsQueuePut(OS_INPUT_KEY_UP, 1, 0, 0, 0); - return 0; - } - - static uint32_t scanCode = 0; - if (scanCode == 256) { - scanCode = MapVirtualKeyA(VK_RSHIFT, MAPVK_VK_TO_VSC); - } - - wparam = ((lparam >> 24) & 0xFF) != scanCode ? VK_LSHIFT : VK_RSHIFT; + // TODO } else if (wparam == VK_CONTROL) { - wparam = ((lparam >> 24) & 0x01) | 0xA2; + // TODO } else if (wparam == VK_MENU) { - wparam = ((lparam >> 24) & 0x01) | 0xA4; + // TODO } KEY key; diff --git a/src/ui/CSimpleHyperlinkButton.cpp b/src/ui/CSimpleHyperlinkButton.cpp index 270a5ce..a4b9fc0 100644 --- a/src/ui/CSimpleHyperlinkButton.cpp +++ b/src/ui/CSimpleHyperlinkButton.cpp @@ -40,16 +40,10 @@ void CSimpleHyperlinkButton::SetHyperlink(CSimpleFontString* string, const GXUFO } void CSimpleHyperlinkButton::OnLayerCursorEnter(int32_t a2) { - auto frame = static_cast(this->m_parent); - frame->OnHyperlinkEnter(this->m_hyperlink, this->m_hyperlink); } void CSimpleHyperlinkButton::OnLayerCursorExit(int32_t a2, int32_t a3) { - auto frame = static_cast(this->m_parent); - frame->OnHyperlinkLeave(this->m_hyperlink, this->m_hyperlink); } void CSimpleHyperlinkButton::OnClick(const char* btn, int32_t a3) { - auto frame = static_cast(this->m_parent); - frame->OnHyperlinkClick(this->m_hyperlink, this->m_hyperlink, btn); } diff --git a/src/ui/CSimpleHyperlinkedFrame.cpp b/src/ui/CSimpleHyperlinkedFrame.cpp index 8de3229..50773b3 100644 --- a/src/ui/CSimpleHyperlinkedFrame.cpp +++ b/src/ui/CSimpleHyperlinkedFrame.cpp @@ -28,32 +28,31 @@ FrameScript_Object::ScriptIx* CSimpleHyperlinkedFrame::GetScriptByName(const cha return nullptr; } -void CSimpleHyperlinkedFrame::OnHyperlinkClick(const char* link, const char* text, const char* button) { +void CSimpleHyperlinkedFrame::OnHyperlinkClick(const char* a2, const char* a3, const char* a4) { if (this->m_onHyperlinkClick.luaRef) { auto L = FrameScript_GetContext(); - lua_pushstring(L, link); - lua_pushstring(L, text); - lua_pushstring(L, button); + lua_pushstring(L, a2); + lua_pushstring(L, a3); - this->RunScript(this->m_onHyperlinkClick, 3, 0); + this->RunScript(this->m_onHyperlinkClick, 2, 0); } } -void CSimpleHyperlinkedFrame::OnHyperlinkLeave(const char* link, const char* text) { +void CSimpleHyperlinkedFrame::OnHyperlinkLeave(const char* a2, const char* a3) { if (this->m_onHyperlinkLeave.luaRef) { auto L = FrameScript_GetContext(); - lua_pushstring(L, link); - lua_pushstring(L, text); + lua_pushstring(L, a2); + lua_pushstring(L, a3); this->RunScript(this->m_onHyperlinkLeave, 2, 0); } } -void CSimpleHyperlinkedFrame::OnHyperlinkEnter(const char* link, const char* text) { +void CSimpleHyperlinkedFrame::OnHyperlinkEnter(const char* a2, const char* a3) { if (this->m_onHyperlinkEnter.luaRef) { auto L = FrameScript_GetContext(); - lua_pushstring(L, link); - lua_pushstring(L, text); + lua_pushstring(L, a2); + lua_pushstring(L, a3); this->RunScript(this->m_onHyperlinkEnter, 2, 0); } diff --git a/src/ui/CSimpleMessageScrollFrame.cpp b/src/ui/CSimpleMessageScrollFrame.cpp index a52e01b..c8fd290 100644 --- a/src/ui/CSimpleMessageScrollFrame.cpp +++ b/src/ui/CSimpleMessageScrollFrame.cpp @@ -1,39 +1,4 @@ #include "ui/CSimpleMessageScrollFrame.hpp" -#include "ui/CSimpleMessageScrollFrameScript.hpp" -int32_t CSimpleMessageScrollFrame::s_metatable = 0; -int32_t CSimpleMessageScrollFrame::s_objectType = 0; - -void CSimpleMessageScrollFrame::CreateScriptMetaTable() { - lua_State* L = FrameScript_GetContext(); - int32_t ref = FrameScript_Object::CreateScriptMetaTable(L, &CSimpleMessageScrollFrame::RegisterScriptMethods); - CSimpleMessageScrollFrame::s_metatable = ref; -} - -int32_t CSimpleMessageScrollFrame::GetObjectType() { - if (!CSimpleMessageScrollFrame::s_objectType) { - CSimpleMessageScrollFrame::s_objectType = ++FrameScript_Object::s_objectTypes; - } - - return CSimpleMessageScrollFrame::s_objectType; -} - -void CSimpleMessageScrollFrame::RegisterScriptMethods(lua_State* L) { - CSimpleFrame::RegisterScriptMethods(L); - FrameScript_Object::FillScriptMethodTable(L, SimpleMessageScrollFrameMethods, NUM_SIMPLE_MESSAGE_SCROLL_FRAME_SCRIPT_METHODS); -} - -CSimpleMessageScrollFrame::CSimpleMessageScrollFrame(CSimpleFrame* parent) - : CSimpleHyperlinkedFrame(parent) { -} - -bool CSimpleMessageScrollFrame::IsA(int32_t type) { - return type == CSimpleMessageScrollFrame::s_objectType - || type == CSimpleFrame::s_objectType - || type == CScriptRegion::s_objectType - || type == CScriptObject::s_objectType; -} - -int32_t CSimpleMessageScrollFrame::GetScriptMetaTable() { - return CSimpleMessageScrollFrame::s_metatable; +CSimpleMessageScrollFrame::CSimpleMessageScrollFrame(CSimpleFrame* parent) : CSimpleHyperlinkedFrame(parent) { } diff --git a/src/ui/CSimpleMessageScrollFrame.hpp b/src/ui/CSimpleMessageScrollFrame.hpp index deadef1..5063fd5 100644 --- a/src/ui/CSimpleMessageScrollFrame.hpp +++ b/src/ui/CSimpleMessageScrollFrame.hpp @@ -5,21 +5,8 @@ class CSimpleMessageScrollFrame : public CSimpleHyperlinkedFrame { public: - // Static variables - static int32_t s_metatable; - static int32_t s_objectType; - - // Static functions - static void CreateScriptMetaTable(); - static int32_t GetObjectType(); - static void RegisterScriptMethods(lua_State* L); - // Member functions CSimpleMessageScrollFrame(CSimpleFrame* parent); - - // Virtual member functions - virtual bool IsA(int32_t type); - virtual int32_t GetScriptMetaTable(); }; #endif diff --git a/src/ui/CSimpleMessageScrollFrameScript.cpp b/src/ui/CSimpleMessageScrollFrameScript.cpp deleted file mode 100644 index f6791b1..0000000 --- a/src/ui/CSimpleMessageScrollFrameScript.cpp +++ /dev/null @@ -1,248 +0,0 @@ -#include "ui/CSimpleMessageScrollFrameScript.hpp" -#include "ui/CSimpleMessageScrollFrame.hpp" -#include "util/Lua.hpp" -#include "util/Unimplemented.hpp" - -static int32_t Script_SetFontObject(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_GetFontObject(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_SetFont(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_GetFont(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_SetTextColor(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_GetTextColor(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_SetShadowColor(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_GetShadowColor(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_SetShadowOffset(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_GetShadowOffset(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_SetSpacing(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_GetSpacing(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_SetJustifyH(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_GetJustifyH(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_SetJustifyV(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_GetJustifyV(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_AddMessage(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_GetMessageInfo(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_RemoveMessagesByAccessID(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_ScrollUp(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_ScrollDown(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_PageUp(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_PageDown(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_ScrollToTop(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_ScrollToBottom(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_SetScrollOffset(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_AtTop(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_AtBottom(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_UpdateColorByID(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_GetNumMessages(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_GetNumLinesDisplayed(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_GetCurrentScroll(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_GetCurrentLine(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_GetMaxLines(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_SetMaxLines(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_SetFading(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_GetFading(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_SetTimeVisible(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_GetTimeVisible(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_SetFadeDuration(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_GetFadeDuration(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_Clear(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_SetInsertMode(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_GetInsertMode(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_SetIndentedWordWrap(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_GetIndentedWordWrap(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_SetHyperlinksEnabled(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - -static int32_t Script_GetHyperlinksEnabled(lua_State* L) { - WHOA_UNIMPLEMENTED(0); -} - - -FrameScript_Method SimpleMessageScrollFrameMethods[NUM_SIMPLE_MESSAGE_SCROLL_FRAME_SCRIPT_METHODS] = { - { "SetFontObject", &Script_SetFontObject }, - { "GetFontObject", &Script_GetFontObject }, - { "SetFont", &Script_SetFont }, - { "GetFont", &Script_GetFont }, - { "SetTextColor", &Script_SetTextColor }, - { "GetTextColor", &Script_GetTextColor }, - { "SetShadowColor", &Script_SetShadowColor }, - { "GetShadowColor", &Script_GetShadowColor }, - { "SetShadowOffset", &Script_SetShadowOffset }, - { "GetShadowOffset", &Script_GetShadowOffset }, - { "SetSpacing", &Script_SetSpacing }, - { "GetSpacing", &Script_GetSpacing }, - { "SetJustifyH", &Script_SetJustifyH }, - { "GetJustifyH", &Script_GetJustifyH }, - { "SetJustifyV", &Script_SetJustifyV }, - { "GetJustifyV", &Script_GetJustifyV }, - { "AddMessage", &Script_AddMessage }, - { "GetMessageInfo", &Script_GetMessageInfo }, - { "RemoveMessagesByAccessID", &Script_RemoveMessagesByAccessID }, - { "ScrollUp", &Script_ScrollUp }, - { "ScrollDown", &Script_ScrollDown }, - { "PageUp", &Script_PageUp }, - { "PageDown", &Script_PageDown }, - { "ScrollToTop", &Script_ScrollToTop }, - { "ScrollToBottom", &Script_ScrollToBottom }, - { "SetScrollOffset", &Script_SetScrollOffset }, - { "AtTop", &Script_AtTop }, - { "AtBottom", &Script_AtBottom }, - { "UpdateColorByID", &Script_UpdateColorByID }, - { "GetNumMessages", &Script_GetNumMessages }, - { "GetNumLinesDisplayed", &Script_GetNumLinesDisplayed }, - { "GetCurrentScroll", &Script_GetCurrentScroll }, - { "GetCurrentLine", &Script_GetCurrentLine }, - { "GetMaxLines", &Script_GetMaxLines }, - { "SetMaxLines", &Script_SetMaxLines }, - { "SetFading", &Script_SetFading }, - { "GetFading", &Script_GetFading }, - { "SetTimeVisible", &Script_SetTimeVisible }, - { "GetTimeVisible", &Script_GetTimeVisible }, - { "SetFadeDuration", &Script_SetFadeDuration }, - { "GetFadeDuration", &Script_GetFadeDuration }, - { "Clear", &Script_Clear }, - { "SetInsertMode", &Script_SetInsertMode }, - { "GetInsertMode", &Script_GetInsertMode }, - { "SetIndentedWordWrap", &Script_SetIndentedWordWrap }, - { "GetIndentedWordWrap", &Script_GetIndentedWordWrap }, - { "SetHyperlinksEnabled", &Script_SetHyperlinksEnabled }, - { "GetHyperlinksEnabled", &Script_GetHyperlinksEnabled } -}; diff --git a/src/ui/CSimpleMessageScrollFrameScript.hpp b/src/ui/CSimpleMessageScrollFrameScript.hpp deleted file mode 100644 index 01181a1..0000000 --- a/src/ui/CSimpleMessageScrollFrameScript.hpp +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef UI_C_SIMPLE_MESSAGE_SCROLL_FRAME_SCRIPT_HPP -#define UI_C_SIMPLE_MESSAGE_SCROLL_FRAME_SCRIPT_HPP - -#include "ui/FrameScript.hpp" - -#define NUM_SIMPLE_MESSAGE_SCROLL_FRAME_SCRIPT_METHODS 48 - -extern FrameScript_Method SimpleMessageScrollFrameMethods[NUM_SIMPLE_MESSAGE_SCROLL_FRAME_SCRIPT_METHODS]; - -#endif diff --git a/src/ui/ScriptFunctions.cpp b/src/ui/ScriptFunctions.cpp index 56fda65..b5a3c2f 100644 --- a/src/ui/ScriptFunctions.cpp +++ b/src/ui/ScriptFunctions.cpp @@ -12,7 +12,6 @@ #include "ui/CSimpleScrollFrame.hpp" #include "ui/CSimpleSlider.hpp" #include "ui/CSimpleTexture.hpp" -#include "ui/CSimpleMessageScrollFrame.hpp" #include "ui/FrameScript.hpp" void CharacterCreateRegisterScriptFunctions() { @@ -80,7 +79,7 @@ void RegisterSimpleFrameScriptMethods() { // TODO // CSimpleMessageFrame::CreateScriptMetaTable(); - CSimpleMessageScrollFrame::CreateScriptMetaTable(); + // CSimpleMessageScrollFrame::CreateScriptMetaTable(); CSimpleModel::CreateScriptMetaTable(); CSimpleModelFFX::CreateScriptMetaTable();