comments: add @module to wea.sculpt.*

This commit is contained in:
Starbeamrainbowlabs 2023-08-03 02:42:46 +01:00
parent c12bcad8cb
commit 0f25cf5b4e
No known key found for this signature in database
GPG Key ID: 1BE5172E637709C2
11 changed files with 39 additions and 0 deletions

@ -2,6 +2,9 @@ local wea = worldeditadditions
local wea_c = worldeditadditions_core
local Vector3 = wea_c.Vector3
---
-- @module worldeditadditions.sculpt
--- Applies the given brush with the given height and size to the given position.
-- @param pos1 Vector3 The position at which to apply the brush.
-- @param brush_name string The name of the brush to apply.

@ -1,6 +1,10 @@
local wea_c = worldeditadditions_core
local Vector3 = wea_c.Vector3
---
-- @module worldeditadditions.sculpt
--- Applies the given brush at the given x/z position to the given heightmap.
-- Important: Where a Vector3 is mentioned in the parameter list, it reall MUST
-- be a Vector3 instance.

@ -2,6 +2,9 @@ local wea = worldeditadditions
local wea_c = worldeditadditions_core
local Vector3 = wea_c.Vector3
---
-- @module worldeditadditions.sculpt.brushes
--- Returns a smooth gaussian brush.
-- @name make_gaussian
-- @internal

@ -1,7 +1,11 @@
local wea_c = worldeditadditions_core
local Vector3 = wea_c.Vector3
---
-- @module worldeditadditions.sculpt.brushes
--- Makes a circle brush of a given size.
-- Default inbuilt brush.
-- @name circle
-- @param size Vector3 The desired sizez of the brush (only X and Y are considered; Z is ignored).
-- @returns bool,brush,Vector3 Success bool, then the brush, then finally the actual size of the brush generated.

@ -1,5 +1,8 @@
---
-- @module worldeditadditions.sculpt.brushes
--- Returns a simple square brush with 100% weight for every pixel.
-- Default inbuilt brush.
-- @name square
-- @param size Vector3 The desired size of the brush. Only the x and y components are used; the z component is ignored.
-- @returns bool,number[],Vector3 1: true, as this function always succeeds. 2: A simple square brush as a zero-indexed flat array. 3: The size of the resulting brush as a Vector3, using the x and y components.

@ -2,6 +2,9 @@ local wea = worldeditadditions
local parse_static = dofile(wea.modpath.."/lib/sculpt/parse_static.lua")
---
-- @module worldeditadditions.sculpt
--- Reads and parses the brush stored in the specified file.
-- @name import_static
-- @internal

@ -21,6 +21,12 @@ local sculpt = {
parse_static = dofile(wea.modpath.."/lib/sculpt/parse_static.lua")
}
--- Brushes for use with the sculpting system.
-- Dump your own in the directory `worldeditadditions/lib/sculpt/brushes` (relative to the WorldEditAdditions git repository root), and WorldEditAdditions will automatically read them!
--
-- See the documentation for more information: <https://worldeditadditions.mooncarrot.space/Reference/#sculpt>
-- @namespace worldeditadditions.sculpt.brushes
-- scan_sculpt is called after everything is loaded in the main init file
return sculpt

@ -1,5 +1,8 @@
local wea = worldeditadditions
---
-- @module worldeditadditions.sculpt
--- Makes a sculpting brush that is as close to a target size as possible.
-- @param brush_name string The name of the brush to create.
-- @param target_size Vector3 The target size of the brush to create.

@ -2,6 +2,9 @@ local wea = worldeditadditions
local make_brush = dofile(wea.modpath.."/lib/sculpt/make_brush.lua")
---
-- @module worldeditadditions.sculpt
--- Generates a textual preview of a given brush.
-- @param brush table The brush in question to preview.
-- @param size Vector3 The size of the brush.

@ -2,6 +2,9 @@ local wea = worldeditadditions
local wea_c = worldeditadditions_core
local Vector3 = wea_c.Vector3
---
-- @module worldeditadditions.sculpt
--- Parses a static brush definition.
-- @name parse_static
-- @internal

@ -4,6 +4,10 @@ local Vector3 = wea_c.Vector3
local import_static = dofile(wea.modpath.."/lib/sculpt/import_static.lua")
---
-- @module worldeditadditions.sculpt
local function import_filepath(filepath, name, overwrite_existing)
if overwrite_existing and wea.sculpt.brushes[name] ~= nil then
return false, "Error: A brush with the name '"..name.."' already exists."