AlpacaLibary  1.63
A closed source C++ bot for OSRS
Menu.hpp
Go to the documentation of this file.
1 #ifndef MENU_HPP_INCLUDED
2 #define MENU_HPP_INCLUDED
3 
4 #include "../../Core/Types/Box.hpp"
5 #include <cstdint>
6 #include <string>
7 #include <vector>
8 
12 namespace Menu
13 {
14 
15  bool IsOpen();
16 
22  bool Open();
23  bool Close();
24 
25 
26 
27  std::int32_t GetCount();
28 
34  bool OptionsValid(std::int32_t MenuCount, const std::vector<std::string>& RawActions, const std::vector<std::string>& RawTargets);
35 
45  std::vector<std::string> GetActions();
46 
56  std::vector<std::string> GetTargets();
57 
68  std::vector<std::string> GetOptions();
80  std::vector<std::pair<std::string, std::string>> GetSplitOptions();
81 
82 
99  std::int32_t IndexOf(const std::string& Option);
100 
112  std::int32_t IndexOf(const std::vector<std::string>& Options);
113 
114 
126  std::tuple<std::int32_t, std::string, std::string> FindOption(std::uint32_t Index);
127 
139  std::tuple<std::int32_t, std::string, std::string> FindOption(const std::string& Option);
140 
152  std::tuple<std::int32_t, std::string, std::string> FindOption(const std::vector<std::string>& Options);
153 
165  std::vector<std::tuple<std::int32_t, std::string, std::string>> FindOptions(const std::string& Option);
166 
178  std::vector<std::tuple<std::int32_t, std::string, std::string>> FindOptions(const std::vector<std::string>& Options);
179 
180 
189  bool Contains(const std::string& Option);
190 
199  bool Contains(const std::vector<std::string>& Options);
200 
201 
212  bool WaitContains(std::uint32_t Duration, std::uint32_t Step, const std::string& Option);
213 
224  bool WaitContains(std::uint32_t Duration, std::uint32_t Step, const std::vector<std::string>& Options);
225 
226 
235  bool Select(std::int32_t Index, bool CloseMenu = true);
236 
246  bool Select(const std::string& Option, bool CloseMenu = true);
247 
257  bool Select(const std::vector<std::string>& Options, bool CloseMenu = true);
258 
259 
264  std::vector<Box> GetOptionBoxes();
265 
270 }
271 
272 #endif // MENU_HPP_INCLUDED
Definition: Box.hpp:11
A namespace containing various functions for the right-click menu.
Definition: Menu.hpp:13
bool Select(std::int32_t Index, bool CloseMenu=true)
Selects the menu option by the passed index if the menu is open.
std::int32_t IndexOf(const std::string &Option)
Get the index of the found option.
std::vector< std::pair< std::string, std::string > > GetSplitOptions()
Get the menu options split into pairs instead of whole strings.
std::int32_t GetCount()
std::vector< std::string > GetTargets()
Get the menu targets.
bool IsOpen()
std::vector< std::tuple< std::int32_t, std::string, std::string > > FindOptions(const std::string &Option)
Looks for a menu option containing the passed Option, and returns information of all options that wer...
Box GetBox()
std::vector< std::string > GetOptions()
Get the menu options.
std::vector< std::string > GetActions()
Get the menu actions.
bool Close()
std::tuple< std::int32_t, std::string, std::string > FindOption(std::uint32_t Index)
Looks for a menu option at the passed index, and returns information about the found option.
std::vector< Box > GetOptionBoxes()
Get the array of menu option boxes, each box is a menu option.
bool WaitContains(std::uint32_t Duration, std::uint32_t Step, const std::string &Option)
Waits until the menu contains the passed option.
bool Contains(const std::string &Option)
Returns true if the menu contains the passed Option.
bool Open()
Opens the menu by right-clicking wherever the mouse currently is.
bool OptionsValid(std::int32_t MenuCount, const std::vector< std::string > &RawActions, const std::vector< std::string > &RawTargets)
Attempts to verify the order of the passed menu actions and targets.