translate selection commands

This commit is contained in:
Jesse Boyd 2016-12-13 15:00:55 +11:00
parent 84d7da3274
commit 23cb3642f1
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
2 changed files with 38 additions and 19 deletions

View File

@ -206,8 +206,24 @@ public enum BBC {
JUMPTO_FAIL("No block in sight!", "Navigation"), JUMPTO_FAIL("No block in sight!", "Navigation"),
UP_FAIL("You would hit something above you.", "Navigation"), UP_FAIL("You would hit something above you.", "Navigation"),
SEL_CUBOID("Cuboid: left click for point 1, right click for point 2", "Selection"),
SEL_CUBOID_EXTEND("Cuboid: left click for a starting point, right click to extend", "Selection"),
SEL_2D_POLYGON("2D polygon selector: Left/right click to add a point.", "Selection"),
SEL_ELLIPSIOD("Ellipsoid selector: left click=center, right click to extend", "Selection"),
SEL_SPHERE("Sphere selector: left click=center, right click to set radius", "Selection"),
SEL_CYLINDRICAL("Cylindrical selector: Left click=center, right click to extend.", "Selection"),
SEL_MAX("%s0 points maximum.", "Selection"),
SEL_FUZZY("Fuzzy selector: Left click to select all contingent blocks, right click to add", "Selection"),
SEL_CONVEX_POLYHEDRAL("Convex polyhedral selector: Left click=First vertex, right click to add more.", "Selection"),
SEL_LIST("For a list of selection types use:&c //sel", "Selection"),
SEL_MODES("Select one of the modes below:", "Selection"),
TIP_SEL_FUZZY("Tip: See the different selection modes with `//sel list`", "Tips"),
TIP_CANCEL("Tip: You can cancel an edit with `//cancel`", "Tips"),
TIP_DOWNLOAD("Tip: Download your clipboard with `//download`", "Tips"),
TIP_BRUSH("Tip: See all the cool brushes with `//br`", "Tips"),

View File

@ -725,33 +725,35 @@ public class SelectionCommands {
final RegionSelector selector; final RegionSelector selector;
if (typeName.equalsIgnoreCase("cuboid")) { if (typeName.equalsIgnoreCase("cuboid")) {
selector = new CuboidRegionSelector(oldSelector); selector = new CuboidRegionSelector(oldSelector);
player.print("Cuboid: left click for point 1, right click for point 2"); player.print(BBC.SEL_CUBOID.s());
} else if (typeName.equalsIgnoreCase("extend")) { } else if (typeName.equalsIgnoreCase("extend")) {
selector = new ExtendingCuboidRegionSelector(oldSelector); selector = new ExtendingCuboidRegionSelector(oldSelector);
player.print("Cuboid: left click for a starting point, right click to extend"); player.print(BBC.SEL_CUBOID_EXTEND.s());
} else if (typeName.equalsIgnoreCase("poly")) { } else if (typeName.equalsIgnoreCase("poly")) {
selector = new Polygonal2DRegionSelector(oldSelector); selector = new Polygonal2DRegionSelector(oldSelector);
player.print("2D polygon selector: Left/right click to add a point."); player.print(BBC.SEL_2D_POLYGON.s());
Optional<Integer> limit = ActorSelectorLimits.forActor(player).getPolygonVertexLimit(); Optional<Integer> limit = ActorSelectorLimits.forActor(player).getPolygonVertexLimit();
if (limit.isPresent()) { if (limit.isPresent()) {
player.print(limit.get() + " points maximum."); player.print(BBC.SEL_MAX.f(limit.get()));
} }
player.print(BBC.SEL_LIST.s());
} else if (typeName.equalsIgnoreCase("ellipsoid")) { } else if (typeName.equalsIgnoreCase("ellipsoid")) {
selector = new EllipsoidRegionSelector(oldSelector); selector = new EllipsoidRegionSelector(oldSelector);
player.print("Ellipsoid selector: left click=center, right click to extend"); player.print(BBC.SEL_ELLIPSIOD.s());
} else if (typeName.equalsIgnoreCase("sphere")) { } else if (typeName.equalsIgnoreCase("sphere")) {
selector = new SphereRegionSelector(oldSelector); selector = new SphereRegionSelector(oldSelector);
player.print("Sphere selector: left click=center, right click to set radius"); player.print(BBC.SEL_SPHERE.s());
} else if (typeName.equalsIgnoreCase("cyl")) { } else if (typeName.equalsIgnoreCase("cyl")) {
selector = new CylinderRegionSelector(oldSelector); selector = new CylinderRegionSelector(oldSelector);
player.print("Cylindrical selector: Left click=center, right click to extend."); player.print(BBC.SEL_CYLINDRICAL.s());
} else if (typeName.equalsIgnoreCase("convex") || typeName.equalsIgnoreCase("hull") || typeName.equalsIgnoreCase("polyhedron")) { } else if (typeName.equalsIgnoreCase("convex") || typeName.equalsIgnoreCase("hull") || typeName.equalsIgnoreCase("polyhedron")) {
selector = new ConvexPolyhedralRegionSelector(oldSelector); selector = new ConvexPolyhedralRegionSelector(oldSelector);
player.print("Convex polyhedral selector: Left click=First vertex, right click to add more."); player.print(BBC.SEL_CONVEX_POLYHEDRAL.s());
Optional<Integer> limit = ActorSelectorLimits.forActor(player).getPolyhedronVertexLimit(); Optional<Integer> limit = ActorSelectorLimits.forActor(player).getPolyhedronVertexLimit();
if (limit.isPresent()) { if (limit.isPresent()) {
player.print(limit.get() + " points maximum."); player.print(BBC.SEL_MAX.f(limit.get()));
} }
player.print(BBC.SEL_LIST.s());
} else if (typeName.startsWith("fuzzy") || typeName.startsWith("magic")) { } else if (typeName.startsWith("fuzzy") || typeName.startsWith("magic")) {
Mask mask; Mask mask;
if (typeName.length() > 6) { if (typeName.length() > 6) {
@ -765,21 +767,22 @@ public class SelectionCommands {
mask = new IdMask(editSession); mask = new IdMask(editSession);
} }
selector = new FuzzyRegionSelector(player, editSession, mask); selector = new FuzzyRegionSelector(player, editSession, mask);
player.print("Fuzzy selector: Left click to select all contingent blocks, right click to add"); player.print(BBC.SEL_FUZZY.s());
player.print(BBC.SEL_LIST.s());
} else { } else {
CommandListBox box = new CommandListBox("Selection modes"); CommandListBox box = new CommandListBox("Selection modes");
StyledFragment contents = box.getContents(); StyledFragment contents = box.getContents();
StyledFragment tip = contents.createFragment(Style.RED); StyledFragment tip = contents.createFragment(Style.RED);
tip.append("Select one of the modes below:").newLine(); tip.append(BBC.SEL_MODES.s()).newLine();
box.appendCommand("cuboid", "Select two corners of a cuboid"); box.appendCommand("//sel cuboid", "Select two corners of a cuboid");
box.appendCommand("extend", "Fast cuboid selection mode"); box.appendCommand("//sel extend", "Fast cuboid selection mode");
box.appendCommand("poly", "Select a 2D polygon with height"); box.appendCommand("//sel poly", "Select a 2D polygon with height");
box.appendCommand("ellipsoid", "Select an ellipsoid"); box.appendCommand("//sel ellipsoid", "Select an ellipsoid");
box.appendCommand("sphere", "Select a sphere"); box.appendCommand("//sel sphere", "Select a sphere");
box.appendCommand("cyl", "Select a cylinder"); box.appendCommand("//sel cyl", "Select a cylinder");
box.appendCommand("convex", "Select a convex polyhedral"); box.appendCommand("//sel convex", "Select a convex polyhedral");
box.appendCommand("fuzzy[=<mask>]", "Select all connected blocks"); box.appendCommand("//sel fuzzy[=<mask>]", "Select all connected blocks");
player.printRaw(ColorCodeBuilder.asColorCodes(box)); player.printRaw(ColorCodeBuilder.asColorCodes(box));
return; return;