Auto-hide floating zone window after last card removed from it

Reduce default size of zone windows slightly
This commit is contained in:
drdev
2014-11-26 17:11:29 +00:00
parent 352d7aeacd
commit 4ba11947ca
2 changed files with 11 additions and 1 deletions

View File

@@ -249,7 +249,7 @@ public class FloatingCardArea extends CardArea {
} }
//fallback default size //fallback default size
FFrame mainFrame = Singletons.getView().getFrame(); FFrame mainFrame = Singletons.getView().getFrame();
window.setSize(mainFrame.getWidth() / 4, mainFrame.getHeight() * 2 / 3); window.setSize(mainFrame.getWidth() / 5, mainFrame.getHeight() / 2);
} }
public void refresh() { public void refresh() {
@@ -270,8 +270,16 @@ public class FloatingCardArea extends CardArea {
cardPanels.add(cardPanel); cardPanels.add(cardPanel);
} }
} }
boolean hadCardPanels = getCardPanels().size() > 0;
setCardPanels(cardPanels); setCardPanels(cardPanels);
window.setTitle(String.format(title, cardPanels.size())); window.setTitle(String.format(title, cardPanels.size()));
//if window had cards and now doesn't, hide window
//(e.g. cast final card from Flashback zone)
if (hadCardPanels && cardPanels.size() == 0) {
window.setVisible(false);
}
} }
@Override @Override

View File

@@ -19,6 +19,8 @@ You can still customize these by clicking on the phase stop indicator, and your
- Zone Window Improvements - - Zone Window Improvements -
Popup windows for zones (Hand, Library, Graveyard, Exile, Flashback) will now remember their position and size between sessions. Human and AI zones will each be remembered separately. Popup windows for zones (Hand, Library, Graveyard, Exile, Flashback) will now remember their position and size between sessions. Human and AI zones will each be remembered separately.
Clicking the zone icon under a player's avatar will now hide the zone window if its currently open. Clicking the zone icon under a player's avatar will now hide the zone window if its currently open.
After the last card is removed from a zone window, that window will now automatically be hidden. An example of this would be casting the last card in the Flashback zone.
Default size of zone windows has been slightly reduced.
--------- ---------
New Cards New Cards