mirror of
https://github.com/FancyInnovations/FancyPlugins.git
synced 2025-12-05 23:33:36 +00:00
Compare commits
4 Commits
d6dc456f2a
...
22f5ccca29
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22f5ccca29 | ||
|
|
1422d42322 | ||
|
|
474a1c3e54 | ||
|
|
169ec91269 |
23
docs/src/fancydialogs/changelog/v1.md
Normal file
23
docs/src/fancydialogs/changelog/v1.md
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
icon: dot
|
||||||
|
order: 2
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
#
|
||||||
|
|
||||||
|
## v1.0.1 [!badge variant="info" text="2025-11-23"] [!badge variant="danger" text="Hotfix"]
|
||||||
|
|
||||||
|
- Fixed player kick issue when no button or action is defined. ([#147](https://github.com/FancyInnovations/FancyPlugins/issues/147))
|
||||||
|
|
||||||
|
## v1.0.0 [!badge variant="info" text="2025-11-23"]
|
||||||
|
|
||||||
|
- Create dialogs using the [JSON schema](https://docs.fancyinnovations.com/fancydialogs/tutorials/json-schema/)
|
||||||
|
- PlaceholderAPI and MiniMessage support in dialog texts
|
||||||
|
- Execute actions when dialog buttons are clicked
|
||||||
|
- Open a dialog when the user joins the server for the first time (see `welcome_dialog_id` in the config)
|
||||||
|
- A quick actions dialog which can be opened with the `/qa` or `/quickactions` commands
|
||||||
|
- FancyNpcs ingegration to open dialogs when interacting with NPCs (see [docs](https://docs.fancyinnovations.com/fancydialogs/tutorials/open-dialog-npc-action/))
|
||||||
|
- API for other plugins to open dialogs (see [docs](https://docs.fancyinnovations.com/fancydialogs/api/getting-started/))
|
||||||
@@ -71,7 +71,7 @@ Unregisters a dialog by its ID.
|
|||||||
|
|
||||||
## Joined Players Cache
|
## Joined Players Cache
|
||||||
|
|
||||||
## Clear joined players cache
|
### Clear joined players cache
|
||||||
|
|
||||||
Clears the cache of players who have joined a dialog.
|
Clears the cache of players who have joined a dialog.
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: FancyDialogs [WIP]
|
title: FancyDialogs
|
||||||
icon: browser
|
icon: browser
|
||||||
order: 90
|
order: 90
|
||||||
---
|
---
|
||||||
@@ -21,11 +21,6 @@ FancyDialogs uses the new dialog feature, Minecraft introduced in **1.21.6** and
|
|||||||
The plugin will only for **Paper** servers on **1.21.6** or newer!
|
The plugin will only for **Paper** servers on **1.21.6** or newer!
|
||||||
!!!
|
!!!
|
||||||
|
|
||||||
!!!warning
|
|
||||||
FancyDialogs is still in development and some features are not yet implemented.
|
|
||||||
See the [TODO](#todo) section for more information.
|
|
||||||
!!!
|
|
||||||
|
|
||||||
**Core advantages of FancyDialogs:**
|
**Core advantages of FancyDialogs:**
|
||||||
- Simple custom dialog creation (in JSON format or in code)
|
- Simple custom dialog creation (in JSON format or in code)
|
||||||
- A lot of different dialog components (text, buttons, input fields, etc.)
|
- A lot of different dialog components (text, buttons, input fields, etc.)
|
||||||
@@ -52,17 +47,3 @@ Common use cases are:
|
|||||||
- Confirmation dialogs for critical actions
|
- Confirmation dialogs for critical actions
|
||||||
- Shop UIs (replacing inventories UIs)
|
- Shop UIs (replacing inventories UIs)
|
||||||
- Dialogs for quests
|
- Dialogs for quests
|
||||||
|
|
||||||
## TODO
|
|
||||||
|
|
||||||
- [X] Create dialogs in JSON format
|
|
||||||
- [X] Create dialogs in code
|
|
||||||
- [X] Customize dialog content and buttons
|
|
||||||
- [X] Open dialogs for players (via commands or code)
|
|
||||||
- [X] Welcome dialog for new players
|
|
||||||
- [X] FancyNpcs integration (open_dialog action)
|
|
||||||
- [X] Confirmation and notice dialogs (API)
|
|
||||||
- [x] Add button action system
|
|
||||||
- [ ] Add support for the quick action hotkey
|
|
||||||
- [ ] Add tutorial features
|
|
||||||
- [ ] Add input controls
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
icon: dot
|
icon: dot
|
||||||
order: 9
|
order: 7
|
||||||
---
|
---
|
||||||
|
|
||||||
# Open dialog npc action
|
# Open dialog npc action
|
||||||
|
|||||||
13
docs/src/fancydialogs/tutorials/quick-actions.md
Normal file
13
docs/src/fancydialogs/tutorials/quick-actions.md
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
icon: dot
|
||||||
|
order: 8
|
||||||
|
---
|
||||||
|
|
||||||
|
# Quick actions
|
||||||
|
|
||||||
|
FancyDialogs doesn't support the quick-actions hotkey, but has a command to open a quick action dialog.
|
||||||
|
To open the quick actions dialog, use the command: `/qa` or `/quickactions`.
|
||||||
|
|
||||||
|
You can customize the quick actions dialog in the `plugins/FancyDialogs/data/dialogs/quick_actions.json` file.
|
||||||
|
|
||||||
|
If you want to disable the quick actions dialog, you can set the `disable-quick-actions-dialog` option to true in the `plugins/FancyDialogs/featureFlags.yml` file.
|
||||||
16
docs/src/fancydialogs/tutorials/welcome-dialog.md
Normal file
16
docs/src/fancydialogs/tutorials/welcome-dialog.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
icon: dot
|
||||||
|
order: 9
|
||||||
|
---
|
||||||
|
|
||||||
|
# Welcome dialog
|
||||||
|
|
||||||
|
You can configure a dialog to be shown to players when they join the server for the first time.
|
||||||
|
A default welcome dialog is included with FancyDialogs, but you can customize it or create your own welcome dialog.
|
||||||
|
|
||||||
|
You can find the default welcome dialog in the `plugins/FancyDialogs/data/dialogs/welcome.json` file.
|
||||||
|
Feel free to edit this file to customize the welcome dialog to your liking.
|
||||||
|
|
||||||
|
If you want to use another dialog as the welcome dialog, you can change the id in the `plugins/FancyDialogs/config.yml` file by changing the `welcome_dialog_id` option to the ID of your desired dialog.
|
||||||
|
|
||||||
|
To completely disable the welcome dialog, you can set the `disable-welcome-dialog` to true in the `plugins/FancyDialogs/featureFlags.yml` file.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
- Fixed player kick issue when no button or action is defined. ([#147](https://github.com/FancyInnovations/FancyPlugins/issues/147))
|
||||||
@@ -1 +1 @@
|
|||||||
0.0.32
|
1.0.1
|
||||||
@@ -9,13 +9,12 @@
|
|||||||
"1.21.7",
|
"1.21.7",
|
||||||
"1.21.8",
|
"1.21.8",
|
||||||
"1.21.9",
|
"1.21.9",
|
||||||
"1.21.10",
|
"1.21.10"
|
||||||
"1.21.11"
|
|
||||||
],
|
],
|
||||||
"channel": "RELEASE",
|
"channel": "RELEASE",
|
||||||
"loaders": [
|
"loaders": [
|
||||||
"paper",
|
"paper",
|
||||||
"folia"
|
"folia"
|
||||||
],
|
],
|
||||||
"featured": false
|
"featured": true
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,7 @@ import com.fancyinnovations.fancydialogs.api.data.inputs.DialogInput;
|
|||||||
import com.fancyinnovations.fancydialogs.api.data.inputs.DialogSelect;
|
import com.fancyinnovations.fancydialogs.api.data.inputs.DialogSelect;
|
||||||
import com.fancyinnovations.fancydialogs.api.data.inputs.DialogTextField;
|
import com.fancyinnovations.fancydialogs.api.data.inputs.DialogTextField;
|
||||||
import de.oliver.fancysitula.api.dialogs.FS_CommonDialogData;
|
import de.oliver.fancysitula.api.dialogs.FS_CommonDialogData;
|
||||||
|
import de.oliver.fancysitula.api.dialogs.FS_Dialog;
|
||||||
import de.oliver.fancysitula.api.dialogs.FS_DialogAction;
|
import de.oliver.fancysitula.api.dialogs.FS_DialogAction;
|
||||||
import de.oliver.fancysitula.api.dialogs.actions.FS_CommonButtonData;
|
import de.oliver.fancysitula.api.dialogs.actions.FS_CommonButtonData;
|
||||||
import de.oliver.fancysitula.api.dialogs.actions.FS_DialogActionButton;
|
import de.oliver.fancysitula.api.dialogs.actions.FS_DialogActionButton;
|
||||||
@@ -18,6 +19,7 @@ import de.oliver.fancysitula.api.dialogs.body.FS_DialogBody;
|
|||||||
import de.oliver.fancysitula.api.dialogs.body.FS_DialogTextBody;
|
import de.oliver.fancysitula.api.dialogs.body.FS_DialogTextBody;
|
||||||
import de.oliver.fancysitula.api.dialogs.inputs.*;
|
import de.oliver.fancysitula.api.dialogs.inputs.*;
|
||||||
import de.oliver.fancysitula.api.dialogs.types.FS_MultiActionDialog;
|
import de.oliver.fancysitula.api.dialogs.types.FS_MultiActionDialog;
|
||||||
|
import de.oliver.fancysitula.api.dialogs.types.FS_NoticeDialog;
|
||||||
import de.oliver.fancysitula.api.entities.FS_RealPlayer;
|
import de.oliver.fancysitula.api.entities.FS_RealPlayer;
|
||||||
import de.oliver.fancysitula.factories.FancySitula;
|
import de.oliver.fancysitula.factories.FancySitula;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -35,7 +37,7 @@ public class DialogImpl extends Dialog {
|
|||||||
super(id, data);
|
super(id, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
private FS_MultiActionDialog buildForPlayer(Player player) {
|
private FS_Dialog buildForPlayer(Player player) {
|
||||||
List<FS_DialogBody> body = new ArrayList<>();
|
List<FS_DialogBody> body = new ArrayList<>();
|
||||||
for (DialogBodyData bodyData : data.body()) {
|
for (DialogBodyData bodyData : data.body()) {
|
||||||
FS_DialogTextBody fsDialogTextBody = new FS_DialogTextBody(
|
FS_DialogTextBody fsDialogTextBody = new FS_DialogTextBody(
|
||||||
@@ -109,6 +111,30 @@ public class DialogImpl extends Dialog {
|
|||||||
actions.add(fsDialogActionButton);
|
actions.add(fsDialogActionButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (actions.isEmpty()) {
|
||||||
|
return new FS_NoticeDialog(
|
||||||
|
new FS_CommonDialogData(
|
||||||
|
ChatColorHandler.translate(data.title(), player, ParserTypes.placeholder()),
|
||||||
|
ChatColorHandler.translate(data.title(), player, ParserTypes.placeholder()),
|
||||||
|
data.canCloseWithEscape(),
|
||||||
|
false,
|
||||||
|
FS_DialogAction.CLOSE,
|
||||||
|
body,
|
||||||
|
inputs
|
||||||
|
),
|
||||||
|
new FS_DialogActionButton(
|
||||||
|
new FS_CommonButtonData(
|
||||||
|
"Close",
|
||||||
|
null,
|
||||||
|
150 // default button width
|
||||||
|
),
|
||||||
|
new FS_DialogCustomAction(
|
||||||
|
"fancydialogs_dialog_action--none",
|
||||||
|
Map.of())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return new FS_MultiActionDialog(
|
return new FS_MultiActionDialog(
|
||||||
new FS_CommonDialogData(
|
new FS_CommonDialogData(
|
||||||
ChatColorHandler.translate(data.title(), player, ParserTypes.placeholder()),
|
ChatColorHandler.translate(data.title(), player, ParserTypes.placeholder()),
|
||||||
@@ -118,53 +144,6 @@ public class DialogImpl extends Dialog {
|
|||||||
FS_DialogAction.CLOSE,
|
FS_DialogAction.CLOSE,
|
||||||
body,
|
body,
|
||||||
inputs
|
inputs
|
||||||
// List.of(
|
|
||||||
// new FS_DialogInput(
|
|
||||||
// "input1",
|
|
||||||
// new FS_DialogTextInput(
|
|
||||||
// 200,
|
|
||||||
// "Enter something",
|
|
||||||
// true,
|
|
||||||
// "default text",
|
|
||||||
// 100,
|
|
||||||
// null
|
|
||||||
// )
|
|
||||||
// ),
|
|
||||||
// new FS_DialogInput(
|
|
||||||
// "input2",
|
|
||||||
// new FS_DialogBooleanInput(
|
|
||||||
// "input2",
|
|
||||||
// false,
|
|
||||||
// "true",
|
|
||||||
// "false"
|
|
||||||
// )
|
|
||||||
// ),
|
|
||||||
// new FS_DialogInput(
|
|
||||||
// "input3",
|
|
||||||
// new FS_DialogNumberRangeInput(
|
|
||||||
// 200,
|
|
||||||
// "Number Input",
|
|
||||||
// "options.generic_value",
|
|
||||||
// 0,
|
|
||||||
// 100,
|
|
||||||
// 50.f,
|
|
||||||
// 1.0f
|
|
||||||
// )
|
|
||||||
// ),
|
|
||||||
// new FS_DialogInput(
|
|
||||||
// "input4",
|
|
||||||
// new FS_DialogSingleOptionInput(
|
|
||||||
// 200,
|
|
||||||
// List.of(
|
|
||||||
// new FS_DialogSingleOptionInput.Entry("option1", "Option 1", true),
|
|
||||||
// new FS_DialogSingleOptionInput.Entry("option2", "Option 2", false),
|
|
||||||
// new FS_DialogSingleOptionInput.Entry("option3", "Option 3", false)
|
|
||||||
// ),
|
|
||||||
// "Select an option",
|
|
||||||
// true
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
),
|
),
|
||||||
actions, // actions
|
actions, // actions
|
||||||
null,
|
null,
|
||||||
|
|||||||
@@ -46,6 +46,10 @@ public class CustomClickActionPacketListener {
|
|||||||
String dialogId = packet.getPayload().get("dialog_id");
|
String dialogId = packet.getPayload().get("dialog_id");
|
||||||
String buttonId = packet.getPayload().get("button_id");
|
String buttonId = packet.getPayload().get("button_id");
|
||||||
|
|
||||||
|
if (dialogId == null || buttonId == null) {
|
||||||
|
return; // Missing necessary information
|
||||||
|
}
|
||||||
|
|
||||||
new DialogButtonClickedEvent(event.player(), dialogId, buttonId, packet.getPayload()).callEvent();
|
new DialogButtonClickedEvent(event.player(), dialogId, buttonId, packet.getPayload()).callEvent();
|
||||||
|
|
||||||
if (dialogId.startsWith("confirmation_dialog_")) {
|
if (dialogId.startsWith("confirmation_dialog_")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user