Release 0.46

master
Kasi 2018-05-15 04:41:51 +01:00
parent 1659c0768b
commit cb9d8090d9
13 changed files with 95 additions and 74 deletions

View File

@ -22,17 +22,19 @@ namespace Interactable
std::string GetName() const;
Internal::ObjectInfo GetInfo() const;
std::vector<Point> GetModel() const;
Convex GetConvex() const;
Box GetBox() const;
Point GetPoint() const;
Convex GetConvex() const;
std::vector<Point> GetModel() const;
double GetVisibility() const;
Tile GetTile() const;
// Angle - Calculates the angle you the tile to be in relation to your player, 0 = north, 90 = east, 180 = south, 270 = west
void RotateTo(std::int32_t Angle = 0) const;
bool Interact(const Button& B = BUTTON_LEFT) const;
bool Interact(const std::string& Option) const;
bool Interact(const std::vector<std::string>& Options, bool RequireAllOptions = false) const;
bool Interact(const std::vector<std::string>& Options) const;
operator Internal::DecorativeObject() const;
};

View File

@ -22,17 +22,19 @@ namespace Interactable
std::string GetName() const;
Internal::ObjectInfo GetInfo() const;
std::vector<Point> GetModel() const;
Convex GetConvex() const;
Box GetBox() const;
Point GetPoint() const;
Convex GetConvex() const;
std::vector<Point> GetModel() const;
double GetVisibility() const;
Tile GetTile() const;
// Angle - Calculates the angle you the tile to be in relation to your player, 0 = north, 90 = east, 180 = south, 270 = west
void RotateTo(std::int32_t Angle = 0) const;
bool Interact(const Button& B = BUTTON_LEFT) const;
bool Interact(const std::string& Option) const;
bool Interact(const std::vector<std::string>& Options, bool RequireAllOptions = false) const;
bool Interact(const std::vector<std::string>& Options) const;
operator Internal::GameObject() const;
};

View File

@ -24,17 +24,20 @@ namespace Interactable
std::string GetName() const;
Internal::ItemInfo GetInfo() const;
std::vector<Point> GetModel() const;
Convex GetConvex() const;
Box GetBox() const;
Point GetPoint() const;
Convex GetConvex() const;
std::vector<Point> GetModel() const;
double GetVisibility() const;
Tile GetTile() const;
Tile GetLocalTile() const;
// Angle - Calculates the angle you the tile to be in relation to your player, 0 = north, 90 = east, 180 = south, 270 = west
void RotateTo(std::int32_t Angle = 0) const;
bool Interact(const Button& B = BUTTON_LEFT) const;
bool Interact(const std::string& Option) const;
bool Interact(const std::vector<std::string>& Options, bool RequireAllOptions = false) const;
bool Interact(const std::vector<std::string>& Options) const;
operator Internal::GroundItem() const;
};

View File

@ -22,17 +22,19 @@ namespace Interactable
std::string GetName() const;
Internal::ObjectInfo GetInfo() const;
std::vector<Point> GetModel() const;
Convex GetConvex() const;
Box GetBox() const;
Point GetPoint() const;
Convex GetConvex() const;
std::vector<Point> GetModel() const;
double GetVisibility() const;
Tile GetTile() const;
// Angle - Calculates the angle you the tile to be in relation to your player, 0 = north, 90 = east, 180 = south, 270 = west
void RotateTo(std::int32_t Angle = 0) const;
bool Interact(const Button& B = BUTTON_LEFT) const;
bool Interact(const std::string& Option) const;
bool Interact(const std::vector<std::string>& Options, bool RequireAllOptions = false) const;
bool Interact(const std::vector<std::string>& Options) const;
operator Internal::GroundObject() const;

View File

@ -22,13 +22,15 @@ namespace Interactable
std::string GetName() const;
Internal::NPCInfo GetInfo() const;
std::vector<Point> GetModel() const;
Convex GetConvex() const;
Box GetBox() const;
Point GetPoint() const;
Convex GetConvex() const;
std::vector<Point> GetModel() const;
double GetVisibility() const;
Tile GetTile() const;
// Angle - Calculates the angle you the tile to be in relation to your player, 0 = north, 90 = east, 180 = south, 270 = west
void RotateTo(std::int32_t Angle = 0) const;
Internal::Character GetInteracting() const;
bool Interacting() const;
@ -36,7 +38,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, bool RequireAllOptions = false) const;
bool Interact(const std::vector<std::string>& Options) const;
operator Internal::NPC() const;
};

View File

@ -21,13 +21,15 @@ namespace Interactable
std::string GetName() const;
Internal::PlayerInfo GetInfo() const;
std::vector<Point> GetModel() const;
Convex GetConvex() const;
Box GetBox() const;
Point GetPoint() const;
Convex GetConvex() const;
std::vector<Point> GetModel() const;
double GetVisibility() const;
Tile GetTile() const;
// Angle - Calculates the angle you the tile to be in relation to your player, 0 = north, 90 = east, 180 = south, 270 = west
void RotateTo(std::int32_t Angle = 0) const;
Internal::Character GetInteracting() const;
bool Interacting() const;
@ -35,7 +37,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, bool RequireAllOptions = false) const;
bool Interact(const std::vector<std::string>& Options) const;
operator Internal::Player() const;
};

View File

@ -22,17 +22,19 @@ namespace Interactable
std::string GetName() const;
Internal::ObjectInfo GetInfo() const;
std::vector<Point> GetModel() const;
Convex GetConvex() const;
Box GetBox() const;
Point GetPoint() const;
Convex GetConvex() const;
std::vector<Point> GetModel() const;
double GetVisibility() const;
Tile GetTile() const;
// Angle - Calculates the angle you the tile to be in relation to your player, 0 = north, 90 = east, 180 = south, 270 = west
void RotateTo(std::int32_t Angle = 0) const;
bool Interact(const Button& B = BUTTON_LEFT) const;
bool Interact(const std::string& Option) const;
bool Interact(const std::vector<std::string>& Options, bool RequireAllOptions = false) const;
bool Interact(const std::vector<std::string>& Options) const;
operator Internal::WallObject() const;
};

View File

@ -27,7 +27,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, bool RequireAllOptions = false) const;
bool Interact(const std::vector<std::string>& Options) const;
operator Internal::Widget() const;
};

View File

@ -75,11 +75,11 @@ class Inventory
static bool ContainsOnly(const std::vector<std::string>& Names);
static bool InteractItemByIndex(std::int32_t Index, const std::string& Option);
static bool InteractItemByIndex(std::int32_t Index, const std::vector<std::string>& Options, bool RequireAllOptions = false);
static bool InteractItemByIndex(std::int32_t Index, const std::vector<std::string>& 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(const std::vector<std::int32_t>& IDs, const std::vector<std::string>& Options, bool RequireAllOptions = false); //Interacts with first found ID
static bool InteractItem(const std::vector<std::string>& Names, const std::vector<std::string>& Options, bool RequireAllOptions = false); //Interacts with first found Name
static bool InteractItem(const std::vector<std::int32_t>& IDs, const std::vector<std::string>& Options); //Interacts with first found ID
static bool InteractItem(const std::vector<std::string>& Names, const std::vector<std::string>& Options); //Interacts with first found Name
static bool DropItemByIndex(std::int32_t Index, bool AllowShiftClick = true);
static bool DropItem(std::int32_t ID, bool AllowShiftClick = true);

View File

@ -8,6 +8,9 @@
/** @addtogroup Interfaces
* @{ */
/**
* @brief A class containing various functions for the right-click menu
*/
class Menu
{
public:
@ -42,6 +45,7 @@ class 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
*/
static std::int32_t GetCount();
@ -50,8 +54,8 @@ class Menu
*
* @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>
* @return std::vector<std::string> of raw menu actions
* @note The result can be inaccurate if the menu isn't open before calling this function
*/
static std::vector<std::string> GetActionsRaw();
@ -60,8 +64,8 @@ class Menu
*
* @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>
* @return std::vector<std::string> of targets
* @note The result can be inaccurate if the menu isn't open before calling this function
*/
static std::vector<std::string> GetTargetsRaw();
@ -71,8 +75,8 @@ class Menu
* @description Actions are almost always the very first word in a menu option
* 'Use' - action 'gold bar' - target
* 'Attack' - action 'Guard (level-21)' - target
*
* @return std::vector<std::string> array of menu actions
* @note The result can be inaccurate if the menu isn't open before calling this function
*/
static std::vector<std::string> GetActions();
@ -82,8 +86,8 @@ class Menu
* @description Targets are almost always everything after the action
* 'Use' - action 'gold bar' - target
* 'Attack' - action 'Guard (level-21)' - target
*
* @return std::vector<std::string> array of menu targets
* @note The result can be inaccurate if the menu isn't open before calling this function
*/
static std::vector<std::string> GetTargets();
@ -96,6 +100,7 @@ class Menu
* 'Use gold bar' - option
* 'Attack Guard (level-21)' - option
* @return std::vector<std::string> array of menu options
* @note The result can be inaccurate if the menu isn't open before calling this function
*/
static std::vector<std::string> GetOptions();
@ -110,12 +115,10 @@ class Menu
* Say for example, you want to attack a guard whose level is 40, and on this one tile, there's 5 different guards, all with different levels
* If you pass 'Attack' as the 'Option' to look for, it'll select the very first guard, regardless of level.
* If you pass 'Attack Guard (level-40)' as the 'Option' to look for, it'll attack the guard whose level is 40.
*
* @param Option %Menu option to look for, can be very specific, or very lenient
* @return std::int32_t The index of the first found option, -1 if the menu isn't open, or the option wasn't found
* @note Notice that 'Attack Guard (level-40)' has a double space after 'Guard', menu options can vary, in this case the menu option i'm looking for
* has a double space after 'Guard'.
*
* @param Option Menu option to look for, can be very specific, or very lenient
* @return std::int32_t The index of the found option, -1 if an option wasn't found
*/
static std::int32_t IndexOf(const std::string& Option);
@ -123,10 +126,10 @@ class Menu
* @brief Get the index of the first found option
*
* @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 can look for multiple
* 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
* @return std::int32_t The index of the first found option, -1 if an option wasn't found
* @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 menu isn't open, or the option wasn't found
* @see Menu::IndexOf(const std::string& Option)
*/
static std::int32_t IndexOf(const std::vector<std::string>& Options);
@ -137,7 +140,7 @@ class Menu
*
* @param Index The index of the menu option to look at
* @return std::tuple<bool, std::string, std::string>
* std::int32_t [0] = Index of the option that was found (-1 if the option wasn't found)
* std::int32_t [0] = Index of the option that was found, -1 if the menu isn't open, or the option wasn't found
* std::string [1] = Action that was found at index
* std::string [2] = Target that was found at index
* @see Menu::IndexOf(const std::string& Option)
@ -147,9 +150,9 @@ class Menu
/**
* @brief Looks for a menu option containing the passed Option, and returns information about the found option
*
* @param Option Menu option to look for, the more specific, the more accurate the result will be
* @param Option %Menu option to look for, the more specific, the more accurate the result will be
* @return std::tuple<bool, std::string, std::string>
* std::int32_t [0] = Index of the option that was found (-1 if the option wasn't found)
* std::int32_t [0] = Index of the option that was found, -1 if the menu isn't open, or the option wasn't found
* std::string [1] = Action that was found
* std::string [2] = Target that was found
* @see Menu::IndexOf(const std::string& Option)
@ -159,21 +162,21 @@ class Menu
/**
* @brief Looks for a menu option containing the passed Option, and returns information about the found option
*
* @param Options Menu options to look for, returns on first option found, if using RequireAllOptions, returns only if all options are found. The more specific, 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::tuple<bool, std::string, std::string>
* std::int32_t [0] = Index of the option that was found (-1 if the option wasn't found)
* std::int32_t [0] = Index of the option that was found, -1 if the menu isn't open, or the option wasn't found
* std::string [1] = Action that was found
* std::string [2] = Target that was found
* @see Menu::IndexOf(const std::string& Option)
* @see Menu::IndexOf(const std::string& Options)
*/
static std::tuple<std::int32_t, std::string, std::string> FindOption(const std::vector<std::string>& Options, bool RequireAllOptions = false);
static std::tuple<std::int32_t, std::string, std::string> FindOption(const std::vector<std::string>& Options);
/**
* @brief Looks for a menu option containing the passed Option, and returns information of all options that were found
*
* @param Option Menu option to look for, the more specific, the more accurate the result will be
* @param Option %Menu option to look for, the more specific the option, the more accurate the result will be
* @return std::vector<std::tuple<std::int32_t, std::string, std::string>>
* std::int32_t [0] = Index of the option that was found (-1 if the option wasn't found)
* std::int32_t [0] = Index of the option that was found, -1 if the menu isn't open, or the option wasn't found
* std::string [1] = Action that was found
* std::string [2] = Target that was found
* @see Menu::IndexOf(const std::string& Option)
@ -183,21 +186,21 @@ class Menu
/**
* @brief Looks for a menu option containing the passed Option, and returns information of all options that were found
*
* @param Options Menu options to look for, returns on first option found, if using RequireAllOptions, returns only if all options are found. The more specific, the more accurate the result will be
* @param %Options %Menu options to look for, if the option is found within the menu options, it'll be added to the result array, the more specific the options, the more accurate the result will be
* @return std::vector<std::tuple<std::int32_t, std::string, std::string>>
* std::int32_t [0] = Index of the option that was found (-1 if the option wasn't found)
* std::int32_t [0] = Index of the option that was found, -1 if the menu isn't open, or the option wasn't found
* std::string [1] = Action that was found
* std::string [2] = Target that was found
* @see Menu::IndexOf(const std::string& Option)
* @see Menu::IndexOf(const std::string& Options)
*/
static std::vector<std::tuple<std::int32_t, std::string, std::string>> FindOptions(const std::vector<std::string>& Options, bool RequireAllOptions = true);
static std::vector<std::tuple<std::int32_t, std::string, std::string>> FindOptions(const std::vector<std::string>& Options);
/**
* @brief Returns true if the menu contains the passed Option
*
* @param Option Menu option to look for, the more specific, the more accurate the result will be
* @return true if the menu contains the passed Option
* @param Option %Menu option to look for, the more specific the option, the more specific the option, the more accurate the result will be
* @return true if the found index is valid (Index >= 0)
* @see Menu::IndexOf(const std::string& Option)
*/
static bool Contains(const std::string& Option);
@ -205,9 +208,9 @@ class Menu
/**
* @brief Returns true if the menu contains at least one of the passed Options
*
* @param Options Menu options to check for, returns on first option found, the more specific, the more accurate the result will be
* @return true if the menu contains at least one of the passed Options
* @see Menu::IndexOf(const std::string& Option)
* @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 true if the found index is valid (Index >= 0)
* @see Menu::IndexOf(const std::string& Options)
*/
static bool Contains(const std::vector<std::string>& Options);
@ -217,9 +220,10 @@ class Menu
*
* @param Duration How long to wait until returning
* @param Step How long to wait until it checks the menu options
* @param Option Option to look for, the more specific, the more accurate the result will be
* @return true if the option was found
* @return false if the function doesn't find the passed option after running for Duration
* @param Option %Menu option to look for, the more specific the option, the more accurate the result will be
* @return true if the found index is valid (Index >= 0)
* @see Menu::IndexOf(const std::string& Option)
* @see Menu::Contains(const std::string& Option)
*/
static bool WaitContains(std::uint32_t Duration, std::uint32_t Step, const std::string& Option);
@ -228,9 +232,10 @@ class Menu
*
* @param Duration How long to wait until returning
* @param Step How long to wait until it checks the menu options
* @param Options Options to look for, returns on first option found, the more specific, the more accurate the result will be
* @return true if at least one of the options was found
* @return false if the function doesn't find at least one of the passed options after running for Duration
* @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 true if the found index is valid (Index >= 0)
* @see Menu::IndexOf(const std::string& Options)
* @see Menu::Contains(const std::string& Options)
*/
static bool WaitContains(std::uint32_t Duration, std::uint32_t Step, const std::vector<std::string>& Options);
@ -241,7 +246,7 @@ class Menu
* @param Index The index of the option
* @param CloseMenu Close the menu if the function fails by using Menu::Close(), true by default
* @return true if the function selected the option by index
* @return false if the index was invalid, the option was off-screen, or the WaitFunc failed - WaitFunc(1000, 100, Menu::IsOpen, false)
* @return false if the menu isn't open, the passed index is invalid (-1), the option box is off-screen, or the WaitFunc failed - WaitFunc(1000, 100, Menu::IsOpen, false)
* @note Implements an %Interactable delay if succesful
*/
static bool Select(std::int32_t Index, bool CloseMenu = true);
@ -249,10 +254,10 @@ class Menu
/**
* @brief Selects the passed menu option if the menu is open
*
* @param Option Menu option to look for, the more specific, the more accurate the result will be
* @param Option %Menu option to look for, the more specific the option, the more accurate the result will be
* @param CloseMenu Close the menu if the function fails by using Menu::Close(), true by default
* @return true if the function selected the option by option
* @return false if the menu isn't open, the found option was invalid, the option was off-screen, or the WaitFunc failed - WaitFunc(1000, 100, Menu::IsOpen, false)
* @return false if the menu isn't open, the found option was invalid, the option box is off-screen, or the WaitFunc failed - WaitFunc(1000, 100, Menu::IsOpen, false)
* @note Implements an %Interactable delay if succesful
* @see Menu::IndexOf(const std::string& Option)
*/
@ -261,26 +266,25 @@ class Menu
/**
* @brief Selects the first found option in the menu
*
* @param Options String array of menu options to look for, returns on first option found, the more specific, the more accurate the result will be
* @param %Options %Menu options to look for, uses the first option found, the more specific the options, the more accurate the result will be
* @param CloseMenu Close the menu if the function fails using Menu::Close(), true by default
* @return true if the function selected the option by the first found option
* @return false if the menu isn't open, the found option was invalid, the option was off-screen, or the WaitFunc failed - WaitFunc(1000, 100, Menu::IsOpen, false)
* @return false if the menu isn't open, the found option was invalid, the option box is off-screen, or the WaitFunc failed - WaitFunc(1000, 100, Menu::IsOpen, false)
* @note Implements an %Interactable delay if succesful
* @see Menu::IndexOf(const std::string& Options)
*/
static bool Select(const std::vector<std::string>& Options, bool CloseMenu = true);
/**
* @brief Get the array of menu option boxes, each box is a menu option
*
* @return std::vector<Box> array of menu option boxes, menu must be open
* @return std::vector<Box> array of the menu option boxes, returns an empty array if the menu isn't open
*/
static std::vector<Box> GetOptionBoxes();
/**
* @brief Get the full menu box
*
* @return Box of the full menu, menu must be open
* @return Box representing the full menu, returns a null box if the menu isn't open
*/
static Box GetBox();
};

View File

@ -26,6 +26,8 @@ class Minimap
static bool TileOnMM(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);
};

View File

@ -20,15 +20,15 @@ class Interact
static bool Click(const Point& P, const Button& B = BUTTON_LEFT);
static bool Click(const Point& P, const std::string& Option);
static bool Click(const Point& P, const std::vector<std::string>& Options, bool RequireAllOptions = false);
static bool Click(const Point& P, const std::vector<std::string>& Options);
static bool Click(const Box& B, const Button& Button = BUTTON_LEFT);
static bool Click(const Box& B, const std::string& Option);
static bool Click(const Box& B, const std::vector<std::string>& Options, bool RequireAllOptions = false);
static bool Click(const Box& B, const std::vector<std::string>& Options);
static bool Click(const Convex& C, const Button& B = BUTTON_LEFT);
static bool Click(const Convex& C, const std::string& Option);
static bool Click(const Convex& C, const std::vector<std::string>& Options, bool RequireAllOptions = false);
static bool Click(const Convex& C, const std::vector<std::string>& Options);
static bool Scroll(const ScrollDirection& Direction);
static bool ScrollUntil(const ScrollDirection& Direction, std::int32_t Duration, const std::function<bool()>& Func);

Binary file not shown.