diff --git a/Bindings.xml b/Bindings.xml
index 08fccc1..e96216e 100644
--- a/Bindings.xml
+++ b/Bindings.xml
@@ -3,6 +3,9 @@
<Binding name="TOGGLE_CAULDRONSHOPPINGLIST" header="CAULDRON">
Cauldron:ShoppingList_Toggle();
</Binding>
+ <Binding name="TOGGLE_CAULDRONQUEUE">
+ Cauldron:Queue_Toggle();
+ </Binding>
<Binding name="CAULDRONRESET">
Cauldron:Reset();
</Binding>
diff --git a/Cauldron.toc b/Cauldron.toc
index 6ed5d53..2431aca 100755
--- a/Cauldron.toc
+++ b/Cauldron.toc
@@ -1,5 +1,5 @@
## Interface: 40000
-## Title: Cauldron2 |cff7fff7f -Ace3-|r
+## Title: Cauldron |cff7fff7f -Ace3-|r
## Version: @project-revision@
## Author: Caendra of Silver Hand
## Notes: An improved interface for your trade skills
@@ -31,9 +31,12 @@ CauldronUtil.lua
CauldronData.lua
CauldronMainUI.lua
+CauldronQueueUI.lua
CauldronShoppingListUI.lua
+CauldronCommon.xml
CauldronMain.xml
+CauldronQueue.xml
CauldronShoppingList.xml
#@alpha@
diff --git a/CauldronCommon.xml b/CauldronCommon.xml
new file mode 100644
index 0000000..c9b536e
--- /dev/null
+++ b/CauldronCommon.xml
@@ -0,0 +1,27 @@
+<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">
+
+ <!-- Template: Button -->
+ <Button name="CauldronButtonTemplate" inherits="MagicButtonTemplate" virtual="true">
+ <Size x="80" y="20" />
+ <NormalText inherits="GameFontHighlightSmall" />
+ <DisabledText inherits="GameFontDisableSmall" />
+ <HighlightText inherits="GameFontHighlightSmall" />
+ <Scripts>
+ <OnClick>
+ PlaySound("igMainMenuOptionCheckBoxOn");
+ </OnClick>
+ <OnEnter>
+ if ( self.tooltipText ) then
+ GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
+ GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1);
+ end
+ </OnEnter>
+ <OnLeave>
+ GameTooltip:Hide();
+ </OnLeave>
+ </Scripts>
+ </Button>
+
+</Ui>
diff --git a/CauldronMain.lua b/CauldronMain.lua
index 107c484..38c4edd 100644
--- a/CauldronMain.lua
+++ b/CauldronMain.lua
@@ -2,6 +2,7 @@
-- Cauldron main file
UIPanelWindows["CauldronQueueWindowFrame"] = { area = "left", pushable = 6 };
+UIPanelWindows["CauldronFrame"] = { area = "left", pushable = 3 };
Cauldron = LibStub("AceAddon-3.0"):NewAddon("Cauldron", "AceEvent-3.0", "AceTimer-3.0", "AceConsole-3.0", "AceHook-3.0", "LibLogger-1.0");
local L = LibStub("AceLocale-3.0"):GetLocale("Cauldron");
@@ -12,14 +13,17 @@ Cauldron.date = string.sub("$Date: 2010-08-27 21:03:36 -0700 (Fri, 27 Aug 2010)
-- key binding names
BINDING_HEADER_CAULDRON = "Cauldron";
BINDING_NAME_TOGGLE_CAULDRONSHOPPINGLIST = "Toggle Shopping List Window";
+BINDING_NAME_TOGGLE_CAULDRONQUEUE = "Toggle Queue";
BINDING_NAME_CAULDRONRESET = "Reset Cauldron";
-Cauldron.options = {};
-Cauldron.options.buttons = {};
+Cauldron.options = {
+ buttons = {},
+};
Cauldron.vars = {
enabled = true,
- inventory = {};
+ showQueue = true,
+ inventory = {},
};
Cauldron.libs = {};
@@ -312,6 +316,9 @@ function Cauldron:OnEnable()
-- clear init flag
self.initializing = false;
+
+ -- upset the standard tradeskill frame
+ UIPanelWindows["TradeSkillFrame"] = { area = "center" };
end
@@ -354,9 +361,9 @@ function Cauldron:OnTradeShow()
self:debug("OnTradeShow: update known skills");
-- self:ScheduleTimer(self.UpdateSkills,1,self);
if not Cauldron.updatingSkills then
- self.updatingSkills = true;
- self:UpdateSkills();
- self.updatingSkills = false;
+-- Cauldron:info("Requesting skill update on trade show");
+ Cauldron.updatingSkills = Cauldron:NeedsSkillUpdate();
+ Cauldron:UpdateSkills();
end
-- register for events that are needed when the window is open
@@ -410,7 +417,8 @@ function Cauldron:OnSkillUpdate()
-- Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[CURRENT_TRADESKILL].window.selected = 0;
if not Cauldron.updatingSkills then
- Cauldron.updatingSkills = true;
+-- Cauldron:info("Requesting skill update for skill update");
+ Cauldron.updatingSkills = Cauldron:NeedsSkillUpdate();
Cauldron:UpdateSkills();
Cauldron.updatingSkills = false;
end
@@ -1287,6 +1295,9 @@ end
},
["skills"] = {
["<tradeskill>"] = {
+ ["skillLevel"] = <level>,
+ ["skillCount"] = <count>,
+ ["lastScanDate"] = <millis>,
["window"] = { -- window metadata
["categories"] = { -- category cache of the tradeskill
["<category>"] = { -- name of the category
diff --git a/CauldronMain.xml b/CauldronMain.xml
index 0fe31f4..c9cbaee 100755
--- a/CauldronMain.xml
+++ b/CauldronMain.xml
@@ -2,69 +2,156 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
- <!-- Template: Button -->
- <Button name="CauldronButtonTemplate" inherits="MagicButtonTemplate" virtual="true">
- <Size x="80" y="20" />
- <NormalText inherits="GameFontHighlightSmall" />
- <DisabledText inherits="GameFontDisableSmall" />
- <HighlightText inherits="GameFontHighlightSmall" />
- <Scripts>
- <OnClick>
- PlaySound("igMainMenuOptionCheckBoxOn");
+ <!-- Template: Reagent detail (normal) -->
+ <Button name="CauldronReagentDetailTemplate" virtual="true">
+ <Layers>
+ <Layer level="BACKGROUND">
+ <Texture name="$parentIconTexture">
+ <Size x="39" y="39"/>
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="0" y="0"/>
+ </Anchor>
+ </Anchors>
+ </Texture>
+ <Texture name="$parentNameFrame" urgency="5" file="Interface\QuestFrame\UI-QuestItemNameFrame">
+ <Size x="128" y="64"/>
+ <Anchors>
+ <Anchor point="LEFT" relativeTo="$parentIconTexture" relativePoint="RIGHT">
+ <Offset x="-10" y="0"/>
+ </Anchor>
+ </Anchors>
+ </Texture>
+ <FontString name="$parentName" inherits="GameFontHighlight" justifyH="LEFT">
+ <Size x="90" y="36"/>
+ <Anchors>
+ <Anchor point="LEFT" relativeTo="$parentNameFrame">
+ <Offset x="15" y="0"/>
+ </Anchor>
+ </Anchors>
+ </FontString>
+ </Layer>
+ <Layer level="ARTWORK">
+ <FontString name="$parentCount" inherits="NumberFontNormal" justifyH="RIGHT">
+ <Anchors>
+ <Anchor point="BOTTOMRIGHT" relativeTo="$parentIconTexture">
+ <Offset x="-1" y="1"/>
+ </Anchor>
+ </Anchors>
+ </FontString>
+ </Layer>
+ </Layers>
+ <Scripts>
+ <OnEnter>
+ GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
+ -- GameTooltip:SetHyperlink(self.link);
+ GameTooltip:SetTradeSkillItem(self.skillIndex, self.reagentIndex);
+ CursorUpdate(self);
+ </OnEnter>
+ <OnLeave>
+ GameTooltip:Hide();
+ ResetCursor();
+ </OnLeave>
+ <OnUpdate>
+ CursorOnUpdate(self);
+ </OnUpdate>
+ <OnClick>
+ HandleModifiedItemClick(self.link);
</OnClick>
- <OnEnter>
- if ( self.tooltipText ) then
- GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
- GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, 1);
- end
+ </Scripts>
+ </Button>
+
+ <!-- Template: Reagent detail (small) -->
+ <Button name="CauldronReagentDetailSmallTemplate" virtual="true">
+ <Size x="16" y="16" />
+ <Layers>
+ <Layer level="BACKGROUND">
+ <Texture name="$parentIconTexture">
+ <Size x="18" y="18"/>
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="0" y="0"/>
+ </Anchor>
+ </Anchors>
+ </Texture>
+ </Layer>
+ <Layer level="ARTWORK">
+ <FontString name="$parentCount" inherits="NumberFontNormal" justifyH="RIGHT">
+ <Anchors>
+ <Anchor point="BOTTOMRIGHT" relativeTo="$parentIconTexture">
+ <Offset x="-1" y="1"/>
+ </Anchor>
+ </Anchors>
+ </FontString>
+ </Layer>
+ </Layers>
+ <Scripts>
+ <OnLoad>
+-- self:SetScale(0.5);
+ </OnLoad>
+ <OnEnter>
+ GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
+ -- GameTooltip:SetHyperlink(self.link);
+ GameTooltip:SetTradeSkillItem(self.skillIndex, self.reagentIndex);
+ CursorUpdate(self);
</OnEnter>
- <OnLeave>
- GameTooltip:Hide();
+ <OnLeave>
+ GameTooltip:Hide();
+ ResetCursor();
</OnLeave>
- </Scripts>
- </Button>
+ <OnUpdate>
+ CursorOnUpdate(self);
+ </OnUpdate>
+ <OnClick>
+ HandleModifiedItemClick(self.link);
+ </OnClick>
+ </Scripts>
+ </Button>
- <!-- Template: Queue item frame -->
- <Button name="CauldronQueueItemFrameTemplate" virtual="true" enableMouse="true">
- <Size x="300" y="39" />
- <Layers>
+ <!-- Template: Skill category header -->
+ <Frame name="CauldronSkillCategoryFrameTemplate" virtual="true">
+ </Frame>
+
+ <!-- Template: Skill item base -->
+ <Frame name="CauldronSkillItemBaseFrameTemplate" virtual="true">
+ <Size x="510" y="37" />
+ </Frame>
+
+ <!-- Template: Skill item (normal, collapsed) -->
+ <Button name="CauldronSkillItemNormalCollapsedFrameTemplate" inherits="CauldronSkillItemBaseFrameTemplate" virtual="true">
+ <Layers>
<Layer level="OVERLAY">
- <!-- item name -->
- <FontString name="$parentItemName" inherits="GameFontNormal"
+ <FontString name="$parentSkillName" inherits="GameFontNormal"
text="(name)" justifyH="LEFT" justifyV="CENTER">
<Size x="250" y="12"/>
<Anchors>
<Anchor point="TOPLEFT">
- <Offset x="40" y="-4"/>
+ <Offset x="55" y="-4"/>
</Anchor>
</Anchors>
- <Color r="0.8" g="0.8" b="0.8" />
</FontString>
- <!-- quantity info -->
- <FontString name="$parentInfo" inherits="GameFontNormal"
- text="(info)" justifyH="LEFT" justifyV="CENTER">
+ <FontString name="$parentSkillInfo" inherits="GameFontNormalSmall"
+ text="(skill info)" justifyH="LEFT" justifyV="CENTER">
<Size x="250" y="12"/>
<Anchors>
<Anchor point="TOPLEFT">
- <Offset x="40" y="-18"/>
+ <Offset x="70" y="-20"/>
</Anchor>
</Anchors>
- <!-- Color r="1.0" g="1.0" b="1.0" / -->
</FontString>
</Layer>
<Layer level="HIGHLIGHT" setAllPoints="true">
<Texture file="Interface\QuestFrame\UI-QuestLogTitleHighlight" alphaMode="ADD">
- <Color r="0.8" g="0.8" b="0.8" a="0.5" />
+ <Color r="0.7" g="0.7" b="0.7" a="0.5" />
</Texture>
</Layer>
- </Layers>
- <Frames>
- <!-- icon -->
- <Button name="$parentIcon">
+ </Layers>
+ <Frames>
+ <Button name="$parentSkillIcon">
<Size x="37" y="37"/>
<Anchors>
<Anchor point="TOPLEFT">
- <Offset x="2" y="-3"/>
+ <Offset x="15" y="-3"/>
</Anchor>
</Anchors>
<Layers>
@@ -80,14 +167,17 @@
</Layers>
<Scripts>
<OnLoad>
+ self.isCompact = false;
-- self.hasItem = 1;
</OnLoad>
<OnClick>
- HandleModifiedItemClick(self.link);
+ HandleModifiedItemClick(GetTradeSkillItemLink(self.skillIndex));
+ Cauldron:SkillItem_OnClick(self, button, down);
</OnClick>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
- GameTooltip:SetHyperlink(self.link);
+ GameTooltip:SetTradeSkillItem(self.skillIndex);
+ -- Cauldron:AppendToTooltip(GameTooltip, self.skillIndex);
CursorUpdate(self);
</OnEnter>
<OnLeave>
@@ -97,675 +187,1033 @@
<OnUpdate>
if GameTooltip:IsOwned(self) then
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
- GameTooltip:SetHyperlink(self.link);
+ GameTooltip:SetTradeSkillItem(self.skillIndex);
CursorUpdate(self);
end
CursorOnUpdate(self);
</OnUpdate>
</Scripts>
</Button>
- <Button name="$parentRemoveItem" inherits="UIPanelCloseButton">
- <Anchors>
- <Anchor point="TOPRIGHT">
- <Offset x="0" y="0"/>
- </Anchor>
- </Anchors>
- <Scripts>
- <OnEnter>
- self:GetParent().inHoverButtons = true;
-
- GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
- GameTooltip:ClearLines();
- GameTooltip:AddLine(Cauldron:LocaleString("Remove this item from the queue"));
- GameTooltip:Show();
- CursorUpdate(self);
- </OnEnter>
- <OnLeave>
- self:GetParent().inHoverButtons = false;
-
- GameTooltip:Hide();
- ResetCursor();
- </OnLeave>
- <OnClick>
- Cauldron:RemoveQueueItem(self:GetParent().itemName);
- Cauldron:UpdateQueue();
- Cauldron:UpdateButtons();
- </OnClick>
- </Scripts>
- </Button>
- <!--
- <Button name="$parentAddToShoppingList" inherits="UIPanelCloseButton" hidden="true">
- <Anchors>
- <Anchor point="TOPRIGHT">
- <Offset x="0" y="0"/>
- </Anchor>
- </Anchors>
- <Scripts>
- <OnEnter>
- self:GetParent().inHoverButtons = true;
-
- GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
- GameTooltip:ClearLines();
- GameTooltip:AddLine(Cauldron:LocaleString("Add this item to the shopping list"));
- GameTooltip:AddLine(Cauldron:LocaleString("Shift-click will replace the count in the shopping list with this amount"));
- GameTooltip:Show();
- CursorUpdate(self);
- </OnEnter>
- <OnLeave>
- self:GetParent().inHoverButtons = false;
-
- GameTooltip:Hide();
- ResetCursor();
- </OnLeave>
- <OnClick>
- Cauldron:AddItemToShoppingList(self:GetParent().itemName, self:GetParent().needAmount, IsShiftKeyDown());
- Cauldron:UpdateShoppingList();
- </OnClick>
- </Scripts>
- <NormalTexture file="Interface\Buttons\UI-PlusButton-Up" />
- <PushedTexture file="Interface\Buttons\UI-PlusButton-Down" />
- <DisabledTexture file="Interface\Buttons\UI-PlusButton-Disabled" />
- <HighlightTexture file="Interface\Buttons\UI-PlusButton-Hilight" alphaMode="ADD" />
- </Button>
- <Button name="$parentIncrementCount" hidden="true" inherits="ClassTrainerSkillButtonTemplate">
- <Size x="23" y="22" />
- <Anchors>
- <Anchor point="TOPRIGHT">
- <Offset x="-48" y="-6"/>
- </Anchor>
- </Anchors>
+ <CheckButton name="$parentFavoriteButton" hidden="false" inherits="UICheckButtonTemplate" text="">
+ <Size x="20" y="22"/>
+ <Anchors>
+ <Anchor point="BOTTOMLEFT" relativeTo="$parentSkillIcon" relativePoint="BOTTOMRIGHT">
+ <Offset x="2" y="10"/>
+ </Anchor>
+ </Anchors>
<Scripts>
<OnLoad>
- self:RegisterForClicks("AnyUp");
+ self:SetScale(0.625);
+ self:SetText(Cauldron:LocaleString("Favorite?"));
</OnLoad>
<OnEnter>
- self:GetParent().inHoverButtons = true;
-
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:ClearLines();
- GameTooltip:AddLine(Cauldron:LocaleString("Increase the amount of this item"));
+ GameTooltip:AddLine(Cauldron:LocaleString("Mark this skill as a favorite"));
GameTooltip:Show();
CursorUpdate(self);
</OnEnter>
<OnLeave>
- self:GetParent().inHoverButtons = false;
-
GameTooltip:Hide();
ResetCursor();
</OnLeave>
<OnClick>
- Cauldron:IncreaseItemCount(self:GetParent().itemName);
- Cauldron:UpdateQueue();
- Cauldron:UpdateButtons();
+ PlaySound("igMainMenuOptionCheckBoxOn");
+ Cauldron:FavoriteItemButton_OnClick(self);
+ Cauldron:UpdateSkillList();
</OnClick>
</Scripts>
- <NormalTexture file="Interface\Buttons\UI-PlusButton-Up" />
- <PushedTexture file="Interface\Buttons\UI-PlusButton-Down" />
- <DisabledTexture file="Interface\Buttons\UI-PlusButton-Disabled" />
- <HighlightTexture file="Interface\Buttons\UI-PlusButton-Hilight" alphaMode="ADD" />
- </Button>
- <Button name="$parentDecrementCount" hidden="true" inherits="ClassTrainerSkillButtonTemplate">
- <Size x="23" y="22" />
- <Anchors>
- <Anchor point="TOPRIGHT">
- <Offset x="-16" y="-2"/>
- </Anchor>
- </Anchors>
+ </CheckButton>
+ <Button name="$parentDiscloseButton" inherits="ClassTrainerSkillButtonTemplate">
+ <Size x="20" y="22"/>
+ <Anchors>
+ <Anchor point="RIGHT" relativeTo="$parentSkillIcon" relativePoint="LEFT">
+ <Offset x="0" y="0"/>
+ </Anchor>
+ </Anchors>
<Scripts>
<OnLoad>
- self:RegisterForClicks("AnyUp");
+ self:SetScale(0.75);
+ self:SetText("");
</OnLoad>
- <OnEnter>
- self:GetParent().inHoverButtons = true;
+ <OnClick>
+ Cauldron:CollapseItemButton_OnClick(self);
+ </OnClick>
+ </Scripts>
+ </Button>
+ <Frame name="$parentReagents">
+ <Size x="70" y="37" />
+ <Anchors>
+ <Anchor point="LEFT" relativeTo="$parentSkillIcon" relativePoint="RIGHT">
+ <Offset x="0" y="0"/>
+ </Anchor>
+ </Anchors>
+ <Frames>
+ <!--
+ <Button name="$parentItemDetail1" inherits="CauldronReagentDetailSmallTemplate" id="1">
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="0" y="-1"/>
+ </Anchor>
+ </Anchors>
+ </Button>
+ <Button name="$parentItemDetail2" inherits="CauldronReagentDetailSmallTemplate" id="2">
+ <Anchors>
+ <Anchor point="LEFT" relativeTo="$parentItemDetail1" relativePoint="RIGHT">
+ <Offset x="1" y="0"/>
+ </Anchor>
+ </Anchors>
+ </Button>
+ <Button name="$parentItemDetail3" inherits="CauldronReagentDetailSmallTemplate" id="3">
+ <Anchors>
+ <Anchor point="TOP" relativeTo="$parentItemDetail1" relativePoint="BOTTOM">
+ <Offset x="0" y="-1"/>
+ </Anchor>
+ </Anchors>
+ </Button>
+ <Button name="$parentItemDetail4" inherits="CauldronReagentDetailSmallTemplate" id="4">
+ <Anchors>
+ <Anchor point="LEFT" relativeTo="$parentItemDetail3" relativePoint="RIGHT">
+ <Offset x="1" y="0"/>
+ </Anchor>
+ </Anchors>
+ </Button>
+ <Button name="$parentItemDetail5" inherits="CauldronReagentDetailSmallTemplate" id="5">
+ <Anchors>
+ <Anchor point="TOP" relativeTo="$parentItemDetail3" relativePoint="BOTTOM">
+ <Offset x="0" y="-1"/>
+ </Anchor>
+ </Anchors>
+ </Button>
+ <Button name="$parentItemDetail6" inherits="CauldronReagentDetailSmallTemplate" id="6">
+ <Anchors>
+ <Anchor point="LEFT" relativeTo="$parentItemDetail5" relativePoint="RIGHT">
+ <Offset x="1" y="0"/>
+ </Anchor>
+ </Anchors>
+ </Button>
+ <Button name="$parentItemDetail7" inherits="CauldronReagentDetailSmallTemplate" id="7">
+ <Anchors>
+ <Anchor point="TOP" relativeTo="$parentItemDetail7" relativePoint="BOTTOM">
+ <Offset x="0" y="-1"/>
+ </Anchor>
+ </Anchors>
+ </Button>
+ <Button name="$parentItemDetail8" inherits="CauldronReagentDetailSmallTemplate" id="8">
+ <Anchors>
+ <Anchor point="LEFT" relativeTo="$parentItemDetail7" relativePoint="RIGHT">
+ <Offset x="1" y="0"/>
+ </Anchor>
+ </Anchors>
+ </Button>
+ -->
+ </Frames>
+ </Frame>
+ <Frame name="$parentMiscInfo">
+ <Size x="51" y="37" />
+ <Anchors>
+ <Anchor point="TOPRIGHT">
+ <Offset x="-55" y="0" />
+ </Anchor>
+ </Anchors>
+ <Layers>
+ <Layer level="OVERLAY">
+ <FontString name="$parentCount" inherits="GameFontNormalLarge"
+ justifyH="CENTER" justifyV="CENTER">
+ <Size x="40" y="37"/>
+ <Anchors>
+ <Anchor point="RIGHT" relativeTo="$parentMiscInfo" relativePoint="RIGHT">
+ <Offset x="0" y="0"/>
+ </Anchor>
+ </Anchors>
+ <Color r="1.0" g="1.0" b="1.0" />
+ </FontString>
+ <!--
+ <Texture name="$parentNumSkillUpsIcon" file="Interface\TradeSkillFrame\UI-TradeSkill-Multiskill">
+ <Size x="16" y="16"/>
+ <Anchors>
+ <Anchor point="TOPLEFT" relativeTo="$parentMiscInfo" relativePoint="TOPLEFT">
+ <Offset x="35" y="0"/>
+ </Anchor>
+ </Anchors>
+ </Texture>
+ <FontString name="$parentNumSkillUps" inherits="GameFontNormal"
+ justifyH="CENTER" justifyV="CENTER">
+ <Size x="16" y="18"/>
+ <Anchors>
+ <Anchor point="TOPLEFT" relativeTo="$parentMiscInfo" relativePoint="TOPLEFT">
+ <Offset x="35" y="-18"/>
+ </Anchor>
+ </Anchors>
+ </FontString>
+ <FontString name="$parentAchievement" inherits="GameFontNormal"
+ justifyH="CENTER" justifyV="CENTER" text="A">
+ <Size x="10" y="37"/>
+ <Anchors>
+ <Anchor point="TOPLEFT" relativeTo="$parentMiscInfo" relativePoint="TOPLEFT">
+ <Offset x="25" y="0"/>
+ </Anchor>
+ </Anchors>
+ </FontString>
+ -->
+ </Layer>
+ </Layers>
+ <Frames>
+ <Button name="Button1" text="Button1" inherits="CauldronButtonTemplate" parentKey="button1">
+ <Size x="200" y="40" />
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="0" y="-1"/>
+ </Anchor>
+ </Anchors>
+ </Button>
+ </Frames>
+ </Frame>
+ <Frame name="$parentSelection" setAllPoints="true" enableMouse="true" hidden="true" frameStrata="LOW" frameLevel="1">
+ <Layers>
+ <Layer level="OVERLAY">
+ <Texture name="$parentSelection" file="Interface\QuestFrame\UI-QuestLogTitleHighlight" alphaMode="ADD">
+ <Color r="0.5" g="0.5" b="0.5" a="0.5" />
+ </Texture>
+ </Layer>
+ </Layers>
+ </Frame>
+ </Frames>
+ <Scripts>
+ </Scripts>
+ </Button>
+ <!-- Template: Skill item (normal, expanded) -->
+ <Button name="CauldronSkillItemNormalExpandedFrameTemplate" virtual="true">
+ <Layers>
+ <Layer level="OVERLAY">
+ <FontString name="$parentSkillName" inherits="GameFontNormal"
+ text="(name)" justifyH="LEFT" justifyV="CENTER">
+ <Size x="250" y="12"/>
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="62" y="-4"/>
+ </Anchor>
+ </Anchors>
+ </FontString>
+ <FontString name="$parentSkillCategory" inherits="GameFontNormalSmall"
+ text="(category)" justifyH="LEFT" justifyV="CENTER">
+ <Size x="250" y="12"/>
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="62" y="-20"/>
+ </Anchor>
+ </Anchors>
+ </FontString>
+ <FontString name="$parentSkillCooldown" inherits="GameFontRedSmall"
+ text="(cooldown)" justifyH="RIGHT" nonSpaceWrap="true" maxLines="3"
+ hidden="true">
+ <Size x="75" y="50"/>
+ <Anchors>
+ <Anchor point="TOPRIGHT">
+ <Offset x="0" y="0"/>
+ </Anchor>
+ </Anchors>
+ </FontString>
+ </Layer>
+ <Layer level="HIGHLIGHT" setAllPoints="true">
+ <Texture file="Interface\QuestFrame\UI-QuestLogTitleHighlight" alphaMode="ADD">
+ <Color r="0.7" g="0.7" b="0.7" a="0.5" />
+ </Texture>
+ </Layer>
+ </Layers>
+ <Frames>
+ <!--
+ <Frame name="$parentSkillNameTooltipFrame">
+ <Size x="250" y="12"/>
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="62" y="-4"/>
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnClick>
+ HandleModifiedItemClick(GetTradeSkillItemLink(self.skillIndex));
+ Cauldron:SkillItem_OnClick(self, button, down);
+ </OnClick>
+ <OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
- GameTooltip:ClearLines();
- GameTooltip:AddLine(Cauldron:LocaleString("Decrease the amount of this item"));
- GameTooltip:Show();
+ GameTooltip:SetTradeSkillItem(self.skillIndex);
CursorUpdate(self);
- </OnEnter>
- <OnLeave>
- self:GetParent().inHoverButtons = false;
-
- GameTooltip:Hide();
- ResetCursor();
- </OnLeave>
+ </OnEnter>
+ <OnLeave>
+ GameTooltip:Hide();
+ ResetCursor();
+ </OnLeave>
+ <OnUpdate>
+ if GameTooltip:IsOwned(self) then
+ GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
+ GameTooltip:SetTradeSkillItem(self.skillIndex);
+ CursorUpdate(self);
+ end
+ CursorOnUpdate(self);
+ </OnUpdate>
+ </Scripts>
+ </Frame>
+ -->
+ <Button name="$parentSkillIcon">
+ <Size x="37" y="37"/>
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="24" y="-3"/>
+ </Anchor>
+ </Anchors>
+ <Layers>
+ <Layer level="ARTWORK">
+ <FontString name="$parentCount" inherits="NumberFontNormal" justifyH="RIGHT" hidden="false">
+ <Anchors>
+ <Anchor point="BOTTOMRIGHT">
+ <Offset x="-2" y="2"/>
+ </Anchor>
+ </Anchors>
+ </FontString>
+ </Layer>
+ </Layers>
+ <Scripts>
+ <OnLoad>
+ self.isCompact = false;
+ -- self.hasItem = 1;
+ </OnLoad>
<OnClick>
- Cauldron:DecreaseItemCount(self:GetParent().itemName);
- Cauldron:UpdateQueue();
- Cauldron:UpdateButtons();
+ HandleModifiedItemClick(GetTradeSkillItemLink(self.skillIndex));
+ Cauldron:SkillItem_OnClick(self, button, down);
</OnClick>
+ <OnEnter>
+ GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
+ GameTooltip:SetTradeSkillItem(self.skillIndex);
+ -- Cauldron:AppendToTooltip(GameTooltip, self.skillIndex);
+ CursorUpdate(self);
+ </OnEnter>
+ <OnLeave>
+ GameTooltip:Hide();
+ ResetCursor();
+ </OnLeave>
+ <OnUpdate>
+ if GameTooltip:IsOwned(self) then
+ GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
+ GameTooltip:SetTradeSkillItem(self.skillIndex);
+ CursorUpdate(self);
+ end
+ CursorOnUpdate(self);
+ </OnUpdate>
</Scripts>
- <NormalTexture file="Interface\Buttons\UI-MinusButton-Up" />
- <PushedTexture file="Interface\Buttons\UI-MinusButton-Down" />
- <DisabledTexture file="Interface\Buttons\UI-MinusButton-Disabled" />
- <HighlightTexture file="Interface\Buttons\UI-ScrollBar-ScrollUpButton-Highlight" alphaMode="ADD" />
</Button>
- <Button name="$parentIncreasePriority" hidden="true">
- <Size x="23" y="22" />
- <Anchors>
- <Anchor point="TOPRIGHT">
- <Offset x="-16" y="-20"/>
- </Anchor>
- </Anchors>
+ <Button name="$parentDiscloseButton" hidden="false" inherits="ClassTrainerSkillButtonTemplate">
+ <Size x="20" y="22"/>
+ <Anchors>
+ <Anchor point="RIGHT" relativeTo="$parentSkillIcon" relativePoint="LEFT">
+ <Offset x="0" y="0"/>
+ </Anchor>
+ </Anchors>
<Scripts>
<OnLoad>
- self:RegisterForClicks("AnyUp");
+ self:SetText("");
</OnLoad>
- <OnEnter>
- self:GetParent().inHoverButtons = true;
-
- GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
- GameTooltip:ClearLines();
- GameTooltip:AddLine(Cauldron:LocaleString("Increase the priority of this item"));
- GameTooltip:AddLine(Cauldron:LocaleString("Shift-click to move to the top of the queue"));
- GameTooltip:Show();
- CursorUpdate(self);
- </OnEnter>
- <OnLeave>
- self:GetParent().inHoverButtons = false;
-
- GameTooltip:Hide();
- ResetCursor();
- </OnLeave>
<OnClick>
- Cauldron:IncreaseItemPriority(self:GetParent().itemName, IsShiftKeyDown());
- CauldronQueue:CalculateAllRequiredItems(Cauldron:GetQueue());
- Cauldron:UpdateQueue();
+ Cauldron:CollapseItemButton_OnClick(self);
</OnClick>
</Scripts>
- <NormalTexture file="Interface\Buttons\UI-ScrollBar-ScrollUpButton-Up" />
- <PushedTexture file="Interface\Buttons\UI-ScrollBar-ScrollUpButton-Down" />
- <DisabledTexture file="Interface\Buttons\UI-ScrollBar-ScrollUpButton-Disabled" />
- <HighlightTexture file="Interface\Buttons\UI-ScrollBar-ScrollUpButton-Highlight" alphaMode="ADD" />
</Button>
- <Button name="$parentDecreasePriority" hidden="true">
- <Size x="23" y="22" />
- <Anchors>
- <Anchor point="TOPRIGHT">
- <Offset x="0" y="-20"/>
- </Anchor>
- </Anchors>
+ <CheckButton name="$parentFavoriteButton" hidden="false" inherits="UICheckButtonTemplate" text="">
+ <Size x="20" y="22"/>
+ <Anchors>
+ <Anchor point="TOPRIGHT">
+ <Offset x="0" y="0"/>
+ </Anchor>
+ </Anchors>
<Scripts>
<OnLoad>
- self:RegisterForClicks("AnyUp");
+ self:SetScale(0.625);
+ self:SetText(Cauldron:LocaleString("Favorite?"));
</OnLoad>
<OnEnter>
- self:GetParent().inHoverButtons = true;
-
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:ClearLines();
- GameTooltip:AddLine(Cauldron:LocaleString("Decrease the priority of this item"));
- GameTooltip:AddLine(Cauldron:LocaleString("Shift-click to move to the bottom of the queue"));
+ GameTooltip:AddLine(Cauldron:LocaleString("Mark this skill as a favorite"));
GameTooltip:Show();
CursorUpdate(self);
</OnEnter>
<OnLeave>
- self:GetParent().inHoverButtons = false;
-
GameTooltip:Hide();
ResetCursor();
</OnLeave>
<OnClick>
- Cauldron:DecreaseItemPriority(self:GetParent().itemName, IsShiftKeyDown());
- CauldronQueue:CalculateAllRequiredItems(Cauldron:GetQueue());
- Cauldron:UpdateQueue();
+ PlaySound("igMainMenuOptionCheckBoxOn");
+ Cauldron:FavoriteItemButton_OnClick(self);
+ Cauldron:UpdateSkillList();
</OnClick>
</Scripts>
- <NormalTexture file="Interface\Buttons\UI-ScrollBar-ScrollDownButton-Up" />
- <PushedTexture file="Interface\Buttons\UI-ScrollBar-ScrollDownButton-Down" />
- <DisabledTexture file="Interface\Buttons\UI-ScrollBar-ScrollDownButton-Disabled" />
- <HighlightTexture file="Interface\Buttons\UI-ScrollBar-ScrollDownButton-Highlight" alphaMode="ADD" />
- </Button>
- -->
- </Frames>
- <Scripts>
- <OnClick>
- HandleModifiedItemClick(self.link);
- </OnClick>
- <!--
- <OnEnter>
- if self.removeable then
- _G[self:GetName().."RemoveItem"]:Show();
- _G[self:GetName().."DecreasePriority"]:Show();
- _G[self:GetName().."IncreasePriority"]:Show();
- _G[self:GetName().."DecrementCount"]:Show();
- _G[self:GetName().."IncrementCount"]:Show();
- _G[self:GetName().."IncrementCount"]:SetScale(0.75);
- end
- if self.shoppable then
- _G[self:GetName().."AddToShoppingList"]:Show();
- end
- </OnEnter>
- <OnLeave>
- if not self.inHoverButtons then
- _G[self:GetName().."RemoveItem"]:Hide();
- _G[self:GetName().."DecreasePriority"]:Hide();
- _G[self:GetName().."IncreasePriority"]:Hide();
- _G[self:GetName().."DecrementCount"]:Hide();
- _G[self:GetName().."IncrementCount"]:Hide();
- _G[self:GetName().."AddToShoppingList"]:Hide();
- end
+ </CheckButton>
+ <Frame name="$parentReagents">
+ <Size x="40" y="100" />
+ <Anchors>
+ <Anchor point="TOPLEFT" relativeTo="$parentSkillIcon" relativePoint="BOTTOMLEFT">
+ <Offset x="10" y="-3"/>
+ </Anchor>
+ </Anchors>
+ <Layers>
+ <Layer level="OVERLAY">
+ <FontString name="$parentToolsInfo" inherits="GameFontNormal"
+ text="(tools info)" justifyH="LEFT">
+ <Size x="250" y="12" />
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="0" y="0"/>
+ </Anchor>
+ </Anchors>
+ <Color r="1.0" g="1.0" b="1.0" />
+ </FontString>
+ </Layer>
+ </Layers>
+ <Frames>
+ <Button name="$parentItemDetail1" inherits="CauldronReagentDetailTemplate" id="1">
+ <Anchors>
+ <Anchor point="TOPLEFT" relativeTo="$parentToolsInfo" relativePoint="BOTTOMLEFT">
+ <Offset x="0" y="-2"/>
+ </Anchor>
+ </Anchors>
+ </Button>
+ <Button name="$parentItemDetail2" inherits="CauldronReagentDetailTemplate" id="2">
+ <Anchors>
+ <Anchor point="LEFT" relativeTo="$parentItemDetail1" relativePoint="RIGHT">
+ <Offset x="5" y="0"/>
+ </Anchor>
+ </Anchors>
+ </Button>
+ <Button name="$parentItemDetail3" inherits="CauldronReagentDetailTemplate" id="3">
+ <Anchors>
+ <Anchor point="TOP" relativeTo="$parentItemDetail1" relativePoint="BOTTOM">
+ <Offset x="0" y="-3"/>
+ </Anchor>
+ </Anchors>
+ </Button>
+ <Button name="$parentItemDetail4" inherits="CauldronReagentDetailTemplate" id="4">
+ <Anchors>
+ <Anchor point="LEFT" relativeTo="$parentItemDetail3" relativePoint="RIGHT">
+ <Offset x="5" y="0"/>
+ </Anchor>
+ </Anchors>
+ </Button>
+ <Button name="$parentItemDetail5" inherits="CauldronReagentDetailTemplate" id="5">
+ <Anchors>
+ <Anchor point="TOP" relativeTo="$parentItemDetail3" relativePoint="BOTTOM">
+ <Offset x="0" y="-3"/>
+ </Anchor>
+ </Anchors>
+ </Button>
+ <Button name="$parentItemDetail6" inherits="CauldronReagentDetailTemplate" id="6">
+ <Anchors>
+ <Anchor point="LEFT" relativeTo="$parentItemDetail5" relativePoint="RIGHT">
+ <Offset x="5" y="0"/>
+ </Anchor>
+ </Anchors>
+ </Button>
+ <Button name="$parentItemDetail7" inherits="CauldronReagentDetailTemplate" id="7">
+ <Anchors>
+ <Anchor point="TOP" relativeTo="$parentItemDetail7" relativePoint="BOTTOM">
+ <Offset x="0" y="-3"/>
+ </Anchor>
+ </Anchors>
+ </Button>
+ <Button name="$parentItemDetail8" inherits="CauldronReagentDetailTemplate" id="8">
+ <Anchors>
+ <Anchor point="LEFT" relativeTo="$parentItemDetail7" relativePoint="RIGHT">
+ <Offset x="5" y="0"/>
+ </Anchor>
+ </Anchors>
+ </Button>
+ </Frames>
+ </Frame>
+ <Frame name="$parentSelection" setAllPoints="true" enableMouse="true" hidden="true" frameStrata="LOW" frameLevel="1">
+ <Layers>
+ <Layer level="OVERLAY">
+ <Texture name="$parentSelection" file="Interface\QuestFrame\UI-QuestLogTitleHighlight" alphaMode="ADD">
+ <Color r="0.5" g="0.5" b="0.5" a="0.5" />
+ </Texture>
+ </Layer>
+ </Layers>
+ </Frame>
+ </Frames>
+ <Scripts>
+ <OnEnter>
+ Cauldron:SkillItem_OnEnter(self);
+ </OnEnter>
+ <OnLeave>
+ Cauldron:SkillItem_OnLeave(self);
</OnLeave>
- -->
+ <OnClick>
+ PlaySound("igMainMenuOptionCheckBoxOn");
+ HandleModifiedItemClick(GetTradeSkillRecipeLink(self.skillIndex));
+ Cauldron:SkillItem_OnClick(self, button, down);
+ </OnClick>
</Scripts>
</Button>
-
- <!-- Queue frame -->
- <Frame name="CauldronQueueWindowFrame" inherits="ButtonFrameTemplate"
- parent="UIParent" enableMouse="true"
- toplevel="true" hidden="true" >
- <!-- TitleRegion setAllPoints="true" / -->
- <!--
- <Size>
- <AbsDimension x="357" y="465" />
- </Size>
- <Anchors>
- <Anchor point="TOPLEFT" />
- </Anchors>
- -->
- <!-- Window border and background -->
- <Layers>
- <!--
- <Layer level="ARTWORK">
- <Texture name="$parentTabardBackground" file="Interface\GuildFrame\GuildFrame">
- <Size x="62" y="62"/>
- <Anchors>
- <Anchor point="TOPLEFT" x="-6" y="7"/>
- </Anchors>
- <TexCoords left="0.63183594" right="0.69238281" top="0.61914063" bottom="0.74023438"/>
- </Texture>
- </Layer>
- <Layer level="ARTWORK" textureSubLevel="1">
- <Texture name="$parentTabardEmblem" file="Interface\GuildFrame\GuildEmblemsLG_01">
- <Size x="64" y="64"/>
- <Anchors>
- <Anchor point="TOPLEFT" x="-8" y="9"/>
- </Anchors>
- </Texture>
- </Layer>
- <Layer level="ARTWORK" textureSubLevel="2">
- <Texture name="$parentTabardBorder" file="Interface\GuildFrame\GuildFrame">
- <Size x="61" y="60"/>
- <Anchors>
- <Anchor point="TOPLEFT" x="-6" y="7"/>
- </Anchors>
- <TexCoords left="0.63183594" right="0.69238281" top="0.74414063" bottom="0.86523438"/>
- </Texture>
- </Layer>
- -->
- <!--
+ <!-- Template: Skill item (compact, collapsed) -->
+
+ <!-- Template: Skill item (compact, expanded) -->
+
+ <!-- Main UI frame -->
+ <Frame name="CauldronFrame" inherits="ButtonFrameTemplate"
+ toplevel="true" parent="UIParent"
+ movable="true" enableMouse="true" hidden="true">
+ <Size x="550" y="525"/>
+
+ <Layers>
<Layer level="BACKGROUND">
- <Texture name="CauldronQueueFramePortrait" file="Interface\Spellbook\Spellbook-Icon">
- <Size x="60" y="60"/>
+ </Layer>
+ <Layer level="OVERLAY">
+ <Texture name="CauldronHorizontalBarLeft" urgency="5" file="Interface\ClassTrainerFrame\UI-ClassTrainer-HorizontalBar">
+ <Size x="100" y="16"/> <!-- x="256" -->
<Anchors>
<Anchor point="TOPLEFT">
- <Offset x="7" y="-6"/>
+ <Offset x="2" y="-94"/>
+ </Anchor>
+ <Anchor point="RIGHT">
+ <Offset x="-80" y="0"/>
</Anchor>
</Anchors>
+ <TexCoords left="0" right="1.0" top="0" bottom="0.25"/>
</Texture>
- <FontString name="$parentDummyString" inherits="GameFontNormal" hidden="true">
+ <Texture urgency="5" file="Interface\ClassTrainerFrame\UI-ClassTrainer-HorizontalBar">
+ <Size x="256" y="16"/>
<Anchors>
- <Anchor point="TOPLEFT">
+ <Anchor point="LEFT" relativeTo="CauldronHorizontalBarLeft" relativePoint="RIGHT">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
- <Size x="0" y="0"/>
- </FontString>
- </Layer>
- <Layer level="BORDER">
- <Texture name="CauldronQueueWindowFrameBorderTopLeft"
- file="Interface\AddOns\Cauldron\Artwork\Cauldron-QueueFrame">
- <Anchors>
- <Anchor point="TOPLEFT">
- <Offset x="0" y="0" />
- </Anchor>
- </Anchors>
- </Texture>
- </Layer>
- -->
+ <TexCoords left="0" right="1.0" top="0.25" bottom="0.5"/>
+ </Texture>
+ </Layer>
+ </Layers>
+ <Frames>
+ <!-- Tradeskill name -->
+ <Frame name="CauldronSkillNameFrame">
+ <Size x="250" y="18" />
+ <Anchors>
+ <Anchor point="TOPLEFT" relativeTo="CauldronFrame">
+ <Offset x="60" y="-28" />
+ </Anchor>
+ </Anchors>
+ <Layers>
+ <Layer level="OVERLAY">
+ <FontString name="CauldronSkillNameText" inherits="QuestTitleFont" justifyH="LEFT" text="(skill name)">
+ <Size x="250" y="18" />
+ <Color r="0.8" g="0.8" b="0.0" />
+ </FontString>
+ </Layer>
+ </Layers>
+ <Scripts>
+ <OnLoad>
+ -- CauldronSkillNameText:SetText("skill name");
+ </OnLoad>
+ </Scripts>
+ </Frame>
-<!--
- <Layer level="ARTWORK">
- <FontString name="CauldronQueueWindowFrameTitleText" inherits="GameFontNormal" text="Tradeskill Queue">
- <Anchors>
- <Anchor point="TOP" relativeTo="CauldronQueueWindowFrame" relativePoint="TOP">
- <Offset x="10" y="-18" />
- </Anchor>
- </Anchors>
- <Size x="300" y="14" />
- </FontString>
- </Layer>
- -->
- </Layers>
-
- <Frames>
- <!-- Queue frame -->
- <Frame name="CauldronQueueFrame">
- <Size x="300" y="332" />
- <Anchors>
- <Anchor point="TOPLEFT" relativeTo="CauldronQueueWindowFrame" relativePoint="TOPLEFT">
- <Offset x="10" y="-64" />
- </Anchor>
- </Anchors>
+ <!-- Tradeskill rank text (+ skill count) -->
+ <Frame name="CauldronRankInfoFrame" drawLayer="BACKGROUND">
+ <Size x="300" y="15" />
+ <Anchors>
+ <Anchor point="TOPLEFT" relativeTo="CauldronSkillNameFrame" relativePoint="BOTTOMLEFT">
+ <Offset x="0" y="-2" />
+ </Anchor>
+ </Anchors>
+ <Layers>
+ <Layer level="ARTWORK">
+ <FontString name="CauldronRankInfoText" inherits="GameFontNormalSmall" justifyH="LEFT" text="(rank info)">
+ <Size x="300" y="15" />
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="0" y="0" />
+ </Anchor>
+ </Anchors>
+ <Color r="0.5" g="0.5" b="0.5" />
+ </FontString>
+ </Layer>
+ </Layers>
+ </Frame>
- <Frames>
- <Frame name="CauldronQueueFrameQueueEmpty">
- <Size x="302" y="360" />
- <Anchors>
- <Anchor point="TOPLEFT">
- <Offset x="0" y="0" />
- </Anchor>
- </Anchors>
- <Layers>
- <Layer level="OVERLAY">
- <FontString name="$parentText" inherits="QuestTitleFont"
- text=""
- justifyH="CENTER" justifyV="CENTER">
- <Size x="302" y="360" />
- <Anchors>
- <Anchor point="TOPLEFT">
- <Offset x="0" y="0" />
- </Anchor>
- </Anchors>
- <Color r="0.2" g="0.2" b="0.2" />
- </FontString>
- </Layer>
- </Layers>
- </Frame>
-
- <ScrollFrame name="CauldronQueueFrameScrollFrame" inherits="UIPanelScrollFrameTemplate" hidden="true">
- <Size x="297" y="332" />
+ <!-- Chat link button -->
+ <Frame name="CauldronLinkFrame">
+ <Size x="30" y="30"/>
+ <Anchors>
+ <Anchor point="TOPRIGHT" relativeTo="CauldronFrame" relativePoint="TOPRIGHT">
+ <Offset x="-7" y="-24"/>
+ </Anchor>
+ </Anchors>
+ <Frames>
+ <Frame name="CauldronLinkDropDown" inherits="UIDropDownMenuTemplate" clampedToScreen="true" id="1" hidden="true">
+ <Scripts>
+ <OnLoad function="CauldronLinkDropDown_OnLoad"/>
+ </Scripts>
+ </Frame>
+ <Button name="CauldronLinkButton">
+ <Size x="30" y="30"/>
<Anchors>
- <Anchor point="TOPLEFT">
+ <Anchor point="LEFT">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
+ <Scripts>
+ <OnClick>
+ local activeEditBox = ChatEdit_GetActiveWindow();
+ if activeEditBox then
+ local link=GetTradeSkillListLink();
+ if (not ChatEdit_InsertLink(link) ) then
+ assert(activeEditBox:GetName(), "Failed to add tradeskill link")
+ end
+ else
+ ToggleDropDownMenu(1, nil, CauldronLinkDropDown, "CauldronLinkFrame", 25, 25);
+ end
+ PlaySound("igMainMenuOptionCheckBoxOn");
+ </OnClick>
+ <OnEnter>
+ GameTooltip:SetOwner(self,"ANCHOR_TOPLEFT");
+ GameTooltip:SetText(LINK_TRADESKILL_TOOLTIP, nil, nil, nil, nil, 1);
+ GameTooltip:Show();
+ </OnEnter>
+ <OnLeave function="GameTooltip_Hide"/>
+ </Scripts>
+ <NormalTexture file="Interface\Buttons\UI-LinkProfession-Up"/>
+ <PushedTexture file="Interface\Buttons\UI-LinkProfession-Down"/>
+ <HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"/>
+ </Button>
+ </Frames>
+ </Frame>
+
+ <!-- Tradeskill rank bar -->
+ <StatusBar name="CauldronRankFrame" drawLayer="BACKGROUND" minValue="0" maxValue="1" defaultValue="0" enableMouse="false">
+ <Size x="236" y="14"/>
+ <Anchors>
+ <Anchor point="RIGHT" relativeTo="CauldronLinkFrame" relativePoint="LEFT">
+ <Offset x="-5" y="0"/>
+ </Anchor>
+ </Anchors>
+ <Layers>
+ <Layer level="ARTWORK">
+ <FontString name="$parentText" inherits="GameFontHighlightSmall" justifyH="CENTER">
+ <Size x="0" y="9"/>
+ <Anchors>
+ <Anchor point="CENTER" relativeTo="CauldronRankFrame">
+ <Offset x="0" y="0"/>
+ </Anchor>
+ </Anchors>
+ </FontString>
+ <Texture name="$parentBorder" urgency="5" file="Interface\PaperDollInfoFrame\UI-Character-Skills-BarBorder">
+ <Size x="245" y="27"/>
+ <Anchors>
+ <Anchor point="LEFT">
+ <Offset x="-5" y="0"/>
+ </Anchor>
+ </Anchors>
+ </Texture>
+ </Layer>
+ <Layer level="BACKGROUND">
+ <Texture name="$parentBackground">
+ <Color r="1.0" g="1.0" b="1.0" a="0.2"/>
+ </Texture>
+ </Layer>
+ </Layers>
+ <Scripts>
+ <OnLoad>
+ self:RegisterEvent("SKILL_LINES_CHANGED");
+ </OnLoad>
+ <OnEvent function="CauldronFrame_Update"/>
+ </Scripts>
+ <BarTexture name="$parentBar" urgency="5" file="Interface\PaperDollInfoFrame\UI-Character-Skills-Bar" />
+ <BarColor r="0.25" g="0.25" b="0.75" />
+ </StatusBar>
+
+ <!-- Tradeskill unlearn button -->
+
+ <!-- Status text -->
+ <Frame name="CauldronStatusFrame" drawLayer="BACKGROUND">
+ <Size x="500" y="20" />
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="10" y="-75" />
+ </Anchor>
+ </Anchors>
+ <Layers>
+ <Layer level="ARTWORK">
+ <FontString name="CauldronStatusText" inherits="GameFontNormal" justifyH="LEFT" text="">
+ <Size x="300" y="20" />
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="0" y="0" />
+ </Anchor>
+ </Anchors>
+ <Color r="0.8" g="0.8" b="0.8" />
+ </FontString>
+ </Layer>
+ </Layers>
+ </Frame>
+
+ <!-- Filter menu -->
+ <Frame name="CauldronFilterFrame" >
+ <Size x="1" y="1"/>
+ <Anchors>
+ <Anchor point="TOPRIGHT" relativeTo="CauldronFrame" relativePoint="TOPRIGHT">
+ <Offset x="-85" y="-62"/>
+ </Anchor>
+ </Anchors>
+ <Frames>
+ <Button name="CauldronFilterButton" inherits="UIMenuButtonStretchTemplate" text="FILTER">
+ <Size x="70" y="22"/>
+ <Anchors>
+ <Anchor point="LEFT"/>
+ </Anchors>
+ <Scripts>
+ <OnClick>
+ ToggleDropDownMenu(1, nil, CauldronFilterDropDown, "CauldronFilterButton", 74, 15);
+ </OnClick>
+ <OnLoad>
+ CauldronFilterButtonRightArrow:Show();
+ </OnLoad>
+ </Scripts>
+ </Button>
+ <Frame name="CauldronFilterDropDown" inherits="UIDropDownMenuTemplate">
+ <Scripts>
+ <!-- TODO: restore
+ <OnLoad function="CauldronFilterDropDown_OnLoad"/>
+ -->
+ </Scripts>
+ </Frame>
+ </Frames>
+ </Frame>
+
+ <!-- Search input box -->
+ <EditBox name="CauldronSearchBox" autoFocus="false">
+ <Size x="180" y="20"/>
+ <Anchors>
+ <Anchor point="RIGHT" relativeTo="CauldronFilterFrame" relativePoint="LEFT">
+ <Offset x="-5" y="0"/>
+ </Anchor>
+ </Anchors>
+ <Layers>
+ <Layer level="BACKGROUND">
+ <Texture name="CauldronSearchBoxLeft" urgency="5" file="Interface\Common\Common-Input-Border">
+ <Size x="8" y="20"/>
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="-5" y="0"/>
+ </Anchor>
+ </Anchors>
+ <TexCoords left="0" right="0.0625" top="0" bottom="0.625"/>
+ </Texture>
+ <Texture name="CauldronSearchBoxRight" urgency="5" file="Interface\Common\Common-Input-Border">
+ <Size x="8" y="20"/>
+ <Anchors>
+ <Anchor point="RIGHT">
+ <Offset x="0" y="0"/>
+ </Anchor>
+ </Anchors>
+ <TexCoords left="0.9375" right="1.0" top="0" bottom="0.625"/>
+ </Texture>
+ <Texture name="CauldronSearchBoxMiddle" urgency="5" file="Interface\Common\Common-Input-Border">
+ <Size x="0" y="20"/>
+ <Anchors>
+ <Anchor point="LEFT" relativeTo="CauldronSearchBoxLeft" relativePoint="RIGHT"/>
+ <Anchor point="RIGHT" relativeTo="CauldronSearchBoxRight" relativePoint="LEFT"/>
+ </Anchors>
+ <TexCoords left="0.0625" right="0.9375" top="0" bottom="0.625"/>
+ </Texture>
+ </Layer>
+ <Layer level="OVERLAY">
+ <Texture name="CauldronSearchBoxSearchIcon" file="Interface\Common\UI-Searchbox-Icon">
+ <Color r="0.7" g="0.7" b="0.7" />
+ <Size x="14" y="14"/>
+ <Anchors>
+ <Anchor point="LEFT" y="-2"/>
+ </Anchors>
+ </Texture>
+ </Layer>
+ </Layers>
+ <Scripts>
+ <OnShow>
+ self:SetText(SEARCH);
+ self:SetFontObject("GameFontDisable");
+ CauldronSearchBoxSearchIcon:SetVertexColor(0.6, 0.6, 0.6);
+ self:SetTextInsets(16, 0, 0, 0);
+ </OnShow>
+ <OnEnterPressed function="EditBox_ClearFocus"/>
+ <OnEscapePressed function="EditBox_ClearFocus"/>
+ <OnTextChanged function="CauldronSearch_OnTextChanged"/>
+ <OnEditFocusLost>
+ self:HighlightText(0, 0);
+ if ( self:GetText() == "" ) then
+ self:SetText(SEARCH);
+ self:SetFontObject("GameFontDisable");
+ CauldronSearchBoxSearchIcon:SetVertexColor(0.6, 0.6, 0.6);
+ end
+ </OnEditFocusLost>
+ <OnEditFocusGained>
+ self:HighlightText();
+ if ( self:GetText() == SEARCH ) then
+ --self:SetText("");
+ self:SetFontObject("ChatFontSmall");
+ CauldronSearchBoxSearchIcon:SetVertexColor(1.0, 1.0, 1.0);
+ end
+ </OnEditFocusGained>
+ </Scripts>
+ <FontString inherits="ChatFontSmall"/>
+ </EditBox>
+
+ <!-- Skill list -->
+ <ScrollFrame name="CauldronSkillListScrollFrame" inherits="UIPanelScrollFrameTemplate">
+ <Size x="505" y="385" />
+ <Anchors>
+ <Anchor point="TOPLEFT" relativeTo="CauldronFrame" relativePoint="TOPLEFT">
+ <Offset x="10" y="-110"/>
+ </Anchor>
+ </Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="CauldronQueueFrameScrollBackgroundTopLeft" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
- <Size>
- <AbsDimension x="31" y="256"/>
- </Size>
+ <Size x="31" y="256"/>
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT">
- <Offset>
- <AbsDimension x="-2" y="5"/>
- </Offset>
+ <Offset x="-2" y="5"/>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.484375" top="0" bottom="1.0"/>
</Texture>
<Texture name="CauldronQueueFrameScrollBackgroundBottomRight" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
- <Size>
- <AbsDimension x="31" y="106"/>
- </Size>
+ <Size x="31" y="206"/>
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT">
- <Offset>
- <AbsDimension x="-2" y="-2"/>
- </Offset>
+ <Offset x="-2" y="-2"/>
</Anchor>
</Anchors>
<TexCoords left="0.515625" right="1.0" top="0" bottom="0.4140625"/>
</Texture>
</Layer>
</Layers>
- <ScrollChild>
- <Frame name="CauldronQueueFrameScrollFrameQueueSections">
- <Size x="300" y="332" />
- <Anchors>
- <Anchor point="TOPLEFT">
- <Offset x="0" y="0"/>
- </Anchor>
- </Anchors>
- <Frames>
- <Frame name="CauldronQueueFrameScrollFrameQueueSectionsMainItemsHeader">
- <Size x="300" y="12" />
- <Anchors>
- <Anchor point="TOPLEFT">
- <Offset x="0" y="0" />
- </Anchor>
- </Anchors>
- <Layers>
- <Layer level="OVERLAY">
- <FontString name="$parentText" inherits="QuestFont" text="">
- <Anchors>
- <Anchor point="TOPLEFT">
- <Offset x="0" y="0" />
- </Anchor>
- </Anchors>
- <Color r="0.6" g="0.6" b="0.6" />
- </FontString>
- </Layer>
- </Layers>
- </Frame>
- <Frame name="CauldronQueueFrameScrollFrameQueueSectionsMainItems">
- <Size x="300" y="1" />
- <Anchors>
- <Anchor point="TOPLEFT" relativeTo="$parentMainItemsHeader" relativePoint="BOTTOMLEFT">
- <Offset x="0" y="-2" />
- </Anchor>
- </Anchors>
- </Frame>
- <Frame name="CauldronQueueFrameScrollFrameQueueSectionsSecondaryItemsHeader">
- <Size x="300" y="12" />
- <Anchors>
- <Anchor point="TOPLEFT" relativeTo="$parentMainItems" relativePoint="BOTTOMLEFT">
- <Offset x="0" y="-2" />
- </Anchor>
- </Anchors>
- <Layers>
- <Layer level="OVERLAY">
- <FontString name="$parentText" inherits="QuestFont" text="">
- <Anchors>
- <Anchor point="TOPLEFT">
- <Offset x="0" y="0" />
- </Anchor>
- </Anchors>
- <Color r="0.6" g="0.6" b="0.6" />
- </FontString>
- </Layer>
- </Layers>
- </Frame>
- <Frame name="CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems">
- <Size x="300" y="1" />
- <Anchors>
- <Anchor point="TOPLEFT" relativeTo="$parentSecondaryItemsHeader" relativePoint="BOTTOMLEFT">
- <Offset x="0" y="-2" />
- </Anchor>
- </Anchors>
- </Frame>
- <Frame name="CauldronQueueFrameScrollFrameQueueSectionsReagentsHeader">
- <Size x="300" y="12" />
- <Anchors>
- <Anchor point="TOPLEFT" relativeTo="$parentSecondaryItems" relativePoint="BOTTOMLEFT">
- <Offset x="0" y="-2" />
- </Anchor>
- </Anchors>
- <Layers>
- <Layer level="OVERLAY">
- <FontString name="$parentText" inherits="QuestFont" text="">
- <Anchors>
- <Anchor point="TOPLEFT">
- <Offset x="0" y="0" />
- </Anchor>
- </Anchors>
- <Color r="0.6" g="0.6" b="0.6" />
- </FontString>
- </Layer>
- </Layers>
- </Frame>
- <Frame name="CauldronQueueFrameScrollFrameQueueSectionsReagents">
- <Size x="300" y="1" />
- <Anchors>
- <Anchor point="TOPLEFT" relativeTo="$parentReagentsHeader" relativePoint="BOTTOMLEFT">
- <Offset x="0" y="-2" />
- </Anchor>
- </Anchors>
- </Frame>
- </Frames>
- </Frame>
- </ScrollChild>
- <!--
+ <ScrollChild>
+ <Frame name="CauldronSkillListScrollFrameScrollChild">
+ <Size x="505" y="385" />
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="0" y="0"/>
+ </Anchor>
+ </Anchors>
<Frames>
- <Slider name="$parentScrollBar" inherits="MinimalHybridScrollBarTemplate">
- <Anchors>
- <Anchor point="TOPRIGHT" relativeTo="CauldronQueueFrame" relativePoint="TOPRIGHT">
- <Offset>
- <AbsDimension x="-47" y="-114"/>
- </Offset>
- </Anchor>
- <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT">
- <Offset>
- <AbsDimension x="6" y="14"/>
- </Offset>
- </Anchor>
- </Anchors>
- </Slider>
</Frames>
- -->
- </ScrollFrame>
- </Frames>
- </Frame>
-
- <!-- Close button -->
- <!--
- <Button name="CauldronQueueWindowFrameCloseButton" inherits="UIPanelCloseButton">
- <Anchors>
- <Anchor point="TOPRIGHT" relativeTo="CauldronQueueWindowFrame" relativePoint="TOPRIGHT">
- <Offset x="4" y="-8"/>
- </Anchor>
- </Anchors>
- <Scripts>
- <OnClick>
- HideUIPanel(CauldronQueueWindowFrame);
- - - TODO: record that queue is closed
- PlaySound("igCharacterInfoClose");
- </OnClick>
- </Scripts>
- </Button>
- -->
-
- <!-- Buttons frame -->
- <Frame name="CauldronQueueButtonsFrame">
- <Size x="357" y="25" />
- <Anchors>
- <Anchor point="BOTTOMLEFT" relativeTo="CauldronQueueWindowFrame" relativePoint="BOTTOMLEFT">
- <Offset x="2" y="0" />
- </Anchor>
- </Anchors>
+ </Frame>
+ </ScrollChild>
+ </ScrollFrame>
- <Frames>
-
- <!-- Queue All button -->
- <Button name="CauldronQueueAllButton" inherits="CauldronButtonTemplate" text="Queue All">
- <Anchors>
- <Anchor point="TOPLEFT">
- <Offset x="0" y="0" />
- </Anchor>
- </Anchors>
- <Scripts>
- <OnLoad>
- -- getglobal(self:GetName()):Disable();
- </OnLoad>
+ <!-- Create all button -->
+ <Button name="CauldronCreateAllButton" inherits="CauldronButtonTemplate" text="CREATE_ALL">
+ <Size x="80" y="22"/>
+ <Anchors>
+ <Anchor point="BOTTOMLEFT" />
+ </Anchors>
+ <Frames>
+ <Frame name="$parentMask" setAllPoints="true" enableMouse="true" hidden="true">
+ <Scripts>
<OnEnter>
- GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
- GameTooltip:ClearLines();
- GameTooltip:AddLine(Cauldron:LocaleString("Click to queue the listed amount of this item"));
- GameTooltip:AddLine(Cauldron:LocaleString("Shift-click to queue the listed potential amount of this item"));
- GameTooltip:Show();
- CursorUpdate(self);
+ if (self.tooltip) then
+ GameTooltip:SetOwner(self, "ANCHOR_LEFT");
+ GameTooltip:SetText(self.tooltip, nil, nil, nil, nil, 1);
+ end
</OnEnter>
- <OnLeave>
- GameTooltip:Hide();
- ResetCursor();
- </OnLeave>
- <OnClick>
- Cauldron:QueueAllTradeSkillItem();
- Cauldron:UpdateButtons();
- </OnClick>
- </Scripts>
- </Button>
-
- <!-- Queue button -->
- <Button name="CauldronQueueButton" inherits="CauldronButtonTemplate" text="Queue">
- <Anchors>
- <Anchor point="LEFT" relativeTo="CauldronQueueAllButton" relativePoint="RIGHT">
- <Offset x="0" y="0" />
- </Anchor>
- </Anchors>
- <Scripts>
- <OnLoad>
- -- getglobal(self:GetName()):Disable();
- </OnLoad>
- <OnClick>
- Cauldron:QueueTradeSkillItem();
- Cauldron:UpdateButtons();
- </OnClick>
- </Scripts>
- </Button>
+ <OnLeave function="GameTooltip_Hide"/>
+ </Scripts>
+ </Frame>
+ </Frames>
+ <Scripts>
+ <OnClick>
+ if ( (not PartialPlayTime()) and (not NoPlayTime()) ) then
+ CauldronInputBox:SetNumber(CauldronFrame.numAvailable);
+ DoTradeSkill(CauldronFrame.selectedSkill, CauldronFrame.numAvailable);
+ CauldronInputBox:ClearFocus();
+ end
+ </OnClick>
+ </Scripts>
+ </Button>
- <!-- spacer -->
+ <!-- Decrement count button -->
+ <Button name="CauldronDecrementButton">
+ <Size x="23" y="22"/>
+ <Anchors>
+ <Anchor point="LEFT" relativeTo="CauldronCreateAllButton" relativePoint="RIGHT">
+ <Offset x="3" y="0"/>
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnClick>
+ CauldronFrameDecrement_OnClick();
+ CauldronInputBox:ClearFocus();
+ </OnClick>
+ </Scripts>
+ <NormalTexture urgency="5" file="Interface\Buttons\UI-SpellbookIcon-PrevPage-Up"/>
+ <PushedTexture urgency="5" file="Interface\Buttons\UI-SpellbookIcon-PrevPage-Down"/>
+ <DisabledTexture urgency="5" file="Interface\Buttons\UI-SpellbookIcon-PrevPage-Disabled"/>
+ <HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"/>
+ </Button>
- <!-- Process button (disabled) -->
- <Button name="CauldronProcessButton" inherits="CauldronButtonTemplate" text="Process">
- <Anchors>
- <Anchor point="LEFT" relativeTo="CauldronQueueButton" relativePoint="RIGHT">
- <Offset x="2" y="0" />
- </Anchor>
- </Anchors>
- <Scripts>
- <OnLoad>
- getglobal(self:GetName()):Disable();
- </OnLoad>
- <OnClick>
- Cauldron:ProcessQueue();
- </OnClick>
- </Scripts>
- </Button>
+ <!-- Count input box -->
+ <EditBox name="CauldronInputBox" letters="3" numeric="true" autoFocus="false">
+ <Size x="31" y="20"/>
+ <Anchors>
+ <Anchor point="LEFT" relativeTo="CauldronDecrementButton" relativePoint="RIGHT">
+ <Offset x="4" y="0"/>
+ </Anchor>
+ </Anchors>
+ <Layers>
+ <Layer level="BACKGROUND">
+ <Texture name="$parentLeft" urgency="5" file="Interface\Common\Common-Input-Border">
+ <Size>
+ <AbsDimension x="8" y="20"/>
+ </Size>
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset>
+ <AbsDimension x="-5" y="0"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ <TexCoords left="0" right="0.0625" top="0" bottom="0.625"/>
+ </Texture>
+ <Texture name="$parentRight" urgency="5" file="Interface\Common\Common-Input-Border">
+ <Size>
+ <AbsDimension x="8" y="20"/>
+ </Size>
+ <Anchors>
+ <Anchor point="RIGHT">
+ <Offset>
+ <AbsDimension x="0" y="0"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ <TexCoords left="0.9375" right="1.0" top="0" bottom="0.625"/>
+ </Texture>
+ <Texture name="$parentMiddle" urgency="5" file="Interface\Common\Common-Input-Border">
+ <Size>
+ <AbsDimension x="10" y="20"/>
+ </Size>
+ <Anchors>
+ <Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT"/>
+ <Anchor point="RIGHT" relativeTo="$parentRight" relativePoint="LEFT"/>
+ </Anchors>
+ <TexCoords left="0.0625" right="0.9375" top="0" bottom="0.625"/>
+ </Texture>
+ </Layer>
+ </Layers>
+ <Scripts>
+ <OnEnterPressed function="EditBox_ClearFocus"/>
+ <OnEscapePressed function="EditBox_ClearFocus"/>
+ <OnTextChanged>
+ if ( self:GetText() == "0" ) then
+ self:SetText("1");
+ end
+ </OnTextChanged>
+ <OnEditFocusLost function="EditBox_ClearHighlight"/>
+ <OnEditFocusGained function="EditBox_HighlightText"/>
+ </Scripts>
+ <FontString inherits="ChatFontNormal"/>
+ </EditBox>
- <!-- Clear Queue button (disabled) -->
- <Button name="CauldronClearQueueButton" inherits="CauldronButtonTemplate" text="Clear Queue">
- <Size x="90" y="20" />
- <Anchors>
- <Anchor point="LEFT" relativeTo="CauldronProcessButton" relativePoint="RIGHT">
- <Offset x="0" y="0" />
- </Anchor>
- </Anchors>
- <Scripts>
- <OnLoad>
- getglobal(self:GetName()):Disable();
- </OnLoad>
- <OnClick>
- CauldronQueue:ClearQueue(Cauldron:GetQueue());
- Cauldron:UpdateQueue();
- Cauldron:UpdateButtons();
- </OnClick>
- </Scripts>
- </Button>
+ <!-- Increment count button -->
+ <Button name="CauldronIncrementButton">
+ <Size>
+ <AbsDimension x="23" y="22"/>
+ </Size>
+ <Anchors>
+ <Anchor point="LEFT" relativeTo="CauldronInputBox" relativePoint="RIGHT">
+ <Offset>
+ <AbsDimension x="3" y="0"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnClick>
+ CauldronFrameIncrement_OnClick();
+ CauldronInputBox:ClearFocus();
+ </OnClick>
+ </Scripts>
+ <NormalTexture urgency="5" file="Interface\Buttons\UI-SpellbookIcon-NextPage-Up"/>
+ <PushedTexture urgency="5" file="Interface\Buttons\UI-SpellbookIcon-NextPage-Down"/>
+ <DisabledTexture urgency="5" file="Interface\Buttons\UI-SpellbookIcon-NextPage-Disabled"/>
+ <HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"/>
+ </Button>
- </Frames>
- </Frame>
+ <!-- Create button -->
+ <Button name="CauldronCreateButton" inherits="CauldronButtonTemplate" text="CREATE">
+ <Size x="80" y="22"/>
+ <Anchors>
+ <Anchor point="LEFT" relativeTo="CauldronIncrementButton" relativePoint="RIGHT" />
+ </Anchors>
+ <Frames>
+ <Frame name="$parentMask" setAllPoints="true" enableMouse="true" hidden="true">
+ <Scripts>
+ <OnEnter>
+ if (self.tooltip) then
+ GameTooltip:SetOwner(self, "ANCHOR_LEFT");
+ GameTooltip:SetText(self.tooltip, nil, nil, nil, nil, 1);
+ end
+ </OnEnter>
+ <OnLeave function="GameTooltip_Hide"/>
+ </Scripts>
+ </Frame>
+ </Frames>
+ <Scripts>
+ <OnClick>
+ if ( (not PartialPlayTime()) and (not NoPlayTime()) ) then
+ DoTradeSkill(CauldronFrame.selectedSkill, CauldronInputBox:GetNumber());
+ CauldronInputBox:ClearFocus();
+ end
+ </OnClick>
+ </Scripts>
+ </Button>
+
+ <!-- View guild crafters button -->
- </Frames>
+ <!-- Show queue button -->
+ <Button name="CauldronShowQueueButton" inherits="CauldronButtonTemplate" text="Show Queue">
+ <Size x="100" y="22"/>
+ <Anchors>
+ <Anchor point="BOTTOMRIGHT">
+ <Offset x="-4" y="4" />
+ </Anchor>
+ </Anchors>
+ <Frames>
+ <Frame name="$parentMask" setAllPoints="true" enableMouse="true" hidden="true">
+ <Scripts>
+ <OnEnter>
+ if (self.tooltip) then
+ GameTooltip:SetOwner(self, "ANCHOR_LEFT");
+ GameTooltip:SetText(self.tooltip, nil, nil, nil, nil, 1);
+ end
+ </OnEnter>
+ <OnLeave function="GameTooltip_Hide"/>
+ </Scripts>
+ </Frame>
+ </Frames>
+ <Scripts>
+ <OnLoad>
+ -- TODO: update with localized text
+ </OnLoad>
+ <OnClick>
+ ShowUIPanel(CauldronQueueWindowFrame);
+ Cauldron.vars.showQueue = true;
+ self:Hide();
+ </OnClick>
+ </Scripts>
+ </Button>
+ </Frames>
+ <Scripts>
+ <OnLoad function="CauldronFrame_OnLoad"/>
+ <OnEvent function="CauldronFrame_OnEvent"/>
+ <OnShow function="CauldronFrame_OnShow"/>
+ <OnHide function="CauldronFrame_OnHide"/>
+ </Scripts>
+</Frame>
- <Scripts>
- <OnLoad>
- return;
- </OnLoad>
- <OnShow>
- PlaySound("igCharacterInfoOpen");
- </OnShow>
- <OnHide>
- --HideUIPanel(CauldronFrame);
- PlaySound("igCharacterInfoClose");
- </OnHide>
- <OnMouseWheel>
- return;
- </OnMouseWheel>
- </Scripts>
- </Frame>
-
</Ui>
diff --git a/CauldronMainUI.lua b/CauldronMainUI.lua
index 606277a..a824951 100644
--- a/CauldronMainUI.lua
+++ b/CauldronMainUI.lua
@@ -1,5 +1,5 @@
-- $Revision: 213 $
--- Cauldron user interface logic
+-- Cauldron main user interface logic
local L = LibStub("AceLocale-3.0"):GetLocale("Cauldron")
@@ -7,6 +7,29 @@ local L = LibStub("AceLocale-3.0"):GetLocale("Cauldron")
local SLOT_NONE = "none";
+function CauldronFrame_OnLoad()
+
+-- ButtonFrameTemplate_HideButtonBar(CauldronFrame);
+ ButtonFrameTemplate_HideAttic(CauldronFrame);
+-- CauldronFrameInsetBg:Hide();
+
+end
+
+function CauldronFrame_OnEvent()
+end
+
+function CauldronFrame_OnShow()
+end
+
+function CauldronFrame_OnHide()
+end
+
+function CauldronSearch_OnTextChanged()
+end
+
+function CauldronFrame_Update()
+end
+
function CauldronFrame_Show()
Cauldron:Frame_Show();
end
@@ -85,10 +108,17 @@ self:debug("frame show: "..tostring(CauldronQueueWindowFrame));
CauldronClearQueueButton:SetText(L["Clear Queue"]);
--]==]
- ShowUIPanel(CauldronQueueWindowFrame);
- SetPortraitToTexture(CauldronQueueWindowFramePortrait, GetTradeSkillTexture());
--- table.insert(UISpecialFrames, CauldronQueueWindowFrame:GetName());
- CauldronQueueWindowFrameTitleText:SetText(L["Queue"]);
+ -- show main UI
+ ShowUIPanel(CauldronFrame);
+ SetPortraitToTexture(CauldronFramePortrait, GetTradeSkillTexture());
+ CauldronFrameTitleText:SetText(L["Cauldron"].." "..Cauldron.version);
+
+ -- show queue UI
+ if Cauldron.vars.showQueue then
+ ShowUIPanel(CauldronQueueWindowFrame);
+ SetPortraitToTexture(CauldronQueueWindowFramePortrait, GetTradeSkillTexture());
+ CauldronQueueWindowFrameTitleText:SetText(L["Queue"]);
+ end
self:RegisterMessage("Cauldron_Update", "OnCauldronUpdate");
@@ -99,8 +129,9 @@ end
function Cauldron:Frame_Hide()
- self:UnregisterEvent("Cauldron_Update")
+ self:UnregisterEvent("Cauldron_Update");
HideUIPanel(CauldronQueueWindowFrame);
+ HideUIPanel(CauldronFrame);
--[[
if TradeSkillFrame then
@@ -135,8 +166,7 @@ function Cauldron:Frame_Update()
return;
end
---[==[
- Cauldron:UpdateSkills();
+-- Cauldron:UpdateSkills();
if CURRENT_TRADESKILL ~= name then
@@ -156,15 +186,16 @@ function Cauldron:Frame_Update()
-- display skill name, level/progress
self:UpdateSkillInfo(name, rank, maxRank);
+--[==[
-- update search text box
self:UpdateSearchText();
-- TODO: update dropdowns
self:UpdateFilterDropDowns();
+--]==]
-- display list of matching skills
self:UpdateSkillList();
---]==]
-- display queue
self:UpdateQueue();
@@ -179,16 +210,24 @@ function Cauldron:UpdateSkillInfo(skillName, rank, maxRank)
self:debug("UpdateSkillInfo enter");
--@end-alpha@
---[==[
local skillCount = Cauldron:GetSkillCount(skillName);
+--[==[
CauldronRankFrameSkillName:SetText(skillName.." ("..skillCount.." "..L["skills"]..")");
+--]==]
+ CauldronSkillNameText:SetText(skillName);
+ local prof_title = "";
+ for i=1,#PROFESSION_RANKS do
+ local value,title = PROFESSION_RANKS[i][1], PROFESSION_RANKS[i][2];
+ if maxRank < value then break end
+ prof_title = title;
+ end
+ CauldronRankInfoText:SetText(prof_title..", "..skillCount.." "..L["skills"]);
CauldronRankFrame:SetStatusBarColor(0.0, 0.0, 1.0, 0.5);
CauldronRankFrameBackground:SetVertexColor(0.0, 0.0, 0.75, 0.5);
CauldronRankFrame:SetMinMaxValues(0, maxRank);
CauldronRankFrame:SetValue(rank);
- CauldronRankFrameSkillRank:SetText(rank.."/"..maxRank);
---]==]
+ CauldronRankFrameText:SetText(rank.."/"..maxRank);
end
@@ -224,9 +263,6 @@ end
function Cauldron:UpdateSkillList()
--- Cauldron:info("Updating skill list: "..debugstack());
-
---[==[
local skillName = CURRENT_TRADESKILL;
if IsTradeSkillLinked() then
skillName = "Linked-"..skillName;
@@ -247,12 +283,18 @@ function Cauldron:UpdateSkillList()
-- check if we have a frame for this position
if not skillFrame then
-- create a new frame for the skill information
+ if self.db.realm.userdata[self.vars.playername].options.compactView then
+ -- TODO
+ else
+ -- TODO
+ end
skillFrame = CreateFrame("Button",
"CauldronSkillItem"..i,
- CauldronSkillListFrameScrollFrameScrollChild,
- "CauldronSkillItemFrameTemplate");
+ CauldronSkillListScrollFrameScrollChild,
+ "CauldronSkillItemNormalCollapsedFrameTemplate");
end
+ --[[
if self.db.realm.userdata[self.vars.playername].options.compactView then
-- set the height of frame
skillFrame:SetHeight(25);
@@ -282,6 +324,7 @@ function Cauldron:UpdateSkillList()
-- show the category info
_G["CauldronSkillItem"..i.."SkillCategory"]:Show();
end
+ --]]
skillFrame:SetID(i);
skillFrame.skillIndex = skillInfo.index;
@@ -295,161 +338,217 @@ function Cauldron:UpdateSkillList()
-- populate the frame
local frame = nil;
-
+
-- set name and difficulty color
frame = _G["CauldronSkillItem"..i.."SkillName"];
- local nameText = skillInfo.name;
- local potentialCount = Cauldron:GetPotentialCraftCount(skillInfo);
- if (potentialCount > 0) and (potentialCount > skillInfo.available) then
- nameText = nameText.." ["..skillInfo.available.."/"..potentialCount.."]";
- elseif skillInfo.available > 0 then
- nameText = nameText.." ["..skillInfo.available.."]";
- end
- local achievements = Cauldron:GetAchievementsForSkill(skillInfo);
- if achievements and #achievements > 0 then
- nameText = nameText.." [A]";
- end
- frame:SetText(nameText);
- if TradeSkillTypeColor then
- local color = TradeSkillTypeColor[skillInfo.difficulty];
- if color then
- frame:SetFontObject(color.font);
- frame.r = color.r;
- frame.g = color.g;
- frame.b = color.b;
+ if frame then
+ local nameText = skillInfo.name;
+ local skillNamePrefix = "";
+ if ( ENABLE_COLORBLIND_MODE == "1" ) then
+ skillNamePrefix = TradeSkillTypePrefix[skillType].." " or "";
+ end
+ frame:SetText(skillNamePrefix..nameText);
+ if TradeSkillTypeColor then
+ local color = TradeSkillTypeColor[skillInfo.difficulty];
+ if color then
+ frame:SetFontObject(color.font);
+ frame.r = color.r;
+ frame.g = color.g;
+ frame.b = color.b;
+ end
end
end
-- set category
frame = _G["CauldronSkillItem"..i.."SkillCategory"];
- frame:SetText(skillInfo.defaultCategory);
- if TradeSkillTypeColor then
- frame:SetFontObject(TradeSkillTypeColor.header.font);
- frame.r = TradeSkillTypeColor.header.r;
- frame.g = TradeSkillTypeColor.header.g;
- frame.b = TradeSkillTypeColor.header.b;
+ if frame then
+ frame:SetText(skillInfo.defaultCategory);
+ if TradeSkillTypeColor then
+ frame:SetFontObject(TradeSkillTypeColor.header.font);
+ frame.r = TradeSkillTypeColor.header.r;
+ frame.g = TradeSkillTypeColor.header.g;
+ frame.b = TradeSkillTypeColor.header.b;
+ end
end
-- set favorite check button
frame = _G["CauldronSkillItem"..i.."FavoriteButton"];
- frame:SetChecked(self.db.realm.userdata[self.vars.playername].skills[skillName].window.skills[skillInfo.name].favorite);
- frame.skillInfo = skillInfo;
-
- -- set cooldown
- frame = _G["CauldronSkillItem"..i.."SkillCooldown"];
- local cooldown = GetTradeSkillCooldown(skillInfo.index);
- if cooldown then
- if not frame:IsVisible() then
- frame:Show();
- end
- frame:SetText(SecondsToTime(cooldown));
- else
- if frame:IsVisible() then
- frame:Hide();
+ if frame then
+ frame:SetChecked(self.db.realm.userdata[self.vars.playername].skills[skillName].window.skills[skillInfo.name].favorite);
+ frame.skillInfo = skillInfo;
+
+ -- set cooldown
+ --[[
+ frame = _G["CauldronSkillItem"..i.."SkillCooldown"];
+ local cooldown = GetTradeSkillCooldown(skillInfo.index);
+ if cooldown then
+ if not frame:IsVisible() then
+ frame:Show();
+ end
+ frame:SetText(SecondsToTime(cooldown));
+ else
+ if frame:IsVisible() then
+ frame:Hide();
+ end
end
+ --]]
end
-- set the icon
frame = _G["CauldronSkillItem"..i.."SkillIcon"];
- frame:SetNormalTexture(skillInfo.icon);
- frame.itemLink = skillInfo.link;
- frame.skillIndex = skillInfo.index;
+ if frame then
+ frame:SetNormalTexture(skillInfo.icon);
+ frame.itemLink = skillInfo.link;
+ frame.skillIndex = skillInfo.index;
+ end
-- set the craft count
frame = _G["CauldronSkillItem"..i.."SkillIconCount"];
- local minMade, maxMade = skillInfo.minMade, skillInfo.maxMade;
- if maxMade > 1 then
- if minMade == maxMade then
- frame:SetText(minMade);
+ if frame then
+ local minMade, maxMade = skillInfo.minMade, skillInfo.maxMade;
+ if maxMade > 1 then
+ if minMade == maxMade then
+ frame:SetText(minMade);
+ else
+ frame:SetText(minMade.."-"..maxMade);
+ end
+ if frame:GetWidth() > 39 then
+ frame:SetText("~"..floor((minMade + maxMade)/2));
+ end
else
- frame:SetText(minMade.."-"..maxMade);
- end
- if frame:GetWidth() > 39 then
- frame:SetText("~"..floor((minMade + maxMade)/2));
+ frame:SetText("");
end
- else
- frame:SetText("");
end
-- set the disclosure button texture
frame = _G["CauldronSkillItem"..i.."DiscloseButton"];
- frame.skillInfo = skillInfo;
- local reagentsExpanded = self.db.realm.userdata[self.vars.playername].skills[skillName].window.skills[skillInfo.name].expanded;
- if reagentsExpanded then
- frame:SetNormalTexture("Interface\\Buttons\\UI-MinusButton-Up");
-
- _G["CauldronSkillItem"..i.."Reagents"]:Show();
-
- -- fill in the tools info
- local spellFocus = BuildColoredListString(GetTradeSkillTools(skillInfo.index));
- local toolsFrame = _G["CauldronSkillItem"..i.."ReagentsToolsInfo"];
- if spellFocus then
- toolsFrame:Show();
- toolsFrame:SetText(L["Requires"]..": "..spellFocus);
- toolsFrame:SetHeight(15);
- else
- toolsFrame:Hide();
- toolsFrame:SetText("");
- toolsFrame:SetHeight(0);
- end
-
- -- fill in the reagents
- _G["CauldronSkillItem"..i.."Reagents"]:SetScale(0.86);
-
- -- get reagents table
- local reagents = skillInfo.reagents;
- local reagentCount = #reagents;
-
- for j=1,8 do
- local reagentFrame = _G["CauldronSkillItem"..i.."ReagentsItemDetail"..j];
-
- if j > reagentCount then
- reagentFrame:Hide();
+ if frame then
+ frame.skillInfo = skillInfo;
+ local reagentsExpanded = self.db.realm.userdata[self.vars.playername].skills[skillName].window.skills[skillInfo.name].expanded;
+ -- if reagentsExpanded then
+ frame:SetNormalTexture("Interface\\Buttons\\UI-MinusButton-Up");
+
+ -- _G["CauldronSkillItem"..i.."Reagents"]:Show();
+
+ -- fill in the tools info
+ --[[
+ local spellFocus = BuildColoredListString(GetTradeSkillTools(skillInfo.index));
+ local toolsFrame = _G["CauldronSkillItem"..i.."ReagentsToolsInfo"];
+ if spellFocus then
+ toolsFrame:Show();
+ toolsFrame:SetText(L["Requires"]..": "..spellFocus);
+ toolsFrame:SetHeight(15);
else
- local reagentInfo = reagents[j];
-
- reagentFrame.skillIndex = skillInfo.index;
- reagentFrame.reagentIndex = reagentInfo.index;
- reagentFrame.link = reagentInfo.link;
-
- local reagentNameFrame = _G["CauldronSkillItem"..i.."ReagentsItemDetail"..j.."Name"];
- local reagentCountFrame = _G["CauldronSkillItem"..i.."ReagentsItemDetail"..j.."Count"];
-
- -- PARANOIA: check if the reagent name, icon, or link are missing
- if not reagentInfo.name or not reagentInfo.icon or not reagentInfo.link then
- -- Cauldron:error("Reagent info missing; marking recipe for rescan: "..skillInfo.name);
- Cauldron:MarkRecipeForRescan(self.db.realm.userdata[self.vars.playername].skills[skillName], skillInfo.name);
- end
-
- reagentFrame:Show();
- SetItemButtonTexture(reagentFrame, reagentInfo.icon);
- reagentNameFrame:SetText(reagentInfo.name);
-
- local playerReagentCount = GetItemCount(reagentInfo.name);
-
- if playerReagentCount < reagentInfo.numRequired then
- -- Gray out items
- SetItemButtonTextureVertexColor(reagentFrame, 0.5, 0.5, 0.5);
- reagentNameFrame:SetTextColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b);
- else
- SetItemButtonTextureVertexColor(reagentFrame, 1.0, 1.0, 1.0);
- reagentNameFrame:SetTextColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
- end
- if playerReagentCount >= 100 then
- playerReagentCount = "*";
+ toolsFrame:Hide();
+ toolsFrame:SetText("");
+ toolsFrame:SetHeight(0);
+ end
+ --]]
+
+ -- fill in the reagents
+ -- _G["CauldronSkillItem"..i.."Reagents"]:SetScale(0.86);
+
+ -- get reagents table
+ local reagents = skillInfo.reagents;
+ local reagentCount = #reagents;
+
+ for j=1,8 do
+ local reagentFrame = _G["CauldronSkillItem"..i.."ReagentsItemDetail"..j];
+
+ if reagentFrame then
+ if j > reagentCount then
+ reagentFrame:Hide();
+ else
+ local reagentInfo = reagents[j];
+
+ reagentFrame.skillIndex = skillInfo.index;
+ reagentFrame.reagentIndex = reagentInfo.index;
+ reagentFrame.link = reagentInfo.link;
+
+ local reagentNameFrame = _G["CauldronSkillItem"..i.."ReagentsItemDetail"..j.."Name"];
+ local reagentIconFrame = _G["CauldronSkillItem"..i.."ReagentsItemDetail"..j.."IconTexture"];
+ Cauldron:info("reagentIconFrame="..tostring(reagentIconFrame));
+ local reagentCountFrame = _G["CauldronSkillItem"..i.."ReagentsItemDetail"..j.."Count"];
+
+ -- PARANOIA: check if the reagent name, icon, or link are missing
+ if not reagentInfo.name or not reagentInfo.icon or not reagentInfo.link then
+ -- Cauldron:error("Reagent info missing; marking recipe for rescan: "..skillInfo.name);
+ Cauldron:MarkRecipeForRescan(self.db.realm.userdata[self.vars.playername].skills[skillName], skillInfo.name);
+ end
+
+ reagentFrame:Show();
+ SetItemButtonTexture(reagentFrame, reagentInfo.icon);
+ if reagentNameFrame then
+ reagentNameFrame:SetText(reagentInfo.name);
+ end
+
+ local playerReagentCount = GetItemCount(reagentInfo.name);
+
+ if playerReagentCount < reagentInfo.numRequired then
+ -- Gray out items
+ SetItemButtonTextureVertexColor(reagentFrame, 0.5, 0.5, 0.5);
+ if reagentNameFrame then
+ reagentNameFrame:SetTextColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b);
+ end
+ else
+ SetItemButtonTextureVertexColor(reagentFrame, 1.0, 1.0, 1.0);
+ if reagentNameFrame then
+ reagentNameFrame:SetTextColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
+ end
+ end
+ if playerReagentCount >= 100 then
+ playerReagentCount = "*";
+ end
+ if reagentCountFrame then
+ reagentCountFrame:SetText(playerReagentCount.."/"..reagentInfo.numRequired);
+ end
+ end
end
- reagentCountFrame:SetText(playerReagentCount.."/"..reagentInfo.numRequired);
end
+
+ --[[ TODO: only adjust height for expanded views
+ local reagentRows = math.floor((reagentCount - 1) / 2) + 1;
+ _G["CauldronSkillItem"..i.."Reagents"]:SetHeight(toolsFrame:GetHeight() + (reagentRows * _G["CauldronSkillItem"..i.."ReagentsItemDetail1"]:GetHeight()));
+ _G["CauldronSkillItem"..i]:SetHeight(_G["CauldronSkillItem"..i.."SkillIcon"]:GetHeight() + _G["CauldronSkillItem"..i.."Reagents"]:GetHeight());
+ --]]
+ --[[
+ else
+ _G["CauldronSkillItem"..i.."Reagents"]:Hide();
+
+ frame:SetNormalTexture("Interface\\Buttons\\UI-PlusButton-Up");
+ _G["CauldronSkillItem"..i]:SetHeight(_G["CauldronSkillItem"..i.."SkillIcon"]:GetHeight());
end
+ --]]
+ end
- local reagentRows = math.floor((reagentCount - 1) / 2) + 1;
- _G["CauldronSkillItem"..i.."Reagents"]:SetHeight(toolsFrame:GetHeight() + (reagentRows * _G["CauldronSkillItem"..i.."ReagentsItemDetail1"]:GetHeight()));
- _G["CauldronSkillItem"..i]:SetHeight(_G["CauldronSkillItem"..i.."SkillIcon"]:GetHeight() + _G["CauldronSkillItem"..i.."Reagents"]:GetHeight());
- else
- _G["CauldronSkillItem"..i.."Reagents"]:Hide();
+ -- craft count
+ frame = _G["CauldronSkillItem"..i.."MiscInfoCount"];
+ if frame then
+ local potentialCount = Cauldron:GetPotentialCraftCount(skillInfo);
+ local text = "";
+ if (potentialCount > 0) and (potentialCount > skillInfo.available) then
+ text = skillInfo.available.."/"..potentialCount;
+ elseif skillInfo.available > 0 then
+ text = skillInfo.available;
+ end
+ frame:SetText(text);
+ end
+
+ -- special skill-ups
+ frame = _G["CauldronSkillItem"..i.."MiscInfoNumSkillUpsIcon"];
+ if frame then
+ -- TODO
+ end
- frame:SetNormalTexture("Interface\\Buttons\\UI-PlusButton-Up");
- _G["CauldronSkillItem"..i]:SetHeight(_G["CauldronSkillItem"..i.."SkillIcon"]:GetHeight());
+ -- achievement indicator
+ frame = _G["CauldronSkillItem"..i.."MiscInfoAchievement"];
+ if frame then
+ local achievements = Cauldron:GetAchievementsForSkill(skillInfo);
+ local text = "";
+ if achievements and #achievements > 0 then
+ text = "A";
+ end
+ frame:SetText(text);
end
-- place the frame in the scroll view
@@ -463,7 +562,7 @@ function Cauldron:UpdateSkillList()
-- adjust the scroll child size
height = height + skillFrame:GetHeight();
- CauldronSkillListFrameScrollFrameScrollChild:SetHeight(height);
+ CauldronSkillListScrollFrameScrollChild:SetHeight(height);
-- show the frame
skillFrame:Show();
@@ -482,7 +581,6 @@ function Cauldron:UpdateSkillList()
j = j + 1;
end
---]==]
end
@@ -552,484 +650,6 @@ function Cauldron:UpdateButtons()
end
-function Cauldron:UpdateQueue()
-
- if (not CauldronQueueWindowFrame) or (not CauldronQueueWindowFrame:IsShown()) then
- return;
- end
-
- local queue = self.db.realm.userdata[self.vars.playername].queue;
- local itemQueue = {};
-
- local skillName = CURRENT_TRADESKILL;
- if not IsTradeSkillLinked() then
- itemQueue = CauldronQueue:GetItems(queue);
- end
-
- if #itemQueue == 0 then
- -- queue is empty, display the empty message
- CauldronQueueFrameQueueEmpty:Show();
- CauldronQueueFrameScrollFrame:Hide();
-
- if IsTradeSkillLinked() then
- CauldronQueueFrameQueueEmptyText:SetText(L["No queue for linked tradeskills."]);
- else
- CauldronQueueFrameQueueEmptyText:SetText(L["The queue is empty!\nMake something."]);
- end
-
- return;
- end
-
- -- queue has items, show them
- CauldronQueueFrameQueueEmpty:Hide();
- CauldronQueueFrameScrollFrame:Show();
-
- local itemFrameHeight = 39;
-
- local height = 0;
-
- CauldronQueueFrameScrollFrameQueueSectionsMainItemsHeaderText:SetText(L["In order to make:"]);
- -- adjust the scroll child size
- CauldronQueueFrameScrollFrameQueueSectionsMainItems:SetHeight(#itemQueue * itemFrameHeight);
-
- for i, queueInfo in ipairs(itemQueue) do
- local queueItemFrame = _G["CauldronQueueItem"..i];
- self:debug("queueItemFrame: "..tostring(queueItemFrame));
-
- -- check if we have a frame for this position
- if not queueItemFrame then
- -- create a new frame for the queue information
- self:debug("create a new frame for item "..i..": "..queueInfo.name);
- queueItemFrame = CreateFrame("Button",
- "CauldronQueueItem"..i,
- CauldronQueueFrameScrollFrameQueueSectionsMainItems,
- "CauldronQueueItemFrameTemplate");
- else
- self:debug("use existing frame for item "..i..": "..queueInfo.name);
-
- -- set the frame's parent
- queueItemFrame:SetParent(CauldronQueueFrameScrollFrameQueueSectionsMainItems);
- end
-
- -- initialize the frame
--- queueItemFrame:SetAlpha(1.0);
--- queueItemFrame:SetHeight(itemFrameHeight);
-
- -- set some basic properties
- queueItemFrame:SetID(i);
- queueItemFrame.itemName = queueInfo.name;
- queueItemFrame.removeable = true;
- queueItemFrame.shoppable = false;
- queueItemFrame.inHoverButtons = false;
-
- -- _G["CauldronQueueItem"..i.."RemoveItem"]:Hide();
- _G["CauldronQueueItem"..i.."RemoveItem"]:SetScale(0.75);
- --[[
- _G["CauldronQueueItem"..i.."IncreasePriority"]:Hide();
- _G["CauldronQueueItem"..i.."DecreasePriority"]:Hide();
- _G["CauldronQueueItem"..i.."DecrementCount"]:Hide();
- _G["CauldronQueueItem"..i.."IncrementCount"]:Hide();
- _G["CauldronQueueItem"..i.."IncrementCount"]:SetScale(0.75);
- _G["CauldronQueueItem"..i.."AddToShoppingList"]:Hide();
- _G["CauldronQueueItem"..i.."AddToShoppingList"]:SetScale(0.5);
- --]]
-
- local skillInfo = Cauldron:GetSkillInfo(queueInfo.tradeskill, queueInfo.name);
- if not skillInfo then
- -- the skill isn't available (character doesn't know it?)
- self:warn("No skill available for "..queueInfo.name.." ("..queueInfo.tradeskill..")");
- end
-
- -- initialize the frame object
- local frame = nil;
-
- -- set name and difficulty color
- frame = _G["CauldronQueueItem"..i.."ItemName"];
- local nameText = queueInfo.name;
- if skillInfo and (skillInfo.available > 0) then
- nameText = nameText.." ["..skillInfo.available.."]";
- end
- frame:SetText(nameText);
- if skillInfo then
- local color = TradeSkillTypeColor[skillInfo.difficulty];
- if color then
- frame:SetFontObject(color.font);
- frame:SetTextColor(color.r, color.g, color.b, 1.0);
- frame.r = color.r;
- frame.g = color.g;
- frame.b = color.b;
- end
- else
- -- TODO: default color info
- self:debug("Using default color info.");
- end
-
- -- set quantity info
- frame = _G["CauldronQueueItem"..i.."Info"];
- local infoText = queueInfo.tradeskill;
- -- TODO: alts/bank/etc.
- frame:SetText(infoText);
--- frame:SetTextColor(1.0, 1.0, 0.2, 1.0);
--- frame:SetShadowOffset(0, 0);
-
- -- set the icon
- frame = _G["CauldronQueueItem"..i.."Icon"];
- frame:SetNormalTexture(queueInfo.icon);
- frame.link = queueInfo.link;
-
- -- set the amount
- frame = _G["CauldronQueueItem"..i.."IconCount"];
- frame:SetText(queueInfo.amount);
-
- -- place the frame in the scroll view
- if i > 1 then
- -- anchor to the frame above
- queueItemFrame:SetPoint("TOPLEFT", _G["CauldronQueueItem"..(i-1)], "BOTTOMLEFT", 0, 0);
- else
- -- anchor to the parent
- queueItemFrame:SetPoint("TOPLEFT", CauldronQueueFrameScrollFrameQueueSectionsMainItems, "TOPLEFT", 0, 0);
- end
-
--- height = height + queueItemFrame:GetHeight() + 2;
--- self:debug("UpdateQueue: height="..height);
-
- -- show the frame
- queueItemFrame:Show();
- end
-
- -- hide any remaining frames
- local j = #itemQueue + 1;
- while true do
- local frame = _G["CauldronQueueItem"..j];
- if not frame then
- break;
- end
-
--- _G["CauldronQueueItem"..j] = nil;
-
- frame:SetParent(nil);
--- frame:SetAlpha(0.0);
- frame:Hide();
--- frame:SetHeight(0);
-
--- frame = nil;
-
- j = j + 1;
- end
-
- local intQueue = CauldronQueue:GetIntermediates(queue);
- local reagentList = CauldronQueue:GetReagents(queue);
-
- -- store the intermediate queue and the reagent list
--- self.db.realm.userdata[self.vars.playername].intQueue = intQueue;
--- self.db.realm.userdata[self.vars.playername].reagentList = reagentList;
-
- -- display intermediate queue, maybe
- if #intQueue == 0 then
- CauldronQueueFrameScrollFrameQueueSectionsSecondaryItemsHeader:SetHeight(1);
- CauldronQueueFrameScrollFrameQueueSectionsSecondaryItemsHeaderText:SetText("");
- CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems:SetHeight(1);
- else
- CauldronQueueFrameScrollFrameQueueSectionsSecondaryItemsHeader:SetHeight(12);
- CauldronQueueFrameScrollFrameQueueSectionsSecondaryItemsHeaderText:SetText(L["You first have to make:"]);
-
- CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems:SetHeight(#intQueue * itemFrameHeight);
-
- local intHeight = 0;
-
- for i, queueInfo in ipairs(intQueue) do
- local queueItemFrame = _G["CauldronQueueIntItem"..i];
-
- -- check if we have a frame for this position
- if not queueItemFrame then
- -- create a new frame for the skill information
- queueItemFrame = CreateFrame("Button",
- "CauldronQueueIntItem"..i,
- CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems,
- "CauldronQueueItemFrameTemplate");
- else
- self:debug("use existing frame for item "..i..": "..queueInfo.name);
-
- -- set the frame's parent
- queueItemFrame:SetParent(CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems);
- end
-
- queueItemFrame:SetID(100 + i);
- queueItemFrame.itemName = queueInfo.name;
- queueItemFrame.removeable = false;
- queueItemFrame.shoppable = true;
- queueItemFrame.inHoverButtons = false;
-
- -- don't show the "hover" buttons
- _G["CauldronQueueIntItem"..i.."RemoveItem"]:Hide();
- _G["CauldronQueueIntItem"..i.."RemoveItem"]:SetScale(0.75);
- --[[
- _G["CauldronQueueIntItem"..i.."IncreasePriority"]:Hide();
- _G["CauldronQueueIntItem"..i.."DecreasePriority"]:Hide();
- _G["CauldronQueueIntItem"..i.."DecrementCount"]:Hide();
- _G["CauldronQueueIntItem"..i.."IncrementCount"]:Hide();
- _G["CauldronQueueIntItem"..i.."IncrementCount"]:SetScale(0.75);
- _G["CauldronQueueIntItem"..i.."AddToShoppingList"]:Hide();
- _G["CauldronQueueIntItem"..i.."AddToShoppingList"]:SetScale(0.5);
- --]]
-
- local skillInfo = Cauldron:GetSkillInfo(queueInfo.tradeskill, queueInfo.name);
- if not skillInfo then
- -- the skill isn't available (character doesn't know it?)
- -- TODO
- self:error("No skill info available for: "..queueInfo.name.."!");
- end
-
- queueItemFrame.link = skillInfo.recipeLink;
-
- -- populate the frame
- local frame = nil;
-
- -- set name and difficulty color
- frame = _G["CauldronQueueIntItem"..i.."ItemName"];
- local nameText = queueInfo.name;
- if skillInfo then
- if (skillInfo.available > 0) then
- nameText = nameText.." ["..skillInfo.available.."]";
- end
- frame:SetText(nameText);
-
- local color = TradeSkillTypeColor[skillInfo.difficulty];
- if color then
- frame:SetFontObject(color.font);
- frame:SetTextColor(color.r, color.g, color.b, 1.0);
- frame.r = color.r;
- frame.g = color.g;
- frame.b = color.b;
- end
- else
- frame:SetFont("GameFontNormal", 12);
--- frame:SetTextColor(1.0, 1.0, 1.0, 1.0);
- frame.r = 1.0;
- frame.g = 1.0;
- frame.b = 1.0;
- end
-
- -- set quantity info
- frame = _G["CauldronQueueIntItem"..i.."Info"];
- local countInfo = Cauldron:ReagentCount(queueInfo.name);
- local infoText = queueInfo.tradeskill;
- --[[ string.format(queueInfo.tradeskill.."; "..L["Have %d"], countInfo.has);
- if countInfo.bank > 0 then
- infoText = infoText..string.format(L[" (%d in bank)"], countInfo.bank);
- end
- local need = math.max(0, queueInfo.amount - countInfo.has);
- if need > 0 then
- infoText = infoText..string.format(L[", need %d"], need);
- end --]]
- -- alts/bank/etc.
- frame:SetText(infoText);
- frame:SetTextColor(0.6, 0.6, 0.6, 1.0);
- frame:SetShadowOffset(0, 0);
-
- -- set the icon
- frame = _G["CauldronQueueIntItem"..i.."Icon"];
- frame:SetNormalTexture(queueInfo.icon);
- frame.link = queueInfo.link;
-
- -- set the amount
- frame = _G["CauldronQueueIntItem"..i.."IconCount"];
- frame:SetText(queueInfo.amount);
-
- -- place the frame in the scroll view
- if i > 1 then
- -- anchor to the frame above
- queueItemFrame:SetPoint("TOPLEFT", _G["CauldronQueueIntItem"..(i-1)], "BOTTOMLEFT", 0, 0);
- else
- -- anchor to the parent
- queueItemFrame:SetPoint("TOPLEFT", CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems, "TOPLEFT", 0, 0);
- end
-
- -- adjust the scroll child size
--- intHeight = intHeight + queueItemFrame:GetHeight() + 2;
--- self:debug("UpdateQueue: height="..height);
--- CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems:SetHeight(intHeight);
-
- -- show the frame
- queueItemFrame:Show();
- end
- end
-
- -- hide any remaining frames
- j = #intQueue + 1;
- while true do
- local frame = _G["CauldronQueueIntItem"..j];
- if not frame then
- break;
- end
-
--- _G["CauldronQueueIntItem"..j] = nil;
-
- frame:SetParent(nil);
--- frame:SetAlpha(0.0);
- frame:Hide();
--- frame:SetHeight(0);
-
--- frame = nil;
-
- j = j + 1;
- end
-
- -- display reagent list
-
- CauldronQueueFrameScrollFrameQueueSectionsReagentsHeaderText:SetText(L["You will need:"]);
- CauldronQueueFrameScrollFrameQueueSectionsReagents:SetHeight(#reagentList * itemFrameHeight);
-
- local reagentHeight = 0;
-
- for i, queueInfo in ipairs(reagentList) do
- local queueItemFrame = _G["CauldronQueueReagentItem"..i];
-
- -- check if we have a frame for this position
- if not queueItemFrame then
- -- create a new frame for the skill information
- queueItemFrame = CreateFrame("Button",
- "CauldronQueueReagentItem"..i,
- CauldronQueueFrameScrollFrameQueueSectionsReagents,
- "CauldronQueueItemFrameTemplate");
- else
- self:debug("use existing frame for item "..i..": "..queueInfo.name);
-
- -- set the frame's parent
- queueItemFrame:SetParent(CauldronQueueFrameScrollFrameQueueSectionsReagents);
- end
-
- local countInfo = Cauldron:ReagentCount(queueInfo.name);
- local need = math.max(0, queueInfo.amount - countInfo.has);
-
- queueItemFrame:SetID(200 + i);
- queueItemFrame.skillIndex = queueInfo.skillIndex;
- queueItemFrame.index = queueInfo.index;
- queueItemFrame.itemName = queueInfo.name;
- queueItemFrame.removeable = false;
- queueItemFrame.shoppable = true;
- queueItemFrame.inHoverButtons = false;
- queueItemFrame.needAmount = need;
-
- -- don't show the "hover" buttons
- _G["CauldronQueueReagentItem"..i.."RemoveItem"]:Hide();
- _G["CauldronQueueReagentItem"..i.."RemoveItem"]:SetScale(0.75);
- --[[
- _G["CauldronQueueReagentItem"..i.."IncreasePriority"]:Hide();
- _G["CauldronQueueReagentItem"..i.."DecreasePriority"]:Hide();
- _G["CauldronQueueReagentItem"..i.."DecrementCount"]:Hide();
- _G["CauldronQueueReagentItem"..i.."IncrementCount"]:Hide();
- _G["CauldronQueueReagentItem"..i.."IncrementCount"]:SetScale(0.75);
- _G["CauldronQueueReagentItem"..i.."AddToShoppingList"]:Hide();
- _G["CauldronQueueReagentItem"..i.."AddToShoppingList"]:SetScale(0.5);
- --]]
-
- local skillInfo = Cauldron:GetSkillInfo(queueInfo.tradeskill, queueInfo.name);
- if not skillInfo then
- -- TODO
- end
-
- -- populate the frame
- local frame = nil;
-
- -- set name and difficulty color
- frame = _G["CauldronQueueReagentItem"..i.."ItemName"];
- frame:SetText(queueInfo.name);
- frame:SetShadowOffset(0, 0);
- frame:SetFont("GameFontNormal", 12);
- frame:SetTextColor(0.8, 0.8, 0.8, 1.0);
- frame.r = 1.0;
- frame.g = 1.0;
- frame.b = 1.0;
-
- -- set quantity info
- frame = _G["CauldronQueueReagentItem"..i.."Info"];
- local countInfo = Cauldron:ReagentCount(queueInfo.name);
- local qtyText = string.format(L["Have %d"], countInfo.has);
- if countInfo.bank > 0 then
- qtyText = qtyText..string.format(L[" (%d in bank)"], countInfo.bank);
- end
- if need > 0 then
- qtyText = qtyText..string.format(L[", need %d"], need);
- end
- -- TODO: alts/bank/etc.
- frame:SetText(qtyText);
- frame:SetTextColor(0.4, 0.4, 0.4, 1.0);
- frame:SetShadowOffset(0, 0);
-
- -- set the icon
- frame = _G["CauldronQueueReagentItem"..i.."Icon"];
- frame:SetNormalTexture(queueInfo.icon);
- frame.link = queueInfo.link;
--- local playerReagentCount = 0; -- TODO
--- if playerReagentCount < queueInfo.amount then
--- frame:SetVertexColor(0.5, 0.5, 0.5, 1.0);
--- frame:SetTextColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b);
--- else
--- frame:SetVertexColor(1.0, 1.0, 1.0, 1.0);
--- frame:SetTextColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
--- end
-
- -- set the amount
- frame = _G["CauldronQueueReagentItem"..i.."IconCount"];
- frame:SetText(queueInfo.amount);
-
- -- place the frame in the scroll view
- if i > 1 then
- -- anchor to the frame above
- queueItemFrame:SetPoint("TOPLEFT", _G["CauldronQueueReagentItem"..(i-1)], "BOTTOMLEFT", 0, 0);
- else
- -- anchor to the parent
- queueItemFrame:SetPoint("TOPLEFT", CauldronQueueFrameScrollFrameQueueSectionsReagents, "TOPLEFT", 0, 0);
- end
-
- -- adjust the scroll child size
--- reagentHeight = reagentHeight + queueItemFrame:GetHeight() + 2;
--- self:debug("UpdateQueue: height="..height);
--- CauldronQueueFrameScrollFrameQueueSectionsReagents:SetHeight(reagentHeight);
-
- -- show the frame
- queueItemFrame:Show();
- end
-
- -- hide any remaining frames
- j = #reagentList + 1;
- while true do
- local frame = _G["CauldronQueueReagentItem"..j];
- if not frame then
- break;
- end
-
--- _G["CauldronQueueReagentItem"..j] = nil;
-
- frame:SetParent(nil);
--- frame:SetAlpha(0.0);
- frame:Hide();
--- frame:SetHeight(0);
-
--- frame = nil;
-
- j = j + 1;
- end
---]]
- -- adjust the height of the scroll frame
- local h = CauldronQueueFrameScrollFrameQueueSectionsMainItemsHeader:GetHeight() +
- CauldronQueueFrameScrollFrameQueueSectionsMainItems:GetHeight() +
- CauldronQueueFrameScrollFrameQueueSectionsSecondaryItemsHeader:GetHeight() +
- CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems:GetHeight() +
- CauldronQueueFrameScrollFrameQueueSectionsReagentsHeader:GetHeight() +
- CauldronQueueFrameScrollFrameQueueSectionsReagents:GetHeight();
- CauldronQueueFrameScrollFrameQueueSections:SetHeight(h);
- CauldronQueueFrameScrollFrame:UpdateScrollChildRect();
-
-end
-
-function Cauldron:SaveFramePosition()
-
--- TODO
-
-end
-
function Cauldron:OnCauldronUpdate()
--[[
diff --git a/CauldronQueue.xml b/CauldronQueue.xml
new file mode 100644
index 0000000..08a50c5
--- /dev/null
+++ b/CauldronQueue.xml
@@ -0,0 +1,673 @@
+<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">
+
+ <!-- Template: Queue item frame -->
+ <Button name="CauldronQueueItemFrameTemplate" virtual="true" enableMouse="true">
+ <Size x="300" y="39" />
+ <Layers>
+ <Layer level="OVERLAY">
+ <!-- item name -->
+ <FontString name="$parentItemName" inherits="GameFontNormal"
+ text="(name)" justifyH="LEFT" justifyV="CENTER">
+ <Size x="250" y="12"/>
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="40" y="-4"/>
+ </Anchor>
+ </Anchors>
+ <Color r="0.8" g="0.8" b="0.8" />
+ </FontString>
+ <!-- quantity info -->
+ <FontString name="$parentInfo" inherits="GameFontNormal"
+ text="(info)" justifyH="LEFT" justifyV="CENTER">
+ <Size x="250" y="12"/>
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="40" y="-18"/>
+ </Anchor>
+ </Anchors>
+ <!-- Color r="1.0" g="1.0" b="1.0" / -->
+ </FontString>
+ </Layer>
+ <Layer level="HIGHLIGHT" setAllPoints="true">
+ <Texture file="Interface\QuestFrame\UI-QuestLogTitleHighlight" alphaMode="ADD">
+ <Color r="0.8" g="0.8" b="0.8" a="0.5" />
+ </Texture>
+ </Layer>
+ </Layers>
+ <Frames>
+ <!-- icon -->
+ <Button name="$parentIcon">
+ <Size x="37" y="37"/>
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="2" y="-3"/>
+ </Anchor>
+ </Anchors>
+ <Layers>
+ <Layer level="ARTWORK">
+ <FontString name="$parentCount" inherits="NumberFontNormal" justifyH="RIGHT" hidden="false">
+ <Anchors>
+ <Anchor point="BOTTOMRIGHT">
+ <Offset x="-2" y="2"/>
+ </Anchor>
+ </Anchors>
+ </FontString>
+ </Layer>
+ </Layers>
+ <Scripts>
+ <OnLoad>
+ -- self.hasItem = 1;
+ </OnLoad>
+ <OnClick>
+ HandleModifiedItemClick(self.link);
+ </OnClick>
+ <OnEnter>
+ GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
+ GameTooltip:SetHyperlink(self.link);
+ CursorUpdate(self);
+ </OnEnter>
+ <OnLeave>
+ GameTooltip:Hide();
+ ResetCursor();
+ </OnLeave>
+ <OnUpdate>
+ if GameTooltip:IsOwned(self) then
+ GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
+ GameTooltip:SetHyperlink(self.link);
+ CursorUpdate(self);
+ end
+ CursorOnUpdate(self);
+ </OnUpdate>
+ </Scripts>
+ </Button>
+ <Button name="$parentRemoveItem" inherits="UIPanelCloseButton">
+ <Anchors>
+ <Anchor point="TOPRIGHT">
+ <Offset x="0" y="0"/>
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnEnter>
+ self:GetParent().inHoverButtons = true;
+
+ GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
+ GameTooltip:ClearLines();
+ GameTooltip:AddLine(Cauldron:LocaleString("Remove this item from the queue"));
+ GameTooltip:Show();
+ CursorUpdate(self);
+ </OnEnter>
+ <OnLeave>
+ self:GetParent().inHoverButtons = false;
+
+ GameTooltip:Hide();
+ ResetCursor();
+ </OnLeave>
+ <OnClick>
+ Cauldron:RemoveQueueItem(self:GetParent().itemName);
+ Cauldron:UpdateQueue();
+ Cauldron:UpdateButtons();
+ </OnClick>
+ </Scripts>
+ </Button>
+ <!--
+ <Button name="$parentAddToShoppingList" inherits="UIPanelCloseButton" hidden="true">
+ <Anchors>
+ <Anchor point="TOPRIGHT">
+ <Offset x="0" y="0"/>
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnEnter>
+ self:GetParent().inHoverButtons = true;
+
+ GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
+ GameTooltip:ClearLines();
+ GameTooltip:AddLine(Cauldron:LocaleString("Add this item to the shopping list"));
+ GameTooltip:AddLine(Cauldron:LocaleString("Shift-click will replace the count in the shopping list with this amount"));
+ GameTooltip:Show();
+ CursorUpdate(self);
+ </OnEnter>
+ <OnLeave>
+ self:GetParent().inHoverButtons = false;
+
+ GameTooltip:Hide();
+ ResetCursor();
+ </OnLeave>
+ <OnClick>
+ Cauldron:AddItemToShoppingList(self:GetParent().itemName, self:GetParent().needAmount, IsShiftKeyDown());
+ Cauldron:UpdateShoppingList();
+ </OnClick>
+ </Scripts>
+ <NormalTexture file="Interface\Buttons\UI-PlusButton-Up" />
+ <PushedTexture file="Interface\Buttons\UI-PlusButton-Down" />
+ <DisabledTexture file="Interface\Buttons\UI-PlusButton-Disabled" />
+ <HighlightTexture file="Interface\Buttons\UI-PlusButton-Hilight" alphaMode="ADD" />
+ </Button>
+ <Button name="$parentIncrementCount" hidden="true" inherits="ClassTrainerSkillButtonTemplate">
+ <Size x="23" y="22" />
+ <Anchors>
+ <Anchor point="TOPRIGHT">
+ <Offset x="-48" y="-6"/>
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnLoad>
+ self:RegisterForClicks("AnyUp");
+ </OnLoad>
+ <OnEnter>
+ self:GetParent().inHoverButtons = true;
+
+ GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
+ GameTooltip:ClearLines();
+ GameTooltip:AddLine(Cauldron:LocaleString("Increase the amount of this item"));
+ GameTooltip:Show();
+ CursorUpdate(self);
+ </OnEnter>
+ <OnLeave>
+ self:GetParent().inHoverButtons = false;
+
+ GameTooltip:Hide();
+ ResetCursor();
+ </OnLeave>
+ <OnClick>
+ Cauldron:IncreaseItemCount(self:GetParent().itemName);
+ Cauldron:UpdateQueue();
+ Cauldron:UpdateButtons();
+ </OnClick>
+ </Scripts>
+ <NormalTexture file="Interface\Buttons\UI-PlusButton-Up" />
+ <PushedTexture file="Interface\Buttons\UI-PlusButton-Down" />
+ <DisabledTexture file="Interface\Buttons\UI-PlusButton-Disabled" />
+ <HighlightTexture file="Interface\Buttons\UI-PlusButton-Hilight" alphaMode="ADD" />
+ </Button>
+ <Button name="$parentDecrementCount" hidden="true" inherits="ClassTrainerSkillButtonTemplate">
+ <Size x="23" y="22" />
+ <Anchors>
+ <Anchor point="TOPRIGHT">
+ <Offset x="-16" y="-2"/>
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnLoad>
+ self:RegisterForClicks("AnyUp");
+ </OnLoad>
+ <OnEnter>
+ self:GetParent().inHoverButtons = true;
+
+ GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
+ GameTooltip:ClearLines();
+ GameTooltip:AddLine(Cauldron:LocaleString("Decrease the amount of this item"));
+ GameTooltip:Show();
+ CursorUpdate(self);
+ </OnEnter>
+ <OnLeave>
+ self:GetParent().inHoverButtons = false;
+
+ GameTooltip:Hide();
+ ResetCursor();
+ </OnLeave>
+ <OnClick>
+ Cauldron:DecreaseItemCount(self:GetParent().itemName);
+ Cauldron:UpdateQueue();
+ Cauldron:UpdateButtons();
+ </OnClick>
+ </Scripts>
+ <NormalTexture file="Interface\Buttons\UI-MinusButton-Up" />
+ <PushedTexture file="Interface\Buttons\UI-MinusButton-Down" />
+ <DisabledTexture file="Interface\Buttons\UI-MinusButton-Disabled" />
+ <HighlightTexture file="Interface\Buttons\UI-ScrollBar-ScrollUpButton-Highlight" alphaMode="ADD" />
+ </Button>
+ <Button name="$parentIncreasePriority" hidden="true">
+ <Size x="23" y="22" />
+ <Anchors>
+ <Anchor point="TOPRIGHT">
+ <Offset x="-16" y="-20"/>
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnLoad>
+ self:RegisterForClicks("AnyUp");
+ </OnLoad>
+ <OnEnter>
+ self:GetParent().inHoverButtons = true;
+
+ GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
+ GameTooltip:ClearLines();
+ GameTooltip:AddLine(Cauldron:LocaleString("Increase the priority of this item"));
+ GameTooltip:AddLine(Cauldron:LocaleString("Shift-click to move to the top of the queue"));
+ GameTooltip:Show();
+ CursorUpdate(self);
+ </OnEnter>
+ <OnLeave>
+ self:GetParent().inHoverButtons = false;
+
+ GameTooltip:Hide();
+ ResetCursor();
+ </OnLeave>
+ <OnClick>
+ Cauldron:IncreaseItemPriority(self:GetParent().itemName, IsShiftKeyDown());
+ CauldronQueue:CalculateAllRequiredItems(Cauldron:GetQueue());
+ Cauldron:UpdateQueue();
+ </OnClick>
+ </Scripts>
+ <NormalTexture file="Interface\Buttons\UI-ScrollBar-ScrollUpButton-Up" />
+ <PushedTexture file="Interface\Buttons\UI-ScrollBar-ScrollUpButton-Down" />
+ <DisabledTexture file="Interface\Buttons\UI-ScrollBar-ScrollUpButton-Disabled" />
+ <HighlightTexture file="Interface\Buttons\UI-ScrollBar-ScrollUpButton-Highlight" alphaMode="ADD" />
+ </Button>
+ <Button name="$parentDecreasePriority" hidden="true">
+ <Size x="23" y="22" />
+ <Anchors>
+ <Anchor point="TOPRIGHT">
+ <Offset x="0" y="-20"/>
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnLoad>
+ self:RegisterForClicks("AnyUp");
+ </OnLoad>
+ <OnEnter>
+ self:GetParent().inHoverButtons = true;
+
+ GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
+ GameTooltip:ClearLines();
+ GameTooltip:AddLine(Cauldron:LocaleString("Decrease the priority of this item"));
+ GameTooltip:AddLine(Cauldron:LocaleString("Shift-click to move to the bottom of the queue"));
+ GameTooltip:Show();
+ CursorUpdate(self);
+ </OnEnter>
+ <OnLeave>
+ self:GetParent().inHoverButtons = false;
+
+ GameTooltip:Hide();
+ ResetCursor();
+ </OnLeave>
+ <OnClick>
+ Cauldron:DecreaseItemPriority(self:GetParent().itemName, IsShiftKeyDown());
+ CauldronQueue:CalculateAllRequiredItems(Cauldron:GetQueue());
+ Cauldron:UpdateQueue();
+ </OnClick>
+ </Scripts>
+ <NormalTexture file="Interface\Buttons\UI-ScrollBar-ScrollDownButton-Up" />
+ <PushedTexture file="Interface\Buttons\UI-ScrollBar-ScrollDownButton-Down" />
+ <DisabledTexture file="Interface\Buttons\UI-ScrollBar-ScrollDownButton-Disabled" />
+ <HighlightTexture file="Interface\Buttons\UI-ScrollBar-ScrollDownButton-Highlight" alphaMode="ADD" />
+ </Button>
+ -->
+ </Frames>
+ <Scripts>
+ <OnClick>
+ HandleModifiedItemClick(self.link);
+ </OnClick>
+ <!--
+ <OnEnter>
+ if self.removeable then
+ _G[self:GetName().."RemoveItem"]:Show();
+ _G[self:GetName().."DecreasePriority"]:Show();
+ _G[self:GetName().."IncreasePriority"]:Show();
+ _G[self:GetName().."DecrementCount"]:Show();
+ _G[self:GetName().."IncrementCount"]:Show();
+ _G[self:GetName().."IncrementCount"]:SetScale(0.75);
+ end
+ if self.shoppable then
+ _G[self:GetName().."AddToShoppingList"]:Show();
+ end
+ </OnEnter>
+ <OnLeave>
+ if not self.inHoverButtons then
+ _G[self:GetName().."RemoveItem"]:Hide();
+ _G[self:GetName().."DecreasePriority"]:Hide();
+ _G[self:GetName().."IncreasePriority"]:Hide();
+ _G[self:GetName().."DecrementCount"]:Hide();
+ _G[self:GetName().."IncrementCount"]:Hide();
+ _G[self:GetName().."AddToShoppingList"]:Hide();
+ end
+ </OnLeave>
+ -->
+ </Scripts>
+ </Button>
+
+ <!-- Queue frame -->
+ <Frame name="CauldronQueueWindowFrame" inherits="ButtonFrameTemplate"
+ parent="UIParent" enableMouse="true"
+ toplevel="true" hidden="true" >
+
+ <!-- Window border and background -->
+ <Layers>
+ </Layers>
+
+ <Frames>
+ <!-- Queue frame -->
+ <Frame name="CauldronQueueFrame">
+ <Size x="300" y="332" />
+ <Anchors>
+ <Anchor point="TOPLEFT" relativeTo="CauldronQueueWindowFrame" relativePoint="TOPLEFT">
+ <Offset x="10" y="-64" />
+ </Anchor>
+ </Anchors>
+
+ <Frames>
+ <Frame name="CauldronQueueFrameQueueEmpty">
+ <Size x="302" y="360" />
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="0" y="0" />
+ </Anchor>
+ </Anchors>
+ <Layers>
+ <Layer level="OVERLAY">
+ <FontString name="$parentText" inherits="QuestTitleFont"
+ text=""
+ justifyH="CENTER" justifyV="CENTER">
+ <Size x="302" y="360" />
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="0" y="0" />
+ </Anchor>
+ </Anchors>
+ <Color r="0.2" g="0.2" b="0.2" />
+ </FontString>
+ </Layer>
+ </Layers>
+ </Frame>
+
+ <ScrollFrame name="CauldronQueueFrameScrollFrame" inherits="UIPanelScrollFrameTemplate" hidden="true">
+ <Size x="297" y="332" />
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="0" y="0"/>
+ </Anchor>
+ </Anchors>
+ <Layers>
+ <Layer level="BACKGROUND">
+ <Texture name="CauldronQueueFrameScrollBackgroundTopLeft" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
+ <Size>
+ <AbsDimension x="31" y="256"/>
+ </Size>
+ <Anchors>
+ <Anchor point="TOPLEFT" relativePoint="TOPRIGHT">
+ <Offset>
+ <AbsDimension x="-2" y="5"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ <TexCoords left="0" right="0.484375" top="0" bottom="1.0"/>
+ </Texture>
+ <Texture name="CauldronQueueFrameScrollBackgroundBottomRight" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
+ <Size>
+ <AbsDimension x="31" y="106"/>
+ </Size>
+ <Anchors>
+ <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT">
+ <Offset>
+ <AbsDimension x="-2" y="-2"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ <TexCoords left="0.515625" right="1.0" top="0" bottom="0.4140625"/>
+ </Texture>
+ </Layer>
+ </Layers>
+ <ScrollChild>
+ <Frame name="CauldronQueueFrameScrollFrameQueueSections">
+ <Size x="300" y="332" />
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="0" y="0"/>
+ </Anchor>
+ </Anchors>
+ <Frames>
+ <Frame name="CauldronQueueFrameScrollFrameQueueSectionsMainItemsHeader">
+ <Size x="300" y="12" />
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="0" y="0" />
+ </Anchor>
+ </Anchors>
+ <Layers>
+ <Layer level="OVERLAY">
+ <FontString name="$parentText" inherits="QuestFont" text="">
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="0" y="0" />
+ </Anchor>
+ </Anchors>
+ <Color r="0.6" g="0.6" b="0.6" />
+ </FontString>
+ </Layer>
+ </Layers>
+ </Frame>
+ <Frame name="CauldronQueueFrameScrollFrameQueueSectionsMainItems">
+ <Size x="300" y="1" />
+ <Anchors>
+ <Anchor point="TOPLEFT" relativeTo="$parentMainItemsHeader" relativePoint="BOTTOMLEFT">
+ <Offset x="0" y="-2" />
+ </Anchor>
+ </Anchors>
+ </Frame>
+ <Frame name="CauldronQueueFrameScrollFrameQueueSectionsSecondaryItemsHeader">
+ <Size x="300" y="20" />
+ <Anchors>
+ <Anchor point="TOPLEFT" relativeTo="$parentMainItems" relativePoint="BOTTOMLEFT">
+ <Offset x="0" y="-2" />
+ </Anchor>
+ </Anchors>
+ <Layers>
+ <Layer level="OVERLAY">
+ <FontString name="$parentText" inherits="QuestFont" text=""
+ justifyV="BOTTOM" justifyH="LEFT">
+ <Size x="300" y="20" />
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="0" y="0" />
+ </Anchor>
+ </Anchors>
+ <Color r="0.6" g="0.6" b="0.6" />
+ </FontString>
+ </Layer>
+ </Layers>
+ </Frame>
+ <Frame name="CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems">
+ <Size x="300" y="1" />
+ <Anchors>
+ <Anchor point="TOPLEFT" relativeTo="$parentSecondaryItemsHeader" relativePoint="BOTTOMLEFT">
+ <Offset x="0" y="-2" />
+ </Anchor>
+ </Anchors>
+ </Frame>
+ <Frame name="CauldronQueueFrameScrollFrameQueueSectionsReagentsHeader">
+ <Size x="300" y="20" />
+ <Anchors>
+ <Anchor point="TOPLEFT" relativeTo="$parentSecondaryItems" relativePoint="BOTTOMLEFT">
+ <Offset x="0" y="-2" />
+ </Anchor>
+ </Anchors>
+ <Layers>
+ <Layer level="OVERLAY">
+ <FontString name="$parentText" inherits="QuestFont" text=""
+ justifyV="BOTTOM" justifyH="LEFT">
+ <Size x="300" y="20" />
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="0" y="0" />
+ </Anchor>
+ </Anchors>
+ <Color r="0.6" g="0.6" b="0.6" />
+ </FontString>
+ </Layer>
+ </Layers>
+ </Frame>
+ <Frame name="CauldronQueueFrameScrollFrameQueueSectionsReagents">
+ <Size x="300" y="1" />
+ <Anchors>
+ <Anchor point="TOPLEFT" relativeTo="$parentReagentsHeader" relativePoint="BOTTOMLEFT">
+ <Offset x="0" y="-2" />
+ </Anchor>
+ </Anchors>
+ </Frame>
+ </Frames>
+ </Frame>
+ </ScrollChild>
+ <!--
+ <Frames>
+ <Slider name="$parentScrollBar" inherits="MinimalHybridScrollBarTemplate">
+ <Anchors>
+ <Anchor point="TOPRIGHT" relativeTo="CauldronQueueFrame" relativePoint="TOPRIGHT">
+ <Offset>
+ <AbsDimension x="-47" y="-114"/>
+ </Offset>
+ </Anchor>
+ <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT">
+ <Offset>
+ <AbsDimension x="6" y="14"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ </Slider>
+ </Frames>
+ -->
+ </ScrollFrame>
+ </Frames>
+ </Frame>
+
+ <!-- Close button -->
+ <!--
+ <Button name="CauldronQueueWindowFrameCloseButton" inherits="UIPanelCloseButton">
+ <Anchors>
+ <Anchor point="TOPRIGHT" relativeTo="CauldronQueueWindowFrame" relativePoint="TOPRIGHT">
+ <Offset x="4" y="-8"/>
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnClick>
+ HideUIPanel(CauldronQueueWindowFrame);
+ - - TODO: record that queue is closed
+ PlaySound("igCharacterInfoClose");
+ </OnClick>
+ </Scripts>
+ </Button>
+ -->
+
+ <!-- Buttons frame -->
+ <Frame name="CauldronQueueButtonsFrame">
+ <Size x="357" y="25" />
+ <Anchors>
+ <Anchor point="BOTTOMLEFT" relativeTo="CauldronQueueWindowFrame" relativePoint="BOTTOMLEFT">
+ <Offset x="2" y="0" />
+ </Anchor>
+ </Anchors>
+
+ <Frames>
+
+ <!-- Queue All button -->
+ <Button name="CauldronQueueAllButton" inherits="CauldronButtonTemplate" text="Queue All">
+ <Anchors>
+ <Anchor point="TOPLEFT">
+ <Offset x="0" y="0" />
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnLoad>
+ -- getglobal(self:GetName()):Disable();
+ </OnLoad>
+ <OnEnter>
+ GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
+ GameTooltip:ClearLines();
+ GameTooltip:AddLine(Cauldron:LocaleString("Click to queue the listed amount of this item"));
+ GameTooltip:AddLine(Cauldron:LocaleString("Shift-click to queue the listed potential amount of this item"));
+ GameTooltip:Show();
+ CursorUpdate(self);
+ </OnEnter>
+ <OnLeave>
+ GameTooltip:Hide();
+ ResetCursor();
+ </OnLeave>
+ <OnClick>
+ Cauldron:QueueAllTradeSkillItem();
+ Cauldron:UpdateButtons();
+ </OnClick>
+ </Scripts>
+ </Button>
+
+ <!-- Queue button -->
+ <Button name="CauldronQueueButton" inherits="CauldronButtonTemplate" text="Queue">
+ <Anchors>
+ <Anchor point="LEFT" relativeTo="CauldronQueueAllButton" relativePoint="RIGHT">
+ <Offset x="0" y="0" />
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnLoad>
+ -- getglobal(self:GetName()):Disable();
+ </OnLoad>
+ <OnClick>
+ Cauldron:QueueTradeSkillItem();
+ Cauldron:UpdateButtons();
+ </OnClick>
+ </Scripts>
+ </Button>
+
+ <!-- spacer -->
+
+ <!-- Process button (disabled) -->
+ <Button name="CauldronProcessButton" inherits="CauldronButtonTemplate" text="Process">
+ <Anchors>
+ <Anchor point="LEFT" relativeTo="CauldronQueueButton" relativePoint="RIGHT">
+ <Offset x="2" y="0" />
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnLoad>
+ getglobal(self:GetName()):Disable();
+ </OnLoad>
+ <OnClick>
+ Cauldron:ProcessQueue();
+ </OnClick>
+ </Scripts>
+ </Button>
+
+ <!-- Clear Queue button (disabled) -->
+ <Button name="CauldronClearQueueButton" inherits="CauldronButtonTemplate" text="Clear Queue">
+ <Size x="90" y="20" />
+ <Anchors>
+ <Anchor point="LEFT" relativeTo="CauldronProcessButton" relativePoint="RIGHT">
+ <Offset x="0" y="0" />
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnLoad>
+ getglobal(self:GetName()):Disable();
+ </OnLoad>
+ <OnClick>
+ CauldronQueue:ClearQueue(Cauldron:GetQueue());
+ Cauldron:UpdateQueue();
+ Cauldron:UpdateButtons();
+ </OnClick>
+ </Scripts>
+ </Button>
+
+ </Frames>
+ </Frame>
+
+ </Frames>
+
+ <Scripts>
+ <OnLoad>
+ return;
+ </OnLoad>
+ <OnShow>
+ PlaySound("igCharacterInfoOpen");
+ </OnShow>
+ <OnHide>
+ --HideUIPanel(CauldronFrame);
+ PlaySound("igCharacterInfoClose");
+ </OnHide>
+ <OnMouseWheel>
+ return;
+ </OnMouseWheel>
+ </Scripts>
+ </Frame>
+
+</Ui>
diff --git a/CauldronQueueUI.lua b/CauldronQueueUI.lua
new file mode 100644
index 0000000..8d42ce5
--- /dev/null
+++ b/CauldronQueueUI.lua
@@ -0,0 +1,477 @@
+-- $Revision: 213 $
+-- Cauldron queue user interface logic
+
+local L = LibStub("AceLocale-3.0"):GetLocale("Cauldron")
+
+function Cauldron:UpdateQueue()
+
+ if (not CauldronQueueWindowFrame) or (not CauldronQueueWindowFrame:IsShown()) then
+ return;
+ end
+
+ local queue = self.db.realm.userdata[self.vars.playername].queue;
+ local itemQueue = {};
+
+ local skillName = CURRENT_TRADESKILL;
+ if not IsTradeSkillLinked() then
+ itemQueue = CauldronQueue:GetItems(queue);
+ end
+
+ if #itemQueue == 0 then
+ -- queue is empty, display the empty message
+ CauldronQueueFrameQueueEmpty:Show();
+ CauldronQueueFrameScrollFrame:Hide();
+
+ if IsTradeSkillLinked() then
+ CauldronQueueFrameQueueEmptyText:SetText(L["No queue for linked tradeskills."]);
+ else
+ CauldronQueueFrameQueueEmptyText:SetText(L["The queue is empty!\nMake something."]);
+ end
+
+ return;
+ end
+
+ -- queue has items, show them
+ CauldronQueueFrameQueueEmpty:Hide();
+ CauldronQueueFrameScrollFrame:Show();
+
+ local itemFrameHeight = 39;
+
+ local height = 0;
+
+ CauldronQueueFrameScrollFrameQueueSectionsMainItemsHeaderText:SetText(L["In order to make:"]);
+ -- adjust the scroll child size
+ CauldronQueueFrameScrollFrameQueueSectionsMainItems:SetHeight(#itemQueue * itemFrameHeight);
+
+ for i, queueInfo in ipairs(itemQueue) do
+ local queueItemFrame = _G["CauldronQueueItem"..i];
+ self:debug("queueItemFrame: "..tostring(queueItemFrame));
+
+ -- check if we have a frame for this position
+ if not queueItemFrame then
+ -- create a new frame for the queue information
+ self:debug("create a new frame for item "..i..": "..queueInfo.name);
+ queueItemFrame = CreateFrame("Button",
+ "CauldronQueueItem"..i,
+ CauldronQueueFrameScrollFrameQueueSectionsMainItems,
+ "CauldronQueueItemFrameTemplate");
+ else
+ self:debug("use existing frame for item "..i..": "..queueInfo.name);
+
+ -- set the frame's parent
+ queueItemFrame:SetParent(CauldronQueueFrameScrollFrameQueueSectionsMainItems);
+ end
+
+ -- initialize the frame
+-- queueItemFrame:SetAlpha(1.0);
+-- queueItemFrame:SetHeight(itemFrameHeight);
+
+ -- set some basic properties
+ queueItemFrame:SetID(i);
+ queueItemFrame.itemName = queueInfo.name;
+ queueItemFrame.removeable = true;
+ queueItemFrame.shoppable = false;
+ queueItemFrame.inHoverButtons = false;
+
+ -- _G["CauldronQueueItem"..i.."RemoveItem"]:Hide();
+ _G["CauldronQueueItem"..i.."RemoveItem"]:SetScale(0.75);
+ --[[
+ _G["CauldronQueueItem"..i.."IncreasePriority"]:Hide();
+ _G["CauldronQueueItem"..i.."DecreasePriority"]:Hide();
+ _G["CauldronQueueItem"..i.."DecrementCount"]:Hide();
+ _G["CauldronQueueItem"..i.."IncrementCount"]:Hide();
+ _G["CauldronQueueItem"..i.."IncrementCount"]:SetScale(0.75);
+ _G["CauldronQueueItem"..i.."AddToShoppingList"]:Hide();
+ _G["CauldronQueueItem"..i.."AddToShoppingList"]:SetScale(0.5);
+ --]]
+
+ local skillInfo = Cauldron:GetSkillInfo(queueInfo.tradeskill, queueInfo.name);
+ if not skillInfo then
+ -- the skill isn't available (character doesn't know it?)
+ self:warn("No skill available for "..queueInfo.name.." ("..queueInfo.tradeskill..")");
+ end
+
+ -- initialize the frame object
+ local frame = nil;
+
+ -- set name and difficulty color
+ frame = _G["CauldronQueueItem"..i.."ItemName"];
+ local nameText = queueInfo.name;
+ if skillInfo and (skillInfo.available > 0) then
+ nameText = nameText.." ["..skillInfo.available.."]";
+ end
+ frame:SetText(nameText);
+ if skillInfo then
+ local color = TradeSkillTypeColor[skillInfo.difficulty];
+ if color then
+ frame:SetFontObject(color.font);
+ frame:SetTextColor(color.r, color.g, color.b, 1.0);
+ frame.r = color.r;
+ frame.g = color.g;
+ frame.b = color.b;
+ end
+ else
+ -- TODO: default color info
+ self:debug("Using default color info.");
+ end
+
+ -- set quantity info
+ frame = _G["CauldronQueueItem"..i.."Info"];
+ local infoText = queueInfo.tradeskill;
+ -- TODO: alts/bank/etc.
+ frame:SetText(infoText);
+-- frame:SetTextColor(1.0, 1.0, 0.2, 1.0);
+-- frame:SetShadowOffset(0, 0);
+
+ -- set the icon
+ frame = _G["CauldronQueueItem"..i.."Icon"];
+ frame:SetNormalTexture(queueInfo.icon);
+ frame.link = queueInfo.link;
+
+ -- set the amount
+ frame = _G["CauldronQueueItem"..i.."IconCount"];
+ frame:SetText(queueInfo.amount);
+
+ -- place the frame in the scroll view
+ if i > 1 then
+ -- anchor to the frame above
+ queueItemFrame:SetPoint("TOPLEFT", _G["CauldronQueueItem"..(i-1)], "BOTTOMLEFT", 0, 0);
+ else
+ -- anchor to the parent
+ queueItemFrame:SetPoint("TOPLEFT", CauldronQueueFrameScrollFrameQueueSectionsMainItems, "TOPLEFT", 0, 0);
+ end
+
+-- height = height + queueItemFrame:GetHeight() + 2;
+-- self:debug("UpdateQueue: height="..height);
+
+ -- show the frame
+ queueItemFrame:Show();
+ end
+
+ -- hide any remaining frames
+ local j = #itemQueue + 1;
+ while true do
+ local frame = _G["CauldronQueueItem"..j];
+ if not frame then
+ break;
+ end
+
+-- _G["CauldronQueueItem"..j] = nil;
+
+ frame:SetParent(nil);
+-- frame:SetAlpha(0.0);
+ frame:Hide();
+-- frame:SetHeight(0);
+
+-- frame = nil;
+
+ j = j + 1;
+ end
+
+ local intQueue = CauldronQueue:GetIntermediates(queue);
+ local reagentList = CauldronQueue:GetReagents(queue);
+
+ -- store the intermediate queue and the reagent list
+-- self.db.realm.userdata[self.vars.playername].intQueue = intQueue;
+-- self.db.realm.userdata[self.vars.playername].reagentList = reagentList;
+
+ -- display intermediate queue, maybe
+ if #intQueue == 0 then
+ CauldronQueueFrameScrollFrameQueueSectionsSecondaryItemsHeader:SetHeight(1);
+ CauldronQueueFrameScrollFrameQueueSectionsSecondaryItemsHeaderText:SetText("");
+ CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems:SetHeight(1);
+ else
+ CauldronQueueFrameScrollFrameQueueSectionsSecondaryItemsHeader:SetHeight(12);
+ CauldronQueueFrameScrollFrameQueueSectionsSecondaryItemsHeaderText:SetText(L["You first have to make:"]);
+
+ CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems:SetHeight(#intQueue * itemFrameHeight);
+
+ local intHeight = 0;
+
+ for i, queueInfo in ipairs(intQueue) do
+ local queueItemFrame = _G["CauldronQueueIntItem"..i];
+
+ -- check if we have a frame for this position
+ if not queueItemFrame then
+ -- create a new frame for the skill information
+ queueItemFrame = CreateFrame("Button",
+ "CauldronQueueIntItem"..i,
+ CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems,
+ "CauldronQueueItemFrameTemplate");
+ else
+ self:debug("use existing frame for item "..i..": "..queueInfo.name);
+
+ -- set the frame's parent
+ queueItemFrame:SetParent(CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems);
+ end
+
+ queueItemFrame:SetID(100 + i);
+ queueItemFrame.itemName = queueInfo.name;
+ queueItemFrame.removeable = false;
+ queueItemFrame.shoppable = true;
+ queueItemFrame.inHoverButtons = false;
+
+ -- don't show the "hover" buttons
+ _G["CauldronQueueIntItem"..i.."RemoveItem"]:Hide();
+ _G["CauldronQueueIntItem"..i.."RemoveItem"]:SetScale(0.75);
+ --[[
+ _G["CauldronQueueIntItem"..i.."IncreasePriority"]:Hide();
+ _G["CauldronQueueIntItem"..i.."DecreasePriority"]:Hide();
+ _G["CauldronQueueIntItem"..i.."DecrementCount"]:Hide();
+ _G["CauldronQueueIntItem"..i.."IncrementCount"]:Hide();
+ _G["CauldronQueueIntItem"..i.."IncrementCount"]:SetScale(0.75);
+ _G["CauldronQueueIntItem"..i.."AddToShoppingList"]:Hide();
+ _G["CauldronQueueIntItem"..i.."AddToShoppingList"]:SetScale(0.5);
+ --]]
+
+ local skillInfo = Cauldron:GetSkillInfo(queueInfo.tradeskill, queueInfo.name);
+ if not skillInfo then
+ -- the skill isn't available (character doesn't know it?)
+ -- TODO
+ self:error("No skill info available for: "..queueInfo.name.."!");
+ end
+
+ queueItemFrame.link = skillInfo.recipeLink;
+
+ -- populate the frame
+ local frame = nil;
+
+ -- set name and difficulty color
+ frame = _G["CauldronQueueIntItem"..i.."ItemName"];
+ local nameText = queueInfo.name;
+ if skillInfo then
+ if (skillInfo.available > 0) then
+ nameText = nameText.." ["..skillInfo.available.."]";
+ end
+ frame:SetText(nameText);
+
+ local color = TradeSkillTypeColor[skillInfo.difficulty];
+ if color then
+ frame:SetFontObject(color.font);
+ frame:SetTextColor(color.r, color.g, color.b, 1.0);
+ frame.r = color.r;
+ frame.g = color.g;
+ frame.b = color.b;
+ end
+ else
+ frame:SetFont("GameFontNormal", 12);
+-- frame:SetTextColor(1.0, 1.0, 1.0, 1.0);
+ frame.r = 1.0;
+ frame.g = 1.0;
+ frame.b = 1.0;
+ end
+
+ -- set quantity info
+ frame = _G["CauldronQueueIntItem"..i.."Info"];
+ local countInfo = Cauldron:ReagentCount(queueInfo.name);
+ local infoText = queueInfo.tradeskill;
+ --[[ string.format(queueInfo.tradeskill.."; "..L["Have %d"], countInfo.has);
+ if countInfo.bank > 0 then
+ infoText = infoText..string.format(L[" (%d in bank)"], countInfo.bank);
+ end
+ local need = math.max(0, queueInfo.amount - countInfo.has);
+ if need > 0 then
+ infoText = infoText..string.format(L[", need %d"], need);
+ end --]]
+ -- alts/bank/etc.
+ frame:SetText(infoText);
+ frame:SetTextColor(0.6, 0.6, 0.6, 1.0);
+ frame:SetShadowOffset(0, 0);
+
+ -- set the icon
+ frame = _G["CauldronQueueIntItem"..i.."Icon"];
+ frame:SetNormalTexture(queueInfo.icon);
+ frame.link = queueInfo.link;
+
+ -- set the amount
+ frame = _G["CauldronQueueIntItem"..i.."IconCount"];
+ frame:SetText(queueInfo.amount);
+
+ -- place the frame in the scroll view
+ if i > 1 then
+ -- anchor to the frame above
+ queueItemFrame:SetPoint("TOPLEFT", _G["CauldronQueueIntItem"..(i-1)], "BOTTOMLEFT", 0, 0);
+ else
+ -- anchor to the parent
+ queueItemFrame:SetPoint("TOPLEFT", CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems, "TOPLEFT", 0, 0);
+ end
+
+ -- adjust the scroll child size
+-- intHeight = intHeight + queueItemFrame:GetHeight() + 2;
+-- self:debug("UpdateQueue: height="..height);
+-- CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems:SetHeight(intHeight);
+
+ -- show the frame
+ queueItemFrame:Show();
+ end
+ end
+
+ -- hide any remaining frames
+ j = #intQueue + 1;
+ while true do
+ local frame = _G["CauldronQueueIntItem"..j];
+ if not frame then
+ break;
+ end
+
+-- _G["CauldronQueueIntItem"..j] = nil;
+
+ frame:SetParent(nil);
+-- frame:SetAlpha(0.0);
+ frame:Hide();
+-- frame:SetHeight(0);
+
+-- frame = nil;
+
+ j = j + 1;
+ end
+
+ -- display reagent list
+
+ CauldronQueueFrameScrollFrameQueueSectionsReagentsHeaderText:SetText(L["You will need:"]);
+ CauldronQueueFrameScrollFrameQueueSectionsReagents:SetHeight(#reagentList * itemFrameHeight);
+
+ local reagentHeight = 0;
+
+ for i, queueInfo in ipairs(reagentList) do
+ local queueItemFrame = _G["CauldronQueueReagentItem"..i];
+
+ -- check if we have a frame for this position
+ if not queueItemFrame then
+ -- create a new frame for the skill information
+ queueItemFrame = CreateFrame("Button",
+ "CauldronQueueReagentItem"..i,
+ CauldronQueueFrameScrollFrameQueueSectionsReagents,
+ "CauldronQueueItemFrameTemplate");
+ else
+ self:debug("use existing frame for item "..i..": "..queueInfo.name);
+
+ -- set the frame's parent
+ queueItemFrame:SetParent(CauldronQueueFrameScrollFrameQueueSectionsReagents);
+ end
+
+ local countInfo = Cauldron:ReagentCount(queueInfo.name);
+ local need = math.max(0, queueInfo.amount - countInfo.has);
+
+ queueItemFrame:SetID(200 + i);
+ queueItemFrame.skillIndex = queueInfo.skillIndex;
+ queueItemFrame.index = queueInfo.index;
+ queueItemFrame.itemName = queueInfo.name;
+ queueItemFrame.removeable = false;
+ queueItemFrame.shoppable = true;
+ queueItemFrame.inHoverButtons = false;
+ queueItemFrame.needAmount = need;
+
+ -- don't show the "hover" buttons
+ _G["CauldronQueueReagentItem"..i.."RemoveItem"]:Hide();
+ _G["CauldronQueueReagentItem"..i.."RemoveItem"]:SetScale(0.75);
+ --[[
+ _G["CauldronQueueReagentItem"..i.."IncreasePriority"]:Hide();
+ _G["CauldronQueueReagentItem"..i.."DecreasePriority"]:Hide();
+ _G["CauldronQueueReagentItem"..i.."DecrementCount"]:Hide();
+ _G["CauldronQueueReagentItem"..i.."IncrementCount"]:Hide();
+ _G["CauldronQueueReagentItem"..i.."IncrementCount"]:SetScale(0.75);
+ _G["CauldronQueueReagentItem"..i.."AddToShoppingList"]:Hide();
+ _G["CauldronQueueReagentItem"..i.."AddToShoppingList"]:SetScale(0.5);
+ --]]
+
+ local skillInfo = Cauldron:GetSkillInfo(queueInfo.tradeskill, queueInfo.name);
+ if not skillInfo then
+ -- TODO
+ end
+
+ -- populate the frame
+ local frame = nil;
+
+ -- set name and difficulty color
+ frame = _G["CauldronQueueReagentItem"..i.."ItemName"];
+ frame:SetText(queueInfo.name);
+ frame:SetShadowOffset(0, 0);
+ frame:SetFont("GameFontNormal", 12);
+ frame:SetTextColor(0.8, 0.8, 0.8, 1.0);
+ frame.r = 1.0;
+ frame.g = 1.0;
+ frame.b = 1.0;
+
+ -- set quantity info
+ frame = _G["CauldronQueueReagentItem"..i.."Info"];
+ local countInfo = Cauldron:ReagentCount(queueInfo.name);
+ local qtyText = string.format(L["Have %d"], countInfo.has);
+ if countInfo.bank > 0 then
+ qtyText = qtyText..string.format(L[" (%d in bank)"], countInfo.bank);
+ end
+ if need > 0 then
+ qtyText = qtyText..string.format(L[", need %d"], need);
+ end
+ -- TODO: alts/bank/etc.
+ frame:SetText(qtyText);
+ frame:SetTextColor(0.4, 0.4, 0.4, 1.0);
+ frame:SetShadowOffset(0, 0);
+
+ -- set the icon
+ frame = _G["CauldronQueueReagentItem"..i.."Icon"];
+ frame:SetNormalTexture(queueInfo.icon);
+ frame.link = queueInfo.link;
+-- local playerReagentCount = 0; -- TODO
+-- if playerReagentCount < queueInfo.amount then
+-- frame:SetVertexColor(0.5, 0.5, 0.5, 1.0);
+-- frame:SetTextColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b);
+-- else
+-- frame:SetVertexColor(1.0, 1.0, 1.0, 1.0);
+-- frame:SetTextColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
+-- end
+
+ -- set the amount
+ frame = _G["CauldronQueueReagentItem"..i.."IconCount"];
+ frame:SetText(queueInfo.amount);
+
+ -- place the frame in the scroll view
+ if i > 1 then
+ -- anchor to the frame above
+ queueItemFrame:SetPoint("TOPLEFT", _G["CauldronQueueReagentItem"..(i-1)], "BOTTOMLEFT", 0, 0);
+ else
+ -- anchor to the parent
+ queueItemFrame:SetPoint("TOPLEFT", CauldronQueueFrameScrollFrameQueueSectionsReagents, "TOPLEFT", 0, 0);
+ end
+
+ -- adjust the scroll child size
+-- reagentHeight = reagentHeight + queueItemFrame:GetHeight() + 2;
+-- self:debug("UpdateQueue: height="..height);
+-- CauldronQueueFrameScrollFrameQueueSectionsReagents:SetHeight(reagentHeight);
+
+ -- show the frame
+ queueItemFrame:Show();
+ end
+
+ -- hide any remaining frames
+ j = #reagentList + 1;
+ while true do
+ local frame = _G["CauldronQueueReagentItem"..j];
+ if not frame then
+ break;
+ end
+
+-- _G["CauldronQueueReagentItem"..j] = nil;
+
+ frame:SetParent(nil);
+-- frame:SetAlpha(0.0);
+ frame:Hide();
+-- frame:SetHeight(0);
+
+-- frame = nil;
+
+ j = j + 1;
+ end
+--]]
+ -- adjust the height of the scroll frame
+ local h = CauldronQueueFrameScrollFrameQueueSectionsMainItemsHeader:GetHeight() +
+ CauldronQueueFrameScrollFrameQueueSectionsMainItems:GetHeight() +
+ CauldronQueueFrameScrollFrameQueueSectionsSecondaryItemsHeader:GetHeight() +
+ CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems:GetHeight() +
+ CauldronQueueFrameScrollFrameQueueSectionsReagentsHeader:GetHeight() +
+ CauldronQueueFrameScrollFrameQueueSectionsReagents:GetHeight();
+ CauldronQueueFrameScrollFrameQueueSections:SetHeight(h);
+ CauldronQueueFrameScrollFrame:UpdateScrollChildRect();
+
+end
+
diff --git a/CauldronTradeskill.lua b/CauldronTradeskill.lua
index f1f6f15..9efcb7a 100644
--- a/CauldronTradeskill.lua
+++ b/CauldronTradeskill.lua
@@ -3,18 +3,68 @@
local L = LibStub("AceLocale-3.0"):GetLocale("Cauldron")
+function Cauldron:NeedsSkillUpdate()
+
+-- Cauldron:info("checking for skill update");
+
+ if CURRENT_TRADESKILL == "UNKNOWN" or CURRENT_TRADESKILL == "" then
+-- Cauldron:info("no current tradeskill; no update needed");
+ return false;
+ end
+ local skillName = CURRENT_TRADESKILL;
+
+ -- initialize the trade skill entry
+ if not Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[skillName] then
+ Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[skillName] = {};
+-- Cauldron:info("no skill entry; update needed");
+ return true;
+ end
+
+ -- initialize the reagent map
+ if not Cauldron.db.realm.userdata[Cauldron.vars.playername].reagentMap then
+ Cauldron.db.realm.userdata[Cauldron.vars.playername].reagentMap = {};
+-- Cauldron:info("no reagent map; update needed");
+ return true;
+ end
+
+ -- save the skill entry in a local var
+ local skillDB = Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[skillName];
+ if not skillDB.recipes then
+ skillDB.recipes = {};
+ end
+
+ local numTradeSkills = GetNumTradeSkills();
+ local name, rank, maxRank = GetTradeSkillLine();
+
+ if (tonumber(numTradeSkills) ~= tonumber(skillDB.skillCount)) then
+-- Cauldron:info("skill count mismatch; update needed");
+ return true;
+ end
+ if (tonumber(rank) ~= tonumber(skillDB.skillLevel)) then
+-- Cauldron:info("skill level mismatch; update needed");
+ return true;
+ end
+ if ((time() - tonumber(skillDB.lastScanDate)) > 184000) then
+-- Cauldron:info("time since last scan > 184000 seconds; update needed");
+ end
+
+-- Cauldron:info("all checks passed; no updated needed");
+ return false;
+end
+
function Cauldron:UpdateSkills()
self:debug("UpdateSkills enter");
-- self:info("updating skills: "..debugstack());
--- self:info("updatingSkills="..tostring(self.updatingSkills));
+-- Cauldron:info("updatingSkills="..tostring(self.updatingSkills));
if not self.updatingSkills then
self:debug("not updating skills; return");
return;
end
- local skillName = GetTradeSkillLine();
+ local numTradeSkills = GetNumTradeSkills();
+ local skillName, rank, maxRank = GetTradeSkillLine();
local baseSkillName = skillName;
self:debug("UpdateSkills: skillName="..skillName);
@@ -22,6 +72,7 @@ function Cauldron:UpdateSkills()
return;
end
+-- Cauldron:info("scanningSkills="..tostring(self.scanningSkills));
if not Cauldron.scanningSkills then
Cauldron.scanningSkills = true;
@@ -46,6 +97,11 @@ function Cauldron:UpdateSkills()
skillDB.recipes = {};
end
+ -- record skill stats
+ skillDB.skillLevel = rank;
+ skillDB.skillCount = numTradeSkills;
+ skillDB.lastScanDate = time();
+
local rescanNotify = false;
-- initialize window information, if necessary
@@ -80,6 +136,18 @@ function Cauldron:UpdateSkills()
-- make sure we're getting a full list
SetTradeSkillItemNameFilter(nil);
SetTradeSkillItemLevelFilter(0, 0);
+ TradeSkillOnlyShowSkillUps(false);
+ TradeSkillOnlyShowMakeable(false);
+ --[[
+ local slots = { GetTradeSkillSubClassFilteredSlots(0) };
+ for i,slot in pairs(slots) do
+ SetTradeSkillInvSlotFilter(i, 0, 0);
+ end
+ local subClasses = { GetTradeSkillSubClasses() };
+ for i,subClass in pairs(subClasses) do
+ SetTradeSkillSubClassFilter(i, 0, 0);
+ end
+ --]]
local category = "";
@@ -260,11 +328,15 @@ function Cauldron:UpdateSkills()
Cauldron.scanningSkills = false;
end
+ --[[
if rescanNotify then
Cauldron:error(L["Cauldron had issues with some recipes for this profession."]);
local msg = string.format(L["Please close and re-open the %1$s window again to re-scan."], baseSkillName);
Cauldron:info(msg);
end
+ --]]
+
+ self.updatingSkills = false;
self:debug("UpdateSkills exit");
end
@@ -354,16 +426,15 @@ function Cauldron:GetSkillList(playername, skillName)
if (not playername) or
(not skillName) then
self:warn("GetSkillList: playername ("..tostring(playername)..") or skillName ("..tostring(skillName)..") not set!");
- return;
+ return {};
end
if (not self.db.realm.userdata[playername]) or
(not self.db.realm.userdata[playername].skills[skillName]) then
- return;
+ return {};
end
local skills = {};
---[====[
for name, recipe in pairs(self.db.realm.userdata[playername].skills[skillName].recipes) do
self:debug("GetSkillList: name="..name);
@@ -583,7 +654,6 @@ function Cauldron:GetSkillList(playername, skillName)
--@alpha@
self:debug("GetSkillList exit");
---]====]
return skills;
end