Fix setting text to nil

This commit is contained in:
2025-01-07 13:36:14 +01:00
parent 4f97859533
commit 34bae5dc7b

View File

@@ -420,7 +420,7 @@ function shared.Config.Init()
end end
--spotterEnableButton:SetChecked(Heimdall_Data.config.spotter.enabled) --spotterEnableButton:SetChecked(Heimdall_Data.config.spotter.enabled)
local spotterEnableButtonLabel = button:CreateFontString(nil, "OVERLAY", "GameFontNormal") local spotterEnableButtonLabel = button:CreateFontString(nil, "OVERLAY", "GameFontNormal")
spotterEnableButtonLabel:SetText(text) spotterEnableButtonLabel:SetText(text or "")
spotterEnableButtonLabel:SetAllPoints(button) spotterEnableButtonLabel:SetAllPoints(button)
return button return button
end end
@@ -458,7 +458,7 @@ function shared.Config.Init()
editBox:SetScript("OnEnterPressed", function() editBox:ClearFocus() end) editBox:SetScript("OnEnterPressed", function() editBox:ClearFocus() end)
editBox:SetScript("OnEscapePressed", function() editBox:ClearFocus() end) editBox:SetScript("OnEscapePressed", function() editBox:ClearFocus() end)
editBox:SetScript("OnEditFocusLost", function() onDone(editBox) end) editBox:SetScript("OnEditFocusLost", function() onDone(editBox) end)
editBox:SetText(initialValue) editBox:SetText(initialValue or "")
container:Add(textFrame, 1, 1) container:Add(textFrame, 1, 1)
container:Add(editBox, 2, 1) container:Add(editBox, 2, 1)
textElement:SetPoint("TOPLEFT", textFrame, "TOPLEFT", 2, -2) textElement:SetPoint("TOPLEFT", textFrame, "TOPLEFT", 2, -2)
@@ -495,7 +495,7 @@ function shared.Config.Init()
editBox:SetAllPoints(editBoxFrame) editBox:SetAllPoints(editBoxFrame)
editBox:SetAutoFocus(false) editBox:SetAutoFocus(false)
editBox:SetFontObject("GameFontNormal") editBox:SetFontObject("GameFontNormal")
editBox:SetText(initialValue) editBox:SetText(initialValue or "")
editBox:SetTextInsets(6, 6, 6, 6) editBox:SetTextInsets(6, 6, 6, 6)
editBox:SetMultiLine(true) editBox:SetMultiLine(true)
editBox:SetSize(280, 100) editBox:SetSize(280, 100)