Skip to content

Commit

Permalink
merge commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Valansch committed Aug 13, 2018
1 parent 6e266f6 commit 3567b24
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 24 deletions.
1 change: 0 additions & 1 deletion control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ require 'blueprint_helper'
require 'paint'
require 'score'
require 'popup'
require 'report'


local Event = require 'utils.event'
Expand Down
4 changes: 1 addition & 3 deletions player_list.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
21 changes: 1 addition & 20 deletions report.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3567b24

Please sign in to comment.