@@ -206,30 +206,41 @@ local ItemsTabClass = newClass("ItemsTab", "UndoHandler", "ControlHost", "Contro
206
206
207
207
-- Database selector
208
208
self .controls .selectDBLabel = new (" LabelControl" , {" TOPLEFT" ,self .controls .itemList ," BOTTOMLEFT" }, {0 , 14 , 0 , 16 }, " ^7Import from:" )
209
- self .controls .selectDBLabel .shown = false
210
- -- function()
211
- -- return self.height < 980
212
- -- end
213
- self .controls .selectDB = new (" DropDownControl" , {" LEFT" ,self .controls .selectDBLabel ," RIGHT" }, {4 , 0 , 150 , 18 }, { " Uniques" , " Rare Templates" })
209
+ self .controls .selectDBLabel .shown = function ()
210
+ return self .height < 980
211
+ end
212
+ self .selectedDB = " UNIQUE"
214
213
214
+ -- Uniques Button
215
+ self .controls .uniqueButton = new (" ButtonControl" , {" LEFT" ,self .controls .selectDBLabel ," RIGHT" }, {4 , 0 , 110 , 18 }, " Uniques" , function ()
216
+ self .selectedDB = " UNIQUE"
217
+ end )
218
+ self .controls .uniqueButton .locked = function () return self .selectedDB == " UNIQUE" end
219
+
220
+ -- Rare Templates Button
221
+ self .controls .rareButton = new (" ButtonControl" , {" LEFT" ,self .controls .selectDBLabel ," RIGHT" }, {120 , 0 , 110 , 18 }, " Rare Templates" , function ()
222
+ self .selectedDB = " RARE"
223
+ end )
224
+ self .controls .rareButton .locked = function () return self .selectedDB == " RARE" end
225
+
215
226
-- Unique database
216
227
self .controls .uniqueDB = new (" ItemDBControl" , {" TOPLEFT" ,self .controls .itemList ," BOTTOMLEFT" }, {0 , 76 , 360 , function (c ) return m_min (244 , self .maxY - select (2 , c :GetPos ())) end }, self , main .uniqueDB , " UNIQUE" )
217
228
self .controls .uniqueDB .y = function ()
218
- return self .controls .selectDBLabel :IsShown () and 118 or 96
229
+ return self .controls .selectDBLabel :IsShown () and 118 or 90
219
230
end
220
231
self .controls .uniqueDB .shown = function ()
221
- return not self .controls .selectDBLabel :IsShown () or self .controls . selectDB . selIndex == 1
232
+ return not self .controls .selectDBLabel :IsShown () or self .selectedDB == " UNIQUE "
222
233
end
223
-
234
+
224
235
-- Rare template database
225
- self .controls .rareDB = new (" ItemDBControl" , {" TOPLEFT" ,self .controls .itemList ," BOTTOMLEFT" }, {0 , 76 , 360 , function (c ) return m_min (260 , self .maxY - select (2 , c :GetPos ())) end }, self , main .rareDB , " RARE" )
236
+ self .controls .rareDB = new (" ItemDBControl" , {" TOPLEFT" ,self .controls .itemList ," BOTTOMLEFT" }, {0 , 76 , 360 , function (c ) return m_min (284 , self .maxY - select (2 , c :GetPos ())) end }, self , main .rareDB , " RARE" )
226
237
self .controls .rareDB .y = function ()
227
- return self .controls .selectDBLabel :IsShown () and 78 or 396
238
+ return self .controls .selectDBLabel :IsShown () and 78 or 386
228
239
end
229
- self .controls .rareDB .shown = false
230
- -- function()
231
- -- return not self.controls.selectDBLabel:IsShown() or self.controls.selectDB.selIndex == 2
232
- -- end
240
+ self .controls .rareDB .shown = function ()
241
+ return not self . controls . selectDBLabel : IsShown () or self . selectedDB == " RARE "
242
+ end
243
+
233
244
-- Create/import item
234
245
self .controls .craftDisplayItem = new (" ButtonControl" , {" TOPLEFT" ,main .portraitMode and self .controls .setManage or self .controls .itemList ," TOPRIGHT" }, {20 , main .portraitMode and 0 or - 20 , 120 , 20 }, " Craft item..." , function ()
235
246
self :CraftItem ()
@@ -804,15 +815,15 @@ holding Shift will put it in the second.]])
804
815
t_insert (self .controls .uniqueDB .dragTargetList , self .controls .itemList )
805
816
t_insert (self .controls .uniqueDB .dragTargetList , self .controls .sharedItemList )
806
817
t_insert (self .controls .uniqueDB .dragTargetList , build .controls .mainSkillMinion )
807
- -- t_insert(self.controls.rareDB.dragTargetList, self.controls.itemList)
808
- -- t_insert(self.controls.rareDB.dragTargetList, self.controls.sharedItemList)
809
- -- t_insert(self.controls.rareDB.dragTargetList, build.controls.mainSkillMinion)
818
+ t_insert (self .controls .rareDB .dragTargetList , self .controls .itemList )
819
+ t_insert (self .controls .rareDB .dragTargetList , self .controls .sharedItemList )
820
+ t_insert (self .controls .rareDB .dragTargetList , build .controls .mainSkillMinion )
810
821
t_insert (self .controls .sharedItemList .dragTargetList , self .controls .itemList )
811
822
t_insert (self .controls .sharedItemList .dragTargetList , build .controls .mainSkillMinion )
812
823
for _ , slot in pairs (self .slots ) do
813
824
t_insert (self .controls .itemList .dragTargetList , slot )
814
825
t_insert (self .controls .uniqueDB .dragTargetList , slot )
815
- -- t_insert(self.controls.rareDB.dragTargetList, slot)
826
+ t_insert (self .controls .rareDB .dragTargetList , slot )
816
827
t_insert (self .controls .sharedItemList .dragTargetList , slot )
817
828
end
818
829
0 commit comments