Kaynağa Gözat

10.0: API changes and XML XSD adherence

tags/2.3
SabinDeus 3 yıl önce
ebeveyn
işleme
027447cfa6
5 değiştirilmiş dosya ile 98 ekleme ve 87 silme
  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 Dosyayı Görüntüle

@@ -66,6 +66,49 @@ local TI_events = {
"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 = {};

function TI_message(...)
@@ -433,6 +476,7 @@ function TI_HandleGossipWindow(gorq)
x.gorq = gorq;
x.args = i;
x.type = v.type;
x.icon = v.icon;
x.state = false;
table.insert(ListEntry, x);
end
@@ -440,7 +484,6 @@ function TI_HandleGossipWindow(gorq)
local TotalOptions = #AvailableQuests+#ActiveQuests+#GossipOptions;
--if(TI_activenumber > ActiveQuests.getn()) TI_activenumber = 1;
if(TotalOptions < 1) then
return;
end
@@ -489,7 +532,7 @@ function TI_HandleGossipWindow(gorq)
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);
SAvQ(v2.questID);
return;
end
end
@@ -497,7 +540,7 @@ function TI_HandleGossipWindow(gorq)
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);
SAcQ(v2.questID);
return;
end
end
@@ -505,7 +548,7 @@ function TI_HandleGossipWindow(gorq)
for i2,v2 in ipairs(GossipOptions) do
if (v2.name == current.name) then
TI_debug(i1.."-Gossip Match Found: "..current.name..", "..current.type);
TI_FunctionList.g.default(i2);
TI_FunctionList.g.gossip(i2);
return;
end
end
@@ -528,28 +571,27 @@ function TI_HandleGossipWindow(gorq)
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);
SAvQ(AvailableQuests[TI_availnumber].questID);
TI_debug("Selecting Available Quest ".. TI_availnumber);
TI_ResetPointers();
return;
elseif(current.type == "activequest" and #ActiveQuests > 0 and TI_activenumber <= #ActiveQuests) then
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();
return;
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
elseif(#GossipOptions > 0) then
for j,val in ipairs(GossipOptions) do
if(val.type == current.type) then
TI_ResetPointers();
TI_FunctionList.g.default(j);
TI_FunctionList.g.gossip(j);
return;
end
end
@@ -641,9 +683,14 @@ function TI_TabulateGossipQuestUIInfo_Retail(gquis)
local temp = {};
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;
table.insert(x, temp);
@@ -657,10 +704,14 @@ function TI_TabulateGossipUIInfo_Retail(guis)
for i,gui in ipairs(guis) do
local temp = {};
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
temp.type = gui.type;
temp.type = gossipType;
temp.icon = gui.icon;
temp.gossipOptionID = gui.gossipOptionID
temp.orderIndex = gui.orderIndex
table.insert(x, temp);
end
return x;
@@ -724,7 +775,7 @@ if (TI_IsRetail()) then
g = {
availquest = C_GossipInfo.SelectAvailableQuest,
activequest = C_GossipInfo.SelectActiveQuest,
default = C_GossipInfo.SelectOption,
gossip = SelectGossipOption,
getavailquests = C_GossipInfo.GetAvailableQuests,
getactivequests = C_GossipInfo.GetActiveQuests,
getoptions = C_GossipInfo.GetOptions,
@@ -733,8 +784,8 @@ if (TI_IsRetail()) then
tabulateOptions = TI_TabulateGossipUIInfo_Retail,
},
q = {
activequest = C_GossipInfo.SelectActiveQuest,
availquest = C_GossipInfo.SelectAvailableQuest,
activequest = SelectActiveQuest,
availquest = SelectAvailableQuest,
}
};
else
@@ -742,7 +793,7 @@ else
g = {
availquest = SelectGossipAvailableQuest,
activequest = SelectGossipActiveQuest,
default = SelectGossipOption,
gossip = SelectGossipOption,
getavailquests = GetGossipAvailableQuests,
getactivequests = GetGossipActiveQuests,
getoptions = GetGossipOptions,

+ 2
- 2
TurnIn.toc Dosyayı Görüntüle

@@ -1,5 +1,5 @@
## Interface: 90207
## X-Compatible-With: 90207
## Interface: 100000
## X-Compatible-With: 100000
## Title: Turn In
## Notes: Automates the selection of quest and gossip options.
## SavedVariables: TI_status, TI_NPCDB, TI_NPCIndex

+ 17
- 61
TurnIn.xml Dosyayı Görüntüle

@@ -1,4 +1,5 @@
<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="TurnInUI.lua" />
@@ -20,17 +21,6 @@
<KeyValues>
<KeyValue key="backdropInfo" value="BACKDROP_TUTORIAL_16_16" type="global"/>
</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>
<OnLoad>
self:ApplyBackdrop();
@@ -55,7 +45,7 @@
-->
</Scripts>
<Frames>
<CheckButton name="$parent_Check" hidden="false" inherits="OptionsCheckButtonTemplate">
<CheckButton name="$parent_Check" hidden="false" inherits="UICheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
@@ -146,7 +136,7 @@
</Anchor>
</Anchors>
</Texture>
<FontString name="$parent_Text" inherits="GameFontNormal" justifyV="top" justifyH="left">
<FontString name="$parent_Text" inherits="GameFontNormal" justifyV="TOP" justifyH="LEFT">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parent_Icon" relativePoint="TOPRIGHT">
<Offset>
@@ -191,7 +181,7 @@
<AbsDimension x="232" y="20" />
</Size>
<Frames>
<CheckButton name="$parent_Check" hidden="false" inherits="OptionsCheckButtonTemplate">
<CheckButton name="$parent_Check" hidden="false" inherits="UICheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
@@ -214,7 +204,7 @@
</OnLeave>
</Scripts>
</CheckButton>
<Button name="$parent_Delete" hidden="false" inherits="OptionsButtonTemplate" text="X">
<Button name="$parent_Delete" hidden="false" inherits="UIPanelButtonTemplate" text="X">
<Anchors>
<Anchor point="RIGHT">
<Offset>
@@ -240,7 +230,7 @@
</Frames>
<Layers>
<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>
<Anchor point="LEFT">
<Offset>
@@ -261,7 +251,7 @@
<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>
<OnEnter>
TI_TempNPCListTooltipShow(self);
@@ -276,7 +266,7 @@
<Layers>
<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>
<Anchor point="LEFT">
<Offset>
@@ -288,7 +278,7 @@
</Layer>
</Layers>
<Frames>
<Button name="$parent_Delete" hidden="false" inherits="OptionsButtonTemplate" text="X">
<Button name="$parent_Delete" hidden="false" inherits="UIPanelButtonTemplate" text="X">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
@@ -311,7 +301,7 @@
</OnLeave>
</Scripts>
</Button>
<Button name="$parent_Add" hidden="false" inherits="OptionsButtonTemplate" text="+">
<Button name="$parent_Add" hidden="false" inherits="UIPanelButtonTemplate" text="+">
<Anchors>
<Anchor point="RIGHT" relativeTo="$parent_Delete" relativePoint="LEFT">
<Offset>
@@ -337,7 +327,7 @@
</Frames>
</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>
<AbsDimension x="200" y="130" />
</Size>
@@ -410,17 +400,6 @@
<KeyValues>
<KeyValue key="backdropInfo" value="BACKDROP_TUTORIAL_16_16" type="global"/>
</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>
<OnLoad>
self.backdropInfo = {
@@ -457,34 +436,11 @@
</Scripts>
</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>
<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">
<BackgroundInsets>
<AbsInset left="11" right="12" top="12" bottom="11"/>
</BackgroundInsets>
<TileSize>
<AbsValue val="32"/>
</TileSize>
<EdgeSize>
<AbsValue val="32"/>
</EdgeSize>
</Backdrop>
<Scripts>
<OnLoad>
@@ -555,7 +511,7 @@
<AbsDimension x="200" y="20" />
</Size>
<Frames>
<CheckButton name="$parent_Checkbox" hidden="false" inherits="OptionsCheckButtonTemplate">
<CheckButton name="$parent_Checkbox" hidden="false" inherits="UICheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
@@ -617,7 +573,7 @@
<AbsDimension x="200" y="40" />
</Size>
<Frames>
<CheckButton name="$parent_UseDefault" hidden="false" inherits="OptionsCheckButtonTemplate">
<CheckButton name="$parent_UseDefault" hidden="false" inherits="UICheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
@@ -637,7 +593,7 @@
</OnClick>
</Scripts>
</CheckButton>
<CheckButton name="$parent_AddAutomatically" hidden="false" inherits="OptionsCheckButtonTemplate">
<CheckButton name="$parent_AddAutomatically" hidden="false" inherits="UICheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parent_UseDefault" relativePoint="BOTTOMLEFT">
<Offset>
@@ -916,7 +872,7 @@
</Size>
<Frames>
<ScrollFrame name="TI_NPCListScrollFrame" inherits="FauxScrollFrameTemplate" hidden="false" enableMouseWheel="true">
<ScrollFrame name="TI_NPCListScrollFrame" inherits="FauxScrollFrameTemplate" hidden="false" >
<Anchors>
<Anchor point="TOPLEFT">
<Offset>

+ 5
- 1
TurnInUI.lua Dosyayı Görüntüle

@@ -29,7 +29,11 @@ function TI_PopulateOptions(arg)
iconpath = "Interface/GossipFrame/AvailableQuestIcon";
end
else
iconpath = "Interface/GossipFrame/" .. v.type .. "GossipIcon";
if(v.icon) then
iconpath = v.icon;
else
iconpath = "Interface/GossipFrame/" .. v.type .. "GossipIcon";
end
end
getglobal(entry .. "_Icon"):SetTexture(iconpath);
getglobal(entry .. "_Check"):SetChecked(v.state);

+ 0
- 0
pkgmeta.yaml Dosyayı Görüntüle


Loading…
İptal
Kaydet