diff --git a/Mage.Client/src/main/java/mage/client/cards/CardIconsPanel.java b/Mage.Client/src/main/java/mage/client/cards/CardIconsPanel.java index 8df9078a740..629de0be28a 100644 --- a/Mage.Client/src/main/java/mage/client/cards/CardIconsPanel.java +++ b/Mage.Client/src/main/java/mage/client/cards/CardIconsPanel.java @@ -327,8 +327,10 @@ public class CardIconsPanel extends JPanel { BufferedImage iconImageWithText = ImageManagerImpl.deepCopy(iconImageCached); // must copy cached value before modify // text + String hint = ManaSymbols.replaceSymbolsWithHTML(icon.getHint(), ManaSymbols.Type.CARD_ICON_HINT); + hint = GUISizeHelper.textToHtmlWithSize(hint, GUISizeHelper.cardTooltipFontSize); JLabel label = new JLabel(); - label.setToolTipText("" + ManaSymbols.replaceSymbolsWithHTML(icon.getHint(), ManaSymbols.Type.CARD_ICON_HINT)); + label.setToolTipText("" + hint); if (!icon.getText().isEmpty()) { Graphics2D g2 = iconImageWithText.createGraphics(); try { diff --git a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java index fd383ceef0a..0aea74ac2eb 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java @@ -568,7 +568,7 @@ public class PreferencesDialog extends javax.swing.JDialog { createSizeSetting(4, KEY_GUI_CARD_EDITOR_SIZE,14, false, "Size of cards in editor and draft panels", "The size of the card in editor and the picked zone of the draft panel "); createSizeSetting(5, KEY_GUI_CARD_OFFSET_SIZE,14, false, "Offset of card's image", "The vertical offset of card images in editor areas "); // TODO: delete createSizeSetting(6, KEY_GUI_ENLARGED_IMAGE_SIZE, 20, false, "Size of popup card hint (image mode by mouse wheel)", "The size of the image shown for the card your mouse pointer
is located over while you turn the mouse wheel"); - createSizeSetting(7, KEY_GUI_TOOLTIP_SIZE,14, false, "Size of popup card hint (text mode)", "The size of the tooltip window for cards or permanents"); // TODO: share with popup image + createSizeSetting(7, KEY_GUI_TOOLTIP_SIZE,14, true, "Size of popup card hint (text mode)", "The size of the tooltip window for cards or permanents"); // TODO: share with popup image // game createSizeSetting(8, KEY_GUI_PLAYER_PANEL_SIZE,14, false, "Size of player panel", "The size of the player panels on battlefield"); createSizeSetting(9, KEY_GUI_CARD_HAND_SIZE,14, false, "Size of cards in hand and stack", "The size of the card images in hand and on the stack"); diff --git a/Mage.Client/src/main/java/mage/client/game/GamePanel.java b/Mage.Client/src/main/java/mage/client/game/GamePanel.java index d07e981f1c3..e87fb9edcb0 100644 --- a/Mage.Client/src/main/java/mage/client/game/GamePanel.java +++ b/Mage.Client/src/main/java/mage/client/game/GamePanel.java @@ -1997,7 +1997,7 @@ public final class GamePanel extends javax.swing.JPanel { @SuppressWarnings("unchecked") private void initComponents() { - abilityPicker = new mage.client.components.ability.AbilityPicker(); + abilityPicker = new mage.client.components.ability.AbilityPicker(GUISizeHelper.dialogsGuiScale); jSplitPane1 = new javax.swing.JSplitPane(); jSplitPane0 = new javax.swing.JSplitPane(); jPanel2 = new javax.swing.JPanel(); diff --git a/Mage.Client/src/main/java/mage/client/util/GUISizeHelper.java b/Mage.Client/src/main/java/mage/client/util/GUISizeHelper.java index cfcadb59fec..e622b1b6ffd 100644 --- a/Mage.Client/src/main/java/mage/client/util/GUISizeHelper.java +++ b/Mage.Client/src/main/java/mage/client/util/GUISizeHelper.java @@ -149,6 +149,9 @@ public final class GUISizeHelper { cardTooltipFontSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_TOOLTIP_SIZE, 14); symbolTooltipSize = cardTooltipFontSize; + // control's tooltip on mouse move + UIManager.put("ToolTip.font", getCardFont().deriveFont(cardTooltipFontSize * 1.0f)); + int handCardSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_CARD_HAND_SIZE, 14); handCardDimension = new Dimension(CARD_IMAGE_WIDTH * handCardSize / 42, CARD_IMAGE_HEIGHT * handCardSize / 42); stackWidth = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_STACK_WIDTH, 30); @@ -238,8 +241,12 @@ public final class GUISizeHelper { } public static String textToHtmlWithSize(String text, Font font) { + return textToHtmlWithSize(text, font.getSize()); + } + + public static String textToHtmlWithSize(String text, int fontSize) { if (text != null && !text.toLowerCase(Locale.ENGLISH).startsWith("")) { - return "

" + text + "

"; + return "

" + text + "

"; } return text; } diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/ManaSymbols.java b/Mage.Client/src/main/java/org/mage/card/arcane/ManaSymbols.java index ea27f1d60ab..d23a5e3d7d4 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/ManaSymbols.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/ManaSymbols.java @@ -621,9 +621,9 @@ public final class ManaSymbols { symbolSize = GUISizeHelper.symbolDialogSize; break; case TOOLTIP: + case CARD_ICON_HINT: symbolSize = GUISizeHelper.symbolTooltipSize; break; - case CARD_ICON_HINT: default: symbolSize = 11; break; diff --git a/Mage.Common/src/main/java/mage/view/PlayerView.java b/Mage.Common/src/main/java/mage/view/PlayerView.java index 41101fa5a35..21f8ad3d5b3 100644 --- a/Mage.Common/src/main/java/mage/view/PlayerView.java +++ b/Mage.Common/src/main/java/mage/view/PlayerView.java @@ -97,17 +97,13 @@ public class PlayerView implements Serializable { sideboard.put(card.getId(), new CardView(card, game, CardUtil.canShowAsControlled(card, createdForPlayerId))); } } - - try { - for (Permanent permanent : state.getBattlefield().getAllPermanents()) { - if (showInBattlefield(permanent, state)) { - PermanentView view = new PermanentView(permanent, game.getCard(permanent.getId()), createdForPlayerId, game); - battlefield.put(view.getId(), view); - } + for (Permanent permanent : state.getBattlefield().getAllPermanents()) { + if (showInBattlefield(permanent, state)) { + PermanentView view = new PermanentView(permanent, game.getCard(permanent.getId()), createdForPlayerId, game); + battlefield.put(view.getId(), view); } - } catch (ConcurrentModificationException e) { - // can happen as a player left battlefield while PlayerView is created } + Card cardOnTop = (player.isTopCardRevealed() && player.getLibrary().hasCards()) ? player.getLibrary().getFromTop(game) : null; this.topCard = cardOnTop != null ? new CardView(cardOnTop, game) : null;