Whiteboard: planned recruit gold taken into account in top sidebar.

This commit is contained in:
Gabriel Morin 2010-08-01 22:30:37 +00:00
parent 2d4f3b0a0f
commit 7c0237a411
2 changed files with 7 additions and 2 deletions

View file

@ -32,6 +32,7 @@
#include "resources.hpp"
#include "team.hpp"
#include "tod_manager.hpp"
#include "whiteboard/manager.hpp"
#include <iostream>
#include <ctime>
@ -524,14 +525,16 @@ report generate_report(TYPE type,
// For the following status reports, show them in gray text
// when it is not the active player's turn.
case GOLD: {
//Supposes the full/"pathfind" unit map is applied
int fake_gold = current_team.gold() - resources::whiteboard->get_spent_gold_for(current_side);
char const *end = naps;
if (current_side != playing_side)
str << span_color(font::GRAY_COLOR);
else if (current_team.gold() < 0)
else if (fake_gold < 0)
str << span_color(font::BAD_COLOR);
else
end = "";
str << current_team.gold() << end;
str << fake_gold << end;
break;
}
case VILLAGES: {

View file

@ -101,6 +101,7 @@ void recruit::apply_temp_modifier(unit_map& unit_map)
* Add cost to money spent on recruits.
*/
resources::teams->at(team_index()).get_side_actions()->change_gold_spent_by(temp_cost_);
resources::screen->invalidate_game_status();
temp_unit_ = NULL;
}
@ -113,6 +114,7 @@ void recruit::remove_temp_modifier(unit_map& unit_map)
* Remove cost from money spent on recruits.
*/
resources::teams->at(team_index()).get_side_actions()->change_gold_spent_by(-temp_cost_);
resources::screen->invalidate_game_status();
}
unit* recruit::create_corresponding_unit()