add a tooltip with the experience modifier for the units XP display

This commit is contained in:
uso 2007-07-27 00:51:11 +00:00
parent cda4341da7
commit 10386174d9
5 changed files with 17 additions and 4 deletions

View file

@ -21,6 +21,7 @@ Version 1.3.6+svn:
* Enable "Save Game" and "View Chat Log" menu entries in replay mode.
* Add an additional line below the minimap in the "Multiplayer->Create game"
screen that displays the size of the selected map. (patch #776 by uso)
* Add a tooltip with the experience modifier for the units XP display.
* WML engine:
* now [base_unit]id= inside [unit] can extend upon existing unit types
* new extra_defines key to define in campaigns some other preprocessor

View file

@ -58,6 +58,7 @@ game_display::game_display(unit_map& units, CVideo& video, const gamemap& map,
temp_unit_(NULL),
status_(status),
teams_(t),
level_(level),
invalidateUnit_(true),
currentTeam_(0), activeTeam_(0),
sidebarScaling_(1.0),
@ -540,7 +541,7 @@ void game_display::draw_report(reports::TYPE report_num)
units_, teams_,
teams_[viewing_team()],
size_t(currentTeam_+1),size_t(activeTeam_+1),
selectedHex_,mouseoverHex_,status_,observers_);
selectedHex_,mouseoverHex_,status_,observers_,level_);
brighten = false;
if(report_num == reports::TIME_OF_DAY) {

View file

@ -200,6 +200,8 @@ private:
const std::vector<team>& teams_;
const config& level_;
void invalidate_route();
bool invalidateUnit_;

View file

@ -36,7 +36,8 @@ report generate_report(TYPE type,
const std::vector<team>& teams, const team& current_team,
unsigned int current_side, unsigned int playing_side,
const gamemap::location& loc, const gamemap::location& mouseover,
const gamestatus& status, const std::set<std::string>& observers)
const gamestatus& status, const std::set<std::string>& observers,
const config& level)
{
unit_map::iterator u = units.end();
SDL_Color HPC;
@ -140,10 +141,17 @@ Units cannot be killed by poison alone. The poison will not reduce it below 1 HP
break;
}
case UNIT_XP: {
report res;
std::stringstream tooltip;
XPC=u->second.xp_color();
str << "<" << (int) XPC.r << "," << (int) XPC.g << "," << (int) XPC.b << ">"
<< u->second.experience() << "/" << u->second.max_experience();
break;
tooltip << _("Experience Modifier: ") << ((level["experience_modifier"] != "") ? level["experience_modifier"] : "100") << "%";
res.add_text(str,tooltip);
return res;
}
case UNIT_ADVANCEMENT_OPTIONS: {
report res;

View file

@ -90,7 +90,8 @@ namespace reports {
const std::vector<team>& teams, const team& current_team,
unsigned int current_side, int unsigned active_side,
const gamemap::location& loc, const gamemap::location& mouseover,
const gamestatus& status, const std::set<std::string>& observers);
const gamestatus& status, const std::set<std::string>& observers,
const config& level);
}
#endif