Skip to content

Commit

Permalink
Merge pull request #52 from Ghoulboy78/spray-paint
Browse files Browse the repository at this point in the history
Spray paint and reintroduce #45
  • Loading branch information
Ghoulboy78 authored Mar 20, 2021
2 parents 0075f61 + e907c42 commit c43cd8f
Show file tree
Hide file tree
Showing 4 changed files with 319 additions and 78 deletions.
13 changes: 12 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ and the value being a lambda function with `(pos, args, flags)` as the arguments
world in whatever way you see fit, and must call the `add_to_history()` function (cos not all brush functions set blocks).
You can take whichever arguments you need from the args `args` variable as long as you specify them in the input command.
You must also add a command which takes the correct inputs and passes them to the `shape()` function in the proper manner.
You must also add a translation key for the action to the lang file.
You must also add a translation key for the action to the lang file. Finally, it's encouraged that devs add a list of parameters
to `global_brushes_parameters_map` to pretify the `brush info` command output.

If this was too bulky and confusing too understand, here is a full example of the `cube` function, which simply places
cubes:
Expand Down Expand Up @@ -145,6 +146,16 @@ cubes:
}
```

4. We finally add a list of the aprameters the brush uses to `global_brushes_parameters_map` to be the display names when
calling `brush info`:
```
global_brushes_parameters_map = {
... //other brushes
'cube'-> ['block', 'size', 'replace'],
... //more brushes
}
```

#### Messages

If you want to print a message as an output to the player, the easiest way is using the `_print(player, message_id, ...extra_args)`
Expand Down
5 changes: 3 additions & 2 deletions docs/Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ The available actions for brushes are:
to become `block`, always staying within `radius` blocks of the starting point. The flood happens in the plane
perpendicular to `axis`, if given.
- `paste` -> pastes the current clipboard, using the targeted block as origin.
- `feature <feature>` -> places a feature (decoration) in the targeted location. Can fail, if natural feature would fail.
DOES NOT SUPPORT `undo` functionality.
- `feature <fearure>` -> places a feature (decoration) in the targeted location. Can fail, if natural feature would fail. DOES NOT SUPPORT `undo` functionality.
- `spray <block> [size] [count] [replacement]` -> creates a spray paint effect: projects `[count]` (100 by default) random rays around the volume the player is looking at in a cone with `[size]` (12 degrees, by default) angle aperture and places `<block>` in a random patter.
- `spray held_item [size] [count] [replacement]` -> same as abve, but it uses the item held _in the offhand_ intead of a set item. Useful when changing block often, to avoid needing to create multiple brushes.

All brush functions can be appended with flags, same as fill commands, adding `f -<flags>` at the end of the regular commands.

Expand Down
48 changes: 34 additions & 14 deletions world-edit.data/langs/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@
"help_cmd_brush_paste": "l Register brush to paste current clipboard with origin on targeted block",
"no_redo": "r No actions to redo for player %s",
"help_cmd_expand": "l Expands sel [magn] from pos",
"brush_info_no_flags": "w no flags",
"help_make_selection": "c Use your wand to select with a start and final position",
"brush_empty_list": "gi No brushes registerd so far",
"action_cone": "cone",
"action_cuboid": "cuboid",
"help_cmd_brush_list": "l Lists all currently regiestered brushes and their actions",
"action_cylinder": "cylinder",
"help_pagination_prev": "g Go to previous page (%d)",
"help_cmd_brush_flood": "l Register brush to perfrm flood fill out of [block] starting on right clicked block",
"help_cmd_brush_flood": "l Register brush to perform flood fill out of [block] starting on right clicked block",
"more_moves_redo": "w Your number is too high, redoing all moves for %s",
"no_undo_history": "w No undo history to show for player %s",
"action_outline": "outline",
"help_cmd_brush_feature": "l Register brush to plop feature",
"action_stack": "stack",
"help_cmd_brush_info": "l Gives detailed info of currently held brush",
Expand All @@ -24,25 +26,28 @@
"action_line": "line",
"action_structure_paste": "structure_paste",
"brush_list_header": "bc === Current brushes are ===",
"help_cmd_brush_cylinder": "l Register brush to create cylinder with [radius] and [height] along [axis] out of [block]",
"new_brush": "wi %s is now a brush with action %s",
"help_cmd_brush_cylinder": "l Register brush to create a cylinder with [radius] and [height] along [axis] out of [block]",
"more_moves_undo": "w Your number is too high, undoing all moves for %s",
"help_welcome_tooltip": "y Hooray!",
"saved_structure": "w Saved structure as %s.nbt",
"help_cmd_rotate": "l Rotates [deg] about [pos]",
"brush_info_action": "b Action: ",
"help_cmd_brush_pyramid": "l Register brush to create a pyramid with [radius] and [height] along [axis] in the direciton given by the sign",
"langs_completeness": "gi Note: %s translation is only %s%% translated: %s missing strings",
"no_undo": "r No actions to undo for player %s",
"help_cmd_rotate_tooltip": "g Axis must be x, y or z",
"help_cmd_move": "l Moves selection to <pos>",
"langs_changed": "gi Language changed to %s.",
"copy_force": "ri Overwriting previous clipboard selection with new one",
"action_ellipsoid": "ellipsoid",
"help_cmd_brush_cuboid": "l Register brush to create cuboid of dimensions [x] [y] and [z] out of [block]",
"help_cmd_brush_cuboid": "l Register brush to create a cuboid of dimensions [x] [y] and [z] out of [block]",
"entry_undo_1": "w %d: type: %s (dimension: %s):",
"brush_reach": "w Brush reach is currently %d blocks",
"help_cmd_undo_history": "l Shows the history of undone actions",
"success_redo": "gi Successfully redid %d operations, filling %d blocks",
"no_longer_brush": "w %s is no longer a brush",
"help_cmd_undo": "l Undoes last n moves, one by default",
"brush_info_flags": "b Flags: ",
"action_sphere": "sphere",
"help_cmd_brush_generic": "l Hold item to turn into brush",
"move_selection_no_player_error": "r To move selection in the direction of the player, you need to have a player",
Expand All @@ -51,55 +56,69 @@
"structure_delete_success": "gi Successfully deleted %s.nbt",
"help_cmd_lang": "l Changes current app's language to [lang]",
"help_list_title": "y Command list (without prefix):",
"brush_item_tooltip": "^g Click to get one!",
"paste_no_clipboard": "ri Cannot complete action, clipboard for player %s is empty",
"help_cmd_redo_tooltip": "g Also shows up in undo history",
"no_selection_error": "r Missing selection for operation for player %s",
"action_cube": "cube",
"new_wand": "wi %s is now the app's wand, use it with care.",
"help_welcome": "c Welcome to the World-Edit Scarpet app's help!",
"help_cmd_undo_all": "l Undoes the entire action history",
"help_cmd_brush_line": "l Register brush to create line from player to where you click of [length], if given",
"help_cmd_brush_line": "l Register brush to create a line from player to where you click of [length], if given",
"success_undo": "gi Successfully undid %d operations, filling %d blocks",
"brush_info_params": "b Parameters: ",
"help_cmd_expand_tooltip": "g Expands the selection [magnitude] from [pos]",
"help_cmd_brush_clear": "l Unregisters current item as brush",
"help_cmd_stack": "l Stacks selection n times in dir",
"copy_clipboard_not_empty": "ri Clipboard for player %s is not empty, use \"/copy force\" to overwrite existing clipboard data",
"invalid_wand": "r Wand has to be a tool or weapon",
"help_cmd_lang_tooltip": "g Available languages are %s",
"action_pyramid": "pyramid",
"help_selection_bounds": "l From %s to %s",
"help_app_lang": "c App Language ",
"structure_overwrite": "ri Overwriting %s.nbt with a new structure",
"action_spray": "spray",
"entry_undo_2 ": "w affected positions: %s",
"action_rotate": "rotate",
"brush_new_reach": "w Brush reach was set to %d blocks",
"help_cmd_brush_sphere": "l Register brush to create sphere of radius [size] out of [block]",
"help_cmd_brush_polygon": "l Register brush to create polygon prism with [vertices] ammount of sides",
"help_cmd_brush_cone": "l Register brush to create cylinder with [radius] and [height] along [axis] in the direciton given by the sign",
"help_cmd_up": "l Teleport up specified ammount of block",
"help_cmd_brush_sphere": "l Register brush to create a sphere of radius [size] out of [block]",
"help_cmd_brush_polygon": "l Register brush to create a polygon prism with [vertices] ammount of sides",
"help_cmd_spray": "l Register brush to spray paint with given radius an point count",
"help_cmd_brush_cone": "l Register brush to create a cone with [radius] and [height] along [axis] in the direciton given by the sign",
"brush_replaced": "w Replacing previous action for brush in %s",
"help_header_suffix": "c ] -----------------",
"help_pagination_suffix": "c ---------------",
"help_cmd_spray_held": "l Register brush to spray paint out of block held in the offhand",
"help_cmd_up_tooltip": "g Generate a glass block under you if there was nothing there",
"help_pagination_last": "g Go to last page (%d)",
"help_cmd_set": "l Set selection to block, filterable",
"langs_add_more_tip": "y Add more languages to the %s folder to use them! Get them from our repo!",
"help_cmd_redo": "l Redoes last n undoes, one by default",
"help_cmd_brush_cube": "l Register brush to create cube of side length [size] out of [block]",
"help_cmd_brush_cube": "l Register brush to create a cube of side length [size] out of [block]",
"action_set": "set",
"action_prism_star": "prism_star",
"help_cmd_outline": "l Outlines the selection with <block>",
"help_cmd_wand": "l Sets held item as wand or gives it if hand is empty",
"brush_extra_info": "ig For detailed info on a brush use /world-edit brush info",
"brush_extra_info": "ig For detailed info on a brush click the [i] icon",
"help_app_lang_tooltip": "g Use the lang command to change it",
"help_cmd_brush_ellipsoid": "l Register brush to create ellipsoid with radii [x_radius], [y_radius] and [z_radius] out of [block]",
"help_cmd_brush_ellipsoid": "l Register brush to create a ellipsoid with radii [x_radius], [y_radius] and [z_radius] out of [block]",
"help_pagination_page": "y Page %d ",
"help_cmd_brush_star": "l Register brush to create star prism with [vertices] ammount of points",
"help_cmd_brush_star": "l Register brush to create a star prism with [vertices] ammount of points",
"action_paste": "paste",
"brush_info": "w %s has action %s bound to it with parameters %s and flags %s",
"no_brush_error": "r %s in not a brush",
"structure_list": "w List of structures:",
"action_walls": "walls",
"help_cmd_wand_2": "l Changes the current wand item",
"help_app_lang_selected": "l %s",
"action_move": "move",
"help_pagination_next": "g Go to next page (%d)",
"brush_info_params_tooltip": "^g See help to understand what each parameter is",
"action_flood": "flood",
"brush_new": "w Registerd new %s brush to %s",
"help_cmd_walls_tooltip": "l Use [sides] to choose which sides to generate",
"filled": "gi Filled %d blocks",
"help_cmd_walls": "l Set walls of the selection",
"existing_structure": "r Existing file %s.nbt, use 'force' to overwrite",
"langs_not_found": "r Language file for %s not found",
"language_code": "en_us",
Expand All @@ -115,5 +134,6 @@
"help_pagination_first": "g Go to first page",
"help_selected_wand_item": "l %s",
"many_undo": "w Undo history for player %s is very long, showing only the last ten items",
"structure_load_fail": "ri Failed to load %s.nbt, no such file exists"
"structure_load_fail": "ri Failed to load %s.nbt, no such file exists",
"brush_info_title": "y Brush registered to "
}
Loading

0 comments on commit c43cd8f

Please sign in to comment.