Skip to content

Feat/conditional configurations - #129

Open
0xar-ds wants to merge 27 commits into
v1.0.0from
feat/conditional-configurations
Open

Feat/conditional configurations#129
0xar-ds wants to merge 27 commits into
v1.0.0from
feat/conditional-configurations

Conversation

@0xar-ds

@0xar-ds 0xar-ds commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

after #128, closes #111

  • ConfigCondition API e3ae106
    • Mixes into Options#checkHidden to check against per-field decorable ConfigCondition[]. This allows for fields to also be hidden per a enumerable value of some other field, besides of the global toggling over a sentinel value.
    • Not a standard ResourcefulConfig renderer for a sole one can be applied per field.
Declaration: https://github.com/mkram17/Bazaar-Utils/blob/7c486905fe1bb78d4cbcf53d183d717903e458de/src/main/java/com/github/mkram17/bazaarutils/config/util/api/conditions/AdvancedConfigurationMode.java#L7-L12
Usage: https://github.com/mkram17/Bazaar-Utils/blob/7c486905fe1bb78d4cbcf53d183d717903e458de/src/main/java/com/github/mkram17/bazaarutils/features/gui/buttons/inputhelper/price/BuyOrderPriceHelper.java#L69-L83
Composability:

Declaration:

public static final class WhenCompetitivePosition extends MethodEquals<TransactionCost, PricingPosition> {
public WhenCompetitivePosition() {
super(TransactionCost.class, TransactionCost::getPricingPosition, PricingPosition.COMPETITIVE);
}
public static final class AndAdvancedMode extends AllOf {
@Override
@SuppressWarnings("unchecked")
protected Class<? extends ConfigCondition>[] conditions() {
return new Class[] {
WhenCompetitivePosition.class,
AdvancedConfigurationMode.class
};
}
}
}

Usage:

@ConfigEntry(
id = "self_outbid",
translation = "bazaarutils.config.buttons.button.container.self_outbid.label"
)
@Comment(
value = """
When you're already the highest bidder, stepping above yourself gains you nothing in the queue and only costs more coins.
Leave this off and the helper holds steady when you're already ahead. Enable it if you want it to always bid competitively, even against your own orders.
""",
translation = "bazaarutils.config.buttons.button.container.self_outbid.hint"
)
@ShowIf(SignInputHelper.TransactionCost.WhenCompetitivePosition.AndAdvancedMode.class)
public boolean selfOutbid = false;

  • Adds a BUConfig boolean field to toggle between an advanced configuration mode 72ae1ad
    • Wrapped on an Observable so it is not required to re-open the config screen after toggling it on/off
  • Gates SignInputHelper::TransactionAmount::fixedValue config field rendering to whether the relevant strategy (fixed) is selected 13db305
  • Drops the AdvancedSettings category d415a49
    • All "advanced behavior" of a feature should be pertained to its location
  • Ensures that @ConfigOption.Separator would hide per the fields' ConfigCondition as well 2fba130

0xar-ds added 21 commits August 22, 2026 14:57
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
shadowJar was deprecated

Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
otherwise we have issues with holders initialization

Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
…x computational logic

Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
…context

Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
…g path

Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
@0xar-ds 0xar-ds mentioned this pull request Sep 6, 2026
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
…strategy is selected

Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
@0xar-ds
0xar-ds force-pushed the feat/conditional-configurations branch from e39ee9f to 2fba130 Compare September 6, 2026 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v1.0.0] [Feature] Advanced Mode

1 participant