From 4ab8e7ca2c104ef51414a77520f2f3c788530317 Mon Sep 17 00:00:00 2001 From: VorTechnix <45538536+VorTechnix@users.noreply.github.com> Date: Thu, 12 Sep 2024 06:54:46 -0700 Subject: [PATCH] Deprecate scol, scube & srect --- Chat-Command-Reference.md | 27 +++---------- .../commands/selectors/scol.lua | 28 ++----------- .../commands/selectors/scube.lua | 39 ++----------------- .../commands/selectors/srect.lua | 34 ++-------------- 4 files changed, 15 insertions(+), 113 deletions(-) diff --git a/Chat-Command-Reference.md b/Chat-Command-Reference.md index 1256280..3380204 100644 --- a/Chat-Command-Reference.md +++ b/Chat-Command-Reference.md @@ -1201,33 +1201,18 @@ This also synchronises with WorldEdit, as all other WorldEditAdditions commands ### `//scol [ ] ` -Short for _select column_. Sets the pos2 at a set distance along 1 axis from pos1. If the axis isn't specified, defaults the direction you are facing. Implementation thanks to @VorTechnix. - -```weacmd -//scol 10 -//scol x 3 -``` +#### === DEPRECATED === +Please use `//srel` instead. ### `//srect [ []] ` -Short for _select rectangle_. Sets the pos2 at a set distance along 2 axes from pos1. If the axes aren't specified, defaults to positive y and the direction you are facing. Implementation thanks to @VorTechnix. - -```weacmd -//srect x z 10 -//srect 3 -//srect -z y 25 -``` +#### === DEPRECATED === +Please use `//srel` instead. ### `//scube [ [ []]] ` -Short for _select cube_. Sets the pos2 at a set distance along 3 axes from pos1. If the axes aren't specified, defaults to positive y, the direction you are facing and the axis to the left of facing. Implementation thanks to @VorTechnix. - -```weacmd -//scube 5 -//scube z a y 12 -//scube x z 3 -//scube -z 12 -``` +#### === DEPRECATED === +Please use `//srel` instead. ### `//scloud <0-6|stop|reset>` diff --git a/worldeditadditions_commands/commands/selectors/scol.lua b/worldeditadditions_commands/commands/selectors/scol.lua index 1ada5ac..24b7435 100644 --- a/worldeditadditions_commands/commands/selectors/scol.lua +++ b/worldeditadditions_commands/commands/selectors/scol.lua @@ -12,32 +12,10 @@ worldeditadditions_core.register_command("scol", { privs = {worldedit=true}, require_pos = 1, parse = function(params_text) - local vec, tmp = Vector3.new(0, 0, 0), {} - local find = wea_c.split(params_text, "%s", false) - local ax1, sn1, len = (tostring(find[1]):match('[xyz]') or "g"):sub(1,1), wea_c.getsign(find[1]), find[table.maxn(find)] - - tmp.len = tonumber(len) - -- If len == nil cancel the operation - if not tmp.len then return false, "No length specified." end - -- If ax1 is bad send "get" order - if ax1 == "g" then tmp.get = true - else vec[ax1] = sn1 * tmp.len end - - return true, vec, tmp - -- tmp carries: - -- The length (len) arguement to the main function for use if "get" is invoked there - -- The bool value "get" to tell the main function if it needs to populate missing information in vec + ------------------------- end, - func = function(name, vec, tmp) - if tmp.get then - local ax, dir = wea_c.player_axis2d(name) - vec[ax] = tmp.len * dir - end - - local pos2 = vec + Vector3.clone(worldedit.pos1[name]) - worldedit.pos2[name] = pos2 - worldedit.mark_pos2(name) - return true, "position 2 set to "..pos2 + func = function(name) + return true, "DEPRECATED: please use //srel instead..." end, }) diff --git a/worldeditadditions_commands/commands/selectors/scube.lua b/worldeditadditions_commands/commands/selectors/scube.lua index 0c7df3e..a2233d8 100644 --- a/worldeditadditions_commands/commands/selectors/scube.lua +++ b/worldeditadditions_commands/commands/selectors/scube.lua @@ -12,43 +12,10 @@ worldeditadditions_core.register_command("scube", { privs = { worldedit = true }, require_pos = 1, parse = function(params_text) - local vec, tmp = Vector3.new(0, 0, 0), {} - local find = wea_c.split(params_text, "%s", false) - local ax1, ax2, ax3 = (tostring(find[1]):match('[xyz]') or "g"):sub(1,1), (tostring(find[2]):match('[xyz]') or "g"):sub(1,1), - (tostring(find[3]):match('[xyz]') or "g"):sub(1,1) - local sn1, sn2, sn3, len = wea_c.getsign(find[1]), wea_c.getsign(find[2]), wea_c.getsign(find[3]), find[table.maxn(find)] - - tmp.len = tonumber(len) - -- If len is nill cancel the operation - if not tmp.len then return false, "No length specified." end - -- If axis is bad send "get" order - if ax1 == "g" then tmp.get = true - else vec[ax1] = sn1 * tmp.len end - if ax2 == "g" then tmp.get = true - else vec[ax2] = sn2 * tmp.len end - if ax3 == "g" then tmp.get = true - else vec[ax3] = sn3 * tmp.len end - - tmp.axes = ax1..","..ax2..","..ax3 - return true, vec, tmp - -- tmp carries: - -- The length (len) arguement to the main function for use if "get" is invoked there - -- The bool value "get" to tell the main function if it needs to populate missing information in vec - -- The string "axes" to tell the main function what axes are and/or need to be populated if "get" is invoked + ------------------------- end, - func = function(name, vec, tmp) - if tmp.get then - local ax, dir = wea_c.player_axis2d(name) - local _, left, sn = wea_c.axis_left(ax,dir) - if not tmp.axes:find("x") then vec.x = tmp.len * (ax == "x" and dir or sn) end - if not tmp.axes:find("z") then vec.z = tmp.len * (ax == "z" and dir or sn) end - if not tmp.axes:find("y") then vec.y = tmp.len end - end - - local pos2 = vec + Vector3.clone(worldedit.pos1[name]) - worldedit.pos2[name] = pos2 - worldedit.mark_pos2(name) - return true, "position 2 set to "..pos2 + func = function(name) + return true, "DEPRECATED: please use //srel instead..." end, }) diff --git a/worldeditadditions_commands/commands/selectors/srect.lua b/worldeditadditions_commands/commands/selectors/srect.lua index b0cb190..058094e 100644 --- a/worldeditadditions_commands/commands/selectors/srect.lua +++ b/worldeditadditions_commands/commands/selectors/srect.lua @@ -13,38 +13,10 @@ worldeditadditions_core.register_command("srect", { privs = { worldedit = true }, require_pos = 1, parse = function(params_text) - local vec, tmp = Vector3.new(0, 0, 0), {} - local find = wea_c.split(params_text, "%s", false) - local ax1, ax2 = (tostring(find[1]):match('[xyz]') or "g"):sub(1,1), (tostring(find[2]):match('[xyz]') or "g"):sub(1,1) - local sn1, sn2, len = wea_c.getsign(find[1]), wea_c.getsign(find[2]), find[table.maxn(find)] - - tmp.len = tonumber(len) - -- If len == nill cancel the operation - if not tmp.len then return false, "No length specified." end - -- If axis is bad send "get" order - if ax1 == "g" then tmp.get = true - else vec[ax1] = sn1 * tmp.len end - if ax2 == "g" then tmp.get = true - else vec[ax2] = sn2 * tmp.len end - - tmp.axes = ax1..","..ax2 - return true, vec, tmp - -- tmp carries: - -- The length (len) arguement to the main function for use if "get" is invoked there - -- The bool value "get" to tell the main function if it needs to populate missing information in vec - -- The string "axes" to tell the main function what axes are and/or need to be populated if "get" is invoked + ------------------------- end, - func = function(name, vec, tmp) - if tmp.get then - local ax, dir = wea_c.player_axis2d(name) - if not tmp.axes:find("[xz]") then vec[ax] = tmp.len * dir end - if not tmp.axes:find("y") then vec.y = tmp.len end - end - - local p2 = vec + Vector3.clone(worldedit.pos1[name]) - worldedit.pos2[name] = p2 - worldedit.mark_pos2(name) - return true, "position 2 set to "..p2 + func = function(name) + return true, "DEPRECATED: please use //srel instead..." end, })