mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
only display the ante tab when playing for ante
Closes: core-developers/forge#381 Signed-off-by: Jamin W. Collins <jamin.collins@gmail.com>
This commit is contained in:
@@ -432,7 +432,9 @@ public final class SLayoutIO {
|
||||
for(EDocID edoc : kv.getValue()) {
|
||||
try {
|
||||
//System.out.println(String.format("adding doc %s -> %s", edoc, edoc.getDoc()));
|
||||
cell.addDoc(edoc.getDoc());
|
||||
if (edoc.getDoc() != null ) {
|
||||
cell.addDoc(edoc.getDoc());
|
||||
}
|
||||
}
|
||||
catch (IllegalArgumentException e) {
|
||||
System.err.println("Failed to get doc for " + edoc);
|
||||
|
||||
@@ -28,6 +28,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.prefs.Preferences;
|
||||
|
||||
import javax.swing.JMenu;
|
||||
import javax.swing.JPopupMenu;
|
||||
@@ -143,7 +144,12 @@ public final class CMatchUI
|
||||
this.myDocs = new EnumMap<EDocID, IVDoc<? extends ICDoc>>(EDocID.class);
|
||||
this.myDocs.put(EDocID.CARD_PICTURE, cDetailPicture.getCPicture().getView());
|
||||
this.myDocs.put(EDocID.CARD_DETAIL, cDetailPicture.getCDetail().getView());
|
||||
this.myDocs.put(EDocID.CARD_ANTES, cAntes.getView());
|
||||
// only create an ante doc if playing for ante
|
||||
if (isPreferenceEnabled(FPref.UI_ANTE)) {
|
||||
this.myDocs.put(EDocID.CARD_ANTES, cAntes.getView());
|
||||
} else {
|
||||
this.myDocs.put(EDocID.CARD_ANTES, null);
|
||||
}
|
||||
this.myDocs.put(EDocID.REPORT_MESSAGE, getCPrompt().getView());
|
||||
this.myDocs.put(EDocID.REPORT_STACK, getCStack().getView());
|
||||
this.myDocs.put(EDocID.REPORT_COMBAT, cCombat.getView());
|
||||
@@ -158,6 +164,10 @@ public final class CMatchUI
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isPreferenceEnabled(final ForgePreferences.FPref preferenceName) {
|
||||
return FModel.getPreferences().getPrefBoolean(preferenceName);
|
||||
}
|
||||
|
||||
FScreen getScreen() {
|
||||
return this.screen;
|
||||
}
|
||||
@@ -486,6 +496,9 @@ public final class CMatchUI
|
||||
updatePlayerControl();
|
||||
KeyboardShortcuts.attachKeyboardShortcuts(this);
|
||||
for (final IVDoc<? extends ICDoc> view : myDocs.values()) {
|
||||
if (view == null) {
|
||||
continue;
|
||||
}
|
||||
final ICDoc layoutControl = view.getLayoutControl();
|
||||
layoutControl.initialize();
|
||||
layoutControl.update();
|
||||
|
||||
Reference in New Issue
Block a user