The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Functions
Image and animations functions

Functions

unit_animation_componentunit::anim_comp () const
 
std::string unit::absolute_image () const
 The name of the file to game_display (used in menus). More...
 
std::string unit::default_anim_image () const
 The default image to use for animation frames with no defined image. More...
 
std::string unit::image_halo () const
 Get the unit's halo image. More...
 
void unit::set_image_halo (const std::string &halo)
 Set the unit's halo image. More...
 
std::string unit::image_ellipse () const
 Get the unit's ellipse image. More...
 
void unit::set_image_ellipse (const std::string &ellipse)
 Set the unit's ellipse image. More...
 
const std::string & unit::flag_rgb () const
 Get the source color palette to use when recoloring the unit's image. More...
 
std::string unit::TC_image_mods () const
 Constructs a recolor (RC) IPF string for this unit's team color. More...
 
const std::string & unit::effect_image_mods () const
 Gets any IPF image mods applied by effects. More...
 
std::string unit::image_mods () const
 Gets an IPF string containing all IPF image mods. More...
 
const std::vector< std::string > & unit::overlays () const
 Get the unit's overlay images. More...
 
color_t unit::hp_color () const
 Color for this unit's current hitpoints. More...
 
color_t unit::hp_color (int hitpoints) const
 Color for this unit's hitpoints. More...
 
color_t unit::xp_color () const
 Color for this unit's XP. More...
 

Detailed Description

Function Documentation

std::string unit::absolute_image ( ) const
unit_animation_component& unit::anim_comp ( ) const
inline
std::string unit::default_anim_image ( ) const

The default image to use for animation frames with no defined image.

Definition at line 2285 of file unit.cpp.

References unit_type::icon(), unit_type::image(), and unit::type().

Referenced by unit_animation_component::invalidate(), and unit_drawer::redraw_unit().

const std::string& unit::effect_image_mods ( ) const
inline

Gets any IPF image mods applied by effects.

Definition at line 1371 of file unit.hpp.

References unit::image_mods_.

Referenced by impl_unit_get().

const std::string & unit::flag_rgb ( ) const

Get the source color palette to use when recoloring the unit's image.

Definition at line 1030 of file unit.cpp.

References unit::flag_rgb_, and game_config::unit_rgb.

Referenced by unit::TC_image_mods().

color_t unit::hp_color ( ) const

Color for this unit's current hitpoints.

Returns
A color between green and red representing how wounded this unit is. The maximum_hitpoints are considered as base.

Definition at line 1073 of file unit.cpp.

References unit::hitpoints(), hp_color_impl(), and unit::max_hitpoints().

Referenced by gui2::dialogs::unit_list::pre_show(), unit_drawer::redraw_unit(), gui2::unit_preview_pane::set_displayed_unit(), unit_hp(), and unit_weapons().

color_t unit::hp_color ( int  hitpoints) const

Color for this unit's hitpoints.

Parameters
hitpointsThe number of hitpoints the color represents.
Returns
The color considering the current hitpoints as base.

Definition at line 1078 of file unit.cpp.

References unit::hitpoints(), and hp_color_impl().

std::string unit::image_ellipse ( ) const
inline

Get the unit's ellipse image.

Definition at line 1350 of file unit.hpp.

References unit::ellipse_, and unit_detail::get_or_default().

Referenced by unit_drawer::redraw_unit().

std::string unit::image_halo ( ) const
inline

Get the unit's halo image.

Definition at line 1341 of file unit.hpp.

References unit_detail::get_or_default(), and unit::halo_.

Referenced by unit_drawer::redraw_unit().

std::string unit::image_mods ( ) const
const std::vector<std::string>& unit::overlays ( ) const
inline

Get the unit's overlay images.

Definition at line 1384 of file unit.hpp.

References unit::overlays_.

Referenced by impl_unit_get(), gui2::dialogs::unit_recall::pre_show(), unit_drawer::redraw_unit(), and gui2::unit_preview_pane::set_displayed_unit().

void unit::set_image_ellipse ( const std::string &  ellipse)
inline

Set the unit's ellipse image.

Definition at line 1356 of file unit.hpp.

References unit::appearance_changed_, and unit::ellipse_.

Referenced by unit::advance_to(), unit::apply_builtin_effect(), and unit::unit().

void unit::set_image_halo ( const std::string &  halo)

Set the unit's halo image.

Definition at line 2504 of file unit.cpp.

References unit::anim_comp_, unit::appearance_changed_, and unit::halo_.

Referenced by unit::advance_to(), unit::apply_builtin_effect(), and unit::unit().

std::string unit::TC_image_mods ( ) const

Constructs a recolor (RC) IPF string for this unit's team color.

Definition at line 2449 of file unit.cpp.

References unit::flag_rgb(), team::get_side_color_index(), and unit::side().

Referenced by unit::image_mods(), unit_animation_component::invalidate(), and unit_drawer::redraw_unit().

color_t unit::xp_color ( ) const