@@ -210,25 +210,30 @@ local ItemsTabClass = newClass("ItemsTab", "UndoHandler", "ControlHost", "Contro
210
210
-- function()
211
211
-- return self.height < 980
212
212
-- end
213
- self .controls . selectDB = new ( " DropDownControl " , { " LEFT " , self . controls . selectDBLabel , " RIGHT " }, { 4 , 0 , 150 , 18 }, { " Uniques " , " Rare Templates " })
213
+ self .selectedDB = " UNIQUE "
214
214
215
+ -- Uniques Button
216
+ self .controls .uniqueButton = new (" ButtonControl" , {" LEFT" , self .controls .selectDBLabel , " RIGHT" }, {4 , 0 , 110 , 18 }, " Uniques" , function ()
217
+ self .selectedDB = " UNIQUE"
218
+ end )
219
+ self .controls .uniqueButton .locked = function () return self .selectedDB == " UNIQUE" end
220
+
221
+ -- Rare Templates Button
222
+ self .controls .rareButton = new (" ButtonControl" , {" LEFT" , self .controls .selectDBLabel , " RIGHT" }, {120 , 0 , 110 , 18 }, " Rare Templates" , function ()
223
+ self .selectedDB = " RARE"
224
+ end )
225
+ self .controls .rareButton .locked = function () return self .selectedDB == " RARE" end
226
+
215
227
-- Unique database
216
228
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
- self .controls .uniqueDB .y = function ()
218
- return self .controls .selectDBLabel :IsShown () and 118 or 96
219
- end
220
- self .controls .uniqueDB .shown = function ()
221
- return not self .controls .selectDBLabel :IsShown () or self .controls .selectDB .selIndex == 1
222
- end
229
+ self .controls .uniqueDB .y = 118
230
+ self .controls .uniqueDB .shown = function () return not self .selectedDB == " UNIQUE" end
223
231
224
232
-- 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" )
226
- self .controls .rareDB .y = function ()
227
- return self .controls .selectDBLabel :IsShown () and 78 or 396
228
- end
229
- self .controls .rareDB .shown = function ()
230
- return not self .controls .selectDBLabel :IsShown () or self .controls .selectDB .selIndex == 2
231
- end
233
+ self .controls .rareDB = new (" ItemDBControl" , {" TOPLEFT" ,self .controls .itemList ," BOTTOMLEFT" }, {0 , 76 , 360 , function (c ) return m_min (286 , self .maxY - select (2 , c :GetPos ())) end }, self , main .rareDB , " RARE" )
234
+ self .controls .uniqueDB .shown = function () return self .selectedDB == " UNIQUE" end
235
+ self .controls .rareDB .shown = function () return self .selectedDB == " RARE" end
236
+
232
237
-- Create/import item
233
238
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 ()
234
239
self :CraftItem ()
0 commit comments