diff --git a/Include/Core/Classes/Widget.hpp b/Include/Core/Classes/Widget.hpp index fe80154..53f0f49 100644 --- a/Include/Core/Classes/Widget.hpp +++ b/Include/Core/Classes/Widget.hpp @@ -27,6 +27,7 @@ namespace Internal std::int32_t GetBoxIndex() const; std::vector GetChildren() const; Widget GetChildren(std::int32_t I) const; + bool GetHasListener() const; std::int32_t GetHeight() const; bool GetHidden() const; std::int32_t GetID() const; diff --git a/Include/Core/Globals.hpp b/Include/Core/Globals.hpp index a658f8f..0adb2f2 100644 --- a/Include/Core/Globals.hpp +++ b/Include/Core/Globals.hpp @@ -81,34 +81,7 @@ namespace Globals // grandchild 0 = proper widget bounds, grandchild 1 = text //************ Chat.cpp ************// - typedef struct ChatDialogWidgetDef - { - std::int32_t Parent = -1; - std::int32_t TitleChild = -1; - std::int32_t ContinueChild = -1; - std::int32_t ContentChild = -1; - } ChatDialogWidgetDef; - - typedef struct SpriteChatDialogWidgetDef - { - std::int32_t Parent = -1; - std::int32_t SpriteChild = -1; - std::int32_t ContentChild = -1; - std::int32_t OptionsContainerChild = -1; // Options are found via grandchildren of this widget - std::int32_t OptionsContainerChildStart = -1; // Child to add an Index to (193, 0, 2 + Index) - } SpriteChatDialogWidgetDef; - - const ChatDialogWidgetDef CHAT_NPC_CHAT_WIDGETS = { 231, 2, 3, 4 }; // Appears when a NPC is talking (NPC head is visible in dialogue) - const ChatDialogWidgetDef CHAT_PLAYER_CHAT_WIDGETS = { 217, 2, 3, 4 }; // Appears when a Player is talking (Player head is visible in dialogue) - const SpriteChatDialogWidgetDef CHAT_SPRITE_WIDGETS = { 193, 1, 2, 0, 2 }; // Appears when a sprite is shown, mainly quest dialogues - const ChatDialogWidgetDef CHAT_LEVEL_UP_CHAT_WIDGETS = { 233, 1, 3, 2 }; // Appears when leveling up - const ChatDialogWidgetDef CHAT_BANK_PIN_ERROR_WIDGETS = { 229, 1, 2 }; // Appears when entering the bank pin wrong - - const WidgetDef CHAT_SELECT_OPTION_CONTAINER = { 219, 1 }; // Container for all Select Option options - const WidgetDef CHAT_SELECT_OPTION_TITLE = { CHAT_SELECT_OPTION_CONTAINER.Parent, CHAT_SELECT_OPTION_CONTAINER.Child, 0 }; - - const WidgetDef CHAT_ENTER_AMOUNT_TITLE = { 162, 44 }; - const WidgetDef CHAT_ENTER_AMOUNT = { 162, 45 }; // Input widget (* when blank) + const WidgetDef CHAT_DIALOGUE_NEST_PARENT = { 162, 37 }; //************ DepositBox.cpp ************// const std::int32_t DEPOSIT_BOX_PARENT = 192; diff --git a/Include/Game/Interactable/Widget.hpp b/Include/Game/Interactable/Widget.hpp index cb7e671..db3b615 100644 --- a/Include/Game/Interactable/Widget.hpp +++ b/Include/Game/Interactable/Widget.hpp @@ -27,6 +27,9 @@ namespace Interactable bool IsHidden() const; bool IsVisible() const; std::vector GetInteractableChildren() const; + std::vector GetDynamicInteractableChildren() const; + std::vector GetStaticInteractableChildren() const; + std::vector GetNestedInteractableChildren() const; std::vector GetNormalizedItemIDs() const; Box GetBox() const; diff --git a/Include/Game/Interfaces/Chat.hpp b/Include/Game/Interfaces/Chat.hpp index 0b82d88..7a795d3 100644 --- a/Include/Game/Interfaces/Chat.hpp +++ b/Include/Game/Interfaces/Chat.hpp @@ -2,6 +2,7 @@ #define CHAT_HPP_INCLUDED #include "../../Core/Classes/MessageNode.hpp" +#include "../../Game/Interactable/Widget.hpp" #include #include #include @@ -16,7 +17,7 @@ namespace Chat PLEASE_WAIT, ENTER_AMOUNT, LEVEL_UP, - SPRITE_SELECT_OPTION + PLEASE_WAIT_TIMED } DIALOGUE_STATE; typedef enum CHAT_TYPE @@ -84,22 +85,19 @@ namespace Chat Internal::MessageNode GetLastMessage(); Internal::MessageNode GetLastMessage(CHAT_TYPE Type); + std::vector GetDialogueWidgets(); DIALOGUE_STATE GetDialogueState(); std::vector GetDialogueOptions(); - std::string GetDialogueTitle(); - std::string GetDialogueContent(); - std::int32_t GetDialogueOptionIndexOf(const std::string& Option); - std::int32_t GetDialogueOptionIndexOf(const std::vector& Options); + bool WaitDialogueState(std::uint32_t Duration, std::uint32_t Step, Chat::DIALOGUE_STATE State, bool Result = true); // Waits until the current chat state equals State + + bool DialogueContains(const std::string& Text); + bool DialogueContains(const std::vector& Texts); bool ClickContinue(bool UseKeyboard = false); bool EnterAmount(std::int32_t Amount); - - bool SelectDialogueOption(std::int32_t Index, bool UseKeyboard = false); // Index starts at 0 bool SelectDialogueOption(const std::string& Option, bool UseKeyboard = false); bool SelectDialogueOption(const std::vector& Options, bool UseKeyboard = false); - - bool WaitDialogueState(std::uint32_t Duration, std::uint32_t Step, Chat::DIALOGUE_STATE State, bool Result = true); // Waits until the current chat state equals State } #endif // CHAT_HPP_INCLUDED diff --git a/Include/Game/Interfaces/Menu.hpp b/Include/Game/Interfaces/Menu.hpp index 1a25862..c23862b 100644 --- a/Include/Game/Interfaces/Menu.hpp +++ b/Include/Game/Interfaces/Menu.hpp @@ -39,24 +39,6 @@ namespace Menu */ std::int32_t GetCount(); - /** - * @brief Get the raw, un-filtered menu actions - * @return std::vector of raw menu actions - * @note The game includes color code in some menu actions or targets - * @warning The result can be inaccurate if the menu isn't open before calling this function - */ - [[deprecated("Use Internal::GetMenuActions() instead")]] - std::vector GetActionsRaw(); - - /** - * @brief Get the raw, un-touched menu targets - * @return std::vector of targets - * @note The game includes color code in some menu actions or targets - * @warning The result can be inaccurate if the menu isn't open before calling this function - */ - [[deprecated("Use Internal::GetMenuTargets() instead")]] - std::vector GetTargetsRaw(); - /** * @brief Attempts to verify the order of the passed menu actions and targets * @return true if the passed menu actions and targets are in the correct order diff --git a/Library/libAlpacaLibrary.a b/Library/libAlpacaLibrary.a index fba3103..ab720a5 100644 Binary files a/Library/libAlpacaLibrary.a and b/Library/libAlpacaLibrary.a differ