1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-12 10:04:40 +02:00

merge commit

This commit is contained in:
Maik Wild 2018-08-13 20:04:45 +02:00
parent 6e266f6003
commit 3567b242ea
3 changed files with 2 additions and 24 deletions

View File

@ -25,7 +25,6 @@ require 'blueprint_helper'
require 'paint'
require 'score'
require 'popup'
require 'report'
local Event = require 'utils.event'

View File

@ -745,8 +745,6 @@ Gui.on_click(
local reporting_player = event.player
local reported_player = Gui.get_data(event.element)
-- test code.
game.print(reporting_player.name .. ' has reported ' .. reported_player.name)
--Report.spawn_reporting_popup (reporting_player, reported_player)
Report.spawn_reporting_popup (reporting_player, reported_player)
end
)

View File

@ -121,7 +121,7 @@ local reporting_cancel_button_name = Gui.uid_name()
local reporting_submit_button_name = Gui.uid_name()
local reporting_input_name = Gui.uid_name()
spawn_reporting_popup = function(player, reported_player)
Module.spawn_reporting_popup = function(player, reported_player)
local center = player.gui.center
if player.opened then --Destroy whatever is open
@ -185,25 +185,6 @@ Gui.on_click(
end
)
local function report_cmd(cmd)
if game.player then
local params = {}
for param in string.gmatch(cmd.parameter, '%S+') do
table.insert(params, param)
end
if #params < 2 then
game.player.print("Please enter then name of the offender and the reason for the report.")
return nil
end
if not game.players[params[1]] then
game.player.print(params[1] .. " does not exist.")
return nil
end
report(game.player, game.players[params[1]], string.sub(cmd.parameter, string.len(params[1]) + 2))
end
end
commands.add_command('report', '<griefer-name> <message> Reports a user to admins', report_cmd)
commands.add_command('showreports', 'Shows user reports (Admins only)',
function(event)
if game.player and game.player.admin then