19 #define GETTEXT_DOMAIN "wesnoth-editor" 38 for(
const config&
item : group.child_range(
"item")) {
41 if(!group[
"core"].to_bool(
false))
54 ERR_ED <<
"No items found." << std::endl;
60 std::stringstream filename;
61 filename << item.
image;
62 if(item.
image.empty()) {
63 filename << item.
halo;
67 if(image ==
nullptr) {
68 tooltip_text <<
"IMAGE NOT FOUND\n";
69 ERR_ED <<
"image for item type: '" << filename.str() <<
"' not found" << std::endl;
71 if(image ==
nullptr) {
72 ERR_ED <<
"Placeholder image not found" << std::endl;
81 tooltip_text << item.
name;
virtual void draw_item(const overlay &item, surface &image, std::stringstream &tooltip_text)
surface get_image(const image::locator &i_locator, TYPE type)
function to get the surface corresponding to an image.
virtual void select_fg_item(const std::string &item_id) override
Select a foreground item.
virtual void select_bg_item(const std::string &item_id) override
virtual const std::string & get_id(const overlay &item)
virtual void setup(const config &cfg)
Setup the internal data structure.
child_itors child_range(config_key_type key)
void set_group(std::size_t index) override
const std::vector< std::string > & active_group()
surface scale_surface(const surface &surf, int w, int h)
Scale a surface using alpha-weighted modified bilinear filtering Note: causes artifacts with alpha gr...
std::map< std::string, std::vector< std::string > > group_map_
Manage the empty-palette in the editor.
std::set< std::string > non_core_items_
const overlay & selected_fg_item() const
Return the currently selected foreground/background item.
virtual std::string get_help_string()
this module manages the cache of images.
item_palette(editor_display &gui, const config &cfg, editor_toolkit &toolkit)
std::vector< item_group > groups_
The editor_groups as defined in editor-groups.cfg.
A config object defines a single node in a WML file, with access to child nodes.
std::pair< std::string, unsigned > item