Merge Game, FlyingText, Common and table

This commit is contained in:
Cooldude2606
2024-09-30 22:32:35 +01:00
parent 3145f7e904
commit f8c74c9dd3
66 changed files with 817 additions and 2035 deletions

View File

@@ -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

View File

@@ -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