@@ -189,10 +189,14 @@ local function GetItemSplit(itemLink)
189
189
return itemSplit
190
190
end
191
191
192
+ local function Trim (str )
193
+ return string.match (str , ' ^%s*(.-)%s*$' )
194
+ end
195
+
192
196
local function GetItemName (itemLink )
193
197
local name = string.match (itemLink , ' |h%[(.*)%]|' )
194
198
local removeIcons = gsub (name , ' |%a.+|%a' , ' ' )
195
- local trimmed = string.match (removeIcons , ' ^%s*(.*)%s*$ ' )
199
+ local trimmed = Trim (removeIcons )
196
200
-- check for empty string or only spaces
197
201
if string.match (trimmed , ' ^%s*$' ) then
198
202
return nil
@@ -432,6 +436,7 @@ local function GetItemStringFromItemLink(slotNum, itemLink, debugOutput)
432
436
local simcItemOptions = {}
433
437
local gems = {}
434
438
local gemBonuses = {}
439
+ local debugLines = {}
435
440
436
441
-- Item id
437
442
local itemId = itemSplit [OFFSET_ITEM_ID ]
@@ -520,16 +525,24 @@ local function GetItemStringFromItemLink(slotNum, itemLink, debugOutput)
520
525
521
526
-- 11.1.7 Belt
522
527
if itemId == 242664 or itemId == 245964 or itemId == 245965 or itemId == 245966 then
523
- local titanDiscId = Simulationcraft :GetTitanDiscBeltSpell ()
528
+ local titanDiscId , tooltipStrings = Simulationcraft :GetTitanDiscBeltSpell ()
524
529
if titanDiscId then
525
530
simcItemOptions [# simcItemOptions + 1 ] = ' titan_disc_id=' .. titanDiscId
526
531
end
532
+ debugLines [# debugLines + 1 ] = ' Spell Descriptions:'
533
+ for i = 1 , # tooltipStrings do
534
+ debugLines [# debugLines + 1 ] = tooltipStrings [i ]
535
+ end
527
536
end
528
537
529
538
local itemStr = ' '
530
539
itemStr = itemStr .. (simcSlotNames [slotNum ] or ' unknown' ) .. " =" .. table.concat (simcItemOptions , ' ,' )
531
540
if debugOutput then
532
- itemStr = itemStr .. ' \n # ' .. gsub (itemLink , " \124 " , " \124\124 " ) .. ' \n '
541
+ debugLines [# debugLines + 1 ] = gsub (itemLink , " \124 " , " \124\124 " )
542
+ for line = 1 , # debugLines do
543
+ itemStr = itemStr .. ' \n # ' .. debugLines [line ]
544
+ end
545
+ itemStr = itemStr .. ' \n '
533
546
end
534
547
535
548
return itemStr
@@ -717,18 +730,21 @@ end
717
730
-- This requires the SpellCache with the right spell IDs to be loaded
718
731
function Simulationcraft :GetTitanDiscBeltSpell ()
719
732
local activeSpell = nil
720
- local beltDescription = SpellCache [Simulationcraft .discBeltSpell ]:GetSpellDescription ()
733
+ local debugTooltipStrings = {}
734
+ local beltDescription = Trim (SpellCache [Simulationcraft .discBeltSpell ]:GetSpellDescription ())
735
+ debugTooltipStrings [# debugTooltipStrings + 1 ] = beltDescription
721
736
if not beltDescription then
722
737
error (' Unable to get spell description for DISC Belt spell' )
723
738
end
724
739
for k , v in pairs (Simulationcraft .discBeltEffectSpells ) do
725
- local effectDesc = SpellCache [k ]:GetSpellDescription ()
740
+ local effectDesc = Trim (SpellCache [k ]:GetSpellDescription ())
741
+ debugTooltipStrings [# debugTooltipStrings + 1 ] = effectDesc
726
742
if beltDescription :find (effectDesc ) then
727
743
activeSpell = v
728
744
end
729
745
end
730
746
731
- return activeSpell
747
+ return activeSpell , debugTooltipStrings
732
748
end
733
749
734
750
function Simulationcraft :GetMainFrame (text )
0 commit comments