diff --git a/Include/Core/Debug.hpp b/Include/Core/Debug.hpp index 65435be..6744bf2 100644 --- a/Include/Core/Debug.hpp +++ b/Include/Core/Debug.hpp @@ -3,6 +3,10 @@ #include "../../Include/Core/Types/Logger.hpp" +#ifndef VERBOSE_LOG_MACRO +#define VERBOSE Debug::Verbose << __PRETTY_FUNCTION__ << " > " +#endif // VERBOSE_LOG_MACRO + class Debug { public: diff --git a/Include/Game/Interfaces/GameTabs/Inventory.hpp b/Include/Game/Interfaces/GameTabs/Inventory.hpp index 31b8601..4e35049 100644 --- a/Include/Game/Interfaces/GameTabs/Inventory.hpp +++ b/Include/Game/Interfaces/GameTabs/Inventory.hpp @@ -78,6 +78,8 @@ class Inventory static bool InteractItemByIndex(std::int32_t Index, const std::vector& Options); static bool InteractItem(std::int32_t ID, const std::string& Option); static bool InteractItem(const std::string& Name, const std::string& Option); + static bool InteractItem(std::int32_t ID, const std::vector& Options); + static bool InteractItem(const std::string& Name, const std::vector& Options); static bool InteractItem(const std::vector& IDs, const std::vector& Options); //Interacts with first found ID static bool InteractItem(const std::vector& Names, const std::vector& Options); //Interacts with first found Name diff --git a/Include/Game/Interfaces/Mainscreen.hpp b/Include/Game/Interfaces/Mainscreen.hpp index bce265a..5504cb7 100644 --- a/Include/Game/Interfaces/Mainscreen.hpp +++ b/Include/Game/Interfaces/Mainscreen.hpp @@ -42,14 +42,6 @@ class Mainscreen static bool IsUpText(const std::vector& UpTexts); static bool WaitIsUpText(std::uint32_t Duration, std::uint32_t Step, const std::string& UpText); static bool WaitUpTextContains(std::uint32_t Duration, std::uint32_t Step, const std::string& UpText); - - static std::int32_t GetCameraX(); - static std::int32_t GetCameraY(); - static std::int32_t GetCameraZ(); - static std::int32_t GetCameraPitch(); - static std::int32_t GetCameraYaw(); - - static bool SetCameraPitch(std::int32_t Pitch); }; /** @} */ diff --git a/Include/Game/Interfaces/Minimap.hpp b/Include/Game/Interfaces/Minimap.hpp index 3d02195..fc177cc 100644 --- a/Include/Game/Interfaces/Minimap.hpp +++ b/Include/Game/Interfaces/Minimap.hpp @@ -11,24 +11,53 @@ class Minimap { public: + /** + * @brief Returns the middle point of the minimap + * + * @return the middle point of the minimap + */ static Point GetMiddle(); - static Tile GetPosition(); - + /** + * @brief Returns the plane the local player is on + * + * @return the plane the local player is on + */ static std::int32_t GetPlane(); - static std::int32_t GetPositionX(); - static std::int32_t GetPositionY(); - + /** + * @brief Returns the tile the local player is on + * + * @return the tile the local player is on + */ + static Tile GetPosition(); + /** + * @brief Returns the tile of the local players destination + * + * @return the tile of the local players destination + */ static Tile GetDestination(); - static std::int32_t GetDestinationX(); - static std::int32_t GetDestinationY(); - static bool CloseTo(Tile T, std::int32_t Distance); - static bool TileOnMM(Tile T); + /** + * @brief Returns true if the local players position is close to the passed tile, uses pixels as distance + * + * @param T tile to check + * @param Distance in pixels + * @return true if the local players position is close to the passed tile + */ + static bool IsCloseTo(const Tile& T, std::int32_t Distance); + /** + * @brief Returns true if the passed tile is on the minimap + * + * @param T tile to check + * @return true if the passed tile is on the minimap + */ + static bool IsTileOn(const Tile& T); - static double GetCompassAngle(); - // Angle - Calculates the angle you the tile to be in relation to your player, 0 = north, 90 = east, 180 = south, 270 = west - static void RotateTo(const Tile& T, std::int32_t Angle = 0); - static void RotateCompass(std::int32_t Degrees); + /** + * @brief Clicks on the minimap compass to quickly face North + * + * @return true if the function succesfully clicks the compass, and the camera angle is 0 / North + */ + static bool ClickCompass(); // Clicks north }; /** @} */ diff --git a/Include/Game/Models/NPCs.hpp b/Include/Game/Models/NPCs.hpp index ab260be..45e536a 100644 --- a/Include/Game/Models/NPCs.hpp +++ b/Include/Game/Models/NPCs.hpp @@ -20,7 +20,7 @@ class NPCs static std::vector GetAll(const std::string& Name); static std::vector GetAll(const std::vector& IDs); static std::vector GetAll(const std::vector& Names); - static std::vector GetAll(const std::function& Filter); + static std::vector GetAll(const std::function& Filter); static Interactable::NPC Get(); static Interactable::NPC Get(const Tile& Tile); @@ -28,7 +28,7 @@ class NPCs static Interactable::NPC Get(const std::string& Name); static Interactable::NPC Get(const std::vector& IDs); static Interactable::NPC Get(const std::vector& Names); - static Interactable::NPC Get(const std::function& Filter); + static Interactable::NPC Get(const std::function& Filter); }; /** @} */ diff --git a/Include/Game/Tools/Camera.hpp b/Include/Game/Tools/Camera.hpp new file mode 100644 index 0000000..adba630 --- /dev/null +++ b/Include/Game/Tools/Camera.hpp @@ -0,0 +1,116 @@ +#ifndef CAMERA_HPP_INCLUDED +#define CAMERA_HPP_INCLUDED + +#include "../../Core/Types/Tile.hpp" +#include + +/** @addtogroup Tools +* @{ */ + +class Camera +{ + public: + + typedef enum COMPASS_DIRECTION + { + NORTH = 0, + EAST = 90, + SOUTH = 180, + WEST = 270 + } COMPASS_DIRECTION; + + typedef enum CAMERA_PITCH + { + LOWEST = 128, + MIDDLE = 191, + HIGHEST = 383 + } CAMERA_PITCH; + + /** + * @brief Returns the cameras X + * + * @return Camera X + */ + static std::int32_t GetX(); + /** + * @brief Returns the cameras Z + * + * @return Camera Z + */ + static std::int32_t GetY(); + /** + * @brief Returns the cameras Z + * + * @return Camera Z + */ + static std::int32_t GetZ(); + /** + * @brief Returns the cameras Yaw + * + * @return Camera Yaw + */ + static std::int32_t GetYaw(); + + /** + * @brief Returns the camera/compass angle in degrees + * + * @return the camera/compass angle in degrees + */ + static double GetAngle(); + /** + * @brief Returns the camera pitch + * + * @return the camera pitch + */ + static std::int32_t GetPitch(); + + /** + * @brief Rotates the camera to the passed angle/degree + * + * @param Angle or degree + * @return true if it rotates within (+/-) 10 of the passed angle + */ + static bool RotateTo(std::int32_t Angle); + /** + * @brief Rotates the camera to the passed direction (Camera::NORTH/EAST/SOUTH/WEST) + * + * @param Direction Camera::NORTH / EAST / SOUTH / WEST + * @return true if it rotates within (+/-) 10 of the passed direction + */ + static bool RotateTo(COMPASS_DIRECTION Direction); + /** + * @brief Rotates the camera to the passed tile, with an optional desired Angle + * + * @param T tile to rotate to + * @param Angle optional desired angle of where the tile should be in relation to the player, defaulted to 0 or North + * @return true if it rotates within (+/-) 10 of the passed tile and angle + */ + static bool RotateTo(const Tile& T, std::int32_t Angle = 0); + /** + * @brief Rotates the camera to the passed tile, with an optional desired direction + * + * @param T tile to rotate to + * @param Direction optional desired angle of where the tile should be in relation to the player (NORTH/EAST/SOUTH/WEST), defaulted to North + * @return true if it rotates within (+/-) 10 of the passed tile and direction + */ + static bool RotateTo(const Tile& T, COMPASS_DIRECTION Direction = NORTH); + + /** + * @brief Sets the pitch of the camera + * + * @param Pitch desired pitch + * @return true if the camera sets the pitch (+/-) 10 of the passed pitch + */ + static bool SetPitch(std::int32_t Pitch); + /** + * @brief Sets the pitch of the camera + * + * @param Pitch desired pitch (Camera::LOWEST/MIDDLE/HIGHEST) + * @return true if the camera sets the pitch (+/-) 10 of the passed pitch + */ + static bool SetPitch(CAMERA_PITCH Pitch); +}; + +/** @} */ + +#endif // CAMERA_HPP_INCLUDED diff --git a/Include/Game/Tools/Tools.hpp b/Include/Game/Tools/Tools.hpp deleted file mode 100644 index 4223831..0000000 --- a/Include/Game/Tools/Tools.hpp +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef TOOLS_HPP_INCLUDED -#define TOOLS_HPP_INCLUDED - -#include "../../Core/Classes/ItemInfo.hpp" -#include "../../Core/Classes/ItemContainer.hpp" -#include -#include - -/** @addtogroup Tools -* @{ */ -class Tools -{ - public: - - -}; - -/** @} */ - -#endif // TOOLS_HPP_INCLUDED diff --git a/Library/libAlpacaLibrary.a b/Library/libAlpacaLibrary.a index a2570d5..23a53eb 100644 Binary files a/Library/libAlpacaLibrary.a and b/Library/libAlpacaLibrary.a differ