Compare commits
No commits in common. "master" and "2.3.1" have entirely different histories.
1
.gitignore
vendored
Executable file → Normal file
1
.gitignore
vendored
Executable file → Normal file
@ -0,0 +1 @@
|
||||
.sync/
|
||||
27
README.txt
27
README.txt
@ -1,6 +1,6 @@
|
||||
Turn In
|
||||
v2.3
|
||||
by Sabindeus of Terenas
|
||||
v2.1
|
||||
by Sabindeus of Smolderthorn/Andre of Argent Dawn (Alliance)
|
||||
|
||||
DESCRIPTION
|
||||
-------------
|
||||
@ -30,4 +30,25 @@ COMMAND SUMMARY
|
||||
|
||||
|
||||
|
||||
Please send bug reports, questions or comments to sabin@sabindeus.com
|
||||
CHANGE LOG
|
||||
-------------
|
||||
v2.1 - Quest selection logic rewrite thanks to Arcanemagus of Hyjal
|
||||
v2.0 - Logic rewrite and added a real GUI for the new NPC DB. Updated for WoW 2.0.
|
||||
v1.3 - Greedy mode now actually works properly... I think. More to come! :/
|
||||
v1.2 - Added Saved Variables. Turn In status now persists. Turn In now selects active quests and gossip options as well as available quests. Greedy mode lets you select an option regardless of if the one you wanted is availble.
|
||||
v1.1 - Fixed "bug" regarding Duke Nicholas Zverenhoff (and possibly other NPCs). Was more of a sloppy omission than a bug really.
|
||||
v1.0a - Added toggle function
|
||||
v1.0 - Initial Release
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Special Thanks to Florrail and Makhno for beta testing like a pro!
|
||||
|
||||
Extra Special Thanks to Arcanemagus for his code input!
|
||||
|
||||
Please send bug reports, questions or comments to Sabin1936@mac.com
|
||||
|
||||
141
TurnIn.lua
141
TurnIn.lua
@ -1,14 +1,22 @@
|
||||
--[[
|
||||
Turn-In Mod
|
||||
version 2.3
|
||||
version 2.1
|
||||
Authored by Ian Friedman
|
||||
Sabindeus of Terenas (Alliance)
|
||||
Sabindeus of Smolderthorn (Alliance)
|
||||
The repeatable quest turn in automating machine.
|
||||
|
||||
Thanks to Arcanemagus of Hyjal for extra bug fixes and coding input
|
||||
]]
|
||||
|
||||
-- WOW Version detection
|
||||
|
||||
local function TI_IsRetail()
|
||||
if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
end
|
||||
end
|
||||
|
||||
TI_VersionString = "2.0";
|
||||
local TI_slashtable;
|
||||
@ -37,6 +45,7 @@ local TI_GossipDefaults = {
|
||||
banker = "Bank"
|
||||
};
|
||||
|
||||
TI_FunctionList = {};
|
||||
|
||||
local TI_DefaultStatus = {
|
||||
state = false,
|
||||
@ -111,7 +120,7 @@ end
|
||||
|
||||
function TI_debug(...)
|
||||
if(TI_status.debugstate) then
|
||||
C_AddOns.LoadAddOn("Blizzard_DebugTools")
|
||||
LoadAddOn("Blizzard_DebugTools")
|
||||
local x = {...};
|
||||
for k,v in pairs(x) do
|
||||
if type(v) == "table" and DevTools_Dump then
|
||||
@ -193,7 +202,6 @@ function TI_LoadEvents()
|
||||
end
|
||||
|
||||
function TI_ResetPointers()
|
||||
TI_debug("resetting pointers")
|
||||
TI_activenumber = 1;
|
||||
TI_availnumber = 1;
|
||||
TI_specnum = 0;
|
||||
@ -412,7 +420,6 @@ function TI_CompleteQuest()
|
||||
TI_ResetPointers();
|
||||
else
|
||||
TI_debug("quest is not completable, declining");
|
||||
TI_availnumber = TI_availnumber + 1;
|
||||
QuestDetailDeclineButton_OnClick();
|
||||
end
|
||||
end
|
||||
@ -475,11 +482,7 @@ function TI_HandleGossipWindow(gorq)
|
||||
local x={};
|
||||
x.name = v.name;
|
||||
x.gorq = gorq;
|
||||
if x.orderIndex then
|
||||
x.args = v.orderIndex;
|
||||
else
|
||||
x.args = i;
|
||||
end
|
||||
x.type = v.type;
|
||||
x.icon = v.icon;
|
||||
x.state = false;
|
||||
@ -495,7 +498,6 @@ function TI_HandleGossipWindow(gorq)
|
||||
|
||||
|
||||
local npcname = UnitName("npc");
|
||||
if not issecretvalue(npcname) then
|
||||
TI_AddNPCToTempList(npcname, ListEntry);
|
||||
|
||||
if(TI_status.autoadd and (not TI_NPCDB[npcname])) then
|
||||
@ -520,7 +522,6 @@ function TI_HandleGossipWindow(gorq)
|
||||
end
|
||||
|
||||
if(TI_availnumber > TotalOptions or TI_activenumber > TotalOptions) then
|
||||
TI_debug("Out of available/active quests, giving up ");
|
||||
TI_ResetPointers();
|
||||
return;
|
||||
end
|
||||
@ -555,11 +556,7 @@ function TI_HandleGossipWindow(gorq)
|
||||
for i2,v2 in ipairs(GossipOptions) do
|
||||
if (v2.name == current.name) then
|
||||
TI_debug(i1.."-Gossip Match Found: "..current.name..", "..current.type);
|
||||
if(v2.args) then
|
||||
TI_FunctionList.g.gossip(v2.args);
|
||||
else
|
||||
TI_FunctionList.g.gossip(i2);
|
||||
end
|
||||
return;
|
||||
end
|
||||
end
|
||||
@ -574,8 +571,6 @@ function TI_HandleGossipWindow(gorq)
|
||||
else
|
||||
TI_debug("npc not in list");
|
||||
end
|
||||
end
|
||||
|
||||
if(TI_status.usedefault == false) then
|
||||
TI_debug("npc not in list, default set to off, returning.");
|
||||
return;
|
||||
@ -586,6 +581,7 @@ function TI_HandleGossipWindow(gorq)
|
||||
if(current.type == "availquest" and #AvailableQuests > 0 and TI_availnumber <= #AvailableQuests) then
|
||||
SAvQ(AvailableQuests[TI_availnumber].questID);
|
||||
TI_debug("Selecting Available Quest ".. TI_availnumber);
|
||||
TI_ResetPointers();
|
||||
return;
|
||||
elseif(current.type == "activequest" and #ActiveQuests > 0 and TI_activenumber <= #ActiveQuests) then
|
||||
while TI_activenumber <= #ActiveQuests do
|
||||
@ -603,8 +599,7 @@ function TI_HandleGossipWindow(gorq)
|
||||
for j,val in ipairs(GossipOptions) do
|
||||
if(val.type == current.type) then
|
||||
TI_ResetPointers();
|
||||
TI_debug("Selecting Gossip Option "..j)
|
||||
TI_FunctionList.g.gossip(val.args);
|
||||
TI_FunctionList.g.gossip(j);
|
||||
return;
|
||||
end
|
||||
end
|
||||
@ -677,7 +672,19 @@ function TI_StripDescriptors(...)
|
||||
return x;
|
||||
end
|
||||
|
||||
function TI_TabulateGossipQuestUIInfo(gquis)
|
||||
function TI_TabulateGossipOptions_Classic(...)
|
||||
local x = {};
|
||||
local arg = {...};
|
||||
for i=1, #arg, 2 do
|
||||
local temp = {};
|
||||
temp.name = arg[i];
|
||||
temp.type = arg[i+1];
|
||||
table.insert(x, temp);
|
||||
end
|
||||
return x;
|
||||
end
|
||||
|
||||
function TI_TabulateGossipQuestUIInfo_Retail(gquis)
|
||||
local x = {};
|
||||
|
||||
for i,gqui in ipairs(gquis) do
|
||||
@ -699,9 +706,9 @@ function TI_TabulateGossipQuestUIInfo(gquis)
|
||||
return x;
|
||||
end
|
||||
|
||||
function TI_TabulateGossipUIInfo(guis)
|
||||
function TI_TabulateGossipUIInfo_Retail(guis)
|
||||
local x = {};
|
||||
table.sort(guis, GossipOptionSort);
|
||||
|
||||
for i,gui in ipairs(guis) do
|
||||
local temp = {};
|
||||
temp.name = gui.name;
|
||||
@ -713,85 +720,109 @@ function TI_TabulateGossipUIInfo(guis)
|
||||
temp.icon = gui.icon;
|
||||
temp.gossipOptionID = gui.gossipOptionID
|
||||
temp.orderIndex = gui.orderIndex
|
||||
temp.args = gui.orderIndex
|
||||
table.insert(x, temp);
|
||||
end
|
||||
return x;
|
||||
end
|
||||
|
||||
|
||||
function TI_TabulateGossipAvailableQuests_Classic(gquis)
|
||||
function TI_TabulateGossipAvailableQuests_Classic(...)
|
||||
local x = {};
|
||||
local idx = 1;
|
||||
|
||||
for i,gqui in ipairs(gquis) do
|
||||
for i=1, select("#", ...), 7 do
|
||||
local temp = {};
|
||||
temp.name = gqui.title;
|
||||
temp.name = select(i, ...);
|
||||
|
||||
if ( gqui.repeatable ) then
|
||||
local isTrivial = select(i+2, ...);
|
||||
local isDaily = select(i+3, ...);
|
||||
local isRepeatable = select(i+4, ...);
|
||||
local isLegendary = select(i+5, ...);
|
||||
local isIgnored = select(i+6, ...);
|
||||
if ( isDaily ) then
|
||||
temp.icon = "Interface\\GossipFrame\\DailyQuestIcon";
|
||||
elseif ( gqui.isLegendary ) then
|
||||
elseif ( isRepeatable ) then
|
||||
temp.icon = "Interface\\GossipFrame\\DailyActiveQuestIcon";
|
||||
elseif ( isLegendary ) then
|
||||
temp.icon = "Interface\\GossipFrame\\AvailableLegendaryQuestIcon";
|
||||
else
|
||||
temp.icon = "Interface\\GossipFrame\\AvailableQuestIcon";
|
||||
end
|
||||
temp.questID = gqui.questID;
|
||||
temp.isComplete = gqui.isComplete;
|
||||
|
||||
temp.questID = idx;
|
||||
table.insert(x, temp);
|
||||
idx = idx + 1;
|
||||
end
|
||||
return x;
|
||||
end
|
||||
|
||||
function TI_TabulateGossipActiveQuests_Classic(gquis)
|
||||
function TI_TabulateGossipActiveQuests_Classic(...)
|
||||
local x = {};
|
||||
local idx = 1;
|
||||
|
||||
for i,gqui in ipairs(gquis) do
|
||||
for i=1, select("#", ...), 6 do
|
||||
local temp = {};
|
||||
temp.name = gqui.title;
|
||||
temp.name = select(i, ...);
|
||||
|
||||
if ( gqui.repeatable ) then
|
||||
temp.icon = "Interface\\GossipFrame\\DailyQuestIcon";
|
||||
elseif ( gqui.isLegendary ) then
|
||||
temp.icon = "Interface\\GossipFrame\\AvailableLegendaryQuestIcon";
|
||||
local isComplete = select(i+3, ...);
|
||||
temp.isComplete = isComplete;
|
||||
local isLegendary = select(i+4, ...);
|
||||
if(isComplete) then
|
||||
if(isLegendary) then
|
||||
temp.icon = "Interface\\GossipFrame\\ActiveLegendaryQuestIcon";
|
||||
else
|
||||
temp.icon = "Interface\\GossipFrame\\AvailableQuestIcon";
|
||||
temp.icon = "Interface\\GossipFrame\\ActiveQuestIcon";
|
||||
end
|
||||
temp.questID = gqui.questID;
|
||||
temp.isComplete = gqui.isComplete;
|
||||
|
||||
else
|
||||
temp.icon = "Interface\\GossipFrame\\IncompleteQuestIcon";
|
||||
end
|
||||
temp.questID = idx;
|
||||
table.insert(x, temp);
|
||||
idx = idx + 1;
|
||||
end
|
||||
return x;
|
||||
end
|
||||
|
||||
TI_FunctionList = {}
|
||||
function TI_SetupFunctions()
|
||||
-- set up functions by release type
|
||||
if (TI_IsRetail()) then
|
||||
TI_FunctionList = {
|
||||
g = {
|
||||
availquest = C_GossipInfo.SelectAvailableQuest,
|
||||
activequest = C_GossipInfo.SelectActiveQuest,
|
||||
gossip = C_GossipInfo.SelectOptionByIndex,
|
||||
gossip = SelectGossipOption,
|
||||
getavailquests = C_GossipInfo.GetAvailableQuests,
|
||||
getactivequests = C_GossipInfo.GetActiveQuests,
|
||||
getoptions = C_GossipInfo.GetOptions,
|
||||
tabulateOptions = TI_TabulateGossipUIInfo,
|
||||
tabulateAvailable = TI_TabulateGossipQuestUIInfo_Retail,
|
||||
tabulateActive = TI_TabulateGossipQuestUIInfo_Retail,
|
||||
tabulateOptions = TI_TabulateGossipUIInfo_Retail,
|
||||
},
|
||||
q = {
|
||||
activequest = SelectActiveQuest,
|
||||
availquest = SelectAvailableQuest,
|
||||
}
|
||||
};
|
||||
else
|
||||
TI_FunctionList = {
|
||||
g = {
|
||||
availquest = SelectGossipAvailableQuest,
|
||||
activequest = SelectGossipActiveQuest,
|
||||
gossip = SelectGossipOption,
|
||||
getavailquests = GetGossipAvailableQuests,
|
||||
getactivequests = GetGossipActiveQuests,
|
||||
getoptions = GetGossipOptions,
|
||||
tabulateAvailable = TI_TabulateGossipAvailableQuests_Classic,
|
||||
tabulateActive = TI_TabulateGossipActiveQuests_Classic,
|
||||
tabulateOptions = TI_TabulateGossipOptions_Classic,
|
||||
},
|
||||
q = {
|
||||
activequest = SelectActiveQuest,
|
||||
availquest = SelectAvailableQuest,
|
||||
}
|
||||
if QuestUtil.GetQuestIconOffer then
|
||||
TI_FunctionList.g.tabulateAvailable = TI_TabulateGossipQuestUIInfo
|
||||
TI_FunctionList.g.tabulateActive = TI_TabulateGossipQuestUIInfo
|
||||
else
|
||||
TI_FunctionList.g.tabulateAvailable = TI_TabulateGossipAvailableQuests_Classic
|
||||
TI_FunctionList.g.tabulateActive = TI_TabulateGossipActiveQuests_Classic
|
||||
end
|
||||
};
|
||||
end
|
||||
TI_SetupFunctions()
|
||||
|
||||
|
||||
--[[this function stolen from WhisperCast by Sarris, whom I love dearly for his contribution to Paladins everywhere.
|
||||
]]
|
||||
function TI_copyTable( src )
|
||||
local copy = {}
|
||||
for k1,v1 in pairs(src) do
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
## Interface: 120100, 120000, 120001, 50503, 40402, 30405, 20505, 11508
|
||||
## X-Compatible-With: 120100, 120000, 120001, 50503, 40402, 30405, 20505, 11508
|
||||
## Interface: 100000
|
||||
## X-Compatible-With: 100000
|
||||
## Title: Turn In
|
||||
## Notes: Automates the selection of quest and gossip options.
|
||||
## SavedVariables: TI_status, TI_NPCDB, TI_NPCIndex
|
||||
|
||||
161
TurnIn.xml
161
TurnIn.xml
@ -684,6 +684,167 @@
|
||||
<Size>
|
||||
<AbsDimension x="200" y="30"/>
|
||||
</Size>
|
||||
|
||||
<!--<Layers>
|
||||
<Layer level="OVERLAY">
|
||||
<FontString name="$parentText" justifyV="top" justifyH="left" inherits="GameFontNormal" text="Gossip Options">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" />
|
||||
</Anchors>
|
||||
</FontString>
|
||||
</Layer>
|
||||
<Layer level="BACKGROUND">
|
||||
<Texture name="$parent_Background" setAllPoints="true">
|
||||
<Color r="0" g="1" b="0" a="0.0"/>
|
||||
</Texture>
|
||||
</Layer>
|
||||
</Layers>-->
|
||||
<Frames>
|
||||
<Button name="$parent1" id="1" hidden="true" inherits="TI_PriorityList">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="0" />
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Button name="$parent2" id="2" hidden="true" inherits="TI_PriorityList">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent1">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="0" />
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Button name="$parent3" id="3" hidden="true" inherits="TI_PriorityList">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent2">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="0" />
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Button name="$parent4" id="4" hidden="true" inherits="TI_PriorityList">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent3">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="0" />
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Button name="$parent5" id="5" hidden="true" inherits="TI_PriorityList">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent4">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="0" />
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Button name="$parent6" id="6" hidden="true" inherits="TI_PriorityList">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent5">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="0" />
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Button name="$parent7" id="7" hidden="true" inherits="TI_PriorityList">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent6">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="0" />
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Button name="$parent8" id="8" hidden="true" inherits="TI_PriorityList">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent7">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="0" />
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Button name="$parent9" id="9" hidden="true" inherits="TI_PriorityList">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent8">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="0" />
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Button name="$parent10" id="10" hidden="true" inherits="TI_PriorityList">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent9">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="0" />
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Button name="$parent11" id="11" hidden="true" inherits="TI_PriorityList">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent10">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="0" />
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Button name="$parent12" id="12" hidden="true" inherits="TI_PriorityList">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent11">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="0" />
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Button name="$parent13" id="13" hidden="true" inherits="TI_PriorityList">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent12">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="0" />
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Button name="$parent14" id="14" hidden="true" inherits="TI_PriorityList">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent13">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="0" />
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Button name="$parent15" id="15" hidden="true" inherits="TI_PriorityList">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent14">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="0" />
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
<Button name="$parent16" id="16" hidden="true" inherits="TI_PriorityList">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent15">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="0" />
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Button>
|
||||
</Frames>
|
||||
</Frame>
|
||||
</ScrollChild>
|
||||
</ScrollFrame>
|
||||
|
||||
80
TurnInUI.lua
80
TurnInUI.lua
@ -1,30 +1,3 @@
|
||||
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)
|
||||
TI_debug(arg);
|
||||
local CurrOpts;
|
||||
@ -37,9 +10,9 @@ function TI_PopulateOptions(arg)
|
||||
end
|
||||
|
||||
for i,v in ipairs(CurrOpts) do
|
||||
local entrybutton = TI_GetOptionsPriorityFrame(i);
|
||||
local icon, entrytext = entrybutton:GetRegions();
|
||||
local checkbox = entrybutton:GetChildren();
|
||||
local entry = "TI_OptionsPriority" .. i;
|
||||
local entrybutton = getglobal(entry);
|
||||
local entrytext = getglobal("TI_OptionsPriority"..i.."_Text");
|
||||
local iconpath;
|
||||
if(v.name == nil) then TI_debug("oh noes") end;
|
||||
entrytext:SetText(v.name);
|
||||
@ -62,15 +35,16 @@ function TI_PopulateOptions(arg)
|
||||
iconpath = "Interface/GossipFrame/" .. v.type .. "GossipIcon";
|
||||
end
|
||||
end
|
||||
icon:SetTexture(iconpath);
|
||||
checkbox:SetChecked(v.state);
|
||||
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
|
||||
entrybutton:SetHeight( entrytext:GetHeight() + 6);
|
||||
entrybutton:Show();
|
||||
last = last+1;
|
||||
end
|
||||
TI_HideUnusedOptionFrames(last);
|
||||
|
||||
for j=last, 16, 1 do
|
||||
getglobal("TI_OptionsPriority" .. j):Hide();
|
||||
end
|
||||
TI_OptionsPriorityScrollFrame:SetVerticalScroll(0);
|
||||
TI_OptionsPriorityScrollFrame:UpdateScrollChildRect();
|
||||
TI_StatusIndicatorUpdate();
|
||||
@ -79,6 +53,31 @@ function TI_PopulateOptions(arg)
|
||||
TI_SettingCheckboxUpdate();
|
||||
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()
|
||||
if(TI_NPCIndex) then
|
||||
@ -90,6 +89,19 @@ function TI_NPCListScrollBarUpdate()
|
||||
local offset = FauxScrollFrame_GetOffset(TI_NPCListScrollFrame);
|
||||
local i=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
|
||||
lineplusoffset = line + FauxScrollFrame_GetOffset(TI_NPCListScrollFrame);
|
||||
|
||||
7
TurnIn_Wrath.toc
Executable file
7
TurnIn_Wrath.toc
Executable file
@ -0,0 +1,7 @@
|
||||
## Interface: 30400
|
||||
## X-Compatible-With: 30400
|
||||
## Title: Turn In
|
||||
## Notes: Automates the selection of quest and gossip options.
|
||||
## SavedVariables: TI_status, TI_NPCDB, TI_NPCIndex
|
||||
## Version: 2.2
|
||||
TurnIn.xml
|
||||
Loading…
Reference in New Issue
Block a user