2017-12-25 23:49:48 +00:00
|
|
|
#ifndef MAINSCREEN_HPP_INCLUDED
|
|
|
|
#define MAINSCREEN_HPP_INCLUDED
|
|
|
|
|
|
|
|
#include "../../Core/Types/Box.hpp"
|
2018-10-04 07:21:36 +00:00
|
|
|
#include "../../Core/Types/Tile.hpp"
|
2017-12-25 23:49:48 +00:00
|
|
|
#include "../../Core/Classes/Character.hpp"
|
|
|
|
#include <cstdint>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2020-02-15 04:24:58 +00:00
|
|
|
#include <functional>
|
2017-12-25 23:49:48 +00:00
|
|
|
|
2019-01-29 20:07:44 +00:00
|
|
|
/**
|
|
|
|
* @brief A namespace containing various functions related to the Mainscreen
|
|
|
|
*/
|
2018-12-27 18:17:09 +00:00
|
|
|
namespace Mainscreen
|
2017-12-25 23:49:48 +00:00
|
|
|
{
|
2018-12-27 18:17:09 +00:00
|
|
|
typedef enum SCREEN_STATE
|
|
|
|
{
|
|
|
|
LOGIN_SCREEN,
|
|
|
|
LOBBY_SCREEN,
|
|
|
|
CONNECTING,
|
|
|
|
LOADING,
|
|
|
|
HOPPING,
|
|
|
|
PLAYING
|
|
|
|
} SCREEN_STATE;
|
|
|
|
|
|
|
|
typedef enum CROSSHAIR_STATE
|
|
|
|
{
|
|
|
|
NONE,
|
|
|
|
YELLOW,
|
|
|
|
RED
|
|
|
|
} CROSSHAIR_STATE;
|
|
|
|
|
2019-01-29 20:07:44 +00:00
|
|
|
/**
|
|
|
|
* @brief Returns the current SCREEN_STATE
|
|
|
|
* @return The current SCREEN_STATE
|
|
|
|
*/
|
2018-12-27 18:17:09 +00:00
|
|
|
Mainscreen::SCREEN_STATE GetState();
|
2019-01-29 20:07:44 +00:00
|
|
|
/**
|
|
|
|
* @brief Returns the current CROSSHAIR_STATE
|
|
|
|
* @return The current CROSSHAIR_STATE
|
|
|
|
*/
|
2018-12-27 18:17:09 +00:00
|
|
|
Mainscreen::CROSSHAIR_STATE GetCrosshairState();
|
|
|
|
|
2019-01-29 20:07:44 +00:00
|
|
|
/**
|
|
|
|
* @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
|
|
|
|
*/
|
2018-12-27 18:17:09 +00:00
|
|
|
bool IsLoggedIn();
|
2019-01-29 20:07:44 +00:00
|
|
|
/**
|
|
|
|
* @brief Returns true if the player is moving
|
|
|
|
* @return True if the player is moving
|
|
|
|
* @details P.GetPoseAnimationID() != P.GetSubPoseAnimationID()
|
|
|
|
*/
|
2018-12-27 18:17:09 +00:00
|
|
|
bool IsMoving();
|
2019-01-29 20:07:44 +00:00
|
|
|
/**
|
|
|
|
* @brief Returns true if the player is animating
|
|
|
|
* @return True if the player is animating
|
|
|
|
* @details P.GetAnimationID() != -1
|
|
|
|
*/
|
2018-12-27 18:17:09 +00:00
|
|
|
bool IsAnimating();
|
|
|
|
|
2019-01-29 20:07:44 +00:00
|
|
|
/**
|
|
|
|
* @brief Returns The %mainscreen uptext found in the top left-hand corner
|
|
|
|
* @return The %mainscreen uptext found in the top left-hand corner
|
|
|
|
*/
|
2018-12-27 18:17:09 +00:00
|
|
|
std::string GetUpText();
|
2019-01-29 20:07:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @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
|
|
|
|
*/
|
2018-12-27 18:17:09 +00:00
|
|
|
bool IsUpText(const std::string& UpText);
|
2019-01-29 20:07:44 +00:00
|
|
|
/**
|
|
|
|
* @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
|
|
|
|
*/
|
2018-12-27 18:17:09 +00:00
|
|
|
bool IsUpText(const std::vector<std::string>& UpTexts);
|
2019-01-29 20:07:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @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
|
|
|
|
*/
|
2018-12-27 18:17:09 +00:00
|
|
|
bool WaitIsUpText(std::uint32_t Duration, std::uint32_t Step, const std::string& UpText);
|
2019-01-29 20:07:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Waits until the %mainscreen uptext contains the passed string
|
|
|
|
* @see UpTextContains
|
|
|
|
* @see WaitFunc
|
|
|
|
*/
|
2018-12-27 18:17:09 +00:00
|
|
|
bool WaitUpTextContains(std::uint32_t Duration, std::uint32_t Step, const std::string& UpText);
|
2019-01-29 20:07:44 +00:00
|
|
|
/**
|
|
|
|
* @brief Waits until the %mainscreen uptext contains any of the passed strings
|
|
|
|
* @see UpTextContains
|
|
|
|
* @see WaitFunc
|
|
|
|
*/
|
2018-12-27 18:17:09 +00:00
|
|
|
bool WaitUpTextContains(std::uint32_t Duration, std::uint32_t Step, const std::vector<std::string>& UpTexts);
|
2019-01-29 20:07:44 +00:00
|
|
|
|
2020-02-15 04:24:58 +00:00
|
|
|
bool IsTileOn(const Tile& T);
|
|
|
|
|
2019-01-29 20:07:44 +00:00
|
|
|
/**
|
|
|
|
* @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
|
|
|
|
*/
|
2018-12-27 18:17:09 +00:00
|
|
|
bool ClickTile(const Tile& T);
|
2019-01-29 20:07:44 +00:00
|
|
|
|
2020-02-15 04:24:58 +00:00
|
|
|
bool WalkPath(const std::vector<Tile>& Path, std::int32_t Distance, std::function<bool()> Func);
|
|
|
|
|
|
|
|
bool WalkPath(const std::vector<Tile>& Path, std::int32_t Distance);
|
|
|
|
|
2019-01-29 20:07:44 +00:00
|
|
|
std::vector<Box> GetBlockingWidgetBoxes();
|
2018-12-31 21:52:58 +00:00
|
|
|
}
|
2017-12-25 23:49:48 +00:00
|
|
|
|
|
|
|
#endif // MAINSCREEN_HPP_INCLUDED
|