diff --git a/config/file_loader.lua b/config/_file_loader.lua similarity index 77% rename from config/file_loader.lua rename to config/_file_loader.lua index 744c058c..0c1b476c 100644 --- a/config/file_loader.lua +++ b/config/_file_loader.lua @@ -26,7 +26,7 @@ return { 'modules.addons.chat-popups', 'modules.addons.damage-popups', 'modules.addons.death-logger', - 'modules.addons.advanced-starting-items', + 'modules.addons.advanced-start', 'modules.addons.spawn-area', 'modules.addons.compilatron', 'modules.addons.scorched-earth', @@ -35,10 +35,10 @@ return { -- GUI 'modules.commands.debug', -- Config Files - 'config.command_auth_admin', -- commands tagged with admin_only are blocked for non admins - 'config.command_auth_roles', -- commands must be allowed via the role config - 'config.command_auth_runtime_disable', -- allows commands to be enabled and disabled during runtime + 'config.expcore-commands.auth_admin', -- commands tagged with admin_only are blocked for non admins + 'config.expcore-commands.auth_roles', -- commands must be allowed via the role config + 'config.expcore-commands.auth_runtime_disable', -- allows commands to be enabled and disabled during runtime 'config.permission_groups', -- loads some predefined permission groups 'config.roles', -- loads some predefined roles - 'expcore.gui.test' + 'expcore.gui.test' -- loads multiple gui defines to test the gui system } \ No newline at end of file diff --git a/config/advanced_starting_items.lua b/config/advanced_start.lua similarity index 100% rename from config/advanced_starting_items.lua rename to config/advanced_start.lua diff --git a/config/config.cfg b/config/config.cfg deleted file mode 100644 index b12b17cf..00000000 --- a/config/config.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[command-auth] -admin-only=This command is for (game) admins only! -command-disabled=This command has been disabled by management! \ No newline at end of file diff --git a/config/command_auth_admin.lua b/config/expcore-commands/auth_admin.lua similarity index 100% rename from config/command_auth_admin.lua rename to config/expcore-commands/auth_admin.lua diff --git a/config/command_auth_roles.lua b/config/expcore-commands/auth_roles.lua similarity index 100% rename from config/command_auth_roles.lua rename to config/expcore-commands/auth_roles.lua diff --git a/config/command_auth_runtime_disable.lua b/config/expcore-commands/auth_runtime_disable.lua similarity index 100% rename from config/command_auth_runtime_disable.lua rename to config/expcore-commands/auth_runtime_disable.lua diff --git a/config/command_parse_general.lua b/config/expcore-commands/parse_general.lua similarity index 100% rename from config/command_parse_general.lua rename to config/expcore-commands/parse_general.lua diff --git a/config/command_parse_roles.lua b/config/expcore-commands/parse_roles.lua similarity index 97% rename from config/command_parse_roles.lua rename to config/expcore-commands/parse_roles.lua index efdf2a00..3d468aaf 100644 --- a/config/command_parse_roles.lua +++ b/config/expcore-commands/parse_roles.lua @@ -2,7 +2,7 @@ local Commands = require 'expcore.commands' local Roles = require 'expcore.roles' local auto_complete = ext_require('expcore.common','auto_complete') -require 'config.command_parse_general' +require 'config.expcore-commands.parse_general' Commands.add_parse('role',function(input,player,reject) if not input then return end diff --git a/control.lua b/control.lua index 48a4fbbc..e4ed6c3f 100644 --- a/control.lua +++ b/control.lua @@ -26,7 +26,7 @@ ext_require = require('expcore.common').ext_require -- Please go to config/file_loader.lua to edit the files that are loaded log('[INFO] Getting file loader config') -local files = require 'config.file_loader' +local files = require 'config._file_loader' -- Loads all files from the config and logs that they are loaded local total_file_count = string.format('%3d',#files) diff --git a/expcore/gui/left.lua b/expcore/gui/left.lua index da7f37e4..fb62761c 100644 --- a/expcore/gui/left.lua +++ b/expcore/gui/left.lua @@ -239,7 +239,7 @@ end LeftFrames.toggle_button = Buttons.new_button() -:set_tooltip('Close Windows') +:set_tooltip{'expcore-gui.left-button-tooltip'} :set_caption('<') :on_click(function(player,element) for _,define in pairs(LeftFrames.frames) do diff --git a/expcore/locale/de.cfg b/expcore/locale/de.cfg deleted file mode 100644 index e872b325..00000000 --- a/expcore/locale/de.cfg +++ /dev/null @@ -1,9 +0,0 @@ -[expcore-commands] -unauthorized=401 - Unbefugt: Zugang verweigert. Du hast keinen Zugriff auf diese Befehle! -reject-number-range=ungültige Reichweite, Min: __1__, Max: __2__ -reject-string-max-length=ungültige Länge, Max: __1__ -reject-player=ungültiger Spieler Name, __1__ , Versuche "Tab" zu benutzen, damit sich der Name automatisch vervollständigt. -reject-player-online=Der betroffene Spieler ist offline, Befehl konnte nicht ausgeführt werden. -reject-player-alive=Der betroffene Spieler ist Tod, Befehl konnte nicht ausgeführt werden. -invalid-inputs=ungültige Eingabe, /__1__ __2__ -command-ran=Befehl ausgeführt. \ No newline at end of file diff --git a/expcore/locale/en.cfg b/expcore/locale/en.cfg deleted file mode 100644 index 931ce162..00000000 --- a/expcore/locale/en.cfg +++ /dev/null @@ -1,32 +0,0 @@ -time-symbol-days-short=__1__d - -[expcore-commands] -unauthorized=Unauthorized, Access is denied due to invalid credentials -reject-string-options=Invalid Option, Must be one of: __1__ -reject-string-max-length=Invalid Length, Max: __1__ -reject-number=Invalid Number. -reject-number-range=Invalid Range, Min (inclusive): __1__, Max (inclusive): __2__ -reject-player=Invaild Player Name, __1__ ,try using tab key to auto-complete the name -reject-player-online=Player is offline. -reject-player-alive=Player is dead. -reject-force=Invaild Force Name. -reject-surface=Invaild Surface Name. -invalid-inputs=Invalid Input, /__1__ __2__ -invalid-param=Invalid Param "__1__"; __2__ -command-help=__1__ - __2__ -command-ran=Command Complete -command-fail=Command failed to run: __1__ -command-error-log-format=[ERROR] command/__1__ :: __2__ - -[expcore-roles] -error-log-format-flag=[ERROR] roleFlag/__1__ :: __2__ -error-log-format-promote=[ERROR] rolePromote/__1__ :: __2__ -game-message-assign=__1__ has been assigned to __2__ by __3__ -game-message-unassign=__1__ has been unassigned from __2__ by __3__ -reject-role=Invalid Role Name. -reject-player-role=Player has a higher role. - -[gui_util] -button_tooltip=Shows / hides the Toolbar Gui buttons. - -[expcore-gui] diff --git a/expcore/locale/nl.cfg b/expcore/locale/nl.cfg deleted file mode 100644 index 21e1ed58..00000000 --- a/expcore/locale/nl.cfg +++ /dev/null @@ -1,9 +0,0 @@ -[expcore-commands] -unauthorized=401 - Onbevoegd: toegang wordt geweigerd vanwege ongeldige inloggegevens -reject-number-range=Onjuiste radius, Min: __1__, Max: __2__ -reject-string-max-length=Onjuiste lengte, Max: __1__ -reject-player=Onjuiste naam, __1__ , probeer tab te gebruiken om de naam automatisch in te vullen -reject-player-online=Speler is offline. -reject-player-alive=Speler is dood. -invalid-inputs=Onjuiste invoer, /__1__ __2__ -command-ran=Commando uitgevoerd. diff --git a/expcore/locale/sv-SE.cfg b/expcore/locale/sv-SE.cfg deleted file mode 100644 index 078b7f17..00000000 --- a/expcore/locale/sv-SE.cfg +++ /dev/null @@ -1,9 +0,0 @@ -[expcore-commands] -unauthorized=401 - Otillåten: Tillgång nekas på grund av otillräcklig säkerhetsprövning. -reject-number-range=Invalid räckvid, Min: __1__, Max: __2__ -reject-string-max-length=ogiltig längd, Max: __1__ -reject-player=Ogiltigt spelarnamn, __1__ , försök använda tab-tangenten för att auto-slutföra namn. -reject-player-online=Spelare är offline. Kommando misslyckades med att köras. -reject-player-alive=Spelare är död. Kommando misslyckades med att köras. -invalid-inputs=Igiltig inmatning, /__1__ __2__ -command-ran=Kommandot slutfört diff --git a/locale/en/commands.cfg b/locale/en/commands.cfg index f987582c..12812c63 100644 --- a/locale/en/commands.cfg +++ b/locale/en/commands.cfg @@ -1,38 +1,56 @@ -[exp-commands] -kill-already-dead=You are already dead. -admin-chat-format=[Admin Chat] __1__: __2__ -tp-no-position-found=No position to teleport to was found, please try again later. -tp-to-self=Player can not be teleported to themselves. -chelp-title=Help results for "__1__": -chelp-footer=[__1__ results found; page __2__ of __3__] -chelp-format=/__1__ __2__ - __3__ __4__ -chelp-alias=Alias: __1__ -chelp-out-of-range=__1__ is an invalid page number. -roles-higher-role=The role you tried to assign is higher than your highest. -roles-list=All roles are: __1__ -roles-list-player=__1__ has: __2__ -roles-list-element=__1__, __2__ -jail-give=__1__ was jailed by __2__. Reason: __3__ -jail-remove=__1__ was unjailed by __2__. -jail-already-jailed=__1__ is already in jail. -jail-not-jailed=__1__ is not currently in jail. -jail-temp-ban=__1__ was temp banned until next reset by __2__. Reason: __3__ -jail-temp-ban-clear=__1__ was cleared from temp banned by __2__. -jail-not-temp-banned=__1__ is not currently temp banned. -jail-already-banned=__1__ is already banned. -report-player-immune=This player can not be reported. -report-non-admin=__1__ was reported for __2__. -report-admin=__1__ was reported by __2__ for __3__. -report-already-reported=You can only report a player once, you can ask a moderator to clear this report. -report-not-reported=The player had no reports on them. -report-player-count-title=The following players have reports against them: -report-player-report-title=__1__ has the following reports agasinst them: -report-list=__1__: __2__ -report-removed=__1__ has one or more reports removed by __2__. -warnings-received=__1__ recived a warning from __2__ for __3__. -warnings-player=__1__ has __2__ warnings and __3__/__4__ script warnings. -warnings-list-tilte=The following player have this many warnings (and this many script warnings): -warnings-list=__1__: __2__ (__3__/__4__) -warnings-cleared=__1__ had all they warnings cleared by __2__. -spawn-unavailable=They was a problem getting you to spawn, please try again later. -repair-result=__1__ entites were revived and __2__ were healed to max health. \ No newline at end of file +[expcom-kill] +already-dead=You are already dead. + +[expcom-admin-chat] +format=[Admin Chat] __1__: __2__ + +[expcom-tp] +no-position-found=No position to teleport to was found, please try again later. +to-self=Player can not be teleported to themselves. + +[expcom-chelp] +title=Help results for "__1__": +footer=[__1__ results found; page __2__ of __3__] +format=/__1__ __2__ - __3__ __4__ +alias=Alias: __1__ +out-of-range=__1__ is an invalid page number. + +[expcom-roles] +higher-role=The role you tried to assign is higher than your highest. +list=All roles are: __1__ +list-player=__1__ has: __2__ +list-element=__1__, __2__ + +[expcom-jail] +give=__1__ was jailed by __2__. Reason: __3__ +remove=__1__ was unjailed by __2__. +already-jailed=__1__ is already in jail. +not-jailed=__1__ is not currently in jail. +temp-ban=__1__ was temp banned until next reset by __2__. Reason: __3__ +temp-ban-clear=__1__ was cleared from temp banned by __2__. +not-temp-banned=__1__ is not currently temp banned. +already-banned=__1__ is already banned. + +[expcom-report] +player-immune=This player can not be reported. +non-admin=__1__ was reported for __2__. +admin=__1__ was reported by __2__ for __3__. +already-reported=You can only report a player once, you can ask a moderator to clear this report. +not-reported=The player had no reports on them. +player-count-title=The following players have reports against them: +player-report-title=__1__ has the following reports agasinst them: +list=__1__: __2__ +removed=__1__ has one or more reports removed by __2__. + +[expcom-warnings] +received=__1__ recived a warning from __2__ for __3__. +player=__1__ has __2__ warnings and __3__/__4__ script warnings. +list-tilte=The following player have this many warnings (and this many script warnings): +list=__1__: __2__ (__3__/__4__) +cleared=__1__ had all they warnings cleared by __2__. + +[expcom-spawn] +unavailable=They was a problem getting you to spawn, please try again later. + +[expcom-repair] +result=__1__ entites were revived and __2__ were healed to max health. \ No newline at end of file diff --git a/locale/en/expcore.cfg b/locale/en/expcore.cfg index 931ce162..58830616 100644 --- a/locale/en/expcore.cfg +++ b/locale/en/expcore.cfg @@ -1,4 +1,5 @@ time-symbol-days-short=__1__d +color-tag=[color=__1__]__2__[/color] [expcore-commands] unauthorized=Unauthorized, Access is denied due to invalid credentials @@ -27,6 +28,7 @@ reject-role=Invalid Role Name. reject-player-role=Player has a higher role. [gui_util] -button_tooltip=Shows / hides the Toolbar Gui buttons. +button_tooltip=Shows/hides the toolbar. [expcore-gui] +left-button-tooltip=Hide all open windows. \ No newline at end of file diff --git a/modules/addons/advanced-starting-items.lua b/modules/addons/advanced-start.lua similarity index 95% rename from modules/addons/advanced-starting-items.lua rename to modules/addons/advanced-start.lua index f402e5dc..07ed9ddc 100644 --- a/modules/addons/advanced-starting-items.lua +++ b/modules/addons/advanced-start.lua @@ -1,7 +1,7 @@ --- Adds a better method of player starting items based on production levels. local Event = require 'utils.event' local Game = require 'utils.game' -local config = require 'config.advanced_starting_items' +local config = require 'config.advanced_start' local items = config.items Event.add(defines.events.on_player_created, function(event) diff --git a/modules/addons/random-player-colours.lua b/modules/addons/random-player-colours.lua index 0e347997..9c47f8be 100644 --- a/modules/addons/random-player-colours.lua +++ b/modules/addons/random-player-colours.lua @@ -9,15 +9,13 @@ Global.register(config,function(tbl) config = tbl end) -local white = Colours.white -local black = Colours.black Event.add(defines.events.on_player_created,function(event) local player = Game.get_player_by_index(event.player_index) local color = 'white' if config.players[player.name] then color = config.players[player.name] else - while not config.disallow[color] do + while config.disallow[color] do color = table.get_random_dictionary_entry(Colours,true) end color = Colours[color] diff --git a/modules/commands/admin-chat.lua b/modules/commands/admin-chat.lua index e9f32b50..f3038941 100644 --- a/modules/commands/admin-chat.lua +++ b/modules/commands/admin-chat.lua @@ -1,6 +1,6 @@ local Commands = require 'expcore.commands' local format_chat_player_name = ext_require('expcore.common','format_chat_player_name') -require 'config.command_parse_general' +require 'config.expcore-commands.parse_general' Commands.new_command('admin-chat','Sends a message in chat that only admins can see.') :add_param('message',false) -- the message to send in the admin chat @@ -11,7 +11,7 @@ Commands.new_command('admin-chat','Sends a message in chat that only admins can local player_name_colour = format_chat_player_name(player) for _,return_player in pairs(game.connected_players) do if return_player.admin then - return_player.print{'exp-commands.admin-chat-format',player_name_colour,message} + return_player.print{'expcom-admin-chat.format',player_name_colour,message} end end return Commands.success -- prevents command complete message from showing diff --git a/modules/commands/cheat-mode.lua b/modules/commands/cheat-mode.lua index 6aef5fca..ab40cb30 100644 --- a/modules/commands/cheat-mode.lua +++ b/modules/commands/cheat-mode.lua @@ -1,5 +1,5 @@ local Commands = require 'expcore.commands' -require 'config.command_parse_general' +require 'config.expcore-commands.parse_general' Commands.new_command('toggle-cheat-mode','Toggles cheat mode for your player, or another player.') :add_param('player',true,'player') -- player to toggle chest mode of, can be nil for self diff --git a/modules/commands/clear-inventory.lua b/modules/commands/clear-inventory.lua index 0b8a8d26..b33c3029 100644 --- a/modules/commands/clear-inventory.lua +++ b/modules/commands/clear-inventory.lua @@ -1,6 +1,6 @@ local Commands = require 'expcore.commands' local move_items = ext_require('expcore.common','move_items') -require 'config.command_parse_roles' +require 'config.expcore-commands.parse_roles' Commands.new_command('clear-inventory','Clears a players inventory') :add_param('player',false,'player-role-alive') diff --git a/modules/commands/help.lua b/modules/commands/help.lua index 419a23ac..11d2c647 100644 --- a/modules/commands/help.lua +++ b/modules/commands/help.lua @@ -1,6 +1,6 @@ local Commands = require 'expcore.commands' local Global = require 'utils.global' -require 'config.command_parse_general' +require 'config.expcore-commands.parse_general' local results_per_page = 5 @@ -42,9 +42,9 @@ Commands.new_command('chelp','Searches for a keyword in all commands you are all -- adds the new command to the page page_count = page_count + 1 found = found + 1 - local alias_format = #command_data.aliases > 0 and {'exp-commands.chelp-alias',table.concat(command_data.aliases,', ')} or '' + local alias_format = #command_data.aliases > 0 and {'expcom-chelp.alias',table.concat(command_data.aliases,', ')} or '' table.insert(pages[current_page],{ - 'exp-commands.chelp-format', + 'expcom-chelp.format', command_data.name, command_data.description, command_data.help, @@ -60,15 +60,15 @@ Commands.new_command('chelp','Searches for a keyword in all commands you are all end -- print the requested page keyword = keyword == '' and '' or keyword - Commands.print({'exp-commands.chelp-title',keyword},'cyan') + Commands.print({'expcom-chelp.title',keyword},'cyan') if pages[page] then for _,command in pairs(pages[page]) do Commands.print(command) end - Commands.print({'exp-commands.chelp-footer',found,page,#pages},'cyan') + Commands.print({'expcom-chelp.footer',found,page,#pages},'cyan') else - Commands.print({'exp-commands.chelp-footer',found,page,#pages},'cyan') - return Commands.error{'exp-commands.chelp-out-of-range',page} + Commands.print({'expcom-chelp.footer',found,page,#pages},'cyan') + return Commands.error{'expcom-chelp.out-of-range',page} end -- blocks command complete message return Commands.success diff --git a/modules/commands/jail.lua b/modules/commands/jail.lua index 6a30789f..a5d7ae37 100644 --- a/modules/commands/jail.lua +++ b/modules/commands/jail.lua @@ -1,7 +1,7 @@ local Commands = require 'expcore.commands' local JailControl = require 'modules.addons.jail-control' local format_chat_player_name = ext_require('expcore.common','format_chat_player_name') -require 'config.command_parse_roles' +require 'config.expcore-commands.parse_roles' Commands.new_command('jail','Puts a player into jail and removes all other roles.') :add_param('player',false,'player-role') @@ -12,9 +12,9 @@ Commands.new_command('jail','Puts a player into jail and removes all other roles local action_player_name_color = format_chat_player_name(action_player) local by_player_name_color = format_chat_player_name(player) if JailControl.jail_player(action_player,player.name) then - game.print{'exp-commands.jail-give',action_player_name_color,by_player_name_color,reason} + game.print{'expcom-jail.give',action_player_name_color,by_player_name_color,reason} else - return Commands.error{'exp-commands.jail-already-jailed',action_player_name_color} + return Commands.error{'expcom-jail.already-jailed',action_player_name_color} end end) @@ -26,9 +26,9 @@ Commands.new_command('unjail','Puts a player into jail and removes all other rol local action_player_name_color = format_chat_player_name(action_player) local by_player_name_color = format_chat_player_name(player) if JailControl.unjail_player(action_player,player.name) then - game.print{'exp-commands.jail-remove',action_player_name_color,by_player_name_color} + game.print{'expcom-jail.remove',action_player_name_color,by_player_name_color} else - return Commands.error{'exp-commands.jail-not-jailed',action_player_name_color} + return Commands.error{'expcom-jail.not-jailed',action_player_name_color} end end) @@ -40,9 +40,9 @@ Commands.new_command('temp-ban','Temp bans a player until the next reset; this r local action_player_name_color = format_chat_player_name(action_player) local by_player_name_color = format_chat_player_name(player) if JailControl.temp_ban_player(action_player,player.name,reason) then - game.print{'exp-commands.jail-temp-ban',action_player_name_color,by_player_name_color,reason} + game.print{'expcom-jail.temp-ban',action_player_name_color,by_player_name_color,reason} else - return Commands.error{'exp-commands.jail-already-banned',action_player_name_color} + return Commands.error{'expcom-jail.already-banned',action_player_name_color} end end) @@ -54,8 +54,8 @@ Commands.new_command('clear-temp-ban','Removes temp ban from a player; this will local action_player_name_color = format_chat_player_name(action_player) local by_player_name_color = format_chat_player_name(player) if JailControl.clear_temp_ban_player(action_player,player.name) then - game.print{'exp-commands.jail-temp-ban-clear',action_player_name_color,by_player_name_color} + game.print{'expcom-jail.temp-ban-clear',action_player_name_color,by_player_name_color} else - return Commands.error{'exp-commands.jail-not-temp-banned',action_player_name_color} + return Commands.error{'expcom-jail.not-temp-banned',action_player_name_color} end end) \ No newline at end of file diff --git a/modules/commands/kill.lua b/modules/commands/kill.lua index 0c36e327..e0076165 100644 --- a/modules/commands/kill.lua +++ b/modules/commands/kill.lua @@ -1,7 +1,7 @@ local Commands = require 'expcore.commands' local Roles = require 'expcore.roles' -require 'config.command_parse_general' -require 'config.command_parse_roles' +require 'config.expcore-commands.parse_general' +require 'config.expcore-commands.parse_roles' Commands.new_command('kill','Kills yourself or another player.') :add_param('player',true,'player-role-alive') -- the player to kill, must be alive to be valid @@ -14,7 +14,7 @@ end} :register(function(player,action_player,raw) if not action_player then -- can only be nil if no player given and the user is dead - return Commands.error{'exp-commands.kill-already-dead'} + return Commands.error{'expcom-kill.already-dead'} end if player == action_player then action_player.character.die() diff --git a/modules/commands/repair.lua b/modules/commands/repair.lua index 660ec6eb..e1644fb8 100644 --- a/modules/commands/repair.lua +++ b/modules/commands/repair.lua @@ -1,6 +1,6 @@ local Commands = require 'expcore.commands' local config = require 'config.repair' -require 'config.command_parse_general' +require 'config.expcore-commands.parse_general' local max_time_to_live = 4294967295 -- unit32 max Commands.new_command('repair','Repairs entities on your force around you') @@ -40,5 +40,5 @@ Commands.new_command('repair','Repairs entities on your force around you') end end end - return Commands.success{'exp-commands.repair-result',revive_count,heal_count} + return Commands.success{'expcom-repair.result',revive_count,heal_count} end) \ No newline at end of file diff --git a/modules/commands/reports.lua b/modules/commands/reports.lua index 3c57f533..98fec56d 100644 --- a/modules/commands/reports.lua +++ b/modules/commands/reports.lua @@ -2,14 +2,14 @@ local Roles = require 'expcore.roles' local Commands = require 'expcore.commands' local ReportsControl = require 'modules.addons.reports-control' local format_chat_player_name = ext_require('expcore.common','format_chat_player_name') -require 'config.command_parse_general' +require 'config.expcore-commands.parse_general' Commands.new_command('report','Reports a player and notifies moderators') :add_param('player',false,function(input,player,reject) input = Commands.parse('player',input,player,reject) if not input then return end if Roles.player_has_flag(input,'report-immune') then - return reject{'exp-commands.report-player-immune'} + return reject{'expcom-report.player-immune'} else return input end @@ -21,10 +21,10 @@ end) local action_player_name_color = format_chat_player_name(action_player) local by_player_name_color = format_chat_player_name(player) if ReportsControl.report_player(action_player,reason,player.name) then - game.print{'exp-commands.report-non-admin',action_player_name_color,reason} - Roles.print_to_roles_higher('Trainee',{'exp-commands.report-admin',action_player_name_color,by_player_name_color,reason}) + game.print{'expcom-report.non-admin',action_player_name_color,reason} + Roles.print_to_roles_higher('Trainee',{'expcom-report.admin',action_player_name_color,by_player_name_color,reason}) else - return Commands.error{'exp-commands.report-already-reported'} + return Commands.error{'expcom-report.already-reported'} end end) @@ -35,18 +35,18 @@ Commands.new_command('get-reports','Gets a list of all reports that a player has if action_player then local reports = ReportsControl.get_player_reports(action_player) local action_player_name_color = format_chat_player_name(action_player) - Commands.print{'exp-commands.report-player-report-title',action_player_name_color} + Commands.print{'expcom-report.player-report-title',action_player_name_color} for player_name,reason in pairs(reports) do local by_player_name_color = format_chat_player_name(player_name) - Commands.print{'exp-commands.report-list',by_player_name_color,reason} + Commands.print{'expcom-report.list',by_player_name_color,reason} end else local user_reports = ReportsControl.user_reports - Commands.print{'exp-commands.report-player-count-title'} + Commands.print{'expcom-report.player-count-title'} for player_name,reports in pairs(user_reports) do local player_name_color = format_chat_player_name(player_name) local report_count = ReportsControl.count_player_reports(player_name) - Commands.print{'exp-commands.report-list',player_name_color,report_count} + Commands.print{'expcom-report.list',player_name_color,report_count} end end end) @@ -57,14 +57,14 @@ Commands.new_command('clear-reports','Clears all reports from a player or just t :register(function(player,action_player,from_player,raw) if from_player then if not ReportsControl.remove_player_report(action_player,from_player.name) then - return Commands.error{'exp-commands.report-not-reported'} + return Commands.error{'expcom-report.not-reported'} end else if not ReportsControl.clear_player_reports(action_player) then - return Commands.error{'exp-commands.report-not-reported'} + return Commands.error{'expcom-report.not-reported'} end end local action_player_name_color = format_chat_player_name(action_player) local by_player_name_color = format_chat_player_name(player) - game.print{'exp-commands.report-removed',action_player_name_color,by_player_name_color} + game.print{'expcom-report.removed',action_player_name_color,by_player_name_color} end) \ No newline at end of file diff --git a/modules/commands/roles.lua b/modules/commands/roles.lua index c8b54f57..d9d3b6d4 100644 --- a/modules/commands/roles.lua +++ b/modules/commands/roles.lua @@ -16,7 +16,7 @@ Commands.new_command('assign-role','Assigns a role to a player') if player_highest.index < role.index then Roles.assign_player(action_player,role,player.name) else - return Commands.error{'exp-commands.roles-higher-role'} + return Commands.error{'expcom-roles.higher-role'} end end) @@ -30,7 +30,7 @@ Commands.new_command('unassign-role','Unassigns a role from a player') if player_highest.index < role.index then Roles.unassign_player(action_player,role,player.name) else - return Commands.error{'exp-commands.roles-higher-role'} + return Commands.error{'expcom-roles.higher-role'} end end) @@ -39,7 +39,7 @@ Commands.new_command('list-roles','Lists all roles in they correct order') :add_alias('lsroles','roles') :register(function(player,action_player,raw) local roles = Roles.config.order - local message = {'exp-commands.roles-list'} + local message = {'expcom-roles.list'} if action_player then roles = Roles.get_player_roles(action_player) end @@ -48,13 +48,13 @@ Commands.new_command('list-roles','Lists all roles in they correct order') local colour = role.custom_color or Colours.white local role_name = format_chat_colour_localized(role.name,colour) if index == 1 then - message = {'exp-commands.roles-list',role_name} + message = {'expcom-roles.list',role_name} if action_player then local player_name_colour = format_chat_player_name(action_player) - message = {'exp-commands.roles-list-player',player_name_colour,role_name} + message = {'expcom-roles.list-player',player_name_colour,role_name} end else - message = {'exp-commands.roles-list-element',message,role_name} + message = {'expcom-roles.list-element',message,role_name} end end return Commands.success(message) diff --git a/modules/commands/spawn.lua b/modules/commands/spawn.lua index 9e27bfbf..cc1fe512 100644 --- a/modules/commands/spawn.lua +++ b/modules/commands/spawn.lua @@ -23,14 +23,14 @@ Commands.new_command('go-to-spawn','Teleport to spawn') :add_alias('spawn','tp-spawn') :register(function(player,action_player) if not action_player then - return Commands.error{'exp-commands.spawn-unavailable'} + return Commands.error{'expcom-spawn.unavailable'} elseif action_player == player then if not teleport(player) then - return Commands.error{'exp-commands.spawn-unavailable'} + return Commands.error{'expcom-spawn.unavailable'} end elseif Roles.player_allowed(player,'command/go-to-spawn/always') then if not teleport(action_player) then - return Commands.error{'exp-commands.spawn-unavailable'} + return Commands.error{'expcom-spawn.unavailable'} end else return Commands.error{'expcore-commands.unauthorized'} diff --git a/modules/commands/tag.lua b/modules/commands/tag.lua index 18c1f0e5..0c5e5cf4 100644 --- a/modules/commands/tag.lua +++ b/modules/commands/tag.lua @@ -1,7 +1,7 @@ local Commands = require 'expcore.commands' local Roles = require 'expcore.roles' -require 'config.command_parse_general' -require 'config.command_parse_roles' +require 'config.expcore-commands.parse_general' +require 'config.expcore-commands.parse_roles' Commands.new_command('tag','Sets your player tag.') :add_param('tag',false,'string-max-length',20) -- new tag for your player max 20 char diff --git a/modules/commands/teleport.lua b/modules/commands/teleport.lua index e1fdd893..0f456c9e 100644 --- a/modules/commands/teleport.lua +++ b/modules/commands/teleport.lua @@ -1,5 +1,5 @@ local Commands = require 'expcore.commands' -require 'config.command_parse_general' +require 'config.expcore-commands.parse_general' local function teleport(from_player,to_player) local surface = to_player.surface @@ -18,11 +18,11 @@ Commands.new_command('teleport','Teleports a player to another player.') :register(function(player,from_player,to_player,raw) if from_player.index == to_player.index then -- return if attempting to teleport to self - return Commands.error{'exp-commands.tp-to-self'} + return Commands.error{'expcom-tp.to-self'} end if not teleport(from_player,to_player) then -- return if the teleport failed - return Commands.error{'exp-commands.tp-no-position-found'} + return Commands.error{'expcom-tp.no-position-found'} end end) @@ -32,11 +32,11 @@ Commands.new_command('bring','Teleports a player to you.') :register(function(player,from_player,raw) if from_player.index == player.index then -- return if attempting to teleport to self - return Commands.error{'exp-commands.tp-to-self'} + return Commands.error{'expcom-tp.to-self'} end if not teleport(from_player,player) then -- return if the teleport failed - return Commands.error{'exp-commands.tp-no-position-found'} + return Commands.error{'expcom-tp.no-position-found'} end end) @@ -47,10 +47,10 @@ Commands.new_command('goto','Teleports you to a player.') :register(function(player,to_player,raw) if to_player.index == player.index then -- return if attempting to teleport to self - return Commands.error{'exp-commands.tp-to-self'} + return Commands.error{'expcom-tp.to-self'} end if not teleport(player,to_player) then -- return if the teleport failed - return Commands.error{'exp-commands.tp-no-position-found'} + return Commands.error{'expcom-tp.no-position-found'} end end) \ No newline at end of file diff --git a/modules/commands/warnings.lua b/modules/commands/warnings.lua index ae3c9692..1a86e4bd 100644 --- a/modules/commands/warnings.lua +++ b/modules/commands/warnings.lua @@ -2,7 +2,7 @@ local Commands = require 'expcore.commands' local WarningsControl = require 'modules.addons.warnings-control' local format_chat_player_name = ext_require('expcore.common','format_chat_player_name') local config = require 'config.warnings' -require 'config.command_parse_roles' +require 'config.expcore-commands.parse_roles' Commands.new_command('give-warning','Gives a warning to a player; may lead to automatic script action.') :add_param('player',false,'player-role') @@ -13,7 +13,7 @@ Commands.new_command('give-warning','Gives a warning to a player; may lead to au WarningsControl.add_warnings(action_player,player.name) local action_player_name_color = format_chat_player_name(action_player) local by_player_name_color = format_chat_player_name(player) - game.print{'exp-commands.warnings-received',action_player_name_color,by_player_name_color,reason} + game.print{'expcom-warnings.received',action_player_name_color,by_player_name_color,reason} end) Commands.new_command('get-warnings','Gets the number of warnings a player has. If no player then lists all players and the number of warnings they have.') @@ -24,7 +24,7 @@ Commands.new_command('get-warnings','Gets the number of warnings a player has. I local warnings = WarningsControl.get_warnings(action_player) local script_warnings = WarningsControl.get_temp_warnings(action_player) local action_player_name_color = format_chat_player_name(action_player) - Commands.print{'exp-commands.warnings-player',action_player_name_color,warnings,script_warnings,config.temp_warning_limit} + Commands.print{'expcom-warnings.player',action_player_name_color,warnings,script_warnings,config.temp_warning_limit} else local rtn = {} local user_warnings = WarningsControl.user_warnings @@ -38,10 +38,10 @@ Commands.new_command('get-warnings','Gets the number of warnings a player has. I end rtn[player_name][2] = #warnings end - Commands.print{'exp-commands.warnings-list-tilte'} + Commands.print{'expcom-warnings.list-tilte'} for player_name,warnings in pairs(rtn) do local player_name_color = format_chat_player_name(player_name) - Commands.print{'exp-commands.warnings-list',player_name_color,warnings[1],warnings[2],config.temp_warning_limit} + Commands.print{'expcom-warnings.list',player_name_color,warnings[1],warnings[2],config.temp_warning_limit} end end end) @@ -53,5 +53,5 @@ Commands.new_command('clear-warnings','Clears all warnings (and script warnings) WarningsControl.clear_temp_warnings(action_player,player.name) local action_player_name_color = format_chat_player_name(action_player) local by_player_name_color = format_chat_player_name(player) - game.print{'exp-commands.warnings-cleared',action_player_name_color,by_player_name_color} + game.print{'expcom-warnings.cleared',action_player_name_color,by_player_name_color} end) \ No newline at end of file