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:
@@ -22,12 +22,14 @@ setmetatable(rcon_statics, { __index = _G })
|
||||
setmetatable(rcon_env, { __index = rcon_statics })
|
||||
|
||||
--- Some common static values which can be added now
|
||||
--- @diagnostic disable: name-style-check
|
||||
rcon_statics.Async = Async
|
||||
rcon_statics.ExpUtil = ExpUtil
|
||||
rcon_statics.Commands = Commands
|
||||
rcon_statics.Clustorio = Clustorio
|
||||
rcon_statics.output = Commands.print
|
||||
rcon_statics.ipc = Clustorio.send_json
|
||||
--- @diagnostic enable: name-style-check
|
||||
|
||||
--- Some common callback values which are useful when a player uses the command
|
||||
function rcon_callbacks.player(player) return player end
|
||||
|
||||
@@ -364,9 +364,11 @@ function Commands.print(message, color, sound)
|
||||
if not player then
|
||||
rcon.print(ExpUtil.format_any(message))
|
||||
else
|
||||
local formatted = ExpUtil.format_any(message, nil, 20)
|
||||
player.print(formatted, color or Color.white)
|
||||
player.play_sound{ path = sound or "utility/scenario_message" }
|
||||
local formatted = ExpUtil.format_any(message, { max_line_count = 20 })
|
||||
player.print(formatted, {
|
||||
color = color or Color.white,
|
||||
sound_path = sound or "utility/scenario_message",
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user