Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c0705f2d3 | ||
|
|
4b1a1af6b3 | ||
|
|
5e84b90850 | ||
|
|
a6f5433efc | ||
|
|
cc1e393bfc | ||
|
|
14d9f35361 | ||
|
|
d269a24967 | ||
|
|
4f03bdf323 | ||
|
|
000e731fbc | ||
|
|
5c4bf53d17 | ||
|
|
027447cfa6 | ||
|
|
ed06ca0f3d | ||
|
|
e7d369fa25 | ||
|
|
4ce1a4be30 | ||
|
|
a78b31dba9 | ||
|
|
8efe5dcbf3 | ||
|
|
47a99070cf | ||
|
|
2eb3b298ce | ||
|
|
2b9a01000f | ||
|
|
37c3143f19 | ||
|
|
755013fa82 | ||
|
|
26bfd93ccd | ||
|
|
ef3f6d6f91 | ||
|
|
938033ded7 | ||
|
|
6ca6548640 | ||
|
|
43ff4d9aa0 | ||
|
|
e80f696ac7 | ||
|
|
5d9f11120a |
0
.gitignore
vendored
Executable file
0
.gitignore
vendored
Executable file
27
README.txt
27
README.txt
@ -1,6 +1,6 @@
|
|||||||
Turn In
|
Turn In
|
||||||
v2.1
|
v2.3
|
||||||
by Sabindeus of Smolderthorn/Andre of Argent Dawn (Alliance)
|
by Sabindeus of Terenas
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-------------
|
-------------
|
||||||
@ -30,25 +30,4 @@ COMMAND SUMMARY
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
CHANGE LOG
|
Please send bug reports, questions or comments to sabin@sabindeus.com
|
||||||
-------------
|
|
||||||
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
|
|
||||||
|
|||||||
373
TurnIn.lua
Normal file → Executable file
373
TurnIn.lua
Normal file → Executable file
@ -1,13 +1,15 @@
|
|||||||
--[[
|
--[[
|
||||||
Turn-In Mod
|
Turn-In Mod
|
||||||
version 2.1
|
version 2.3
|
||||||
Authored by Ian Friedman
|
Authored by Ian Friedman
|
||||||
Sabindeus of Smolderthorn (Alliance)
|
Sabindeus of Terenas (Alliance)
|
||||||
The repeatable quest turn in automating machine.
|
The repeatable quest turn in automating machine.
|
||||||
|
|
||||||
Thanks to Arcanemagus of Hyjal for extra bug fixes and coding input
|
Thanks to Arcanemagus of Hyjal for extra bug fixes and coding input
|
||||||
]]
|
]]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TI_VersionString = "2.0";
|
TI_VersionString = "2.0";
|
||||||
local TI_slashtable;
|
local TI_slashtable;
|
||||||
TI_gossipclosed = false;
|
TI_gossipclosed = false;
|
||||||
@ -35,18 +37,6 @@ local TI_GossipDefaults = {
|
|||||||
banker = "Bank"
|
banker = "Bank"
|
||||||
};
|
};
|
||||||
|
|
||||||
local TI_FunctionList = {
|
|
||||||
g = {
|
|
||||||
availquest = SelectGossipAvailableQuest,
|
|
||||||
activequest = SelectGossipActiveQuest,
|
|
||||||
default = SelectGossipOption
|
|
||||||
},
|
|
||||||
q = {
|
|
||||||
availquest = SelectAvailableQuest,
|
|
||||||
activequest = SelectActiveQuest
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
local TI_DefaultStatus = {
|
local TI_DefaultStatus = {
|
||||||
state = false,
|
state = false,
|
||||||
@ -67,6 +57,49 @@ local TI_events = {
|
|||||||
"QUEST_FINISHED"
|
"QUEST_FINISHED"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
local TI_GossipIconNameToId = {
|
||||||
|
["activequesticon"] = 132048,
|
||||||
|
["availablequesticon"] = 132049,
|
||||||
|
["banker"] = 132050,
|
||||||
|
["battlemaster"] = 132051,
|
||||||
|
["binder"] = 132052,
|
||||||
|
["gossip"] = 132053,
|
||||||
|
["healer"] = 132054,
|
||||||
|
["petition"] = 132055,
|
||||||
|
["tabard"] = 132056,
|
||||||
|
["taxi"] = 132057,
|
||||||
|
["trainer"] = 132058,
|
||||||
|
["unlearn"] = 132059,
|
||||||
|
["vendor"] = 132060,
|
||||||
|
["incompletequest"] = 365195,
|
||||||
|
["dailyquest"] = 368364,
|
||||||
|
["dailyactivequest"] = 368577,
|
||||||
|
["auctioneer"] = 528409,
|
||||||
|
["activelegendaryquest"] = 646979,
|
||||||
|
["availablelegendaryquest"] = 646980,
|
||||||
|
["chatbubble"] = 1019848,
|
||||||
|
["workorder"] = 1130518,
|
||||||
|
["transmogrify"] = 1673939,
|
||||||
|
["campaignactivequest"] = 3532316,
|
||||||
|
["campaignavailablequest"] = 3532317,
|
||||||
|
["campaignincompletequest"] = 3532318,
|
||||||
|
["campaigngossipicons"] = 3595324,
|
||||||
|
}
|
||||||
|
|
||||||
|
local function TI_InvertDictionary(input)
|
||||||
|
local s={}
|
||||||
|
for k,v in pairs(input) do
|
||||||
|
s[v]=k
|
||||||
|
end
|
||||||
|
return s
|
||||||
|
end
|
||||||
|
|
||||||
|
local TI_GossipIconIdToName = TI_InvertDictionary(TI_GossipIconNameToId)
|
||||||
|
|
||||||
|
local function TI_TranslateIconToType(iconId)
|
||||||
|
return TI_GossipIconIdToName[iconId]
|
||||||
|
end
|
||||||
|
|
||||||
TI_TempNPCList = {};
|
TI_TempNPCList = {};
|
||||||
|
|
||||||
function TI_message(...)
|
function TI_message(...)
|
||||||
@ -78,7 +111,15 @@ end
|
|||||||
|
|
||||||
function TI_debug(...)
|
function TI_debug(...)
|
||||||
if(TI_status.debugstate) then
|
if(TI_status.debugstate) then
|
||||||
TI_message(...)
|
C_AddOns.LoadAddOn("Blizzard_DebugTools")
|
||||||
|
local x = {...};
|
||||||
|
for k,v in pairs(x) do
|
||||||
|
if type(v) == "table" and DevTools_Dump then
|
||||||
|
DevTools_Dump(v)
|
||||||
|
else
|
||||||
|
DEFAULT_CHAT_FRAME:AddMessage(tostring(v));
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -152,6 +193,7 @@ function TI_LoadEvents()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function TI_ResetPointers()
|
function TI_ResetPointers()
|
||||||
|
TI_debug("resetting pointers")
|
||||||
TI_activenumber = 1;
|
TI_activenumber = 1;
|
||||||
TI_availnumber = 1;
|
TI_availnumber = 1;
|
||||||
TI_specnum = 0;
|
TI_specnum = 0;
|
||||||
@ -207,6 +249,9 @@ function TI_SlashCmdHandler(cmd)
|
|||||||
window = function ()
|
window = function ()
|
||||||
TI_OptionsFrame:Show();
|
TI_OptionsFrame:Show();
|
||||||
end,
|
end,
|
||||||
|
config = function ()
|
||||||
|
TI_OptionsFrame:Show();
|
||||||
|
end,
|
||||||
recent = function ()
|
recent = function ()
|
||||||
TI_TempNPCListWindow:Show();
|
TI_TempNPCListWindow:Show();
|
||||||
end,
|
end,
|
||||||
@ -258,7 +303,7 @@ function TI_IsNPCOn(npcname, type)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function TI_OnEvent(event)
|
function TI_OnEvent(self, event, ...)
|
||||||
if(event == "VARIABLES_LOADED") then
|
if(event == "VARIABLES_LOADED") then
|
||||||
TI_VarInit();
|
TI_VarInit();
|
||||||
if(TI_status.state) then
|
if(TI_status.state) then
|
||||||
@ -314,7 +359,7 @@ function TI_OnEvent(event)
|
|||||||
TI_debug("Quest Detail");
|
TI_debug("Quest Detail");
|
||||||
TI_gossipclosed = false;
|
TI_gossipclosed = false;
|
||||||
if(TI_IsNPCOn(UnitName("npc"), "availquest")) then
|
if(TI_IsNPCOn(UnitName("npc"), "availquest")) then
|
||||||
AcceptQuest();
|
TI_HandleAcceptQuest();
|
||||||
end
|
end
|
||||||
TI_ResetPointers();
|
TI_ResetPointers();
|
||||||
end
|
end
|
||||||
@ -328,6 +373,11 @@ function TI_OnEvent(event)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function TI_HandleAcceptQuest()
|
||||||
|
--QuestInfoFadingFrame_OnUpdate(QuestInfoFadingFrame, 1); -- does not exist anymore in 6.0
|
||||||
|
QuestDetailAcceptButton_OnClick();
|
||||||
|
end
|
||||||
|
|
||||||
function TI_HandleQuestProgress()
|
function TI_HandleQuestProgress()
|
||||||
|
|
||||||
local questname = GetTitleText();
|
local questname = GetTitleText();
|
||||||
@ -357,10 +407,13 @@ end
|
|||||||
|
|
||||||
function TI_CompleteQuest()
|
function TI_CompleteQuest()
|
||||||
if(IsQuestCompletable()) then
|
if(IsQuestCompletable()) then
|
||||||
|
TI_debug("quest is completable, completeing");
|
||||||
CompleteQuest();
|
CompleteQuest();
|
||||||
TI_ResetPointers();
|
TI_ResetPointers();
|
||||||
else
|
else
|
||||||
DeclineQuest();
|
TI_debug("quest is not completable, declining");
|
||||||
|
TI_availnumber = TI_availnumber + 1;
|
||||||
|
QuestDetailDeclineButton_OnClick();
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -368,11 +421,10 @@ function TI_GetQuests(type)
|
|||||||
local numQuests = (getglobal("GetNum"..type.."Quests"))();
|
local numQuests = (getglobal("GetNum"..type.."Quests"))();
|
||||||
local qfn = getglobal("Get"..type.."Title");
|
local qfn = getglobal("Get"..type.."Title");
|
||||||
local ret = {};
|
local ret = {};
|
||||||
local qname;
|
|
||||||
local i=1;
|
local i=1;
|
||||||
for i=1,numQuests do
|
for i=1,numQuests do
|
||||||
qname = qfn(i);
|
local qname, isComplete = qfn(i);
|
||||||
ret[i] = {name=qname};
|
ret[i] = {name=qname, questID=i, isComplete=isComplete};
|
||||||
end
|
end
|
||||||
return ret;
|
return ret;
|
||||||
end
|
end
|
||||||
@ -383,22 +435,21 @@ function TI_HandleGossipWindow(gorq)
|
|||||||
local AvailableQuests;
|
local AvailableQuests;
|
||||||
local ActiveQuests;
|
local ActiveQuests;
|
||||||
local GossipOptions;
|
local GossipOptions;
|
||||||
|
TI_debug(gorq);
|
||||||
if(gorq == "g") then
|
if(gorq == "g") then
|
||||||
AvailableQuests = TI_TabulateGossipAvailableQuests(GetGossipAvailableQuests());
|
AvailableQuests = TI_FunctionList.g.tabulateAvailable(TI_FunctionList.g.getavailquests());
|
||||||
ActiveQuests = TI_TabulateGossipActiveQuests(GetGossipActiveQuests());
|
ActiveQuests = TI_FunctionList.g.tabulateActive(TI_FunctionList.g.getactivequests());
|
||||||
GossipOptions = TI_TabulateGossipOptions(GetGossipOptions());
|
GossipOptions = TI_FunctionList.g.tabulateOptions(TI_FunctionList.g.getoptions());
|
||||||
SAcQ = SelectGossipActiveQuest;
|
SAcQ = TI_FunctionList.g.activequest;
|
||||||
SAvQ = SelectGossipAvailableQuest;
|
SAvQ = TI_FunctionList.g.availquest;
|
||||||
elseif(gorq == "q") then
|
elseif(gorq == "q") then
|
||||||
AvailableQuests = TI_GetQuests("Available");
|
AvailableQuests = TI_GetQuests("Available");
|
||||||
ActiveQuests = TI_GetQuests("Active");
|
ActiveQuests = TI_GetQuests("Active");
|
||||||
GossipOptions = {};
|
GossipOptions = {};
|
||||||
SAcQ=SelectActiveQuest;
|
SAcQ=TI_FunctionList.q.activequest;
|
||||||
SAvQ=SelectAvailableQuest;
|
SAvQ=TI_FunctionList.q.availquest;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local ListEntry = {};
|
local ListEntry = {};
|
||||||
for i,v in ipairs(AvailableQuests) do
|
for i,v in ipairs(AvailableQuests) do
|
||||||
local x={};
|
local x={};
|
||||||
@ -424,8 +475,13 @@ function TI_HandleGossipWindow(gorq)
|
|||||||
local x={};
|
local x={};
|
||||||
x.name = v.name;
|
x.name = v.name;
|
||||||
x.gorq = gorq;
|
x.gorq = gorq;
|
||||||
x.args = i;
|
if x.orderIndex then
|
||||||
|
x.args = v.orderIndex;
|
||||||
|
else
|
||||||
|
x.args = i;
|
||||||
|
end
|
||||||
x.type = v.type;
|
x.type = v.type;
|
||||||
|
x.icon = v.icon;
|
||||||
x.state = false;
|
x.state = false;
|
||||||
table.insert(ListEntry, x);
|
table.insert(ListEntry, x);
|
||||||
end
|
end
|
||||||
@ -433,86 +489,93 @@ function TI_HandleGossipWindow(gorq)
|
|||||||
|
|
||||||
|
|
||||||
local TotalOptions = #AvailableQuests+#ActiveQuests+#GossipOptions;
|
local TotalOptions = #AvailableQuests+#ActiveQuests+#GossipOptions;
|
||||||
--if(TI_activenumber > ActiveQuests.getn()) TI_activenumber = 1;
|
|
||||||
if(TotalOptions < 1) then
|
if(TotalOptions < 1) then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local npcname = UnitName("npc");
|
local npcname = UnitName("npc");
|
||||||
TI_AddNPCToTempList(npcname, ListEntry);
|
if not issecretvalue(npcname) then
|
||||||
|
TI_AddNPCToTempList(npcname, ListEntry);
|
||||||
|
|
||||||
if(TI_status.autoadd and (not TI_NPCDB[npcname])) then
|
if(TI_status.autoadd and (not TI_NPCDB[npcname])) then
|
||||||
TI_debug("autoadd on, adding this NPC", TI_status.autoadd, TI_NPCDB[npcname]);
|
TI_debug("autoadd on, adding this NPC", TI_status.autoadd, TI_NPCDB[npcname]);
|
||||||
TI_AddNPCToList(ListEntry, npcname);
|
TI_AddNPCToList(ListEntry, npcname);
|
||||||
end
|
end
|
||||||
|
|
||||||
-- If a NPC is in the Database but a new dialog option has appeared (new daily/completed quest) then add it to the DB
|
-- If a NPC is in the Database but a new dialog option has appeared (new daily/completed quest) then add it to the DB
|
||||||
if (TI_NPCDB[npcname]) then
|
if (TI_NPCDB[npcname]) then
|
||||||
for k1, v1 in ipairs(ListEntry) do
|
for k1, v1 in ipairs(ListEntry) do
|
||||||
local found = false;
|
local found = false;
|
||||||
for k2, v2 in ipairs(TI_NPCDB[npcname]) do
|
for k2, v2 in ipairs(TI_NPCDB[npcname]) do
|
||||||
if (v2.type == v1.type and v2.name == v1.name) then
|
if (v2.type == v1.type and v2.name == v1.name) then
|
||||||
found = true;
|
found = true;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if (not found) then
|
||||||
|
table.insert(TI_NPCDB[npcname], v1)
|
||||||
|
TI_PopulateOptions("npclist updated");
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if (not found) then
|
|
||||||
table.insert(TI_NPCDB[npcname], v1)
|
|
||||||
TI_PopulateOptions("npclist updated");
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
if(TI_availnumber > TotalOptions or TI_activenumber > TotalOptions) then
|
if(TI_availnumber > TotalOptions or TI_activenumber > TotalOptions) then
|
||||||
TI_ResetPointers();
|
TI_debug("Out of available/active quests, giving up ");
|
||||||
return;
|
TI_ResetPointers();
|
||||||
end
|
return;
|
||||||
|
end
|
||||||
|
|
||||||
|
TI_debug(npcname);
|
||||||
TI_debug(npcname);
|
if(TI_NPCDB[npcname]) then
|
||||||
if(TI_NPCDB[npcname]) then
|
local thisnpc = TI_NPCDB[npcname];
|
||||||
local thisnpc = TI_NPCDB[npcname];
|
if(thisnpc.state) then
|
||||||
if(thisnpc.state) then
|
TI_debug("npc is active, using his options");
|
||||||
TI_debug("npc is active, using his options");
|
for i1,current in ipairs(thisnpc) do
|
||||||
for i1,current in ipairs(thisnpc) do
|
if (current.state == true) then
|
||||||
if (current.state == true) then
|
TI_debug("Current Quest: "..current.name);
|
||||||
TI_debug("Current Quest: "..current.name);
|
if (TI_specnum == 0 or i1 > TI_specnum) then
|
||||||
if (TI_specnum == 0 or i1 > TI_specnum) then
|
TI_specnum = i1;
|
||||||
TI_specnum = i1;
|
if (current.type == "availquest") then
|
||||||
if (current.type == "availquest") then
|
for i2,v2 in ipairs(AvailableQuests) do
|
||||||
for i2,v2 in ipairs(AvailableQuests) do
|
if (v2.name == current.name) then
|
||||||
if (v2.name == current.name) then
|
TI_debug(i1.."-Available Match Found: "..current.name);
|
||||||
TI_debug(i1.."-Available Match Found: "..current.name);
|
SAvQ(v2.questID);
|
||||||
TI_FunctionList[current.gorq]["availquest"](i2);
|
return;
|
||||||
return;
|
end
|
||||||
end
|
end
|
||||||
end
|
elseif (current.type == "activequest") then
|
||||||
elseif (current.type == "activequest") then
|
for i2,v2 in ipairs(ActiveQuests) do
|
||||||
for i2,v2 in ipairs(ActiveQuests) do
|
if (v2.name == current.name) then
|
||||||
if (v2.name == current.name) then
|
TI_debug(i1.."-Active Match Found: "..current.name..", "..current.type);
|
||||||
TI_debug(i1.."-Active Match Found: "..current.name..", "..current.type);
|
SAcQ(v2.questID);
|
||||||
TI_FunctionList[current.gorq]["activequest"](i2);
|
return;
|
||||||
return;
|
end
|
||||||
end
|
end
|
||||||
end
|
else
|
||||||
elseif (current.type == "gossip") then
|
for i2,v2 in ipairs(GossipOptions) do
|
||||||
for i2,v2 in ipairs(GossipOptions) do
|
if (v2.name == current.name) then
|
||||||
if (v2.name == current.name) then
|
TI_debug(i1.."-Gossip Match Found: "..current.name..", "..current.type);
|
||||||
SelectGossipOption(i2);
|
if(v2.args) then
|
||||||
return;
|
TI_FunctionList.g.gossip(v2.args);
|
||||||
|
else
|
||||||
|
TI_FunctionList.g.gossip(i2);
|
||||||
|
end
|
||||||
|
return;
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
return;
|
||||||
|
else
|
||||||
|
TI_debug("npc in list, but not active");
|
||||||
end
|
end
|
||||||
return;
|
|
||||||
else
|
else
|
||||||
TI_debug("npc in list, but not active");
|
TI_debug("npc not in list");
|
||||||
end
|
end
|
||||||
else
|
|
||||||
TI_debug("npc not in list");
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if(TI_status.usedefault == false) then
|
if(TI_status.usedefault == false) then
|
||||||
TI_debug("npc not in list, default set to off, returning.");
|
TI_debug("npc not in list, default set to off, returning.");
|
||||||
return;
|
return;
|
||||||
@ -521,20 +584,27 @@ function TI_HandleGossipWindow(gorq)
|
|||||||
for i,current in ipairs(TI_status.options) do
|
for i,current in ipairs(TI_status.options) do
|
||||||
if(current.state) then
|
if(current.state) then
|
||||||
if(current.type == "availquest" and #AvailableQuests > 0 and TI_availnumber <= #AvailableQuests) then
|
if(current.type == "availquest" and #AvailableQuests > 0 and TI_availnumber <= #AvailableQuests) then
|
||||||
TI_availnumber = TI_availnumber + 1;
|
SAvQ(AvailableQuests[TI_availnumber].questID);
|
||||||
SAvQ(TI_availnumber-1);
|
TI_debug("Selecting Available Quest ".. TI_availnumber);
|
||||||
TI_debug("Selecting Available Quest ".. TI_availnumber-1);
|
|
||||||
return;
|
return;
|
||||||
elseif(current.type == "activequest" and #ActiveQuests > 0 and TI_activenumber <= #ActiveQuests) then
|
elseif(current.type == "activequest" and #ActiveQuests > 0 and TI_activenumber <= #ActiveQuests) then
|
||||||
TI_activenumber = TI_activenumber + 1;
|
while TI_activenumber <= #ActiveQuests do
|
||||||
SAcQ(TI_activenumber-1);
|
if ActiveQuests[TI_activenumber].isComplete then
|
||||||
TI_debug("Selecting Active Quest ".. TI_activenumber-1);
|
TI_debug("Selecting Active Quest ".. TI_activenumber .. " " .. ActiveQuests[TI_activenumber].name );
|
||||||
return;
|
SAcQ(ActiveQuests[TI_activenumber].questID);
|
||||||
|
TI_ResetPointers();
|
||||||
|
return;
|
||||||
|
else
|
||||||
|
TI_debug("Active Quest ".. TI_activenumber .. " " .. ActiveQuests[TI_activenumber].name .. " is not complete")
|
||||||
|
TI_activenumber = TI_activenumber + 1;
|
||||||
|
end
|
||||||
|
end
|
||||||
elseif(#GossipOptions > 0) then
|
elseif(#GossipOptions > 0) then
|
||||||
for j,val in ipairs(GossipOptions) do
|
for j,val in ipairs(GossipOptions) do
|
||||||
if(val.type == current.type) then
|
if(val.type == current.type) then
|
||||||
TI_ResetPointers();
|
TI_ResetPointers();
|
||||||
SelectGossipOption(j);
|
TI_debug("Selecting Gossip Option "..j)
|
||||||
|
TI_FunctionList.g.gossip(val.args);
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -569,7 +639,13 @@ function TI_AddNPCToTempList(name, list)
|
|||||||
local temp = {};
|
local temp = {};
|
||||||
temp.name = name;
|
temp.name = name;
|
||||||
temp.list = list;
|
temp.list = list;
|
||||||
temp.location = GetSubZoneText() .. ", " .. GetRealZoneText();
|
local subZone = GetSubZoneText();
|
||||||
|
local realZone = GetRealZoneText();
|
||||||
|
if(subZone == "") then
|
||||||
|
temp.location = realZone;
|
||||||
|
else
|
||||||
|
temp.location = subZone .. ", " .. realZone;
|
||||||
|
end
|
||||||
table.insert(TI_TempNPCList, 1, temp);
|
table.insert(TI_TempNPCList, 1, temp);
|
||||||
if(#TI_TempNPCList > TI_TempNPCListMaxSize) then
|
if(#TI_TempNPCList > TI_TempNPCListMaxSize) then
|
||||||
table.remove(TI_TempNPCList, TI_TempNPCListMaxSize);
|
table.remove(TI_TempNPCList, TI_TempNPCListMaxSize);
|
||||||
@ -601,62 +677,121 @@ function TI_StripDescriptors(...)
|
|||||||
return x;
|
return x;
|
||||||
end
|
end
|
||||||
|
|
||||||
function TI_TabulateGossipOptions(...)
|
function TI_TabulateGossipQuestUIInfo(gquis)
|
||||||
local x = {};
|
local x = {};
|
||||||
local arg = {...};
|
|
||||||
for i=1, #arg, 2 do
|
for i,gqui in ipairs(gquis) do
|
||||||
local temp = {};
|
local temp = {};
|
||||||
temp.name = arg[i];
|
temp.name = gqui.title;
|
||||||
temp.type = arg[i+1];
|
|
||||||
|
temp.icon = QuestUtil.GetQuestIconOffer(
|
||||||
|
gqui.isLegendary,
|
||||||
|
gqui.frequency,
|
||||||
|
gqui.isRepeatable,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
temp.questID = gqui.questID;
|
||||||
|
temp.isComplete = gqui.isComplete;
|
||||||
|
|
||||||
table.insert(x, temp);
|
table.insert(x, temp);
|
||||||
end
|
end
|
||||||
return x;
|
return x;
|
||||||
end
|
end
|
||||||
|
|
||||||
function TI_TabulateGossipAvailableQuests(...)
|
function TI_TabulateGossipUIInfo(guis)
|
||||||
|
local x = {};
|
||||||
|
table.sort(guis, GossipOptionSort);
|
||||||
|
for i,gui in ipairs(guis) do
|
||||||
|
local temp = {};
|
||||||
|
temp.name = gui.name;
|
||||||
|
local gossipType = TI_TranslateIconToType(gui.icon)
|
||||||
|
if gossipType == "chatbubble" then
|
||||||
|
gossipType = "gossip"
|
||||||
|
end
|
||||||
|
temp.type = gossipType;
|
||||||
|
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)
|
||||||
local x = {};
|
local x = {};
|
||||||
|
|
||||||
for i=1, select("#", ...), 5 do
|
for i,gqui in ipairs(gquis) do
|
||||||
local temp = {};
|
local temp = {};
|
||||||
temp.name = select(i, ...);
|
temp.name = gqui.title;
|
||||||
|
|
||||||
isTrivial = select(i+2, ...);
|
if ( gqui.repeatable ) then
|
||||||
isDaily = select(i+3, ...);
|
|
||||||
isRepeatable = select(i+4, ...);
|
|
||||||
if ( isDaily ) then
|
|
||||||
temp.icon = "Interface\\GossipFrame\\DailyQuestIcon";
|
temp.icon = "Interface\\GossipFrame\\DailyQuestIcon";
|
||||||
elseif ( isRepeatable ) then
|
elseif ( gqui.isLegendary ) then
|
||||||
temp.icon = "Interface\\GossipFrame\\DailyActiveQuestIcon";
|
temp.icon = "Interface\\GossipFrame\\AvailableLegendaryQuestIcon";
|
||||||
else
|
else
|
||||||
temp.icon = "Interface\\GossipFrame\\AvailableQuestIcon";
|
temp.icon = "Interface\\GossipFrame\\AvailableQuestIcon";
|
||||||
end
|
end
|
||||||
|
temp.questID = gqui.questID;
|
||||||
|
temp.isComplete = gqui.isComplete;
|
||||||
|
|
||||||
table.insert(x, temp);
|
table.insert(x, temp);
|
||||||
end
|
end
|
||||||
return x;
|
return x;
|
||||||
end
|
end
|
||||||
|
|
||||||
function TI_TabulateGossipActiveQuests(...)
|
function TI_TabulateGossipActiveQuests_Classic(gquis)
|
||||||
local x = {};
|
local x = {};
|
||||||
|
|
||||||
for i=1, select("#", ...), 4 do
|
for i,gqui in ipairs(gquis) do
|
||||||
local temp = {};
|
local temp = {};
|
||||||
temp.name = select(i, ...);
|
temp.name = gqui.title;
|
||||||
|
|
||||||
isComplete = select(i+3, ...);
|
if ( gqui.repeatable ) then
|
||||||
if(isComplete) then
|
temp.icon = "Interface\\GossipFrame\\DailyQuestIcon";
|
||||||
temp.icon = "Interface\\GossipFrame\\ActiveQuestIcon";
|
elseif ( gqui.isLegendary ) then
|
||||||
|
temp.icon = "Interface\\GossipFrame\\AvailableLegendaryQuestIcon";
|
||||||
else
|
else
|
||||||
temp.icon = "Interface\\GossipFrame\\IncompleteQuestIcon";
|
temp.icon = "Interface\\GossipFrame\\AvailableQuestIcon";
|
||||||
end
|
end
|
||||||
|
temp.questID = gqui.questID;
|
||||||
|
temp.isComplete = gqui.isComplete;
|
||||||
|
|
||||||
table.insert(x, temp);
|
table.insert(x, temp);
|
||||||
end
|
end
|
||||||
return x;
|
return x;
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[this function stolen from WhisperCast by Sarris, whom I love dearly for his contribution to Paladins everywhere.
|
TI_FunctionList = {}
|
||||||
]]
|
function TI_SetupFunctions()
|
||||||
|
TI_FunctionList = {
|
||||||
|
g = {
|
||||||
|
availquest = C_GossipInfo.SelectAvailableQuest,
|
||||||
|
activequest = C_GossipInfo.SelectActiveQuest,
|
||||||
|
gossip = C_GossipInfo.SelectOptionByIndex,
|
||||||
|
getavailquests = C_GossipInfo.GetAvailableQuests,
|
||||||
|
getactivequests = C_GossipInfo.GetActiveQuests,
|
||||||
|
getoptions = C_GossipInfo.GetOptions,
|
||||||
|
tabulateOptions = TI_TabulateGossipUIInfo,
|
||||||
|
},
|
||||||
|
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()
|
||||||
|
|
||||||
|
|
||||||
function TI_copyTable( src )
|
function TI_copyTable( src )
|
||||||
local copy = {}
|
local copy = {}
|
||||||
for k1,v1 in pairs(src) do
|
for k1,v1 in pairs(src) do
|
||||||
|
|||||||
6
TurnIn.toc
Normal file → Executable file
6
TurnIn.toc
Normal file → Executable file
@ -1,7 +1,7 @@
|
|||||||
## Interface: 30300
|
## Interface: 120100, 120000, 120001, 50503, 40402, 30405, 20505, 11508
|
||||||
## X-Compatible-With: 40000
|
## X-Compatible-With: 120100, 120000, 120001, 50503, 40402, 30405, 20505, 11508
|
||||||
## Title: Turn In
|
## Title: Turn In
|
||||||
## Notes: Automates the selection of quest and gossip options.
|
## Notes: Automates the selection of quest and gossip options.
|
||||||
## SavedVariables: TI_status, TI_NPCDB, TI_NPCIndex
|
## SavedVariables: TI_status, TI_NPCDB, TI_NPCIndex
|
||||||
## Version: 2.1
|
## Version: 2.2
|
||||||
TurnIn.xml
|
TurnIn.xml
|
||||||
327
TurnIn.xml
Normal file → Executable file
327
TurnIn.xml
Normal file → Executable file
@ -1,8 +1,9 @@
|
|||||||
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd">
|
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd">
|
||||||
<Script file="TurnIn.lua" />
|
<Script file="TurnIn.lua" />
|
||||||
<Script file="TurnInUI.lua" />
|
<Script file="TurnInUI.lua" />
|
||||||
|
|
||||||
<Frame name="TI_OptionFrameBoxTemplate" virtual="true">
|
<Frame name="TI_OptionFrameBoxTemplate" virtual="true" inherits="BackdropTemplate">
|
||||||
<!-- shamelessly stolen from blizzard -->
|
<!-- shamelessly stolen from blizzard -->
|
||||||
<Layers>
|
<Layers>
|
||||||
<Layer level="BACKGROUND">
|
<Layer level="BACKGROUND">
|
||||||
@ -17,19 +18,12 @@
|
|||||||
</FontString>
|
</FontString>
|
||||||
</Layer>
|
</Layer>
|
||||||
</Layers>
|
</Layers>
|
||||||
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
|
<KeyValues>
|
||||||
<EdgeSize>
|
<KeyValue key="backdropInfo" value="BACKDROP_TUTORIAL_16_16" type="global"/>
|
||||||
<AbsValue val="16"/>
|
</KeyValues>
|
||||||
</EdgeSize>
|
|
||||||
<TileSize>
|
|
||||||
<AbsValue val="16"/>
|
|
||||||
</TileSize>
|
|
||||||
<BackgroundInsets>
|
|
||||||
<AbsInset left="5" right="5" top="5" bottom="5"/>
|
|
||||||
</BackgroundInsets>
|
|
||||||
</Backdrop>
|
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
|
self:ApplyBackdrop();
|
||||||
self:SetBackdropBorderColor(0.4, 0.4, 0.4);
|
self:SetBackdropBorderColor(0.4, 0.4, 0.4);
|
||||||
self:SetBackdropColor(0.5, 0.5, 0.5);
|
self:SetBackdropColor(0.5, 0.5, 0.5);
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
@ -51,7 +45,7 @@
|
|||||||
-->
|
-->
|
||||||
</Scripts>
|
</Scripts>
|
||||||
<Frames>
|
<Frames>
|
||||||
<CheckButton name="$parent_Check" hidden="false" inherits="OptionsCheckButtonTemplate">
|
<CheckButton name="$parent_Check" hidden="false" inherits="UICheckButtonTemplate">
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT"/>
|
<Anchor point="TOPLEFT"/>
|
||||||
</Anchors>
|
</Anchors>
|
||||||
@ -63,13 +57,13 @@
|
|||||||
</Size>
|
</Size>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnEnter>
|
<OnEnter>
|
||||||
TI_OptionListCheckboxTooltip();
|
TI_OptionListCheckboxTooltip(self);
|
||||||
</OnEnter>
|
</OnEnter>
|
||||||
<OnLeave>
|
<OnLeave>
|
||||||
TI_TooltipHide();
|
TI_TooltipHide();
|
||||||
</OnLeave>
|
</OnLeave>
|
||||||
<OnClick>
|
<OnClick>
|
||||||
TI_OptionToggle();
|
TI_OptionToggle(self);
|
||||||
</OnClick>
|
</OnClick>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</CheckButton>
|
</CheckButton>
|
||||||
@ -86,13 +80,13 @@
|
|||||||
</Anchors>
|
</Anchors>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnEnter>
|
<OnEnter>
|
||||||
TI_TooltipMessage("Decrease this option's priority.");
|
TI_TooltipMessage(self, "Decrease this option's priority.");
|
||||||
</OnEnter>
|
</OnEnter>
|
||||||
<OnLeave>
|
<OnLeave>
|
||||||
TI_TooltipHide();
|
TI_TooltipHide();
|
||||||
</OnLeave>
|
</OnLeave>
|
||||||
<OnClick>
|
<OnClick>
|
||||||
TI_OptionMove(1);
|
TI_OptionMove(self, 1);
|
||||||
</OnClick>
|
</OnClick>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
<NormalTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Up"/>
|
<NormalTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Up"/>
|
||||||
@ -113,10 +107,10 @@
|
|||||||
</Anchors>
|
</Anchors>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnClick>
|
<OnClick>
|
||||||
TI_OptionMove(-1);
|
TI_OptionMove(self, -1);
|
||||||
</OnClick>
|
</OnClick>
|
||||||
<OnEnter>
|
<OnEnter>
|
||||||
TI_TooltipMessage("Increase this option's priority.");
|
TI_TooltipMessage(self, "Increase this option's priority.");
|
||||||
</OnEnter>
|
</OnEnter>
|
||||||
<OnLeave>
|
<OnLeave>
|
||||||
TI_TooltipHide();
|
TI_TooltipHide();
|
||||||
@ -142,7 +136,7 @@
|
|||||||
</Anchor>
|
</Anchor>
|
||||||
</Anchors>
|
</Anchors>
|
||||||
</Texture>
|
</Texture>
|
||||||
<FontString name="$parent_Text" inherits="GameFontNormal" justifyV="top" justifyH="left">
|
<FontString name="$parent_Text" inherits="GameFontNormal" justifyV="TOP" justifyH="LEFT">
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT" relativeTo="$parent_Icon" relativePoint="TOPRIGHT">
|
<Anchor point="TOPLEFT" relativeTo="$parent_Icon" relativePoint="TOPRIGHT">
|
||||||
<Offset>
|
<Offset>
|
||||||
@ -187,7 +181,7 @@
|
|||||||
<AbsDimension x="232" y="20" />
|
<AbsDimension x="232" y="20" />
|
||||||
</Size>
|
</Size>
|
||||||
<Frames>
|
<Frames>
|
||||||
<CheckButton name="$parent_Check" hidden="false" inherits="OptionsCheckButtonTemplate">
|
<CheckButton name="$parent_Check" hidden="false" inherits="UICheckButtonTemplate">
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT"/>
|
<Anchor point="TOPLEFT"/>
|
||||||
</Anchors>
|
</Anchors>
|
||||||
@ -199,18 +193,18 @@
|
|||||||
</Size>
|
</Size>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnClick>
|
<OnClick>
|
||||||
TI_NPCToggle();
|
TI_NPCToggle(self);
|
||||||
TI_NPCListCheckboxTooltip();
|
TI_NPCListCheckboxTooltip(self);
|
||||||
</OnClick>
|
</OnClick>
|
||||||
<OnEnter>
|
<OnEnter>
|
||||||
TI_NPCListCheckboxTooltip();
|
TI_NPCListCheckboxTooltip(self);
|
||||||
</OnEnter>
|
</OnEnter>
|
||||||
<OnLeave>
|
<OnLeave>
|
||||||
TI_TooltipHide();
|
TI_TooltipHide();
|
||||||
</OnLeave>
|
</OnLeave>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</CheckButton>
|
</CheckButton>
|
||||||
<Button name="$parent_Delete" hidden="false" inherits="OptionsButtonTemplate" text="X">
|
<Button name="$parent_Delete" hidden="false" inherits="UIPanelButtonTemplate" text="X">
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="RIGHT">
|
<Anchor point="RIGHT">
|
||||||
<Offset>
|
<Offset>
|
||||||
@ -223,20 +217,20 @@
|
|||||||
</Size>
|
</Size>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnEnter>
|
<OnEnter>
|
||||||
TI_TooltipMessage("Delete this NPC.");
|
TI_TooltipMessage(self, "Delete this NPC.");
|
||||||
</OnEnter>
|
</OnEnter>
|
||||||
<OnLeave>
|
<OnLeave>
|
||||||
TI_TooltipHide();
|
TI_TooltipHide();
|
||||||
</OnLeave>
|
</OnLeave>
|
||||||
<OnClick>
|
<OnClick>
|
||||||
TI_DeleteNPCIndex();
|
TI_DeleteNPCIndex(self);
|
||||||
</OnClick>
|
</OnClick>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</Button>
|
</Button>
|
||||||
</Frames>
|
</Frames>
|
||||||
<Layers>
|
<Layers>
|
||||||
<Layer level="ARTWORK">
|
<Layer level="ARTWORK">
|
||||||
<FontString name="$parent_Text" justifyV="top" justifyH="left" inherits="GameFontNormal" text="">
|
<FontString name="$parent_Text" justifyV="TOP" justifyH="LEFT" inherits="GameFontNormal" text="">
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="LEFT">
|
<Anchor point="LEFT">
|
||||||
<Offset>
|
<Offset>
|
||||||
@ -249,7 +243,7 @@
|
|||||||
</Layers>
|
</Layers>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnClick>
|
<OnClick>
|
||||||
TI_SelectNPCIndex();
|
TI_SelectNPCIndex(self);
|
||||||
</OnClick>
|
</OnClick>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
<HighlightTexture file="Interface\QuestFrame\UI-QuestTitleHighlight" alphaMode="ADD"/>
|
<HighlightTexture file="Interface\QuestFrame\UI-QuestTitleHighlight" alphaMode="ADD"/>
|
||||||
@ -257,10 +251,10 @@
|
|||||||
|
|
||||||
<GameTooltip name="TI_Tooltip" hidden="true" inherits="GameTooltipTemplate" />
|
<GameTooltip name="TI_Tooltip" hidden="true" inherits="GameTooltipTemplate" />
|
||||||
|
|
||||||
<Frame Name="TI_TempNPCListEntry" virtual="true" hidden="true">
|
<Frame name="TI_TempNPCListEntry" virtual="true" hidden="true">
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnEnter>
|
<OnEnter>
|
||||||
TI_TempNPCListTooltipShow();
|
TI_TempNPCListTooltipShow(self);
|
||||||
</OnEnter>
|
</OnEnter>
|
||||||
<OnLeave>
|
<OnLeave>
|
||||||
TI_TooltipHide();
|
TI_TooltipHide();
|
||||||
@ -272,7 +266,7 @@
|
|||||||
|
|
||||||
<Layers>
|
<Layers>
|
||||||
<Layer level="ARTWORK">
|
<Layer level="ARTWORK">
|
||||||
<FontString name="$parent_Text" justifyV="top" justifyH="left" inherits="GameFontNormal" text="">
|
<FontString name="$parent_Text" justifyV="TOP" justifyH="LEFT" inherits="GameFontNormal" text="">
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="LEFT">
|
<Anchor point="LEFT">
|
||||||
<Offset>
|
<Offset>
|
||||||
@ -284,7 +278,7 @@
|
|||||||
</Layer>
|
</Layer>
|
||||||
</Layers>
|
</Layers>
|
||||||
<Frames>
|
<Frames>
|
||||||
<Button name="$parent_Delete" hidden="false" inherits="OptionsButtonTemplate" text="X">
|
<Button name="$parent_Delete" hidden="false" inherits="UIPanelButtonTemplate" text="X">
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPRIGHT">
|
<Anchor point="TOPRIGHT">
|
||||||
<Offset>
|
<Offset>
|
||||||
@ -300,14 +294,14 @@
|
|||||||
TI_DeleteTempNPCIndex(self:GetParent():GetID());
|
TI_DeleteTempNPCIndex(self:GetParent():GetID());
|
||||||
</OnClick>
|
</OnClick>
|
||||||
<OnEnter>
|
<OnEnter>
|
||||||
TI_TooltipMessage("Delete");
|
TI_TooltipMessage(self, "Delete");
|
||||||
</OnEnter>
|
</OnEnter>
|
||||||
<OnLeave>
|
<OnLeave>
|
||||||
TI_TooltipHide();
|
TI_TooltipHide();
|
||||||
</OnLeave>
|
</OnLeave>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</Button>
|
</Button>
|
||||||
<Button name="$parent_Add" hidden="false" inherits="OptionsButtonTemplate" text="+">
|
<Button name="$parent_Add" hidden="false" inherits="UIPanelButtonTemplate" text="+">
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="RIGHT" relativeTo="$parent_Delete" relativePoint="LEFT">
|
<Anchor point="RIGHT" relativeTo="$parent_Delete" relativePoint="LEFT">
|
||||||
<Offset>
|
<Offset>
|
||||||
@ -323,7 +317,7 @@
|
|||||||
TI_AddTempNPCIndex(self:GetParent():GetID());
|
TI_AddTempNPCIndex(self:GetParent():GetID());
|
||||||
</OnClick>
|
</OnClick>
|
||||||
<OnEnter>
|
<OnEnter>
|
||||||
TI_TooltipMessage("Add this NPC to the database");
|
TI_TooltipMessage(self, "Add this NPC to the database");
|
||||||
</OnEnter>
|
</OnEnter>
|
||||||
<OnLeave>
|
<OnLeave>
|
||||||
TI_TooltipHide();
|
TI_TooltipHide();
|
||||||
@ -333,7 +327,7 @@
|
|||||||
</Frames>
|
</Frames>
|
||||||
</Frame>
|
</Frame>
|
||||||
|
|
||||||
<Frame Name="TI_TempNPCListWindow" parent="UIParent" frameStrata="DIALOG" toplevel="true" enableMouse="true" movable="true" hidden="true">
|
<Frame name="TI_TempNPCListWindow" parent="UIParent" frameStrata="DIALOG" toplevel="true" enableMouse="true" movable="true" hidden="true" inherits="BackdropTemplate">
|
||||||
<Size>
|
<Size>
|
||||||
<AbsDimension x="200" y="130" />
|
<AbsDimension x="200" y="130" />
|
||||||
</Size>
|
</Size>
|
||||||
@ -403,18 +397,24 @@
|
|||||||
</Anchors>
|
</Anchors>
|
||||||
</Frame>
|
</Frame>
|
||||||
</Frames>
|
</Frames>
|
||||||
<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
|
<KeyValues>
|
||||||
<EdgeSize>
|
<KeyValue key="backdropInfo" value="BACKDROP_TUTORIAL_16_16" type="global"/>
|
||||||
<AbsValue val="16"/>
|
</KeyValues>
|
||||||
</EdgeSize>
|
|
||||||
<TileSize>
|
|
||||||
<AbsValue val="16"/>
|
|
||||||
</TileSize>
|
|
||||||
<BackgroundInsets>
|
|
||||||
<AbsInset left="5" right="5" top="5" bottom="5"/>
|
|
||||||
</BackgroundInsets>
|
|
||||||
</Backdrop>
|
|
||||||
<Scripts>
|
<Scripts>
|
||||||
|
<OnLoad>
|
||||||
|
self.backdropInfo = {
|
||||||
|
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
|
||||||
|
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
|
||||||
|
tile = true,
|
||||||
|
tileEdge = true,
|
||||||
|
tileSize = 16,
|
||||||
|
edgeSize = 16,
|
||||||
|
insets = { left = 5, right = 5, top = 5, bottom = 5 },
|
||||||
|
};
|
||||||
|
self:ApplyBackdrop();
|
||||||
|
self:SetBackdropBorderColor(0.6, 0.6, 0.6);
|
||||||
|
self:SetBackdropColor(0.2, 0.2, 0.2);
|
||||||
|
</OnLoad>
|
||||||
<OnMouseUp>
|
<OnMouseUp>
|
||||||
if ( self.isMoving ) then
|
if ( self.isMoving ) then
|
||||||
self:StopMovingOrSizing();
|
self:StopMovingOrSizing();
|
||||||
@ -422,7 +422,7 @@
|
|||||||
end
|
end
|
||||||
</OnMouseUp>
|
</OnMouseUp>
|
||||||
<OnMouseDown>
|
<OnMouseDown>
|
||||||
if ( arg1 == "LeftButton" ) then
|
if ( button == "LeftButton" ) then
|
||||||
self:StartMoving();
|
self:StartMoving();
|
||||||
self.isMoving = true;
|
self.isMoving = true;
|
||||||
end
|
end
|
||||||
@ -436,36 +436,24 @@
|
|||||||
</Scripts>
|
</Scripts>
|
||||||
</Frame>
|
</Frame>
|
||||||
|
|
||||||
<Frame Name="TI_OptionsFrame" frameStrata="DIALOG" toplevel="true" enableMouse="true" enableMouseWheel="true" movable="true" parent="UIParent">
|
<Frame name="TI_OptionsFrame" inherits="BackdropTemplate" frameStrata="DIALOG" toplevel="true" enableMouse="true" movable="true" parent="UIParent">
|
||||||
<TitleRegion>
|
|
||||||
<Size>
|
|
||||||
<AbsDimension x="128" y="64"/>
|
|
||||||
</Size>
|
|
||||||
<Anchors>
|
|
||||||
<Anchor point="TOP">
|
|
||||||
<Offset>
|
|
||||||
<AbsDimension x="0" y="12"/>
|
|
||||||
</Offset>
|
|
||||||
</Anchor>
|
|
||||||
</Anchors>
|
|
||||||
</TitleRegion>
|
|
||||||
|
|
||||||
<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
|
<KeyValues>
|
||||||
<BackgroundInsets>
|
<KeyValue key="backdropInfo" value="BACKDROP_DIALOG_32_32" type="global"/>
|
||||||
<AbsInset left="11" right="12" top="12" bottom="11"/>
|
</KeyValues>
|
||||||
</BackgroundInsets>
|
|
||||||
<TileSize>
|
|
||||||
<AbsValue val="32"/>
|
|
||||||
</TileSize>
|
|
||||||
<EdgeSize>
|
|
||||||
<AbsValue val="32"/>
|
|
||||||
</EdgeSize>
|
|
||||||
</Backdrop>
|
|
||||||
|
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnShow>
|
<OnLoad>
|
||||||
|
self:ApplyBackdrop()
|
||||||
</OnShow>
|
self:EnableMouse(true)
|
||||||
|
self:RegisterForDrag("LeftButton")
|
||||||
|
</OnLoad>
|
||||||
|
<OnDragStart>
|
||||||
|
self:StartMoving()
|
||||||
|
</OnDragStart>
|
||||||
|
<OnDragStop>
|
||||||
|
self:StopMovingOrSizing()
|
||||||
|
</OnDragStop>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
<Size>
|
<Size>
|
||||||
<AbsDimension x="300" y="500"/>
|
<AbsDimension x="300" y="500"/>
|
||||||
@ -523,7 +511,7 @@
|
|||||||
<AbsDimension x="200" y="20" />
|
<AbsDimension x="200" y="20" />
|
||||||
</Size>
|
</Size>
|
||||||
<Frames>
|
<Frames>
|
||||||
<CheckButton name="$parent_Checkbox" hidden="false" inherits="OptionsCheckButtonTemplate">
|
<CheckButton name="$parent_Checkbox" hidden="false" inherits="UICheckButtonTemplate">
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT">
|
<Anchor point="TOPLEFT">
|
||||||
<Offset>
|
<Offset>
|
||||||
@ -539,7 +527,7 @@
|
|||||||
</Size>
|
</Size>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnClick>
|
<OnClick>
|
||||||
TI_StatusIndicator_CheckFn();
|
TI_StatusIndicator_CheckFn(self);
|
||||||
</OnClick>
|
</OnClick>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</CheckButton>
|
</CheckButton>
|
||||||
@ -585,7 +573,7 @@
|
|||||||
<AbsDimension x="200" y="40" />
|
<AbsDimension x="200" y="40" />
|
||||||
</Size>
|
</Size>
|
||||||
<Frames>
|
<Frames>
|
||||||
<CheckButton name="$parent_UseDefault" hidden="false" inherits="OptionsCheckButtonTemplate">
|
<CheckButton name="$parent_UseDefault" hidden="false" inherits="UICheckButtonTemplate">
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT">
|
<Anchor point="TOPLEFT">
|
||||||
<Offset>
|
<Offset>
|
||||||
@ -601,11 +589,11 @@
|
|||||||
</Size>
|
</Size>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnClick>
|
<OnClick>
|
||||||
TI_SettingCheckboxFn("usedefault");
|
TI_SettingCheckboxFn(self, "usedefault");
|
||||||
</OnClick>
|
</OnClick>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</CheckButton>
|
</CheckButton>
|
||||||
<CheckButton name="$parent_AddAutomatically" hidden="false" inherits="OptionsCheckButtonTemplate">
|
<CheckButton name="$parent_AddAutomatically" hidden="false" inherits="UICheckButtonTemplate">
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT" relativeTo="$parent_UseDefault" relativePoint="BOTTOMLEFT">
|
<Anchor point="TOPLEFT" relativeTo="$parent_UseDefault" relativePoint="BOTTOMLEFT">
|
||||||
<Offset>
|
<Offset>
|
||||||
@ -621,7 +609,7 @@
|
|||||||
</Size>
|
</Size>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnClick>
|
<OnClick>
|
||||||
TI_SettingCheckboxFn("autoadd");
|
TI_SettingCheckboxFn(self, "autoadd");
|
||||||
</OnClick>
|
</OnClick>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</CheckButton>
|
</CheckButton>
|
||||||
@ -658,6 +646,7 @@
|
|||||||
<Frame name="TI_OptionsPriorityContainer" inherits="TI_OptionFrameBoxTemplate">
|
<Frame name="TI_OptionsPriorityContainer" inherits="TI_OptionFrameBoxTemplate">
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
|
self:ApplyBackdrop();
|
||||||
self:SetBackdropBorderColor(0.4, 0.4, 0.4);
|
self:SetBackdropBorderColor(0.4, 0.4, 0.4);
|
||||||
self:SetBackdropColor(0.15, 0.15, 0.15);
|
self:SetBackdropColor(0.15, 0.15, 0.15);
|
||||||
getglobal(self:GetName().."Title"):SetText("Gossip Options Priority List");
|
getglobal(self:GetName().."Title"):SetText("Gossip Options Priority List");
|
||||||
@ -695,167 +684,6 @@
|
|||||||
<Size>
|
<Size>
|
||||||
<AbsDimension x="200" y="30"/>
|
<AbsDimension x="200" y="30"/>
|
||||||
</Size>
|
</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>
|
</Frame>
|
||||||
</ScrollChild>
|
</ScrollChild>
|
||||||
</ScrollFrame>
|
</ScrollFrame>
|
||||||
@ -865,6 +693,7 @@
|
|||||||
<Frame name="TI_OptionsNPCContainer" inherits="TI_OptionFrameBoxTemplate">
|
<Frame name="TI_OptionsNPCContainer" inherits="TI_OptionFrameBoxTemplate">
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
|
self:ApplyBackdrop();
|
||||||
self:SetBackdropBorderColor(0.4, 0.4, 0.4);
|
self:SetBackdropBorderColor(0.4, 0.4, 0.4);
|
||||||
self:SetBackdropColor(0.15, 0.15, 0.15);
|
self:SetBackdropColor(0.15, 0.15, 0.15);
|
||||||
getglobal(self:GetName().."Title"):SetText("NPC Database");
|
getglobal(self:GetName().."Title"):SetText("NPC Database");
|
||||||
@ -882,7 +711,7 @@
|
|||||||
</Size>
|
</Size>
|
||||||
<Frames>
|
<Frames>
|
||||||
|
|
||||||
<ScrollFrame name="TI_NPCListScrollFrame" inherits="FauxScrollFrameTemplate" hidden="false" enableMouseWheel="true">
|
<ScrollFrame name="TI_NPCListScrollFrame" inherits="FauxScrollFrameTemplate" hidden="false" >
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT">
|
<Anchor point="TOPLEFT">
|
||||||
<Offset>
|
<Offset>
|
||||||
@ -987,12 +816,8 @@
|
|||||||
|
|
||||||
<Frame name="TurnIn" hidden="true" frameStrata="LOW" enableMouse="false">
|
<Frame name="TurnIn" hidden="true" frameStrata="LOW" enableMouse="false">
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad function="TI_OnLoad"/>
|
||||||
TI_OnLoad();
|
<OnEvent function="TI_OnEvent"/>
|
||||||
</OnLoad>
|
|
||||||
<OnEvent>
|
|
||||||
TI_OnEvent(event);
|
|
||||||
</OnEvent>
|
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</Frame>
|
</Frame>
|
||||||
</Ui>
|
</Ui>
|
||||||
|
|||||||
152
TurnInUI.lua
Normal file → Executable file
152
TurnInUI.lua
Normal file → Executable file
@ -1,3 +1,30 @@
|
|||||||
|
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;
|
||||||
@ -10,9 +37,9 @@ function TI_PopulateOptions(arg)
|
|||||||
end
|
end
|
||||||
|
|
||||||
for i,v in ipairs(CurrOpts) do
|
for i,v in ipairs(CurrOpts) do
|
||||||
local entry = "TI_OptionsPriority" .. i;
|
local entrybutton = TI_GetOptionsPriorityFrame(i);
|
||||||
local entrybutton = getglobal(entry);
|
local icon, entrytext = entrybutton:GetRegions();
|
||||||
local entrytext = getglobal("TI_OptionsPriority"..i.."_Text");
|
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);
|
||||||
@ -20,27 +47,30 @@ function TI_PopulateOptions(arg)
|
|||||||
if(v.icon) then
|
if(v.icon) then
|
||||||
iconpath = v.icon;
|
iconpath = v.icon;
|
||||||
else
|
else
|
||||||
iconpath = "Interface\\GossipFrame\\ActiveQuestIcon";
|
iconpath = "Interface/GossipFrame/ActiveQuestIcon";
|
||||||
end
|
end
|
||||||
elseif(v.type == "availquest") then
|
elseif(v.type == "availquest") then
|
||||||
if(v.icon) then
|
if(v.icon) then
|
||||||
iconpath = v.icon;
|
iconpath = v.icon;
|
||||||
else
|
else
|
||||||
iconpath = "Interface\\GossipFrame\\AvailableQuestIcon";
|
iconpath = "Interface/GossipFrame/AvailableQuestIcon";
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
iconpath = "Interface\\GossipFrame\\" .. v.type .. "GossipIcon";
|
if(v.icon) then
|
||||||
|
iconpath = v.icon;
|
||||||
|
else
|
||||||
|
iconpath = "Interface/GossipFrame/" .. v.type .. "GossipIcon";
|
||||||
|
end
|
||||||
end
|
end
|
||||||
getglobal(entry .. "_Icon"):SetTexture(iconpath);
|
icon:SetTexture(iconpath);
|
||||||
getglobal(entry .. "_Check"):SetChecked(v.state);
|
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
|
TI_HideUnusedOptionFrames(last);
|
||||||
getglobal("TI_OptionsPriority" .. j):Hide();
|
|
||||||
end
|
|
||||||
TI_OptionsPriorityScrollFrame:SetVerticalScroll(0);
|
TI_OptionsPriorityScrollFrame:SetVerticalScroll(0);
|
||||||
TI_OptionsPriorityScrollFrame:UpdateScrollChildRect();
|
TI_OptionsPriorityScrollFrame:UpdateScrollChildRect();
|
||||||
TI_StatusIndicatorUpdate();
|
TI_StatusIndicatorUpdate();
|
||||||
@ -49,31 +79,6 @@ function TI_PopulateOptions(arg)
|
|||||||
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
|
||||||
@ -85,19 +90,6 @@ function TI_NPCListScrollBarUpdate()
|
|||||||
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);
|
||||||
@ -118,8 +110,8 @@ function TI_NPCListScrollBarUpdate()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function TI_SelectNPCIndex()
|
function TI_SelectNPCIndex(self)
|
||||||
local index = this:GetID();
|
local index = self:GetID();
|
||||||
if(TI_LoadedNPCIndex == index) then
|
if(TI_LoadedNPCIndex == index) then
|
||||||
TI_LoadedNPCIndex = 0;
|
TI_LoadedNPCIndex = 0;
|
||||||
else
|
else
|
||||||
@ -129,8 +121,8 @@ function TI_SelectNPCIndex()
|
|||||||
TI_PopulateOptions("select npc");
|
TI_PopulateOptions("select npc");
|
||||||
end
|
end
|
||||||
|
|
||||||
function TI_DeleteNPCIndex()
|
function TI_DeleteNPCIndex(self)
|
||||||
local index = this:GetParent():GetID();
|
local index = self:GetParent():GetID();
|
||||||
TI_DeleteNPC(index);
|
TI_DeleteNPC(index);
|
||||||
if(TI_LoadedNPCIndex == index) then
|
if(TI_LoadedNPCIndex == index) then
|
||||||
TI_LoadedNPCIndex = 0;
|
TI_LoadedNPCIndex = 0;
|
||||||
@ -138,9 +130,9 @@ function TI_DeleteNPCIndex()
|
|||||||
TI_PopulateOptions("npclist update");
|
TI_PopulateOptions("npclist update");
|
||||||
end
|
end
|
||||||
|
|
||||||
function TI_NPCToggle()
|
function TI_NPCToggle(self)
|
||||||
local index = this:GetParent():GetID();
|
local index = self:GetParent():GetID();
|
||||||
TI_NPCDB[TI_NPCIndex[index]].state = this:GetChecked();
|
TI_NPCDB[TI_NPCIndex[index]].state = self:GetChecked();
|
||||||
|
|
||||||
if(TI_NPCDB[TI_NPCIndex[index]].state) then
|
if(TI_NPCDB[TI_NPCIndex[index]].state) then
|
||||||
TI_LoadedNPCIndex = index;
|
TI_LoadedNPCIndex = index;
|
||||||
@ -152,14 +144,14 @@ function TI_NPCToggle()
|
|||||||
TI_PopulateOptions("select npc");
|
TI_PopulateOptions("select npc");
|
||||||
end
|
end
|
||||||
|
|
||||||
function TI_OptionMove(offset)
|
function TI_OptionMove(self, offset)
|
||||||
local CurrOpts;
|
local CurrOpts;
|
||||||
if(TI_LoadedNPCIndex > 0) then
|
if(TI_LoadedNPCIndex > 0) then
|
||||||
CurrOpts = TI_NPCDB[TI_NPCIndex[TI_LoadedNPCIndex]];
|
CurrOpts = TI_NPCDB[TI_NPCIndex[TI_LoadedNPCIndex]];
|
||||||
else
|
else
|
||||||
CurrOpts = TI_status.options;
|
CurrOpts = TI_status.options;
|
||||||
end
|
end
|
||||||
local id = this:GetParent():GetID();
|
local id = self:GetParent():GetID();
|
||||||
local newid = id + offset;
|
local newid = id + offset;
|
||||||
|
|
||||||
if(newid < 1 or newid > table.getn(CurrOpts)) then
|
if(newid < 1 or newid > table.getn(CurrOpts)) then
|
||||||
@ -173,15 +165,15 @@ function TI_OptionMove(offset)
|
|||||||
TI_PopulateOptions("move");
|
TI_PopulateOptions("move");
|
||||||
end
|
end
|
||||||
|
|
||||||
function TI_OptionToggle()
|
function TI_OptionToggle(self)
|
||||||
local CurrOpts;
|
local CurrOpts;
|
||||||
if(TI_LoadedNPCIndex > 0) then
|
if(TI_LoadedNPCIndex > 0) then
|
||||||
CurrOpts = TI_NPCDB[TI_NPCIndex[TI_LoadedNPCIndex]];
|
CurrOpts = TI_NPCDB[TI_NPCIndex[TI_LoadedNPCIndex]];
|
||||||
else
|
else
|
||||||
CurrOpts = TI_status.options;
|
CurrOpts = TI_status.options;
|
||||||
end
|
end
|
||||||
local id = this:GetParent():GetID();
|
local id = self:GetParent():GetID();
|
||||||
if(this:GetChecked()) then
|
if(self:GetChecked()) then
|
||||||
CurrOpts[id].state=true;
|
CurrOpts[id].state=true;
|
||||||
else
|
else
|
||||||
CurrOpts[id].state=false;
|
CurrOpts[id].state=false;
|
||||||
@ -202,8 +194,8 @@ function TI_StatusIndicatorUpdate()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function TI_StatusIndicator_CheckFn()
|
function TI_StatusIndicator_CheckFn(self)
|
||||||
if(this:GetChecked()) then
|
if(self:GetChecked()) then
|
||||||
TI_Switch("on");
|
TI_Switch("on");
|
||||||
else
|
else
|
||||||
TI_Switch("off");
|
TI_Switch("off");
|
||||||
@ -211,10 +203,10 @@ function TI_StatusIndicator_CheckFn()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function TI_TempNPCListTooltipShow()
|
function TI_TempNPCListTooltipShow(self)
|
||||||
TI_Tooltip:SetOwner(this, ANCHOR_PRESERVE);
|
TI_Tooltip:SetOwner(self, ANCHOR_PRESERVE);
|
||||||
TI_Tooltip:ClearLines();
|
TI_Tooltip:ClearLines();
|
||||||
local id = this:GetID();
|
local id = self:GetID();
|
||||||
TI_Tooltip:AddLine(TI_TempNPCList[id].location);
|
TI_Tooltip:AddLine(TI_TempNPCList[id].location);
|
||||||
for i,v in ipairs(TI_TempNPCList[id].list) do
|
for i,v in ipairs(TI_TempNPCList[id].list) do
|
||||||
TI_Tooltip:AddLine("- " .. v.name);
|
TI_Tooltip:AddLine("- " .. v.name);
|
||||||
@ -228,8 +220,8 @@ function TI_TooltipHide()
|
|||||||
TI_Tooltip:Hide();
|
TI_Tooltip:Hide();
|
||||||
end
|
end
|
||||||
|
|
||||||
function TI_TooltipMessage(msg)
|
function TI_TooltipMessage(self, msg)
|
||||||
TI_Tooltip:SetOwner(this, ANCHOR_PRESERVE);
|
TI_Tooltip:SetOwner(self, ANCHOR_PRESERVE);
|
||||||
TI_Tooltip:ClearLines();
|
TI_Tooltip:ClearLines();
|
||||||
TI_Tooltip:SetText(msg);
|
TI_Tooltip:SetText(msg);
|
||||||
TI_Tooltip:Show();
|
TI_Tooltip:Show();
|
||||||
@ -238,34 +230,34 @@ end
|
|||||||
function TI_TempNPCListUpdate()
|
function TI_TempNPCListUpdate()
|
||||||
local last = 1;
|
local last = 1;
|
||||||
for i,v in ipairs(TI_TempNPCList) do
|
for i,v in ipairs(TI_TempNPCList) do
|
||||||
local tempbuttontext = getglobal("TI_TempNPCListWindow"..i.."_Text");
|
local tempbuttontext = _G["TI_TempNPCListWindow"..i.."_Text"];
|
||||||
tempbuttontext:SetText(v.name);
|
tempbuttontext:SetText(v.name);
|
||||||
tempbuttontext:GetParent():Show();
|
tempbuttontext:GetParent():Show();
|
||||||
last = last+1;
|
last = last+1;
|
||||||
end
|
end
|
||||||
for j=last, TI_TempNPCListMaxSize, 1 do
|
for j=last, TI_TempNPCListMaxSize, 1 do
|
||||||
getglobal("TI_TempNPCListWindow" .. j):Hide();
|
_G["TI_TempNPCListWindow" .. j]:Hide();
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function TI_NPCListCheckboxTooltip()
|
function TI_NPCListCheckboxTooltip(self)
|
||||||
if(this:GetChecked()) then
|
if(self:GetChecked()) then
|
||||||
TI_TooltipMessage("NPC is using specific settings.");
|
TI_TooltipMessage(self, "NPC is using specific settings.");
|
||||||
else
|
else
|
||||||
TI_TooltipMessage("NPC is using default settings.");
|
TI_TooltipMessage(self, "NPC is using default settings.");
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function TI_OptionListCheckboxTooltip()
|
function TI_OptionListCheckboxTooltip(self)
|
||||||
if(this:GetChecked()) then
|
if(self:GetChecked()) then
|
||||||
TI_TooltipMessage("This option is enabled.");
|
TI_TooltipMessage(self, "This option is enabled.");
|
||||||
else
|
else
|
||||||
TI_TooltipMessage("This option is disabled.");
|
TI_TooltipMessage(self, "This option is disabled.");
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function TI_SettingCheckboxFn(var)
|
function TI_SettingCheckboxFn(self, var)
|
||||||
if(this:GetChecked()) then
|
if(self:GetChecked()) then
|
||||||
TI_status[var] = true;
|
TI_status[var] = true;
|
||||||
else
|
else
|
||||||
TI_status[var] = false;
|
TI_status[var] = false;
|
||||||
|
|||||||
1
pkgmeta.yaml
Executable file
1
pkgmeta.yaml
Executable file
@ -0,0 +1 @@
|
|||||||
|
package-as: TurnIn
|
||||||
Loading…
Reference in New Issue
Block a user