mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-03-03 14:53:01 +02:00
merge commit
This commit is contained in:
parent
6e266f6003
commit
3567b242ea
@ -25,7 +25,6 @@ require 'blueprint_helper'
|
|||||||
require 'paint'
|
require 'paint'
|
||||||
require 'score'
|
require 'score'
|
||||||
require 'popup'
|
require 'popup'
|
||||||
require 'report'
|
|
||||||
|
|
||||||
|
|
||||||
local Event = require 'utils.event'
|
local Event = require 'utils.event'
|
||||||
|
@ -745,8 +745,6 @@ Gui.on_click(
|
|||||||
local reporting_player = event.player
|
local reporting_player = event.player
|
||||||
local reported_player = Gui.get_data(event.element)
|
local reported_player = Gui.get_data(event.element)
|
||||||
|
|
||||||
-- test code.
|
Report.spawn_reporting_popup (reporting_player, reported_player)
|
||||||
game.print(reporting_player.name .. ' has reported ' .. reported_player.name)
|
|
||||||
--Report.spawn_reporting_popup (reporting_player, reported_player)
|
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
21
report.lua
21
report.lua
@ -121,7 +121,7 @@ local reporting_cancel_button_name = Gui.uid_name()
|
|||||||
local reporting_submit_button_name = Gui.uid_name()
|
local reporting_submit_button_name = Gui.uid_name()
|
||||||
local reporting_input_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
|
local center = player.gui.center
|
||||||
if player.opened then --Destroy whatever is open
|
if player.opened then --Destroy whatever is open
|
||||||
@ -185,25 +185,6 @@ Gui.on_click(
|
|||||||
end
|
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)',
|
commands.add_command('showreports', 'Shows user reports (Admins only)',
|
||||||
function(event)
|
function(event)
|
||||||
if game.player and game.player.admin then
|
if game.player and game.player.admin then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user