This commit is contained in:
Andrew6810
2023-03-30 12:32:45 -07:00
parent f3e579cb57
commit d6aaac97af
53 changed files with 2930 additions and 1307 deletions
@@ -675,13 +675,19 @@ function GUI:CreateQueueFrame(parent)
if strfind(name, "Vellum") then
velName = name
end
if (velName ~= nil) then
if strfind(velName, "Weapon") then
itemIDx = "item:52511:0:0:0:0:0:0"
name = TSMAPI:GetSafeItemInfo(itemIDx)
if (velName ~= nil) and (not strfind(velName, "III")) then
local VellumReplacePrice = TSM.Cost:GetMatCost(itemIDx)
if strfind(velName, "Weapon Vellum") then
if VellumReplacePrice > TSM.Cost:GetMatCost("item:43146:0:0:0:0:0:0") then
itemIDx = "item:43146:0:0:0:0:0:0"
name = TSMAPI:GetSafeItemInfo(itemIDx)
end
else
itemIDx = "item:52510:0:0:0:0:0:0"
name = TSMAPI:GetSafeItemInfo(itemIDx)
if VellumReplacePrice > TSM.Cost:GetMatCost("item:43145:0:0:0:0:0:0") then
itemIDx = "item:43145:0:0:0:0:0:0"
name = TSMAPI:GetSafeItemInfo(itemIDx)
end
end
end
@@ -1449,7 +1455,7 @@ function GUI:CreateCraftInfoFrame(parent)
-- Enable display of items created
local lNum, hNum = GetTradeSkillNumMade(skillIndex)
local numMade = floor(((lNum or 1) + (hNum or 1)) / 2)
if altVerb ~= nil and strfind(name,"Enchant ") then
if altVerb == ENSCRIBE then
numMade = 1
end
if numMade > 1 then
@@ -1486,14 +1492,15 @@ function GUI:CreateCraftInfoFrame(parent)
end
end
-- if altVerb == ENSCRIBE then
if altVerb ~= nil and strfind(name,"Enchant ") then
if altVerb == ENSCRIBE then
createAllBtn:SetText(L["Enchant Vellum"])
-- createAllBtn.vellum = TSMAPI:GetSafeItemInfo("item:38682:0:0:0:0:0:0")
if strfind(name, "Weapon") or strfind(name, "Staff") then
createAllBtn.vellum = TSMAPI:GetSafeItemInfo("item:52511:0:0:0:0:0:0") -- Weapon Vellum
createAllBtn.vellum = TSMAPI:GetSafeItemInfo("item:43146:0:0:0:0:0:0") -- Weapon Vellum III
else
createAllBtn.vellum = TSMAPI:GetSafeItemInfo("item:52510:0:0:0:0:0:0") -- Armor Vellum
createAllBtn.vellum = TSMAPI:GetSafeItemInfo("item:43145:0:0:0:0:0:0") -- Armor Vellum III
end
else
createAllBtn:SetText(CREATE_ALL)
createAllBtn.vellum = nil
@@ -1817,6 +1824,12 @@ function GUI:UpdateQueue()
canCraft = min(canCraft, floor(numHave / quantity))
end
-- local velName
-- local VELLUM_ID = "item:38682:0:0:0:0:0:0"
-- if TSM.db.factionrealm.crafts[spellID].mats[VELLUM_ID] then
-- velName = GetItemInfo(VELLUM_ID) or TSM.db.factionrealm.mats[VELLUM_ID].name
-- end
local color
local craftIndex = skillIndexLookup[spellID]
if canCraft >= numQueued then
@@ -2740,7 +2753,7 @@ end
function CheapestVellum(itemPassed)
-- Return one of the two vellum available
-- Get Cheapest vellum, lower vellum types can be replaced by III
local MatName = GetItemInfo(itemPassed)
-- MatName is sometimes nil ???
if MatName ~= nil then
@@ -2748,11 +2761,12 @@ function CheapestVellum(itemPassed)
if strfind(MatName, "Vellum") then
velName = MatName
end
if (velName ~= nil) then
if strfind(velName, "Weapon") then
itemPassed = "item:52511:0:0:0:0:0:0"
if (velName ~= nil) and (not strfind(velName, "III")) then
local VellumReplacePrice = TSM.Cost:GetMatCost(itemPassed) or 0
if strfind(velName, "Weapon Vellum") then
if VellumReplacePrice > (TSM.Cost:GetMatCost("item:43146:0:0:0:0:0:0") or 0) then itemPassed = "item:43146:0:0:0:0:0:0" end
else
itemPassed = "item:52510:0:0:0:0:0:0"
if VellumReplacePrice > (TSM.Cost:GetMatCost("item:43145:0:0:0:0:0:0") or 0) then itemPassed = "item:43145:0:0:0:0:0:0" end
end
end
end