wea_c.notify main changeover

This commit is contained in:
VorTechnix 2024-10-16 19:22:34 -07:00
parent 644510a9ca
commit c86319d94e
No known key found for this signature in database
GPG key ID: 091E91A69545D5BA
9 changed files with 17 additions and 16 deletions

View file

@ -1,6 +1,6 @@
-- Lists all currently loaded entities. -- Lists all currently loaded entities.
local weac = worldeditadditions_core local wea_c = worldeditadditions_core
minetest.register_chatcommand("/listentities", { minetest.register_chatcommand("/listentities", {
params = "", params = "",
@ -22,16 +22,16 @@ minetest.register_chatcommand("/listentities", {
obj_name = "[LuaEntity:__UNKNOWN__]" obj_name = "[LuaEntity:__UNKNOWN__]"
end end
end end
local pos = weac.Vector3.clone(obj:get_pos()) local pos = wea_c.Vector3.clone(obj:get_pos())
table.insert(table_vals, { table.insert(table_vals, {
id, id,
obj_name, obj_name,
tostring(pos) tostring(pos)
}) })
end end
worldedit.player_notify(name, table.concat({ wea_c.notify.info(name, table.concat({
"Currently loaded entities:", "Currently loaded entities:",
weac.format.make_ascii_table(table_vals), wea_c.format.make_ascii_table(table_vals),
"", "",
"Total "..tostring(#table_vals).." objects" "Total "..tostring(#table_vals).." objects"
}, "\n")) }, "\n"))

View file

@ -41,7 +41,7 @@ local function step(params)
-- If we haven't run out of values call function again -- If we haven't run out of values call function again
minetest.after(params.delay, step, params) -- Time is in seconds minetest.after(params.delay, step, params) -- Time is in seconds
else else
worldedit.player_notify(params.player_name, "The macro \"".. wea_c.notify.ok(params.player_name, "The macro \""..
params.file.."\" was completed in " .. params.file.."\" was completed in " ..
wea_c.format.human_time(params.time)) wea_c.format.human_time(params.time))
end end

View file

@ -7,7 +7,7 @@ local function step(params)
local start_time = wea_c.get_ms_time() local start_time = wea_c.get_ms_time()
local full_cmd = params.cmd_name.." "..params.args local full_cmd = params.cmd_name.." "..params.args
worldedit.player_notify(params.name, string.format("[ many | /%s ] %d / %d (~%.2f%%) complete | last: %s, average: %s, ETA: ~%s", wea_c.notify.info(params.name, string.format("[ many | /%s ] %d / %d (~%.2f%%) complete | last: %s, average: %s, ETA: ~%s",
full_cmd, full_cmd,
(params.i + 1), params.count, (params.i + 1), params.count,
((params.i + 1) / params.count)*100, ((params.i + 1) / params.count)*100,
@ -53,7 +53,7 @@ local function step(params)
table.insert(done_message, table.concat(message_parts, ", ")) table.insert(done_message, table.concat(message_parts, ", "))
end end
table.insert(done_message, ")") table.insert(done_message, ")")
worldedit.player_notify(params.name, table.concat(done_message, "")) wea_c.notify.ok(params.name, table.concat(done_message, ""))
end end
end end

View file

@ -29,7 +29,7 @@ minetest.register_chatcommand("/multi", {
if not args then args = "" end if not args then args = "" end
-- print("command_name", command_name) -- print("command_name", command_name)
worldedit.player_notify(name, "#"..i..": "..command) wea_c.notify.info(name, "#"..i..": "..command)
local cmd = minetest.registered_chatcommands[command_name] local cmd = minetest.registered_chatcommands[command_name]
if not cmd then if not cmd then
@ -61,6 +61,6 @@ minetest.register_chatcommand("/multi", {
table.insert(done_message, table.concat(message_parts, ", ")) table.insert(done_message, table.concat(message_parts, ", "))
table.insert(done_message, ")") table.insert(done_message, ")")
worldedit.player_notify(name, table.concat(done_message, "")) wea_c.notify.ok(name, table.concat(done_message, ""))
end end
}) })

View file

@ -53,7 +53,7 @@ minetest.register_chatcommand("//pos", {
func = function(name, params_text) func = function(name, params_text)
local i = tonumber(params_text) local i = tonumber(params_text)
if type(i) ~= "number" then if type(i) ~= "number" then
worldedit.player_notify(name, "Error: Invalid index number given.") weac.notify.error(name, "Error: Invalid index number given.")
return return
end end
i = math.floor(i) i = math.floor(i)

View file

@ -13,7 +13,7 @@ minetest.register_on_punchnode(function(pos, node, puncher)
if wea.add_pos[name] > 0 then if wea.add_pos[name] > 0 then
wea.selection.add_point(name, pos) wea.selection.add_point(name, pos)
wea.add_pos[name] = wea.add_pos[name] - 1 wea.add_pos[name] = wea.add_pos[name] - 1
worldedit.player_notify(name, "You have "..wea.add_pos[name].." nodes left to punch") wea_c.notify.info(name, "You have "..wea.add_pos[name].." nodes left to punch")
else wea.add_pos[name] = nil end else wea.add_pos[name] = nil end
end end
end) end)

View file

@ -28,7 +28,7 @@ local function do_unmark(name, params_text)
if params_text == "all" then if params_text == "all" then
local removed = do_unmark_all() local removed = do_unmark_all()
worldedit.player_notify(name, "Hidden "..removed.." marker entities") weac.notify.info(name, "Hidden "..removed.." marker entities")
else else
-- Hide the WorldEditAdditions marker -- Hide the WorldEditAdditions marker
weac.pos.unmark(name) weac.pos.unmark(name)

View file

@ -57,7 +57,7 @@ Please add any other additional specific system information here too if you thin
}, "") }, "")
print("DEBUG:player_notify player_name", player_name, "msg_compiled", msg_compiled) print("DEBUG:player_notify player_name", player_name, "msg_compiled", msg_compiled)
worldedit.player_notify(player_name, msg_compiled) weac.notify.error(player_name, msg_compiled)
end end

View file

@ -5,6 +5,7 @@
-- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ -- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
-- ███████ ██ ██ ██ ███████ ██ ██ ███████ ██████ ██ ██████ ██ ████ -- ███████ ██ ██ ██ ███████ ██ ██ ███████ ██████ ██ ██████ ██ ████
local weac = worldeditadditions_core
--- ---
-- @module worldeditadditions_core -- @module worldeditadditions_core
local worldedit_command_y, worldedit_command_n local worldedit_command_y, worldedit_command_n
@ -41,7 +42,7 @@ minetest.override_chatcommand("/y", {
if minetest.global_exists("worldedit") and worldedit_command_y ~= nil then if minetest.global_exists("worldedit") and worldedit_command_y ~= nil then
worldedit_command_y(player_name) worldedit_command_y(player_name)
else else
worldedit.player_notify(player_name, "There aren't any pending operations at the moment.") weac.notify.info(player_name, "There aren't any pending operations at the moment.")
end end
else else
pending_calls[player_name].func() pending_calls[player_name].func()
@ -58,10 +59,10 @@ minetest.override_chatcommand("/n", {
if minetest.global_exists("worldedit") and worldedit_command_y ~= nil then if minetest.global_exists("worldedit") and worldedit_command_y ~= nil then
worldedit_command_n(player_name) worldedit_command_n(player_name)
else else
worldedit.player_notify(player_name, "There aren't any operations pending, so there's nothing to abort.") weac.notify.info(player_name, "There aren't any operations pending, so there's nothing to abort.")
end end
else else
worldedit.player_notify(player_name, "Aborting captured command /"..pending_calls[player_name].cmdname..".") weac.notify.info(player_name, "Aborting captured command /"..pending_calls[player_name].cmdname..".")
pending_calls[player_name] = nil pending_calls[player_name] = nil
end end
end end