Add clear to waypoint editor

This commit is contained in:
fullwall 2012-11-01 14:01:17 +08:00
parent a555d54c8c
commit 4fe45d5ce6
2 changed files with 17 additions and 1 deletions

View File

@ -185,6 +185,16 @@ public class LinearWaypointProvider implements WaypointProvider {
conversation = TriggerEditPrompt.start(player, LinearWaypointEditor.this);
}
});
return;
}
if (event.getMessage().equalsIgnoreCase("clear")) {
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {
@Override
public void run() {
clearWaypoints();
}
});
return;
}
if (!event.getMessage().equalsIgnoreCase("toggle path"))
return;
@ -198,6 +208,12 @@ public class LinearWaypointProvider implements WaypointProvider {
});
}
private void clearWaypoints() {
editingSlot = 0;
waypoints.clear();
destroyWaypointMarkers();
}
@EventHandler(ignoreCancelled = true)
public void onPlayerInteract(PlayerInteractEvent event) {
if (!event.getPlayer().equals(player) || event.getAction() == Action.PHYSICAL)

View File

@ -137,7 +137,7 @@ citizens.editors.text.remove-prompt=Enter the index of the entry you wish to rem
citizens.editors.text.removed-entry=[[Removed]] entry at index [[{0}]].
citizens.editors.text.start-prompt=Type [[add]] to add an entry, [[edit]] to edit entries, [[remove]] to remove entries, [[close]] to toggle the NPC as a close talker, and [[random]] to toggle the NPC as a random talker. Type [[help]] to show this again.
citizens.editors.waypoints.linear.added-waypoint=[[Added]] a waypoint at ({0}) ([[{1}]], [[{2}]])
citizens.editors.waypoints.linear.begin=<b>Entered the linear waypoint editor!<br> [[Left click]] to add a waypoint, [[right click]] to remove.<br> Type [[toggle path]] to toggle showing entities at waypoints.
citizens.editors.waypoints.linear.begin=<b>Entered the linear waypoint editor!<br> [[Left click]] to add a waypoint, [[right click]] to remove.<br> Type [[toggle path]] to toggle showing entities at waypoints, [[triggers]] to enter the trigger editor and [[clear]] to clear all waypoints.
citizens.editors.waypoints.linear.edit-slot-set=Editing slot set to [[{0}]] ({1}).
citizens.editors.waypoints.linear.end=Exited the linear waypoint editor.
citizens.editors.waypoints.linear.not-showing-markers=[[Stopped]] showing waypoint markers.