diff --git a/changelog b/changelog index 6edff4d298d..0818a1d3780 100644 --- a/changelog +++ b/changelog @@ -43,7 +43,8 @@ Version 1.11.7+dev: * Moved color cursors option to Advanced Preferences. * Always hide and disable color cursors option on Mac OS X since it's known to cause severe lags that render the cursor unusable. - * Unit overlays are now displayed in the Recall dialog list and side panel. + * Unit overlays are now displayed in the Recall dialog, both on the list + and the description panel. * WML engine: * WML variable turn_number is set correctly (to 1) in prestart and start events. Previously, it retained its last value from the previous scenario diff --git a/src/dialogs.cpp b/src/dialogs.cpp index c8b600d0062..ec9e55a41ea 100644 --- a/src/dialogs.cpp +++ b/src/dialogs.cpp @@ -1029,7 +1029,8 @@ unit_preview_pane::details::details() : xp_color(), movement_left(0), total_movement(0), - attacks() + attacks(), + overlays() { } @@ -1115,6 +1116,18 @@ void unit_preview_pane::draw_contents() sdl_blit(unit_image,NULL,screen,&rect); image_rect = rect; + + if(!det.overlays.empty()) { + BOOST_FOREACH(const std::string& overlay, det.overlays) { + surface os = image::get_image(overlay); + + if(os->w > rect.w || os->h > rect.h) { + os = scale_surface(os, rect.w, rect.h, false); + } + + sdl_blit(os, NULL, screen, &rect); + } + } } // Place the 'unit profile' button @@ -1281,6 +1294,15 @@ const unit_preview_pane::details units_list_preview_pane::get_details() const det.total_movement= u.total_movement(); det.attacks = u.attacks(); + + if(u.can_recruit()) { + det.overlays.push_back(unit::leader_crown()); + }; + + BOOST_FOREACH(const std::string& overlay, u.overlays()) { + det.overlays.push_back(overlay); + } + return det; } diff --git a/src/dialogs.hpp b/src/dialogs.hpp index f232a30b9f4..2449fd06990 100644 --- a/src/dialogs.hpp +++ b/src/dialogs.hpp @@ -99,6 +99,7 @@ public: std::string hp_color, xp_color; int movement_left, total_movement; std::vector attacks; + std::vector overlays; }; unit_preview_pane(const gui::filter_textbox *filter = NULL,