mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 03:25:23 +09:00
Merge Game, FlyingText, Common and table
This commit is contained in:
@@ -47,7 +47,7 @@ return {
|
||||
end
|
||||
end
|
||||
|
||||
return { "chat-bot.afk", max.name, ExpUtil.format_locale_time(max.afk_time, "long", afk_time_units) }
|
||||
return { "chat-bot.afk", max.name, ExpUtil.format_time_locale(max.afk_time, "long", afk_time_units) }
|
||||
end,
|
||||
["players"] = function(_player, _is_command)
|
||||
return { "chat-bot.players", #game.players }
|
||||
@@ -70,7 +70,7 @@ return {
|
||||
names[#names + 1] = next_player.name
|
||||
end
|
||||
|
||||
return { "chat-bot.blame", table.get_random_dictionary_entry(names) }
|
||||
return { "chat-bot.blame", table.get_random(names) }
|
||||
end,
|
||||
["magic"] = { "chat-bot.magic" },
|
||||
["aids"] = { "chat-bot.aids" },
|
||||
@@ -78,7 +78,7 @@ return {
|
||||
["lenny"] = { "chat-bot.lenny" },
|
||||
["hodor"] = function(_player, _is_command)
|
||||
local options = { "?", ".", "!", "!!!" }
|
||||
return { "chat-bot.hodor", table.get_random_dictionary_entry(options) }
|
||||
return { "chat-bot.hodor", table.get_random(options) }
|
||||
end,
|
||||
["evolution"] = function(_player, _is_command)
|
||||
return { "chat-bot.current-evolution", string.format("%.2f", game.forces["enemy"].evolution_factor) }
|
||||
|
||||
@@ -19,6 +19,7 @@ see ./expcore/commands.lua for more details
|
||||
surface
|
||||
]]
|
||||
|
||||
local ExpUtil = require("modules/exp_util")
|
||||
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||
|
||||
-- luacheck:ignore 212/player
|
||||
@@ -37,7 +38,7 @@ end)
|
||||
|
||||
Commands.add_parse("string-options", function(input, player, reject, options)
|
||||
if not input then return end -- nil check
|
||||
local option = _C.auto_complete(options, input)
|
||||
local option = ExpUtil.auto_complete(options, input)
|
||||
return option or reject{ "expcore-commands.reject-string-options", table.concat(options, ", ") }
|
||||
end)
|
||||
|
||||
|
||||
@@ -7,9 +7,10 @@
|
||||
player-role-alive
|
||||
]]
|
||||
|
||||
local ExpUtil = require("modules/exp_util")
|
||||
local Commands = require("modules.exp_legacy.expcore.commands") --- @dep expcore.commands
|
||||
local Roles = require("modules.exp_legacy.expcore.roles") --- @dep expcore.roles
|
||||
local auto_complete = _C.auto_complete --- @dep expcore.common
|
||||
local auto_complete = ExpUtil.auto_complete --- @dep expcore.common
|
||||
require("modules.exp_legacy.config.expcore.command_general_parse")
|
||||
|
||||
-- luacheck:ignore 212/player
|
||||
|
||||
@@ -5,13 +5,14 @@
|
||||
-- the key used for the name of the button is the permission name used by the role system;
|
||||
-- @config Player-List
|
||||
|
||||
local ExpUtil = require("modules/exp_util")
|
||||
local Gui = require("modules.exp_legacy.expcore.gui") --- @dep expcore.gui
|
||||
local Roles = require("modules.exp_legacy.expcore.roles") --- @dep expcore.roles
|
||||
local Reports = require("modules.exp_legacy.modules.control.reports") --- @dep modules.control.reports
|
||||
local Warnings = require("modules.exp_legacy.modules.control.warnings") --- @dep modules.control.warnings
|
||||
local Jail = require("modules.exp_legacy.modules.control.jail") --- @dep modules.control.jail
|
||||
local Colors = require("modules/exp_util/include/color")
|
||||
local format_chat_player_name = _C.format_chat_player_name --- @dep expcore.common
|
||||
local format_player_name = ExpUtil.format_player_name_locale --- @dep expcore.common
|
||||
|
||||
local SelectedPlayer, SelectedAction
|
||||
local function set_datastores(player, action)
|
||||
@@ -31,7 +32,7 @@ end
|
||||
local function get_action_player_name(player)
|
||||
local selected_player_name = SelectedPlayer:get(player)
|
||||
local selected_player = game.players[selected_player_name]
|
||||
local selected_player_color = format_chat_player_name(selected_player)
|
||||
local selected_player_color = format_player_name(selected_player)
|
||||
return selected_player_name, selected_player_color
|
||||
end
|
||||
|
||||
@@ -98,7 +99,7 @@ local report_player = new_button("utility/spawn_flag", { "player-list.report-pla
|
||||
|
||||
local function report_player_callback(player, reason)
|
||||
local selected_player_name, selected_player_color = get_action_player_name(player)
|
||||
local by_player_name_color = format_chat_player_name(player)
|
||||
local by_player_name_color = format_player_name(player)
|
||||
game.print{ "expcom-report.non-admin", selected_player_color, reason }
|
||||
Roles.print_to_roles_higher("Trainee", { "expcom-report.admin", selected_player_color, by_player_name_color, reason })
|
||||
Reports.report_player(selected_player_name, player.name, reason)
|
||||
@@ -113,7 +114,7 @@ local warn_player = new_button("utility/spawn_flag", { "player-list.warn-player"
|
||||
|
||||
local function warn_player_callback(player, reason)
|
||||
local selected_player_name, selected_player_color = get_action_player_name(player)
|
||||
local by_player_name_color = format_chat_player_name(player)
|
||||
local by_player_name_color = format_player_name(player)
|
||||
game.print{ "expcom-warnings.received", selected_player_color, by_player_name_color, reason }
|
||||
Warnings.add_warning(selected_player_name, player.name, reason)
|
||||
end
|
||||
@@ -132,7 +133,7 @@ local jail_player = new_button("utility/multiplayer_waiting_icon", { "player-lis
|
||||
|
||||
local function jail_player_callback(player, reason)
|
||||
local selected_player_name, selected_player_color = get_action_player_name(player)
|
||||
local by_player_name_color = format_chat_player_name(player)
|
||||
local by_player_name_color = format_player_name(player)
|
||||
game.print{ "expcom-jail.give", selected_player_color, by_player_name_color, reason }
|
||||
Jail.jail_player(selected_player_name, player.name, reason)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user