14 #define GETTEXT_DOMAIN "wesnoth-lib"
49 icon_type_ = find_widget<timage>(
this,
"type_image" ,
false,
false);
50 icon_race_ = find_widget<timage>(
this,
"type_race" ,
false,
false);
51 icon_alignment_ = find_widget<timage>(
this,
"type_alignment",
false,
false);
54 label_name_ = find_widget<tlabel>(
this,
"type_name" ,
false,
false);
55 label_level_ = find_widget<tlabel>(
this,
"type_level" ,
false,
false);
56 label_details_ = find_widget<tlabel>(
this,
"type_details",
false,
false);
59 button_profile_ = find_widget<tbutton>(
this,
"type_profile",
false,
false);
76 tc =
"~RC(" + type->
flag_rgb() +
">" +
91 symbols[
"lvl"] = std::to_string(type->
level());
105 const std::string& alignment_name = type->alignment().to_string();
107 icon_alignment_->set_label(
"icons/alignments/alignment_" + alignment_name +
"_30.png");
114 std::stringstream str;
115 str <<
"<b>" <<
_(
"HP: ") <<
"</b>"
116 <<
"<span color='#21e100'>" << type->
hitpoints() <<
"</span> ";
118 str <<
"<b>" <<
_(
"XP: ") <<
"</b>"
121 str <<
"<b>" <<
_(
"MP: ") <<
"</b>"
127 bool has_traits =
false;
128 std::stringstream t_str;
132 if(tr[
"availability"] !=
"musthave")
continue;
143 t_str <<
" " << name <<
"\n";
150 str <<
"<b>" <<
_(
"Traits") <<
"</b>" <<
"\n";
157 str <<
"<b>" <<
_(
"Abilities") <<
"</b>" <<
"\n";
161 str <<
" " << ab <<
"\n";
169 str <<
"<b>" <<
_(
"Attacks") <<
"</b>" <<
"\n";
171 for(
const auto&
a : type->
attacks())
173 str <<
"<span color='#f5e6c1'>" <<
a.damage()
176 str <<
"<span color='#a69275'>" <<
" " <<
a.range()
180 if (!special.empty()) {
181 str <<
"<span color='#a69275'>" <<
" " << special <<
"</span>" <<
"\n";
184 const std::string accuracy_parry =
a.accuracy_parry_description();
185 if(!accuracy_parry.empty()) {
186 str <<
"<span color='#a69275'>" <<
" " << accuracy_parry <<
"</span>" <<
"\n";
234 DBG_GUI_P <<
"Parsing unit preview pane " <<
id <<
'\n';
236 load_resolutions<tresolution>(cfg);
256 tbuilder_unit_preview_pane::tbuilder_unit_preview_pane(
const config& cfg)
267 DBG_GUI_G <<
"Window builder: placed unit preview pane '" <<
id
268 <<
"' with definition '" <<
definition <<
"'.\n";
271 = boost::dynamic_pointer_cast<
std::string current_type_
play_controller * controller
std::string const & gender_string(unit_race::GENDER gender)
GLvoid **typedef void(GLAPIENTRY *PFNGLGETVERTEXATTRIBDVPROC)(GLuint
const t_string & type_name() const
The name of the unit in the current language setting.
const std::vector< t_string > & abilities() const
const std::string weapon_details_sep
const t_string & name(GENDER gender=MALE) const
virtual unsigned get_state() const override
See tcontrol::get_state.
GLuint GLuint GLsizei GLenum type
tresolution_definition_ptr config()
tresolution(const config &cfg)
virtual void set_label(const t_string &label)
const unit_race * race() const
Never returns nullptr, but may point to the null race.
const std::string & image() const
void connect_signal_mouse_left_click(tdispatcher &dispatcher, const tsignal_function &signal)
Connects a signal handler for a left mouse button click.
void set_displayed_type(const unit_type *type)
Displays the stats of a specified unit type.
void finalize_setup()
Initializes the interneral sub-widget pointers.
Base class of a resolution, contains the common keys for a resolution.
A class inherited from ttext_box that displays its input as stars.
void init_control(tcontrol *control) const
std::string definition
Parameters for the control.
virtual bool get_active() const override
See tcontrol::get_active.
virtual void set_use_markup(bool use_markup)
virtual const std::string & get_control_type() const override
See tcontrol::get_control_type.
static UNUSEDNOWARN std::string _(const char *str)
const std::string & flag_rgb() const
std::map< std::string, t_string > string_map
#define VALIDATE(cond, message)
The macro to use for the validation of WML.
GLboolean GLboolean GLboolean GLboolean a
const std::vector< unit_race::GENDER > & genders() const
The returned vector will not be empty, provided this has been built to the HELP_INDEXED status...
void init_grid(const boost::intrusive_ptr< tbuilder_grid > &grid_builder)
Initializes and builds the grid.
const std::string & icon() const
Contains the state info for a resolution.
std::string race_id() const
Returns the ID of this type's race without the need to build the type.
virtual void set_active(const bool active) override
See tcontrol::set_active.
void profile_button_callback()
Callback for the profile button.
config::const_child_itors possible_traits() const
virtual void set_self_active(const bool active) override
See tcontainer_::set_self_active.
GLuint const GLchar * name
int experience_needed(bool with_acceleration=true) const
std::vector< tstate_definition > state
const std::string weapon_numbers_sep
config & child(const std::string &key, int n=0)
Returns the nth child with the given key, or a reference to an invalid config if there is none...
std::vector< attack_type > attacks() const
static std::string get_side_color_index(int side)
void show_unit_help(CVideo &video, const std::string &show_topic, bool has_variations, bool hidden, int xloc, int yloc)
Open the help browser, show unit with id unit_id.
A config object defines a single node in a WML file, with access to child nodes.
static std::string alignment_description(ALIGNMENT align, unit_race::GENDER gender=unit_race::MALE)
tunit_preview_pane_definition(const config &cfg)
GLsizei const GLcharARB ** string
const std::string & id() const
The id for this unit_type.
Contains the implementation details for lexical_cast and shouldn't be used directly.