- Improved detailed spell ability descriptions when paying costs/targeting by getting rid of the Targeting ERROR text in the prompt box at the time when the SA is not yet targeted by the player.

- Made the detailed SA descriptions on paying costs/targeting optional (can be enabled/disabled in preferences, enabled by default) for people wanting the old behavior (which might especially be useful for mobile Forge on small screens).
This commit is contained in:
Agetian
2017-01-14 19:44:01 +00:00
parent d80a8dcad4
commit ef27adc5c6
7 changed files with 32 additions and 3 deletions

View File

@@ -115,6 +115,7 @@ public enum CSubmenuPreferences implements ICDoc {
lstControls.add(Pair.of(view.getCbStackCreatures(), FPref.UI_STACK_CREATURES));
lstControls.add(Pair.of(view.getCbManaLostPrompt(), FPref.UI_MANA_LOST_PROMPT));
lstControls.add(Pair.of(view.getCbEscapeEndsTurn(), FPref.UI_ALLOW_ESC_TO_END_TURN));
lstControls.add(Pair.of(view.getCbDetailedPaymentDesc(), FPref.UI_DETAILED_SPELLDESC_IN_PROMPT));
lstControls.add(Pair.of(view.getCbFilterLandsByColorId(), FPref.UI_FILTER_LANDS_BY_COLOR_IDENTITY));

View File

@@ -77,6 +77,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
private final JCheckBox cbAltSoundSystem = new OptionsCheckBox("Use Alternate Sound System");
private final JCheckBox cbUiForTouchScreen = new OptionsCheckBox("Enhance UI for Touchscreens");
private final JCheckBox cbCompactMainMenu = new OptionsCheckBox("Use Compact Main Sidebar Menu");
private final JCheckBox cbDetailedPaymentDesc = new OptionsCheckBox("Show Spell Description on Payment/Targeting");
private final JCheckBox cbPromptFreeBlocks = new OptionsCheckBox("Free Block Handling");
private final JCheckBox cbPauseWhileMinimized = new OptionsCheckBox("Pause While Minimized");
private final JCheckBox cbCompactPrompt = new OptionsCheckBox("Compact Prompt");
@@ -166,6 +167,9 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
pnlPrefs.add(cbEscapeEndsTurn, regularConstraints);
pnlPrefs.add(new NoteLabel("When enabled, Escape key functions as an alternative shortcut to end the current turn."), regularConstraints);
pnlPrefs.add(cbDetailedPaymentDesc, regularConstraints);
pnlPrefs.add(new NoteLabel("When enabled, detailed spell/ability descriptions are shown when choosing targets and paying costs."), regularConstraints);
// Deck building options
pnlPrefs.add(new SectionLabel("Random Deck Generation"), sectionConstraints);
@@ -606,6 +610,10 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
return cbManaLostPrompt;
}
public final JCheckBox getCbDetailedPaymentDesc() {
return cbDetailedPaymentDesc;
}
/** @return {@link forge.toolbox.FLabel} */
public FLabel getBtnReset() {
return btnReset;

View File

@@ -118,6 +118,10 @@ public class SettingsPage extends TabPage<SettingsScreen> {
"Free Block Handling",
"When enabled, if you would have to pay 0 to block, pay automatically without prompt."),
1);
lstSettings.addItem(new BooleanSetting(FPref.UI_DETAILED_SPELLDESC_IN_PROMPT,
"Show Spell Description on Payment/Targeting",
"When enabled, detailed spell/ability descriptions are shown when choosing targets and paying costs."),
1);
//Random Deck Generation
lstSettings.addItem(new BooleanSetting(FPref.DECKGEN_NOSMALL,

View File

@@ -4,7 +4,9 @@ import forge.game.card.Card;
import forge.game.mana.ManaCostBeingPaid;
import forge.game.player.Player;
import forge.game.spellability.SpellAbility;
import forge.model.FModel;
import forge.player.PlayerControllerHuman;
import forge.properties.ForgePreferences;
import forge.util.ITriggerEvent;
public class InputPayManaOfCostPayment extends InputPayMana {
@@ -48,7 +50,9 @@ public class InputPayManaOfCostPayment extends InputPayMana {
if (messagePrefix != null) {
msg.append(messagePrefix).append("\n");
}
msg.append(saPaidFor.getStackDescription()).append("\n");
if (FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_DETAILED_SPELLDESC_IN_PROMPT)) {
msg.append(saPaidFor.getStackDescription().replace("(Targeting ERROR)", "")).append("\n");
}
msg.append("Pay Mana Cost: ").append(displayMana);
if (this.phyLifeToLose > 0) {
msg.append(" (");

View File

@@ -23,7 +23,9 @@ import forge.game.card.Card;
import forge.game.mana.ManaCostBeingPaid;
import forge.game.player.Player;
import forge.game.spellability.SpellAbility;
import forge.model.FModel;
import forge.player.PlayerControllerHuman;
import forge.properties.ForgePreferences;
import forge.util.ITriggerEvent;
//pays the cost of a card played from the player's hand
@@ -119,7 +121,10 @@ public class InputPayManaSimple extends InputPayMana {
*/
@Override
protected String getMessage() {
final StringBuilder msg = new StringBuilder(saPaidFor.getStackDescription()).append("\n");
final StringBuilder msg = new StringBuilder();
if (FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_DETAILED_SPELLDESC_IN_PROMPT)) {
msg.append(saPaidFor.getStackDescription().replace("(Targeting ERROR)", "")).append("\n");
}
msg.append("Pay Mana Cost: ").append(this.manaCost.toString(false, player.getManaPool()));
if (this.phyLifeToLose > 0) {
msg.append(" (");

View File

@@ -16,7 +16,9 @@ import forge.game.card.CardView;
import forge.game.player.Player;
import forge.game.spellability.SpellAbility;
import forge.game.spellability.TargetRestrictions;
import forge.model.FModel;
import forge.player.PlayerControllerHuman;
import forge.properties.ForgePreferences;
import forge.util.ITriggerEvent;
public final class InputSelectTargets extends InputSyncronizedBase {
@@ -59,7 +61,11 @@ public final class InputSelectTargets extends InputSyncronizedBase {
sb.append("Parent Targeted:");
sb.append(sa.getUniqueTargets()).append("\n");
}
sb.append(sa.getStackDescription()).append("\n").append(tgt.getVTSelection());
if (FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_DETAILED_SPELLDESC_IN_PROMPT)) {
sb.append(sa.getStackDescription().replace("(Targeting ERROR)", "")).append("\n").append(tgt.getVTSelection());
} else {
sb.append(sa.getHostCard() + " - " + tgt.getVTSelection());
}
final int maxTargets = tgt.getMaxTargets(sa.getHostCard(), sa);
final int targeted = sa.getTargets().getNumTargeted();

View File

@@ -56,6 +56,7 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
UI_COMPACT_PROMPT ("false"),
UI_COMPACT_TABS ("false"),
UI_COMPACT_LIST_ITEMS ("false"),
UI_DETAILED_SPELLDESC_IN_PROMPT ("true"),
UI_CARD_SIZE ("small"),
UI_SINGLE_CARD_ZOOM("false"),
UI_LIBGDX_TEXTURE_FILTERING("false"),