WoWInterface SVN TipTop

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 110 to Rev 111
    Reverse comparison

Rev 110 → Rev 111

trunk/TipTop/TipTopOptions.lua
49,6 → 49,7
factionIconY = "-4",
onCursor = false,
anchor = "BOTTOMRIGHT",
anchorTo = "BOTTOMRIGHT",
offsetX = "-2",
offsetY = "109",
showTargetText = true,
87,15 → 88,15
end
end
 
local function CreateMover()
--mover = CreateFrame("Frame", nil, UIParent)
mover = CreateFrame("Frame", "TipTopMover", UIParent)
mover:SetSize(200, 100)
mover:SetPoint(db.anchor, UIParent, db.anchor, db.offsetX, db.offsetY)
local function SetUpMover()
mover.t = mover:CreateTexture()
mover.t:SetAllPoints()
mover.t:SetTexture("Interface\\Buttons\\WHITE8x8")
mover.t:SetVertexColor(0,0,1,.4)
mover.t:SetColorTexture(0,0,1,.4)
mover.l = mover:CreateLine()
mover.l:SetThickness(1)
mover.l:SetStartPoint("CENTER", mover)
mover.l:SetEndPoint(db.anchor, mover)
mover.l:SetColorTexture(1,1,1,1)
mover:EnableMouse(true)
mover:SetMovable(true)
mover:SetClampedToScreen(true)
108,7 → 109,7
button1 = "Save",
button2 = "Cancel",
OnAccept = function()
db.anchor, _, _, x, y = mover:GetPoint()
db.anchorTo, _, _, x, y = mover:GetPoint()
db.offsetX, db.offsetY = tostring(x), tostring(y)
mover:Hide()
InterfaceOptionsFrame:Show()
254,8 → 255,8
order = 10,
},
anchor = {
name = "Anchor To...",
desc = "What side of the screen you would like the tooltip located at.",
name = "Grow from...",
desc = "What side/corner of the tooltip you would like it to expand from.",
type = "select",
disabled = function() return db.onCursor end,
values = positions,
268,13 → 269,32
end,
set = function(_, anchor)
db.anchor = positions[anchor]
mover.l:SetEndPoint(db.anchor, mover)
end,
order = 11,
},
anchorTo = {
name = "Anchor To...",
desc = "What side of the screen you would like the tooltip located at.",
type = "select",
disabled = function() return db.onCursor end,
values = positions,
get = function()
for k, v in pairs(positions) do
if db.anchorTo == v then
return k
end
end
end,
set = function(_, anchorTo)
db.anchorTo = positions[anchorTo]
end,
order = 12,
},
empty1 = {
name = " ",
type = "description",
order = 12,
order = 13,
},
offsetX = {
name = "X Offset",
288,7 → 308,7
end
db.offsetX = offsetX
end,
order = 13,
order = 14,
},
offsetY = {
name = "Y Offset",
302,26 → 322,24
end
db.offsetY = offsetY
end,
order = 14,
order = 15,
},
mover = {
name = "Draggable Mover",
desc = "Shows an anchor to move the tooltip's position.",
desc = "Shows an anchor to move the tooltip's position. The line shows from which side/corner the tooltip will grow from.",
type = "execute",
disabled = function() return db.onCursor end,
func = function()
print("clicked button")
InterfaceOptionsFrame:Hide()
if not mover then
print("creating mover")
CreateMover()
if not mover.t then
SetUpMover()
end
mover:ClearAllPoints()
mover:SetPoint(db.anchor, UIParent, db.anchor, db.offsetX, db.offsetY)
mover:SetPoint(db.anchorTo, UIParent, db.anchorTo, db.offsetX, db.offsetY)
mover:Show()
StaticPopup_Show("TIPTOP_MOVER")
end,
order = 15,
order = 16,
},
},
},
975,6 → 993,13
local function OnInitialize()
SetUpDB()
 
--create mover to anchor the tooltip to
mover = CreateFrame("Frame", "TipTopMover", UIParent)
TipTop.mover = mover
mover:SetSize(200, 100)
mover:SetPoint(db.anchorTo, UIParent, db.anchorTo, db.offsetX, db.offsetY)
 
 
LibStub("AceConfig-3.0"):RegisterOptionsTable("TipTop", options)
TipTop.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("TipTop", "TipTop", nil, "general")
TipTop.optionsFrame.baropts = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("TipTop", "Health Bar", "TipTop", "baropts")
trunk/TipTop/tiptop.lua
541,13 → 541,14
end
 
--moves tooltip
local mover = TipTop.mover
hooksecurefunc("GameTooltip_SetDefaultAnchor", function (tooltip, parent)
if db.onCursor then
tooltip:SetOwner(parent, "ANCHOR_CURSOR")
else
tooltip:SetOwner(parent, "ANCHOR_NONE")
tooltip:ClearAllPoints()
tooltip:SetPoint(db.anchor, UIParent, db.anchor, db.offsetX, db.offsetY)
tooltip:SetPoint(db.anchor, mover)
end
end)
 
575,6 → 576,26
end
ttSBar:HookScript("OnValueChanged", CalcHealth)
ttSBar:HookScript("OnUpdate", TargetTextUpdate)
local timer, hasUnit = 0, false
tt:HookScript("OnUpdate", function(self, elapsed) --hack to fix when the background doesn't resize correctly (when the tooltip's or bg's OnShow isn't fired)
if timer >= .5 and db.insideBar then
if self:GetUnit() then
if not hasUnit then --if I didn't have a unit before but do now
BGPosition()
hasUnit = true
end
else
if hasUnit then --if I did have a unit and don't anymore
TipTop:ClearAllPoints()
TipTop:SetAllPoints(tt)
TipTop:SetBackdropBorderColor(db.borderColor.r, db.borderColor.g, db.borderColor.b, db.borderColor.a)
hasUnit = false
end
end
timer = 0
end
timer = timer + elapsed
end)
 
PlayerLogin = nil --let this function be garbage collected
end
trunk/TipTop/TipTop.toc
1,8 → 1,8
## Interface: 70300
## Interface: 80000
## Title: TipTop
## Author: Seerah
## Notes: Tooltip enhancement
## Version: 2.19.3
## Version: 2.20
## SavedVariables: TipTopDB
## SavedVariablesPerCharacter: TipTopPCDB
## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets