forked from External/mage
Added an option that player has to confirm if he passes priority with empty stack and has mana in his pool. Implements #707.
This commit is contained in:
parent
907ec7abb0
commit
9da44a547d
16 changed files with 187 additions and 61 deletions
|
|
@ -85,6 +85,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
public static final String KEY_SHOW_ABILITY_PICKER_FORCED = "showAbilityPicker";
|
||||
public static final String KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS = "gameAllowRequestShowHandCards";
|
||||
public static final String KEY_GAME_SHOW_STORM_COUNTER = "gameShowStormCounter";
|
||||
public static final String KEY_GAME_CONFIRM_EMPTY_MANA_POOL = "gameConfirmEmptyManaPool";
|
||||
|
||||
public static final String KEY_GAME_LOG_AUTO_SAVE = "gameLogAutoSave";
|
||||
|
||||
|
|
@ -335,6 +336,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
showAbilityPickerForced = new javax.swing.JCheckBox();
|
||||
cbAllowRequestToShowHandCards = new javax.swing.JCheckBox();
|
||||
cbShowStormCounter = new javax.swing.JCheckBox();
|
||||
cbConfirmEmptyManaPool = new javax.swing.JCheckBox();
|
||||
main_gamelog = new javax.swing.JPanel();
|
||||
cbGameLogAutoSave = new javax.swing.JCheckBox();
|
||||
tabPhases = new javax.swing.JPanel();
|
||||
|
|
@ -549,6 +551,16 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
}
|
||||
});
|
||||
|
||||
cbConfirmEmptyManaPool.setSelected(true);
|
||||
cbConfirmEmptyManaPool.setText("Confirm if you want to pass a phase/step but there is still mana in your mana pool");
|
||||
cbConfirmEmptyManaPool.setToolTipText("<html>If activated you get a confirm message if you pass priority while stack is empty<br>\n and you still have mana in your mana pool.");
|
||||
cbConfirmEmptyManaPool.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
|
||||
cbConfirmEmptyManaPool.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
cbConfirmEmptyManaPoolActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout main_gameLayout = new javax.swing.GroupLayout(main_game);
|
||||
main_game.setLayout(main_gameLayout);
|
||||
main_gameLayout.setHorizontalGroup(
|
||||
|
|
@ -558,14 +570,15 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.addGroup(main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(main_gameLayout.createSequentialGroup()
|
||||
.addComponent(cbAllowRequestToShowHandCards, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(14, Short.MAX_VALUE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGroup(main_gameLayout.createSequentialGroup()
|
||||
.addGroup(main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
||||
.addComponent(showPlayerNamesPermanently, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(nonLandPermanentsInOnePile, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(showAbilityPickerForced, javax.swing.GroupLayout.Alignment.LEADING))
|
||||
.addComponent(cbShowStormCounter, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(cbShowStormCounter, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cbConfirmEmptyManaPool, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(0, 0, Short.MAX_VALUE))))
|
||||
);
|
||||
main_gameLayout.setVerticalGroup(
|
||||
|
|
@ -579,7 +592,9 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(cbAllowRequestToShowHandCards)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(cbShowStormCounter))
|
||||
.addComponent(cbShowStormCounter)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(cbConfirmEmptyManaPool))
|
||||
);
|
||||
|
||||
nonLandPermanentsInOnePile.getAccessibleContext().setAccessibleName("nonLandPermanentsInOnePile");
|
||||
|
|
@ -630,7 +645,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.addComponent(main_game, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(main_gamelog, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(63, Short.MAX_VALUE))
|
||||
.addContainerGap(40, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
main_card.getAccessibleContext().setAccessibleName("Game panel");
|
||||
|
|
@ -1383,7 +1398,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
tabAvatars.setLayout(tabAvatarsLayout);
|
||||
tabAvatarsLayout.setHorizontalGroup(
|
||||
tabAvatarsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 598, Short.MAX_VALUE)
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 590, Short.MAX_VALUE)
|
||||
);
|
||||
tabAvatarsLayout.setVerticalGroup(
|
||||
tabAvatarsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
|
|
@ -1602,7 +1617,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap())
|
||||
.addComponent(tabsPanel)
|
||||
.addComponent(tabsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 595, Short.MAX_VALUE)
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
|
|
@ -1630,6 +1645,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
save(prefs, dialog.showAbilityPickerForced, KEY_SHOW_ABILITY_PICKER_FORCED, "true", "false", UPDATE_CACHE_POLICY);
|
||||
save(prefs, dialog.cbAllowRequestToShowHandCards, KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true", "false", UPDATE_CACHE_POLICY);
|
||||
save(prefs, dialog.cbShowStormCounter, KEY_GAME_SHOW_STORM_COUNTER, "true", "false", UPDATE_CACHE_POLICY);
|
||||
save(prefs, dialog.cbConfirmEmptyManaPool, KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true", "false", UPDATE_CACHE_POLICY);
|
||||
save(prefs, dialog.cbGameLogAutoSave, KEY_GAME_LOG_AUTO_SAVE, "true", "false", UPDATE_CACHE_POLICY);
|
||||
|
||||
// Phases
|
||||
|
|
@ -1696,6 +1712,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
getSelectedAvatar(),
|
||||
dialog.showAbilityPickerForced.isSelected(),
|
||||
dialog.cbAllowRequestToShowHandCards.isSelected(),
|
||||
dialog.cbConfirmEmptyManaPool.isSelected(),
|
||||
getUserSkipPrioritySteps());
|
||||
|
||||
prefs.flush();
|
||||
|
|
@ -1947,6 +1964,10 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_cbShowStormCounterActionPerformed
|
||||
|
||||
private void cbConfirmEmptyManaPoolActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbConfirmEmptyManaPoolActionPerformed
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_cbConfirmEmptyManaPoolActionPerformed
|
||||
|
||||
private void showProxySettings() {
|
||||
if (cbProxyType.getSelectedItem() == Connection.ProxyType.SOCKS) {
|
||||
this.pnlProxy.setVisible(true);
|
||||
|
|
@ -2023,6 +2044,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
load(prefs, dialog.showAbilityPickerForced, KEY_SHOW_ABILITY_PICKER_FORCED, "true");
|
||||
load(prefs, dialog.cbAllowRequestToShowHandCards, KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true");
|
||||
load(prefs, dialog.cbShowStormCounter, KEY_GAME_SHOW_STORM_COUNTER, "true");
|
||||
load(prefs, dialog.cbConfirmEmptyManaPool, KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true");
|
||||
|
||||
load(prefs, dialog.cbGameLogAutoSave, KEY_GAME_LOG_AUTO_SAVE, "true");
|
||||
|
||||
|
|
@ -2367,6 +2389,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
id,
|
||||
PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_TOOLTIPS_ANY_ZONE, "true").equals("true"),
|
||||
PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true").equals("true"),
|
||||
PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true").equals("true"),
|
||||
getUserSkipPrioritySteps());
|
||||
}
|
||||
}
|
||||
|
|
@ -2381,6 +2404,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
private javax.swing.JButton btnBrowseImageLocation;
|
||||
private javax.swing.JCheckBox cbAllowRequestToShowHandCards;
|
||||
private javax.swing.JCheckBox cbCheckForNewImages;
|
||||
private javax.swing.JCheckBox cbConfirmEmptyManaPool;
|
||||
private javax.swing.JCheckBox cbEnableBattlefieldBGM;
|
||||
private javax.swing.JCheckBox cbEnableDraftSounds;
|
||||
private javax.swing.JCheckBox cbEnableGameSounds;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue