diff --git a/TurnIn.lua b/TurnIn.lua
index fd9e7cd..bb9b9ed 100755
--- a/TurnIn.lua
+++ b/TurnIn.lua
@@ -66,7 +66,7 @@ function TI_OnLoad()
SlashCmdList["TI"]=TI_SlashCmdHandler;
SLASH_TI1="/turnin";
SLASH_TI2="/ti";
- tinsert(UISpecialFrames,"TI_OptionsFrame");
+ --tinsert(UISpecialFrames,"TI_OptionsFrame");
TI_slashtable = {};
TI_gossipopts = {};
TI_gossipclosed = false;
@@ -128,6 +128,7 @@ end
function TI_EventHandlers:GOSSIP_SHOW ()
TI_debug("Gossip Show");
if(GossipFrame:IsVisible()) then
+ TI_AttachFrameToGossip(GossipFrame);
if(TI_gossipclosed) then
TI_debug("resetting pointers");
TI_gossipclosed = false;
@@ -140,7 +141,8 @@ end
function TI_EventHandlers:GOSSIP_CLOSED ()
TI_debug("Gossip Closed");
if(not GossipFrame:IsVisible()) then
- TI_gossipclosed = true;
+ TI_DetachFrame();
+ TI_gossipclosed = true;
end;
end
@@ -516,6 +518,7 @@ function TI_HandleGossipWindow(gorq)
local thisnpc = TI_NPCDB[npcname];
if(thisnpc.state) then
TI_debug("npc is active, using his options");
+ TI_PopulateGossipOptionFrame(thisnpc);
for i1,current in ipairs(thisnpc) do
if (current.state == true) then
TI_debug("Current Quest: "..current.name);
@@ -562,6 +565,7 @@ function TI_HandleGossipWindow(gorq)
end;
TI_debug("using default config");
+ TI_PopulateGossipOptionFrame(TI_status.options);
for i,current in ipairs(TI_status.options) do
if(current.state) then
if(current.type == "availquest" and #AvailableQuests > 0 and TI_availnumber <= #AvailableQuests) then
@@ -731,9 +735,5 @@ end
function toggle(arg)
- if(arg) then
- return false;
- else
- return true;
- end
+ return not arg;
end
\ No newline at end of file
diff --git a/TurnIn.xml b/TurnIn.xml
index c285f6b..b6f3a3a 100755
--- a/TurnIn.xml
+++ b/TurnIn.xml
@@ -36,19 +36,48 @@
+
+
-
@@ -437,32 +414,6 @@
-
@@ -905,6 +856,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TI_CreateAttachOptionFrames(self);
+
+
+
+
+
+
diff --git a/TurnInUI.lua b/TurnInUI.lua
index 819f9df..b730595 100755
--- a/TurnInUI.lua
+++ b/TurnInUI.lua
@@ -58,7 +58,7 @@ function TI_PopulateOptions(arg)
end
getglobal(entry .. "_Icon"):SetTexture(iconpath);
getglobal(entry .. "_Check"):SetChecked(v.state);
- entrytext:SetWidth(156); --make sure to change this if you change the anchors in the XML
+ entrytext:SetWidth(165); --make sure to change this if you change the anchors in the XML
entrybutton:SetHeight( entrytext:GetHeight() + 6);
entrybutton:Show();
last = last+1;
@@ -317,4 +317,71 @@ function TI_SettingCheckboxUpdate()
end
end
+function TI_AttachFrameToGossip (frame)
+ TI_GossipStatusFrame:SetPoint("TOPLEFT", frame, "TOPRIGHT", 5, 2);
+ TI_GossipStatusFrame:Show();
+-- for i, v in ipairs(TI_GossipStatusFrameOptions) do
+-- v:Show();
+-- end
+end
+
+function TI_DetachFrame()
+ TI_GossipStatusFrame:Hide();
+ TI_GossipStatusFrame:ClearAllPoints();
+end
+
+TI_GossipStatusFrameOptions = {};
+
+function TI_CreateAttachOptionFrames(parent)
+ local prevbutton = parent;
+ for i=1,16 do
+ local button = CreateFrame("Button", parent:GetName()..i, parent, "TI_GossipOptionFrame");
+ button:Hide();
+ button:SetPoint("TOPLEFT", prevbutton, "BOTTOMLEFT", 0, 0);
+ table.insert(TI_GossipStatusFrameOptions, button);
+ prevbutton = button;
+ end
+
+ TI_GossipStatusFrameOptions[1]:SetPoint("TOPLEFT", parent, "TOPLEFT", 5, -20);
+
+end
+
+function TI_PopulateGossipOptionFrame(CurrOpts)
+ local last = 1;
+ local basename = "TI_GossipStatusFrame";
+ for i,v in ipairs(CurrOpts) do
+ if(v.state) then
+ local entry = basename .. last;
+ TI_debug(entry);
+ local entrybutton = getglobal(entry);
+ local entrytext = getglobal(entry .. "_Text");
+ local iconpath;
+ if(v.name == nil) then TI_debug("oh noes") end;
+ entrytext:SetText(v.name);
+ if(v.type == "activequest") then
+ if(v.icon) then
+ iconpath = v.icon;
+ else
+ iconpath = "Interface\\GossipFrame\\ActiveQuestIcon";
+ end
+ elseif(v.type == "availquest") then
+ if(v.icon) then
+ iconpath = v.icon;
+ else
+ iconpath = "Interface\\GossipFrame\\AvailableQuestIcon";
+ end
+ else
+ iconpath = "Interface\\GossipFrame\\" .. v.type .. "GossipIcon";
+ end
+ getglobal(entry .. "_Icon"):SetTexture(iconpath);
+ entrytext:SetWidth(175); --make sure to change this if you change the anchors in the XML
+ entrybutton:SetHeight( entrytext:GetHeight() + 6);
+ entrybutton:Show();
+ last = last+1;
+ end
+ end
+ for j=last, 16, 1 do
+ getglobal(basename .. j):Hide();
+ end
+end