Author: shadowmaster
Date: Sun Dec  7 20:45:43 2008
New Revision: 31354

URL: http://svn.gna.org/viewcvs/wesnoth?rev=31354&view=rev
Log:
All dialogs using the units_list_preview_pane and
unit_types_preview_pane facilities (create-unit, recall-unit,
recruit-unit and unit-list) display the selection's race.

Modified:
    trunk/changelog
    trunk/src/dialogs.cpp
    trunk/src/dialogs.hpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=31354&r1=31353&r2=31354&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Sun Dec  7 20:45:43 2008
@@ -34,6 +34,8 @@
  * Unit changes and balancing:
    * Increased the cost of the Goblin Spearman from 8 to 9.
  * User interface:
+   * Recruit, recall, unit-list and create-unit dialogs display the
+     selected unit/unit-type's race.
    * Rewrote the layout algorithm for the new widgets.
    * Fixed the font loading when the data directory is overridden.
    * Removed text wrapping around background image in story screens; it is

Modified: trunk/src/dialogs.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/dialogs.cpp?rev=31354&r1=31353&r2=31354&view=diff
==============================================================================
--- trunk/src/dialogs.cpp (original)
+++ trunk/src/dialogs.cpp Sun Dec  7 20:45:43 2008
@@ -720,6 +720,7 @@
        image(),
        name(),
        type_name(),
+       race(),
        level(0),
        alignment(),
        traits(),
@@ -835,6 +836,7 @@
 
        std::stringstream text;
        text << det.type_name << "\n"
+               << det.race << "\n"
                << font::BOLD_TEXT << _("level") << " " << det.level << "\n"
                << det.alignment << "\n"
                << det.traits << "\n";
@@ -934,6 +936,9 @@
 
        det.name = u.name();
        det.type_name = u.type_name();
+       if(u.race() != NULL) {
+               det.race = u.race()->name(u.gender());
+       }
        det.level = u.level();
        det.alignment = unit_type::alignment_description(u.alignment(), 
u.gender());
        det.traits = u.traits_description();
@@ -997,6 +1002,13 @@
        det.type_name = t->type_name();
        det.level = t->level();
        det.alignment = unit_type::alignment_description(t->alignment(), 
t->genders().front());
+       
+       race_map const& rcm = unit_type_data::types().races();
+       race_map::const_iterator ri = rcm.find(t->race());
+       if(ri != rcm.end()) {
+               assert(t->genders().empty() != true);
+               det.race = (*ri).second.name(t->genders().front());
+       }
 
        //FIXME: This probably must be move into a unit_type function
        const std::vector<config*> traits = t->possible_traits();

Modified: trunk/src/dialogs.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/dialogs.hpp?rev=31354&r1=31353&r2=31354&view=diff
==============================================================================
--- trunk/src/dialogs.hpp (original)
+++ trunk/src/dialogs.hpp Sun Dec  7 20:45:43 2008
@@ -82,7 +82,7 @@
                details();
 
                surface image;
-               std::string name, type_name;
+               std::string name, type_name, race;
                int level;
                std::string alignment, traits;
                std::vector<t_string> abilities;


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to