Quantcast

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

Christopher Tse [11-18-22 - 09:39]
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
Filename
ChatBubblePool.lua
Settings.lua
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);