@@ -318,6 +318,40 @@ local function CreateSettingMenu(opt)
318
318
}
319
319
end
320
320
321
+ local function DrawMenu (root , menuData )
322
+ for _ , m in ipairs (menuData ) do
323
+ if m .isTitle then
324
+ root :CreateTitle (m .text )
325
+ else
326
+ local c = root :CreateCheckbox (m .text , m .checked , function ()
327
+
328
+ end , {
329
+ arg1 = m .arg1 ,
330
+ arg2 = m .arg2 ,
331
+ })
332
+ c :SetResponder (function (data , menuInputData , menu )
333
+ m .func ({
334
+ arg1 = m .arg1 ,
335
+ arg2 = m .arg2 ,
336
+ })
337
+ -- Your handler here...
338
+ return MenuResponse .Refresh ;
339
+ end )
340
+
341
+ if m .menuList then
342
+ DrawMenu (c , m .menuList )
343
+ end
344
+ end
345
+ end
346
+
347
+ end
348
+
349
+ local EasyMenu = _G .EasyMenu or function (settings )
350
+ MenuUtil .CreateContextMenu (UIParent , function (ownerRegion , rootDescription )
351
+ DrawMenu (rootDescription , settings )
352
+ end )
353
+ end
354
+
321
355
-- import
322
356
do
323
357
408
442
}
409
443
})
410
444
411
- if not EasyMenu then
412
- ba :Hide ()
413
- end
414
-
415
445
ba :SetScript (" OnClick" , function (self , button )
416
446
EasyMenu (settings , menuFrame , " cursor" , 0 , 0 , " MENU" );
417
447
end )
457
487
458
488
tAppendAll (settings , CreateSettingMenu (actionOpt ))
459
489
460
- if not EasyMenu then
461
- ba :Hide ()
462
- end
463
-
464
490
ba :SetScript (" OnClick" , function (self , button )
465
491
EasyMenu (settings , menuFrame , " cursor" , 0 , 0 , " MENU" );
466
492
end )
0 commit comments