diff --git a/SkilletNewsData.lua b/SkilletNewsData.lua index b243e08..0293571 100644 --- a/SkilletNewsData.lua +++ b/SkilletNewsData.lua @@ -26,6 +26,15 @@ local isCata = WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC Skillet.NewsName = "Skillet-Classic News" Skillet.NewsData = { + { version = "1.96", + data = { + { name = "Fixes", + data = { + { header = "Display required level", body = "Fixes for issues #181, #182" }, + }, + }, + }, + }, { version = "1.95", data = { { name = "Fixes", diff --git a/UI/MainFrame.lua b/UI/MainFrame.lua index 0f4e4e4..aa87e70 100644 --- a/UI/MainFrame.lua +++ b/UI/MainFrame.lua @@ -675,16 +675,14 @@ function Skillet:TradeButton_OnEnter(button) local rank, maxRank = data.rank, data.maxRank GameTooltip:AddLine("["..tostring(rank).."/"..tostring(maxRank).."]",0,1,0) if tradeID == self.currentTrade then + local link if GetTradeSkillListLink then - local link = GetTradeSkillListLink() - if link then - GameTooltip:AddLine(L["shift-click to link"]) - elseif C_TradeSkillUI then - link = C_TradeSkillUI.GetTradeSkillListLink() - if link then - GameTooltip:AddLine(L["shift-click to link"]) - end - end + link = GetTradeSkillListLink() + elseif C_TradeSkillUI.GetTradeSkillListLink then + link = C_TradeSkillUI.GetTradeSkillListLink() + end + if link then + GameTooltip:AddLine(L["shift-click to link"]) end end local buttonIcon = _G[button:GetName().."Icon"] @@ -722,16 +720,14 @@ function Skillet:TradeButton_OnClick(this,button) if button == "LeftButton" then if player == self.currentPlayer and self.currentTrade then if self.currentTrade == tradeID and IsShiftKeyDown() then + local link if GetTradeSkillListLink then - local link = GetTradeSkillListLink() - if link then - ChatEdit_InsertLink(link) - elseif C_TradeSkillUI then - link = C_TradeSkillUI.GetTradeSkillListLink() - if link then - ChatEdit_InsertLink(link) - end - end + link = GetTradeSkillListLink() + elseif C_TradeSkillUI.GetTradeSkillListLink then + link = C_TradeSkillUI.GetTradeSkillListLink() + end + if link then + ChatEdit_InsertLink(link) end elseif self.currentTrade ~= tradeID then if self.skillIsCraft[self.currentTrade] ~= self.skillIsCraft[tradeID] then diff --git a/UI/Sorting.lua b/UI/Sorting.lua index 2de68fb..392f856 100644 --- a/UI/Sorting.lua +++ b/UI/Sorting.lua @@ -74,24 +74,29 @@ local function sort_recipe_by_skill_level(tradeskill, a, b) end local function sort_recipe_by_item_level(tradeskill, a, b) + local left_r, left, right_r, right, _ while a.subGroup and #a.subGroup.entries>0 do a = a.subGroup.entries[1] end while b.subGroup and #b.subGroup.entries>0 do b = b.subGroup.entries[1] end - local left_r = Skillet:GetRecipe(a.recipeID) - local right_r = Skillet:GetRecipe(b.recipeID) - local left = Skillet:GetLevelRequiredToUse(left_r.itemID) - local right = Skillet:GetLevelRequiredToUse(right_r.itemID) + left_r = Skillet:GetRecipe(a.recipeID) + right_r = Skillet:GetRecipe(b.recipeID) + left = Skillet:GetLevelRequiredToUse(left_r.itemID) + right = Skillet:GetLevelRequiredToUse(right_r.itemID) if not left then left = 0 end if not right then right = 0 end if left == right then -- -- Same level, try iLevel next -- - local left = select(4,GetItemInfo(left_r.itemID)) or 0 - local right = select(4,GetItemInfo(right_r.itemID)) or 0 + if left_r.itemID then + left = select(4,GetItemInfo(left_r.itemID)) or 0 + end + if right_r.itemID then + right = select(4,GetItemInfo(right_r.itemID)) or 0 + end if left == right then -- -- Same level, sort by difficulty @@ -106,18 +111,21 @@ local function sort_recipe_by_item_level(tradeskill, a, b) end local function sort_recipe_by_item_quality(tradeskill, a, b) + local left_r, left, right_r, right while a.subGroup and #a.subGroup.entries>0 do a = a.subGroup.entries[1] end while b.subGroup and #b.subGroup.entries>0 do b = b.subGroup.entries[1] end - local left_r = Skillet:GetRecipe(a.recipeID) - local right_r = Skillet:GetRecipe(b.recipeID) - local _,_, left = GetItemInfo(left_r.itemID) - local _,_, right = GetItemInfo(right_r.itemID) - if not left then left = 0 end - if not right then right = 0 end + left_r = Skillet:GetRecipe(a.recipeID) + right_r = Skillet:GetRecipe(b.recipeID) + if left_r.itemID then + left = select(3,GetItemInfo(left_r.itemID)) or 0 + end + if right_r.itemID then + right = select(3,GetItemInfo(right_r.itemID)) or 0 + end if left == right then -- -- Same level, sort by level required to use