diff --git a/Include/Game/Interactable/DecorativeObject.hpp b/Include/Game/Interactable/DecorativeObject.hpp index a590b71..71087fc 100644 --- a/Include/Game/Interactable/DecorativeObject.hpp +++ b/Include/Game/Interactable/DecorativeObject.hpp @@ -32,7 +32,7 @@ namespace Interactable bool Interact(const Button& B = BUTTON_LEFT) const; bool Interact(const std::string& Option) const; - bool Interact(const std::vector& Options) const; + bool Interact(const std::vector& Options, bool RequireAll = true) const; operator Internal::DecorativeObject() const; }; diff --git a/Include/Game/Interactable/GameObject.hpp b/Include/Game/Interactable/GameObject.hpp index 48beacd..990da59 100644 --- a/Include/Game/Interactable/GameObject.hpp +++ b/Include/Game/Interactable/GameObject.hpp @@ -32,7 +32,7 @@ namespace Interactable bool Interact(const Button& B = BUTTON_LEFT) const; bool Interact(const std::string& Option) const; - bool Interact(const std::vector& Options) const; + bool Interact(const std::vector& Options, bool RequireAll = true) const; operator Internal::GameObject() const; }; diff --git a/Include/Game/Interactable/GroundItem.hpp b/Include/Game/Interactable/GroundItem.hpp index c2328e9..7e0724c 100644 --- a/Include/Game/Interactable/GroundItem.hpp +++ b/Include/Game/Interactable/GroundItem.hpp @@ -34,7 +34,7 @@ namespace Interactable bool Interact(const Button& B = BUTTON_LEFT) const; bool Interact(const std::string& Option) const; - bool Interact(const std::vector& Options) const; + bool Interact(const std::vector& Options, bool RequireAll = true) const; operator Internal::GroundItem() const; }; diff --git a/Include/Game/Interactable/GroundObject.hpp b/Include/Game/Interactable/GroundObject.hpp index 99e576e..892fe24 100644 --- a/Include/Game/Interactable/GroundObject.hpp +++ b/Include/Game/Interactable/GroundObject.hpp @@ -32,7 +32,8 @@ namespace Interactable bool Interact(const Button& B = BUTTON_LEFT) const; bool Interact(const std::string& Option) const; - bool Interact(const std::vector& Options) const; + bool Interact(const std::vector& Options, bool RequireAll = true) const; + operator Internal::GroundObject() const; }; diff --git a/Include/Game/Interactable/NPC.hpp b/Include/Game/Interactable/NPC.hpp index 3dbfffa..f1f07e9 100644 --- a/Include/Game/Interactable/NPC.hpp +++ b/Include/Game/Interactable/NPC.hpp @@ -36,7 +36,7 @@ namespace Interactable bool Interact(const Button& B = BUTTON_LEFT) const; bool Interact(const std::string& Option) const; - bool Interact(const std::vector& Options) const; + bool Interact(const std::vector& Options, bool RequireAll = true) const; operator Internal::NPC() const; }; diff --git a/Include/Game/Interactable/Player.hpp b/Include/Game/Interactable/Player.hpp index bdee424..d261dbc 100644 --- a/Include/Game/Interactable/Player.hpp +++ b/Include/Game/Interactable/Player.hpp @@ -35,7 +35,7 @@ namespace Interactable bool Interact(const Button& B = BUTTON_LEFT) const; bool Interact(const std::string& Option) const; - bool Interact(const std::vector& Options) const; + bool Interact(const std::vector& Options, bool RequireAll = true) const; operator Internal::Player() const; }; diff --git a/Include/Game/Interactable/WallObject.hpp b/Include/Game/Interactable/WallObject.hpp index e64a07e..36038d2 100644 --- a/Include/Game/Interactable/WallObject.hpp +++ b/Include/Game/Interactable/WallObject.hpp @@ -32,7 +32,7 @@ namespace Interactable bool Interact(const Button& B = BUTTON_LEFT) const; bool Interact(const std::string& Option) const; - bool Interact(const std::vector& Options) const; + bool Interact(const std::vector& Options, bool RequireAll = true) const; operator Internal::WallObject() const; }; diff --git a/Include/Game/Interactable/Widget.hpp b/Include/Game/Interactable/Widget.hpp index 60a54d1..0216d61 100644 --- a/Include/Game/Interactable/Widget.hpp +++ b/Include/Game/Interactable/Widget.hpp @@ -19,6 +19,7 @@ namespace Interactable Widget(const Widget& W); bool IsHidden() const; + bool IsVisible() const; std::vector GetNormalizedItemIDs() const; Box GetBox() const; @@ -26,10 +27,10 @@ namespace Interactable bool Interact(const Button& B = BUTTON_LEFT) const; bool Interact(const std::string& Option) const; - bool Interact(const std::vector& Options) const; + bool Interact(const std::vector& Options, bool RequireAll = true) const; operator Internal::Widget() const; }; } -#endif // INTERACTABLEWIDGET_HPP_INCLUDED +#endif // INTERACTABLEWIDGET_HPP_INCLUDED diff --git a/Include/Game/Interfaces/Menu.hpp b/Include/Game/Interfaces/Menu.hpp index fb2127d..5297106 100644 --- a/Include/Game/Interfaces/Menu.hpp +++ b/Include/Game/Interfaces/Menu.hpp @@ -11,17 +11,17 @@ class Menu { public: - + /** * @brief Returns true if the right-click menu is open - * + * * @return true if the right-click menu is open */ static bool IsOpen(); /** * @brief Opens the menu by right-clicking wherever the mouse currently is - * + * * @return true if the menu is currently open or opened by right clicking * @return false if WaitFunc fails - WaitFunc(1000, 100, Menu::IsOpen, true); * @note Implements an %Interactable delay if succesful @@ -30,7 +30,7 @@ class Menu /** * @brief Closes the menu by moving the mouse to either left or right of the menu, uses the current mouse position as a base point - * + * * @return true if the menu isn't open, or closed by moving the mouse * @return false if the generated point is off-screen, or WaitFunc fails - WaitFunc(1000, 100, Menu::IsOpen, false); * @note Implements an %Interactable delay if succesful @@ -40,57 +40,57 @@ class Menu /** * @brief Get the number of menu options - * + * * @return the number of menu options */ static std::int32_t GetCount(); /** * @brief Get the raw, un-filtered menu actions - * + * * @description By default the game includes html code in menu actions/targets * This function returns those actions without the removal of the html code - * + * * @return std::vector */ static std::vector GetActionsRaw(); /** * @brief Get the raw, un-filtered menu targets - * + * * @description By default the game includes html code in menu actions/targets * This function returns those targets without the removal of the html code - * + * * @return std::vector */ static std::vector GetTargetsRaw(); /** * @brief Get the menu actions - * + * * @description Actions are almost always the very first word in a menu option * 'Use' - action 'gold bar' - target * 'Attack' - action 'Guard (level-21)' - target - * + * * @return std::vector array of menu actions */ static std::vector GetActions(); /** * @brief Get the menu targets - * + * * @description Targets are almost always everything after the action * 'Use' - action 'gold bar' - target * 'Attack' - action 'Guard (level-21)' - target - * + * * @return std::vector array of menu targets */ static std::vector GetTargets(); /** * @brief Get the menu options - * - * @description + * + * @description * 'Use' - action 'gold bar' - target * 'Attack' - action 'Guard (level-21)' - target * 'Use gold bar' - option @@ -102,18 +102,18 @@ class Menu /** * @brief Get the index of the found option - * + * * @description This function will find the first menu option containing the string 'Option' * This means passing 'Att' or 'Attack' will return the first found menu option containing 'Att' or 'Attack' * If you want to find a very specific menu option, the more the 'Option' string contains, the more specific it'll be - * + * * Say for example, you want to attack a guard whose level is 40, and on this one tile, there's 5 different guards, all with different levels * If you pass 'Attack' as the 'Option' to look for, it'll select the very first guard, regardless of level. * If you pass 'Attack Guard (level-40)' as the 'Option' to look for, it'll attack the guard whose level is 40. - * + * * @note Notice that 'Attack Guard (level-40)' has a double space after 'Guard', menu options can vary, in this case the menu option i'm looking for * has a double space after 'Guard'. - * + * * @param Option Menu option to look for, can be very specific, or very lenient * @return std::int32_t The index of the found option, -1 if an option wasn't found */ @@ -121,81 +121,81 @@ class Menu /** * @brief Get the index of the first found option - * - * @description This function will return the first found index, of the first found option. + * + * @description This function will return the first found index, of the first found option. * This function is just Menu::IndexOf(const std::string& Option), but instead of looking for one single option, this function can look for multiple - * + * * @param Options * @return std::int32_t The index of the first found option, -1 if an option wasn't found * @see Menu::IndexOf(const std::string& Option) */ - static std::int32_t IndexOf(const std::vector& Options); + static std::int32_t IndexOf(const std::vector& Options); /** * @brief Looks for a menu option at the passed index, and returns information about the found option - * + * * @param Index The index of the menu option to look at * @return std::tuple * std::int32_t [0] = Index of the option that was found (-1 if the option wasn't found) * std::string [1] = Action that was found at index * std::string [2] = Target that was found at index - * @see Menu::IndexOf(const std::string& Option) + * @see Menu::IndexOf(const std::string& Option) */ static std::tuple FindOption(std::uint32_t Index); /** * @brief Looks for a menu option containing the passed Option, and returns information about the found option - * + * * @param Option Menu option to look for, the more specific, the more accurate the result will be * @return std::tuple * std::int32_t [0] = Index of the option that was found (-1 if the option wasn't found) * std::string [1] = Action that was found * std::string [2] = Target that was found - * @see Menu::IndexOf(const std::string& Option) + * @see Menu::IndexOf(const std::string& Option) */ static std::tuple FindOption(const std::string& Option); /** * @brief Looks for a menu option containing the passed Option, and returns information about the found option - * + * * @param Options Menu options to look for, returns on first option found, the more specific, the more accurate the result will be * @return std::tuple * std::int32_t [0] = Index of the option that was found (-1 if the option wasn't found) * std::string [1] = Action that was found * std::string [2] = Target that was found - * @see Menu::IndexOf(const std::string& Option) + * @see Menu::IndexOf(const std::string& Option) */ - static std::tuple FindOption(const std::vector& Options); + static std::tuple FindOption(const std::vector& Options, bool RequireAll = true); /** * @brief Looks for a menu option containing the passed Option, and returns information of all options that were found - * + * * @param Option Menu option to look for, the more specific, the more accurate the result will be * @return std::vector> * std::int32_t [0] = Index of the option that was found (-1 if the option wasn't found) * std::string [1] = Action that was found * std::string [2] = Target that was found - * @see Menu::IndexOf(const std::string& Option) + * @see Menu::IndexOf(const std::string& Option) */ static std::vector> FindOptions(const std::string& Option); /** * @brief Looks for a menu option containing the passed Option, and returns information of all options that were found - * + * * @param Options Menu options to look for, returns on first option found, the more specific, the more accurate the result will be * @return std::vector> * std::int32_t [0] = Index of the option that was found (-1 if the option wasn't found) * std::string [1] = Action that was found * std::string [2] = Target that was found - * @see Menu::IndexOf(const std::string& Option) + * @see Menu::IndexOf(const std::string& Option) */ - static std::vector> FindOptions(const std::vector& Options); + static std::vector> FindOptions(const std::vector& Options, bool RequireAll = true); /** * @brief Returns true if the menu contains the passed Option - * + * * @param Option Menu option to look for, the more specific, the more accurate the result will be * @return true if the menu contains the passed Option * @see Menu::IndexOf(const std::string& Option) @@ -204,17 +204,17 @@ class Menu /** * @brief Returns true if the menu contains at least one of the passed Options - * + * * @param Options Menu options to check for, returns on first option found, the more specific, the more accurate the result will be * @return true if the menu contains at least one of the passed Options * @see Menu::IndexOf(const std::string& Option) */ - static bool Contains(const std::vector& Options); + static bool Contains(const std::vector& Options); /** * @brief Waits until the menu contains the passed option - * + * * @param Duration How long to wait until returning * @param Step How long to wait until it checks the menu options * @param Option Option to look for, the more specific, the more accurate the result will be @@ -225,7 +225,7 @@ class Menu /** * @brief Waits until the menu contains at leaset one of the passed options - * + * * @param Duration How long to wait until returning * @param Step How long to wait until it checks the menu options * @param Options Options to look for, returns on first option found, the more specific, the more accurate the result will be @@ -237,22 +237,22 @@ class Menu /** * @brief Selects the menu option by the passed index if the menu is open - * + * * @param Index The index of the option * @param CloseMenu Close the menu if the function fails by using Menu::Close(), true by default * @return true if the function selected the option by index - * @return false if the index was invalid, the option was off-screen, or the WaitFunc failed - WaitFunc(1000, 100, Menu::IsOpen, false) + * @return false if the index was invalid, the option was off-screen, or the WaitFunc failed - WaitFunc(1000, 100, Menu::IsOpen, false) * @note Implements an %Interactable delay if succesful */ static bool Select(std::int32_t Index, bool CloseMenu = true); /** * @brief Selects the passed menu option if the menu is open - * + * * @param Option Menu option to look for, the more specific, the more accurate the result will be * @param CloseMenu Close the menu if the function fails by using Menu::Close(), true by default * @return true if the function selected the option by option - * @return false if the menu isn't open, the found option was invalid, the option was off-screen, or the WaitFunc failed - WaitFunc(1000, 100, Menu::IsOpen, false) + * @return false if the menu isn't open, the found option was invalid, the option was off-screen, or the WaitFunc failed - WaitFunc(1000, 100, Menu::IsOpen, false) * @note Implements an %Interactable delay if succesful * @see Menu::IndexOf(const std::string& Option) */ @@ -260,11 +260,11 @@ class Menu /** * @brief Selects the first found option in the menu - * + * * @param Options String array of menu options to look for, returns on first option found, the more specific, the more accurate the result will be * @param CloseMenu Close the menu if the function fails using Menu::Close(), true by default - * @return true if the function selected the option by the first found option - * @return false if the menu isn't open, the found option was invalid, the option was off-screen, or the WaitFunc failed - WaitFunc(1000, 100, Menu::IsOpen, false) + * @return true if the function selected the option by the first found option + * @return false if the menu isn't open, the found option was invalid, the option was off-screen, or the WaitFunc failed - WaitFunc(1000, 100, Menu::IsOpen, false) * @note Implements an %Interactable delay if succesful */ static bool Select(const std::vector& Options, bool CloseMenu = true); @@ -272,14 +272,14 @@ class Menu /** * @brief Get the array of menu option boxes, each box is a menu option - * + * * @return std::vector array of menu option boxes, menu must be open */ static std::vector GetOptionBoxes(); /** * @brief Get the full menu box - * + * * @return Box of the full menu, menu must be open */ static Box GetBox(); diff --git a/Library/libAlpacaLibrary.a b/Library/libAlpacaLibrary.a index 715f75b..07594e7 100644 Binary files a/Library/libAlpacaLibrary.a and b/Library/libAlpacaLibrary.a differ