mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-08-29 09:01:33 +00:00
81cdc8fb87
Moves the first notes editor line into an H1 title, keeps it stable when empty, and removes the separate title field. Includes the remaining pending phone UI, voice, locale, bridge, and test updates on this branch.
46 lines
1.3 KiB
Lua
46 lines
1.3 KiB
Lua
Bridge = Bridge or {}
|
|
Bridge.Callbacks = Bridge.Callbacks or {}
|
|
Bridge.Calls = Bridge.Calls or {}
|
|
Bridge.Database = Bridge.Database or {}
|
|
Bridge.Framework = Bridge.Framework or {}
|
|
Bridge.Inventory = Bridge.Inventory or {}
|
|
Bridge.Radio = Bridge.Radio or {}
|
|
Bridge.Speaker = Bridge.Speaker or {}
|
|
|
|
function Bridge.Speaker.IsEnabled()
|
|
return not Config.Speaker or Config.Speaker.Enabled ~= false
|
|
end
|
|
|
|
function Bridge.Radio.SupportsSpeaker()
|
|
return false
|
|
end
|
|
|
|
function Bridge.Radio.SetPlayerSpeaker()
|
|
return false
|
|
end
|
|
|
|
local level_colours = {
|
|
debug = "^5",
|
|
info = "^2",
|
|
warn = "^3",
|
|
error = "^1",
|
|
}
|
|
|
|
function Bridge.Debug(level, message, ...)
|
|
local arguments = { ... }
|
|
local options = type(arguments[#arguments]) == "table" and arguments[#arguments] or nil
|
|
if options then
|
|
arguments[#arguments] = nil
|
|
end
|
|
|
|
local bridge_config = Config and Config.Bridge or nil
|
|
local enabled = options and options.always
|
|
or bridge_config and (bridge_config.Debug or bridge_config.DebugLevels and bridge_config.DebugLevels[level])
|
|
if not enabled then
|
|
return
|
|
end
|
|
|
|
local formatted = #arguments > 0 and message:format(table.unpack(arguments)) or message
|
|
print(("%s%s^0"):format(level_colours[level] or "^7", formatted))
|
|
end
|