greying out of top menu when the info is not valid (i.e it's not your turn)

This commit is contained in:
Jérémy Rosen 2006-08-05 10:17:48 +00:00
parent c1bdb3c08d
commit 796f535de3
8 changed files with 19 additions and 12 deletions

View File

@ -11,6 +11,7 @@ Version 1.3-svn:
* user interface
* disable inactive sliders instead of hiding them
* sliders can be adjusted with keyboard left and right
* sidebar reports related to gold, units, villages, and time grey out during other team's turns
* WML engine
* allow_new_game key (default=yes) to prevent [multiplayer] scenarios to
show up in the multiplayer game creation interface (FR #6397)

View File

@ -546,6 +546,7 @@ Joshua Hudson
Paul Smedley (Creeping)
Andrea Palmatè (afxgroup)
EdB
Jim Carroll (Jimm)
"
[/about]

View File

@ -321,6 +321,7 @@ void set_font_list(const std::vector<subset_descriptor>& fontlist)
}
const SDL_Color NORMAL_COLOUR = {0xDD,0xDD,0xDD,0},
GRAY_COLOUR = {0x55,0x55,0x55,0},
LOBBY_COLOUR = {0xBB,0xBB,0xBB,0},
GOOD_COLOUR = {0x00,0xFF,0x00,0},
BAD_COLOUR = {0xFF,0x00,0x00,0},

View File

@ -44,7 +44,7 @@ struct subset_descriptor
void set_font_list(const std::vector<subset_descriptor>& fontlist);
//various standard colours
extern const SDL_Color NORMAL_COLOUR, LOBBY_COLOUR, GOOD_COLOUR, BAD_COLOUR,
extern const SDL_Color NORMAL_COLOUR, GRAY_COLOUR, LOBBY_COLOUR, GOOD_COLOUR, BAD_COLOUR,
BLACK_COLOUR, DARK_COLOUR, YELLOW_COLOUR, BUTTON_COLOUR,
STONED_COLOUR, TITLE_COLOUR, DISABLED_COLOUR;

View File

@ -22,7 +22,7 @@ namespace font {
const char LARGE_TEXT='*', SMALL_TEXT='`', GOOD_TEXT='@', BAD_TEXT='#',
NORMAL_TEXT='{', BLACK_TEXT='}', BOLD_TEXT='~', IMAGE='&',
COLOR_TEXT='<', NULL_MARKUP='^';
COLOR_TEXT='<', NULL_MARKUP='^', GRAY_TEXT='|';
namespace {
@ -53,6 +53,9 @@ std::string::const_iterator parse_markup(std::string::const_iterator i1, std::st
case BLACK_TEXT:
*colour = BLACK_COLOUR;
break;
case GRAY_TEXT:
*colour = GRAY_COLOUR;
break;
case LARGE_TEXT:
*font_size += 2;
break;

View File

@ -21,7 +21,7 @@ class CVideo;
namespace font {
//standard markups
extern const char LARGE_TEXT, SMALL_TEXT, GOOD_TEXT, BAD_TEXT, NORMAL_TEXT, BLACK_TEXT, BOLD_TEXT, IMAGE, NULL_MARKUP;
extern const char LARGE_TEXT, SMALL_TEXT, GOOD_TEXT, BAD_TEXT, NORMAL_TEXT, GRAY_TEXT, BLACK_TEXT, BOLD_TEXT, IMAGE, NULL_MARKUP;
//function to draw text on the screen. The text will be clipped to area.

View File

@ -291,6 +291,7 @@ void play_controller::init_side(const unsigned int team_index, bool is_replay){
if(team_manager_.is_observer()) {
gui_->set_team(size_t(team_index));
}
gui_->set_playing_team(size_t(team_index));
std::stringstream player_number_str;
player_number_str << player_number_;
@ -348,8 +349,6 @@ void play_controller::init_side(const unsigned int team_index, bool is_replay){
current_team.set_time_of_day(int(status_.turn()),status_.get_time_of_day());
gui_->set_playing_team(size_t(team_index));
if (!recorder.is_skipping()){
::clear_shroud(*gui_,status_,map_,gameinfo_,units_,teams_,team_index);
}

View File

@ -342,32 +342,32 @@ Units cannot be killed by poison alone. The poison will not reduce it below 1 HP
str << "\n";
break;
// For these following status reports, show them in gray text when it is not the active player's turn.
case GOLD:
str << (current_team.gold() < 0 ? font::BAD_TEXT : font::NULL_MARKUP) << current_team.gold();
str << (current_side != playing_side ? font::GRAY_TEXT : (current_team.gold() < 0 ? font::BAD_TEXT : font::NULL_MARKUP)) << current_team.gold();
break;
case VILLAGES: {
const team_data data = calculate_team_data(current_team,current_side,units);
str << data.villages;
str << (current_side != playing_side ? font::GRAY_TEXT : font::NULL_MARKUP) << data.villages;
break;
}
case NUM_UNITS: {
str << team_units(units,current_side);
str << (current_side != playing_side ? font::GRAY_TEXT : font::NULL_MARKUP) << team_units(units,current_side);
break;
}
case UPKEEP: {
const team_data data = calculate_team_data(current_team,current_side,units);
str << data.expenses << " (" << data.upkeep << ")";
str << (current_side != playing_side ? font::GRAY_TEXT : font::NULL_MARKUP) << data.expenses << " (" << data.upkeep << ")";
break;
}
case EXPENSES: {
const team_data data = calculate_team_data(current_team,current_side,units);
str << data.expenses;
str << (current_side != playing_side ? font::GRAY_TEXT : font::NULL_MARKUP) << data.expenses;
break;
}
case INCOME: {
const team_data data = calculate_team_data(current_team,current_side,units);
str << (data.net_income < 0 ? font::BAD_TEXT : font::NULL_MARKUP) << data.net_income;
str << (current_side != playing_side ? font::GRAY_TEXT : (data.net_income < 0 ? font::BAD_TEXT : font::NULL_MARKUP)) << data.net_income;
break;
}
case TERRAIN: {
@ -494,6 +494,8 @@ Units cannot be killed by poison alone. The poison will not reduce it below 1 HP
if (current_team.countdown_time() > 0){
sec = current_team.countdown_time() / 1000;
str << (current_side != playing_side ? font::GRAY_TEXT : font::NULL_MARKUP);
if(sec < 60)
str << "<200,0,0>";
else if(sec < 120)