19 #define GETTEXT_DOMAIN "wesnoth-editor" 39 for(
const config&
item : group.child_range(
"item")) {
42 if(!group[
"core"].to_bool(
false))
55 ERR_ED <<
"No items found." << std::endl;
61 std::stringstream filename;
62 filename << item.
image;
63 if(item.
image.empty()) {
64 filename << item.
halo;
68 if(image ==
nullptr) {
69 tooltip_text <<
"IMAGE NOT FOUND\n";
70 ERR_ED <<
"image for item type: '" << filename.str() <<
"' not found" << std::endl;
72 if(image ==
nullptr) {
73 ERR_ED <<
"Placeholder image not found" << std::endl;
82 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)
Caches and returns 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)
config_array_view child_range(config_key_type key) const
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...
virtual void setup(const game_config_view &cfg)
Setup the internal data structure.
item_palette(editor_display &gui, const game_config_view &cfg, editor_toolkit &toolkit)
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()
Functions to load and save images from/to disk.
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