Implemented level reporting.
parent
9380a5a460
commit
116047ccdf
|
@ -50,8 +50,8 @@ local function button_display(id, name, owner, player_count, xp, pos, desc)
|
||||||
local formspec =
|
local formspec =
|
||||||
'formspec_version[3]'..
|
'formspec_version[3]'..
|
||||||
'size[12,8]'..
|
'size[12,8]'..
|
||||||
--'image_button[10.5,.5;1,1;lobby_report_icon.png;report;;;false]'..
|
'image_button[10.5,.5;1,1;lobby_report_icon.png;report;;;false]'..
|
||||||
--'tooltip[report;Report this level as incomplete.]'..
|
'tooltip[report;Report this level as incomplete.]'..
|
||||||
'style_type[textarea;textcolor=#ccddff;border=true]'..
|
'style_type[textarea;textcolor=#ccddff;border=true]'..
|
||||||
'label[0.5,.7;Map Name:]'..
|
'label[0.5,.7;Map Name:]'..
|
||||||
'textarea[3.25,.55;7,.4;;;'..esc(name)..' (by '..owner..')]'..
|
'textarea[3.25,.55;7,.4;;;'..esc(name)..' (by '..owner..')]'..
|
||||||
|
@ -281,17 +281,19 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
if fields.save then
|
if fields.save then
|
||||||
local reason = fields.reason
|
local reason = fields.reason
|
||||||
if reason then
|
if reason then
|
||||||
if lobby.take_xp(player, 1) then
|
local input = fields.input
|
||||||
local input = fields.input
|
minetest.chat_send_player(name, 'Thanks for your report')
|
||||||
print (reason)
|
local map_name = lobby.savedata.id_2_name[map_id] or map_id
|
||||||
print (input)
|
local data = lobby.savedata.data[map_id]
|
||||||
minetest.chat_send_player(name, 'Thanks for your report')
|
local map_owner = data.owner_name
|
||||||
else
|
local src = 'system'
|
||||||
minetest.chat_send_player(name, 'Sorry, you need 1 XP to submit this report.')
|
local dst = 'Admin, '..map_owner..', '..name
|
||||||
end
|
local subject = name..' reported '..reason..' on '..map_name
|
||||||
else
|
local body = input..'\n\n\nThis is an automated message, please do not respond.'
|
||||||
minetest.chat_send_player(name, 'You need to select a reason.')
|
mail.send(src, dst, subject, body)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
minetest.chat_send_player(name, 'You need to select a reason.')
|
||||||
end
|
end
|
||||||
elseif formname == 'lobby:button_claim' then
|
elseif formname == 'lobby:button_claim' then
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
|
|
|
@ -121,9 +121,9 @@ function lobby.report_level(map_id)
|
||||||
'style_type[label;textcolor=;font=;font_size=]'..
|
'style_type[label;textcolor=;font=;font_size=]'..
|
||||||
'label[.75,1.5;Report Reason:]'..
|
'label[.75,1.5;Report Reason:]'..
|
||||||
'dropdown[.5,2;5,.5;reason;Incomplete,Broken,No tasks,Broken spawn;0]'..
|
'dropdown[.5,2;5,.5;reason;Incomplete,Broken,No tasks,Broken spawn;0]'..
|
||||||
'textarea[.5,2.75;5,3.75;;This is where we explain what the different options mean and what this actually does.;]'..
|
'textarea[.5,2.75;5,3.75;;Filling out this form will send a message to the server operator, the creator of the level, and you. The map name and creator are automatically added. Just select the reason for reporting the level and optionally fill out additional information.;]'..
|
||||||
'textarea[6,1.66;5.5,5;input;Further Details (optional);]'..
|
'textarea[6,1.66;5.5,5;input;Further Details (optional);]'..
|
||||||
'button_exit[2,7;3,.75;save;Submit (1xp)]'..
|
'button_exit[2,7;3,.75;save;Submit]'..
|
||||||
'button_exit[7,7;3,.75;lol;Cancel]'
|
'button_exit[7,7;3,.75;lol;Cancel]'
|
||||||
return formspec
|
return formspec
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue