mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Add preference to enable/disable mana pool emptying prompt.
This commit is contained in:
@@ -108,6 +108,7 @@ public enum CSubmenuPreferences implements ICDoc {
|
|||||||
lstControls.add(Pair.of(view.getCbHideReminderText(), FPref.UI_HIDE_REMINDER_TEXT));
|
lstControls.add(Pair.of(view.getCbHideReminderText(), FPref.UI_HIDE_REMINDER_TEXT));
|
||||||
lstControls.add(Pair.of(view.getCbOpenPacksIndiv(), FPref.UI_OPEN_PACKS_INDIV));
|
lstControls.add(Pair.of(view.getCbOpenPacksIndiv(), FPref.UI_OPEN_PACKS_INDIV));
|
||||||
lstControls.add(Pair.of(view.getCbStackCreatures(), FPref.UI_STACK_CREATURES));
|
lstControls.add(Pair.of(view.getCbStackCreatures(), FPref.UI_STACK_CREATURES));
|
||||||
|
lstControls.add(Pair.of(view.getCbManaLostPrompt(), FPref.UI_MANA_LOST_PROMPT));
|
||||||
|
|
||||||
for(final Pair<JCheckBox, FPref> kv : lstControls) {
|
for(final Pair<JCheckBox, FPref> kv : lstControls) {
|
||||||
kv.getKey().addItemListener(new ItemListener() {
|
kv.getKey().addItemListener(new ItemListener() {
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
|||||||
private final JCheckBox cbHideReminderText = new OptionsCheckBox("Hide Reminder Text");
|
private final JCheckBox cbHideReminderText = new OptionsCheckBox("Hide Reminder Text");
|
||||||
private final JCheckBox cbOpenPacksIndiv = new OptionsCheckBox("Open Packs Individually");
|
private final JCheckBox cbOpenPacksIndiv = new OptionsCheckBox("Open Packs Individually");
|
||||||
private final JCheckBox cbStackCreatures = new OptionsCheckBox("Stack Creatures");
|
private final JCheckBox cbStackCreatures = new OptionsCheckBox("Stack Creatures");
|
||||||
|
private final JCheckBox cbManaLostPrompt = new OptionsCheckBox("Prompt Mana Pool Emptying");
|
||||||
|
|
||||||
private final Map<FPref, KeyboardShortcutField> shortcutFields = new HashMap<FPref, KeyboardShortcutField>();
|
private final Map<FPref, KeyboardShortcutField> shortcutFields = new HashMap<FPref, KeyboardShortcutField>();
|
||||||
|
|
||||||
@@ -155,6 +156,9 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
|||||||
|
|
||||||
pnlPrefs.add(cbPromptFreeBlocks, regularConstraints);
|
pnlPrefs.add(cbPromptFreeBlocks, regularConstraints);
|
||||||
pnlPrefs.add(new NoteLabel("When enabled, if you would have to pay 0 to block, pay automatically without prompt."), regularConstraints);
|
pnlPrefs.add(new NoteLabel("When enabled, if you would have to pay 0 to block, pay automatically without prompt."), regularConstraints);
|
||||||
|
|
||||||
|
pnlPrefs.add(cbManaLostPrompt, regularConstraints);
|
||||||
|
pnlPrefs.add(new NoteLabel("When enabled, you get a warning if passing priority would cause you to lose mana in your mana pool."), regularConstraints);
|
||||||
|
|
||||||
// Deck building options
|
// Deck building options
|
||||||
pnlPrefs.add(new SectionLabel("Random Deck Generation"), sectionConstraints);
|
pnlPrefs.add(new SectionLabel("Random Deck Generation"), sectionConstraints);
|
||||||
@@ -543,6 +547,10 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
|||||||
public final JCheckBox getCbStackCreatures() {
|
public final JCheckBox getCbStackCreatures() {
|
||||||
return cbStackCreatures;
|
return cbStackCreatures;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final JCheckBox getCbManaLostPrompt() {
|
||||||
|
return cbManaLostPrompt;
|
||||||
|
}
|
||||||
|
|
||||||
/** @return {@link forge.toolbox.FLabel} */
|
/** @return {@link forge.toolbox.FLabel} */
|
||||||
public FLabel getBtnReset() {
|
public FLabel getBtnReset() {
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ public class InputPassPriority extends InputSyncronizedBase {
|
|||||||
Game game = GuiBase.getInterface().getGame();
|
Game game = GuiBase.getInterface().getGame();
|
||||||
if (game.getStack().isEmpty()) { //phase can't end right now if stack isn't empty
|
if (game.getStack().isEmpty()) { //phase can't end right now if stack isn't empty
|
||||||
Player player = game.getPhaseHandler().getPriorityPlayer();
|
Player player = game.getPhaseHandler().getPriorityPlayer();
|
||||||
if (player != null && player.getManaPool().willManaBeLostAtEndOfPhase() && player.getLobbyPlayer() == GuiBase.getInterface().getGuiPlayer()) {
|
if (player != null && FModel.getPreferences().getPrefBoolean(FPref.UI_MANA_LOST_PROMPT) && player.getManaPool().willManaBeLostAtEndOfPhase() && player.getLobbyPlayer() == GuiBase.getInterface().getGuiPlayer()) {
|
||||||
ThreadUtil.invokeInGameThread(new Runnable() { //must invoke in game thread so dialog can be shown on mobile game
|
ThreadUtil.invokeInGameThread(new Runnable() { //must invoke in game thread so dialog can be shown on mobile game
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
|
|||||||
UI_LOCK_TITLE_BAR ("false"),
|
UI_LOCK_TITLE_BAR ("false"),
|
||||||
UI_HIDE_GAME_TABS ("false"), // Visibility of tabs in match screen.
|
UI_HIDE_GAME_TABS ("false"), // Visibility of tabs in match screen.
|
||||||
UI_CLOSE_ACTION ("NONE"),
|
UI_CLOSE_ACTION ("NONE"),
|
||||||
|
UI_MANA_LOST_PROMPT ("false"), // Prompt on losing mana when passing priority
|
||||||
|
|
||||||
UI_FOR_TOUCHSCREN("false"),
|
UI_FOR_TOUCHSCREN("false"),
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user