BetterGUI-MC / Issue-Tracker

The issue tracker for BetterGUI
0 stars 0 forks source link

[FEATURE] Enhancement on Argument Processor #11

Closed HSGamer closed 11 months ago

HSGamer commented 11 months ago

Type

Plugin

Specific

Argument Processor

Content

When I first introduced the Argument Processor, it was a "patch job" so that we could use both Store Argument and Target Menu in every supported menu types.

To be honest, its style of configuration is pretty ugly (getting settings from menu-settings directly) and unscalable (cannot use the same processor for multiple parts of the command arguments).

So, I'm planning a redesign of the way Argument Processor handles, along with a new style of configuration.

What you can expect from the new design:

The "prototype":

menu-settings:
  argument-processor:
    name:
      type: player
      offline: true
    age:
      type: store
      suggest:
      - 10
      - 18
      - 20
    message:
      type: store
      take-remaining: true
      min-arg: 2
      default-args: "Hello World"
      min-args-action: "tell: &cAt least 2 arguments"

button:
  slot: 0
  id: paper
  name: "&a&l {arg_name}"
  lore:
  - "&b Age: &f {arg_age}"
  - "&b Message: &f {arg_message}"

Alternative

No response

Screenshots & Links

No response

HSGamer commented 11 months ago

The latest build has implemented the new Argument Processor.

https://github.com/BetterGUI-MC/Issue-Tracker/assets/25300232/cea9e52c-844a-430a-bd6f-7d6293787f54

menu-settings:
  command: testargs
  argument-processor:
    hello:
      length: 2
      suggest:
      - Hello you
      - Welcome back
      action: "tell: &cHello is required"
    message:
      take-remaining: true
      suggest:
      - HSGamer
      - Minecraft World
      action: "tell: &cMessage is required"

button:
  slot: 0
  id: stone
  name: "&bTest Arguments"
  lore:
  - "{arg_hello}, {arg_message}"
HSGamer commented 11 months ago

Finished