20 #define GETTEXT_DOMAIN "wesnoth-editor"
40 for(
const config&
item : group.child_range(
"item")) {
43 if(!group[
"core"].to_bool(
false))
55 ERR_ED <<
"No items found.";
63 std::stringstream& tooltip_text)
65 std::stringstream filename;
66 filename <<
item.image;
67 if(
item.image.empty()) {
68 filename <<
item.halo;
73 tooltip_text <<
"IMAGE NOT FOUND\n";
74 ERR_ED <<
"image for item type: '" << filename.str() <<
"' not found";
77 ERR_ED <<
"Placeholder image not found";
82 tooltip_text <<
item.name;
A config object defines a single node in a WML file, with access to child nodes.
std::set< std::string > non_core_items_
std::vector< item_group > groups_
The editor_groups as defined in editor-groups.cfg.
virtual void select_bg_item(const std::string &item_id) override
const std::vector< std::string > & active_group()
std::map< std::string, std::vector< std::string > > group_map_
virtual void select_fg_item(const std::string &item_id) override
Select a foreground item.
void set_group(std::size_t index) override
const overlay & selected_fg_item() const
Return the currently selected foreground/background item.
virtual std::string get_help_string()
virtual const std::string & get_id(const overlay &item)
item_palette(editor_display &gui, const game_config_view &cfg, editor_toolkit &toolkit)
virtual void setup(const game_config_view &cfg)
Setup the internal data structure.
virtual void setup_item(const overlay &item, texture &item_base_image, texture &item_overlay_image, std::stringstream &tooltip)
Setup item image and tooltip.
A class grating read only view to a vector of config objects, viewed as one config with all children ...
config_array_view child_range(config_key_type key) const
Wrapper class to encapsulate creation and management of an SDL_Texture.
Manage the empty-palette in the editor.
std::pair< std::string, unsigned > item
texture get_texture(const image::locator &i_locator, TYPE type, bool skip_cache)
Returns an image texture suitable for hardware-accelerated rendering.