mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-26 09:03:01 +00:00
wea_c.notify main changeover
This commit is contained in:
parent
644510a9ca
commit
c86319d94e
9 changed files with 17 additions and 16 deletions
|
@ -1,6 +1,6 @@
|
|||
-- Lists all currently loaded entities.
|
||||
|
||||
local weac = worldeditadditions_core
|
||||
local wea_c = worldeditadditions_core
|
||||
|
||||
minetest.register_chatcommand("/listentities", {
|
||||
params = "",
|
||||
|
@ -22,16 +22,16 @@ minetest.register_chatcommand("/listentities", {
|
|||
obj_name = "[LuaEntity:__UNKNOWN__]"
|
||||
end
|
||||
end
|
||||
local pos = weac.Vector3.clone(obj:get_pos())
|
||||
local pos = wea_c.Vector3.clone(obj:get_pos())
|
||||
table.insert(table_vals, {
|
||||
id,
|
||||
obj_name,
|
||||
tostring(pos)
|
||||
})
|
||||
end
|
||||
worldedit.player_notify(name, table.concat({
|
||||
wea_c.notify.info(name, table.concat({
|
||||
"Currently loaded entities:",
|
||||
weac.format.make_ascii_table(table_vals),
|
||||
wea_c.format.make_ascii_table(table_vals),
|
||||
"",
|
||||
"Total "..tostring(#table_vals).." objects"
|
||||
}, "\n"))
|
||||
|
|
|
@ -41,7 +41,7 @@ local function step(params)
|
|||
-- If we haven't run out of values call function again
|
||||
minetest.after(params.delay, step, params) -- Time is in seconds
|
||||
else
|
||||
worldedit.player_notify(params.player_name, "The macro \""..
|
||||
wea_c.notify.ok(params.player_name, "The macro \""..
|
||||
params.file.."\" was completed in " ..
|
||||
wea_c.format.human_time(params.time))
|
||||
end
|
||||
|
|
|
@ -7,7 +7,7 @@ local function step(params)
|
|||
local start_time = wea_c.get_ms_time()
|
||||
|
||||
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,
|
||||
(params.i + 1), params.count,
|
||||
((params.i + 1) / params.count)*100,
|
||||
|
@ -53,7 +53,7 @@ local function step(params)
|
|||
table.insert(done_message, table.concat(message_parts, ", "))
|
||||
end
|
||||
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
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ minetest.register_chatcommand("/multi", {
|
|||
if not args then args = "" end
|
||||
-- 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]
|
||||
if not cmd then
|
||||
|
@ -61,6 +61,6 @@ minetest.register_chatcommand("/multi", {
|
|||
table.insert(done_message, table.concat(message_parts, ", "))
|
||||
table.insert(done_message, ")")
|
||||
|
||||
worldedit.player_notify(name, table.concat(done_message, ""))
|
||||
wea_c.notify.ok(name, table.concat(done_message, ""))
|
||||
end
|
||||
})
|
||||
|
|
|
@ -53,7 +53,7 @@ minetest.register_chatcommand("//pos", {
|
|||
func = function(name, params_text)
|
||||
local i = tonumber(params_text)
|
||||
if type(i) ~= "number" then
|
||||
worldedit.player_notify(name, "Error: Invalid index number given.")
|
||||
weac.notify.error(name, "Error: Invalid index number given.")
|
||||
return
|
||||
end
|
||||
i = math.floor(i)
|
||||
|
|
|
@ -13,7 +13,7 @@ minetest.register_on_punchnode(function(pos, node, puncher)
|
|||
if wea.add_pos[name] > 0 then
|
||||
wea.selection.add_point(name, pos)
|
||||
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
|
||||
end
|
||||
end)
|
||||
|
|
|
@ -28,7 +28,7 @@ local function do_unmark(name, params_text)
|
|||
|
||||
if params_text == "all" then
|
||||
local removed = do_unmark_all()
|
||||
worldedit.player_notify(name, "Hidden "..removed.." marker entities")
|
||||
weac.notify.info(name, "Hidden "..removed.." marker entities")
|
||||
else
|
||||
-- Hide the WorldEditAdditions marker
|
||||
weac.pos.unmark(name)
|
||||
|
|
|
@ -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)
|
||||
worldedit.player_notify(player_name, msg_compiled)
|
||||
weac.notify.error(player_name, msg_compiled)
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
-- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
||||
-- ███████ ██ ██ ██ ███████ ██ ██ ███████ ██████ ██ ██████ ██ ████
|
||||
|
||||
local weac = worldeditadditions_core
|
||||
---
|
||||
-- @module worldeditadditions_core
|
||||
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
|
||||
worldedit_command_y(player_name)
|
||||
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
|
||||
else
|
||||
pending_calls[player_name].func()
|
||||
|
@ -58,10 +59,10 @@ minetest.override_chatcommand("/n", {
|
|||
if minetest.global_exists("worldedit") and worldedit_command_y ~= nil then
|
||||
worldedit_command_n(player_name)
|
||||
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
|
||||
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
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue