| .sync/ |
| local TI_FunctionList = { | local TI_FunctionList = { | ||||
| g = { | g = { | ||||
| availquest = SelectGossipAvailableQuest, | |||||
| activequest = SelectGossipActiveQuest, | |||||
| default = SelectGossipOption | |||||
| availquest = C_GossipInfo.SelectActiveQuest, | |||||
| activequest = C_GossipInfo.SelectAvailableQuest, | |||||
| default = C_GossipInfo.SelectOption | |||||
| }, | }, | ||||
| q = { | q = { | ||||
| availquest = SelectAvailableQuest, | availquest = SelectAvailableQuest, | ||||
| local ActiveQuests; | local ActiveQuests; | ||||
| local GossipOptions; | local GossipOptions; | ||||
| if(gorq == "g") then | if(gorq == "g") then | ||||
| AvailableQuests = TI_TabulateGossipAvailableQuests(GetGossipAvailableQuests()); | |||||
| ActiveQuests = TI_TabulateGossipActiveQuests(GetGossipActiveQuests()); | |||||
| GossipOptions = TI_TabulateGossipOptions(GetGossipOptions()); | |||||
| SAcQ = SelectGossipActiveQuest; | |||||
| SAvQ = SelectGossipAvailableQuest; | |||||
| AvailableQuests = TI_TabulateGossipQuestUIInfo(C_GossipInfo.GetAvailableQuests()); | |||||
| ActiveQuests = TI_TabulateGossipQuestUIInfo(C_GossipInfo.GetActiveQuests()); | |||||
| GossipOptions = TI_TabulateGossipUIInfo(C_GossipInfo.GetOptions()); | |||||
| SAcQ = C_GossipInfo.SelectActiveQuest; | |||||
| SAvQ = C_GossipInfo.SelectAvailableQuest; | |||||
| elseif(gorq == "q") then | elseif(gorq == "q") then | ||||
| AvailableQuests = TI_GetQuests("Available"); | AvailableQuests = TI_GetQuests("Available"); | ||||
| ActiveQuests = TI_GetQuests("Active"); | ActiveQuests = TI_GetQuests("Active"); | ||||
| 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); | TI_debug(i1.."-Gossip Match Found: "..current.name..", "..current.type); | ||||
| SelectGossipOption(i2); | |||||
| C_GossipInfo.SelectOption(i2); | |||||
| return; | return; | ||||
| end | end | ||||
| end | end | ||||
| 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); | |||||
| C_GossipInfo.SelectOption(j); | |||||
| return; | return; | ||||
| end | end | ||||
| end | end | ||||
| return x; | return x; | ||||
| end | end | ||||
| function TI_TabulateGossipAvailableQuests(...) | |||||
| function TI_TabulateGossipQuestUIInfo(gquis) | |||||
| local x = {}; | local x = {}; | ||||
| for i=1, select("#", ...), 7 do | |||||
| for i,gqui in ipairs(gquis) do | |||||
| local temp = {}; | local temp = {}; | ||||
| temp.name = select(i, ...); | |||||
| temp.name = gqui.name; | |||||
| temp.icon = QuestUtil.GetQuestIconActive(gqui.isComplete, gqui.isLegendary, | |||||
| gqui.frequency, gqui.isRepeatable, gqui.isCampaign, gqui.isCovenantCalling) | |||||
| 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); | table.insert(x, temp); | ||||
| end | end | ||||
| return x; | return x; | ||||
| end | end | ||||
| function TI_TabulateGossipActiveQuests(...) | |||||
| function TI_TabulateGossipUIInfo(guis) | |||||
| local x = {}; | local x = {}; | ||||
| for i=1, select("#", ...), 6 do | |||||
| for i,gui in ipairs(guis) do | |||||
| local temp = {}; | 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 | |||||
| temp.name = gui.name; | |||||
| temp.type = gui.type; | |||||
| 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. | --[[this function stolen from WhisperCast by Sarris, whom I love dearly for his contribution to Paladins everywhere. | ||||
| ]] | ]] |
| ## Interface: 80000 | |||||
| ## X-Compatible-With: 80000 | |||||
| ## Interface: 90002 | |||||
| ## X-Compatible-With: 90002 | |||||
| ## 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 |
| <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"> | ||||
| </FontString> | </FontString> | ||||
| </Layer> | </Layer> | ||||
| </Layers> | </Layers> | ||||
| <KeyValues> | |||||
| <KeyValue key="backdropInfo" value="BACKDROP_TOOLTIP_16_16_5555" type="global"/> | |||||
| </KeyValues> | |||||
| <Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true"> | <Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true"> | ||||
| <EdgeSize> | <EdgeSize> | ||||
| <AbsValue val="16"/> | <AbsValue val="16"/> | ||||
| </Backdrop> | </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> | ||||
| </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> | ||||
| </Anchors> | </Anchors> | ||||
| </Frame> | </Frame> | ||||
| </Frames> | </Frames> | ||||
| <KeyValues> | |||||
| <KeyValue key="backdropInfo" value="BACKDROP_TOOLTIP_16_16_5555" type="global"/> | |||||
| </KeyValues> | |||||
| <Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true"> | <Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true"> | ||||
| <EdgeSize> | <EdgeSize> | ||||
| <AbsValue val="16"/> | <AbsValue val="16"/> | ||||
| </BackgroundInsets> | </BackgroundInsets> | ||||
| </Backdrop> | </Backdrop> | ||||
| <Scripts> | <Scripts> | ||||
| <OnLoad> | |||||
| 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(); | ||||
| </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" enableMouseWheel="true" movable="true" parent="UIParent"> | |||||
| <TitleRegion> | <TitleRegion> | ||||
| <Size> | <Size> | ||||
| <AbsDimension x="128" y="64"/> | <AbsDimension x="128" y="64"/> | ||||
| </Anchors> | </Anchors> | ||||
| </TitleRegion> | </TitleRegion> | ||||
| <KeyValues> | |||||
| <KeyValue key="backdropInfo" value="BACKDROP_DIALOG_32_32" type="global"/> | |||||
| </KeyValues> | |||||
| <Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true"> | <Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true"> | ||||
| <BackgroundInsets> | <BackgroundInsets> | ||||
| <AbsInset left="11" right="12" top="12" bottom="11"/> | <AbsInset left="11" right="12" top="12" bottom="11"/> | ||||
| </Backdrop> | </Backdrop> | ||||
| <Scripts> | <Scripts> | ||||
| <OnShow> | |||||
| </OnShow> | |||||
| <OnLoad> | |||||
| self:ApplyBackdrop() | |||||
| 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"/> | ||||
| <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"); | ||||
| <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"); |
| 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"; | |||||
| iconpath = "Interface/GossipFrame/" .. v.type .. "GossipIcon"; | |||||
| end | end | ||||
| getglobal(entry .. "_Icon"):SetTexture(iconpath); | getglobal(entry .. "_Icon"):SetTexture(iconpath); | ||||
| getglobal(entry .. "_Check"):SetChecked(v.state); | getglobal(entry .. "_Check"):SetChecked(v.state); |