From 76ad9bf6e08b32bb0b7e15e5fbda3df6174aebc8 Mon Sep 17 00:00:00 2001 From: Peter Holmberg Date: Tue, 18 May 2021 10:53:18 +0200 Subject: [PATCH 1/7] inherit BackdropTemplate --- .gitignore | 3 +- EavesDrop.xml | 168 +++++++++++++++++++++++++------------------------- 2 files changed, 86 insertions(+), 85 deletions(-) diff --git a/.gitignore b/.gitignore index a43a18f..c9377aa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ # Don't track content of these folders -.release/ \ No newline at end of file +.release/ +.idea/ diff --git a/EavesDrop.xml b/EavesDrop.xml index 4aa1ebf..3322aa0 100755 --- a/EavesDrop.xml +++ b/EavesDrop.xml @@ -2,10 +2,10 @@ - + - + @@ -96,21 +96,21 @@ GameTooltip:Hide(); - if button == "LeftButton" and IsShiftKeyDown() and self.tooltipText then - EavesDrop:SendToChat(self.tooltipText) - elseif IsAltKeyDown() then - if button == "LeftButton" then - EavesDrop:OpenMenu() - elseif button == "RightButton" then - EavesDrop:ShowHistory() - end - end + if button == "LeftButton" and IsShiftKeyDown() and self.tooltipText then + EavesDrop:SendToChat(self.tooltipText) + elseif IsAltKeyDown() then + if button == "LeftButton" then + EavesDrop:OpenMenu() + elseif button == "RightButton" then + EavesDrop:ShowHistory() + end + end - + @@ -164,8 +164,8 @@ self:SetBackdropColor(1, 1, 1, 1); if ( self.tooltipText ) then - GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); - GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1); + GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); + GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1); end @@ -173,11 +173,11 @@ GameTooltip:Hide(); - if button == "LeftButton" and IsShiftKeyDown() and self.tooltipText2 then - EavesDrop:SendToChat(self.tooltipText2) - elseif button == "RightButton" and IsShiftKeyDown() and self.tooltipText1 then - EavesDrop:SendToChat(self.tooltipText1) - end + if button == "LeftButton" and IsShiftKeyDown() and self.tooltipText2 then + EavesDrop:SendToChat(self.tooltipText2) + elseif button == "RightButton" and IsShiftKeyDown() and self.tooltipText1 then + EavesDrop:SendToChat(self.tooltipText1) + end @@ -191,8 +191,8 @@ if ( self.tooltipText ) then - GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); - GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1); + GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); + GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1); end @@ -202,7 +202,7 @@ - + @@ -394,12 +394,12 @@ PlaySound(SOUNDKIT.IG_CHAT_SCROLL_DOWN); if IsShiftKeyDown() then - EavesDrop:ScrollToBottom() - elseif IsControlKeyDown() then - EavesDrop:FindCombatDown() - else - EavesDrop:ScrollDown() - end + EavesDrop:ScrollToBottom() + elseif IsControlKeyDown() then + EavesDrop:FindCombatDown() + else + EavesDrop:ScrollDown() + end GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); @@ -429,14 +429,14 @@ - PlaySound(SOUNDKIT.IG_CHAT_SCROLL_UP); - if IsShiftKeyDown() then - EavesDrop:ScrollToTop() - elseif IsControlKeyDown() then - EavesDrop:FindCombatUp() - else - EavesDrop:ScrollUp() - end + PlaySound(SOUNDKIT.IG_CHAT_SCROLL_UP); + if IsShiftKeyDown() then + EavesDrop:ScrollToTop() + elseif IsControlKeyDown() then + EavesDrop:FindCombatUp() + else + EavesDrop:ScrollUp() + end GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); @@ -464,13 +464,13 @@ EavesDropTab:SetAlpha(0); - if IsAltKeyDown() then - if button == "LeftButton" then - EavesDrop:OpenMenu() - elseif button == "RightButton" then - EavesDrop:ShowHistory() - end - end + if IsAltKeyDown() then + if button == "LeftButton" then + EavesDrop:OpenMenu() + elseif button == "RightButton" then + EavesDrop:ShowHistory() + end + end @@ -524,9 +524,9 @@ GameTooltip:Hide(); - if button == "RightButton" then - EavesDrop:OpenMenu() - end + if button == "RightButton" then + EavesDrop:OpenMenu() + end EavesDropTab:SetAlpha(1); @@ -539,17 +539,17 @@ if (not EavesDrop.db.profile["LOCKED"] ) then - EavesDropFrame:StartMoving(); - end + EavesDropFrame:StartMoving(); + end EavesDropFrame:StopMovingOrSizing(); local x, y = EavesDropFrame:GetLeft(), EavesDropFrame:GetTop() - local es = EavesDropFrame:GetEffectiveScale() - local ps = UIParent:GetScale() - x = x*es - GetScreenWidth()*ps/2 - y = y*es - GetScreenHeight()*ps/2 - EavesDrop.db.profile.x, EavesDrop.db.profile.y = x, y + local es = EavesDropFrame:GetEffectiveScale() + local ps = UIParent:GetScale() + x = x*es - GetScreenWidth()*ps/2 + y = y*es - GetScreenHeight()*ps/2 + EavesDrop.db.profile.x, EavesDrop.db.profile.y = x, y @@ -606,7 +606,7 @@ - + @@ -694,27 +694,27 @@ + + + + + + + + + + + + + + + FauxScrollFrame_OnVerticalScroll(self, offset, 16, EavesDrop.ScrollBar_Update); + + + EavesDrop:ScrollBar_Update() + + + @@ -850,8 +850,8 @@ if ( self.tooltipText ) then - GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); - GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1); + GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); + GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1); end @@ -866,17 +866,17 @@ if (not EavesDrop.db.profile["LOCKED"] ) then - self:StartMoving(); - end + self:StartMoving(); + end self:StopMovingOrSizing(); local x, y = self:GetLeft(), self:GetTop() - local es = self:GetEffectiveScale() - local ps = UIParent:GetScale() - x = x*es - GetScreenWidth()*ps/2 - y = y*es - GetScreenHeight()*ps/2 - EavesDrop.db.profile.hx, EavesDrop.db.profile.hy = x, y + local es = self:GetEffectiveScale() + local ps = UIParent:GetScale() + x = x*es - GetScreenWidth()*ps/2 + y = y*es - GetScreenHeight()*ps/2 + EavesDrop.db.profile.hx, EavesDrop.db.profile.hy = x, y From c59ff25b454f1305908f998861bda657a72e9be5 Mon Sep 17 00:00:00 2001 From: Peter Holmberg Date: Tue, 18 May 2021 11:01:50 +0200 Subject: [PATCH 2/7] formatting --- EavesDrop.xml | 1746 +++++++++++++++++++++++++------------------------ 1 file changed, 878 insertions(+), 868 deletions(-) diff --git a/EavesDrop.xml b/EavesDrop.xml index 3322aa0..f953ede 100755 --- a/EavesDrop.xml +++ b/EavesDrop.xml @@ -1,883 +1,893 @@ - + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - self:SetBackdropColor(0, 0, 0, 0); - - - self:SetBackdropColor(1, 1, 1, 0.33); - GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); - GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1); - - - self:SetBackdropColor(0, 0, 0, 0); - GameTooltip:Hide(); - - - if button == "LeftButton" and IsShiftKeyDown() and self.tooltipText then - EavesDrop:SendToChat(self.tooltipText) - elseif IsAltKeyDown() then - if button == "LeftButton" then - EavesDrop:OpenMenu() - elseif button == "RightButton" then - EavesDrop:ShowHistory() - end - end - - - + + + + self:SetBackdropColor(0, 0, 0, 0); + + + self:SetBackdropColor(1, 1, 1, 0.33); + GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); + GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1); + + + self:SetBackdropColor(0, 0, 0, 0); + GameTooltip:Hide(); + + + if button == "LeftButton" and IsShiftKeyDown() and self.tooltipText then + EavesDrop:SendToChat(self.tooltipText) + elseif IsAltKeyDown() then + if button == "LeftButton" then + EavesDrop:OpenMenu() + elseif button == "RightButton" then + EavesDrop:ShowHistory() + end + end + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - self:SetBackdropColor(0, 0, 0, .33); - - - self:SetBackdropColor(1, 1, 1, 1); - if ( self.tooltipText ) then - GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); - GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1); - end - - - self:SetBackdropColor(0, 0, 0, .33); - GameTooltip:Hide(); - - - if button == "LeftButton" and IsShiftKeyDown() and self.tooltipText2 then - EavesDrop:SendToChat(self.tooltipText2) - elseif button == "RightButton" and IsShiftKeyDown() and self.tooltipText1 then - EavesDrop:SendToChat(self.tooltipText1) - end - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + self:SetBackdropColor(0, 0, 0, .33); + + + self:SetBackdropColor(1, 1, 1, 1); + if ( self.tooltipText ) then + GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); + GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1); + end + + + self:SetBackdropColor(0, 0, 0, .33); + GameTooltip:Hide(); + + + if button == "LeftButton" and IsShiftKeyDown() and self.tooltipText2 then + EavesDrop:SendToChat(self.tooltipText2) + elseif button == "RightButton" and IsShiftKeyDown() and self.tooltipText1 then + EavesDrop:SendToChat(self.tooltipText1) + end + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - - - EavesDrop:Scroll(self, delta); - - - EavesDropTab:SetAlpha(1); - - - EavesDropTab:SetAlpha(0); - - - if IsAltKeyDown() then - if button == "LeftButton" then - EavesDrop:OpenMenu() - elseif button == "RightButton" then - EavesDrop:ShowHistory() - end - end - - - + + + + EavesDrop:Scroll(self, delta); + + + EavesDropTab:SetAlpha(1); + + + EavesDropTab:SetAlpha(0); + + + if IsAltKeyDown() then + if button == "LeftButton" then + EavesDrop:OpenMenu() + elseif button == "RightButton" then + EavesDrop:ShowHistory() + end + end + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - self:RegisterForDrag("LeftButton"); - - - if (not EavesDrop.db.profile["LOCKED"] ) then - self:StartMoving(); - end - - - self:StopMovingOrSizing(); - local x, y = self:GetLeft(), self:GetTop() - local es = self:GetEffectiveScale() - local ps = UIParent:GetScale() - x = x*es - GetScreenWidth()*ps/2 - y = y*es - GetScreenHeight()*ps/2 - EavesDrop.db.profile.hx, EavesDrop.db.profile.hy = x, y - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + self:RegisterForDrag("LeftButton"); + + + if (not EavesDrop.db.profile["LOCKED"] ) then + self:StartMoving(); + end + + + self:StopMovingOrSizing(); + local x, y = self:GetLeft(), self:GetTop() + local es = self:GetEffectiveScale() + local ps = UIParent:GetScale() + x = x*es - GetScreenWidth()*ps/2 + y = y*es - GetScreenHeight()*ps/2 + EavesDrop.db.profile.hx, EavesDrop.db.profile.hy = x, y + + + From 56057c4d6547b8fe6556dd95648a42636f5a4fc0 Mon Sep 17 00:00:00 2001 From: Peter Holmberg Date: Tue, 18 May 2021 11:05:30 +0200 Subject: [PATCH 3/7] Revert "formatting" This reverts commit c59ff25b454f1305908f998861bda657a72e9be5. --- EavesDrop.xml | 1746 ++++++++++++++++++++++++------------------------- 1 file changed, 868 insertions(+), 878 deletions(-) diff --git a/EavesDrop.xml b/EavesDrop.xml index f953ede..3322aa0 100755 --- a/EavesDrop.xml +++ b/EavesDrop.xml @@ -1,893 +1,883 @@ - + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - self:SetBackdropColor(0, 0, 0, 0); - - - self:SetBackdropColor(1, 1, 1, 0.33); - GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); - GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1); - - - self:SetBackdropColor(0, 0, 0, 0); - GameTooltip:Hide(); - - - if button == "LeftButton" and IsShiftKeyDown() and self.tooltipText then - EavesDrop:SendToChat(self.tooltipText) - elseif IsAltKeyDown() then - if button == "LeftButton" then - EavesDrop:OpenMenu() - elseif button == "RightButton" then - EavesDrop:ShowHistory() - end - end - - - + + + + self:SetBackdropColor(0, 0, 0, 0); + + + self:SetBackdropColor(1, 1, 1, 0.33); + GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); + GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1); + + + self:SetBackdropColor(0, 0, 0, 0); + GameTooltip:Hide(); + + + if button == "LeftButton" and IsShiftKeyDown() and self.tooltipText then + EavesDrop:SendToChat(self.tooltipText) + elseif IsAltKeyDown() then + if button == "LeftButton" then + EavesDrop:OpenMenu() + elseif button == "RightButton" then + EavesDrop:ShowHistory() + end + end + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - self:SetBackdropColor(0, 0, 0, .33); - - - self:SetBackdropColor(1, 1, 1, 1); - if ( self.tooltipText ) then - GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); - GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1); - end - - - self:SetBackdropColor(0, 0, 0, .33); - GameTooltip:Hide(); - - - if button == "LeftButton" and IsShiftKeyDown() and self.tooltipText2 then - EavesDrop:SendToChat(self.tooltipText2) - elseif button == "RightButton" and IsShiftKeyDown() and self.tooltipText1 then - EavesDrop:SendToChat(self.tooltipText1) - end - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + self:SetBackdropColor(0, 0, 0, .33); + + + self:SetBackdropColor(1, 1, 1, 1); + if ( self.tooltipText ) then + GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); + GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1); + end + + + self:SetBackdropColor(0, 0, 0, .33); + GameTooltip:Hide(); + + + if button == "LeftButton" and IsShiftKeyDown() and self.tooltipText2 then + EavesDrop:SendToChat(self.tooltipText2) + elseif button == "RightButton" and IsShiftKeyDown() and self.tooltipText1 then + EavesDrop:SendToChat(self.tooltipText1) + end + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - - - EavesDrop:Scroll(self, delta); - - - EavesDropTab:SetAlpha(1); - - - EavesDropTab:SetAlpha(0); - - - if IsAltKeyDown() then - if button == "LeftButton" then - EavesDrop:OpenMenu() - elseif button == "RightButton" then - EavesDrop:ShowHistory() - end - end - - - + + + + EavesDrop:Scroll(self, delta); + + + EavesDropTab:SetAlpha(1); + + + EavesDropTab:SetAlpha(0); + + + if IsAltKeyDown() then + if button == "LeftButton" then + EavesDrop:OpenMenu() + elseif button == "RightButton" then + EavesDrop:ShowHistory() + end + end + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - self:RegisterForDrag("LeftButton"); - - - if (not EavesDrop.db.profile["LOCKED"] ) then - self:StartMoving(); - end - - - self:StopMovingOrSizing(); - local x, y = self:GetLeft(), self:GetTop() - local es = self:GetEffectiveScale() - local ps = UIParent:GetScale() - x = x*es - GetScreenWidth()*ps/2 - y = y*es - GetScreenHeight()*ps/2 - EavesDrop.db.profile.hx, EavesDrop.db.profile.hy = x, y - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + self:RegisterForDrag("LeftButton"); + + + if (not EavesDrop.db.profile["LOCKED"] ) then + self:StartMoving(); + end + + + self:StopMovingOrSizing(); + local x, y = self:GetLeft(), self:GetTop() + local es = self:GetEffectiveScale() + local ps = UIParent:GetScale() + x = x*es - GetScreenWidth()*ps/2 + y = y*es - GetScreenHeight()*ps/2 + EavesDrop.db.profile.hx, EavesDrop.db.profile.hy = x, y + + + From aa38a78fd040ef29bef25ae045c51c8a383dae04 Mon Sep 17 00:00:00 2001 From: Peter Holmberg Date: Tue, 18 May 2021 11:05:34 +0200 Subject: [PATCH 4/7] Revert "inherit BackdropTemplate" This reverts commit 76ad9bf6e08b32bb0b7e15e5fbda3df6174aebc8. --- .gitignore | 3 +- EavesDrop.xml | 168 +++++++++++++++++++++++++------------------------- 2 files changed, 85 insertions(+), 86 deletions(-) diff --git a/.gitignore b/.gitignore index c9377aa..a43a18f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ # Don't track content of these folders -.release/ -.idea/ +.release/ \ No newline at end of file diff --git a/EavesDrop.xml b/EavesDrop.xml index 3322aa0..4aa1ebf 100755 --- a/EavesDrop.xml +++ b/EavesDrop.xml @@ -2,10 +2,10 @@ - + - + @@ -96,21 +96,21 @@ GameTooltip:Hide(); - if button == "LeftButton" and IsShiftKeyDown() and self.tooltipText then - EavesDrop:SendToChat(self.tooltipText) - elseif IsAltKeyDown() then - if button == "LeftButton" then - EavesDrop:OpenMenu() - elseif button == "RightButton" then - EavesDrop:ShowHistory() - end - end + if button == "LeftButton" and IsShiftKeyDown() and self.tooltipText then + EavesDrop:SendToChat(self.tooltipText) + elseif IsAltKeyDown() then + if button == "LeftButton" then + EavesDrop:OpenMenu() + elseif button == "RightButton" then + EavesDrop:ShowHistory() + end + end - + @@ -164,8 +164,8 @@ self:SetBackdropColor(1, 1, 1, 1); if ( self.tooltipText ) then - GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); - GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1); + GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); + GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1); end @@ -173,11 +173,11 @@ GameTooltip:Hide(); - if button == "LeftButton" and IsShiftKeyDown() and self.tooltipText2 then - EavesDrop:SendToChat(self.tooltipText2) - elseif button == "RightButton" and IsShiftKeyDown() and self.tooltipText1 then - EavesDrop:SendToChat(self.tooltipText1) - end + if button == "LeftButton" and IsShiftKeyDown() and self.tooltipText2 then + EavesDrop:SendToChat(self.tooltipText2) + elseif button == "RightButton" and IsShiftKeyDown() and self.tooltipText1 then + EavesDrop:SendToChat(self.tooltipText1) + end @@ -191,8 +191,8 @@ if ( self.tooltipText ) then - GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); - GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1); + GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); + GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1); end @@ -202,7 +202,7 @@ - + @@ -394,12 +394,12 @@ PlaySound(SOUNDKIT.IG_CHAT_SCROLL_DOWN); if IsShiftKeyDown() then - EavesDrop:ScrollToBottom() - elseif IsControlKeyDown() then - EavesDrop:FindCombatDown() - else - EavesDrop:ScrollDown() - end + EavesDrop:ScrollToBottom() + elseif IsControlKeyDown() then + EavesDrop:FindCombatDown() + else + EavesDrop:ScrollDown() + end GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); @@ -429,14 +429,14 @@ - PlaySound(SOUNDKIT.IG_CHAT_SCROLL_UP); - if IsShiftKeyDown() then - EavesDrop:ScrollToTop() - elseif IsControlKeyDown() then - EavesDrop:FindCombatUp() - else - EavesDrop:ScrollUp() - end + PlaySound(SOUNDKIT.IG_CHAT_SCROLL_UP); + if IsShiftKeyDown() then + EavesDrop:ScrollToTop() + elseif IsControlKeyDown() then + EavesDrop:FindCombatUp() + else + EavesDrop:ScrollUp() + end GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); @@ -464,13 +464,13 @@ EavesDropTab:SetAlpha(0); - if IsAltKeyDown() then - if button == "LeftButton" then - EavesDrop:OpenMenu() - elseif button == "RightButton" then - EavesDrop:ShowHistory() - end - end + if IsAltKeyDown() then + if button == "LeftButton" then + EavesDrop:OpenMenu() + elseif button == "RightButton" then + EavesDrop:ShowHistory() + end + end @@ -524,9 +524,9 @@ GameTooltip:Hide(); - if button == "RightButton" then - EavesDrop:OpenMenu() - end + if button == "RightButton" then + EavesDrop:OpenMenu() + end EavesDropTab:SetAlpha(1); @@ -539,17 +539,17 @@ if (not EavesDrop.db.profile["LOCKED"] ) then - EavesDropFrame:StartMoving(); - end + EavesDropFrame:StartMoving(); + end EavesDropFrame:StopMovingOrSizing(); local x, y = EavesDropFrame:GetLeft(), EavesDropFrame:GetTop() - local es = EavesDropFrame:GetEffectiveScale() - local ps = UIParent:GetScale() - x = x*es - GetScreenWidth()*ps/2 - y = y*es - GetScreenHeight()*ps/2 - EavesDrop.db.profile.x, EavesDrop.db.profile.y = x, y + local es = EavesDropFrame:GetEffectiveScale() + local ps = UIParent:GetScale() + x = x*es - GetScreenWidth()*ps/2 + y = y*es - GetScreenHeight()*ps/2 + EavesDrop.db.profile.x, EavesDrop.db.profile.y = x, y @@ -606,7 +606,7 @@ - + @@ -694,27 +694,27 @@ + + + + + + + + + + + + + + + FauxScrollFrame_OnVerticalScroll(self, offset, 16, EavesDrop.ScrollBar_Update); + + + EavesDrop:ScrollBar_Update() + + + @@ -850,8 +850,8 @@ if ( self.tooltipText ) then - GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); - GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1); + GameTooltip:SetOwner(self, EavesDrop.ToolTipAnchor); + GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1); end @@ -866,17 +866,17 @@ if (not EavesDrop.db.profile["LOCKED"] ) then - self:StartMoving(); - end + self:StartMoving(); + end self:StopMovingOrSizing(); local x, y = self:GetLeft(), self:GetTop() - local es = self:GetEffectiveScale() - local ps = UIParent:GetScale() - x = x*es - GetScreenWidth()*ps/2 - y = y*es - GetScreenHeight()*ps/2 - EavesDrop.db.profile.hx, EavesDrop.db.profile.hy = x, y + local es = self:GetEffectiveScale() + local ps = UIParent:GetScale() + x = x*es - GetScreenWidth()*ps/2 + y = y*es - GetScreenHeight()*ps/2 + EavesDrop.db.profile.hx, EavesDrop.db.profile.hy = x, y From ec7c37b0b37651fef7a4986d120308d49be5d843 Mon Sep 17 00:00:00 2001 From: Peter Holmberg Date: Tue, 18 May 2021 11:07:29 +0200 Subject: [PATCH 5/7] inherits BackdropTemplate --- .gitignore | 3 ++- EavesDrop.xml | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index a43a18f..c9377aa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ # Don't track content of these folders -.release/ \ No newline at end of file +.release/ +.idea/ diff --git a/EavesDrop.xml b/EavesDrop.xml index 4aa1ebf..9e1c9c8 100755 --- a/EavesDrop.xml +++ b/EavesDrop.xml @@ -5,7 +5,7 @@ - + @@ -110,7 +110,7 @@ - + @@ -202,7 +202,7 @@ - + @@ -606,7 +606,7 @@ - + From 92d8c5a96f4d3e8cfc9ddcec1e309cf396a1390b Mon Sep 17 00:00:00 2001 From: Peter Holmberg Date: Fri, 26 Aug 2022 22:52:47 +0200 Subject: [PATCH 6/7] shortenValue always return string --- .idea/workspace.xml | 45 +++++++++++++++++++++++++++++++++++++++++++++ EavesDrop.lua | 16 ++++++++-------- 2 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..344c98f --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + 1621327559037 + + + + + + \ No newline at end of file diff --git a/EavesDrop.lua b/EavesDrop.lua index 1c5925d..76b099a 100755 --- a/EavesDrop.lua +++ b/EavesDrop.lua @@ -154,7 +154,7 @@ local function shortenValue(value) elseif value >= 10000 then value = string_format("%.1fk",value / 1000) end - return value + return tostring(value) end local function round(num, idp) @@ -483,9 +483,9 @@ function EavesDrop:CombatEvent() if (critical) then text = critchar..text..critchar end if (crushing) then text = crushchar..text..crushchar end if (glancing) then text = glancechar..text..glancechar end - if (resisted) then text = string_format("%s (%d)", text, shortenValue(resisted)) end - if (blocked) then text = string_format("%s (%d)", text, shortenValue(blocked)) end - if (absorbed) then text = string_format("%s (%d)", text, shortenValue(absorbed))end + if (resisted) then text = string_format("%s (%s)", text, shortenValue(resisted)) end + if (blocked) then text = string_format("%s (%s)", text, shortenValue(blocked)) end + if (absorbed) then text = string_format("%s (%s)", text, shortenValue(absorbed))end if fromPlayer then if (self:TrackStat(inout, "hit", spellName, texture, SCHOOL_STRINGS[school], amount, critical, message)) then @@ -531,7 +531,7 @@ function EavesDrop:CombatEvent() if toPlayer then totHealingIn = totHealingIn + amount if (amount < db["HFILTER"]) then return end - if (db["OVERHEAL"]) and overHeal > 0 then text = string_format("%d {%d}", shortenValue(amount-overHeal), shortenValue(overHeal)) end + if (db["OVERHEAL"]) and overHeal > 0 then text = string_format("%s {%s}", shortenValue(amount-overHeal), shortenValue(overHeal)) end if (critical) then text = critchar..text..critchar end if (db["HEALERID"] == true and not fromPlayer) then text = text.." ("..sourceName..")" end color = db["PHEAL"] @@ -542,7 +542,7 @@ function EavesDrop:CombatEvent() elseif fromPlayer then totHealingOut = totHealingOut + amount if (amount < db["HFILTER"]) then return end - if (db["OVERHEAL"]) and overHeal > 0 then text = string_format("%d {%d}", shortenValue(amount-overHeal), shortenValue(overHeal)) end + if (db["OVERHEAL"]) and overHeal > 0 then text = string_format("%s {%s}", shortenValue(amount-overHeal), shortenValue(overHeal)) end if (critical) then text = critchar..text..critchar end color = db["THEAL"] if (self:TrackStat(inout, "heal", spellName, texture, SCHOOL_STRINGS[spellSchool], amount, critical, message)) then @@ -630,7 +630,7 @@ end function EavesDrop:PLAYER_XP_UPDATE() local xp = UnitXP("player") local xpgained = xp - pxp - self:DisplayEvent(MISC, string_format("+%d (%s)", shortenValue(xpgained), XP), nil, db["EXPC"], nil) + self:DisplayEvent(MISC, string_format("+%s (%s)", shortenValue(xpgained), XP), nil, db["EXPC"], nil) pxp = xp end @@ -990,7 +990,7 @@ function EavesDrop:ParseReflect(timestamp, event, hideCaster, sourceGUID, source --reflected events if (self.ReflectTarget == sourceName and sourceName == destName and self.ReflectSkill == spellName) then - local text = string_format("%s: %d", REFLECT, shortenValue(amount)) + local text = string_format("%s: %s", REFLECT, shortenValue(amount)) if (critical) then text = critchar..text..critchar end self:DisplayEvent(OUTGOING, text, texture, self:SpellColor(db["TSPELL"], SCHOOL_STRINGS[school]), messsage) self:ClearReflect() From 17fdd4b93fd665c29c2ae007e31027337ae959ea Mon Sep 17 00:00:00 2001 From: Peter Holmberg Date: Wed, 31 Aug 2022 18:26:47 +0200 Subject: [PATCH 7/7] use spellname --- EavesDrop.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/EavesDrop.lua b/EavesDrop.lua index 76b099a..a10955f 100755 --- a/EavesDrop.lua +++ b/EavesDrop.lua @@ -475,7 +475,7 @@ function EavesDrop:CombatEvent() outtype, intype = "TSPELL", "PSPELL" else spellId, spellName, spellSchool, amount, overDamage, school, resisted, blocked, absorbed, critical, glancing, crushing = a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12 - texture = select(3, GetSpellInfo(spellId)) + texture = select(3, GetSpellInfo(spellName)) outtype, intype = "TSPELL", "PSPELL" end text = tostring(shortenValue(amount)) @@ -509,7 +509,7 @@ function EavesDrop:CombatEvent() ------------buff/debuff gain---------------- elseif etype == "BUFF" then spellId, spellName, spellSchool, auraType, amount = a1, a2, a3, a4, a5 - texture = select(3, GetSpellInfo(spellId)) + texture = select(3, GetSpellInfo(spellName)) if toPlayer and db[auraType] then self:DisplayEvent(INCOMING, self:ShortenString(spellName), texture, db["P"..auraType], message) else return @@ -517,7 +517,7 @@ function EavesDrop:CombatEvent() ------------buff/debuff lose---------------- elseif etype == "FADE" then spellId, spellName, spellSchool, auraType, amount = a1, a2, a3, a4, a5 - texture = select(3, GetSpellInfo(spellId)) + texture = select(3, GetSpellInfo(spellName)) if toPlayer and db[auraType.."FADE"] then self:DisplayEvent(INCOMING, self:ShortenString(spellName).." "..L["Fades"], texture, db["P"..auraType], message) else return @@ -526,7 +526,7 @@ function EavesDrop:CombatEvent() elseif etype == "HEAL" then spellId, spellName, spellSchool, amount, overHeal, absorbed, critical = a1, a2, a3, a4, a5, a6, a7 text = tostring(shortenValue(amount)) - texture = select(3, GetSpellInfo(spellId)) + texture = select(3, GetSpellInfo(spellName)) if toPlayer then totHealingIn = totHealingIn + amount @@ -560,7 +560,7 @@ function EavesDrop:CombatEvent() tcolor = "TMELEE" else spellId, spellName, spellSchool, missType = a1, a2, a3, a4 - texture = select(3, GetSpellInfo(spellId)) + texture = select(3, GetSpellInfo(spellName)) tcolor = "TSPELL" end text = _G[missType] @@ -577,7 +577,7 @@ function EavesDrop:CombatEvent() elseif etype == "DRAIN" then if (db["GAINS"]) then spellId, spellName, spellSchool, amount, powerType, extraAmount = a1, a2, a3, a4, a5, a6 - texture = select(3, GetSpellInfo(spellId)) + texture = select(3, GetSpellInfo(spellName)) if toPlayer then text = string_format("-%d %s", amount, string_nil("")) color = db["PGAIN"] @@ -597,7 +597,7 @@ function EavesDrop:CombatEvent() elseif etype == "POWER" then if (db["GAINS"]) then spellId, spellName, spellSchool, amount, powerType = a1, a2, a3, a4, a5 - texture = select(3, GetSpellInfo(spellId)) + texture = select(3, GetSpellInfo(spellName)) if toPlayer then if (amount < db["MFILTER"]) then return end color = db["PGAIN"] @@ -984,7 +984,7 @@ end --Set last reflection function EavesDrop:ParseReflect(timestamp, event, hideCaster, sourceGUID, sourceName, sourceFlags, sourceFlags2, destGUID, destName, destFlags, destFlags2, ...) local spellId, spellName, spellSchool, amount, school, resisted, blocked, absorbed, critical, glancing, crushing = ... - local texture = select(3, GetSpellInfo(spellId)) + local texture = select(3, GetSpellInfo(spellName)) local text = amount local messsage = CombatLog_OnEvent(Blizzard_CombatLog_CurrentSettings, timestamp, event, hideCaster, sourceGUID, sourceName, sourceFlags, sourceFlags2, destGUID, destName, destFlags, destFlags2, ...)