Allow multiple icons at the top right of player avatar (#12169)

This commit is contained in:
Alexander Novotny 2024-04-22 23:58:43 -04:00 committed by GitHub
parent 42906f519b
commit 9f52c8946e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 9 deletions

View file

@ -400,20 +400,20 @@ public class PlayerPanelExt extends javax.swing.JPanel {
tooltipText.append("<br/>Match time remaining: ").append(getPriorityTimeLeftString(player));
// designations
this.avatar.setTopTextImageRight(null);
this.avatar.clearTopTextImagesRight();
for (String name : player.getDesignationNames()) {
tooltipText.append("<br/>").append(name);
if (DesignationType.CITYS_BLESSING.toString().equals(name)) {
this.avatar.setTopTextImageRight(ImageHelper.getImageFromResources("/info/city_blessing.png"));
this.avatar.addTopTextImageRight(ImageHelper.getImageFromResources("/info/city_blessing.png"));
}
}
if (player.isMonarch()) {
tooltipText.append("<br/>").append("The Monarch");
this.avatar.setTopTextImageRight(ImageHelper.getImageFromResources("/info/crown.png"));
this.avatar.addTopTextImageRight(ImageHelper.getImageFromResources("/info/crown.png"));
}
if (player.isInitiative()) {
tooltipText.append("<br/>").append("Have the Initiative");
this.avatar.setTopTextImageRight(ImageHelper.getImageFromResources("/info/initiative.png"));
this.avatar.addTopTextImageRight(ImageHelper.getImageFromResources("/info/initiative.png"));
}
// counters