fancydialogs: Update README.md and add dialog examples

This commit is contained in:
Oliver
2025-05-16 09:41:38 +02:00
committed by Oliver
parent bff8ef27f4
commit 2bf8163370
5 changed files with 152 additions and 1 deletions

View File

@@ -0,0 +1,42 @@
{
"type": "dialog_list",
"title": "Dialog List Dialog",
"body": [
{
"type": "plain_message",
"contents": "Welcome to the server! Please read the rules carefully.",
"width": 200
},
{
"type": "plain_message",
"contents": "The rules are: blah blah blah.",
"width": 400
}
],
"dialogs": [
{
"type": "notice",
"title": "Rules",
"external_title": "Go to rules dialog",
"body": [
{
"type": "plain_message",
"contents": "Some important information 1.",
"width": 200
}
]
},
{
"type": "notice",
"title": "Notice Dialog 2",
"external_title": "Go to dialog 2",
"body": [
{
"type": "plain_message",
"contents": "ome important information 2.",
"width": 200
}
]
}
]
}

View File

@@ -0,0 +1,42 @@
{
"type": "multi_action",
"title": "Multi Action Dialog",
"body": [
{
"type": "plain_message",
"contents": "Welcome to the server! Please read the rules carefully.",
"width": 200
},
{
"type": "plain_message",
"contents": "The rules are: blah blah blah.",
"width": 400
}
],
"actions": [
{
"label": "Action 1",
"id":"whatever",
"on_submit": {
"type": "command_template",
"template": "tellraw @a '$(example) $(extra1) $(extra2)'"
}
},
{
"label": "Action 2",
"id":"whatever2",
"on_submit": {
"type": "command_template",
"template": "tellraw @a '$(example) $(extra1) $(extra2)'"
}
},
{
"label": "Action 3",
"id":"whatever3",
"on_submit": {
"type": "command_template",
"template": "tellraw @a '$(example) $(extra1) $(extra2)'"
}
}
]
}

View File

@@ -0,0 +1,24 @@
{
"type": "notice",
"title": "Notice Dialog",
"body": [
{
"type": "plain_message",
"contents": "Welcome to the server! Please read the rules carefully.",
"width": 200
},
{
"type": "plain_message",
"contents": "The rules are: blah blah blah.",
"width": 400
}
],
"action": {
"label": "Understood!",
"id":"whatever",
"on_submit": {
"type": "command_template",
"template": "tellraw @a '$(example) $(extra1) $(extra2)'"
}
}
}

View File

@@ -0,0 +1,43 @@
{
"type": "simple_input_form",
"title": "Simple Input Form Dialog",
"inputs": [
{
"type":"text",
"label": "Text input",
"key": "key1"
},
{
"type":"boolean",
"label": "Checkbox",
"key": "key2"
},
{
"type": "number_range",
"label": "Number Range",
"start": 50.0,
"end": 420.0,
"steps": 5,
"initial": 200.0,
"key": "key2"
},
{
"type": "single_option",
"label": "Single Option",
"options": [
{"id": "opt1", "display": "Option 1", "initial": true},
{"id": "opt1", "display": "Option 2"},
{"id": "opt1", "display": "Option 3"}
],
"key": "key3"
}
],
"action": {
"label": "Create!",
"id":"whatever",
"on_submit": {
"type": "command_template",
"template": "tellraw @a '$(example) $(extra1) $(extra2)'"
}
}
}

View File

@@ -1,6 +1,6 @@
<div align="center">
![Banner](../../docs/src/static/logos-and-banners/fancydialogs-banner.png)
![Banner](../../../docs/src/static/logos-and-banners/fancydialogs-banner.png)
[![Supports Folia](https://img.shields.io/badge/folia-supported-%23F9D879?labelColor=%2313154E&color=%234A44A6)](https://papermc.io/software/folia)
[![Discord](https://img.shields.io/discord/899740810956910683?cacheSeconds=3600&logo=discord&logoColor=white&label=%20&labelColor=%235865F2&color=%23707BF4)](https://discord.gg/ZUgYCEJUEx)