44 using item_ptr = std::shared_ptr<wml_menu_item>;
56 bool erase(
const std::string&
id);
64 bool is_key_hold_repeat =
false)
const;
76 std::vector<config>& items,
A config object defines a single node in a WML file, with access to child nodes.
void get_items(const map_location &hex, std::vector< config > &items, filter_context &fc, game_data &gamedata, unit_map &units) const
Returns the menu items that can be shown for the given location.
void init_handlers(game_lua_kernel &lk) const
Initializes the implicit event handlers for inlined [command]s.
bool empty() const
Returns true if no menu items are being managed.
std::shared_ptr< wml_menu_item > item_ptr
wml_menu_item pointers
bool fire_item(const std::string &id, const map_location &hex, game_data &gamedata, filter_context &fc, unit_map &units, bool is_key_hold_repeat=false) const
Fires the menu item with the given id.
std::map< std::string, item_ptr > wml_menu_items_
bool erase(const std::string &id)
Erases the item with the provided id.
void to_config(config &cfg) const
std::size_t size() const
Gets the number of menu items owned.
item_ptr get_item(const std::string &id) const
Gets the menu item with the specified ID.
void set_item(const std::string &id, const vconfig &menu_item)
Updates or creates (as appropriate) the menu item with the given id.
~wmi_manager()
Destructor.
void set_menu_items(const config &cfg)
Sets the current menu items to the "menu_item" children of cfg.
Container associating units to locations.
A variable-expanding proxy for the config class.
Encapsulates the map of the game.
const std::string & gamedata