|
|
|
|
|
|
|
|
|
|
|
local TI_OptionsPriorityFramePool = {}; |
|
|
|
|
|
local TI_OptionsPriorityFramePoolMax = 0; |
|
|
|
|
|
|
|
|
|
|
|
local function TI_GetOptionsPriorityFrame(idx) |
|
|
|
|
|
if idx > TI_OptionsPriorityFramePoolMax then |
|
|
|
|
|
for i=TI_OptionsPriorityFramePoolMax+1, idx, 1 do |
|
|
|
|
|
local frame = CreateFrame("Button", "TI_OptionsPriority"..i, |
|
|
|
|
|
getglobal("TI_OptionsPriority"), "TI_PriorityList", i); |
|
|
|
|
|
if i == 1 then |
|
|
|
|
|
frame:SetPoint("TOPLEFT", 0, 0); |
|
|
|
|
|
else |
|
|
|
|
|
frame:SetPoint("TOPLEFT", "TI_OptionsPriority"..i-1, "BOTTOMLEFT", 0, 0); |
|
|
|
|
|
end |
|
|
|
|
|
frame:Hide(); |
|
|
|
|
|
table.insert(TI_OptionsPriorityFramePool, i, frame); |
|
|
|
|
|
TI_OptionsPriorityFramePoolMax = TI_OptionsPriorityFramePoolMax + 1; |
|
|
|
|
|
end |
|
|
|
|
|
end |
|
|
|
|
|
return TI_OptionsPriorityFramePool[idx]; |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
local function TI_HideUnusedOptionFrames(last) |
|
|
|
|
|
for i=last, TI_OptionsPriorityFramePoolMax, 1 do |
|
|
|
|
|
TI_OptionsPriorityFramePool[i]:Hide(); |
|
|
|
|
|
end |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
function TI_PopulateOptions(arg) |
|
|
function TI_PopulateOptions(arg) |
|
|
TI_debug(arg); |
|
|
TI_debug(arg); |
|
|
local CurrOpts; |
|
|
local CurrOpts; |
|
|
|
|
|
|
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
for i,v in ipairs(CurrOpts) do |
|
|
for i,v in ipairs(CurrOpts) do |
|
|
local entry = "TI_OptionsPriority" .. i; |
|
|
|
|
|
local entrybutton = getglobal(entry); |
|
|
|
|
|
local entrytext = getglobal("TI_OptionsPriority"..i.."_Text"); |
|
|
|
|
|
|
|
|
local entrybutton = TI_GetOptionsPriorityFrame(i); |
|
|
|
|
|
local icon, entrytext = entrybutton:GetRegions(); |
|
|
|
|
|
local checkbox = entrybutton:GetChildren(); |
|
|
local iconpath; |
|
|
local iconpath; |
|
|
if(v.name == nil) then TI_debug("oh noes") end; |
|
|
if(v.name == nil) then TI_debug("oh noes") end; |
|
|
entrytext:SetText(v.name); |
|
|
entrytext:SetText(v.name); |
|
|
|
|
|
|
|
|
iconpath = "Interface/GossipFrame/" .. v.type .. "GossipIcon"; |
|
|
iconpath = "Interface/GossipFrame/" .. v.type .. "GossipIcon"; |
|
|
end |
|
|
end |
|
|
end |
|
|
end |
|
|
getglobal(entry .. "_Icon"):SetTexture(iconpath); |
|
|
|
|
|
getglobal(entry .. "_Check"):SetChecked(v.state); |
|
|
|
|
|
|
|
|
icon:SetTexture(iconpath); |
|
|
|
|
|
checkbox:SetChecked(v.state); |
|
|
entrytext:SetWidth(156); --make sure to change this if you change the anchors in the XML |
|
|
entrytext:SetWidth(156); --make sure to change this if you change the anchors in the XML |
|
|
entrybutton:SetHeight( entrytext:GetHeight() + 6); |
|
|
entrybutton:SetHeight( entrytext:GetHeight() + 6); |
|
|
entrybutton:Show(); |
|
|
entrybutton:Show(); |
|
|
last = last+1; |
|
|
last = last+1; |
|
|
end |
|
|
end |
|
|
for j=last, 16, 1 do |
|
|
|
|
|
getglobal("TI_OptionsPriority" .. j):Hide(); |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
TI_HideUnusedOptionFrames(last); |
|
|
|
|
|
|
|
|
TI_OptionsPriorityScrollFrame:SetVerticalScroll(0); |
|
|
TI_OptionsPriorityScrollFrame:SetVerticalScroll(0); |
|
|
TI_OptionsPriorityScrollFrame:UpdateScrollChildRect(); |
|
|
TI_OptionsPriorityScrollFrame:UpdateScrollChildRect(); |
|
|
TI_StatusIndicatorUpdate(); |
|
|
TI_StatusIndicatorUpdate(); |
|
|
|
|
|
|
|
|
TI_SettingCheckboxUpdate(); |
|
|
TI_SettingCheckboxUpdate(); |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
--[[ |
|
|
|
|
|
function TI_PopulateOptions(arg) |
|
|
|
|
|
TI_debug(arg); |
|
|
|
|
|
if(TI_status and TI_status.options) then |
|
|
|
|
|
for i,v in ipairs(TI_status.options) do |
|
|
|
|
|
local entry = "TI_OptionsPriority" .. i; |
|
|
|
|
|
local iconpath; |
|
|
|
|
|
if(v.name == nil) then TI_debug("oh noes") end; |
|
|
|
|
|
if(getglobal(entry .. "_Text") == nil) then TI_debug("wtf "..entry .. "_Text") end; |
|
|
|
|
|
getglobal(entry .. "_Text"):SetText(v.name); |
|
|
|
|
|
if(v.type == "activequest") then |
|
|
|
|
|
iconpath = "Interface\\GossipFrame\\ActiveQuestIcon"; |
|
|
|
|
|
elseif(v.type == "availquest") then |
|
|
|
|
|
iconpath = "Interface\\GossipFrame\\AvailableQuestIcon"; |
|
|
|
|
|
else |
|
|
|
|
|
iconpath = "Interface\\GossipFrame\\" .. v.type .. "GossipIcon"; |
|
|
|
|
|
end |
|
|
|
|
|
getglobal(entry .. "_Icon"):SetTexture(iconpath); |
|
|
|
|
|
getglobal(entry .. "_Check"):SetChecked(v.state); |
|
|
|
|
|
getglobal(entry):Show(); |
|
|
|
|
|
end |
|
|
|
|
|
end |
|
|
|
|
|
TI_NPCListScrollBarUpdate(); |
|
|
|
|
|
end |
|
|
|
|
|
]]-- |
|
|
|
|
|
|
|
|
|
|
|
function TI_NPCListScrollBarUpdate() |
|
|
function TI_NPCListScrollBarUpdate() |
|
|
if(TI_NPCIndex) then |
|
|
if(TI_NPCIndex) then |
|
|
|
|
|
|
|
|
local offset = FauxScrollFrame_GetOffset(TI_NPCListScrollFrame); |
|
|
local offset = FauxScrollFrame_GetOffset(TI_NPCListScrollFrame); |
|
|
local i=1; |
|
|
local i=1; |
|
|
local j=1; |
|
|
local j=1; |
|
|
--~ for k, v in pairs(TI_NPCDB) do |
|
|
|
|
|
--~ if(offset <= i and i < offset+8) then |
|
|
|
|
|
--~ if(i <= table.getn(TI_NPCDB)) then |
|
|
|
|
|
--~ getglobal("TI_OptionsNPCContainer"..j.."_Text"):SetText(k); |
|
|
|
|
|
--~ getglobal("TI_OptionsNPCContainer"..j.."_Check"):SetChecked(v.state); |
|
|
|
|
|
--~ getglobal("TI_OptionsNPCContainer"..j):Show(); |
|
|
|
|
|
--~ else |
|
|
|
|
|
--~ getglobal("TI_OptionsNPCContainer"..j):Hide(); |
|
|
|
|
|
--~ end |
|
|
|
|
|
--~ j = j + 1; |
|
|
|
|
|
--~ end |
|
|
|
|
|
--~ i = i + 1; |
|
|
|
|
|
--~ end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for line=1,8 do |
|
|
for line=1,8 do |
|
|
lineplusoffset = line + FauxScrollFrame_GetOffset(TI_NPCListScrollFrame); |
|
|
lineplusoffset = line + FauxScrollFrame_GetOffset(TI_NPCListScrollFrame); |
|
|
if(lineplusoffset <= table.getn(TI_NPCIndex)) then |
|
|
if(lineplusoffset <= table.getn(TI_NPCIndex)) then |