Skip to content

Commit

Permalink
Add messages for chat waypoint trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Oct 12, 2020
1 parent 4591b9e commit 13dee35
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
Expand Up @@ -280,12 +280,11 @@ public void run() {
clearWaypoints();
}
});
} else if (message.equalsIgnoreCase("toggle path")) {
} else if (message.equalsIgnoreCase("toggle path") || message.equalsIgnoreCase("markers")) {
event.setCancelled(true);
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {
@Override
public void run() {
// we need to spawn entities on the main thread.
togglePath();
}
});
Expand Down
Expand Up @@ -23,6 +23,7 @@ public Prompt acceptInput(ConversationContext context, String input) {
if (input.startsWith("radius")) {
try {
radius = Double.parseDouble(input.split(" ")[1]);
Messaging.sendTr((CommandSender) context.getForWhom(), Messages.CHAT_TRIGGER_RADIUS_SET, radius);
} catch (NumberFormatException e) {
Messaging.sendErrorTr((CommandSender) context.getForWhom(),
Messages.WAYPOINT_TRIGGER_CHAT_INVALID_RADIUS);
Expand All @@ -36,6 +37,7 @@ public Prompt acceptInput(ConversationContext context, String input) {
return (Prompt) context.getSessionData(WaypointTriggerPrompt.RETURN_PROMPT_KEY);
}
lines.add(input);
Messaging.sendTr((CommandSender) context.getForWhom(), Messages.CHAT_TRIGGER_MESSAGE_ADDED, input);
return this;
}

Expand Down
2 changes: 2 additions & 0 deletions main/src/main/java/net/citizensnpcs/util/Messages.java
Expand Up @@ -33,7 +33,9 @@ public class Messages {
public static final String CAT_STOPPED_LYING = "citizens.commands.npc.cat.lying-stop";
public static final String CAT_STOPPED_SITTING = "citizens.commands.npc.cat.sitting-stop";
public static final String CAT_TYPE_SET = "citizens.commands.npc.cat.type-set";
public static final String CHAT_TRIGGER_MESSAGE_ADDED = "citizens.editors.waypoints.triggers.chat.message-added";
public static final String CHAT_TRIGGER_PROMPT = "citizens.editors.waypoints.triggers.chat.prompt";
public static final String CHAT_TRIGGER_RADIUS_SET = "citizens.editors.waypoints.triggers.chat.radius-set";
public static final String CITIZENS_IMPLEMENTATION_DISABLED = "citizens.changed-implementation";
public static final String CITIZENS_INCOMPATIBLE = "citizens.notifications.incompatible-version";
public static final String CITIZENS_INVALID_COMMAND_CLASS = "citizens.commands.invalid.class";
Expand Down
6 changes: 4 additions & 2 deletions main/src/main/resources/messages_en.properties
Expand Up @@ -247,7 +247,7 @@ citizens.commands.npc.zombiemod.villager-profession-set=[[{0}]]''s profession se
citizens.commands.page-missing=The page [[{0}]] does not exist.
citizens.commands.requirements.disallowed-mobtype=The NPC cannot be the mob type [[{0}]] for that command.
citizens.commands.requirements.living-entity=The NPC must be a living entity.
citizens.commands.requirements.missing-permission=You don't have permission to execute that command.
citizens.commands.requirements.missing-permission=You don''t have permission to execute that command.
citizens.commands.requirements.missing-required-trait=Missing required trait [[{0}]].
citizens.commands.requirements.must-be-ingame=You must be ingame to use that command.
citizens.commands.requirements.must-be-owner=You must be the owner of this NPC to execute that command.
Expand Down Expand Up @@ -285,7 +285,7 @@ citizens.editors.already-in-editor=You''re already in an editor!
citizens.editors.copier.begin=<b>Entered the NPC copier!<br>Click anywhere to copy the currently selected NPC.
citizens.editors.copier.end=Exited the NPC copier.
citizens.editors.equipment.all-items-removed=[[{0}]] had all of its items removed.
citizens.editors.equipment.begin=<b>Entered the equipment editor!<br>[[Right click]] to equip the NPC or [[crouch right click]] to change the item in hand!<br>Type [[offhand]], [[chestplate]], [[helmet]], etc. in chat to equip specific slots with the item you're holding!
citizens.editors.equipment.begin=<b>Entered the equipment editor!<br>[[Right click]] to equip the NPC or [[crouch right click]] to change the item in hand!<br>Type [[offhand]], [[chestplate]], [[helmet]], etc. in chat to equip specific slots with the item you''re holding!
citizens.editors.equipment.end=Exited the equipment editor.
citizens.editors.equipment.invalid-block=Invalid block!
citizens.editors.equipment.saddled-set=[[{0}]] is now saddled.
Expand Down Expand Up @@ -349,6 +349,8 @@ citizens.editors.waypoints.triggers.animation.prompt=Enter in animations to perf
citizens.editors.waypoints.triggers.animation.invalid-animation=Invalid animation [[{0}]]. Valid animations are {1}.
citizens.editors.waypoints.triggers.chat.invalid-radius=The radius must be a number.
citizens.editors.waypoints.triggers.chat.missing-radius=No radius supplied.
citizens.editors.waypoints.triggers.chat.message-added=Message added: [[{0}]].
citizens.editors.waypoints.triggers.chat.radius-set=Radius set to [[{0}]] blocks.
citizens.editors.waypoints.triggers.chat.prompt=Enter in chat lines to say.<br>Type in [[radius (radius)]] to set the block radius to broadcast the messages.<br>Type [[finish]] to finish the chat trigger or [[back]] to return to the previous prompt.
citizens.editors.waypoints.triggers.delay.prompt=Enter the delay in [[server ticks]] to use. (20 ticks = 1 second)
citizens.editors.waypoints.triggers.main.missing-waypoint=Not editing a waypoint.
Expand Down

0 comments on commit 13dee35

Please sign in to comment.