@@ -393,8 +393,47 @@ function modmgr.dialog_configure_world()
393
393
" textlist[0,1.5;5,4.25;world_config_depends;" ..
394
394
modmgr .get_dependencies (mod .path ) .. " ;0]" ..
395
395
" button[9.25,6.35;2,0.5;btn_config_world_save;Save]" ..
396
- " button[7.4,6.35;2,0.5;btn_config_world_cancel;Cancel]" ..
397
- " button[5.5,-0.125;5.75,0.5;btn_all_mods;Enable all Mods]" ..
396
+ " button[7.4,6.35;2,0.5;btn_config_world_cancel;Cancel]"
397
+
398
+ if engine .setting_get (" old_style_mod_selection" ) == " true" then
399
+ local selected = engine .get_textlist_index (" world_config_modlist" )
400
+ local mod = filterlist .get_list (modmgr .modlist )[selected ]
401
+
402
+ if mod ~= nil then
403
+ if mod .is_modpack then
404
+ local rawlist = filterlist .get_raw_list (modmgr .modlist )
405
+
406
+ local all_enabled = true
407
+ for j = 1 ,# rawlist ,1 do
408
+ if rawlist [j ].modpack == mod .name and
409
+ rawlist [j ].enabled ~= true then
410
+ all_enabled = false
411
+ break
412
+ end
413
+ end
414
+
415
+ if all_enabled == false then
416
+ retval = retval .. " button[5.5,-0.125;2,0.5;btn_mp_enable;Enable MP]"
417
+ else
418
+ retval = retval .. " button[5.5,-0.125;2,0.5;btn_mp_disable;Disable MP]"
419
+ end
420
+ else
421
+ if mod .enabled then
422
+ retval = retval .. " checkbox[5.5,-0.375;cb_mod_enable;enabled;true]"
423
+ else
424
+ retval = retval .. " checkbox[5.5,-0.375;cb_mod_enable;enabled;false]"
425
+ end
426
+ end
427
+
428
+ end
429
+
430
+ retval = retval ..
431
+ " button[8.5,-0.125;2.5,0.5;btn_all_mods;Enable all]"
432
+ else
433
+ retval = retval ..
434
+ " button[5.5,-0.125;5.75,0.5;btn_all_mods;Enable all Mods]"
435
+ end
436
+ retval = retval ..
398
437
" textlist[5.5,0.5;5.5,5.75;world_config_modlist;"
399
438
400
439
@@ -627,33 +666,65 @@ function modmgr.handle_configure_world_buttons(fields)
627
666
if fields [" world_config_modlist" ] ~= nil then
628
667
local event = explode_textlist_event (fields [" world_config_modlist" ])
629
668
modmgr .world_config_selected_mod = event .index
669
+
670
+ if engine .setting_get (" old_style_mod_selection" ) ~= " true" then
671
+ if event .typ == " DCL" then
672
+ local mod = filterlist .get_list (modmgr .modlist )[event .index ]
673
+
674
+ if mod .typ == " game_mod" then
675
+ return nil
676
+ end
677
+
678
+ if not mod .is_modpack then
679
+ mod .enabled = not mod .enabled
680
+ else
681
+ local list = filterlist .get_raw_list (modmgr .modlist )
682
+ local toset = nil
683
+
684
+ for i = 1 ,# list ,1 do
685
+ if list [i ].modpack == mod .name then
686
+ if toset == nil then
687
+ toset = not list [i ].enabled
688
+ end
689
+
690
+ list [i ].enabled = toset
691
+ end
692
+ end
693
+ end
694
+ end
695
+ end
696
+ end
697
+
698
+ if engine .setting_get (" old_style_mod_selection" ) == " true" then
699
+ if fields [" cb_mod_enable" ] ~= nil then
700
+ local mod = filterlist .get_list (modmgr .modlist )
701
+ [engine .get_textlist_index (" world_config_modlist" )]
702
+ if fields [" cb_mod_enable" ] == " true" then
703
+ mod .enabled = true
704
+ else
705
+ mod .enabled = false
706
+ end
707
+ end
630
708
631
- if event .typ == " DCL" then
632
- local mod = filterlist .get_list (modmgr .modlist )[event .index ]
709
+ if fields [" btn_mp_enable" ] ~= nil or
710
+ fields [" btn_mp_disable" ] then
711
+ local mod = filterlist .get_list (modmgr .modlist )
712
+ [engine .get_textlist_index (" world_config_modlist" )]
633
713
634
- if mod .typ == " game_mod" then
635
- return nil
714
+ local toset = false
715
+ if fields [" btn_mp_enable" ] ~= nil then
716
+ toset = true
636
717
end
718
+ local list = filterlist .get_raw_list (modmgr .modlist )
637
719
638
- if not mod .is_modpack then
639
- mod .enabled = not mod .enabled
640
- else
641
- local list = filterlist .get_raw_list (modmgr .modlist )
642
- local toset = nil
643
-
644
- for i = 1 ,# list ,1 do
645
- if list [i ].modpack == mod .name then
646
- if toset == nil then
647
- toset = not list [i ].enabled
648
- end
649
-
650
- list [i ].enabled = toset
651
- end
720
+ for i = 1 ,# list ,1 do
721
+ if list [i ].modpack == mod .name then
722
+ list [i ].enabled = toset
652
723
end
653
724
end
654
725
end
655
726
end
656
-
727
+
657
728
if fields [" cb_hide_gamemods" ] ~= nil then
658
729
local current = filterlist .get_filtercriteria (modmgr .modlist )
659
730
0 commit comments