Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions lua/entities/gmod_wire_textscreen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -230,18 +230,17 @@ function ENT:Setup(DefaultText, chrPerLine, textJust, valign, tfont, fgcolor, bg
self.chrPerLine = math.Clamp(math.ceil(chrPerLine or 10), 1, 15)
self.textJust = textJust or 1
self.valign = valign or 0
self.tfont = tfont or "Arial"
self:SendConfig()

self.tfont = tfont and string.sub(tfont, 1, 32) or "Arial"
self:TriggerInput("String", DefaultText or "")
self:SendConfig()
end

function ENT:TriggerInput(iname, value)
if iname == "String" then
self.text = string.sub(tostring(value), 1, 1024)
self.doSendText = true
elseif iname == "Font" then
self.tfont = tostring(value)
self.tfont = string.sub(tostring(value), 1, 32)
self.doSendConfig = true
elseif iname == "FGColor" then
self.fgcolor = Color(value.x, value.y, value.z)
Expand Down Expand Up @@ -279,7 +278,7 @@ function ENT:SendConfig(ply)

self.doSendConfig = false

local font = string.sub(self.tfont, 0, 31)
local font = self.tfont
local size = self.chrPerLine

if not WireLib.CheckFont(font .. math.floor(760 / size), ply) then
Expand Down
Loading