浏览代码

Initial work on UI revamp

3.0
SabinDeus 8 年前
当前提交
659f15f051
共有 6 个文件被更改,包括 2035 次插入0 次删除
  1. 0
    0
      I_Am_3.0
  2. 54
    0
      README.txt
  3. 739
    0
      TurnIn.lua
  4. 7
    0
      TurnIn.toc
  5. 915
    0
      TurnIn.xml
  6. 320
    0
      TurnInUI.lua

+ 0
- 0
I_Am_3.0 查看文件


+ 54
- 0
README.txt 查看文件

Turn In
v2.1
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.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

+ 739
- 0
TurnIn.lua 查看文件

--[[
Turn-In Mod
version 2.1
Authored by Ian Friedman
Sabindeus of Smolderthorn (Alliance)
The repeatable quest turn in automating machine.
Thanks to Arcanemagus of Hyjal for extra bug fixes and coding input
]]

local addonName, addon = ...


TI_VersionString = "2.0";
local TI_slashtable;
TI_gossipclosed = false;
TI_LoadedNPCIndex = 0;
TI_activenumber = 1;
TI_availnumber = 1;
TI_specnum = 0;
TI_gossipopts = {};

TI_TempNPCList = {};
TI_TempNPCListMaxSize = 5;

TI_NPCInQuestion = nil;

local TI_FunctionList = {
g = {
availquest = SelectGossipAvailableQuest,
activequest = SelectGossipActiveQuest,
default = SelectGossipOption
},
q = {
availquest = SelectAvailableQuest,
activequest = SelectActiveQuest
}
};


local TI_DefaultStatus = {
state = false,
version = TI_VersionString,
options = {},
debugstate = false,
usedefault=true,
autoadd=false
};

TI_TempNPCList = {};

function TI_message(...)
local x = {...};
for k,v in pairs(x) do
print(tostring(v));
end
end

function TI_debug(...)
if(TI_status.debugstate) then
TI_message(...)
end
end

function TI_OnLoad()
SlashCmdList["TI"]=TI_SlashCmdHandler;
SLASH_TI1="/turnin";
SLASH_TI2="/ti";
tinsert(UISpecialFrames,"TI_OptionsFrame");
TI_slashtable = {};
TI_gossipopts = {};
TI_gossipclosed = false;
TurnIn:RegisterEvent("VARIABLES_LOADED");
TI_activenumber = 1;
TI_availnumber = 1;
TI_specnum = 0;
StaticPopupDialogs["TI_NPCINQUESTION"] = {
text = "The NPC %s is already in your NPC Database. Do you wish to replace his gossip options with the current ones? (Note: This will overwrite your settings for this NPC.)",
button1 = "Yes",
button2 = "No",
OnAccept = function()
TI_AddNPCToList(TI_NPCInQuestion.list, TI_NPCInQuestion.name, true);
end,
timeout=0,
whileDead = 1,
hideOnEscape = 1
};
end

function TI_VarInit()
TI_debug("loading vars");
if(not TI_status or TI_status.version ~= TI_VersionString) then
TI_status = TI_copyTable(TI_DefaultStatus);
TI_OptionsInit();
end
if(not TI_status.options or #TI_status.options == 0) then
TI_OptionsInit();
end
if(not TI_NPCDB) then
TI_NPCDB = {};
end
if(not TI_NPCIndex) then
TI_NPCIndexGenerate();
end
TI_PopulateOptions("vars loaded");
end

--
-- Events
--

local TI_EventHandlers = {}

function TI_EventHandlers:QUEST_GREETING ()
TI_debug("Quest Greeting");
TI_lastquestframe = "greeting";
if(QuestFrame:IsVisible()) then
if(TI_gossipclosed) then
TI_debug("resetting pointers");
TI_gossipclosed = false;
TI_ResetPointers();
end
TI_HandleGossipWindow("q");
end
end

function TI_EventHandlers:GOSSIP_SHOW ()
TI_debug("Gossip Show");
if(GossipFrame:IsVisible()) then
if(TI_gossipclosed) then
TI_debug("resetting pointers");
TI_gossipclosed = false;
TI_ResetPointers();
end
TI_HandleGossipWindow("g");
end
end

function TI_EventHandlers:GOSSIP_CLOSED ()
TI_debug("Gossip Closed");
if(not GossipFrame:IsVisible()) then
TI_gossipclosed = true;
end;
end

function TI_EventHandlers:QUEST_COMPLETE ()
TI_debug("Quest Complete");
if(TI_IsNPCOn(UnitName("npc"), "activequest")) then
if(not (GetNumQuestChoices() > 1)) then
GetQuestReward(1);
end
end
TI_ResetPointers();
end

function TI_EventHandlers:QUEST_PROGRESS ()
TI_debug("Quest Progress");
TI_gossipclosed = false;
TI_lastquestframe = "progress";
TI_HandleQuestProgress();
end

function TI_EventHandlers:QUEST_DETAIL ()
TI_debug("Quest Detail");
TI_gossipclosed = false;
if(TI_IsNPCOn(UnitName("npc"), "availquest")) then
TI_HandleAcceptQuest();
end
TI_ResetPointers();
end

function TI_EventHandlers:QUEST_FINISHED ()
TI_debug("Quest Finished");
if(not QuestFrame:IsVisible() and TI_lastquestframe == "greeting") then
TI_debug("looks like the quest frame closed, resetting pointers on next open");
TI_gossipclosed = true;
end
end

function TI_EventHandlers:PLAYER_ENTERING_WORLD ()
TI_message("Turn In loaded");
end

function TI_OnEvent(self, event, ...)
if(event == "VARIABLES_LOADED") then
TI_debug("Variables Loaded");
TI_VarInit();
if(TI_status.state) then
TI_LoadEvents();
end
else
TI_EventHandlers[event]();
end
end

function TI_LoadEvents()
for k,v in pairs(TI_EventHandlers) do
TurnIn:RegisterEvent(k);
end
end

function TI_UnloadEvents()
for k,v in pairs(TI_EventHandlers) do
TurnIn:UnregisterEvent(k);
end
end

--
-- Pointers
-- Keeping track of gossip/quest frame state between event handlers
--

function TI_ResetPointers()
TI_activenumber = 1;
TI_availnumber = 1;
TI_specnum = 0;
end

--
-- Defaults loading for new NPCs
--

local TI_GossipDefaults = {
availquest = "Available Quests",
activequest = "Active Quests",
gossip = "Gossip",
vendor = "Vendor",
taxi = "Taxi",
trainer = "Trainer",
battlemaster = "Battlemaster",
binder = "Hearthstone Binder",
healer = "Spirit Healer",
banker = "Bank"
};

function TI_OptionsInit()
TI_status.options = {};
for k,v in pairs(TI_GossipDefaults) do
local temp = {};
temp.name = v;
temp.type = k;
temp.state = false;
table.insert(TI_status.options, temp);
end
end

function TI_NPCIndexGenerate()
TI_NPCIndex = {};
for k,v in pairs(TI_NPCDB) do
table.insert(TI_NPCIndex, k);
end
table.sort(TI_NPCIndex);
end


--
-- User Interface Handlers
--

function TI_Switch(state)
if(state=="on") then
TI_status.state = true;
TI_LoadEvents();
TI_message("Turn In On");
elseif(state=="off") then
TI_ResetPointers();
TI_status.state = false;
TI_UnloadEvents();
TI_message("Turn In Off");
elseif(state=="toggle") then
if(TI_status.state) then
TI_Switch("off");
else
TI_Switch("on");
end
end
TI_StatusIndicatorUpdate();
end

function TI_ShouldTakeAction()
return not IsShiftKeyDown();
end

function TI_SlashCmdHandler(cmd)
cmdlist = {strsplit(" ", cmd)};
local commands = {
on = function ()
TI_Switch("on");
end,
off = function ()
TI_Switch("off");
end,
toggle = function ()
TI_Switch("toggle");
end,
status = function ()
if(TI_status.state) then
TI_message("Turn In On");
else
TI_message("Turn In Off");
end
end,
window = function ()
InterfaceOptionsFrame_OpenToCategory("Turn In");
end,
config = function ()
InterfaceOptionsFrame_OpenToCategory("Turn In");
end,
recent = function ()
TI_TempNPCListWindow:Show();
end,
debug = function ()
if(TI_status.debugstate) then
TI_status.debugstate = false;
TI_message("debug mode off");
else
TI_status.debugstate = true;
TI_message("debug mode on");
end
end
};
if(commands[cmdlist[1]]) then
commands[cmdlist[1]](cmdlist[2], cmdlist[3], cmdlist[4]);
else
TI_message("Turn In 2.1 Help", "--------------", "/ti on - turns Turn In on", "/ti off - turns Turn In off", "/ti toggle - toggles Turn In on or off", "/ti window - shows the options window", "/ti recent - shows the recently visited NPCs");
end
end

function TI_IsNPCOn(npcname, type)
local opton = false;
if(type ~= nil) then
for k,v in pairs(TI_status.options) do
if(v.type == type and v.state == true) then
opton = true;
end
end
else
opton = true;
end
if(TI_NPCDB[npcname] == nil and TI_status.usedefault == true and opton == true) then
TI_debug("case 1");
return true;
elseif(TI_NPCDB[npcname] ~= nil and TI_NPCDB[npcname].state) then
TI_debug("case 2");
return true;
elseif(TI_NPCDB[npcname] ~= nil and TI_status.usedefault == true and not TI_NPCDB[npcname].state and opton == true) then
TI_debug("case 4");
return true;
else
TI_debug("case 3");
return false;
end
end

--
-- NPC state machine functions
--

function TI_HandleAcceptQuest()
if(TI_ShouldTakeAction()) then
QuestDetailAcceptButton_OnClick();
end
end

function TI_HandleQuestProgress()
if(TI_ShouldTakeAction()) then
local questname = GetTitleText();
local npcname = UnitName("npc");
if(QuestFrame:IsVisible()) then
if(TI_NPCDB[npcname]) then
local thisnpc = TI_NPCDB[npcname];
if(thisnpc.state) then
for i,current in ipairs(thisnpc) do
if(current.name == questname and current.state) then
TI_CompleteQuest();
end
end
else
if(TI_IsNPCOn(UnitName("npc"), "activequest")) then
TI_CompleteQuest();
end
end
else
if(TI_IsNPCOn(UnitName("npc"), "activequest")) then
TI_CompleteQuest();
end
end
end
end
end

function TI_CompleteQuest()
if(TI_ShouldTakeAction()) then
if(IsQuestCompletable()) then
TI_debug("quest is completable, completeing");
CompleteQuest();
TI_ResetPointers();
else
TI_debug("quest is not completable, declining");
QuestDetailDeclineButton_OnClick();
end
end
end

function TI_GetQuests(type)
local numQuests = (getglobal("GetNum"..type.."Quests"))();
local qfn = getglobal("Get"..type.."Title");
local ret = {};
local qname;
local i=1;
for i=1,numQuests do
qname = qfn(i);
ret[i] = {name=qname};
end
return ret;
end

function TI_HandleGossipWindow(gorq)
local SAcQ;
local SAvQ;
local AvailableQuests;
local ActiveQuests;
local GossipOptions;
if(gorq == "g") then
AvailableQuests = TI_TabulateGossipAvailableQuests(GetGossipAvailableQuests());
ActiveQuests = TI_TabulateGossipActiveQuests(GetGossipActiveQuests());
GossipOptions = TI_TabulateGossipOptions(GetGossipOptions());
SAcQ = SelectGossipActiveQuest;
SAvQ = SelectGossipAvailableQuest;
elseif(gorq == "q") then
AvailableQuests = TI_GetQuests("Available");
ActiveQuests = TI_GetQuests("Active");
GossipOptions = {};
SAcQ=SelectActiveQuest;
SAvQ=SelectAvailableQuest;
end
local ListEntry = {};
for i,v in ipairs(AvailableQuests) do
local x={};
x.name = v.name;
x.gorq = gorq;
x.args = i;
x.type = "availquest";
x.icon = v.icon;
x.state = false;
table.insert(ListEntry, x);
end
for i,v in ipairs(ActiveQuests) do
local x={};
x.name = v.name;
x.gorq = gorq;
x.args = i;
x.type = "activequest";
x.icon = v.icon;
x.state = false;
table.insert(ListEntry, x);
end
for i,v in ipairs(GossipOptions) do
local x={};
x.name = v.name;
x.gorq = gorq;
x.args = i;
x.type = v.type;
x.state = false;
table.insert(ListEntry, x);
end
ListEntry.state = false;
local TotalOptions = #AvailableQuests+#ActiveQuests+#GossipOptions;
if(TotalOptions < 1) then
return;
end
local npcname = UnitName("npc");
TI_AddNPCToTempList(npcname, ListEntry);
if(TI_status.autoadd and (not TI_NPCDB[npcname])) then
TI_debug("autoadd on, adding this NPC", TI_status.autoadd, TI_NPCDB[npcname]);
TI_AddNPCToList(ListEntry, npcname);
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 (TI_NPCDB[npcname]) then
for k1, v1 in ipairs(ListEntry) do
local found = false;
for k2, v2 in ipairs(TI_NPCDB[npcname]) do
if (v2.type == v1.type and v2.name == v1.name) then
found = true;
end
end
if (not found) then
table.insert(TI_NPCDB[npcname], v1)
TI_PopulateOptions("npclist updated");
end
end
end
if(TI_availnumber > TotalOptions or TI_activenumber > TotalOptions) then
TI_ResetPointers();
return;
end
if(not TI_ShouldTakeAction()) then
return;
end
TI_debug(npcname);
if(TI_NPCDB[npcname]) then
local thisnpc = TI_NPCDB[npcname];
if(thisnpc.state) then
TI_debug("npc is active, using his options");
for i1,current in ipairs(thisnpc) do
if (current.state == true) then
TI_debug("Current Quest: "..current.name);
if (TI_specnum == 0 or i1 > TI_specnum) then
TI_specnum = i1;
if (current.type == "availquest") then
for i2,v2 in ipairs(AvailableQuests) do
if (v2.name == current.name) then
TI_debug(i1.."-Available Match Found: "..current.name);
TI_FunctionList[current.gorq]["availquest"](i2);
return;
end
end
elseif (current.type == "activequest") then
for i2,v2 in ipairs(ActiveQuests) do
if (v2.name == current.name) then
TI_debug(i1.."-Active Match Found: "..current.name..", "..current.type);
TI_FunctionList[current.gorq]["activequest"](i2);
return;
end
end
else
for i2,v2 in ipairs(GossipOptions) do
if (v2.name == current.name) then
TI_debug(i1.."-Gossip Match Found: "..current.name..", "..current.type);
SelectGossipOption(i2);
return;
end
end
end
end
end
end
return;
else
TI_debug("npc in list, but not active");
end
else
TI_debug("npc not in list");
end
if(TI_status.usedefault == false) then
TI_debug("npc not in list, default set to off, returning.");
return;
end;
TI_debug("using default config");
for i,current in ipairs(TI_status.options) do
if(current.state) then
if(current.type == "availquest" and #AvailableQuests > 0 and TI_availnumber <= #AvailableQuests) then
TI_availnumber = TI_availnumber + 1;
SAvQ(TI_availnumber-1);
TI_debug("Selecting Available Quest ".. TI_availnumber-1);
return;
elseif(current.type == "activequest" and #ActiveQuests > 0 and TI_activenumber <= #ActiveQuests) then
TI_activenumber = TI_activenumber + 1;
SAcQ(TI_activenumber-1);
TI_debug("Selecting Active Quest ".. TI_activenumber-1);
return;
elseif(#GossipOptions > 0) then
for j,val in ipairs(GossipOptions) do
if(val.type == current.type) then
TI_ResetPointers();
SelectGossipOption(j);
return;
end
end
end
end
end
end

function TI_AddNPCToList(OptList, npcname, confirminquestion)
if (npcname == nil) then
npcname = UnitName("npc");
end
if(#OptList > 0) then
if(TI_NPCDB[npcname] == nil) then
TI_NPCDB[npcname] = TI_copyTable(OptList);
table.insert(TI_NPCIndex, npcname);
table.sort(TI_NPCIndex);
TI_PopulateOptions("npclist updated");
elseif(confirminquestion == true) then
TI_NPCDB[npcname] = TI_copyTable(OptList);
TI_PopulateOptions("npclist updated");
else
TI_NPCInQuestion = {name=npcname, list=OptList};
StaticPopup_Show("TI_NPCINQUESTION", npcname);
end
end
end


function TI_AddNPCToTempList(name, list)
local temp = {};
temp.name = name;
temp.list = list;
local subZone = GetSubZoneText();
local realZone = GetRealZoneText();
if(subZone == "") then
temp.location = realZone;
else
temp.location = subZone .. ", " .. realZone;
end
table.insert(TI_TempNPCList, 1, temp);
if(#TI_TempNPCList > TI_TempNPCListMaxSize) then
table.remove(TI_TempNPCList, TI_TempNPCListMaxSize);
end
TI_TempNPCListUpdate();
end

function TI_DeleteTempNPCIndex(index)
table.remove(TI_TempNPCList, index);
TI_TempNPCListUpdate();
end

function TI_AddTempNPCIndex(index)
TI_AddNPCToList(TI_TempNPCList[index].list, TI_TempNPCList[index].name);
end

function TI_DeleteNPC(index)
local name = TI_NPCIndex[index];
table.remove(TI_NPCIndex, index);
TI_NPCDB[name] = nil;
end

function TI_StripDescriptors(...)
local x = {};
local arg = {...};
for i=1, #arg, 2 do
table.insert(x,arg[i]);
end
return x;
end

function TI_TabulateGossipOptions(...)
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_TabulateGossipAvailableQuests(...)
local x = {};
for i=1, select("#", ...), 7 do
local temp = {};
temp.name = select(i, ...);
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 ( isRepeatable ) then
temp.icon = "Interface\\GossipFrame\\DailyActiveQuestIcon";
elseif ( isLegendary ) then
temp.icon = "Interface\\GossipFrame\\AvailableLegendaryQuestIcon";
else
temp.icon = "Interface\\GossipFrame\\AvailableQuestIcon";
end
table.insert(x, temp);
end
return x;
end

function TI_TabulateGossipActiveQuests(...)
local x = {};
for i=1, select("#", ...), 6 do
local temp = {};
temp.name = select(i, ...);
local isComplete = select(i+3, ...);
local isLegendary = select(i+4, ...);
if(isComplete) then
if(isLegendary) then
temp.icon = "Interface\\GossipFrame\\ActiveLegendaryQuestIcon";
else
temp.icon = "Interface\\GossipFrame\\ActiveQuestIcon";
end
else
temp.icon = "Interface\\GossipFrame\\IncompleteQuestIcon";
end
table.insert(x, temp);
end
return x;
end
--[[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
if ( type(v1) == "table" ) then
copy[k1]=TI_copyTable(v1)
else
copy[k1]=v1
end
end
return copy
end


function toggle(arg)
if(arg) then
return false;
else
return true;
end
end

+ 7
- 0
TurnIn.toc 查看文件

## Interface: 70000
## X-Compatible-With: 70000
## Title: Turn In
## Notes: Automates the selection of quest and gossip options.
## SavedVariables: TI_status, TI_NPCDB, TI_NPCIndex
## Version: 2.1
TurnIn.xml

+ 915
- 0
TurnIn.xml 查看文件

<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="TurnInUI.lua" />
<Frame name="TI_OptionFrameBoxTemplate" virtual="true">
<!-- shamelessly stolen from blizzard -->
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentTitle" inherits="GameFontHighlight">
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="9" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<EdgeSize>
<AbsValue val="16"/>
</EdgeSize>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="5" right="5" top="5" bottom="5"/>
</BackgroundInsets>
</Backdrop>
<Scripts>
<OnLoad>
self:SetBackdropBorderColor(0.4, 0.4, 0.4);
self:SetBackdropColor(0.5, 0.5, 0.5);
</OnLoad>
</Scripts>
</Frame>

<Button name="TI_PriorityList" virtual="true" hidden="false">
<Size>
<AbsDimension x="270" y="20" />
</Size>
<Scripts><!--
<OnEnter>
getglobal(self:GetName() .. "_Background"):SetVertexColor(1,1,1,0.4);
</OnEnter>
<OnLeave>
getglobal(self:GetName() .. "_Background"):SetVertexColor(0,0,0,0.4);
</OnLeave>
-->
</Scripts>
<Frames>
<CheckButton name="$parent_Check" hidden="false" inherits="OptionsCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
<HitRectInsets>
<AbsInset left="0" right="0" top="0" bottom="0"/>
</HitRectInsets>
<Size>
<AbsDimension x="20" y="22"/>
</Size>
<Scripts>
<OnEnter>
TI_OptionListCheckboxTooltip(self);
</OnEnter>
<OnLeave>
TI_TooltipHide();
</OnLeave>
<OnClick>
TI_OptionToggle(self);
</OnClick>
</Scripts>
</CheckButton>
<Button name="$parent_MoveDown" hidden="false">
<Size>
<AbsDimension x="24" y="24"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnEnter>
TI_TooltipMessage(self, "Decrease this option's priority.");
</OnEnter>
<OnLeave>
TI_TooltipHide();
</OnLeave>
<OnClick>
TI_OptionMove(self, 1);
</OnClick>
</Scripts>
<NormalTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Up"/>
<PushedTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Down"/>
<DisabledTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollDown-Disabled"/>
<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"/>
</Button>
<Button name="$parent_MoveUp" hidden="false">
<Size>
<AbsDimension x="24" y="24"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativePoint="LEFT" relativeTo="$parent_MoveDown">
<Offset>
<AbsDimension x="3" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
TI_OptionMove(self, -1);
</OnClick>
<OnEnter>
TI_TooltipMessage(self, "Increase this option's priority.");
</OnEnter>
<OnLeave>
TI_TooltipHide();
</OnLeave>
</Scripts>
<NormalTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollUp-Up"/>
<PushedTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollUp-Down"/>
<DisabledTexture file="Interface\ChatFrame\UI-ChatIcon-ScrollUp-Disabled"/>
<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"/>
</Button>
</Frames>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parent_Icon" file="Interface\QuestFrame\UI-Quest-BulletPoint">
<Size>
<AbsDimension x="16" y="16"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="20" y="-3"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<FontString name="$parent_Text" inherits="GameFontNormal" justifyV="top" justifyH="left">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parent_Icon" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="-1"/>
</Offset>
</Anchor>
<Anchor point="TOPRIGHT" relativeTo="$parent_MoveUp" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
<Layer level="BACKGROUND">
<Texture name="$parent_Background" setAllPoints="true">
<Color r="0.2" g="0.2" b="1" a="0.0" />
</Texture>
</Layer>
</Layers>
<!--<NormalText name="$parent_Text" justifyV="top" justifyH="left" inherits="GameFontNormal" nonspacewrap="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parent_Icon" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="-1"/>
</Offset>
</Anchor>
<Anchor point="TOPRIGHT" relativeTo="$parent_MoveUp" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Size>
<AbsDimension x="156" y="0" />
</Size>
</NormalText>-->
</Button>
<Button name="TI_NPCList" virtual="true" hidden="false">
<Size>
<AbsDimension x="232" y="20" />
</Size>
<Frames>
<CheckButton name="$parent_Check" hidden="false" inherits="OptionsCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
<HitRectInsets>
<AbsInset left="0" right="0" top="0" bottom="0"/>
</HitRectInsets>
<Size>
<AbsDimension x="20" y="22"/>
</Size>
<Scripts>
<OnClick>
TI_NPCToggle(self);
TI_NPCListCheckboxTooltip(self);
</OnClick>
<OnEnter>
TI_NPCListCheckboxTooltip(self);
</OnEnter>
<OnLeave>
TI_TooltipHide();
</OnLeave>
</Scripts>
</CheckButton>
<Button name="$parent_Delete" hidden="false" inherits="OptionsButtonTemplate" text="X">
<Anchors>
<Anchor point="RIGHT">
<Offset>
<AbsDimension x="3" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Size>
<AbsDimension x="20" y="20" />
</Size>
<Scripts>
<OnEnter>
TI_TooltipMessage(self, "Delete this NPC.");
</OnEnter>
<OnLeave>
TI_TooltipHide();
</OnLeave>
<OnClick>
TI_DeleteNPCIndex(self);
</OnClick>
</Scripts>
</Button>
</Frames>
<Layers>
<Layer level="ARTWORK">
<FontString name="$parent_Text" justifyV="top" justifyH="left" inherits="GameFontNormal" text="">
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="20" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnClick>
TI_SelectNPCIndex(self);
</OnClick>
</Scripts>
<HighlightTexture file="Interface\QuestFrame\UI-QuestTitleHighlight" alphaMode="ADD"/>
</Button>
<GameTooltip name="TI_Tooltip" hidden="true" inherits="GameTooltipTemplate" />
<Frame Name="TI_TempNPCListEntry" virtual="true" hidden="true">
<Scripts>
<OnEnter>
TI_TempNPCListTooltipShow(self);
</OnEnter>
<OnLeave>
TI_TooltipHide();
</OnLeave>
</Scripts>
<Size>
<AbsDimension x="188" y="20" />
</Size>
<Layers>
<Layer level="ARTWORK">
<FontString name="$parent_Text" justifyV="top" justifyH="left" inherits="GameFontNormal" text="">
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Button name="$parent_Delete" hidden="false" inherits="OptionsButtonTemplate" text="X">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
<Size>
<AbsDimension x="20" y="20" />
</Size>
<Scripts>
<OnClick>
TI_DeleteTempNPCIndex(self:GetParent():GetID());
</OnClick>
<OnEnter>
TI_TooltipMessage(self, "Delete");
</OnEnter>
<OnLeave>
TI_TooltipHide();
</OnLeave>
</Scripts>
</Button>
<Button name="$parent_Add" hidden="false" inherits="OptionsButtonTemplate" text="+">
<Anchors>
<Anchor point="RIGHT" relativeTo="$parent_Delete" relativePoint="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Size>
<AbsDimension x="20" y="20" />
</Size>
<Scripts>
<OnClick>
TI_AddTempNPCIndex(self:GetParent():GetID());
</OnClick>
<OnEnter>
TI_TooltipMessage(self, "Add this NPC to the database");
</OnEnter>
<OnLeave>
TI_TooltipHide();
</OnLeave>
</Scripts>
</Button>
</Frames>
</Frame>
<Frame Name="TI_TempNPCListWindow" parent="UIParent" frameStrata="DIALOG" toplevel="true" enableMouse="true" movable="true" hidden="true">
<Size>
<AbsDimension x="200" y="130" />
</Size>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<FontString inherits="GameFontNormal" text="Recently Visited NPCs">
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPLEFT">
<Offset><AbsDimension x="6" y="-7" /></Offset>
</Anchor>
<Anchor point="TOPRIGHT">
<Offset><AbsDimension x="-6" y="-7" /></Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Button name="$parent_Close" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Frame name="$parent1" id="1" hidden="true" inherits="TI_TempNPCListEntry">
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPLEFT">
<Offset><AbsDimension x="6" y="-27" /></Offset>
</Anchor>
<!--<Anchor point="TOPRIGHT">
<Offset><AbsDimension x="-6" y="-27" /></Offset>
</Anchor>-->
</Anchors>
</Frame>
<Frame name="$parent2" id="2" hidden="true" inherits="TI_TempNPCListEntry">
<Anchors>
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent1">
<Offset><AbsDimension x="0" y="0" /></Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="$parent3" id="3" hidden="true" inherits="TI_TempNPCListEntry">
<Anchors>
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent2">
<Offset><AbsDimension x="0" y="0" /></Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="$parent4" id="4" hidden="true" inherits="TI_TempNPCListEntry">
<Anchors>
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent3">
<Offset><AbsDimension x="0" y="0" /></Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="$parent5" id="5" hidden="true" inherits="TI_TempNPCListEntry">
<Anchors>
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent4">
<Offset><AbsDimension x="0" y="0" /></Offset>
</Anchor>
</Anchors>
</Frame>
</Frames>
<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<EdgeSize>
<AbsValue val="16"/>
</EdgeSize>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="5" right="5" top="5" bottom="5"/>
</BackgroundInsets>
</Backdrop>
<Scripts>
<OnMouseUp>
if ( self.isMoving ) then
self:StopMovingOrSizing();
self.isMoving = false;
end
</OnMouseUp>
<OnMouseDown>
if ( button == "LeftButton" ) then
self:StartMoving();
self.isMoving = true;
end
</OnMouseDown>
<OnHide>
if ( self.isMoving ) then
self:StopMovingOrSizing();
self.isMoving = false;
end
</OnHide>
</Scripts>
</Frame>
<Frame Name="TI_OptionsFrame">
<!--
<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">
<BackgroundInsets>
<AbsInset left="11" right="12" top="12" bottom="11"/>
</BackgroundInsets>
<TileSize>
<AbsValue val="32"/>
</TileSize>
<EdgeSize>
<AbsValue val="32"/>
</EdgeSize>
</Backdrop>
-->
<Scripts>
<OnLoad>
TI_LoadInterfaceOptions(self);
</OnLoad>
</Scripts>
<!--
<Size>
<AbsDimension x="300" y="500"/>
</Size>
-->
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<!--
<Texture name="$parentOptionFrameHeader" file="Interface\DialogFrame\UI-DialogBox-Header">
<Size>
<AbsDimension x="256" y="64"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="12"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<FontString inherits="GameFontNormal" text="Turn In Options">
<Anchors>
<Anchor point="TOP" relativeTo="$parentOptionFrameHeader">
<Offset>
<AbsDimension x="0" y="-14"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
-->
</Layer>
</Layers>
<Frames>
<!--
<Button name="$parent_Close" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
-->
<Frame name="TI_StatusIndicator" hidden="false">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="16" y="-24" />
</Offset>
</Anchor>
</Anchors>
<Size>
<AbsDimension x="200" y="20" />
</Size>
<Frames>
<CheckButton name="$parent_Checkbox" hidden="false" inherits="OptionsCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="0" />
</Offset>
</Anchor>
</Anchors>
<HitRectInsets>
<AbsInset left="0" right="0" top="0" bottom="0"/>
</HitRectInsets>
<Size>
<AbsDimension x="20" y="22"/>
</Size>
<Scripts>
<OnClick>
TI_StatusIndicator_CheckFn(self);
</OnClick>
</Scripts>
</CheckButton>
</Frames>
<Layers>
<Layer level="OVERLAY">
<FontString name="$parent_Text" inherits="GameFontNormal" text="Turn In is ">
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="20" y="0" />
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parent_Status" inherits="GameFontNormal">
<Anchors>
<Anchor point="LEFT" relativeTo="$parent_Text" relativePoint="RIGHT">
<Offset>
<AbsDimension x="1" y="0" />
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnShow>
TI_StatusIndicatorUpdate();
</OnShow>
</Scripts>
</Frame>
<Frame name="TI_SettingCheckboxes" hidden="false">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TI_StatusIndicator" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-10" />
</Offset>
</Anchor>
</Anchors>
<Size>
<AbsDimension x="200" y="40" />
</Size>
<Frames>
<CheckButton name="$parent_UseDefault" hidden="false" inherits="OptionsCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="0" />
</Offset>
</Anchor>
</Anchors>
<HitRectInsets>
<AbsInset left="0" right="0" top="0" bottom="0"/>
</HitRectInsets>
<Size>
<AbsDimension x="20" y="22"/>
</Size>
<Scripts>
<OnClick>
TI_SettingCheckboxFn(self, "usedefault");
</OnClick>
</Scripts>
</CheckButton>
<CheckButton name="$parent_AddAutomatically" hidden="false" inherits="OptionsCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parent_UseDefault" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="0" />
</Offset>
</Anchor>
</Anchors>
<HitRectInsets>
<AbsInset left="0" right="0" top="0" bottom="0"/>
</HitRectInsets>
<Size>
<AbsDimension x="20" y="22"/>
</Size>
<Scripts>
<OnClick>
TI_SettingCheckboxFn(self, "autoadd");
</OnClick>
</Scripts>
</CheckButton>
</Frames>
<Layers>
<Layer level="OVERLAY">
<FontString name="$parent_UseDefault_Text" inherits="GameFontNormal" text="Use default options for unlisted NPCs">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="20" y="-4" />
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parent_AddAutomatically_Text" inherits="GameFontNormal" text="Automatically add new NPCs">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parent_UseDefault_Text" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-10" />
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnShow>
TI_SettingCheckboxUpdate();
</OnShow>
</Scripts>
</Frame>
<Frame name="TI_OptionsPriorityContainer" inherits="TI_OptionFrameBoxTemplate">
<Scripts>
<OnLoad>
self:SetBackdropBorderColor(0.4, 0.4, 0.4);
self:SetBackdropColor(0.15, 0.15, 0.15);
getglobal(self:GetName().."Title"):SetText("Gossip Options Priority List");
</OnLoad>
</Scripts>
<Anchors>
<Anchor point="BOTTOMRIGHT" relativeTo="$parent" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-10" y="10" />
</Offset>
</Anchor>
</Anchors>
<Size>
<AbsDimension x="300" y="430" />
</Size>
<Frames>
<ScrollFrame name="TI_OptionsPriorityScrollFrame" hidden="false" inherits="UIPanelScrollFrameTemplate">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="4" y="-8" />
</Offset>
</Anchor>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-28" y="8" />
</Offset>
</Anchor>
</Anchors>
<ScrollChild>
<Frame name="TI_OptionsPriority">
<Anchors>
<Anchor point="TOPLEFT" />
</Anchors>
<Size>
<AbsDimension x="200" y="30"/>
</Size>
<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>
</Frames>
</Frame>
<Frame name="TI_OptionsNPCContainer" inherits="TI_OptionFrameBoxTemplate">
<Scripts>
<OnLoad>
self:SetBackdropBorderColor(0.4, 0.4, 0.4);
self:SetBackdropColor(0.15, 0.15, 0.15);
getglobal(self:GetName().."Title"):SetText("NPC Database");
TI_GenerateFauxScrollFrameButtons(self, "TI_NPCList");
</OnLoad>
</Scripts>
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="$parent" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="10" y="10" />
</Offset>
</Anchor>
</Anchors>
<Size>
<AbsDimension x="300" y="430" />
</Size>
<Frames>
<ScrollFrame name="TI_NPCListScrollFrame" inherits="FauxScrollFrameTemplate" hidden="false" enableMouseWheel="true">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="-28" y="-8" />
</Offset>
</Anchor>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-28" y="8" />
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnVerticalScroll>
--FauxScrollFrame_OnVerticalScroll(20, TI_NPCListScrollBarUpdate);
FauxScrollFrame_OnVerticalScroll(self, offset, 20, TI_NPCListScrollBarUpdate);
</OnVerticalScroll>
<OnShow>
TI_NPCListScrollBarUpdate();
</OnShow>
</Scripts>
</ScrollFrame>
</Frames>
</Frame>
</Frames>
</Frame>
<Frame name="TurnIn" hidden="true" frameStrata="LOW" enableMouse="false">
<Scripts>
<OnLoad function="TI_OnLoad"/>
<OnEvent function="TI_OnEvent"/>
</Scripts>
</Frame>
</Ui>

+ 320
- 0
TurnInUI.lua 查看文件

function TI_LoadInterfaceOptions(panel)

--TI_IOAddonFrame = CreateFrame( "Frame", nil, UIParent );
-- Register in the Interface Addon Options GUI
-- Set the name for the Category for the Options Panel
panel.name = "Turn In";
-- Add the panel to the Interface Options
--TI_OptionsFrame:SetParent(TI_IOAddonFrame);
InterfaceOptions_AddCategory(panel);

-- Make a child panel
-- TI_IOAddonFrame.childpanel = CreateFrame( "Frame", nil, TI_IOAddonFrame.panel);
-- TI_IOAddonFrame.childpanel.name = "Turn In child";
-- Specify childness of this panel (this puts it under the little red [+], instead of giving it a normal AddOn category)
-- TI_IOAddonFrame.childpanel.parent = TI_IOAddonFrame.panel.name;
-- Add the child to the Interface Options
-- InterfaceOptions_AddCategory(TI_IOAddonFrame.childpanel);


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]];
TI_OptionsPriorityContainerTitle:SetText(TI_NPCIndex[TI_LoadedNPCIndex]);
else
CurrOpts = TI_status.options;
TI_OptionsPriorityContainerTitle:SetText("Default Priority List");
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
if(v.icon) then
iconpath = v.icon;
else
iconpath = "Interface\\GossipFrame\\ActiveQuestIcon";
end
elseif(v.type == "availquest") then
if(v.icon) then
iconpath = v.icon;
else
iconpath = "Interface\\GossipFrame\\AvailableQuestIcon";
end
else
iconpath = "Interface\\GossipFrame\\" .. v.type .. "GossipIcon";
end
getglobal(entry .. "_Icon"):SetTexture(iconpath);
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
local numButtons = table.getn(TI_OptionsNPCContainerButtons);
local buttonHeight = TI_OptionsNPCContainerButtons[1]:GetHeight();
FauxScrollFrame_Update(TI_NPCListScrollFrame,table.getn(TI_NPCIndex),numButtons,buttonHeight);
-- arg2 is max entries, arg3 is number of lines, arg4 is pixel height of each line
local line; -- 1 through n 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 line=1,numButtons do
lineplusoffset = line + FauxScrollFrame_GetOffset(TI_NPCListScrollFrame);
if(lineplusoffset <= table.getn(TI_NPCIndex)) then
TI_OptionsNPCContainerButtons[line]:SetID(lineplusoffset);
getglobal(TI_OptionsNPCContainerButtons[line]:GetName() .. "_Text"):SetText(TI_NPCIndex[lineplusoffset]);
getglobal(TI_OptionsNPCContainerButtons[line]:GetName() .. "_Check"):SetChecked(TI_NPCDB[TI_NPCIndex[lineplusoffset]].state);
if(lineplusoffset == TI_LoadedNPCIndex) then
TI_OptionsNPCContainerButtons[line]:LockHighlight();
else
TI_OptionsNPCContainerButtons[line]:UnlockHighlight();
end
TI_OptionsNPCContainerButtons[line]:Show();
else
TI_OptionsNPCContainerButtons[line]:Hide();
end
end
end
end

TI_OptionsNPCContainerButtons = {};

function TI_GenerateFauxScrollFrameButtons(parent, template)
local parentHeight = -1 * parent:GetHeight();
local i = 1;
local x = 4;
local y = -8;
while y > parentHeight + 20 do
local button = CreateFrame("Button", parent:GetName()..i, parent, template);
button:Hide();
local height = button:GetHeight();
button:SetPoint("TOPLEFT", parent, x, y);
y = y - height;
button:SetWidth(parent:GetWidth()-32);
i = i + 1;
table.insert(TI_OptionsNPCContainerButtons, button);
end
end

function TI_SelectNPCIndex(self)
local index = self:GetID();
if(TI_LoadedNPCIndex == index) then
TI_LoadedNPCIndex = 0;
else
TI_LoadedNPCIndex = index;
end
TI_PopulateOptions("select npc");
self:LockHighlight();
end

function TI_DeleteNPCIndex(self)
local index = self:GetParent():GetID();
TI_DeleteNPC(index);
if(TI_LoadedNPCIndex == index) then
TI_LoadedNPCIndex = 0;
end
TI_PopulateOptions("npclist update");
end

function TI_NPCToggle(self)
local index = self:GetParent():GetID();
TI_NPCDB[TI_NPCIndex[index]].state = self: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(self, offset)
local CurrOpts;
if(TI_LoadedNPCIndex > 0) then
CurrOpts = TI_NPCDB[TI_NPCIndex[TI_LoadedNPCIndex]];
else
CurrOpts = TI_status.options;
end
local id = self: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(self)
local CurrOpts;
if(TI_LoadedNPCIndex > 0) then
CurrOpts = TI_NPCDB[TI_NPCIndex[TI_LoadedNPCIndex]];
else
CurrOpts = TI_status.options;
end
local id = self:GetParent():GetID();
if(self: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(self)
if(self:GetChecked()) then
TI_Switch("on");
else
TI_Switch("off");
end
end


function TI_TempNPCListTooltipShow(self)
TI_Tooltip:SetOwner(self, ANCHOR_PRESERVE);
TI_Tooltip:ClearLines();
local id = self: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(self, msg)
TI_Tooltip:SetOwner(self, 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 = _G["TI_TempNPCListWindow"..i.."_Text"];
tempbuttontext:SetText(v.name);
tempbuttontext:GetParent():Show();
last = last+1;
end
for j=last, TI_TempNPCListMaxSize, 1 do
_G["TI_TempNPCListWindow" .. j]:Hide();
end
end

function TI_NPCListCheckboxTooltip(self)
if(self:GetChecked()) then
TI_TooltipMessage(self, "NPC is using specific settings.");
else
TI_TooltipMessage(self, "NPC is using default settings.");
end
end

function TI_OptionListCheckboxTooltip(self)
if(self:GetChecked()) then
TI_TooltipMessage(self, "This option is enabled.");
else
TI_TooltipMessage(self, "This option is disabled.");
end
end

function TI_SettingCheckboxFn(self, var)
if(self: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



正在加载...
取消
保存