From 83b5226da38d862ea6abf0f9abbd9d483d265579 Mon Sep 17 00:00:00 2001 From: XP Date: Wed, 25 Oct 2023 16:49:50 -0700 Subject: [PATCH] Settings to enable/disable first and second parts omega AM independently --- .../triggers/duties/ewult/OmegaUltimate.java | 16 ++++++++-- .../ewult/OmegaUltimateGroupPrioGui.java | 29 +++++++++++++++---- .../xp/xivsupport/gui/util/GridBagHelper.java | 15 ++++++++++ 3 files changed, 52 insertions(+), 8 deletions(-) diff --git a/triggers/triggers-ew/src/main/java/gg/xp/xivsupport/events/triggers/duties/ewult/OmegaUltimate.java b/triggers/triggers-ew/src/main/java/gg/xp/xivsupport/events/triggers/duties/ewult/OmegaUltimate.java index a38accfc9907..b7760ab45311 100644 --- a/triggers/triggers-ew/src/main/java/gg/xp/xivsupport/events/triggers/duties/ewult/OmegaUltimate.java +++ b/triggers/triggers-ew/src/main/java/gg/xp/xivsupport/events/triggers/duties/ewult/OmegaUltimate.java @@ -237,6 +237,8 @@ public class OmegaUltimate extends AutoChildEventHandler implements FilteredEven private final BooleanSetting deltaAmEnable; private final BooleanSetting sigmaAmEnable; private final BooleanSetting omegaAmEnable; + private final BooleanSetting omegaAmFirstSetEnable; + private final BooleanSetting omegaAmSecondSetEnable; private final IntSetting sigmaAmDelay; private final IntSetting omegaFirstSetDelay; private final IntSetting omegaSecondSetDelay; @@ -338,6 +340,8 @@ public OmegaUltimate(XivState state, StatusEffectRepository buffs, ActiveCastRep deltaAmEnable = new BooleanSetting(pers, settingKeyBase + "delta-am.enabled", false); sigmaAmEnable = new BooleanSetting(pers, settingKeyBase + "sigma-am.enabled", false); omegaAmEnable = new BooleanSetting(pers, settingKeyBase + "omega-am.enabled", false); + omegaAmFirstSetEnable = new BooleanSetting(pers, settingKeyBase + "omega-am.first-set-enabled", true); + omegaAmSecondSetEnable = new BooleanSetting(pers, settingKeyBase + "omega-am.second-set-enabled", true); p1prio = new JobSortOverrideSetting(pers, settingKeyBase + "p1-prio-override", state, groupPrioJobSort); psPrio = new JobSortOverrideSetting(pers, settingKeyBase + "ps-prio-override", state, groupPrioJobSort); sniperPrio = new JobSortOverrideSetting(pers, settingKeyBase + "sniper-prio-override", state, groupPrioJobSort); @@ -1971,7 +1975,7 @@ else if (longDist.getTarget().isThePlayer()) { @AutoFeed private final SequentialTrigger omegaFirstSetAm = SqtTemplates.sq(60_000, OmegaFirstSetAssignments.class, sa -> true, (e1, s) -> { - if (getOmegaAmEnable().get()) { + if (getOmegaAmEnable().get() && getOmegaAmFirstSetEnable().get()) { MultiSlotAutoMarkHandler handler = new MultiSlotAutoMarkHandler<>(s::accept, getOmegaAmSettings()); int delay = getOmegaFirstSetDelay().get() * 1_000; @@ -1991,7 +1995,7 @@ else if (longDist.getTarget().isThePlayer()) { @AutoFeed private final SequentialTrigger omegaSecondSetAm = SqtTemplates.sq(60_000, OmegaSecondSetAssignments.class, sa -> true, (e1, s) -> { - if (getOmegaAmEnable().get()) { + if (getOmegaAmEnable().get() && getOmegaAmSecondSetEnable().get()) { MultiSlotAutoMarkHandler handler = new MultiSlotAutoMarkHandler<>(s::accept, getOmegaAmSettings()); int delay = getOmegaSecondSetDelay().get() * 1_000; @@ -2287,4 +2291,12 @@ public IntSetting getOmegaSecondSetDelay() { private ActiveCastRepository getCasts() { return casts; } + + public BooleanSetting getOmegaAmFirstSetEnable() { + return omegaAmFirstSetEnable; + } + + public BooleanSetting getOmegaAmSecondSetEnable() { + return omegaAmSecondSetEnable; + } } diff --git a/triggers/triggers-ew/src/main/java/gg/xp/xivsupport/events/triggers/duties/ewult/OmegaUltimateGroupPrioGui.java b/triggers/triggers-ew/src/main/java/gg/xp/xivsupport/events/triggers/duties/ewult/OmegaUltimateGroupPrioGui.java index e09de9af6e39..c38404ff8569 100644 --- a/triggers/triggers-ew/src/main/java/gg/xp/xivsupport/events/triggers/duties/ewult/OmegaUltimateGroupPrioGui.java +++ b/triggers/triggers-ew/src/main/java/gg/xp/xivsupport/events/triggers/duties/ewult/OmegaUltimateGroupPrioGui.java @@ -12,6 +12,7 @@ import gg.xp.xivsupport.gui.extra.DutyPluginTab; import gg.xp.xivsupport.gui.overlay.RefreshLoop; import gg.xp.xivsupport.gui.tabs.SmartTabbedPane; +import gg.xp.xivsupport.gui.util.GridBagHelper; import gg.xp.xivsupport.gui.util.GuiUtil; import gg.xp.xivsupport.models.groupmodels.PsMarkerGroup; import gg.xp.xivsupport.models.groupmodels.TwoGroupsOfFour; @@ -145,12 +146,28 @@ public void setVisible(boolean aFlag) { panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS)); omegaSettings.setAlignmentX(0); panel.add(omegaSettings); - JPanel firstSetDelay = new IntSettingSpinner(backend.getOmegaFirstSetDelay(), "First Set Delay").getComponent(); - firstSetDelay.setAlignmentX(0); - panel.add(firstSetDelay); - JPanel secondSetDelay = new IntSettingSpinner(backend.getOmegaSecondSetDelay(), "Second Set Delay").getComponent(); - secondSetDelay.setAlignmentX(0); - panel.add(secondSetDelay); + JPanel moreSettingsPanel = new JPanel(new GridBagLayout()); + GridBagConstraints gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 5, 0); + GridBagHelper gbh = new GridBagHelper(moreSettingsPanel, gbc); + { + JCheckBox firstSetEnabled = new BooleanSettingGui(backend.getOmegaAmFirstSetEnable(), "First Set Automarker").getComponent(); + firstSetEnabled.setAlignmentX(0); + moreSettingsPanel.add(firstSetEnabled); + JPanel firstSetDelay = new IntSettingSpinner(backend.getOmegaFirstSetDelay(), "First Set Delay").getComponent(); + firstSetDelay.setAlignmentX(0); + gbh.addRowWithRightPadding(firstSetEnabled, firstSetDelay, Box.createHorizontalGlue()); + } + { + JCheckBox secondSetEnabled = new BooleanSettingGui(backend.getOmegaAmSecondSetEnable(), "Second Set Automarker").getComponent(); + secondSetEnabled.setAlignmentX(0); + moreSettingsPanel.add(secondSetEnabled); + JPanel secondSetDelay = new IntSettingSpinner(backend.getOmegaSecondSetDelay(), "Second Set Delay").getComponent(); + secondSetDelay.setAlignmentX(0); + moreSettingsPanel.add(secondSetDelay); + gbh.addRowWithRightPadding(secondSetEnabled, secondSetDelay, Box.createHorizontalGlue()); + } + moreSettingsPanel.setAlignmentX(0); + panel.add(moreSettingsPanel); tabs.addTab("Omega", makeAmPanel(new BooleanSettingHidingPanel(backend.getOmegaAmEnable(), "Omega Automark", panel, true), backend.getOmegaPsPrio())); } outer.add(tabs, BorderLayout.CENTER); diff --git a/xivsupport/src/main/java/gg/xp/xivsupport/gui/util/GridBagHelper.java b/xivsupport/src/main/java/gg/xp/xivsupport/gui/util/GridBagHelper.java index b7c58f290706..c76ea6ff1c4a 100644 --- a/xivsupport/src/main/java/gg/xp/xivsupport/gui/util/GridBagHelper.java +++ b/xivsupport/src/main/java/gg/xp/xivsupport/gui/util/GridBagHelper.java @@ -27,6 +27,21 @@ public void addRow(Component... components) { gbc.gridy++; } + public void addRowWithRightPadding(Component... components) { + gbc.gridx = 0; + for (Component component : components) { + if (component != null) { + panel.add(component, gbc); + } + gbc.gridx++; + } + double oldWeight = gbc.weightx; + gbc.weightx = 999; + panel.add(Box.createHorizontalGlue(), gbc); + gbc.weightx = oldWeight; + gbc.gridy++; + } + public void addVerticalPadding() { double oldWeight = gbc.weighty; gbc.weighty = 1;