From 2e3ba7e10494678980870761f76cafe927bd0aba Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 13 Jan 2018 18:55:07 +0100 Subject: [PATCH] Added designation names to player tooltip. --- .../java/mage/client/game/PlayerPanelExt.java | 11 ++++++++--- .../src/main/resources/info/city_blessing.png | Bin 0 -> 712 bytes .../src/main/java/mage/view/PlayerView.java | 10 +++++++++- .../main/java/mage/designations/Designation.java | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 Mage.Client/src/main/resources/info/city_blessing.png diff --git a/Mage.Client/src/main/java/mage/client/game/PlayerPanelExt.java b/Mage.Client/src/main/java/mage/client/game/PlayerPanelExt.java index 2ac0690b54..5722b74785 100644 --- a/Mage.Client/src/main/java/mage/client/game/PlayerPanelExt.java +++ b/Mage.Client/src/main/java/mage/client/game/PlayerPanelExt.java @@ -76,6 +76,7 @@ import static mage.constants.Constants.MIN_AVATAR_ID; import mage.constants.ManaType; import mage.counters.Counter; import mage.counters.CounterType; +import mage.designations.DesignationType; import mage.remote.Session; import mage.utils.timer.PriorityTimer; import mage.view.CardView; @@ -333,11 +334,15 @@ public class PlayerPanelExt extends javax.swing.JPanel { } // Extend tooltip StringBuilder tooltipText = new StringBuilder(basicTooltipText); + this.avatar.setTopTextImageRight(null); + for (String name : player.getDesignationNames()) { + tooltipText.append("
").append(name); + if (DesignationType.CITYS_BLESSING.toString().equals(name)) { + this.avatar.setTopTextImageRight(ImageHelper.getImageFromResources("/info/city_blessing.png")); + } + } if (player.isMonarch()) { - tooltipText.append("
Monarch"); this.avatar.setTopTextImageRight(ImageHelper.getImageFromResources("/info/crown.png")); - } else { - this.avatar.setTopTextImageRight(null); } for (Counter counter : player.getCounters().values()) { tooltipText.append("
").append(counter.getName()).append(" counters: ").append(counter.getCount()); diff --git a/Mage.Client/src/main/resources/info/city_blessing.png b/Mage.Client/src/main/resources/info/city_blessing.png new file mode 100644 index 0000000000000000000000000000000000000000..4cbc973a36ee7d5970305eb8b3e69ecc8514c5ad GIT binary patch literal 712 zcmV;(0yq7MP)`VHk(6=iU3d53NmOCf2aVOv7pA<{}jh4;JQ$ zbP(i!;8D;)e?mkDLSUyJBoyqRqe$vNm`#FGDla%GCt*s znD_u4g)U&^!MJ3{ec6sX4~A%kH$ab=_!ysZNxs` z`L}zl-~Yib!GT(xj$X+Ns;`>HP6rJDe{*C`=v3LY0w7pTU89cUqy?kcv|L{J!j;}a z5iJT@thfP^IWkKoi54r)!xpz%aW0u8l6f*v$kmDips^5Btv2jGGbC42B<2s;Y_%Pk zOAs5*xqUWQQzSMrBrn>q^D(A$=B5)v4oshoIsl)Q+IWhD%YwBW@GHyy^%~9`#)A$_ z=B5)GlAV3<>E(9ikCoCCQXW72{Avry&KAbF+dm}n$p0J?%GTa$?3z%R(i7*6g00000 designationNames = new ArrayList<>(); public PlayerView(Player player, GameState state, Game game, UUID createdForPlayerId, UUID watcherUserId) { this.playerId = player.getId(); @@ -164,6 +165,9 @@ public class PlayerView implements Serializable { this.passedUntilStackResolved = player.getPassedUntilStackResolved(); this.passedUntilEndStepBeforeMyTurn = player.getPassedUntilEndStepBeforeMyTurn(); this.monarch = player.getId().equals(game.getMonarchId()); + for (Designation designation : player.getDesignations()) { + this.designationNames.add(designation.getName()); + } } private boolean showInBattlefield(Permanent permanent, GameState state) { @@ -305,4 +309,8 @@ public class PlayerView implements Serializable { return monarch; } + public List getDesignationNames() { + return designationNames; + } + } diff --git a/Mage/src/main/java/mage/designations/Designation.java b/Mage/src/main/java/mage/designations/Designation.java index ffd52dd4f0..44d7ba62ab 100644 --- a/Mage/src/main/java/mage/designations/Designation.java +++ b/Mage/src/main/java/mage/designations/Designation.java @@ -52,7 +52,7 @@ public abstract class Designation implements MageObject { } public Designation(DesignationType designationType, String expansionSetCode, boolean unique) { - this.name = designationType.name(); + this.name = designationType.toString(); this.designationType = designationType; this.id = UUID.randomUUID(); this.frameStyle = FrameStyle.M15_NORMAL;