@@ -31,6 +31,9 @@ local themes = addon:GetModule('Themes')
31
31
--- @class Config : AceModule
32
32
local config = addon :GetModule (' Config' )
33
33
34
+ --- @class Context : AceModule
35
+ local context = addon :GetModule (' Context' )
36
+
34
37
--- @param kind BagKind
35
38
--- @return AceConfig.OptionsTable
36
39
function config :GetCustomCategoryOptions (kind )
@@ -60,7 +63,8 @@ function config:GetCustomCategoryOptions(kind)
60
63
end ,
61
64
set = function (_ , value )
62
65
categories :SetCategoryState (kind , value , not categories :IsCategoryEnabled (kind , value ))
63
- events :SendMessage (' bags/FullRefreshAll' )
66
+ local ctx = context :New (' on_click' )
67
+ events :SendMessage (' bags/FullRefreshAll' , ctx )
64
68
end ,
65
69
values = {}
66
70
}
@@ -98,7 +102,8 @@ function config:GetBagOptions(kind)
98
102
end ,
99
103
set = function (_ , value )
100
104
DB :SetCategoryFilter (kind , value , not DB :GetCategoryFilter (kind , value ))
101
- events :SendMessage (' bags/FullRefreshAll' )
105
+ local ctx = context :New (' on_click' )
106
+ events :SendMessage (' bags/FullRefreshAll' , ctx )
102
107
end ,
103
108
values = {
104
109
[" RecentItems" ] = L :G (" Recent Items" ),
@@ -125,7 +130,8 @@ function config:GetBagOptions(kind)
125
130
end ,
126
131
set = function (_ , value )
127
132
DB :SetSectionSortType (kind , DB :GetBagView (kind ), value )
128
- events :SendMessage (' bags/FullRefreshAll' )
133
+ local ctx = context :New (' on_click' )
134
+ events :SendMessage (' bags/FullRefreshAll' , ctx )
129
135
end ,
130
136
values = {
131
137
[const .SECTION_SORT_TYPE .ALPHABETICALLY ] = L :G (" Alphabetically" ),
@@ -145,7 +151,8 @@ function config:GetBagOptions(kind)
145
151
end ,
146
152
set = function (_ , value )
147
153
DB :SetItemSortType (kind , DB :GetBagView (kind ), value )
148
- events :SendMessage (' bags/FullRefreshAll' )
154
+ local ctx = context :New (' on_click' )
155
+ events :SendMessage (' bags/FullRefreshAll' , ctx )
149
156
end ,
150
157
values = {
151
158
[const .ITEM_SORT_TYPE .QUALITY_THEN_ALPHABETICALLY ] = L :G (" Quality, then Alphabetically" ),
@@ -200,7 +207,8 @@ function config:GetBagOptions(kind)
200
207
end ,
201
208
set = function (_ , value )
202
209
DB :SetMergeItems (kind , value )
203
- events :SendMessage (' bags/FullRefreshAll' )
210
+ local ctx = context :New (' on_click' )
211
+ events :SendMessage (' bags/FullRefreshAll' , ctx )
204
212
end ,
205
213
},
206
214
mergeUnstackable = {
@@ -213,7 +221,8 @@ function config:GetBagOptions(kind)
213
221
end ,
214
222
set = function (_ , value )
215
223
DB :SetMergeUnstackable (kind , value )
216
- events :SendMessage (' bags/FullRefreshAll' )
224
+ local ctx = context :New (' on_click' )
225
+ events :SendMessage (' bags/FullRefreshAll' , ctx )
217
226
end ,
218
227
},
219
228
unmergeAtShop = {
@@ -226,7 +235,8 @@ function config:GetBagOptions(kind)
226
235
end ,
227
236
set = function (_ , value )
228
237
DB :SetUnmergeAtShop (kind , value )
229
- events :SendMessage (' bags/FullRefreshAll' )
238
+ local ctx = context :New (' on_click' )
239
+ events :SendMessage (' bags/FullRefreshAll' , ctx )
230
240
end ,
231
241
},
232
242
dontMergePartial = {
@@ -239,7 +249,8 @@ function config:GetBagOptions(kind)
239
249
end ,
240
250
set = function (_ , value )
241
251
DB :SetDontMergePartial (kind , value )
242
- events :SendMessage (' bags/FullRefreshAll' )
252
+ local ctx = context :New (' on_click' )
253
+ events :SendMessage (' bags/FullRefreshAll' , ctx )
243
254
end ,
244
255
},
245
256
dontMergeTransmog = {
@@ -252,7 +263,8 @@ function config:GetBagOptions(kind)
252
263
end ,
253
264
set = function (_ , value )
254
265
DB :SetDontMergeTransmog (kind , value )
255
- events :SendMessage (' bags/FullRefreshAll' )
266
+ local ctx = context :New (' on_click' )
267
+ events :SendMessage (' bags/FullRefreshAll' , ctx )
256
268
end ,
257
269
},
258
270
}
@@ -273,7 +285,8 @@ function config:GetBagOptions(kind)
273
285
end ,
274
286
set = function (_ , value )
275
287
DB :SetItemLevelEnabled (kind , value )
276
- events :SendMessage (' bags/FullRefreshAll' )
288
+ local ctx = context :New (' on_click' )
289
+ events :SendMessage (' bags/FullRefreshAll' , ctx )
277
290
end ,
278
291
},
279
292
color = {
@@ -286,7 +299,8 @@ function config:GetBagOptions(kind)
286
299
end ,
287
300
set = function (_ , value )
288
301
DB :SetItemLevelColorEnabled (kind , value )
289
- events :SendMessage (' bags/FullRefreshAll' )
302
+ local ctx = context :New (' on_click' )
303
+ events :SendMessage (' bags/FullRefreshAll' , ctx )
290
304
end ,
291
305
},
292
306
}
@@ -308,7 +322,8 @@ function config:GetBagOptions(kind)
308
322
end ,
309
323
set = function (_ , value )
310
324
DB :SetShowFullSectionNames (kind , value )
311
- events :SendMessage (' bags/FullRefreshAll' )
325
+ local ctx = context :New (' on_click' )
326
+ events :SendMessage (' bags/FullRefreshAll' , ctx )
312
327
end ,
313
328
},
314
329
showAllFreeSpace = {
@@ -322,7 +337,8 @@ function config:GetBagOptions(kind)
322
337
end ,
323
338
set = function (_ , value )
324
339
DB :SetShowAllFreeSpace (kind , value )
325
- events :SendMessage (' bags/FullRefreshAll' )
340
+ local ctx = context :New (' on_click' )
341
+ events :SendMessage (' bags/FullRefreshAll' , ctx )
326
342
end ,
327
343
},
328
344
showExtraGlowyButtons = {
@@ -336,7 +352,8 @@ function config:GetBagOptions(kind)
336
352
end ,
337
353
set = function (_ , value )
338
354
DB :SetExtraGlowyButtons (kind , value )
339
- events :SendMessage (' bags/FullRefreshAll' )
355
+ local ctx = context :New (' on_click' )
356
+ events :SendMessage (' bags/FullRefreshAll' , ctx )
340
357
end ,
341
358
},
342
359
itemsPerRow = {
@@ -353,7 +370,8 @@ function config:GetBagOptions(kind)
353
370
set = function (_ , value )
354
371
DB :SetBagViewSizeItems (kind , DB :GetBagView (kind ), value )
355
372
bucket :Later (" setItemsPerRow" , 0.2 , function ()
356
- events :SendMessage (' bags/FullRefreshAll' )
373
+ local ctx = context :New (' on_click' )
374
+ events :SendMessage (' bags/FullRefreshAll' , ctx )
357
375
end )
358
376
end ,
359
377
},
@@ -387,7 +405,8 @@ function config:GetBagOptions(kind)
387
405
set = function (_ , value )
388
406
DB :SetBagViewSizeColumn (kind , DB :GetBagView (kind ), value )
389
407
bucket :Later (" setSectionsPerRow" , 0.2 , function ()
390
- events :SendMessage (' bags/FullRefreshAll' )
408
+ local ctx = context :New (' on_click' )
409
+ events :SendMessage (' bags/FullRefreshAll' , ctx )
391
410
end )
392
411
end ,
393
412
},
0 commit comments