New options introduced to see the popup only for nonbasic lands.

Trigger of the popup moved earlier so as the sound will play on its
closure (when the lands enters play) and not on its opening.
This commit is contained in:
Alessandro Coli
2020-09-26 14:24:55 +02:00
parent 8d24a2a6ff
commit 36da6b6c7f
4 changed files with 12 additions and 4 deletions

View File

@@ -451,7 +451,8 @@ public enum CSubmenuPreferences implements ICDoc {
private void initializeLandPlayedComboBox() {
final String[] elems = {ForgeConstants.LAND_PLAYED_NOTIFICATION_NEVER, ForgeConstants.LAND_PLAYED_NOTIFICATION_ALWAYS,
ForgeConstants.LAND_PLAYED_NOTIFICATION_AI};
ForgeConstants.LAND_PLAYED_NOTIFICATION_ALWAYS_FOR_NONBASIC_LANDS, ForgeConstants.LAND_PLAYED_NOTIFICATION_AI,
ForgeConstants.LAND_PLAYED_NOTIFICATION_AI_FOR_NONBASIC_LANDS};
final FPref userSetting = FPref.UI_LAND_PLAYED_NOTIFICATION_POLICY;
final FComboBoxPanel<String> panel = this.view.getCbpLandPlayedComboBoxPanel();
final FComboBox<String> comboBox = createComboBox(elems, userSetting);

View File

@@ -1454,7 +1454,10 @@ public final class CMatchUI
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))) {
if(ForgeConstants.LAND_PLAYED_NOTIFICATION_ALWAYS.equals(landPlayedNotificationPolicy)
|| (ForgeConstants.LAND_PLAYED_NOTIFICATION_AI.equals(landPlayedNotificationPolicy) && (isAi))
|| (ForgeConstants.LAND_PLAYED_NOTIFICATION_ALWAYS_FOR_NONBASIC_LANDS.equals(landPlayedNotificationPolicy) && !land.isBasicLand())
|| (ForgeConstants.LAND_PLAYED_NOTIFICATION_AI_FOR_NONBASIC_LANDS.equals(landPlayedNotificationPolicy) && !land.isBasicLand()) && (isAi)) {
String title = "Forge";
List<String> options = ImmutableList.of(Localizer.getInstance().getMessage("lblOK"));