mod.privilegeareas: Update to Git commit 18a803c

https://github.com/minetest-mods/privilegeareas/tree/18a803c
master
Jordan Irwin 2018-07-03 15:41:15 -07:00
parent ae97b77cbb
commit 8711249105
2 changed files with 18 additions and 5 deletions

View File

@ -14,7 +14,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
* [cleaner][] ([CC0][lic.cc0]) -- version [0.4 (68222b1 Git)][ver.cleaner] *2017-08-30*
* [invisible][] ([LGPL][lic.lgpl2.1] / [CC BY-SA][lic.ccbysa3.0])
* [override][] ([MIT][lic.override]) -- version [0.2 (e6dda7a Git)][ver.override] *2017-08-30*
* [privilegeareas][] ([WTFPL][lic.privilegeareas] / [CC0][lic.cc0]) -- version: [aebaa00 Git][ver.privilegeareas] *2016-05-18*
* [privilegeareas][] ([WTFPL][lic.privilegeareas] / [CC0][lic.cc0]) -- version: [18a803c Git][ver.privilegeareas] *2017-12-04*
* [privs][] ([CC0][lic.cc0])
* [spectator_mode][] ([WTFPL][lic.spectator_mode]) -- version: [7d68bec Git][ver.spectator_mode] *2017-03-30*
* [whitelist][] ([CC0][lic.cc0]) -- version [0.1 (b813b19 Git)][ver.whitelist] *2017-08-18*
@ -454,7 +454,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
[ver.painting]: https://github.com/minetest-mods/painting/tree/8961849
[ver.pipeworks]: https://github.com/minetest-mods/pipeworks/tree/a5e1bfa
[ver.playeranim]: https://github.com/minetest-mods/playeranim/tree/59bcd38
[ver.privilegeareas]: https://github.com/minetest-mods/privilegeareas/tree/aebaa00
[ver.privilegeareas]: https://github.com/minetest-mods/privilegeareas/tree/18a803c
[ver.quartz]: https://github.com/minetest-mods/quartz/tree/00ca4eb
[ver.rainbow_ore]: https://github.com/FsxShader2012/rainbow_ore/tree/6e77693
[ver.sfinv_buttons]: http://repo.or.cz/minetest_sfinv_buttons.git/tree/4f3b075

View File

@ -4,6 +4,9 @@ gui = {}
minetest.register_chatcommand("privareas", {
params = "",
description = "PrivAreas: access a formspec from the privilegeareas mod",
privs = {
privs = true,
},
func = function(name, param)
add_gui(name)
end,
@ -33,6 +36,10 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
if (formname~="privilegeareas:gui_add") then
return false
end
if not minetest.check_player_privs(player, "privs") then
return false
end
if fields.submit then
-- Do addition stuff
@ -156,13 +163,19 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
if (gui[name].id and gui[name].trigger and fields.name) then
-- this will doubtlessly be buggy
table.insert(privilegeareas.areas[gui[name].id].actions[gui[name].trigger][gui[name].type],fields.name)
local id = gui[name].id
local trigger = gui[name].trigger
local action_type = gui[name].type
local trigger_action_types = privilegeareas.areas[id].actions[trigger]
if not trigger_action_types[action_type] then
trigger_action_types[action_type] = {}
end
table.insert(trigger_action_types[action_type],fields.name)
-- Alert user of success
minetest.chat_send_player(name, "Added data '"..fields.name.."' to '"..gui[name].type.."' in trigger "..gui[name].trigger.." in area "..gui[name].id)
-- Delete field
local id = gui[name].id
gui[name] = nil
-- Update
@ -193,4 +206,4 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end
act_gui(name,gui[name].id)
end)
end)