Release 1.20

master
Kasi 2019-01-29 20:07:44 +00:00
parent eb328838ff
commit 9cb796bc6c
18 changed files with 132 additions and 16 deletions

View File

@ -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);

View File

@ -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<Box> GetBlockingWidgetBoxes();
double GetHealthPercentage(const Internal::Character& C);
std::vector<Widget> GetWidgets(std::int32_t Container);

View File

@ -26,6 +26,10 @@ class Area
std::int32_t GetPlane() const;
std::vector<Tile> 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();
};

View File

@ -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;
};

View File

@ -11,6 +11,7 @@
#include "../../Core/Input.hpp"
#include "../../Game/Tools/Camera.hpp"
#include <cstdint>
#include <functional>
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<std::string>& Options, bool CheckTarget = true) const;
bool Interact(const std::function<bool (const std::vector<Point>&)>& InteractMethod) const;
};
}

View File

@ -11,6 +11,7 @@
#include "../../Core/Input.hpp"
#include "../../Game/Tools/Camera.hpp"
#include <cstdint>
#include <functional>
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<std::string>& Options, bool CheckTarget = true) const;
bool Interact(const std::function<bool (const std::vector<Point>&)>& InteractMethod) const;
};
}

View File

@ -11,6 +11,7 @@
#include "../../Core/Input.hpp"
#include "../../Game/Tools/Camera.hpp"
#include <cstdint>
#include <functional>
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<std::string>& Options, bool CheckTarget = true) const;
bool Interact(const std::function<bool (const std::vector<Point>&)>& InteractMethod) const;
};
}

View File

@ -11,6 +11,7 @@
#include "../../Core/Input.hpp"
#include "../../Game/Tools/Camera.hpp"
#include <cstdint>
#include <functional>
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<std::string>& Options, bool CheckTarget = true) const;
bool Interact(const std::function<bool (const std::vector<Point>&)>& InteractMethod) const;
};
}

View File

@ -8,6 +8,7 @@
#include "../../Core/Types/Convex.hpp"
#include "../../Core/Input.hpp"
#include <cstdint>
#include <functional>
namespace Interactable
{
@ -26,7 +27,7 @@ namespace Interactable
Item(const Interactable::Item& Item);
bool Exists() const;
static bool ItemsExist(const std::vector<Interactable::Item>& 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<std::string>& Options, bool CheckTarget = false) const;
bool Interact(const std::function<bool (const Convex&)>& InteractMethod) const;
bool Valid() const;
operator bool() const;

View File

@ -11,6 +11,7 @@
#include "../../Core/Input.hpp"
#include "../../Game/Tools/Camera.hpp"
#include <cstdint>
#include <functional>
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<std::string>& Options, bool CheckTarget = true) const;
bool Interact(const std::function<bool (const std::vector<Point>&)>& InteractMethod) const;
};
}

View File

@ -11,6 +11,7 @@
#include "../../Core/Input.hpp"
#include "../../Game/Tools/Camera.hpp"
#include <cstdint>
#include <functional>
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<std::string>& Options, bool CheckTarget = true) const;
bool Interact(const std::function<bool (const std::vector<Point>&)>& InteractMethod) const;
};
}

View File

@ -11,6 +11,7 @@
#include "../../Core/Input.hpp"
#include "../../Game/Tools/Camera.hpp"
#include <cstdint>
#include <functional>
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<std::string>& Options, bool CheckTarget = true) const;
bool Interact(const std::function<bool (const std::vector<Point>&)>& InteractMethod) const;
};
}

View File

@ -9,6 +9,7 @@
#include "../../Core/Types/Convex.hpp"
#include "../../Core/Input.hpp"
#include <cstdint>
#include <functional>
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<std::string>& Options) const;
bool Interact(const std::function<bool (const Box&)>& InteractMethod) const;
};
}

View File

@ -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);

View File

@ -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);
/**

View File

@ -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<std::string>& 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<std::string>& 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<std::string>& 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<std::string>& 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<std::string>& 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<Box> GetBlockingWidgetBoxes();
}
/** @} */

View File

@ -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<std::string> 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<std::string> 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

Binary file not shown.