mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Introduced a preference to turn the panel on/off.
This commit is contained in:
@@ -246,6 +246,7 @@ public enum CSubmenuPreferences implements ICDoc {
|
||||
initializeMulliganRuleComboBox();
|
||||
initializeAiProfilesComboBox();
|
||||
initializeStackAdditionsComboBox();
|
||||
initializeLandPlayedComboBox();
|
||||
initializeColorIdentityCombobox();
|
||||
initializeAutoYieldModeComboBox();
|
||||
initializeCounterDisplayTypeComboBox();
|
||||
@@ -447,7 +448,17 @@ public enum CSubmenuPreferences implements ICDoc {
|
||||
final String selectedItem = this.prefs.getPref(userSetting);
|
||||
panel.setComboBox(comboBox, selectedItem);
|
||||
}
|
||||
|
||||
|
||||
private void initializeLandPlayedComboBox() {
|
||||
final String[] elems = {ForgeConstants.LAND_PLAYED_NOTIFICATION_NEVER, ForgeConstants.LAND_PLAYED_NOTIFICATION_ALWAYS,
|
||||
ForgeConstants.LAND_PLAYED_NOTIFICATION_AI};
|
||||
final FPref userSetting = FPref.UI_LAND_PLAYED_NOTIFICATION_POLICY;
|
||||
final FComboBoxPanel<String> panel = this.view.getCbpLandPlayedComboBoxPanel();
|
||||
final FComboBox<String> comboBox = createComboBox(elems, userSetting);
|
||||
final String selectedItem = this.prefs.getPref(userSetting);
|
||||
panel.setComboBox(comboBox, selectedItem);
|
||||
}
|
||||
|
||||
private void initializeColorIdentityCombobox() {
|
||||
final String[] elems = {ForgeConstants.DISP_CURRENT_COLORS_NEVER, ForgeConstants.DISP_CURRENT_COLORS_CHANGED,
|
||||
ForgeConstants.DISP_CURRENT_COLORS_MULTICOLOR, ForgeConstants.DISP_CURRENT_COLORS_MULTI_OR_CHANGED,
|
||||
|
||||
@@ -120,6 +120,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
private final FComboBoxPanel<String> cbpMulliganRule = new FComboBoxPanel<>(localizer.getMessage("cbpMulliganRule")+":");
|
||||
private final FComboBoxPanel<String> cbpAiProfiles = new FComboBoxPanel<>(localizer.getMessage("cbpAiProfiles")+":");
|
||||
private final FComboBoxPanel<String> cbpStackAdditions = new FComboBoxPanel<>(localizer.getMessage("cbpStackAdditions")+":");
|
||||
private final FComboBoxPanel<String> cbpLandPlayed = new FComboBoxPanel<>(localizer.getMessage("cbpLandPlayed")+":");
|
||||
private final FComboBoxPanel<String> cbpDisplayCurrentCardColors = new FComboBoxPanel<>(localizer.getMessage("cbpDisplayCurrentCardColors")+":");
|
||||
private final FComboBoxPanel<String> cbpAutoYieldMode = new FComboBoxPanel<>(localizer.getMessage("cbpAutoYieldMode")+":");
|
||||
private final FComboBoxPanel<String> cbpCounterDisplayType = new FComboBoxPanel<>(localizer.getMessage("cbpCounterDisplayType")+":");
|
||||
@@ -205,6 +206,9 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
|
||||
pnlPrefs.add(cbpStackAdditions, comboBoxConstraints);
|
||||
pnlPrefs.add(new NoteLabel(localizer.getMessage("nlpStackAdditions")), descriptionConstraints);
|
||||
|
||||
pnlPrefs.add(cbpLandPlayed, comboBoxConstraints);
|
||||
pnlPrefs.add(new NoteLabel(localizer.getMessage("nlpLandPlayed")), descriptionConstraints);
|
||||
|
||||
pnlPrefs.add(cbEnforceDeckLegality, titleConstraints);
|
||||
pnlPrefs.add(new NoteLabel(localizer.getMessage("nlEnforceDeckLegality")), descriptionConstraints);
|
||||
@@ -684,6 +688,10 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
public FComboBoxPanel<String> getCbpStackAdditionsComboBoxPanel() {
|
||||
return cbpStackAdditions;
|
||||
}
|
||||
|
||||
public FComboBoxPanel<String> getCbpLandPlayedComboBoxPanel() {
|
||||
return cbpLandPlayed;
|
||||
}
|
||||
|
||||
public FComboBoxPanel<GameLogEntryType> getGameLogVerbosityComboBoxPanel() {
|
||||
return cbpGameLogEntryType;
|
||||
|
||||
@@ -1450,38 +1450,42 @@ public final class CMatchUI
|
||||
}
|
||||
|
||||
private void createLandPopupPanel(Card land, Zone zone) {
|
||||
String title = "Forge";
|
||||
List<String> options = ImmutableList.of(Localizer.getInstance().getMessage("lblOK"));
|
||||
|
||||
MigLayout migLayout = new MigLayout("insets 15, left, gap 30, fill");
|
||||
JPanel mainPanel = new JPanel(migLayout);
|
||||
final Dimension parentSize = JOptionPane.getRootFrame().getSize();
|
||||
Dimension maxSize = new Dimension(1400, parentSize.height - 100);
|
||||
mainPanel.setMaximumSize(maxSize);
|
||||
mainPanel.setOpaque(false);
|
||||
|
||||
int rotation = getRotation(land.getView());
|
||||
String landPlayedNotificationPolicy = FModel.getPreferences().getPref(FPref.UI_LAND_PLAYED_NOTIFICATION_POLICY);
|
||||
Player cardController = land.getController();
|
||||
boolean isAi = cardController.isAI();
|
||||
if(ForgeConstants.LAND_PLAYED_NOTIFICATION_ALWAYS.equals(landPlayedNotificationPolicy) || (ForgeConstants.LAND_PLAYED_NOTIFICATION_AI.equals(landPlayedNotificationPolicy) && (isAi))) {
|
||||
String title = "Forge";
|
||||
List<String> options = ImmutableList.of(Localizer.getInstance().getMessage("lblOK"));
|
||||
|
||||
MigLayout migLayout = new MigLayout("insets 15, left, gap 30, fill");
|
||||
JPanel mainPanel = new JPanel(migLayout);
|
||||
final Dimension parentSize = JOptionPane.getRootFrame().getSize();
|
||||
Dimension maxSize = new Dimension(1400, parentSize.height - 100);
|
||||
mainPanel.setMaximumSize(maxSize);
|
||||
mainPanel.setOpaque(false);
|
||||
|
||||
int rotation = getRotation(land.getView());
|
||||
|
||||
FImagePanel imagePanel = new FImagePanel();
|
||||
BufferedImage bufferedImage = FImageUtil.getImage(land.getCurrentState().getView());
|
||||
imagePanel.setImage(bufferedImage, rotation, AutoSizeImageMode.SOURCE);
|
||||
int imageWidth = 433;
|
||||
int imageHeight = 600;
|
||||
Dimension imagePanelDimension = new Dimension(imageWidth,imageHeight);
|
||||
imagePanel.setMinimumSize(imagePanelDimension);
|
||||
|
||||
mainPanel.add(imagePanel, "cell 0 0, spany 3");
|
||||
|
||||
Player cardController = land.getController();
|
||||
String msg = cardController.toString() + " puts " + land.toString() + " into play into " + zone.toString() + ".";
|
||||
|
||||
final FTextArea prompt1 = new FTextArea(msg);
|
||||
prompt1.setFont(FSkin.getFont(21));
|
||||
prompt1.setAutoSize(true);
|
||||
prompt1.setMinimumSize(new Dimension(475,200));
|
||||
mainPanel.add(prompt1, "cell 1 0, aligny top");
|
||||
|
||||
|
||||
FOptionPane.showOptionDialog(null, title, null, mainPanel, options);
|
||||
FImagePanel imagePanel = new FImagePanel();
|
||||
BufferedImage bufferedImage = FImageUtil.getImage(land.getCurrentState().getView());
|
||||
imagePanel.setImage(bufferedImage, rotation, AutoSizeImageMode.SOURCE);
|
||||
int imageWidth = 433;
|
||||
int imageHeight = 600;
|
||||
Dimension imagePanelDimension = new Dimension(imageWidth,imageHeight);
|
||||
imagePanel.setMinimumSize(imagePanelDimension);
|
||||
|
||||
mainPanel.add(imagePanel, "cell 0 0, spany 3");
|
||||
|
||||
String msg = cardController.toString() + " puts " + land.toString() + " into play into " + zone.toString() + ".";
|
||||
|
||||
final FTextArea prompt1 = new FTextArea(msg);
|
||||
prompt1.setFont(FSkin.getFont(21));
|
||||
prompt1.setAutoSize(true);
|
||||
prompt1.setMinimumSize(new Dimension(475,200));
|
||||
mainPanel.add(prompt1, "cell 1 0, aligny top");
|
||||
|
||||
FOptionPane.showOptionDialog(null, title, null, mainPanel, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2583,4 +2583,6 @@ lblEnterMessageToSend=Enter message to send
|
||||
#OnlineLobbyScreen.java
|
||||
lblDetectedInvalidHostAddress=Invalid host address ({0}) was detected.
|
||||
#Player.java
|
||||
lblChooseACompanion=Choose a companion
|
||||
lblChooseACompanion=Choose a companion
|
||||
cbpLandPlayed=Land entering battlefield notifications
|
||||
nlpLandPlayed=Choose when you want to get visual notifications for a land entering the battlefield: Never, always, or only for the lands entering a battlefield because of an action of a AI player
|
||||
|
||||
@@ -321,6 +321,11 @@ public final class ForgeConstants {
|
||||
public static final String STACK_EFFECT_NOTIFICATION_NEVER = "Never";
|
||||
public static final String STACK_EFFECT_NOTIFICATION_ALWAYS = "Always";
|
||||
public static final String STACK_EFFECT_NOTIFICATION_AI_AND_TRIGGERED = "AI cast/activated, or triggered by any player";
|
||||
|
||||
// Constants for LAnd played notification policy
|
||||
public static final String LAND_PLAYED_NOTIFICATION_NEVER = "Never";
|
||||
public static final String LAND_PLAYED_NOTIFICATION_ALWAYS = "Always";
|
||||
public static final String LAND_PLAYED_NOTIFICATION_AI = "Lands entering a battlefield because of an action of a AI player";
|
||||
|
||||
// Set boolean constant for landscape mode for gdx port
|
||||
public static final boolean isGdxPortLandscape = FileUtil.doesFileExist(ASSETS_DIR + "switch_orientation.ini");
|
||||
|
||||
@@ -121,6 +121,7 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
|
||||
UI_CLOSE_ACTION ("NONE"),
|
||||
UI_MANA_LOST_PROMPT ("false"), // Prompt on losing mana when passing priority
|
||||
UI_STACK_EFFECT_NOTIFICATION_POLICY ("Never"),
|
||||
UI_LAND_PLAYED_NOTIFICATION_POLICY ("Never"),
|
||||
UI_PAUSE_WHILE_MINIMIZED("false"),
|
||||
UI_TOKENS_IN_SEPARATE_ROW("false"), // Display tokens in their own battlefield row.
|
||||
UI_DISPLAY_CURRENT_COLORS(ForgeConstants.DISP_CURRENT_COLORS_NEVER),
|
||||
|
||||
Reference in New Issue
Block a user