diff --git a/worldedit_commands/safe.lua b/worldedit_commands/safe.lua index bba5871..cd8fee1 100644 --- a/worldedit_commands/safe.lua +++ b/worldedit_commands/safe.lua @@ -11,10 +11,20 @@ local function safe_region(name, count, callback) return callback() end - --save callback to call later + -- save callback to call later safe_region_callback[name] = callback - worldedit.player_notify(name, S("WARNING: this operation could affect up to @1 nodes; type @2 to continue or @3 to cancel", - count, minetest.colorize("#00ffff", "//y"), minetest.colorize("#00ffff", "//n")), "info") + + local count_str = tostring(count) + -- highlight millions, 1 mln <=> 100x100x100 cube + if #count_str > 6 then + count_str = minetest.colorize("#f33", count_str:sub(1, -7)) .. count_str:sub(-6, -1) + end + + local yes_cmd = minetest.colorize("#00ffff", "//y") + local no_cmd = minetest.colorize("#00ffff", "//n") + local msg = S("WARNING: this operation could affect up to @1 nodes; type @2 to continue or @3 to cancel", + count_str, yes_cmd, no_cmd) + worldedit.player_notify(name, msg, "info") end local function reset_pending(name)