Skip to content

fancydialogs - add requirements to buttons & inputs#201

Open
mesemi wants to merge 4 commits intoFancyInnovations:mainfrom
mesemi:main
Open

fancydialogs - add requirements to buttons & inputs#201
mesemi wants to merge 4 commits intoFancyInnovations:mainfrom
mesemi:main

Conversation

@mesemi
Copy link

@mesemi mesemi commented Feb 15, 2026

📋 Description

Created a new configuration option to Buttons & Inputs (Checkbox, Select, Textfield) to have a requirement for it to appear in a dialog. Currently these requirements are permission or string match - being

requirements: {
  "type": "permission",
  "permission": "my.permission"
}

or

requirements: {
  "type": "string match",
  "input": "%player_name%",
  "output": "mesemi"
}

resulting in the item displaying if conditions are met (perm is held, or %player_name% resolves to mesemi)

Closes #82

✅ Checklist

  • [ X ] My code follows the project's coding style and guidelines
  • [ X ] I have tested my changes locally and they work as expected
  • [ X ] I have added necessary documentation (if applicable)
  • [ ? ] I have linked related issues using Fixes #issue_number or Closes #issue_number
  • [ X ] I have rebased/merged with the latest main branch

🔍 Changes

Please provide a brief summary of the changes made in this PR.

  • Added requirements to buttons & inputs
    • Always returns true if there is no requirements - so no old configs have to be changed and expected behavior remains
    • Either permission or string match to check for permissions or matching two strings (useful for placeholders)

🧪 How to Test

Please describe how to manually test the changes made in this PR.

  1. Create a new dialog with buttons or inputs.
  2. Add new option "requirements" as formatted above for either permission or string match
  3. Open dialog and see that it hides the piece if requirement isnt fulfilled

@Technofied
Copy link

This feature has been super useful for us, it means we can use FancyDialogs in place of DeluxeMenus in a lot more places. Almost bridges the gap entirely!

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.

Feature: FancyDialogs is the best, but right now it's not flexible.

2 participants

Comments