Skip to content

Commit

Permalink
UI condition "Unique" now returns true if the unit has a character, too
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrettin committed Jan 1, 2016
1 parent 408eba4 commit 85c1ad1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/map/map_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ui/botpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/mainscr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 85c1ad1

Please sign in to comment.