瀏覽代碼

10.0: API changes and XML XSD adherence

tags/2.3
SabinDeus 3 年之前
父節點
當前提交
027447cfa6
共有 5 個檔案被更改,包括 98 行新增87 行删除
  1. 74
    23
      TurnIn.lua
  2. 2
    2
      TurnIn.toc
  3. 17
    61
      TurnIn.xml
  4. 5
    1
      TurnInUI.lua
  5. 0
    0
      pkgmeta.yaml

+ 74
- 23
TurnIn.lua 查看文件

"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(...)
x.gorq = gorq; x.gorq = gorq;
x.args = i; x.args = i;
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
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
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);
TI_FunctionList[current.gorq]["availquest"](i2);
SAvQ(v2.questID);
return; return;
end end
end end
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);
TI_FunctionList[current.gorq]["activequest"](i2);
SAcQ(v2.questID);
return; return;
end end
end end
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);
TI_FunctionList.g.default(i2);
TI_FunctionList.g.gossip(i2);
return; return;
end end
end end
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(TI_availnumber-1);
TI_debug("Selecting Available Quest ".. TI_availnumber-1);
SAvQ(AvailableQuests[TI_availnumber].questID);
TI_debug("Selecting Available Quest ".. TI_availnumber);
TI_ResetPointers(); TI_ResetPointers();
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
while TI_activenumber <= #ActiveQuests do while TI_activenumber <= #ActiveQuests do
TI_activenumber = TI_activenumber + 1;
if ActiveQuests[TI_activenumber-1].isComplete then
TI_debug("Selecting Active Quest ".. TI_activenumber-1 .. " " .. ActiveQuests[TI_activenumber-1].name );
SAcQ(TI_activenumber-1);
if ActiveQuests[TI_activenumber].isComplete then
TI_debug("Selecting Active Quest ".. TI_activenumber .. " " .. ActiveQuests[TI_activenumber].name );
SAcQ(ActiveQuests[TI_activenumber].questID);
TI_ResetPointers(); TI_ResetPointers();
return; return;
else else
TI_debug("Active Quest ".. TI_activenumber-1 .. " " .. ActiveQuests[TI_activenumber-1].name .. " is not complete")
TI_debug("Active Quest ".. TI_activenumber .. " " .. ActiveQuests[TI_activenumber].name .. " is not complete")
TI_activenumber = TI_activenumber + 1;
end end
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();
TI_FunctionList.g.default(j);
TI_FunctionList.g.gossip(j);
return; return;
end end
end end
local temp = {}; local temp = {};
temp.name = gqui.title; temp.name = gqui.title;
temp.icon = QuestUtil.GetQuestIconActive(gqui.isComplete, gqui.isLegendary,
gqui.frequency, gqui.isRepeatable, gqui.isCampaign, gqui.isCovenantCalling);

temp.icon = QuestUtil.GetQuestIconOffer(
gqui.isLegendary,
gqui.frequency,
gqui.isRepeatable,
false,
false
);
temp.questID = gqui.questID;
temp.isComplete = gqui.isComplete; temp.isComplete = gqui.isComplete;
table.insert(x, temp); table.insert(x, temp);
for i,gui in ipairs(guis) do for i,gui in ipairs(guis) do
local temp = {}; local temp = {};
temp.name = gui.name; temp.name = gui.name;
if gui.type == "chatbubble" then
gui.type = "gossip"
local gossipType = TI_TranslateIconToType(gui.icon)
if gossipType == "chatbubble" then
gossipType = "gossip"
end end
temp.type = gui.type;
temp.type = gossipType;
temp.icon = gui.icon;
temp.gossipOptionID = gui.gossipOptionID
temp.orderIndex = gui.orderIndex
table.insert(x, temp); table.insert(x, temp);
end end
return x; return x;
g = { g = {
availquest = C_GossipInfo.SelectAvailableQuest, availquest = C_GossipInfo.SelectAvailableQuest,
activequest = C_GossipInfo.SelectActiveQuest, activequest = C_GossipInfo.SelectActiveQuest,
default = C_GossipInfo.SelectOption,
gossip = SelectGossipOption,
getavailquests = C_GossipInfo.GetAvailableQuests, getavailquests = C_GossipInfo.GetAvailableQuests,
getactivequests = C_GossipInfo.GetActiveQuests, getactivequests = C_GossipInfo.GetActiveQuests,
getoptions = C_GossipInfo.GetOptions, getoptions = C_GossipInfo.GetOptions,
tabulateOptions = TI_TabulateGossipUIInfo_Retail, tabulateOptions = TI_TabulateGossipUIInfo_Retail,
}, },
q = { q = {
activequest = C_GossipInfo.SelectActiveQuest,
availquest = C_GossipInfo.SelectAvailableQuest,
activequest = SelectActiveQuest,
availquest = SelectAvailableQuest,
} }
}; };
else else
g = { g = {
availquest = SelectGossipAvailableQuest, availquest = SelectGossipAvailableQuest,
activequest = SelectGossipActiveQuest, activequest = SelectGossipActiveQuest,
default = SelectGossipOption,
gossip = SelectGossipOption,
getavailquests = GetGossipAvailableQuests, getavailquests = GetGossipAvailableQuests,
getactivequests = GetGossipActiveQuests, getactivequests = GetGossipActiveQuests,
getoptions = GetGossipOptions, getoptions = GetGossipOptions,

+ 2
- 2
TurnIn.toc 查看文件

## Interface: 90207
## X-Compatible-With: 90207
## Interface: 100000
## X-Compatible-With: 100000
## 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

+ 17
- 61
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">
<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" />
<KeyValues> <KeyValues>
<KeyValue key="backdropInfo" value="BACKDROP_TUTORIAL_16_16" type="global"/> <KeyValue key="backdropInfo" value="BACKDROP_TUTORIAL_16_16" type="global"/>
</KeyValues> </KeyValues>
<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> <Scripts>
<OnLoad> <OnLoad>
self:ApplyBackdrop(); self:ApplyBackdrop();
--> -->
</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>
</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>
<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>
</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>
</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>
<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(self); TI_TempNPCListTooltipShow(self);
<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>
</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>
</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>
</Frames> </Frames>
</Frame> </Frame>
<Frame Name="TI_TempNPCListWindow" parent="UIParent" frameStrata="DIALOG" toplevel="true" enableMouse="true" movable="true" hidden="true" inherits="BackdropTemplate">
<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>
<KeyValues> <KeyValues>
<KeyValue key="backdropInfo" value="BACKDROP_TUTORIAL_16_16" type="global"/> <KeyValue key="backdropInfo" value="BACKDROP_TUTORIAL_16_16" type="global"/>
</KeyValues> </KeyValues>
<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> <Scripts>
<OnLoad> <OnLoad>
self.backdropInfo = { self.backdropInfo = {
</Scripts> </Scripts>
</Frame> </Frame>
<Frame Name="TI_OptionsFrame" inherits="BackdropTemplate" frameStrata="DIALOG" toplevel="true" enableMouse="true" enableMouseWheel="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>
<Frame name="TI_OptionsFrame" inherits="BackdropTemplate" frameStrata="DIALOG" toplevel="true" enableMouse="true" movable="true" parent="UIParent">
<KeyValues> <KeyValues>
<KeyValue key="backdropInfo" value="BACKDROP_DIALOG_32_32" type="global"/> <KeyValue key="backdropInfo" value="BACKDROP_DIALOG_32_32" type="global"/>
</KeyValues> </KeyValues>
<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> <Scripts>
<OnLoad> <OnLoad>
<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>
<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>
</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>
</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>

+ 5
- 1
TurnInUI.lua 查看文件

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); getglobal(entry .. "_Icon"):SetTexture(iconpath);
getglobal(entry .. "_Check"):SetChecked(v.state); getglobal(entry .. "_Check"):SetChecked(v.state);

+ 0
- 0
pkgmeta.yaml 查看文件


Loading…
取消
儲存