Skip to content

Commit bf437da

Browse files
committed
Add omnium_talents string
1 parent e6f9ced commit bf437da

2 files changed

Lines changed: 47 additions & 2 deletions

File tree

Simulationcraft.toc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
## Interface: 120001, 120005
1+
## Interface: 120001, 120005, 120007
22
## Title: Simulationcraft
33
## IconTexture: Interface\Addons\SimulationCraft\logo
44
## Notes: Constructs SimC export strings
55
## Author: Theck, navv_, seriallos
6-
## Version: 12.0.5-04
6+
## Version: 12.0.7-alpha01
77
## OptionalDependencies: Ace3, LibRealmInfo, LibDBIcon, LibDataBroker-1.1
88
## SavedVariables: SimulationCraftDB
99

core.lua

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ local ITEM_MOD_TYPE_CRAFT_STATS_2 = 30
5757

5858
local SUPPORTED_LOADOUT_SERIALIZATION_VERSION = 2
5959

60+
-- Extra C_Traits systems (beyond class talents) to export.
61+
-- Each entry pairs the SimC option name with its trait system ID
62+
-- (the value passed to C_Traits.SetConfigIDBySystemID by the matching Blizzard UI).
63+
local TRAIT_SYSTEMS = {
64+
{ name = 'omnium_talents', systemID = 48 }, -- 12.0.7 player power
65+
{ name = 'void_talents', systemID = 46 },
66+
}
67+
6068
local WeeklyRewards = _G.C_WeeklyRewards
6169

6270
-- New talents for Dragonflight
@@ -413,6 +421,28 @@ local function GetExportString(configID)
413421
return str
414422
end
415423

424+
-- Build a slash-delimited list of purchased traits from any C_Traits config.
425+
-- Format: <optionName>=<entryID>:<rank>/<entryID>:<rank>/...
426+
local function GetTraitString(optionName, configID)
427+
if not configID then return nil end
428+
429+
local configInfo = Traits.GetConfigInfo(configID)
430+
if not configInfo or not configInfo.treeIDs then return nil end
431+
432+
local entries = {}
433+
for _, treeID in ipairs(configInfo.treeIDs) do
434+
for _, nodeID in ipairs(Traits.GetTreeNodes(treeID)) do
435+
local node = Traits.GetNodeInfo(configID, nodeID)
436+
if node and node.ranksPurchased and node.ranksPurchased > 0 and node.activeEntry then
437+
entries[#entries + 1] = node.activeEntry.entryID .. ':' .. node.activeEntry.rank
438+
end
439+
end
440+
end
441+
442+
if #entries == 0 then return nil end
443+
return optionName .. '=' .. table.concat(entries, '/')
444+
end
445+
416446
-- function that translates between the game's role values and ours
417447
local function TranslateRole(spec_id, str)
418448
local spec_role = Simulationcraft.RoleTable[spec_id]
@@ -1143,6 +1173,21 @@ function Simulationcraft:GetSimcProfile(debugOutput, noBags, showMerchant, links
11431173
simulationcraftProfile = simulationcraftProfile .. playerTalents .. '\n'
11441174
end
11451175

1176+
if Traits and Traits.GetConfigIDBySystemID then
1177+
local firstTraitSystem = true
1178+
for _, system in ipairs(TRAIT_SYSTEMS) do
1179+
local configID = Traits.GetConfigIDBySystemID(system.systemID)
1180+
local traitStr = GetTraitString(system.name, configID)
1181+
if traitStr then
1182+
if firstTraitSystem then
1183+
simulationcraftProfile = simulationcraftProfile .. '\n'
1184+
firstTraitSystem = false
1185+
end
1186+
simulationcraftProfile = simulationcraftProfile .. traitStr .. '\n'
1187+
end
1188+
end
1189+
end
1190+
11461191
simulationcraftProfile = simulationcraftProfile .. '\n'
11471192

11481193
-- Method that gets gear information

0 commit comments

Comments
 (0)