Supply external conversation hooks, part 39

This commit is contained in:
PikaMug 2021-03-04 02:20:31 -05:00
parent cf9a105eb9
commit ce56f9e326
3 changed files with 91 additions and 18 deletions

View File

@ -354,6 +354,28 @@ public class ActionMenuPrompt extends ActionsEditorNumericPrompt {
return null;
}
public ChatColor getNumberColor(final ConversationContext context, final int number) {
switch (number) {
case 1:
return ChatColor.GREEN;
case 2:
return ChatColor.RED;
default:
return null;
}
}
public String getSelectionText(final ConversationContext context, final int number) {
switch (number) {
case 1:
return ChatColor.GREEN + Lang.get("yesWord");
case 2:
return ChatColor.RED + Lang.get("noWord");
default:
return null;
}
}
@Override
public String getQueryText(final ConversationContext context) {
return Lang.get("confirmDelete");
@ -365,12 +387,13 @@ public class ActionMenuPrompt extends ActionsEditorNumericPrompt {
= new ActionsEditorPostOpenStringPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event);
String text = ChatColor.GREEN + "" + ChatColor.BOLD + "1" + ChatColor.RESET + "" + ChatColor.GREEN + " - "
+ Lang.get("yesWord") + "\n";
text += ChatColor.RED + "" + ChatColor.BOLD + "2" + ChatColor.RESET + "" + ChatColor.RED + " - "
+ Lang.get("noWord");
return ChatColor.RED + getQueryText(context) + " (" + ChatColor.YELLOW
+ (String) context.getSessionData(CK.ED_EVENT_DELETE) + ChatColor.RED + ")\n" + text;
String text = ChatColor.RED + getQueryText(context) + " (" + ChatColor.YELLOW
+ (String) context.getSessionData(CK.ED_EVENT_DELETE) + ChatColor.RED + ")\n";
for (int i = 1; i <= size; i++) {
text += "\n" + getNumberColor(context, i) + "" + ChatColor.BOLD + i + ChatColor.RESET + " - "
+ getSelectionText(context, i);
}
return text;
}
@Override

View File

@ -352,6 +352,28 @@ public class ConditionMenuPrompt extends ConditionsEditorNumericPrompt {
return null;
}
public ChatColor getNumberColor(final ConversationContext context, final int number) {
switch (number) {
case 1:
return ChatColor.GREEN;
case 2:
return ChatColor.RED;
default:
return null;
}
}
public String getSelectionText(final ConversationContext context, final int number) {
switch (number) {
case 1:
return ChatColor.GREEN + Lang.get("yesWord");
case 2:
return ChatColor.RED + Lang.get("noWord");
default:
return null;
}
}
@Override
public String getQueryText(final ConversationContext context) {
return Lang.get("confirmDelete");
@ -363,12 +385,13 @@ public class ConditionMenuPrompt extends ConditionsEditorNumericPrompt {
= new ConditionsEditorPostOpenStringPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event);
String text = ChatColor.GREEN + "" + ChatColor.BOLD + "1" + ChatColor.RESET + "" + ChatColor.GREEN + " - "
+ Lang.get("yesWord") + "\n";
text += ChatColor.RED + "" + ChatColor.BOLD + "2" + ChatColor.RESET + "" + ChatColor.RED + " - "
+ Lang.get("noWord");
return ChatColor.RED + Lang.get("confirmDelete") + " (" + ChatColor.YELLOW
+ (String) context.getSessionData(CK.ED_CONDITION_DELETE) + ChatColor.RED + ")\n" + text;
String text = ChatColor.RED + getQueryText(context) + " (" + ChatColor.YELLOW
+ (String) context.getSessionData(CK.ED_CONDITION_DELETE) + ChatColor.RED + ")\n";
for (int i = 1; i <= size; i++) {
text += "\n" + getNumberColor(context, i) + "" + ChatColor.BOLD + i + ChatColor.RESET + " - "
+ getSelectionText(context, i);
}
return text;
}
@Override

View File

@ -334,6 +334,28 @@ public class QuestMenuPrompt extends QuestsEditorNumericPrompt {
return null;
}
public ChatColor getNumberColor(final ConversationContext context, final int number) {
switch (number) {
case 1:
return ChatColor.GREEN;
case 2:
return ChatColor.RED;
default:
return null;
}
}
public String getSelectionText(final ConversationContext context, final int number) {
switch (number) {
case 1:
return ChatColor.GREEN + Lang.get("yesWord");
case 2:
return ChatColor.RED + Lang.get("noWord");
default:
return null;
}
}
@Override
public String getQueryText(final ConversationContext context) {
return Lang.get("confirmDelete");
@ -341,12 +363,17 @@ public class QuestMenuPrompt extends QuestsEditorNumericPrompt {
@Override
public String getPromptText(final ConversationContext context) {
String text = ChatColor.GREEN + "" + ChatColor.BOLD + "1" + ChatColor.RESET + "" + ChatColor.GREEN + " - "
+ Lang.get("yesWord") + "\n";
text += ChatColor.RED + "" + ChatColor.BOLD + "2" + ChatColor.RESET + "" + ChatColor.RED + " - "
+ Lang.get("noWord");
return ChatColor.RED + getQueryText(context) + " (" + ChatColor.YELLOW
+ (String) context.getSessionData(CK.ED_QUEST_DELETE) + ChatColor.RED + ")\n" + text;
final QuestsEditorPostOpenStringPromptEvent event
= new QuestsEditorPostOpenStringPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event);
String text = ChatColor.RED + getQueryText(context) + " (" + ChatColor.YELLOW
+ (String) context.getSessionData(CK.ED_QUEST_DELETE) + ChatColor.RED + ")\n";
for (int i = 1; i <= size; i++) {
text += "\n" + getNumberColor(context, i) + "" + ChatColor.BOLD + i + ChatColor.RESET + " - "
+ getSelectionText(context, i);
}
return text;
}
@Override