local Gui = require 'utils.gui' local Utils = require 'utils.core' local Game = require 'utils.game' local Global = require 'utils.global' local Command = require 'utils.command' local Popup = require 'features.gui.popup' local Color = require 'resources.color_presets' local Event = require 'utils.event' local Server = require 'features.server' local Discord = require 'resources.discord' local helpdesk_channel = Discord.channel_names.helpdesk local moderation_log_channel = Discord.channel_names.moderation_log local moderator_role_mention = Discord.role_mentions.moderator local format = string.format local report_frame_name = Gui.uid_name() local report_close_button_name = Gui.uid_name() local report_tab_button_name = Gui.uid_name() local jail_offender_button_name = Gui.uid_name() local report_body_name = Gui.uid_name() local jail_name = 'Jail' local default_group = 'Default' local prefix = '------------------NOTICE-------------------' local prefix_e = '--------------------------------------------' local Module = {} -- Global registered locals local report_data = {} local jail_data = {} local non_character_unjailed_players = {} Global.register({ report_data = report_data, jail_data = jail_data, non_character_unjailed_players = non_character_unjailed_players }, function(tbl) report_data = tbl.report_data jail_data = tbl.jail_data non_character_unjailed_players = tbl.non_character_unjailed_players end) local function report_command(args, player) local reported_player_name = args.player local reported_player = game.get_player(reported_player_name) if not reported_player then Game.player_print(reported_player_name .. ' does not exist.', Color.fail, player) return nil end Module.report(player, reported_player, args.message) Game.player_print('Your report has been sent.', Color.success, player) end local function draw_report(parent, report_id) local report = report_data[report_id] if report_id == 0 or not report then parent.add {type = 'label', caption = 'No reports yet.'} return end local reported_player_name = game.get_player(report.reported_player_index).name local reporting_player_name = '