Skip to content

Commit

Permalink
v1.7.8
Browse files Browse the repository at this point in the history
  • Loading branch information
d4kir92 committed Aug 23, 2024
1 parent c11e864 commit 30fe4fd
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 29 deletions.
2 changes: 1 addition & 1 deletion MoveAny.toc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion MoveAny_Cata.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion MoveAny_TBC.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion MoveAny_Vanilla.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion MoveAny_Wrath.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 2 additions & 6 deletions libs/D4Lib/D4Translations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
15 changes: 14 additions & 1 deletion registerwidgets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down
63 changes: 46 additions & 17 deletions settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 30fe4fd

Please sign in to comment.