From 4415c61629cae1785084b5de182ccc9856864fd7 Mon Sep 17 00:00:00 2001 From: Paul Schifferer Date: Wed, 15 Dec 2010 22:37:28 -0800 Subject: [PATCH] Added paging controls to the skill list, since it was the main performance bottleneck when the skill window first opens. This should eliminate the last of the performance issues. --- CauldronMain.lua | 48 +++++++++++++++++++- CauldronMain.xml | 111 +++++++++++++++++++++++++++++++++++++++++++-- CauldronMainUI.lua | 113 +++++++++++++++++++++++++++++++++++----------- CauldronTradeskill.lua | 67 ++++++++++++++++++++++----- Locale/Cauldron-enUS.lua | 2 + 5 files changed, 298 insertions(+), 43 deletions(-) diff --git a/CauldronMain.lua b/CauldronMain.lua index cf0097e..54d6334 100644 --- a/CauldronMain.lua +++ b/CauldronMain.lua @@ -962,6 +962,51 @@ function Cauldron:IncreaseItemCount(name) CauldronQueue:AdjustItemCount(Cauldron:GetQueue(), name, 1); end +function Cauldron:PrevPage() + + local skillName = CURRENT_TRADESKILL; + if skillName == "UNKNOWN" then + return; + end + if IsTradeSkillLinked() then + skillName = "Linked-"..skillName; + end + if IsTradeSkillGuild() then + skillName = "Guild-"..skillName; + end + + local offset = self.db.realm.userdata[self.vars.playername].skills[skillName].window.offset; + if not offset then + self.db.realm.userdata[self.vars.playername].skills[skillName].window.offset = 0; + else + self.db.realm.userdata[self.vars.playername].skills[skillName].window.offset = math.max(0, offset - CAULDRON_SKILL_LIST_MAX); + end +end + +function Cauldron:NextPage() + + local skillName = CURRENT_TRADESKILL; + if skillName == "UNKNOWN" then + return; + end + if IsTradeSkillLinked() then + skillName = "Linked-"..skillName; + end + if IsTradeSkillGuild() then + skillName = "Guild-"..skillName; + end + + local offset = self.db.realm.userdata[self.vars.playername].skills[skillName].window.offset; + local numSkills = self.db.realm.userdata[self.vars.playername].skills[skillName].skillCount or 0; + if not offset then + self.db.realm.userdata[self.vars.playername].skills[skillName].window.offset = CAULDRON_SKILL_LIST_MAX; + else + if (offset + CAULDRON_SKILL_LIST_MAX) <= numSkills then + self.db.realm.userdata[self.vars.playername].skills[skillName].window.offset = offset + CAULDRON_SKILL_LIST_MAX; + end + end +end + function Cauldron:GetQueue(player) if not player then @@ -1175,6 +1220,7 @@ function filterSkillups(skillList) end function Cauldron:SetTradeSkillItem(tooltip, itemIndex, reagentIndex) +--[[ local link; local name; if reagentIndex then @@ -1194,7 +1240,7 @@ function Cauldron:SetTradeSkillItem(tooltip, itemIndex, reagentIndex) -- link = GetTradeSkillItemLink(itemIndex); -- name = Cauldron:GetIdFromLink(link); end - +--]] tooltip:Show(); end diff --git a/CauldronMain.xml b/CauldronMain.xml index beef364..f0a1aef 100755 --- a/CauldronMain.xml +++ b/CauldronMain.xml @@ -412,7 +412,7 @@ - + @@ -427,7 +427,28 @@ - + + + + + + + + + + + + + + + + + + + + + + @@ -780,7 +801,7 @@ - + @@ -811,7 +832,7 @@ - + @@ -823,6 +844,88 @@ + + + + + + + + + + + + + + + + + + + + + + + +