From 2c7aca7546f691ab1a61c6db6c8ed1f989243d36 Mon Sep 17 00:00:00 2001 From: Dave White Date: Tue, 11 Nov 2003 04:52:01 +0000 Subject: [PATCH] made it so units that can no longer advance have experience needed displayed as '-' --- src/display.cpp | 10 ++++++++-- src/game_config.cpp | 2 +- src/widgets/menu.cpp | 23 ++++++++++++++++++++--- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/src/display.cpp b/src/display.cpp index c80bc9c2403..97cebd000ed 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -686,8 +686,14 @@ void display::draw_unit_details(int x, int y, const gamemap::location& loc, << (lang_ability.empty() ? u.type().ability() : lang_ability)<<"\n" << string_table["hp"] << ": " << u.hitpoints() << "/" << u.max_hitpoints() << "\n" - << string_table["xp"] << ": " << u.experience() << "/" - << u.max_experience() << "\n" + << string_table["xp"] << ": "; + + if(u.type().advances_to().empty()) + details << u.experience() << "/-"; + else + details << u.experience() << "/" << u.max_experience(); + + details << "\n" << string_table["moves"] << ": " << u.movement_left() << "/" << u.total_movement() << "\n"; diff --git a/src/game_config.cpp b/src/game_config.cpp index 75d82490648..9008442d081 100644 --- a/src/game_config.cpp +++ b/src/game_config.cpp @@ -22,7 +22,7 @@ namespace game_config const int cure_amount = 8; const int curer_heals_per_turn = 18; const int recall_cost = 20; - const std::string version = "0.5.1"; + const std::string version = "0.5.2-CVS"; bool debug = false; #ifdef WESNOTH_PATH diff --git a/src/widgets/menu.cpp b/src/widgets/menu.cpp index e849a729713..b1b68a84b86 100644 --- a/src/widgets/menu.cpp +++ b/src/widgets/menu.cpp @@ -185,7 +185,25 @@ void menu::handle_event(const SDL_Event& event) if(item != selected_) { selected_ = item; drawn_ = false; - } + } + } else if(event.type == SDL_MOUSEBUTTONDOWN + && event.button.button == SDL_BUTTON_WHEELDOWN) { + if(first_item_on_screen_+max_menu_items0) { + --first_item_on_screen_; + if (selected_>=first_item_on_screen_+int(max_menu_items)) + selected_=first_item_on_screen_+max_menu_items-1; + itemRects_.clear(); + drawn_ = false; + } } } @@ -199,10 +217,9 @@ int menu::process(int x, int y, bool button,bool up_arrow,bool down_arrow, itemRects_.clear(); drawn_ = false; } - const bool down = downarrow_.process(x,y,button); if(down && first_item_on_screen_ + max_menu_items < items_.size()) { - ++first_item_on_screen_; + ++first_item_on_screen_; itemRects_.clear(); drawn_ = false; }