From 4d4710ac177c8c48b7382304384cb117dff65491 Mon Sep 17 00:00:00 2001 From: Christopher Tse Date: Fri, 18 Nov 2022 20:39:40 +1100 Subject: [PATCH] Re-added font size adjustment to chat bubble pool even when dress blizz bubbles is set to false. Also font size is now capped at 72 for better settings ux --- ChatBubblePool.lua | 3 +++ Settings.lua | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChatBubblePool.lua b/ChatBubblePool.lua index 83f6d9d..a682a12 100644 --- a/ChatBubblePool.lua +++ b/ChatBubblePool.lua @@ -273,6 +273,8 @@ local function createChatBubble(fontSize) editBox:SetScript("OnEnterPressed", function(self) if IsShiftKeyDown() then self:Insert("\n") else self:ClearFocus() end end); editBox:SetScript("OnEscapePressed",clearFocusAndSelection); + local fontPath, _, fontFlags = editBox:GetFont(); + editBox:SetFont(fontPath, fontSize, fontFlags); --Apparently, the below code stops the user from being able to change the cursor location --editBox:EnableMouse(true) --editBox:SetScript("OnMouseDown", function(self) newChatBubble:StartMoving() end ) @@ -301,6 +303,7 @@ local function createChatBubble(fontSize) --We use an invisible FontString to measure the length of the text inside the edit box. editBox.stringMeasure = editBox:CreateFontString(nil,"OVERLAY","ChatBubbleFont"); editBox.stringMeasure:SetAlpha(0); + editBox.stringMeasure:SetFont(fontPath, fontSize, fontFlags); editBox:SetScript("OnTextChanged", function(self) editBox.stringMeasure:SetText(self:GetText()); adjustChatBubbleWidth(newChatBubble); diff --git a/Settings.lua b/Settings.lua index ce7fec3..de28873 100644 --- a/Settings.lua +++ b/Settings.lua @@ -91,7 +91,7 @@ function RegisterFontSize(category) local tooltip = "Controls the font size of all chat bubbles."; local defaultValue = settings.get("FONT_SIZE"); local minValue = 8; - local maxValue = 128; + local maxValue = 72; local step = 1; local setting = Settings.RegisterAddOnSetting(category, name, variable, type(defaultValue), defaultValue); -- 1.7.9.5