Skip to content

Commit

Permalink
Updates for 1.14.4 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
b-morgan committed Jul 7, 2023
1 parent 5bc3f78 commit c5e4e21
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 34 deletions.
4 changes: 2 additions & 2 deletions Skillet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Skillet.L = L
local GetAddOnMetadata = C_AddOns and C_AddOns.GetAddOnMetadata or GetAddOnMetadata
Skillet.version = GetAddOnMetadata("Skillet-Classic", "Version")
Skillet.interface = select(4, GetBuildInfo())
Skillet.build = (Skillet.interface < 20000 and "Classic") or (Skillet.interface < 30000 and "BCC") or (Skillet.interface < 40000 and "Wrath") or "Retail"
Skillet.build = (Skillet.interface < 11404 and "Classic") or (Skillet.interface < 20000 and "Classic2") or (Skillet.interface < 30000 and "BCC") or (Skillet.interface < 40000 and "Wrath") or "Retail"
Skillet.project = WOW_PROJECT_ID
local isRetail = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE
local isClassic = WOW_PROJECT_ID == WOW_PROJECT_CLASSIC
Expand Down Expand Up @@ -1250,7 +1250,7 @@ function Skillet:SkilletShow()
-- Processing will continue in SkilletShowWindow when the TRADE_SKILL_UPDATE or CRAFT_UPDATE event fires
-- (Wrath needs a little help)
--
if isWrath then
if self.build ~= "Classic" then
if self.isCraft then
Skillet:CRAFT_UPDATE()
else
Expand Down
9 changes: 9 additions & 0 deletions SkilletNewsData.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ local isWrath = WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC

Skillet.NewsName = "Skillet-Classic News"
Skillet.NewsData = {
{ version = "1.75",
data = {
{ name = "Changes",
data = {
{ header = "Compatibility", body = "Updates for 1.14.4 compatibility" },
},
},
},
},
{ version = "1.74",
data = {
{ name = "Fixes",
Expand Down
2 changes: 1 addition & 1 deletion UI/IgnoreList.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ local function createIgnoreListFrame(self)
titlebar2:SetPoint("TOPRIGHT",titlebar,"BOTTOMRIGHT",0,0)
titlebar2:SetColorTexture(r,g,b,1)
titlebar2:SetHeight(13)
if isClassic then
if Skillet.build == "Classic" then
titlebar:SetGradientAlpha("VERTICAL",r*0.6,g*0.6,b*0.6,1,r,g,b,1)
titlebar2:SetGradientAlpha("VERTICAL",r*0.9,g*0.9,b*0.9,1,r*0.6,g*0.6,b*0.6,1)
else
Expand Down
4 changes: 2 additions & 2 deletions UI/MainFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ function Skillet:CreateTradeSkillWindow()
titlebar2:SetPoint("TOPRIGHT",titlebar,"BOTTOMRIGHT",0,0)
titlebar2:SetColorTexture(r,g,b,1)
titlebar2:SetHeight(13)
if isClassic then
if Skillet.build == "Classic" then
titlebar:SetGradientAlpha("VERTICAL",r*0.6,g*0.6,b*0.6,1,r,g,b,1)
titlebar2:SetGradientAlpha("VERTICAL",r*0.9,g*0.9,b*0.9,1,r*0.6,g*0.6,b*0.6,1)
else
Expand Down Expand Up @@ -3428,7 +3428,7 @@ function Skillet:CreateStandaloneQueueFrame()
titlebar2:SetPoint("TOPRIGHT",titlebar,"BOTTOMRIGHT",0,0)
titlebar2:SetColorTexture(r,g,b,1)
titlebar2:SetHeight(13)
if isClassic then
if SetGradientAlpha then
titlebar:SetGradientAlpha("VERTICAL",r*0.6,g*0.6,b*0.6,1,r,g,b,1)
titlebar2:SetGradientAlpha("VERTICAL",r*0.9,g*0.9,b*0.9,1,r*0.6,g*0.6,b*0.6,1)
else
Expand Down
53 changes: 25 additions & 28 deletions UI/ShoppingList.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ local function createShoppingListFrame(self)
titlebar2:SetPoint("TOPRIGHT",titlebar,"BOTTOMRIGHT",0,0)
titlebar2:SetColorTexture(r,g,b,1)
titlebar2:SetHeight(13)
if isClassic then
if Skillet.build == "Classic" then
titlebar:SetGradientAlpha("VERTICAL",r*0.6,g*0.6,b*0.6,1,r,g,b,1)
titlebar2:SetGradientAlpha("VERTICAL",r*0.9,g*0.9,b*0.9,1,r*0.6,g*0.6,b*0.6,1)
else
Expand Down Expand Up @@ -325,21 +325,21 @@ local function indexBags()
local bags = {0,1,2,3,4}
for _, container in pairs(bags) do
local slots
if isClassic then
slots = GetContainerNumSlots(container)
else
slots = C_Container.GetContainerNumSlots(container)
end
if GetContainerNumSlots then
slots = GetContainerNumSlots(container)
else
slots = C_Container.GetContainerNumSlots(container)
end
for i = 1, slots, 1 do
local item
if isClassic then
if GetContainerItemLink then
item = GetContainerItemLink(container, i)
else
item = C_Container.GetContainerItemLink(container, i)
end
if item then
local info, id, count
if isClassic then
if GetContainerItemInfo then
info, count = GetContainerItemInfo(container, i)
id = Skillet:GetItemIDFromLink(item)
else
Expand Down Expand Up @@ -390,21 +390,21 @@ local function indexBank()
local bankBags = {-1,5,6,7,8,9,10,11} -- In Classic, there is no reagent bank
for _, container in pairs(bankBags) do
local slots
if isClassic then
if GetContainerNumSlots then
slots = GetContainerNumSlots(container)
else
slots = C_Container.GetContainerNumSlots(container)
end
for i = 1, slots, 1 do
local item
if isClassic then
if GetContainerItemLink then
item = GetContainerItemLink(container, i)
else
item = C_Container.GetContainerItemLink(container, i)
end
if item then
local info, id, count
if isClassic then
if GetContainerItemInfo then
info, count = GetContainerItemInfo(container, i)
id = Skillet:GetItemIDFromLink(item)
else
Expand Down Expand Up @@ -757,7 +757,7 @@ local function findBagForItem(itemID, count)
local _, _, _, _, _, _, _, itemStackCount = GetItemInfo(itemID)
for container = 0, 4, 1 do
local bagSize, freeSlots, bagType
if isClassic then
if GetContainerNumSlots then
bagSize = GetContainerNumSlots(container)
freeSlots, bagType = GetContainerNumFreeSlots(container)
else
Expand All @@ -767,21 +767,18 @@ local function findBagForItem(itemID, count)
--DA.DEBUG(1, "findBagForItem: container= "..tostring(container)..", bagSize= "..tostring(bagSize)..", freeSlots= "..tostring(freeSlots)..", bagType= "..tostring(bagType))
if bagType == 0 then
for slot = 1, bagSize, 1 do
local bagItem, info, num_in_bag, locked
if isClassic then
local info, bagItem, num_in_bag, locked
if GetContainerItemID then
bagItem = GetContainerItemID(container, slot)
info, num_in_bag, locked = GetContainerItemInfo(container, slot)
else
bagItem = C_Container.GetContainerItemLink(container, slot)
info = C_Container.GetContainerItemInfo(container, slot)
--DA.DEBUG(1, "findBagForItem: container= "..tostring(container)..", slot= "..tostring(slot)..", info= "..DA.DUMP1(info))
bagItem = info.itemID
num_in_bag = info.stackCount
locked = info.isLocked
end
if bagItem then
if not isClassic then
info = C_Container.GetContainerItemInfo(container, slot)
--DA.DEBUG(1, "findBagForItem: container= "..tostring(container)..", slot= "..tostring(slot)..", info= "..DA.DUMP1(info))
bagItem = info.itemID
num_in_bag = info.stackCount
locked = info.isLocked
end
if itemID == bagItem then
--
-- found some of the same, it is a full stack or locked?
Expand All @@ -808,7 +805,7 @@ local function getItemFromBank(itemID, bag, slot, count)
--DA.DEBUG(0,"getItemFromBank(", itemID, bag, slot, count,")")
ClearCursor()
local info, available
if isClassic then
if GetContainerItemInfo then
info, available = GetContainerItemInfo(bag, slot)
else
info = C_Container.GetContainerItemInfo(bag, slot)
Expand All @@ -819,15 +816,15 @@ local function getItemFromBank(itemID, bag, slot, count)
if available then
if available == 1 or count >= available then
--DA.DEBUG(1,"PickupContainerItem(",bag,", ", slot,")")
if isClassic then
if PickupContainerItem then
PickupContainerItem(bag, slot)
else
C_Container.PickupContainerItem(bag, slot)
end
num_moved = available
else
--DA.DEBUG(1,"SplitContainerItem(",bag, slot, count,")")
if isClassic then
if SplitContainerItem then
SplitContainerItem(bag, slot, count)
else
C_Container.SplitContainerItem(bag, slot, count)
Expand All @@ -837,7 +834,7 @@ local function getItemFromBank(itemID, bag, slot, count)
local tobag, toslot = findBagForItem(itemID, num_moved)
--DA.DEBUG(1,"tobag=", tobag, " toslot=", toslot, " findBagForItem(", itemID, num_moved,")")
if not tobag then
if isClassic then
if GetContainerItemLink then
Skillet:Print(L["Could not find bag space for"]..": "..GetContainerItemLink(bag, slot))
else
Skillet:Print(L["Could not find bag space for"]..": "..C_Container.GetContainerItemLink(bag, slot))
Expand All @@ -850,7 +847,7 @@ local function getItemFromBank(itemID, bag, slot, count)
PutItemInBackpack()
else
--DA.DEBUG(1,"PutItemInBag(",ContainerIDToInventoryID(tobag),")")
if isClassic then
if ContainerIDToInventoryID then
PutItemInBag(ContainerIDToInventoryID(tobag))
else
PutItemInBag(C_Container.ContainerIDToInventoryID(tobag))
Expand Down Expand Up @@ -886,7 +883,7 @@ local function getItemFromGuildBank(itemID, bag, slot, count)
return 0
else
--DA.DEBUG(1,"getItemFromGuildBank: PickupContainerItem("..tostring(tobag)..", "..tostring(toslot)..")")
if isClassic then
if PickupContainerItem then
PickupContainerItem(tobag, toslot) -- actually puts the item in the bag
else
C_Container.PickupContainerItem(tobag, toslot)
Expand Down
2 changes: 1 addition & 1 deletion UI/Utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ end
-- lower right corner only
--
function Skillet:EnableResize(frame, min_width, min_height, refresh_method)
if isClassic then
if Skillet.build == "Classic" then
frame:SetMinResize(min_width,min_height) -- magic numbers
else
frame:SetResizeBounds(min_width, min_height) -- magic numbers
Expand Down

0 comments on commit c5e4e21

Please sign in to comment.