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

AutoConfig API #38

Open
Matt-MX opened this issue Jul 9, 2024 · 2 comments
Open

AutoConfig API #38

Matt-MX opened this issue Jul 9, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@Matt-MX
Copy link
Owner

Matt-MX commented Jul 9, 2024

Lightweight API allowing for developers to give users control to customize GUIs and save them to YAML.

e.g

val existingGui = gui(!"title") {
    configButton("button.hello.world") {
        // todo configure default props
    }
}

configurableGui(existingGui) {
    buttonCustomizeClickHandler {
        ConfigurableButtonGui(button).open(player)
    }
}.open(player)

This aims to generalize the process of letting an admin configure a gui from in-game.

@Matt-MX Matt-MX added the enhancement New feature or request label Jul 9, 2024
@Matt-MX
Copy link
Owner Author

Matt-MX commented Jul 9, 2024

Very low priority

@Matt-MX
Copy link
Owner Author

Matt-MX commented Jul 10, 2024

Additionally having the ability to pull lines from a lang file.

val lang by plugin.yaml()

("cmd" / someArg).runs<Player> {
    val msg_cmd_response by lang("&cOptional default response")
    // TODO what about placeholders support?
    reply(!msg_cmd_response)
}

lang.yaml (default)

msg:
  cmd:
    response: "&aYou ran this command %someArgValue%"

I saw some other plugin implementing some MiniMessage styled stuff for interacting with the player like this:

msg:
  cmd:
    response:
     - "<lgreen>You ran this command %SomeArgValue%"
     - "<title><lgreen>Command ran<subtitle><white>Subtitle</title>"
     - "<sound:block_note_block_pling:0.3:2>"

@Matt-MX Matt-MX changed the title Customizer API AutoConfig API Jul 15, 2024
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

1 participant