Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -994,10 +994,10 @@ public void resetOnceResolved() {
}
}

// key for autoyield - the card description (including number) (if there is a card) plus the effect description
// key for autoyield - the card name (if there is a card) plus the effect description
public String yieldKey() {
if (getHostCard() != null) {
return getHostCard().toString() + ": " + toUnsuppressedString();
return getHostCard().getName() + ": " + toUnsuppressedString();
Comment thread
tool4ever marked this conversation as resolved.
Outdated
} else {
return toUnsuppressedString();
}
Expand Down
3 changes: 0 additions & 3 deletions forge-game/src/main/java/forge/game/trigger/Trigger.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ public String toString(boolean active) {
desc = TextUtil.fastReplace(desc, "EFFECTSOURCE", getHostCard().getEffectSource().getDisplayName());
}
sb.append(desc);
if (!this.triggerRemembered.isEmpty()) {
sb.append(" (").append(this.triggerRemembered).append(")");
}
return sb.toString();
} else {
return "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public SpellAbility getSATargetingCard() {
public String yieldKey() {
if (getTrigger() != null) {
if (getHostCard() != null) {
return getHostCard().toString() + ": " + getTrigger().toString();
return getHostCard().getName() + ": " + getTrigger().toString();
} else {
return getTrigger().toString();
}
Expand Down Expand Up @@ -185,6 +185,9 @@ public String getStackDescription(boolean withTargets) {
if (regtrig == null) return "";
final StringBuilder sb =
new StringBuilder(regtrig.replaceAbilityText(regtrig.toString(true), this, true));
if (!regtrig.getTriggerRemembered().isEmpty()) {
sb.append(" (").append(regtrig.getTriggerRemembered()).append(")");
}

// prevent text growing too long when SA target other in a chain and also potential StackOverflow
if (withTargets) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,11 @@ public void actionPerformed(final ActionEvent e) {
if (matchUI == null) { return; }
StackItemView si = matchUI.getGameView().peekStack();
if (si != null && si.isAbility()) {
boolean abilityScope = !forge.localinstance.properties.ForgeConstants.AUTO_YIELD_PER_CARD.equals(
forge.model.FModel.getPreferences().getPref(forge.localinstance.properties.ForgePreferences.FPref.UI_AUTO_YIELD_MODE));
matchUI.getGameController().setShouldAutoYield(si.getKey(), true, abilityScope);
int triggerID = si.getSourceTrigger();
if (si.isOptionalTrigger() && matchUI.isLocalPlayer(si.getActivatingPlayer())) {
matchUI.getGameController().setShouldAlwaysAcceptTrigger(triggerID);
boolean abilityScope = matchUI.getGameController().getYieldController().isAbilityScope();
String key = si.getKey();
matchUI.getGameController().setShouldAutoYield(key, true, abilityScope);
if (si.isOptionalTrigger() && matchUI.isLocalPlayer(si.getActivatingPlayer()) && !key.isEmpty()) {
matchUI.getGameController().setShouldAlwaysAcceptTrigger(key, abilityScope);
}
matchUI.getGameController().passPriority();
}
Expand All @@ -179,12 +178,11 @@ public void actionPerformed(final ActionEvent e) {
if (matchUI == null) { return; }
StackItemView si = matchUI.getGameView().peekStack();
if (si != null && si.isAbility()) {
boolean abilityScope = !forge.localinstance.properties.ForgeConstants.AUTO_YIELD_PER_CARD.equals(
forge.model.FModel.getPreferences().getPref(forge.localinstance.properties.ForgePreferences.FPref.UI_AUTO_YIELD_MODE));
matchUI.getGameController().setShouldAutoYield(si.getKey(), true, abilityScope);
int triggerID = si.getSourceTrigger();
if (si.isOptionalTrigger() && matchUI.isLocalPlayer(si.getActivatingPlayer())) {
matchUI.getGameController().setShouldAlwaysDeclineTrigger(triggerID);
boolean abilityScope = matchUI.getGameController().getYieldController().isAbilityScope();
String key = si.getKey();
matchUI.getGameController().setShouldAutoYield(key, true, abilityScope);
if (si.isOptionalTrigger() && matchUI.isLocalPlayer(si.getActivatingPlayer()) && !key.isEmpty()) {
matchUI.getGameController().setShouldAlwaysDeclineTrigger(key, abilityScope);
}
matchUI.getGameController().passPriority();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public void initialize() {
initializeLandPlayedComboBox();
initializeColorIdentityCombobox();
initializeSwitchStatesCombobox();
initializeAutoYieldModeComboBox();
initializeAutoDecisionModeComboBox();
initializeStackGroupPermanentsComboBox();
initializeMaxStackDepthComboBox();
initializeCounterDisplayTypeComboBox();
Expand Down Expand Up @@ -571,15 +571,15 @@ private void initializeSwitchStatesCombobox() {
panel.setComboBox(comboBox, selectedItem);
}

private void initializeAutoYieldModeComboBox() {
private void initializeAutoDecisionModeComboBox() {
final String[] elems = {
ForgeConstants.AUTO_YIELD_PER_CARD,
ForgeConstants.AUTO_YIELD_PER_ABILITY,
ForgeConstants.AUTO_YIELD_PER_ABILITY_SESSION,
ForgeConstants.AUTO_YIELD_PER_ABILITY_INSTALL,
ForgeConstants.AUTO_DECISION_PER_CARD,
ForgeConstants.AUTO_DECISION_PER_ABILITY,
ForgeConstants.AUTO_DECISION_PER_ABILITY_SESSION,
ForgeConstants.AUTO_DECISION_PER_ABILITY_INSTALL,
};
final FPref userSetting = FPref.UI_AUTO_YIELD_MODE;
final FComboBoxPanel<String> panel = this.view.getAutoYieldModeComboBoxPanel();
final FPref userSetting = FPref.UI_AUTO_DECISION_MODE;
final FComboBoxPanel<String> panel = this.view.getAutoDecisionModeComboBoxPanel();
final FComboBox<String> comboBox = createComboBox(elems, userSetting);
final String selectedItem = this.prefs.getPref(userSetting);
panel.setComboBox(comboBox, selectedItem);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
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> cbpAutoDecisionMode = new FComboBoxPanel<>(localizer.getMessage("cbpAutoDecisionMode")+":");
private final FComboBoxPanel<String> cbpStackGroupPermanents = new FComboBoxPanel<>(localizer.getMessage("cbpStackGroupPermanents")+":");
private final FComboBoxPanel<Integer> cbpMaxStackDepth = new FComboBoxPanel<>(localizer.getMessage("cbpMaxStackDepth")+":");
private final FComboBoxPanel<String> cbpCounterDisplayType = new FComboBoxPanel<>(localizer.getMessage("cbpCounterDisplayType")+":");
Expand Down Expand Up @@ -301,8 +301,8 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
pnlPrefs.add(cbpGraveyardOrdering, comboBoxConstraints);
pnlPrefs.add(new NoteLabel(localizer.getMessage("nlpGraveyardOrdering")), descriptionConstraints);

pnlPrefs.add(cbpAutoYieldMode, comboBoxConstraints);
pnlPrefs.add(new NoteLabel(localizer.getMessage("nlpAutoYieldMode")), descriptionConstraints);
pnlPrefs.add(cbpAutoDecisionMode, comboBoxConstraints);
pnlPrefs.add(new NoteLabel(localizer.getMessage("nlpAutoDecisionMode")), descriptionConstraints);

//Server Preferences
pnlPrefs.add(new SectionLabel(localizer.getMessage("ServerPreferences")), sectionConstraints);
Expand Down Expand Up @@ -903,8 +903,8 @@ public FComboBoxPanel<String> getCbpDefaultLanguageComboBoxPanel() {
}


public FComboBoxPanel<String> getAutoYieldModeComboBoxPanel() {
return cbpAutoYieldMode;
public FComboBoxPanel<String> getAutoDecisionModeComboBoxPanel() {
return cbpAutoDecisionMode;
}

public FComboBoxPanel<String> getCbpStackGroupPermanents() {
Expand Down
109 changes: 0 additions & 109 deletions forge-gui-desktop/src/main/java/forge/screens/match/VAutoYields.java

This file was deleted.

Loading
Loading