Browse Source

TSM/Crafting: Fix nil cost / total cost string

pull/3/head 2.8
Andrew6810 3 years ago
parent
commit
aa1617f4db
  1. 8
      TradeSkillMaster_Crafting/Modules/Cost.lua
  2. 15
      TradeSkillMaster_Crafting/Modules/CraftingGUI.lua

8
TradeSkillMaster_Crafting/Modules/Cost.lua

@ -70,14 +70,6 @@ function Cost:GetCraftCost(itemID)
costIsValid = false costIsValid = false
end end
for matID, matQuantity in pairs(craft.mats) do for matID, matQuantity in pairs(craft.mats) do
local MatName = GetItemInfo(matID)
-- if MatName ~= nil and strfind(MatName, "Vellum") then
-- local NewItemString = CheapestVellum(matID)
-- if matID ~= NewItemString then
-- matID = NewItemString
-- end
-- end
local matCost = Cost:GetMatCost(matID) local matCost = Cost:GetMatCost(matID)
if not matCost or matCost == 0 then if not matCost or matCost == 0 then
costIsValid = false costIsValid = false

15
TradeSkillMaster_Crafting/Modules/CraftingGUI.lua

@ -139,7 +139,7 @@ function GUI:ShowGatheringFrame()
end end
function GUI:ShowProfessionWindow() function GUI:ShowProfessionWindow()
if not TradeSkillFrame then return TSMAPI:CreateTimeDelay("craftingShowProfessionDelay", 0, GUI.ShowProfessionWindow) end if not TradeSkillFrame and not AscensionTradeSkillFrame then return TSMAPI:CreateTimeDelay("craftingShowProfessionDelay", 0, GUI.ShowProfessionWindow) end
-- if GetTradeSkillLine() == GetSpellInfo(53428) or IsTradeSkillGuild() then -- if GetTradeSkillLine() == GetSpellInfo(53428) or IsTradeSkillGuild() then
if GetTradeSkillLine() == GetSpellInfo(53428) then if GetTradeSkillLine() == GetSpellInfo(53428) then
-- runeforging or guild profession -- runeforging or guild profession
@ -153,6 +153,9 @@ function GUI:ShowProfessionWindow()
end end
return return
end end
AscensionTradeSkillFrame:UnregisterEvent("TRADE_SKILL_SHOW")
AscensionTradeSkillFrame:OpenOldUI()
GUI:ShowSwitchButton() GUI:ShowSwitchButton()
if TSM.db.global.showingDefaultFrame then return end if TSM.db.global.showingDefaultFrame then return end
@ -647,16 +650,16 @@ function GUI:CreateQueueFrame(parent)
GameTooltip:AddLine(" ") GameTooltip:AddLine(" ")
if moneyCoinsTooltip then if moneyCoinsTooltip then
GameTooltip:AddLine("Crafting Cost: " .. (TSMAPI:FormatTextMoneyIcon(cost, "|cffffff00"))) GameTooltip:AddLine("Crafting Cost: " .. (TSMAPI:FormatTextMoneyIcon(cost, "|cffffff00") or "---"))
else else
GameTooltip:AddLine("Crafting Cost: " .. (TSMAPI:FormatTextMoney(cost, "|cffffff00"))) GameTooltip:AddLine("Crafting Cost: " .. (TSMAPI:FormatTextMoney(cost, "|cffffff00") or "---"))
end end
if data.numQueued>1 then if data.numQueued>1 then
local totalcost = cost * data.numQueued local totalcost = cost and cost * data.numQueued
if moneyCoinsTooltip then if moneyCoinsTooltip then
GameTooltip:AddLine("Total Cost: " .. (TSMAPI:FormatTextMoneyIcon(totalcost, "|cffffff00"))) GameTooltip:AddLine("Total Cost: " .. (TSMAPI:FormatTextMoneyIcon(totalcost, "|cffffff00") or "---"))
else else
GameTooltip:AddLine("Total Cost: " .. (TSMAPI:FormatTextMoney(totalcost, "|cffffff00"))) GameTooltip:AddLine("Total Cost: " .. (TSMAPI:FormatTextMoney(totalcost, "|cffffff00") or "---"))
end end
end end

Loading…
Cancel
Save