mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-05 16:13:28 +00:00
greying out of top menu when the info is not valid (i.e it's not your turn)
This commit is contained in:
parent
c1bdb3c08d
commit
796f535de3
@ -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)
|
||||
|
@ -546,6 +546,7 @@ Joshua Hudson
|
||||
Paul Smedley (Creeping)
|
||||
Andrea Palmatè (afxgroup)
|
||||
EdB
|
||||
Jim Carroll (Jimm)
|
||||
"
|
||||
[/about]
|
||||
|
||||
|
@ -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},
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user