19 #define GETTEXT_DOMAIN "wesnoth-editor" 36 for(
const unit_type_data::unit_type_map::value_type &
i :
unit_types.
types()) {
37 if(
i.second.do_not_list())
51 cfg[
"id"] =
i.second.id();
52 cfg[
"name"] =
i.second.plural_name();
53 cfg[
"icon"] =
i.second.get_icon_path_stem();
69 ERR_ED <<
"No items found." << std::endl;
75 std::stringstream filename;
80 if(image ==
nullptr) {
81 tooltip_text <<
"IMAGE NOT FOUND\n";
82 ERR_ED <<
"image for unit type: '" << filename.str() <<
"' not found" << std::endl;
84 if(image ==
nullptr) {
85 ERR_ED <<
"Placeholder image not found" << std::endl;
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.
unit_palette(editor_display &gui, const game_config_view &cfg, editor_toolkit &toolkit)
std::set< std::string > selected_bg_items_
const std::string & flag_rgb() const
void set_group(std::size_t index) override
virtual bool is_selected_bg_item(const std::string &id)
unit_type_data unit_types
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...
const race_map & races() const
virtual std::string get_help_string()
const unit_type_map & types() const
A single unit type that the player may recruit.
const t_string & type_name() const
The name of the unit in the current language setting.
std::map< std::string, std::vector< std::string > > group_map_
const std::string & id() const
The id for this unit_type.
Manage the empty-palette in the editor.
static std::string get_side_color_id(unsigned side)
virtual const std::string & get_id(const unit_type &terrain)
const std::string & image() const
const const unit_type & & selected_fg_item() const
Return the currently selected foreground/background item.
Functions to load and save images from/to disk.
std::vector< item_group > groups_
The editor_groups as defined in editor-groups.cfg.
virtual void select_bg_item(const std::string &item_id)
A config object defines a single node in a WML file, with access to child nodes.
virtual void setup(const game_config_view &cfg)
Setup the internal data structure.
virtual void draw_item(const unit_type &terrain, surface &image, std::stringstream &tooltip_text)