diff --git a/Include/Core/Input.hpp b/Include/Core/Input.hpp index f81d956..9b579f1 100644 --- a/Include/Core/Input.hpp +++ b/Include/Core/Input.hpp @@ -55,7 +55,7 @@ void ScrollUp(); void ScrollDown(); void MouseDown(std::int32_t B); void MouseUp(std::int32_t B); -void MouseMove(Point P); +void MouseMove(const Point& P); void MouseMove(std::int32_t X, std::int32_t Y); void KeyDown(std::int32_t K); void KeyUp(std::int32_t K); diff --git a/Include/Core/Internal.hpp b/Include/Core/Internal.hpp index 0754767..5187a7a 100644 --- a/Include/Core/Internal.hpp +++ b/Include/Core/Internal.hpp @@ -267,7 +267,6 @@ namespace Internal std::string GetItemName(std::int32_t ID); bool IsItemPlaceholder(std::int32_t ID); bool IsItemStackable(std::int32_t ID); - std::vector GetBlockingWidgetBoxes(); double GetHealthPercentage(const Internal::Character& C); std::vector GetWidgets(std::int32_t Container); diff --git a/Include/Core/Types/Area.hpp b/Include/Core/Types/Area.hpp index a2054b6..4df7468 100644 --- a/Include/Core/Types/Area.hpp +++ b/Include/Core/Types/Area.hpp @@ -26,6 +26,10 @@ class Area std::int32_t GetPlane() const; std::vector GetVertices() const; + Tile GetHybridRandomTile(double ProbabilityX, double ProbabilityY, double StandardDeviationX, double StandardDeviationY, double PointGenAccuracy) const; + Tile GetProfileHybridRandomTile() const; + Tile GetProfileHybridRandomTile(double PointGenAccuracy) const; + friend std::ostream& operator<<(std::ostream& OS, const Area& A); ~Area(); }; diff --git a/Include/Core/Types/Triangle.hpp b/Include/Core/Types/Triangle.hpp index 4c291b0..cff7215 100644 --- a/Include/Core/Types/Triangle.hpp +++ b/Include/Core/Types/Triangle.hpp @@ -16,6 +16,7 @@ class Triangle Triangle(const Point& A, const Point& B, const Point& C); ~Triangle(); + Point GetCentroid() const; bool Contains(const Point& P) const; }; diff --git a/Include/Game/Interactable/DecorativeObject.hpp b/Include/Game/Interactable/DecorativeObject.hpp index a51b2c4..6055f30 100644 --- a/Include/Game/Interactable/DecorativeObject.hpp +++ b/Include/Game/Interactable/DecorativeObject.hpp @@ -11,6 +11,7 @@ #include "../../Core/Input.hpp" #include "../../Game/Tools/Camera.hpp" #include +#include namespace Interactable { @@ -48,6 +49,7 @@ namespace Interactable bool Interact(const Button& B = BUTTON_LEFT) const; bool Interact(const std::string& Option, bool CheckTarget = true) const; bool Interact(const std::vector& Options, bool CheckTarget = true) const; + bool Interact(const std::function&)>& InteractMethod) const; }; } diff --git a/Include/Game/Interactable/GameObject.hpp b/Include/Game/Interactable/GameObject.hpp index acd840a..2167640 100644 --- a/Include/Game/Interactable/GameObject.hpp +++ b/Include/Game/Interactable/GameObject.hpp @@ -11,6 +11,7 @@ #include "../../Core/Input.hpp" #include "../../Game/Tools/Camera.hpp" #include +#include namespace Interactable { @@ -50,6 +51,7 @@ namespace Interactable bool Interact(const Button& B = BUTTON_LEFT) const; bool Interact(const std::string& Option, bool CheckTarget = true) const; bool Interact(const std::vector& Options, bool CheckTarget = true) const; + bool Interact(const std::function&)>& InteractMethod) const; }; } diff --git a/Include/Game/Interactable/GroundItem.hpp b/Include/Game/Interactable/GroundItem.hpp index 764d306..87cb9df 100644 --- a/Include/Game/Interactable/GroundItem.hpp +++ b/Include/Game/Interactable/GroundItem.hpp @@ -11,6 +11,7 @@ #include "../../Core/Input.hpp" #include "../../Game/Tools/Camera.hpp" #include +#include namespace Interactable { @@ -51,6 +52,7 @@ namespace Interactable bool Interact(const Button& B = BUTTON_LEFT) const; bool Interact(const std::string& Option, bool CheckTarget = true) const; bool Interact(const std::vector& Options, bool CheckTarget = true) const; + bool Interact(const std::function&)>& InteractMethod) const; }; } diff --git a/Include/Game/Interactable/GroundObject.hpp b/Include/Game/Interactable/GroundObject.hpp index 5d29681..9336130 100644 --- a/Include/Game/Interactable/GroundObject.hpp +++ b/Include/Game/Interactable/GroundObject.hpp @@ -11,6 +11,7 @@ #include "../../Core/Input.hpp" #include "../../Game/Tools/Camera.hpp" #include +#include namespace Interactable { @@ -48,6 +49,7 @@ namespace Interactable bool Interact(const Button& B = BUTTON_LEFT) const; bool Interact(const std::string& Option, bool CheckTarget = true) const; bool Interact(const std::vector& Options, bool CheckTarget = true) const; + bool Interact(const std::function&)>& InteractMethod) const; }; } diff --git a/Include/Game/Interactable/Item.hpp b/Include/Game/Interactable/Item.hpp index 0d2d45c..4b7ff45 100644 --- a/Include/Game/Interactable/Item.hpp +++ b/Include/Game/Interactable/Item.hpp @@ -8,6 +8,7 @@ #include "../../Core/Types/Convex.hpp" #include "../../Core/Input.hpp" #include +#include namespace Interactable { @@ -26,7 +27,7 @@ namespace Interactable Item(const Interactable::Item& Item); bool Exists() const; - static bool ItemsExist(const std::vector& Items); + bool IsInterfaceOpen() const; bool OpenInterface() const; @@ -47,6 +48,7 @@ namespace Interactable bool Interact(const Button& B = BUTTON_LEFT) const; bool Interact(const std::string& Option, bool CheckTarget = false) const; bool Interact(const std::vector& Options, bool CheckTarget = false) const; + bool Interact(const std::function& InteractMethod) const; bool Valid() const; operator bool() const; diff --git a/Include/Game/Interactable/NPC.hpp b/Include/Game/Interactable/NPC.hpp index fd781aa..9755eda 100644 --- a/Include/Game/Interactable/NPC.hpp +++ b/Include/Game/Interactable/NPC.hpp @@ -11,6 +11,7 @@ #include "../../Core/Input.hpp" #include "../../Game/Tools/Camera.hpp" #include +#include namespace Interactable { @@ -52,6 +53,7 @@ namespace Interactable bool Interact(const Button& B = BUTTON_LEFT) const; bool Interact(const std::string& Option, bool CheckTarget = true) const; bool Interact(const std::vector& Options, bool CheckTarget = true) const; + bool Interact(const std::function&)>& InteractMethod) const; }; } diff --git a/Include/Game/Interactable/Player.hpp b/Include/Game/Interactable/Player.hpp index e4e0e07..9ce9e7a 100644 --- a/Include/Game/Interactable/Player.hpp +++ b/Include/Game/Interactable/Player.hpp @@ -11,6 +11,7 @@ #include "../../Core/Input.hpp" #include "../../Game/Tools/Camera.hpp" #include +#include namespace Interactable { @@ -51,6 +52,7 @@ namespace Interactable bool Interact(const Button& B = BUTTON_LEFT) const; bool Interact(const std::string& Option, bool CheckTarget = true) const; bool Interact(const std::vector& Options, bool CheckTarget = true) const; + bool Interact(const std::function&)>& InteractMethod) const; }; } diff --git a/Include/Game/Interactable/WallObject.hpp b/Include/Game/Interactable/WallObject.hpp index 35ed67f..040d884 100644 --- a/Include/Game/Interactable/WallObject.hpp +++ b/Include/Game/Interactable/WallObject.hpp @@ -11,6 +11,7 @@ #include "../../Core/Input.hpp" #include "../../Game/Tools/Camera.hpp" #include +#include namespace Interactable { @@ -48,6 +49,7 @@ namespace Interactable bool Interact(const Button& B = BUTTON_LEFT) const; bool Interact(const std::string& Option, bool CheckTarget = true) const; bool Interact(const std::vector& Options, bool CheckTarget = true) const; + bool Interact(const std::function&)>& InteractMethod) const; }; } diff --git a/Include/Game/Interactable/Widget.hpp b/Include/Game/Interactable/Widget.hpp index 4b17754..4fef868 100644 --- a/Include/Game/Interactable/Widget.hpp +++ b/Include/Game/Interactable/Widget.hpp @@ -9,6 +9,7 @@ #include "../../Core/Types/Convex.hpp" #include "../../Core/Input.hpp" #include +#include namespace Interactable { @@ -35,6 +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::function& InteractMethod) const; }; } diff --git a/Include/Game/Interfaces/GameTabs/Logout.hpp b/Include/Game/Interfaces/GameTabs/Logout.hpp index 2d5d949..0d9b31e 100644 --- a/Include/Game/Interfaces/GameTabs/Logout.hpp +++ b/Include/Game/Interfaces/GameTabs/Logout.hpp @@ -21,8 +21,8 @@ namespace Logout bool WorldSwitcherScrollTo(const Internal::World& World); bool WorldSwitcherScrollTo(std::int32_t WorldID); - bool SwitchWorld(const Internal::World& World, bool AllowPVPWorlds = false, bool SetOnlyWarnAboutDangerousWorlds = false); // SetOnlyWarnAboutFutureWorlds will click "Yes. In future, only warn about dangerous worlds." instead of just "yes" - bool SwitchWorld(std::int32_t WorldID, bool AllowPVPWorlds = false, bool SetOnlyWarnAboutDangerousWorlds = false); // SetOnlyWarnAboutFutureWorlds will click "Yes. In future, only warn about dangerous worlds." instead of just "yes" + bool SwitchWorld(const Internal::World& World); + bool SwitchWorld(std::int32_t WorldID); Interactable::Widget GetWorldWidget(const Internal::World& World); Interactable::Widget GetWorldWidget(std::int32_t WorldID); diff --git a/Include/Game/Interfaces/Login.hpp b/Include/Game/Interfaces/Login.hpp index 3da0587..2631324 100644 --- a/Include/Game/Interfaces/Login.hpp +++ b/Include/Game/Interfaces/Login.hpp @@ -42,7 +42,7 @@ namespace Login bool CloseWorldSelect(); bool SelectWorld(); - bool SelectWorld(Internal::World World); + bool SelectWorld(const Internal::World& World); bool SelectWorld(std::int32_t WorldID); /** diff --git a/Include/Game/Interfaces/Mainscreen.hpp b/Include/Game/Interfaces/Mainscreen.hpp index cbedf1a..03808b5 100644 --- a/Include/Game/Interfaces/Mainscreen.hpp +++ b/Include/Game/Interfaces/Mainscreen.hpp @@ -10,6 +10,9 @@ /** @addtogroup Interfaces * @{ */ +/** +* @brief A namespace containing various functions related to the Mainscreen +*/ namespace Mainscreen { typedef enum SCREEN_STATE @@ -29,22 +32,119 @@ namespace Mainscreen RED } CROSSHAIR_STATE; + /** + * @brief Returns the current SCREEN_STATE + * @return The current SCREEN_STATE + */ Mainscreen::SCREEN_STATE GetState(); + /** + * @brief Returns the current CROSSHAIR_STATE + * @return The current CROSSHAIR_STATE + */ Mainscreen::CROSSHAIR_STATE GetCrosshairState(); + /** + * @brief Returns true if the Mainscreen SCREEN_STATE is PLAYING, LOADING, or HOPPING + * @return True if the Mainscreen SCREEN_STATE is PLAYING, LOADING, or HOPPING + */ bool IsLoggedIn(); + /** + * @brief Returns true if the player is moving + * @return True if the player is moving + * @details P.GetPoseAnimationID() != P.GetSubPoseAnimationID() + */ bool IsMoving(); + /** + * @brief Returns true if the player is animating + * @return True if the player is animating + * @details P.GetAnimationID() != -1 + */ bool IsAnimating(); + /** + * @brief Returns The %mainscreen uptext found in the top left-hand corner + * @return The %mainscreen uptext found in the top left-hand corner + */ std::string GetUpText(); - bool UpTextContains(const std::string& UpText); - bool UpTextContains(const std::vector& UpTexts); + + /** + * @brief Returns true if the %mainscreen uptext is equal to the passed string + * @param UpText String to compare + * @return True if the %mainscreen uptext is equal to the passed string + */ bool IsUpText(const std::string& UpText); + /** + * @brief Returns true if the %mainscreen uptext is equal to any of the passed strings + * @param UpTexts Strings to compare + * @return True if the %mainscreen uptext is equal to any of the passed strings + */ bool IsUpText(const std::vector& UpTexts); + + /** + * @brief Returns true if the %mainscreen uptext contains the passed string + * @param UpText String to check + * @return True if the %mainscreen uptext contains the passed string + */ + bool UpTextContains(const std::string& UpText); + /** + * @brief Returns true if the %mainscreen uptext contains any of the passed strings + * @param UpTexts Strings to check + * @return True if the %mainscreen uptext contains any of the passed strings + */ + bool UpTextContains(const std::vector& UpTexts); + + /** + * @brief Extended function of UpTextContains + * @description + * This function will loop over (CheckTime) milliseconds, if the passed string isn't found within the uptext + * it will go into a nested loop over (FailCheckTime) milliseconds, if the passed string still isn't found within the 'Fail' loop + * the function will exit (false) + * @param UpText String to check + * @param CheckTime The passed string must be found in the mainscreen uptext for this long, to return true + * @param FailCheckTime If the passed string isn't found within the mainscreen uptext, + * this is how long it will continue to try and find the passed string in the mainscreen uptext before returning false + */ + bool UpTextContains(const std::string& UpText, std::uint32_t CheckTime, std::uint32_t FailCheckTime); + /** + * @brief Extended function of UpTextContains + * @description + * This function will loop over (CheckTime) milliseconds, if one of the passed strings isn't found within the uptext + * it will go into a nested loop over (FailCheckTime) milliseconds, if one of the passed strings isn't still isn't found within the 'Fail' loop + * the function will exit (false) + * @param UpText String to check + * @param CheckTime The passed string must be found in the mainscreen uptext for this long, to return true + * @param FailCheckTime If the passed string isn't found within the mainscreen uptext, + * this is how long it will continue to try and find the passed string in the mainscreen uptext before returning false + */ + bool UpTextContains(const std::vector& UpTexts, std::uint32_t CheckTime, std::uint32_t FailCheckTime); + + /** + * @brief Waits until the %mainscreen uptext is equal to the passed string + * @see WaitFunc + */ bool WaitIsUpText(std::uint32_t Duration, std::uint32_t Step, const std::string& UpText); + + /** + * @brief Waits until the %mainscreen uptext contains the passed string + * @see UpTextContains + * @see WaitFunc + */ bool WaitUpTextContains(std::uint32_t Duration, std::uint32_t Step, const std::string& UpText); + /** + * @brief Waits until the %mainscreen uptext contains any of the passed strings + * @see UpTextContains + * @see WaitFunc + */ bool WaitUpTextContains(std::uint32_t Duration, std::uint32_t Step, const std::vector& UpTexts); + + /** + * @brief Clicks on a tile on the %mainscreen + * @return True if the tile was clicked + * @return False if the distance from the tile is >= 8; !(Minimap::GetPosition().DistanceFrom(T) < 8) or it fails to click + */ bool ClickTile(const Tile& T); + + std::vector GetBlockingWidgetBoxes(); } /** @} */ diff --git a/Include/Game/Interfaces/Menu.hpp b/Include/Game/Interfaces/Menu.hpp index fc51e28..8be0616 100644 --- a/Include/Game/Interfaces/Menu.hpp +++ b/Include/Game/Interfaces/Menu.hpp @@ -9,20 +9,18 @@ /** @addtogroup Interfaces * @{ */ /** -* @brief A class containing various functions for the right-click menu +* @brief A namespace containing various functions for the right-click menu */ namespace Menu { /** * @brief Returns true if the right-click menu is open - * * @return true if the right-click menu is open */ 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 @@ -31,7 +29,6 @@ namespace 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 @@ -41,7 +38,6 @@ namespace Menu /** * @brief Get the number of menu options - * * @return the number of menu options * @note The menu does not need to be open for this to be accurate */ @@ -49,7 +45,6 @@ namespace Menu /** * @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 of raw menu actions @@ -59,7 +54,6 @@ namespace Menu /** * @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 of targets @@ -127,7 +121,7 @@ namespace Menu * @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 looks for multiple * - * @param %Options %Menu options to look for, returns on first option found, the more specific the options, the more accurate the result will be + * @param Options %Menu options to look for, returns on first option found, the more specific the options, the more accurate the result will be * @return std::int32_t The index of the first found option, -1 if the option wasn't found * @see Menu::IndexOf(const std::string& Option) * @warning The result can be inaccurate if the menu isn't open before calling this function diff --git a/Library/libAlpacaLibrary.a b/Library/libAlpacaLibrary.a index b3cc4e8..cf738d9 100644 Binary files a/Library/libAlpacaLibrary.a and b/Library/libAlpacaLibrary.a differ