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

Make a rule depend on rule conditions #21

Open
davidalb97 opened this issue Oct 25, 2021 · 0 comments
Open

Make a rule depend on rule conditions #21

davidalb97 opened this issue Oct 25, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@davidalb97
Copy link

It would be nice to have rules that depend on the enabled state of generated/defined types.

For example, using boolean conditions with the field "ruleCondition" to enable a rule configuration:

{
  "rules": [
    {
      "id": "shaders",
      "type": "DEFINED",
      "caption": "Type of optimizations: %s",
      "tooltip": "Enable Sodium optimizations (Most performant) or Optifine (Better shader tunning)?",
      "options": [
        {
          "id": "sodiumId",
          "caption": "Sodium",
          "directories": [ "modsSodium" ]
        },
        {
          "id": "optifineId",
          "caption": "Optifine",
          "directories": [ "modsOptifine" ],
          "isDefault": false
        }
      ]
    },
    {
      "id": "SodiumOnlyOptimizationsId",
      "type": "GENERATED",
      "caption": "Sodium only optimizations",
      "tooltip": "Enable other optimization mods that are not compatible with optine",
      "directories": [ "sodiumCompatibleOnlyMods" ],
      "ruleCondition": "sodiumId"
    },
    {
      "id": "SodiumOptimizationMod43AddonsId",
      "type": "GENERATED",
      "caption": "Configure mod 43's Addons",
      "tooltip": "Choose what addons are enabled for mod 43 (only compatible with Sodium)",
      "directories": [ "sodiumMod43Addons" ],
      "ruleCondition": "SodiumOnlyOptimizationsId:modid43"
    }

The first rule (DEFINED) has two options, either Sodium or Optifine.
When choosing Sodium, the user then could see a new button with sodium only mods (rule with id SodiumOnlyOptimizationsId).
When enabling a specific mod (modid43, in the example), the user could then see another button for configuring modid43's addons.

PS: Really nice work on this mod!

@EZForever EZForever added the enhancement New feature or request label Oct 29, 2021
@EZForever EZForever mentioned this issue Oct 29, 2021
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants