diff --git a/MoveAny.toc b/MoveAny.toc index 7964bf2..260af62 100644 --- a/MoveAny.toc +++ b/MoveAny.toc @@ -4,7 +4,7 @@ ## Interface-Cata: 40400 ## Interface: 110002 -## Version: 1.7.7 +## Version: 1.7.8 ## Title: MoveAny by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Move Any Ui or Frame ## Author: D4KiR diff --git a/MoveAny_Cata.toc b/MoveAny_Cata.toc index c2b075d..ec7e800 100644 --- a/MoveAny_Cata.toc +++ b/MoveAny_Cata.toc @@ -1,5 +1,5 @@ ## Interface: 40400 -## Version: 1.7.7 +## Version: 1.7.8 ## Title: MoveAny |T135994:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Move Any Ui or Frame ## Author: D4KiR diff --git a/MoveAny_TBC.toc b/MoveAny_TBC.toc index 9423ccb..0a6c2dd 100644 --- a/MoveAny_TBC.toc +++ b/MoveAny_TBC.toc @@ -1,5 +1,5 @@ ## Interface: 20504 -## Version: 1.7.7 +## Version: 1.7.8 ## Title: MoveAny |T135994:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Move Any Ui or Frame ## Author: D4KiR diff --git a/MoveAny_Vanilla.toc b/MoveAny_Vanilla.toc index 30a2fee..5e234fd 100644 --- a/MoveAny_Vanilla.toc +++ b/MoveAny_Vanilla.toc @@ -1,5 +1,5 @@ ## Interface: 11503 -## Version: 1.7.7 +## Version: 1.7.8 ## Title: MoveAny |T135994:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Move Any Ui or Frame ## Author: D4KiR diff --git a/MoveAny_Wrath.toc b/MoveAny_Wrath.toc index 8fce31f..84f955f 100644 --- a/MoveAny_Wrath.toc +++ b/MoveAny_Wrath.toc @@ -1,5 +1,5 @@ ## Interface: 30403 -## Version: 1.7.7 +## Version: 1.7.8 ## Title: MoveAny |T135994:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Move Any Ui or Frame ## Author: D4KiR diff --git a/libs/D4Lib/D4Translations.lua b/libs/D4Lib/D4Translations.lua index 78e7a1a..07c9511 100644 --- a/libs/D4Lib/D4Translations.lua +++ b/libs/D4Lib/D4Translations.lua @@ -17,13 +17,9 @@ function D4:Trans(key, lang, t1, t2, t3) if t1 and t2 and t3 then result = string.format(result, t1, t2, t3) - end - - if t1 and t2 then + elseif t1 and t2 then result = string.format(result, t1, t2) - end - - if t1 then + elseif t1 then result = string.format(result, t1) end diff --git a/registerwidgets.lua b/registerwidgets.lua index 3eb55ae..6e70a1c 100644 --- a/registerwidgets.lua +++ b/registerwidgets.lua @@ -1469,6 +1469,7 @@ local incombat = nil local inpetbattle = nil local isstealthed = nil local ischatclosed = nil +local lastchatab = nil local lastEle = nil local lastSize = 0 local fullHP = false @@ -1497,12 +1498,21 @@ end function MoveAny:IsChatClosed() for i = 1, 12 do - if _G["ChatFrame" .. i .. "EditBox"] and _G["ChatFrame" .. i .. "EditBox"]:GetText() ~= "" then return false end + if _G["ChatFrame" .. i .. "EditBox"] and _G["ChatFrame" .. i .. "EditBox"]:HasFocus() then return false end end return true end +function MoveAny:CurrentChatTab() + for i = 1, 12 do + local ct = _G["ChatFrame" .. i .. "EditBox"] + if ct and ct:IsShown() then return i end + end + + return 0 +end + function MoveAny:CheckAlphas() if incombat ~= InCombatLockdown() then incombat = InCombatLockdown() @@ -1530,6 +1540,9 @@ function MoveAny:CheckAlphas() if ischatclosed then MoveAny:UpdateAlphas() end + elseif MoveAny.CurrentChatTab and lastchatab ~= MoveAny:CurrentChatTab() then + lastchatab = MoveAny:CurrentChatTab() + MoveAny:UpdateAlphas() end if lastSize ~= getn(MoveAny:GetAlphaFrames()) then diff --git a/settings.lua b/settings.lua index 07d0c1e..964b87b 100644 --- a/settings.lua +++ b/settings.lua @@ -469,8 +469,8 @@ function MoveAny:InitMALock() end ) - MoveAny:SetVersion(AddonName, 135994, "1.7.7") - MALock.TitleText:SetText(format("MoveAny |T135994:16:16:0:0|t v|cff3FC7EB%s", "1.7.7")) + MoveAny:SetVersion(AddonName, 135994, "1.7.8") + MALock.TitleText:SetText(format("MoveAny |T135994:16:16:0:0|t v|cff3FC7EB%s", "1.7.8")) MALock.CloseButton:SetScript( "OnClick", function() @@ -1082,7 +1082,7 @@ function MoveAny:ShowProfiles() end ) - MAProfiles.TitleText:SetText(format("MoveAny |T135994:16:16:0:0|t v|cff3FC7EB%s", "1.7.7")) + MAProfiles.TitleText:SetText(format("MoveAny |T135994:16:16:0:0|t v|cff3FC7EB%s", "1.7.8")) MAProfiles.CloseButton:SetScript( "OnClick", function() @@ -3041,26 +3041,55 @@ function MoveAny:LoadAddon() end if MoveAny:IsEnabled("CHATEDITBOX", false) then - local ceb = _G["ChatFrame" .. 1 .. "EditBox"] - if ceb then - hooksecurefunc( - ceb, - "SetClampRectInsets", - function(sel) - if sel.setclamprectinsets_ma then return end - sel.setclamprectinsets_ma = true - sel:SetClampRectInsets(2, 2, 2, 2) - sel.setclamprectinsets_ma = false - end - ) + for i = 1, 12 do + local ceb = _G["ChatFrame" .. i .. "EditBox"] + if ceb then + hooksecurefunc( + ceb, + "SetClampRectInsets", + function(sel) + if sel.setclamprectinsets_ma then return end + sel.setclamprectinsets_ma = true + sel:SetClampRectInsets(2, 2, 2, 2) + sel.setclamprectinsets_ma = false + end + ) - ceb:SetClampRectInsets(2, 2, 2, 2) + ceb:SetClampRectInsets(2, 2, 2, 2) + if i > 1 then + local cebPoint = "SetPoint" + if ceb.SetPointBase then + cebPoint = "SetPointBase" + end + + hooksecurefunc( + ceb, + cebPoint, + function(sel) + if sel.ma_setpo then return end + sel.ma_setpo = true + MoveAny:SetPoint(sel, "CENTER", _G["ChatFrame" .. 1 .. "EditBox"], "CENTER", 0, 0) + sel.ma_setpo = false + end + ) + + MoveAny:SetPoint(ceb, "CENTER", _G["ChatFrame" .. 1 .. "EditBox"], "CENTER", 0, 0) + end + end end MoveAny:RegisterWidget( { ["name"] = "ChatFrame" .. 1 .. "EditBox", ["lstr"] = "LID_CHATEDITBOX", + ["setup"] = function() + for i = 2, 12 do + if _G["ChatFrame" .. i .. "EditBox"] then + tinsert(MoveAny:GetAlphaFrames(), _G["ChatFrame" .. i .. "EditBox"]) + MoveAny:AddFrameName(_G["ChatFrame" .. i .. "EditBox"], "ChatFrame" .. 1 .. "EditBox") + end + end + end } ) end @@ -4784,7 +4813,7 @@ function MoveAny:LoadAddon() ["name"] = "MoveAny", ["icon"] = 135994, ["dbtab"] = CVTAB, - ["vTT"] = {{"MoveAny |T135994:16:16:0:0|t", "v|cff3FC7EB1.7.7"}, {MoveAny:GT("LID_LEFTCLICK"), MoveAny:GT("LID_MMBTNLEFT")}, {MoveAny:GT("LID_RIGHTCLICK"), MoveAny:GT("LID_MMBTNRIGHT")}}, + ["vTT"] = {{"MoveAny |T135994:16:16:0:0|t", "v|cff3FC7EB1.7.8"}, {MoveAny:GT("LID_LEFTCLICK"), MoveAny:GT("LID_MMBTNLEFT")}, {MoveAny:GT("LID_RIGHTCLICK"), MoveAny:GT("LID_MMBTNRIGHT")}}, ["funcL"] = function() MoveAny:ToggleMALock() end,