diff --git a/CauldronMain.xml b/CauldronMain.xml index c9cbaee..277e23e 100755 --- a/CauldronMain.xml +++ b/CauldronMain.xml @@ -62,8 +62,7 @@ </Button> <!-- Template: Reagent detail (small) --> - <Button name="CauldronReagentDetailSmallTemplate" virtual="true"> - <Size x="16" y="16" /> + <Button name="CauldronReagentDetailSmallTemplate" virtual="true" hidden="true"> <Layers> <Layer level="BACKGROUND"> <Texture name="$parentIconTexture"> @@ -76,6 +75,7 @@ </Texture> </Layer> <Layer level="ARTWORK"> + <!-- <FontString name="$parentCount" inherits="NumberFontNormal" justifyH="RIGHT"> <Anchors> <Anchor point="BOTTOMRIGHT" relativeTo="$parentIconTexture"> @@ -83,15 +83,14 @@ </Anchor> </Anchors> </FontString> + --> </Layer> </Layers> + <!-- <Scripts> - <OnLoad> --- self:SetScale(0.5); - </OnLoad> <OnEnter> GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT"); - -- GameTooltip:SetHyperlink(self.link); + - - GameTooltip:SetHyperlink(self.link); GameTooltip:SetTradeSkillItem(self.skillIndex, self.reagentIndex); CursorUpdate(self); </OnEnter> @@ -106,6 +105,7 @@ HandleModifiedItemClick(self.link); </OnClick> </Scripts> + --> </Button> <!-- Template: Skill category header --> @@ -242,22 +242,23 @@ </Scripts> </Button> <Frame name="$parentReagents"> - <Size x="70" y="37" /> + <Size x="73" y="37" /> <Anchors> <Anchor point="LEFT" relativeTo="$parentSkillIcon" relativePoint="RIGHT"> - <Offset x="0" y="0"/> + <Offset x="375" y="1"/> </Anchor> </Anchors> <Frames> - <!-- <Button name="$parentItemDetail1" inherits="CauldronReagentDetailSmallTemplate" id="1"> + <Size x="16" y="16" /> <Anchors> <Anchor point="TOPLEFT"> - <Offset x="0" y="-1"/> + <Offset x="0" y="0"/> </Anchor> </Anchors> </Button> <Button name="$parentItemDetail2" inherits="CauldronReagentDetailSmallTemplate" id="2"> + <Size x="15" y="15" /> <Anchors> <Anchor point="LEFT" relativeTo="$parentItemDetail1" relativePoint="RIGHT"> <Offset x="1" y="0"/> @@ -265,13 +266,15 @@ </Anchors> </Button> <Button name="$parentItemDetail3" inherits="CauldronReagentDetailSmallTemplate" id="3"> + <Size x="15" y="15" /> <Anchors> - <Anchor point="TOP" relativeTo="$parentItemDetail1" relativePoint="BOTTOM"> - <Offset x="0" y="-1"/> + <Anchor point="LEFT" relativeTo="$parentItemDetail2" relativePoint="RIGHT"> + <Offset x="1" y="0"/> </Anchor> </Anchors> </Button> <Button name="$parentItemDetail4" inherits="CauldronReagentDetailSmallTemplate" id="4"> + <Size x="15" y="15" /> <Anchors> <Anchor point="LEFT" relativeTo="$parentItemDetail3" relativePoint="RIGHT"> <Offset x="1" y="0"/> @@ -279,13 +282,15 @@ </Anchors> </Button> <Button name="$parentItemDetail5" inherits="CauldronReagentDetailSmallTemplate" id="5"> + <Size x="15" y="15" /> <Anchors> - <Anchor point="TOP" relativeTo="$parentItemDetail3" relativePoint="BOTTOM"> + <Anchor point="TOP" relativeTo="$parentItemDetail1" relativePoint="BOTTOM"> <Offset x="0" y="-1"/> </Anchor> </Anchors> </Button> <Button name="$parentItemDetail6" inherits="CauldronReagentDetailSmallTemplate" id="6"> + <Size x="15" y="15" /> <Anchors> <Anchor point="LEFT" relativeTo="$parentItemDetail5" relativePoint="RIGHT"> <Offset x="1" y="0"/> @@ -293,80 +298,88 @@ </Anchors> </Button> <Button name="$parentItemDetail7" inherits="CauldronReagentDetailSmallTemplate" id="7"> + <Size x="15" y="15" /> <Anchors> - <Anchor point="TOP" relativeTo="$parentItemDetail7" relativePoint="BOTTOM"> - <Offset x="0" y="-1"/> + <Anchor point="LEFT" relativeTo="$parentItemDetail6" relativePoint="RIGHT"> + <Offset x="1" y="0"/> </Anchor> </Anchors> </Button> <Button name="$parentItemDetail8" inherits="CauldronReagentDetailSmallTemplate" id="8"> + <Size x="15" y="15" /> <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" /> + <Size x="110" y="37" /> <Anchors> <Anchor point="TOPRIGHT"> - <Offset x="-55" y="0" /> + <Offset x="-140" y="0" /> </Anchor> </Anchors> <Layers> <Layer level="OVERLAY"> - <FontString name="$parentCount" inherits="GameFontNormalLarge" - justifyH="CENTER" justifyV="CENTER"> - <Size x="40" y="37"/> + <FontString name="$parentAchievement" inherits="GameFontNormal" + justifyH="CENTER" justifyV="CENTER" text="A"> + <Size x="10" y="37"/> <Anchors> - <Anchor point="RIGHT" relativeTo="$parentMiscInfo" relativePoint="RIGHT"> - <Offset x="0" y="0"/> + <Anchor point="LEFT" relativeTo="$parentMiscInfo" relativePoint="LEFT"> + <Offset x="20" 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"> + justifyH="CENTER" justifyV="CENTER" text="0"> <Size x="16" y="18"/> <Anchors> - <Anchor point="TOPLEFT" relativeTo="$parentMiscInfo" relativePoint="TOPLEFT"> - <Offset x="35" y="-18"/> + <Anchor point="LEFT" relativeTo="$parentMiscInfo" relativePoint="LEFT"> + <Offset x="50" y="-18"/> </Anchor> </Anchors> </FontString> - <FontString name="$parentAchievement" inherits="GameFontNormal" - justifyH="CENTER" justifyV="CENTER" text="A"> - <Size x="10" y="37"/> + <FontString name="$parentCount" inherits="GameFontNormalLarge" + justifyH="CENTER" justifyV="CENTER"> + <Size x="40" y="37"/> <Anchors> - <Anchor point="TOPLEFT" relativeTo="$parentMiscInfo" relativePoint="TOPLEFT"> - <Offset x="25" y="0"/> + <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> - --> </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"/> + <Button name="$parentCooldown"> + <Size x="16" y="16" /> + <Anchors> + <Anchor point="LEFT" relativeTo="$parentMiscInfo" relativePoint="LEFT"> + <Offset x="0" y="0"/> </Anchor> - </Anchors> - </Button> + </Anchors> + <Layers level="OVERLAY"> + <Texture name="$parentTextureIcon" file="Interface\AddOns\Cauldron\Artwork\Cooldown" alphaMode="ADD"> + <Color r="0.7" g="0.7" b="0.7" a="0.5" /> + </Texture> + </Layers> + </Button> + <Frame> + <Size x="16" y="16" /> + <Anchors> + <Anchor point="LEFT" relativeTo="$parentMiscInfo" relativePoint="LEFT"> + <Offset x="34" y="0"/> + </Anchor> + </Anchors> + <Layers level="OVERLAY"> + <Texture name="$parentNumSkillUpsIcon" file="Interface\TradeSkillFrame\UI-TradeSkill-Multiskill"> + </Texture> + </Layers> + </Frame> </Frames> </Frame> <Frame name="$parentSelection" setAllPoints="true" enableMouse="true" hidden="true" frameStrata="LOW" frameLevel="1"> @@ -832,17 +845,20 @@ <!-- Tradeskill unlearn button --> <!-- Status text --> - <Frame name="CauldronStatusFrame" drawLayer="BACKGROUND"> - <Size x="500" y="20" /> + <Frame name="CauldronStatusFrame"> + <Size x="535" y="20" /> <Anchors> <Anchor point="TOPLEFT"> - <Offset x="10" y="-75" /> + <Offset x="7" y="-75" /> </Anchor> </Anchors> <Layers> <Layer level="ARTWORK"> - <FontString name="CauldronStatusText" inherits="GameFontNormal" justifyH="LEFT" text=""> - <Size x="300" y="20" /> + <Texture urgency="5" file="Interface\Buttons\UI-Listbox-Highlight2"> + <Color r="0.6" g="0.75" b="1.0" a="0.5" /> + </Texture> + <FontString name="CauldronStatusText" inherits="GameFontHighlight" justifyH="LEFT" text=""> + <Size x="520" y="20" /> <Anchors> <Anchor point="TOPLEFT"> <Offset x="0" y="0" /> @@ -852,6 +868,49 @@ </FontString> </Layer> </Layers> + <Frames> + <Button name="CauldronStatusExitButton"> + <Size x="17" y="17"/> + <Anchors> + <Anchor point="RIGHT" x="-2" y="0"/> + </Anchors> + <Layers> + <Layer level="ARTWORK"> + <Texture file="Interface\FriendsFrame\ClearBroadcastIcon" alpha="0.5" parentKey="texture"> + <Size x="17" y="17"/> + <Anchors> + <Anchor point="TOPLEFT" x="0" y="0"/> + </Anchors> + </Texture> + </Layer> + </Layers> + <Scripts> + <OnEnter> + self.texture:SetAlpha(1.0); + </OnEnter> + <OnLeave> + self.texture:SetAlpha(0.5); + </OnLeave> + <OnMouseDown> + self.texture:SetPoint("TOPLEFT", 1, -1); + </OnMouseDown> + <OnMouseUp> + self.texture:SetPoint("TOPLEFT", 0, 0); + </OnMouseUp> + <OnClick> + --[[ + TradeSkillFrame.filterTbl = {hasMaterials = false, hasSkillUp = false, subClassValue = -1, slotValue = -1 }; + TradeSkillOnlyShowSkillUps(TradeSkillFrame.filterTbl.hasSkillUp); + TradeSkillOnlyShowMakeable(TradeSkillFrame.filterTbl.hasMaterials); + SetTradeSkillSubClassFilter(TradeSkillFrame.filterTbl.subClassValue, 1, 1); + SetTradeSkillInvSlotFilter(TradeSkillFrame.filterTbl.slotValue, 1, 1); + TradeSkillUpdateFilterBar(); + CloseDropDownMenus(); + --]] + </OnClick> + </Scripts> + </Button> + </Frames> </Frame> <!-- Filter menu --> @@ -984,12 +1043,13 @@ <TexCoords left="0" right="0.484375" top="0" bottom="1.0"/> </Texture> <Texture name="CauldronQueueFrameScrollBackgroundBottomRight" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar"> - <Size x="31" y="206"/> + <Size x="31" y="106"/> <Anchors> <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT"> <Offset x="-2" y="-2"/> </Anchor> </Anchors> + <!-- TexCoords left="0.515625" right="1.0" top="0" bottom="0.4140625"/ --> <TexCoords left="0.515625" right="1.0" top="0" bottom="0.4140625"/> </Texture> </Layer> diff --git a/CauldronMainUI.lua b/CauldronMainUI.lua index a824951..1093fbd 100644 --- a/CauldronMainUI.lua +++ b/CauldronMainUI.lua @@ -25,6 +25,7 @@ function CauldronFrame_OnHide() end function CauldronSearch_OnTextChanged() + Cauldron:TradeSkillFilter_OnTextChanged(CauldronSearchBox); end function CauldronFrame_Update() @@ -186,11 +187,12 @@ function Cauldron:Frame_Update() -- display skill name, level/progress self:UpdateSkillInfo(name, rank, maxRank); ---[==[ -- update search text box self:UpdateSearchText(); - -- TODO: update dropdowns +--[==[ + -- TODO: update filter information + self:UpdateStatus(); self:UpdateFilterDropDowns(); --]==] @@ -233,7 +235,6 @@ end function Cauldron:UpdateSearchText() ---[==[ local skillName = CURRENT_TRADESKILL; if IsTradeSkillLinked() then skillName = "Linked-"..skillName; @@ -250,9 +251,64 @@ function Cauldron:UpdateSearchText() if searchText == "" then searchText = SEARCH; end - CauldronFiltersSearchEditBox:SetText(searchText); ---]==] + CauldronSearchBox:SetText(searchText); + +end +function Cauldron:UpdateStatus() + + local filters = {}; + + local filterTable = Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[skillName].window.filter; + --[[ + ["sortAlpha"] = false, -- should the list be sorted alphabetically (mutually-exclusive to "sortDifficulty" and "sortBenefit") + ["sortDifficulty"] = true, -- should the list be sorted by difficulty (mutually-exclusive to "sortAlpha" and "sortBenefit") + ["sortBenefit"] = false, -- should the list be sorted by potentcy of the benefit the crafted item/enchantment grants (mutually-exclusive to "sortDifficulty" and "sortAlpha") UNUSED + ["haveAllReagents"] = false, -- should only items with all required reagents be shown in the list? + ["haveKeyReagents"] = false, -- should only items with all key reagents be shown in the list? + ["haveAnyReagents"] = false, -- should only items with any reagents be shown in the list? + ["optimal"] = true, -- should optimal skills be shown? + ["medium"] = true, -- should medium skills be shown? + ["easy"] = true, -- should easy skills be shown? + ["trivial"] = false, -- should trivial skills be shown? + ["favorites"] = false, -- should only favorite skills be shown? + --]] + if filterTable.haveAllReagents then + table.insert(filters, "All reagents"); + elseif filterTable.haveKeyReagents then + table.insert(filters, "Key reagents"); + elseif filterTable.haveAnyReagents then + table.insert(filters, "Any reagents"); + end + + local difficulties = {}; + if filterTable.optimal then + table.insert(difficulties, "optimal"); + end + if filterTable.medium then + table.insert(difficulties, "medium"); + end + if filterTable.easy then + table.insert(difficulties, "easy"); + end + if filterTable.trivial then + table.insert(difficulties, "trivial"); + end + if #difficulties > 0 then + table.insert(filters, Cauldron:JoinStrings(difficulties, ",")); + end + + if filterTable.favorites then + table.insert(filters, "Favorites"); + end + + if #filters > 0 then + local statusText = Cauldron:JoinStrings(filters, "; "); + CauldronStatusText:SetText(statusText); + CauldronStatusText:Show(); + else + CauldronStatusText:Hide(); + end end function Cauldron:UpdateFilterDropDowns() @@ -467,7 +523,6 @@ function Cauldron:UpdateSkillList() 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 diff --git a/CauldronQueue.xml b/CauldronQueue.xml index 08a50c5..17d0a67 100644 --- a/CauldronQueue.xml +++ b/CauldronQueue.xml @@ -420,7 +420,7 @@ </Anchors> <Frames> <Frame name="CauldronQueueFrameScrollFrameQueueSectionsMainItemsHeader"> - <Size x="300" y="12" /> + <Size x="300" y="16" /> <Anchors> <Anchor point="TOPLEFT"> <Offset x="0" y="0" /> @@ -428,13 +428,18 @@ </Anchors> <Layers> <Layer level="OVERLAY"> - <FontString name="$parentText" inherits="QuestFont" text=""> + <Texture urgency="5" file="Interface\Buttons\UI-Listbox-Highlight2"> + <Color r="0.6" g="0.75" b="1.0" a="0.5" /> + </Texture> + <FontString name="$parentText" inherits="QuestFontHighlight" text="" + justifyV="CENTER" justifyH="CENTER"> + <Size x="300" y="16" /> <Anchors> <Anchor point="TOPLEFT"> <Offset x="0" y="0" /> </Anchor> </Anchors> - <Color r="0.6" g="0.6" b="0.6" /> + <Color r="0.8" g="0.8" b="0.8" /> </FontString> </Layer> </Layers> @@ -448,7 +453,7 @@ </Anchors> </Frame> <Frame name="CauldronQueueFrameScrollFrameQueueSectionsSecondaryItemsHeader"> - <Size x="300" y="20" /> + <Size x="300" y="16" /> <Anchors> <Anchor point="TOPLEFT" relativeTo="$parentMainItems" relativePoint="BOTTOMLEFT"> <Offset x="0" y="-2" /> @@ -456,15 +461,18 @@ </Anchors> <Layers> <Layer level="OVERLAY"> - <FontString name="$parentText" inherits="QuestFont" text="" - justifyV="BOTTOM" justifyH="LEFT"> - <Size x="300" y="20" /> + <Texture urgency="5" file="Interface\Buttons\UI-Listbox-Highlight2"> + <Color r="0.6" g="0.75" b="1.0" a="0.5" /> + </Texture> + <FontString name="$parentText" inherits="QuestFontHighlight" text="" + justifyV="CENTER" justifyH="CENTER"> + <Size x="300" y="16" /> <Anchors> <Anchor point="TOPLEFT"> <Offset x="0" y="0" /> </Anchor> </Anchors> - <Color r="0.6" g="0.6" b="0.6" /> + <Color r="0.8" g="0.8" b="0.8" /> </FontString> </Layer> </Layers> @@ -478,7 +486,7 @@ </Anchors> </Frame> <Frame name="CauldronQueueFrameScrollFrameQueueSectionsReagentsHeader"> - <Size x="300" y="20" /> + <Size x="300" y="16" /> <Anchors> <Anchor point="TOPLEFT" relativeTo="$parentSecondaryItems" relativePoint="BOTTOMLEFT"> <Offset x="0" y="-2" /> @@ -486,15 +494,18 @@ </Anchors> <Layers> <Layer level="OVERLAY"> - <FontString name="$parentText" inherits="QuestFont" text="" - justifyV="BOTTOM" justifyH="LEFT"> - <Size x="300" y="20" /> + <Texture urgency="5" file="Interface\Buttons\UI-Listbox-Highlight2"> + <Color r="0.6" g="0.75" b="1.0" a="0.5" /> + </Texture> + <FontString name="$parentText" inherits="QuestFontHighlight" text="" + justifyV="CENTER" justifyH="CENTER"> + <Size x="300" y="16" /> <Anchors> <Anchor point="TOPLEFT"> <Offset x="0" y="0" /> </Anchor> </Anchors> - <Color r="0.6" g="0.6" b="0.6" /> + <Color r="0.8" g="0.8" b="0.8" /> </FontString> </Layer> </Layers> diff --git a/CauldronQueueUI.lua b/CauldronQueueUI.lua index 8d42ce5..a54e710 100644 --- a/CauldronQueueUI.lua +++ b/CauldronQueueUI.lua @@ -181,7 +181,7 @@ function Cauldron:UpdateQueue() CauldronQueueFrameScrollFrameQueueSectionsSecondaryItemsHeaderText:SetText(""); CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems:SetHeight(1); else - CauldronQueueFrameScrollFrameQueueSectionsSecondaryItemsHeader:SetHeight(12); + CauldronQueueFrameScrollFrameQueueSectionsSecondaryItemsHeader:SetHeight(16); CauldronQueueFrameScrollFrameQueueSectionsSecondaryItemsHeaderText:SetText(L["You first have to make:"]); CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems:SetHeight(#intQueue * itemFrameHeight); diff --git a/CauldronUtil.lua b/CauldronUtil.lua index 4bb5262..d953fc0 100644 --- a/CauldronUtil.lua +++ b/CauldronUtil.lua @@ -328,3 +328,19 @@ function Cauldron:MarkRecipeForRescan(skillDB, name) -- record the failed recipe skillDB.rescan.failedRecipes[name] = true; end + +function Cauldron:JoinStrings(strings, sep) + + local joinedStr = ""; + + for i,str in ipairs(strings) do + if i > 0 then + joinedStr = joinedStr..sep; + end + + joinedStr = joinedStr..str; + end + + return joinedStr; +end +