@@ -274,7 +274,8 @@ local ItemsTabClass = newClass("ItemsTab", "UndoHandler", "ControlHost", "Contro
274274 local slotName = s_format (" %s Rune #%d" , slot .type , i )
275275 local label = slotName :gsub (" Armour" , " " ):gsub (" #" , " " )
276276
277- local runeSlot = new (" DropDownControl" , { " TOPLEFT" , prevSlot , " BOTTOMLEFT" }, {0 , 2 , 310 , 20 }, runeList [slot .type :lower ()], function ()
277+ local runeSlot = new (" DropDownControl" , { " TOPLEFT" , prevSlot , " BOTTOMLEFT" }, {0 , 2 , 310 , 20 }, runeList [slot .type :lower ()], function (_ , value )
278+ self .activeItemSet [slotName ] = { runeName = value .name }
278279 self .build .buildFlag = true
279280 end )
280281 runeSlot .anchor .collapse = true
@@ -1260,6 +1261,13 @@ function ItemsTabClass:Load(xml, dbFileName)
12601261 itemSet [slotName ].active = child .attrib .active == " true"
12611262 itemSet [slotName ].pbURL = child .attrib .itemPbURL or " "
12621263 end
1264+ elseif child .elem == " RuneSlot" then
1265+ local slotName = child .attrib .slotName or " "
1266+ local slot = itemSet [slotName ]
1267+ if slot then
1268+ local runeName = child .attrib .runeName or " None"
1269+ slot .runeName = runeName
1270+ end
12631271 elseif child .elem == " SocketIdURL" then
12641272 local id = tonumber (child .attrib .nodeId )
12651273 itemSet [id ] = { pbURL = child .attrib .itemPbURL or " " }
@@ -1352,6 +1360,11 @@ function ItemsTabClass:Save(xml)
13521360 end
13531361 end
13541362 end
1363+ for slotName , _ in pairs (self .runeSlots ) do
1364+ local runeName = (itemSet [slotName ] and itemSet [slotName ].runeName ) or " None"
1365+ local node = { elem = " RuneSlot" , attrib = { slotName = slotName , runeName = runeName } }
1366+ t_insert (child , node )
1367+ end
13551368 t_insert (xml , child )
13561369 end
13571370 if self .tradeQuery .statSortSelectionList then
@@ -1525,6 +1538,9 @@ function ItemsTabClass:CreateItemSet(itemSetId, name)
15251538 itemSet [slotName ] = { selItemId = 0 }
15261539 end
15271540 end
1541+ for slotName , _ in pairs (self .runeSlots ) do
1542+ itemSet [slotName ] = { runeName = " None" }
1543+ end
15281544 self .itemSets [itemSet .id ] = itemSet
15291545 return itemSet
15301546end
@@ -1592,6 +1608,15 @@ function ItemsTabClass:SetActiveItemSet(itemSetId, deferSync)
15921608 end
15931609 end
15941610 end
1611+ for slotName , slot in pairs (self .runeSlots ) do
1612+ if prevSet then
1613+ -- Update the previous set
1614+ prevSet [slotName ] = { runeName = slot :GetSelValue ().name }
1615+ end
1616+ -- Equip incoming set's rune
1617+ local currentRune = curSet [slotName ] and curSet [slotName ].runeName or " None"
1618+ slot :SelByValue (currentRune , " name" , true )
1619+ end
15951620 self .build .buildFlag = true
15961621 self :PopulateSlots ()
15971622 if not deferSync then
0 commit comments