From 76a29407c152c9ae8f262c85dec1f7c7da0a22d9 Mon Sep 17 00:00:00 2001 From: Christopher Tse Date: Wed, 2 Sep 2020 08:25:12 +1000 Subject: [PATCH] Also auto switch colours to player talk colours for create self Also some minor UI fixes to the settings button sizes plus comments --- ChatBubblePool.lua | 15 +++++++++++++++ MainFrame.lua | 6 ++++-- Settings.xml | 8 ++++---- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/ChatBubblePool.lua b/ChatBubblePool.lua index c2f5224..401674e 100644 --- a/ChatBubblePool.lua +++ b/ChatBubblePool.lua @@ -133,6 +133,14 @@ end local function moveTail(tail) --Note: Since the chat bubble is anchored to the WorldFrame, we shouldn't adjust for UIParent's scale + + --Vectors Used + -- Cursor - The cursor's current X and Y screen coords + -- origPoint - Vector of tail's original location relative to its old anchoring point. + -- anchoringPointCoords - Vector of new anchoring point in world coords + -- oldAnchoringPointCoords - Vector of old anchoring point in world coords + -- origPointWorldCoords - Vector of tail's original location in world coords. + local cursorX, cursorY = GetCursorPosition(); local origPoint = tail.origPoint; local bubble = tail:GetParent(); @@ -142,6 +150,13 @@ local function moveTail(tail) local anchoringPointCoords = getAnchoringPointCoords(bubble, anchoringPoint); local oldAnchoringPointCoords = getAnchoringPointCoords(bubble, origPoint.relativeP); local origPointWorldCoords = addVector(origPoint, oldAnchoringPointCoords); + + --In this part, we basically only move the x or y based on which side it is on. + --The other axis should remain at "0" (plus some offset to align the texture) + --This is so the tail remains attached to the bubble. + + --We also bound the new X/Y so it doesn't go beyond the edge of the bubble. + --The minimum X/Y variable determines how much space to leave at the end of the bubble. if closestEdge == "BOTTOM" or closestEdge == "TOP" then local cursorOffset = cursorX - tail.origCursorLoc.x; local newXinWorldCoords = origPointWorldCoords.x + cursorOffset; diff --git a/MainFrame.lua b/MainFrame.lua index 35248d8..4310cfa 100644 --- a/MainFrame.lua +++ b/MainFrame.lua @@ -115,19 +115,21 @@ function checkSmartTargetColoring() if not settings.get("SMART_COLORING") then return end - if IsControlKeyDown() and SayColorSelected() then + if IsShiftKeyDown() or IsControlKeyDown() and SayColorSelected() then if not smartTargetColoringActive then smartTargetColoringActive = true; savedColor = settings.get("SELECTED_COLOR"); savedRGB = settings.get("SELECTED_COLOR_RGB"); end - if UnitExists("target") then + if IsControlKeyDown() and UnitExists("target") then if UnitIsPlayer("target") then selectColor(nil,"Say",ChatTypeInfo["SAY"],nil); else selectColor(nil,"Say (NPC)",ChatTypeInfo["MONSTER_SAY"],nil); end + elseif IsShiftKeyDown() then + selectColor(nil,"Say",ChatTypeInfo["SAY"],nil); else selectColor(nil,savedColor,savedRGB,nil); end diff --git a/Settings.xml b/Settings.xml index a5983da..b61da2e 100644 --- a/Settings.xml +++ b/Settings.xml @@ -75,7 +75,7 @@ - + @@ -95,7 +95,7 @@