Example #1
0
        //----------------------------------------------//
        // MODS TAB                                     //
        //----------------------------------------------//

        //Updates the mod configuration based on the checkedlistbox
        private void UpdateModConfiguration()
        {
            //Loop through checkedlistbox and enable/disable mods and set their order
            for (int i = 0; i < chklstMods.Items.Count; i++)
            {
                string modname = (string)chklstMods.Items[i];
                bool   check   = chklstMods.GetItemChecked(i);

                ModData mod = ModMan.GetMod(modname);
                if (mod != null)
                {
                    mod.Enabled   = check;
                    mod.SortValue = -i; //Sort in reverse
                }
            }

            //Sort the mods
            ModMan.Mods.Sort((a, b) => a.SortValue.CompareTo(b.SortValue));
        }