Selaa lähdekoodia

Tagging as 2.0.11

tags/2.0.11
SabinDeus 16 vuotta sitten
vanhempi
commit
d06f10c3c5
4 muutettua tiedostoa jossa 1326 lisäystä ja 1326 poistoa
  1. 51
    51
      README.txt
  2. 5
    5
      TurnIn.toc
  3. 998
    998
      TurnIn.xml
  4. 272
    272
      TurnInUI.lua

+ 51
- 51
README.txt Näytä tiedosto

@@ -1,52 +1,52 @@
Turn In
v2.0
by Sabindeus of Smolderthorn/Andre of Argent Dawn (Alliance)
DESCRIPTION
-------------
An add-on that automates the clicking of Quests and NPC Gossip dialogues.
HOW TO USE
-------------
To bring up the Options window, type /ti window.
To bring up the Recently Visited NPCs window, type /ti templist.
Turn In keeps an NPC database, to allow you to customize your interactions on a per-NPC basis. Whenever you talk to an NPC, it appears in your Recently Visited NPCs window. From there you can decide if you want to add it to the Database so you can customize his options. Simply click the '+' button to add the NPC to the DB.
After Adding an NPC, you can check the checkbox next to its name in the NPC list and then rearrange or activate/deactive his options to your liking. If you uncheck the checkbox next to an NPC's name, it will use the default option set. If you want Turn In to specifically take no action for an NPC, simply deactivate all of his options, don't uncheck his checkbox in the NPC list!
When an NPC does not appear in the Database, Turn In uses the default option set to resolve interactions with it. You can customize the default option set by not having an NPC selected in the options window. The Use Default Settings checkbox determines whether talking to NPC not in the Database will use the default options or do nothing at all. The Automatically Add NPCs checkbox will cause all of your new NPC visits to automatically add the NPC to your NPC DB.
COMMAND SUMMARY
-------------
/turnin or /ti - basic slash command, shows help message
/turnin on - Turns on the mod, from now on all quests will be automatically chosen and completed. Additionally, any available quests will be accepted, and gossip options will be automatically chosen.
/turnin off - Deactivates the mod
/turnin toggle - Activates or deactivates the mod
/turnin window - Shows the options window
/turnin recent - Shows the recently visited NPCs window
CHANGE LOG
-------------
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 for beta testing like a pro!
Please send bug reports, questions or comments to Sabin1936@mac.com
Turn In
v2.0
by Sabindeus of Smolderthorn/Andre of Argent Dawn (Alliance)
DESCRIPTION
-------------
An add-on that automates the clicking of Quests and NPC Gossip dialogues.
HOW TO USE
-------------
To bring up the Options window, type /ti window.
To bring up the Recently Visited NPCs window, type /ti templist.
Turn In keeps an NPC database, to allow you to customize your interactions on a per-NPC basis. Whenever you talk to an NPC, it appears in your Recently Visited NPCs window. From there you can decide if you want to add it to the Database so you can customize his options. Simply click the '+' button to add the NPC to the DB.
After Adding an NPC, you can check the checkbox next to its name in the NPC list and then rearrange or activate/deactive his options to your liking. If you uncheck the checkbox next to an NPC's name, it will use the default option set. If you want Turn In to specifically take no action for an NPC, simply deactivate all of his options, don't uncheck his checkbox in the NPC list!
When an NPC does not appear in the Database, Turn In uses the default option set to resolve interactions with it. You can customize the default option set by not having an NPC selected in the options window. The Use Default Settings checkbox determines whether talking to NPC not in the Database will use the default options or do nothing at all. The Automatically Add NPCs checkbox will cause all of your new NPC visits to automatically add the NPC to your NPC DB.
COMMAND SUMMARY
-------------
/turnin or /ti - basic slash command, shows help message
/turnin on - Turns on the mod, from now on all quests will be automatically chosen and completed. Additionally, any available quests will be accepted, and gossip options will be automatically chosen.
/turnin off - Deactivates the mod
/turnin toggle - Activates or deactivates the mod
/turnin window - Shows the options window
/turnin recent - Shows the recently visited NPCs window
CHANGE LOG
-------------
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 for beta testing like a pro!
Please send bug reports, questions or comments to Sabin1936@mac.com
Thank you for downloading my add-on!

+ 5
- 5
TurnIn.toc Näytä tiedosto

@@ -1,6 +1,6 @@
## Interface: 30000
## Title: Turn In
## Description: Automates the selection of quest and gossip options.
## SavedVariables: TI_status, TI_NPCDB, TI_NPCIndex
## Version: 2.0.9
## Interface: 30300
## Title: Turn In
## Description: Automates the selection of quest and gossip options.
## SavedVariables: TI_status, TI_NPCDB, TI_NPCIndex
## Version: 2.0.11
TurnIn.xml

+ 998
- 998
TurnIn.xml
File diff suppressed because it is too large
Näytä tiedosto


+ 272
- 272
TurnInUI.lua Näytä tiedosto

@@ -1,272 +1,272 @@
function TI_PopulateOptions(arg)
TI_debug(arg);
local CurrOpts;
local last=1;
if(TI_status and TI_status.options) then
if(TI_LoadedNPCIndex > 0) then
CurrOpts = TI_NPCDB[TI_NPCIndex[TI_LoadedNPCIndex]];
else
CurrOpts = TI_status.options;
end
for i,v in ipairs(CurrOpts) do
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);
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);
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
for j=last, 16, 1 do
getglobal("TI_OptionsPriority" .. j):Hide();
end
TI_OptionsPriorityScrollFrame:SetVerticalScroll(0);
TI_OptionsPriorityScrollFrame:UpdateScrollChildRect();
TI_StatusIndicatorUpdate();
end
TI_NPCListScrollBarUpdate();
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
FauxScrollFrame_Update(TI_NPCListScrollFrame,table.getn(TI_NPCIndex),8,20);
-- arg2 is max entries, arg3 is number of lines, arg4 is pixel height of each line
local line; -- 1 through 8 of our window to scroll
local lineplusoffset; -- an index into our data calculated from the scroll offset
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);
if(lineplusoffset <= table.getn(TI_NPCIndex)) then
getglobal("TI_OptionsNPCContainer"..line):SetID(lineplusoffset);
getglobal("TI_OptionsNPCContainer"..line.."_Text"):SetText(TI_NPCIndex[lineplusoffset]);
getglobal("TI_OptionsNPCContainer"..line.."_Check"):SetChecked(TI_NPCDB[TI_NPCIndex[lineplusoffset]].state);
if(lineplusoffset == TI_LoadedNPCIndex) then
getglobal("TI_OptionsNPCContainer"..line):LockHighlight();
else
getglobal("TI_OptionsNPCContainer"..line):UnlockHighlight();
end
getglobal("TI_OptionsNPCContainer"..line):Show();
else
getglobal("TI_OptionsNPCContainer"..line):Hide();
end
end
end
end
function TI_SelectNPCIndex()
local index = this:GetID();
if(TI_LoadedNPCIndex == index) then
TI_LoadedNPCIndex = 0;
else
TI_LoadedNPCIndex = index;
end
TI_PopulateOptions("select npc");
end
function TI_DeleteNPCIndex()
local index = this:GetParent():GetID();
TI_DeleteNPC(index);
if(TI_LoadedNPCIndex == index) then
TI_LoadedNPCIndex = 0;
end
TI_PopulateOptions("npclist update");
end
function TI_NPCToggle()
local index = this:GetParent():GetID();
TI_NPCDB[TI_NPCIndex[index]].state = this:GetChecked();
if(TI_NPCDB[TI_NPCIndex[index]].state) then
TI_LoadedNPCIndex = index;
else
if(TI_LoadedNPCIndex == index) then
TI_LoadedNPCIndex = 0;
end
end
TI_PopulateOptions("select npc");
end
function TI_OptionMove(offset)
local CurrOpts;
if(TI_LoadedNPCIndex > 0) then
CurrOpts = TI_NPCDB[TI_NPCIndex[TI_LoadedNPCIndex]];
else
CurrOpts = TI_status.options;
end
local id = this:GetParent():GetID();
local newid = id + offset;
if(newid < 1 or newid > table.getn(CurrOpts)) then
return;
end
local temp = CurrOpts[newid];
CurrOpts[newid] = CurrOpts[id];
CurrOpts[id] = temp;
TI_PopulateOptions("move");
end
function TI_OptionToggle()
local CurrOpts;
if(TI_LoadedNPCIndex > 0) then
CurrOpts = TI_NPCDB[TI_NPCIndex[TI_LoadedNPCIndex]];
else
CurrOpts = TI_status.options;
end
local id = this:GetParent():GetID();
if(this:GetChecked()) then
CurrOpts[id].state=true;
else
CurrOpts[id].state=false;
end
end
function TI_StatusIndicatorUpdate()
if(TI_status) then
if(TI_status.state) then
TI_StatusIndicator_Status:SetText("On");
TI_StatusIndicator_Status:SetTextColor(0,1,0);
else
TI_StatusIndicator_Status:SetText("Off");
TI_StatusIndicator_Status:SetTextColor(1,0,0);
end
TI_StatusIndicator_Checkbox:SetChecked(TI_status.state);
end
end
function TI_StatusIndicator_CheckFn()
if(this:GetChecked()) then
TI_Switch("on");
else
TI_Switch("off");
end
end
function TI_TempNPCListTooltipShow()
TI_Tooltip:SetOwner(this, ANCHOR_PRESERVE);
TI_Tooltip:ClearLines();
local id = this:GetID();
TI_Tooltip:AddLine(TI_TempNPCList[id].location);
for i,v in ipairs(TI_TempNPCList[id].list) do
TI_Tooltip:AddLine("- " .. v.name);
end
--TI_Tooltip:SetText(text);
TI_Tooltip:Show();
end
function TI_TooltipHide()
TI_Tooltip:Hide();
end
function TI_TooltipMessage(msg)
TI_Tooltip:SetOwner(this, ANCHOR_PRESERVE);
TI_Tooltip:ClearLines();
TI_Tooltip:SetText(msg);
TI_Tooltip:Show();
end
function TI_TempNPCListUpdate()
local last = 1;
for i,v in ipairs(TI_TempNPCList) do
local tempbuttontext = getglobal("TI_TempNPCListWindow"..i.."_Text");
tempbuttontext:SetText(v.name);
tempbuttontext:GetParent():Show();
last = last+1;
end
for j=last, TI_TempNPCListMaxSize, 1 do
getglobal("TI_TempNPCListWindow" .. j):Hide();
end
end
function TI_NPCListCheckboxTooltip()
if(this:GetChecked()) then
TI_TooltipMessage("NPC is using specific settings.");
else
TI_TooltipMessage("NPC is using default settings.");
end
end
function TI_OptionListCheckboxTooltip()
if(this:GetChecked()) then
TI_TooltipMessage("This option is enabled.");
else
TI_TooltipMessage("This option is disabled.");
end
end
function TI_SettingCheckboxFn(var)
if(this:GetChecked()) then
TI_status[var] = true;
else
TI_status[var] = false;
end
end
function TI_SettingCheckboxUpdate()
if(TI_status) then
TI_SettingCheckboxes_UseDefault:SetChecked(TI_status.usedefault);
TI_SettingCheckboxes_AddAutomatically:SetChecked(TI_status.autoadd);
end
end
function TI_PopulateOptions(arg)
TI_debug(arg);
local CurrOpts;
local last=1;
if(TI_status and TI_status.options) then
if(TI_LoadedNPCIndex > 0) then
CurrOpts = TI_NPCDB[TI_NPCIndex[TI_LoadedNPCIndex]];
else
CurrOpts = TI_status.options;
end
for i,v in ipairs(CurrOpts) do
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);
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);
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
for j=last, 16, 1 do
getglobal("TI_OptionsPriority" .. j):Hide();
end
TI_OptionsPriorityScrollFrame:SetVerticalScroll(0);
TI_OptionsPriorityScrollFrame:UpdateScrollChildRect();
TI_StatusIndicatorUpdate();
end
TI_NPCListScrollBarUpdate();
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
FauxScrollFrame_Update(TI_NPCListScrollFrame,table.getn(TI_NPCIndex),8,20);
-- arg2 is max entries, arg3 is number of lines, arg4 is pixel height of each line
local line; -- 1 through 8 of our window to scroll
local lineplusoffset; -- an index into our data calculated from the scroll offset
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);
if(lineplusoffset <= table.getn(TI_NPCIndex)) then
getglobal("TI_OptionsNPCContainer"..line):SetID(lineplusoffset);
getglobal("TI_OptionsNPCContainer"..line.."_Text"):SetText(TI_NPCIndex[lineplusoffset]);
getglobal("TI_OptionsNPCContainer"..line.."_Check"):SetChecked(TI_NPCDB[TI_NPCIndex[lineplusoffset]].state);
if(lineplusoffset == TI_LoadedNPCIndex) then
getglobal("TI_OptionsNPCContainer"..line):LockHighlight();
else
getglobal("TI_OptionsNPCContainer"..line):UnlockHighlight();
end
getglobal("TI_OptionsNPCContainer"..line):Show();
else
getglobal("TI_OptionsNPCContainer"..line):Hide();
end
end
end
end
function TI_SelectNPCIndex()
local index = this:GetID();
if(TI_LoadedNPCIndex == index) then
TI_LoadedNPCIndex = 0;
else
TI_LoadedNPCIndex = index;
end
TI_PopulateOptions("select npc");
end
function TI_DeleteNPCIndex()
local index = this:GetParent():GetID();
TI_DeleteNPC(index);
if(TI_LoadedNPCIndex == index) then
TI_LoadedNPCIndex = 0;
end
TI_PopulateOptions("npclist update");
end
function TI_NPCToggle()
local index = this:GetParent():GetID();
TI_NPCDB[TI_NPCIndex[index]].state = this:GetChecked();
if(TI_NPCDB[TI_NPCIndex[index]].state) then
TI_LoadedNPCIndex = index;
else
if(TI_LoadedNPCIndex == index) then
TI_LoadedNPCIndex = 0;
end
end
TI_PopulateOptions("select npc");
end
function TI_OptionMove(offset)
local CurrOpts;
if(TI_LoadedNPCIndex > 0) then
CurrOpts = TI_NPCDB[TI_NPCIndex[TI_LoadedNPCIndex]];
else
CurrOpts = TI_status.options;
end
local id = this:GetParent():GetID();
local newid = id + offset;
if(newid < 1 or newid > table.getn(CurrOpts)) then
return;
end
local temp = CurrOpts[newid];
CurrOpts[newid] = CurrOpts[id];
CurrOpts[id] = temp;
TI_PopulateOptions("move");
end
function TI_OptionToggle()
local CurrOpts;
if(TI_LoadedNPCIndex > 0) then
CurrOpts = TI_NPCDB[TI_NPCIndex[TI_LoadedNPCIndex]];
else
CurrOpts = TI_status.options;
end
local id = this:GetParent():GetID();
if(this:GetChecked()) then
CurrOpts[id].state=true;
else
CurrOpts[id].state=false;
end
end
function TI_StatusIndicatorUpdate()
if(TI_status) then
if(TI_status.state) then
TI_StatusIndicator_Status:SetText("On");
TI_StatusIndicator_Status:SetTextColor(0,1,0);
else
TI_StatusIndicator_Status:SetText("Off");
TI_StatusIndicator_Status:SetTextColor(1,0,0);
end
TI_StatusIndicator_Checkbox:SetChecked(TI_status.state);
end
end
function TI_StatusIndicator_CheckFn()
if(this:GetChecked()) then
TI_Switch("on");
else
TI_Switch("off");
end
end
function TI_TempNPCListTooltipShow()
TI_Tooltip:SetOwner(this, ANCHOR_PRESERVE);
TI_Tooltip:ClearLines();
local id = this:GetID();
TI_Tooltip:AddLine(TI_TempNPCList[id].location);
for i,v in ipairs(TI_TempNPCList[id].list) do
TI_Tooltip:AddLine("- " .. v.name);
end
--TI_Tooltip:SetText(text);
TI_Tooltip:Show();
end
function TI_TooltipHide()
TI_Tooltip:Hide();
end
function TI_TooltipMessage(msg)
TI_Tooltip:SetOwner(this, ANCHOR_PRESERVE);
TI_Tooltip:ClearLines();
TI_Tooltip:SetText(msg);
TI_Tooltip:Show();
end
function TI_TempNPCListUpdate()
local last = 1;
for i,v in ipairs(TI_TempNPCList) do
local tempbuttontext = getglobal("TI_TempNPCListWindow"..i.."_Text");
tempbuttontext:SetText(v.name);
tempbuttontext:GetParent():Show();
last = last+1;
end
for j=last, TI_TempNPCListMaxSize, 1 do
getglobal("TI_TempNPCListWindow" .. j):Hide();
end
end
function TI_NPCListCheckboxTooltip()
if(this:GetChecked()) then
TI_TooltipMessage("NPC is using specific settings.");
else
TI_TooltipMessage("NPC is using default settings.");
end
end
function TI_OptionListCheckboxTooltip()
if(this:GetChecked()) then
TI_TooltipMessage("This option is enabled.");
else
TI_TooltipMessage("This option is disabled.");
end
end
function TI_SettingCheckboxFn(var)
if(this:GetChecked()) then
TI_status[var] = true;
else
TI_status[var] = false;
end
end
function TI_SettingCheckboxUpdate()
if(TI_status) then
TI_SettingCheckboxes_UseDefault:SetChecked(TI_status.usedefault);
TI_SettingCheckboxes_AddAutomatically:SetChecked(TI_status.autoadd);
end
end

Loading…
Peruuta
Tallenna