mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-30 11:53:48 +00:00
Attack Enemy: Inactive weapon specials are now shown muted, rather than elided altogether.
This commit is contained in:
parent
e569d896d8
commit
3c9f425a6c
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include "display.hpp"
|
#include "display.hpp"
|
||||||
#include "display_context.hpp"
|
#include "display_context.hpp"
|
||||||
|
#include "font/text_formatting.hpp"
|
||||||
#include "game_board.hpp"
|
#include "game_board.hpp"
|
||||||
#include "lexical_cast.hpp"
|
#include "lexical_cast.hpp"
|
||||||
#include "log.hpp"
|
#include "log.hpp"
|
||||||
@ -705,13 +706,14 @@ std::string attack_type::weapon_specials(bool only_active, bool is_backstab) con
|
|||||||
std::string res;
|
std::string res;
|
||||||
for (const config::any_child &sp : specials_.all_children_range())
|
for (const config::any_child &sp : specials_.all_children_range())
|
||||||
{
|
{
|
||||||
if ( only_active && !special_active(sp.cfg, AFFECT_EITHER, is_backstab) )
|
const bool active = special_active(sp.cfg, AFFECT_EITHER, is_backstab);
|
||||||
continue;
|
|
||||||
|
|
||||||
const std::string& name = sp.cfg["name"].str();
|
const std::string& name = sp.cfg["name"].str();
|
||||||
if (!name.empty()) {
|
if (!name.empty()) {
|
||||||
if (!res.empty()) res += ", ";
|
if (!res.empty()) res += ", ";
|
||||||
|
if (only_active && !active) res += font::span_color(font::inactive_details_color);
|
||||||
res += name;
|
res += name;
|
||||||
|
if (only_active && !active) res += "</span>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user