Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings to enable/disable first and second parts omega AM independently #453

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -1971,7 +1975,7 @@ else if (longDist.getTarget().isThePlayer()) {
@AutoFeed
private final SequentialTrigger<BaseEvent> omegaFirstSetAm = SqtTemplates.sq(60_000, OmegaFirstSetAssignments.class, sa -> true,
(e1, s) -> {
if (getOmegaAmEnable().get()) {
if (getOmegaAmEnable().get() && getOmegaAmFirstSetEnable().get()) {
MultiSlotAutoMarkHandler<DynamisOmegaAssignment> handler = new MultiSlotAutoMarkHandler<>(s::accept, getOmegaAmSettings());

int delay = getOmegaFirstSetDelay().get() * 1_000;
Expand All @@ -1991,7 +1995,7 @@ else if (longDist.getTarget().isThePlayer()) {
@AutoFeed
private final SequentialTrigger<BaseEvent> omegaSecondSetAm = SqtTemplates.sq(60_000, OmegaSecondSetAssignments.class, sa -> true,
(e1, s) -> {
if (getOmegaAmEnable().get()) {
if (getOmegaAmEnable().get() && getOmegaAmSecondSetEnable().get()) {
MultiSlotAutoMarkHandler<DynamisOmegaAssignment> handler = new MultiSlotAutoMarkHandler<>(s::accept, getOmegaAmSettings());

int delay = getOmegaSecondSetDelay().get() * 1_000;
Expand Down Expand Up @@ -2287,4 +2291,12 @@ public IntSetting getOmegaSecondSetDelay() {
private ActiveCastRepository getCasts() {
return casts;
}

public BooleanSetting getOmegaAmFirstSetEnable() {
return omegaAmFirstSetEnable;
}

public BooleanSetting getOmegaAmSecondSetEnable() {
return omegaAmSecondSetEnable;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading