From 85c1ad1ef92aa564faa107425820342e367578fa Mon Sep 17 00:00:00 2001 From: Andrettin Date: Fri, 1 Jan 2016 17:21:01 +0100 Subject: [PATCH] UI condition "Unique" now returns true if the unit has a character, too --- src/map/map_draw.cpp | 6 +++--- src/ui/botpanel.cpp | 2 +- src/ui/mainscr.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/map/map_draw.cpp b/src/map/map_draw.cpp index 55f28bada..54c180780 100644 --- a/src/map/map_draw.cpp +++ b/src/map/map_draw.cpp @@ -478,10 +478,10 @@ void CViewport::Draw() const PixelPos unit_center_pos = Map.TilePosToMapPixelPos_TopLeft(UnitUnderCursor->tilePos); unit_center_pos = MapToScreenPixelPos(unit_center_pos); std::string text_color; - if (UnitUnderCursor->Unique) { - text_color = "orange"; + if (UnitUnderCursor->Unique || UnitUnderCursor->Character != NULL) { + text_color = "fire"; } else if (UnitUnderCursor->Prefix != NULL || UnitUnderCursor->Suffix != NULL) { - text_color = "blue"; + text_color = "light-blue"; } DrawGenericPopup(UnitUnderCursor->GetMessageName(), unit_center_pos.x, unit_center_pos.y, text_color); //Wyrmgus end diff --git a/src/ui/botpanel.cpp b/src/ui/botpanel.cpp index f198a9674..11825bff3 100644 --- a/src/ui/botpanel.cpp +++ b/src/ui/botpanel.cpp @@ -475,7 +475,7 @@ static bool CanShowPopupContent(const PopupConditionPanel *condition, } } if (condition->Unique != CONDITION_TRUE) { - if ((condition->Unique == CONDITION_ONLY) ^ unit.Unique) { + if ((condition->Unique == CONDITION_ONLY) ^ (unit.Unique || unit.Character != NULL)) { return false; } } diff --git a/src/ui/mainscr.cpp b/src/ui/mainscr.cpp index f6e0d2d38..ab5b729e1 100644 --- a/src/ui/mainscr.cpp +++ b/src/ui/mainscr.cpp @@ -286,7 +286,7 @@ static bool CanShowContent(const ConditionPanel *condition, const CUnit &unit) } } if (condition->Unique != CONDITION_TRUE) { - if ((condition->Unique == CONDITION_ONLY) ^ unit.Unique) { + if ((condition->Unique == CONDITION_ONLY) ^ (unit.Unique || unit.Character != NULL)) { return false; } }