/trunk/Who Framed Watcher Wabbit
## Interface: 50100 |
## Name: Who Framed Watcher Wabbit? |
## Version: 1.8 |
## Version: 1.8.1 |
## Notes: Various tweaks to improve the quest watch frame |
## SavedVariables: WFWWDB |
## SavedVariablesPerCharacter: WFWWPCDB |
WatchFrameTitle:SetParent(WFContainer) |
WatchFrameCollapseExpandButton:SetParent(WFContainer) |
WatchFrameCollapseExpandButton:Raise() --let us click it even if header tex is too big |
WatchFrameCollapseExpandButton:Raise() --let us click it even if header text is too big |
WatchFrameTitle:Show() |
WatchFrameCollapseExpandButton:Show() |
WatchFrameTitle.Hide = function() end |
WatchFrameCollapseExpandButton.Hide = function() end |
WatchFrameCollapseExpandButton.Hide = function() WatchFrameTitle:SetText(OBJECTIVES_TRACKER_LABEL)end |
WatchFrameCollapseExpandButton:Enable() |
WatchFrameCollapseExpandButton.Disable = function() end |
if WFWWPCDB.collapsed then --remember if watchframe was collapsed on last logout |
end |
WatchFrameCollapseExpandButton:RegisterForClicks("AnyDown") |
WatchFrameCollapseExpandButton:SetScript("OnClick", function(self,btn) --redo this to allow for modified clicks |
WatchFrameCollapseExpandButton:SetScript("OnClick", function(self,btn) |
if IsShiftKeyDown() then |
ToggleAchievementFrame() |
elseif IsAltKeyDown() then |
ToggleFrame(QuestLogFrame) |
else |
WatchFrame_CollapseExpandButton_OnClick() --default function called by OnClick |
if WatchFrame.userCollapsed then --my original hook |
if not WFWWPCDB.collapsed then --if the container's not collapsed, collapse it |
WFContainer:SetHeight(30) |
WFContainer:SetWidth(150) |
WFWWPCDB.collapsed = true |
end |
end |
end) |
--keep the watch frame and container in sync with each other |
hooksecurefunc("WatchFrame_Expand", function(self) |
if WFWWPCDB.collapsed and GetNumAutoQuestPopUps() == 0 then |
WatchFrame_Collapse(self) |
end |
end) |
WatchFrameCollapseExpandButton:SetScript("OnEnter", function(self) |
GameTooltip:SetOwner(self, "ANCHOR_TOP") |
GameTooltip:AddLine("Who Framed Watcher Wabbit?",1,1,1) |
local f = CreateFrame("Frame") --need to create a slight delay to get rid of errors and glitches |
f:Hide() |
f.elapsed = 0 |
f:SetScript("OnUpdate", function(self, elapsed) |
--[[f:SetScript("OnUpdate", function(self, elapsed) |
f.elapsed = f.elapsed + elapsed |
if f.elapsed > .5 then |
SetUpContainer() |
f:Hide() |
end |
end) |
end)]] |
WFContainer:SetScript("OnEvent", function() |
Initialize() |
SetUpContainer() --see if we can get away with this here now |
f:Show() |
end) |