Skip to content

Commit

Permalink
tunit_create: add attack details to type summary
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Oct 20, 2015
1 parent cd9c23f commit d3e04c6
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/gui/dialogs/unit_create.cpp
Expand Up @@ -33,6 +33,7 @@
#include "gui/widgets/toggle_button.hpp"
#include "gui/widgets/window.hpp"
#include "display.hpp"
#include "marked-up_text.hpp"
#include "help/help.hpp"
#include "game_config.hpp"
#include "gettext.hpp"
Expand Down Expand Up @@ -271,6 +272,30 @@ void tunit_create::print_stats(std::stringstream& str, const int row)
str << name << "\n";
}
}**/

str << " \n";

// Print attack details
BOOST_FOREACH(const attack_type& a, u->attacks())
{
str << "<span color='#f5e6c1'>" << a.num_attacks()
<< font::weapon_numbers_sep << a.damage() << " " << a.name() << "</span>" << "\n";

str << "<span color='#a69275'>" << " " << a.range()
<< font::weapon_details_sep << a.type() << "</span>" << "\n";

const std::string special = a.weapon_specials();
if (!special.empty()) {
str << "<span color='#a69275'>" << " " << special << "</span>" << "\n";
}

const std::string accuracy_parry = a.accuracy_parry_description();
if(!accuracy_parry.empty()) {
str << "<span color='#a69275'>" << " " << accuracy_parry << "</span>" << "\n";
}

str << " \n";
}
}

void tunit_create::list_item_clicked(twindow& window)
Expand Down

0 comments on commit d3e04c6

Please sign in to comment.