Skip to content

Add DIALOG_CLICK quest type - #11

Open
kazotaruumc72 wants to merge 1 commit into
Maxlego08:developfrom
MineArena:feature/dialog-click-quest
Open

kazotaruumc72 wants to merge 1 commit into
Maxlego08:developfrom
MineArena:feature/dialog-click-quest

Conversation

@kazotaruumc72

Copy link
Copy Markdown

Summary

New quest type DIALOG_CLICK: progresses when a player clicks a button of a zMenu dialog.

quests:
  - type: DIALOG_CLICK
    actions:
      - dialog: "welcome"   # or dialogs: [...]; "*" or empty = every dialog
        button: "button1"   # or buttons: [...]; empty = every button
    name: "dialog-1"
    display-name: "Join Survival"
    description: "Click on Join Survival in the welcome dialog"
    goal: 1

button is the key of the button in the dialog file: the key under multi-actions, yes / no for a confirmation dialog, notice, exit-button.

Depends on

The listener is registered by reflection (PluginManager#registerEvent on the class found by name), so this PR compiles against the current zmenu-api and zQuests keeps working with zMenu versions without the event: it just logs an info message and DIALOG_CLICK quests never progress. Once a zMenu release contains the event, the type works without any zQuests change. Cancelled events are ignored.

Changes

  • QuestType.DIALOG_CLICK, API record DialogClick(dialog, button) and DialogClickAction
  • DialogClickAction / DialogClickQuestLoader (case-insensitive matching, * wildcard)
  • DialogClickListener, registered in QuestsPlugin#onEnable
  • Documented in docs/configurations/quests.md

Test plan

🤖 Generated with Claude Code

Progresses when a player clicks a button of a zMenu dialog, using zMenu's
PlayerDialogClickEvent. The event is registered by reflection, so zQuests
still works with zMenu versions that do not have it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant