Skip to content

Commit

Permalink
Handle some 11.0 API changes in a backwards compatible way
Browse files Browse the repository at this point in the history
  • Loading branch information
seriallos committed Apr 23, 2024
1 parent e4a1a81 commit 9f96f8d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Simulationcraft.toc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## IconTexture: Interface\Addons\SimulationCraft\logo
## Notes: Constructs SimC export strings
## Author: Theck, navv_, seriallos
## Version: 10.2.6-02
## Version: 10.2.6-03
## OptionalDependencies: Ace3, LibRealmInfo, LibDBIcon, LibDataBroker-1.1
## SavedVariables: SimulationCraftDB

Expand Down
8 changes: 7 additions & 1 deletion core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ local Traits = _G.C_Traits
-- GetAddOnMetadata was global until 10.1. It's now in C_AddOns. This line will use C_AddOns if available and work in either WoW build
local GetAddOnMetadata = C_AddOns and C_AddOns.GetAddOnMetadata or GetAddOnMetadata

-- Some global item functions have been moved into C_Item in 11.0
local GetDetailedItemLevelInfo = C_Item and C_Item.GetDetailedItemLevelInfo or GetDetailedItemLevelInfo
local GetItemInfoInstant = C_Item and C_Item.GetItemInfoInstant or GetItemInfoInstant
local GetItemCount = C_Item and C_Item.GetItemCount or GetItemCount

-- Talent string export
local bitWidthHeaderVersion = 8
local bitWidthSpecID = 16
Expand Down Expand Up @@ -331,7 +336,8 @@ local function WriteLoadoutContent(exportStream, configID, treeID)

local isNodeSelected = treeNode.ranksPurchased > 0;
local isPartiallyRanked = treeNode.ranksPurchased ~= treeNode.maxRanks;
local isChoiceNode = treeNode.type == Enum.TraitNodeType.Selection or treeNode.type == Enum.TraitNodeType.SubTreeSelection;
local isChoiceNode = treeNode.type == Enum.TraitNodeType.Selection
or treeNode.type == Enum.TraitNodeType.SubTreeSelection;

exportStream:AddValue(1, isNodeSelected and 1 or 0);
if(isNodeSelected) then
Expand Down

0 comments on commit 9f96f8d

Please sign in to comment.