mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
alldecks - enabled list of all decks
This commit is contained in:
@@ -86,11 +86,13 @@ public class ImageCache {
|
||||
if (null != cached) {
|
||||
return cached;
|
||||
}
|
||||
|
||||
boolean mayEnlarge = Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_SCALE_LARGER);
|
||||
|
||||
BufferedImage original = getImage(key);
|
||||
double scale = Math.min((double) width / original.getWidth(), (double) height / original.getHeight());
|
||||
// here would be the place to limit the scaling option in menu ?
|
||||
if ((scale > 1) && !Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_SCALE_LARGER)) {
|
||||
if ((scale > 1) && !mayEnlarge) {
|
||||
scale = 1;
|
||||
}
|
||||
|
||||
@@ -103,8 +105,8 @@ public class ImageCache {
|
||||
ResampleOp resampler = new ResampleOp(destWidth, destHeight);
|
||||
|
||||
result = resampler.filter(original, null);
|
||||
CACHE.put(resizedKey, result);
|
||||
}
|
||||
CACHE.put(resizedKey, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ public class DeckgenUtil {
|
||||
* @param selection {java.lang.String}
|
||||
* @return {@link forge.deck.Deck}
|
||||
*/
|
||||
public static Deck buildCustomDeck(final String[] selection) {
|
||||
public static Deck getConstructedDeck(final String[] selection) {
|
||||
return Singletons.getModel().getDecks().getConstructed().get(selection[0]);
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ public enum VAllDecks implements IVDoc<CAllDecks> {
|
||||
|
||||
parentCell.getBody().add(btnImport, "w 120px!, h 30px!, gap 0 0 5px 5px");
|
||||
|
||||
//parentCell.getBody().add(scroller, "w 96%!, h 96%!, gap 2% 0 2% 0");
|
||||
parentCell.getBody().add(scroller, "w 96%!, growy, pushy, gap 2% 0 2% 0");
|
||||
}
|
||||
|
||||
//========== Retrieval methods
|
||||
|
||||
@@ -245,7 +245,7 @@ public enum CSubmenuGauntletBuild implements ICDoc {
|
||||
deckToAdd = DeckgenUtil.buildThemeDeck(selection);
|
||||
}
|
||||
else {
|
||||
deckToAdd = DeckgenUtil.buildCustomDeck(selection);
|
||||
deckToAdd = DeckgenUtil.getConstructedDeck(selection);
|
||||
}
|
||||
|
||||
workingDecks.add(deckToAdd);
|
||||
|
||||
@@ -230,7 +230,7 @@ public enum CSubmenuGauntletContests implements ICDoc {
|
||||
userDeck = DeckgenUtil.buildThemeDeck(selection);
|
||||
}
|
||||
else {
|
||||
userDeck = DeckgenUtil.buildCustomDeck(selection);
|
||||
userDeck = DeckgenUtil.getConstructedDeck(selection);
|
||||
}
|
||||
gd.setUserDeck(userDeck);
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ public enum CSubmenuGauntletQuick implements ICDoc {
|
||||
userDeck = DeckgenUtil.buildThemeDeck(selection);
|
||||
}
|
||||
else {
|
||||
userDeck = DeckgenUtil.buildCustomDeck(selection);
|
||||
userDeck = DeckgenUtil.getConstructedDeck(selection);
|
||||
}
|
||||
|
||||
// Generate gauntlet decks
|
||||
|
||||
@@ -271,7 +271,7 @@ public class FDeckChooser extends JPanel {
|
||||
}
|
||||
// Custom deck
|
||||
else if (lst0.getName().equals(ESubmenuConstructedTypes.CUSTOM.toString())) {
|
||||
deck = DeckgenUtil.buildCustomDeck(selection);
|
||||
deck = DeckgenUtil.getConstructedDeck(selection);
|
||||
}
|
||||
// Failure, for some reason
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user