Skip to content

Commit

Permalink
Refactor the select() shim so it uses a vararg and can take an arbitr…
Browse files Browse the repository at this point in the history
…ary number of arguments.

Fix a frame reference error in new Options as well the sv reference.
Add the new Guides List frame to special frames so it also closes with Esc.
  • Loading branch information
Road-block committed Oct 18, 2016
1 parent 2632729 commit 55bc4b4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions GuideListFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ end)

ww.SetFadeTime(frame, 0.7)

table.insert(UISpecialFrames, "TourGuideGuideList")
--[[
function TourGuide:CreateGuideListPanel()
frame = CreateFrame("Frame", nil, UIParent)
Expand Down
4 changes: 2 additions & 2 deletions OptionsFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ trackquestcheck.text:SetText("Automatically Track Quests")
ww.SetFadeTime(frame, 0.7)

trackquestcheck:SetScript("OnClick", function()
self.db.char.trackquests = not self.db.char.trackquests
TourGuide.db.char.trackquests = not TourGuide.db.char.trackquests
end)

trackquestcheck:SetScript("OnShow", function()
f = f or this
qtrack:SetChecked(self.db.char.trackquests)
f:SetChecked(TourGuide.db.char.trackquests)
f:SetAlpha(0)
f:SetScript("OnUpdate", ww.FadeIn)
end)
Expand Down
10 changes: 5 additions & 5 deletions lua52to50compat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
]]
local _G = getfenv(0)
if not _G.select then
select = function(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20)
local tab = {a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20}
if index == "#" then return table.getn(tab) end
select = function(index,...)
assert(tonumber(index) or index=="#","Invalid argument #1 to select(). Usage: select(\"#\"|int,...)")
if index == "#" then return arg.n end
local sub = {}
for i=index,table.getn(tab) do
sub[table.getn(sub)+1] = tab[i]
for i=index,arg.n do
sub[table.getn(sub)+1] = arg[i]
end
return unpack(sub)
end
Expand Down

0 comments on commit 55bc4b4

Please sign in to comment.