19 #define GETTEXT_DOMAIN "wesnoth-editor"
35 for (
const unit_type_data::unit_type_map::value_type &
i :
unit_types.
types())
37 if (
i.second.do_not_list())
39 item_map_.insert(std::pair<std::string, unit_type>(
i.second.id(),
i.second));
58 cfg[
"id"] =
i.second.id();
59 cfg[
"name"] =
i.second.plural_name();
60 cfg[
"icon"] =
"icons/unit-groups/race_" +
i.second.id();
76 ERR_ED <<
"No items found." << std::endl;
82 std::stringstream filename;
87 if(image ==
nullptr) {
88 tooltip_text <<
"IMAGE NOT FOUND\n";
89 ERR_ED <<
"image for unit type: '" << filename.str() <<
"' not found" << std::endl;
91 if (image ==
nullptr) {
92 ERR_ED <<
"Placeholder image not found" << std::endl;
surface get_image(const image::locator &i_locator, TYPE type)
function to get the surface corresponding to an image.
const unit_type & selected_fg_item() const
Return the currently selected foreground/background item.
const t_string & type_name() const
The name of the unit in the current language setting.
virtual void select_fg_item(const std::string &item_id)
Select a foreground item.
Stores the info about the groups in a nice format.
std::set< std::string > selected_bg_items_
virtual bool is_selected_bg_item(const std::string &id)
unit_type_data unit_types
const std::string & image() const
const std::vector< std::string > & active_group()
surface scale_surface(const surface &surf, int w, int h)
virtual std::string get_help_string()
const std::string & flag_rgb() const
const unit_type_map & types() const
std::map< std::string, std::vector< std::string > > group_map_
Manage the empty-palette in the editor.
unit_palette(editor_display &gui, const config &cfg, mouse_action **active_mouse_action)
virtual const std::string & get_id(const unit_type &terrain)
virtual void setup(const config &cfg)
Setup the internal data structure.
const race_map & races() const
std::set< std::string > non_core_items_
this module manages the cache of images.
static std::string get_side_color_index(int side)
std::vector< item_group > groups_
The editor_groups as defined in editor-groups.cfg.
A mouse action receives events from the controller, and responds to them by creating an appropriate e...
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.
GLsizei const GLcharARB ** string
const std::string & id() const
The id for this unit_type.
void set_group(size_t index)
virtual void draw_item(const unit_type &terrain, surface &image, std::stringstream &tooltip_text)