mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-22 09:39:48 +00:00
Changed Player Dialog Events to work like NPC Dialog Events
This commit is contained in:
1 parent
9ebaf780e1
commit
92e69bb270
3 files changed
+23
-12
No files matched your search
@@ -8,24 +8,36 @@ import noppes.npcs.constants.EnumScriptType;
|
||||
|
||||
public class DialogEvent extends PlayerEvent implements IDialogEvent {
|
||||
public final IDialog dialog;
|
||||
public final int dialogId;
|
||||
public final int optionId;
|
||||
|
||||
public DialogEvent(IPlayer player, IDialog dialog) {
|
||||
public DialogEvent(IPlayer player, int id, int optionId, IDialog dialog) {
|
||||
super(player);
|
||||
this.dialog = dialog;
|
||||
this.dialogId = id;
|
||||
this.optionId = optionId;
|
||||
}
|
||||
|
||||
public IDialog getDialog() {
|
||||
return dialog;
|
||||
}
|
||||
|
||||
public int getDialogId() {
|
||||
return dialogId;
|
||||
}
|
||||
|
||||
public int getOptionId() {
|
||||
return optionId;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.DIALOG_EVENT.function;
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
public static class DialogOpen extends DialogEvent implements IDialogEvent.DialogOpen {
|
||||
public DialogOpen(IPlayer player, IDialog dialog) {
|
||||
super(player, dialog);
|
||||
public DialogOpen(IPlayer player, int id, int optionId, IDialog dialog) {
|
||||
super(player, id, optionId, dialog);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
@@ -35,8 +47,8 @@ public class DialogEvent extends PlayerEvent implements IDialogEvent {
|
||||
|
||||
@Cancelable
|
||||
public static class DialogOption extends DialogEvent implements IDialogEvent.DialogOption {
|
||||
public DialogOption(IPlayer player, IDialog dialog) {
|
||||
super(player, dialog);
|
||||
public DialogOption(IPlayer player, int id, int optionId, IDialog dialog) {
|
||||
super(player, id, optionId, dialog);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
@@ -46,13 +58,12 @@ public class DialogEvent extends PlayerEvent implements IDialogEvent {
|
||||
}
|
||||
|
||||
public static class DialogClosed extends DialogEvent implements IDialogEvent.DialogClosed {
|
||||
public DialogClosed(IPlayer player, IDialog dialog) {
|
||||
super(player, dialog);
|
||||
public DialogClosed(IPlayer player, int id, int optionId, IDialog dialog) {
|
||||
super(player, id, optionId, dialog);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.DIALOG_CLOSE.function;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user