From ba06643d4112726bf1360d45e402fe3f0c9adadc Mon Sep 17 00:00:00 2001 From: Kasi Date: Thu, 7 Jun 2018 04:43:38 +0100 Subject: [PATCH] Release 0.54 --- Include/Core/Debug.hpp | 4 + .../Game/Interfaces/GameTabs/Inventory.hpp | 2 + Include/Game/Interfaces/Mainscreen.hpp | 8 -- Include/Game/Interfaces/Minimap.hpp | 55 +++++++-- Include/Game/Models/NPCs.hpp | 4 +- Include/Game/Tools/Camera.hpp | 116 ++++++++++++++++++ Include/Game/Tools/Tools.hpp | 20 --- Library/libAlpacaLibrary.a | Bin 4696676 -> 4696676 bytes 8 files changed, 166 insertions(+), 43 deletions(-) create mode 100644 Include/Game/Tools/Camera.hpp delete mode 100644 Include/Game/Tools/Tools.hpp 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 a2570d5cb77fcd4dc245432a2a633c2f07326b35..23a53ebd3f420d781efabdb1914534604a4a0dea 100644 GIT binary patch delta 2948 zcmY*b4Nw%<9lt%O_s!kG9lLv|z#hV$^_GwO@Gb%ZDkQCw(>U0X&|qR49iqS`QQK5e zNY4}N2W=%Ulc7=ujp;~Y5aB6FnUZ>BLY$6GVoOr|1gg_Xn$TEd4YYmxcHeS$Gr!yS z|GnS;|K7g;|Gj-vpPW!nA+%>`0);-Wr@-67MK~(LsUuucgiDTa--&Pw1~^T0-vUuk z$dnl<9LvBo)>_e*JPbs1Y$NJ^Q>`mym-c@#eo z(+JZK7+u9ggPGd*j3&7pWX*v|;|6*DGIQT-n)4=jS=N}Y%0(9T*jcFFVmc)kj31Pz zS{N8RZmN;^I6V z4hVMHCiK!gmWz3zVS9^h^>*+ze9pEnOS({B0vLZdn0$DQ;AU0kp?UZ>yJNVYlVcEBTV(aZ9s z`38V>GzG2AHM&FI(E-pM%4gxBFX#`nlF!rq0t=h&({4GN0sMK03^9=*HZtTG7|OVD zghUgoG&*=R17RV;A~<+-u}0~|yZ*C`%s*~O&<{0cMu!@+5VGM=Blq=T(u-?kY?fOS zl4jD_>32Z)TIZGTOLkW%-x1At)rpXUumonjnmem_Tklk|(7z<~^-eqfs7c`(-~tfcmUmImQ*$_=hG z2(9YYZ^5I}JO_3)3Qtil0jh`30`4hZOI-%Xx_K6aruZe)AHdTh|HCFhP=_CaTa9_; z;7?7$HEJ3ZT;lft{(0eG`DZGXsuaPdx`Y065EiJCDV55LTL#q1#jP~d@}ZVZ^$2SD zacdW9mBE?kg`cUZFX4`z!d|Klb*QvSD%EB5q*PfdwW_YJ?!_(7))h?44C+Kbr}R*X z52@)vk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