-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of github.com:sbrl/Minetest-WorldEditAdditions int…
…o dev
- Loading branch information
Showing
19 changed files
with
112 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,5 +23,6 @@ worldeditadditions.normalize_test("credits", { | |
end | ||
end | ||
send_credits(1) | ||
return true, "Thank you!" | ||
end | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
local Notify = worldeditadditions_core.notify | ||
worldeditadditions.normalize_test("suppress", { | ||
params = "N/A", | ||
description = "Tests notification suppression system.", | ||
func = function(name, params_table) | ||
Notify.suppress_for_player(name, 5) | ||
Notify.warn(name, "This message should not be shown.") | ||
Notify.suppress_for_player(name, -1) | ||
Notify.ok(name, "This message should be shown.") | ||
local result = Notify.suppress_for_function(name, function() | ||
Notify.error(name, "This message should not be shown.") | ||
return true | ||
end) | ||
if not result then | ||
return false, "Error: suppress_for_function did not call function." | ||
else | ||
return true, "suppress_for_function called function." | ||
end | ||
end | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
-- @module worldeditadditions_core | ||
local wea_c = worldeditadditions_core | ||
|
||
--- Handles the result of a function call. | ||
--- @param ... any The full output of the function call. | ||
local function handle_fn_result(...) | ||
local result = { ... } | ||
local ret = "" | ||
local success = table.remove(result, 1) | ||
if #result > 1 then | ||
ret = wea_c.table.tostring(result) | ||
elseif #result == 1 then | ||
if type(result[1]) == "table" then | ||
ret = "Function returned table:\n" .. | ||
wea_c.table.tostring(result[1]) | ||
else ret = tostring(result[1]) end | ||
else | ||
ret = table.concat({ | ||
"Function returned \"", | ||
tostring(success), | ||
"\" with no other output." | ||
}, "") | ||
end | ||
return success or false, ret | ||
end | ||
|
||
return handle_fn_result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.