Skip to content

Commit

Permalink
Add button to reset status frame position
Browse files Browse the repository at this point in the history
  • Loading branch information
tekkub committed Nov 2, 2008
1 parent bce3188 commit d8b2e3f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 10 additions & 0 deletions Config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local TourGuide = TourGuide
local L = TourGuide.Locale
local GAP = 8
local tekcheck = LibStub("tekKonfig-Checkbox")
local tekbutton = LibStub("tekKonfig-Button")


local frame = CreateFrame("Frame", nil, InterfaceOptionsFramePanelContainer)
Expand All @@ -24,6 +25,15 @@ frame:SetScript("OnShow", function()
showstatusframe:SetScript("OnClick", function(self) checksound(self); TourGuide.db.char.showstatusframe = not TourGuide.db.char.showstatusframe; TourGuide:PositionStatusFrame() end)
showstatusframe:SetChecked(TourGuide.db.char.showstatusframe)

local resetpos = tekbutton.new_small(frame, "TOP", showstatusframe, "CENTER", 0, 11)
resetpos:SetPoint("RIGHT", -16, 0)
resetpos:SetText("Reset")
resetpos.tiptext = L["Reset the status frame to the default position"]
resetpos:SetScript("OnClick", function(self)
TourGuide.db.profile.statusframepoint, TourGuide.db.profile.statusframex, TourGuide.db.profile.statusframey = nil
TourGuide.statusframe:SetPoint("BOTTOMRIGHT", QuestWatchFrame, "TOPRIGHT", -60, -15)
end)

local mapnotecoords = tekcheck.new(frame, nil, L["Map note coords"], "TOPLEFT", showstatusframe, "BOTTOMLEFT", 0, -GAP)
mapnotecoords.tiptext = L["Map coordinates found in tooltip notes (requires TomTom)."]
mapnotecoords:SetScript("OnClick", function(self) checksound(self); TourGuide.db.char.mapnotecoords = not TourGuide.db.char.mapnotecoords end)
Expand Down
5 changes: 3 additions & 2 deletions StatusFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ end

local f = CreateFrame("Button", nil, UIParent)
TourGuide.statusframe = f
f:SetPoint("BOTTOMRIGHT", QuestWatchFrame, "TOPRIGHT", -60, -15)
f:SetHeight(24)
f:SetFrameStrata("LOW")
f:EnableMouse(true)
Expand Down Expand Up @@ -72,9 +71,11 @@ end)


function TourGuide:PositionStatusFrame()
f:ClearAllPoints()
if self.db.profile.statusframepoint then
f:ClearAllPoints()
f:SetPoint(self.db.profile.statusframepoint, self.db.profile.statusframex, self.db.profile.statusframey)
else
f:SetPoint("BOTTOMRIGHT", QuestWatchFrame, "TOPRIGHT", -60, -15)
end

if self.db.char.showstatusframe then f:Show() else f:Hide() end
Expand Down

0 comments on commit d8b2e3f

Please sign in to comment.