Supply external conversation hooks, part 37

This commit is contained in:
PikaMug 2021-03-03 05:46:50 -05:00
parent 4a9c2e898b
commit 5cfff53215
3 changed files with 48 additions and 8 deletions

View File

@ -90,8 +90,10 @@ public class ActionMenuPrompt extends ActionsEditorNumericPrompt {
@Override @Override
public String getPromptText(final ConversationContext context) { public String getPromptText(final ConversationContext context) {
final ActionsEditorPostOpenNumericPromptEvent event = new ActionsEditorPostOpenNumericPromptEvent(context, this); final ActionsEditorPostOpenNumericPromptEvent event
= new ActionsEditorPostOpenNumericPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event); plugin.getServer().getPluginManager().callEvent(event);
String text = ChatColor.GOLD + getTitle(context); String text = ChatColor.GOLD + getTitle(context);
for (int i = 1; i <= size; i++) { for (int i = 1; i <= size; i++) {
text += "\n" + getNumberColor(context, i) + "" + ChatColor.BOLD + i + ChatColor.RESET + " - " text += "\n" + getNumberColor(context, i) + "" + ChatColor.BOLD + i + ChatColor.RESET + " - "
@ -166,7 +168,8 @@ public class ActionMenuPrompt extends ActionsEditorNumericPrompt {
@Override @Override
public String getPromptText(final ConversationContext context) { public String getPromptText(final ConversationContext context) {
final ActionsEditorPostOpenStringPromptEvent event = new ActionsEditorPostOpenStringPromptEvent(context, this); final ActionsEditorPostOpenStringPromptEvent event
= new ActionsEditorPostOpenStringPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event); plugin.getServer().getPluginManager().callEvent(event);
final String text = ChatColor.GOLD + getTitle(context) + "\n" + ChatColor.YELLOW + getQueryText(context); final String text = ChatColor.GOLD + getTitle(context) + "\n" + ChatColor.YELLOW + getQueryText(context);
@ -228,6 +231,10 @@ public class ActionMenuPrompt extends ActionsEditorNumericPrompt {
@Override @Override
public String getPromptText(final ConversationContext context) { public String getPromptText(final ConversationContext context) {
final ActionsEditorPostOpenStringPromptEvent event
= new ActionsEditorPostOpenStringPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event);
String text = ChatColor.GOLD + getTitle(context) + "\n"; String text = ChatColor.GOLD + getTitle(context) + "\n";
for (final Action a : plugin.getActions()) { for (final Action a : plugin.getActions()) {
text += ChatColor.AQUA + a.getName() + ChatColor.GRAY + ", "; text += ChatColor.AQUA + a.getName() + ChatColor.GRAY + ", ";
@ -273,6 +280,10 @@ public class ActionMenuPrompt extends ActionsEditorNumericPrompt {
@Override @Override
public String getPromptText(final ConversationContext context) { public String getPromptText(final ConversationContext context) {
final ActionsEditorPostOpenStringPromptEvent event
= new ActionsEditorPostOpenStringPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event);
String text = ChatColor.GOLD + getTitle(context) + "\n"; String text = ChatColor.GOLD + getTitle(context) + "\n";
for (final Action a : plugin.getActions()) { for (final Action a : plugin.getActions()) {
text += ChatColor.AQUA + a.getName() + ChatColor.GRAY + ","; text += ChatColor.AQUA + a.getName() + ChatColor.GRAY + ",";
@ -337,6 +348,10 @@ public class ActionMenuPrompt extends ActionsEditorNumericPrompt {
@Override @Override
public String getPromptText(final ConversationContext context) { public String getPromptText(final ConversationContext context) {
final ActionsEditorPostOpenStringPromptEvent event
= new ActionsEditorPostOpenStringPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event);
String text = ChatColor.GREEN + "" + ChatColor.BOLD + "1" + ChatColor.RESET + "" + ChatColor.GREEN + " - " String text = ChatColor.GREEN + "" + ChatColor.BOLD + "1" + ChatColor.RESET + "" + ChatColor.GREEN + " - "
+ Lang.get("yesWord") + "\n"; + Lang.get("yesWord") + "\n";
text += ChatColor.RED + "" + ChatColor.BOLD + "2" + ChatColor.RESET + "" + ChatColor.RED + " - " text += ChatColor.RED + "" + ChatColor.BOLD + "2" + ChatColor.RESET + "" + ChatColor.RED + " - "

View File

@ -90,8 +90,10 @@ public class ConditionMenuPrompt extends ConditionsEditorNumericPrompt {
@Override @Override
public String getPromptText(final ConversationContext context) { public String getPromptText(final ConversationContext context) {
final ConditionsEditorPostOpenNumericPromptEvent event = new ConditionsEditorPostOpenNumericPromptEvent(context, this); final ConditionsEditorPostOpenNumericPromptEvent event
= new ConditionsEditorPostOpenNumericPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event); plugin.getServer().getPluginManager().callEvent(event);
String text = ChatColor.GOLD + getTitle(context); String text = ChatColor.GOLD + getTitle(context);
for (int i = 1; i <= size; i++) { for (int i = 1; i <= size; i++) {
text += "\n" + getNumberColor(context, i) + "" + ChatColor.BOLD + i + ChatColor.RESET + " - " text += "\n" + getNumberColor(context, i) + "" + ChatColor.BOLD + i + ChatColor.RESET + " - "
@ -164,7 +166,8 @@ public class ConditionMenuPrompt extends ConditionsEditorNumericPrompt {
@Override @Override
public String getPromptText(final ConversationContext context) { public String getPromptText(final ConversationContext context) {
final ConditionsEditorPostOpenStringPromptEvent event = new ConditionsEditorPostOpenStringPromptEvent(context, this); final ConditionsEditorPostOpenStringPromptEvent event
= new ConditionsEditorPostOpenStringPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event); plugin.getServer().getPluginManager().callEvent(event);
final String text = ChatColor.GOLD + getTitle(context) + "\n" + ChatColor.YELLOW + getQueryText(context); final String text = ChatColor.GOLD + getTitle(context) + "\n" + ChatColor.YELLOW + getQueryText(context);
@ -226,6 +229,10 @@ public class ConditionMenuPrompt extends ConditionsEditorNumericPrompt {
@Override @Override
public String getPromptText(final ConversationContext context) { public String getPromptText(final ConversationContext context) {
final ConditionsEditorPostOpenStringPromptEvent event
= new ConditionsEditorPostOpenStringPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event);
String text = ChatColor.GOLD + getTitle(context) + "\n"; String text = ChatColor.GOLD + getTitle(context) + "\n";
for (final Condition a : plugin.getConditions()) { for (final Condition a : plugin.getConditions()) {
text += ChatColor.AQUA + a.getName() + ChatColor.GRAY + ", "; text += ChatColor.AQUA + a.getName() + ChatColor.GRAY + ", ";
@ -271,6 +278,10 @@ public class ConditionMenuPrompt extends ConditionsEditorNumericPrompt {
@Override @Override
public String getPromptText(final ConversationContext context) { public String getPromptText(final ConversationContext context) {
final ConditionsEditorPostOpenStringPromptEvent event
= new ConditionsEditorPostOpenStringPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event);
String text = ChatColor.GOLD + getTitle(context) + "\n"; String text = ChatColor.GOLD + getTitle(context) + "\n";
for (final Condition c : plugin.getConditions()) { for (final Condition c : plugin.getConditions()) {
text += ChatColor.AQUA + c.getName() + ChatColor.GRAY + ","; text += ChatColor.AQUA + c.getName() + ChatColor.GRAY + ",";
@ -335,10 +346,14 @@ public class ConditionMenuPrompt extends ConditionsEditorNumericPrompt {
@Override @Override
public String getPromptText(final ConversationContext context) { public String getPromptText(final ConversationContext context) {
final ConditionsEditorPostOpenStringPromptEvent event
= new ConditionsEditorPostOpenStringPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event);
String text = ChatColor.GREEN + "" + ChatColor.BOLD + "1" + ChatColor.RESET + "" + ChatColor.GREEN + " - " String text = ChatColor.GREEN + "" + ChatColor.BOLD + "1" + ChatColor.RESET + "" + ChatColor.GREEN + " - "
+ Lang.get("yesWord") + "\n"; + Lang.get("yesWord") + "\n";
text += ChatColor.RED + "" + ChatColor.BOLD + "2" + ChatColor.RESET + "" + ChatColor.RED + " - " text += ChatColor.RED + "" + ChatColor.BOLD + "2" + ChatColor.RESET + "" + ChatColor.RED + " - "
+ Lang.get("noWord"); + Lang.get("noWord");
return ChatColor.RED + Lang.get("confirmDelete") + " (" + ChatColor.YELLOW return ChatColor.RED + Lang.get("confirmDelete") + " (" + ChatColor.YELLOW
+ (String) context.getSessionData(CK.ED_CONDITION_DELETE) + ChatColor.RED + ")\n" + text; + (String) context.getSessionData(CK.ED_CONDITION_DELETE) + ChatColor.RED + ")\n" + text;
} }

View File

@ -88,7 +88,8 @@ public class QuestMenuPrompt extends QuestsEditorNumericPrompt {
@Override @Override
public String getPromptText(final ConversationContext context) { public String getPromptText(final ConversationContext context) {
final QuestsEditorPostOpenNumericPromptEvent event = new QuestsEditorPostOpenNumericPromptEvent(context, this); final QuestsEditorPostOpenNumericPromptEvent event
= new QuestsEditorPostOpenNumericPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event); plugin.getServer().getPluginManager().callEvent(event);
String text = ChatColor.GOLD + getTitle(context); String text = ChatColor.GOLD + getTitle(context);
for (int i = 1; i <= size; i++) { for (int i = 1; i <= size; i++) {
@ -149,7 +150,8 @@ public class QuestMenuPrompt extends QuestsEditorNumericPrompt {
@Override @Override
public String getPromptText(final ConversationContext context) { public String getPromptText(final ConversationContext context) {
final QuestsEditorPostOpenStringPromptEvent event = new QuestsEditorPostOpenStringPromptEvent(context, this); final QuestsEditorPostOpenStringPromptEvent event
= new QuestsEditorPostOpenStringPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event); plugin.getServer().getPluginManager().callEvent(event);
final String text = ChatColor.GOLD + getTitle(context)+ "\n" + ChatColor.YELLOW + getQueryText(context); final String text = ChatColor.GOLD + getTitle(context)+ "\n" + ChatColor.YELLOW + getQueryText(context);
@ -213,6 +215,10 @@ public class QuestMenuPrompt extends QuestsEditorNumericPrompt {
@Override @Override
public String getPromptText(final ConversationContext context) { public String getPromptText(final ConversationContext context) {
final QuestsEditorPostOpenStringPromptEvent event
= new QuestsEditorPostOpenStringPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event);
String text = ChatColor.GOLD + getTitle(context); String text = ChatColor.GOLD + getTitle(context);
for (final Quest q : plugin.getQuests()) { for (final Quest q : plugin.getQuests()) {
text += "\n" + ChatColor.GRAY + "- " + ChatColor.AQUA + q.getName(); text += "\n" + ChatColor.GRAY + "- " + ChatColor.AQUA + q.getName();
@ -253,6 +259,10 @@ public class QuestMenuPrompt extends QuestsEditorNumericPrompt {
@Override @Override
public String getPromptText(final ConversationContext context) { public String getPromptText(final ConversationContext context) {
final QuestsEditorPostOpenStringPromptEvent event
= new QuestsEditorPostOpenStringPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event);
String text = ChatColor.GOLD + getTitle(context) + "\n"; String text = ChatColor.GOLD + getTitle(context) + "\n";
for (final Quest quest : plugin.getQuests()) { for (final Quest quest : plugin.getQuests()) {
text += ChatColor.AQUA + quest.getName() + ChatColor.GRAY + ","; text += ChatColor.AQUA + quest.getName() + ChatColor.GRAY + ",";