From 0f25cf5b4ef89b30a2866dd259105be03c784b4d Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Thu, 3 Aug 2023 02:42:46 +0100 Subject: [PATCH] comments: add @module to wea.sculpt.* --- worldeditadditions/lib/sculpt/apply.lua | 3 +++ worldeditadditions/lib/sculpt/apply_heightmap.lua | 4 ++++ worldeditadditions/lib/sculpt/brushes/__gaussian.lua | 3 +++ worldeditadditions/lib/sculpt/brushes/circle.lua | 4 ++++ worldeditadditions/lib/sculpt/brushes/square.lua | 3 +++ worldeditadditions/lib/sculpt/import_static.lua | 3 +++ worldeditadditions/lib/sculpt/init.lua | 6 ++++++ worldeditadditions/lib/sculpt/make_brush.lua | 3 +++ worldeditadditions/lib/sculpt/make_preview.lua | 3 +++ worldeditadditions/lib/sculpt/parse_static.lua | 3 +++ worldeditadditions/lib/sculpt/scan_static.lua | 4 ++++ 11 files changed, 39 insertions(+) diff --git a/worldeditadditions/lib/sculpt/apply.lua b/worldeditadditions/lib/sculpt/apply.lua index e9eaf6b..1670748 100644 --- a/worldeditadditions/lib/sculpt/apply.lua +++ b/worldeditadditions/lib/sculpt/apply.lua @@ -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. diff --git a/worldeditadditions/lib/sculpt/apply_heightmap.lua b/worldeditadditions/lib/sculpt/apply_heightmap.lua index 34e3ed4..64456c3 100644 --- a/worldeditadditions/lib/sculpt/apply_heightmap.lua +++ b/worldeditadditions/lib/sculpt/apply_heightmap.lua @@ -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. diff --git a/worldeditadditions/lib/sculpt/brushes/__gaussian.lua b/worldeditadditions/lib/sculpt/brushes/__gaussian.lua index 2c41ef9..339e60b 100644 --- a/worldeditadditions/lib/sculpt/brushes/__gaussian.lua +++ b/worldeditadditions/lib/sculpt/brushes/__gaussian.lua @@ -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 diff --git a/worldeditadditions/lib/sculpt/brushes/circle.lua b/worldeditadditions/lib/sculpt/brushes/circle.lua index 2e678e3..45c69eb 100644 --- a/worldeditadditions/lib/sculpt/brushes/circle.lua +++ b/worldeditadditions/lib/sculpt/brushes/circle.lua @@ -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. diff --git a/worldeditadditions/lib/sculpt/brushes/square.lua b/worldeditadditions/lib/sculpt/brushes/square.lua index 85c82c6..28472e0 100644 --- a/worldeditadditions/lib/sculpt/brushes/square.lua +++ b/worldeditadditions/lib/sculpt/brushes/square.lua @@ -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. diff --git a/worldeditadditions/lib/sculpt/import_static.lua b/worldeditadditions/lib/sculpt/import_static.lua index 8842c29..4e9460d 100644 --- a/worldeditadditions/lib/sculpt/import_static.lua +++ b/worldeditadditions/lib/sculpt/import_static.lua @@ -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 diff --git a/worldeditadditions/lib/sculpt/init.lua b/worldeditadditions/lib/sculpt/init.lua index 2342e9d..d1870a4 100644 --- a/worldeditadditions/lib/sculpt/init.lua +++ b/worldeditadditions/lib/sculpt/init.lua @@ -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: +-- @namespace worldeditadditions.sculpt.brushes + -- scan_sculpt is called after everything is loaded in the main init file return sculpt diff --git a/worldeditadditions/lib/sculpt/make_brush.lua b/worldeditadditions/lib/sculpt/make_brush.lua index ea05900..f7da2eb 100644 --- a/worldeditadditions/lib/sculpt/make_brush.lua +++ b/worldeditadditions/lib/sculpt/make_brush.lua @@ -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. diff --git a/worldeditadditions/lib/sculpt/make_preview.lua b/worldeditadditions/lib/sculpt/make_preview.lua index 59ea9e2..7c99cc5 100644 --- a/worldeditadditions/lib/sculpt/make_preview.lua +++ b/worldeditadditions/lib/sculpt/make_preview.lua @@ -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. diff --git a/worldeditadditions/lib/sculpt/parse_static.lua b/worldeditadditions/lib/sculpt/parse_static.lua index 7b1208b..5fa848c 100644 --- a/worldeditadditions/lib/sculpt/parse_static.lua +++ b/worldeditadditions/lib/sculpt/parse_static.lua @@ -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 diff --git a/worldeditadditions/lib/sculpt/scan_static.lua b/worldeditadditions/lib/sculpt/scan_static.lua index 960cf6f..ae62df5 100644 --- a/worldeditadditions/lib/sculpt/scan_static.lua +++ b/worldeditadditions/lib/sculpt/scan_static.lua @@ -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."