@@ -116,40 +116,18 @@ GUIConfigureWorld::GUIConfigureWorld(gui::IGUIEnvironment* env,
116
116
// mod_names
117
117
if (!mod.is_modpack &&
118
118
mod_names.count (modname) == 0 )
119
- m_new_mod_names. insert ( modname);
119
+ m_settings. setBool ( " load_mod_ " + modname, false );
120
120
}
121
- if (!m_new_mod_names.empty ())
122
- {
123
- wchar_t * text = wgettext (" Warning: Some mods are not configured yet.\n "
124
- " They will be enabled by default when you save the configuration. " );
125
- GUIMessageMenu *menu =
126
- new GUIMessageMenu (Environment, Parent, -1 , m_menumgr, text);
127
- menu->drop ();
128
- delete[] text;
129
- }
130
-
131
-
132
121
// find missing mods (mentioned in world.mt, but not installed)
133
- std::set<std::string> missing_mods;
134
122
for (std::set<std::string>::iterator it = mod_names.begin ();
135
123
it != mod_names.end (); ++it)
136
124
{
137
125
std::string modname = *it;
138
126
if (m_addonmods.count (modname) == 0 )
139
- missing_mods. insert ( modname);
127
+ m_settings. remove ( " load_mod_ " + modname);
140
128
}
141
- if (!missing_mods.empty ())
142
- {
143
- wchar_t * text = wgettext (" Warning: Some configured mods are missing.\n "
144
- " Their setting will be removed when you save the configuration. " );
145
- GUIMessageMenu *menu =
146
- new GUIMessageMenu (Environment, Parent, -1 , m_menumgr, text);
147
- delete[] text;
148
- for (std::set<std::string>::iterator it = missing_mods.begin ();
149
- it != missing_mods.end (); ++it)
150
- m_settings.remove (" load_mod_" +(*it));
151
- menu->drop ();
152
- }
129
+ std::string worldmtfile = m_wspec.path +DIR_DELIM+" world.mt" ;
130
+ m_settings.updateConfigFile (worldmtfile.c_str ());
153
131
}
154
132
155
133
void GUIConfigureWorld::drawMenu ()
@@ -388,11 +366,6 @@ bool GUIConfigureWorld::OnEvent(const SEvent& event)
388
366
return true ;
389
367
}
390
368
case GUI_ID_SAVE: {
391
- for (std::set<std::string>::iterator it = m_new_mod_names.begin ();
392
- it!= m_new_mod_names.end (); ++it)
393
- {
394
- m_settings.setBool (" load_mod_" +(*it),true );
395
- }
396
369
std::string worldmtfile = m_wspec.path +DIR_DELIM+" world.mt" ;
397
370
m_settings.updateConfigFile (worldmtfile.c_str ());
398
371
@@ -558,22 +531,14 @@ void GUIConfigureWorld::buildTreeView(std::map<std::string, ModSpec> mods,
558
531
buildTreeView (mod.modpack_content , new_node);
559
532
else
560
533
{
561
- // set icon for node: ? for new mods, x for disabled mods,
562
- // checkmark for enabled mods
563
- if (m_new_mod_names. count ( modname) > 0 )
564
- {
565
- new_node-> setIcon (QUESTIONMARK_STR);
566
- }
534
+ // set icon for node: x for disabled mods, checkmark for enabled mods
535
+ bool mod_enabled = false ;
536
+ if (m_settings. exists ( " load_mod_ " + modname))
537
+ mod_enabled = m_settings. getBool ( " load_mod_ " +modname);
538
+ if (mod_enabled)
539
+ new_node-> setIcon (CHECKMARK_STR);
567
540
else
568
- {
569
- bool mod_enabled = true ;
570
- if (m_settings.exists (" load_mod_" +modname))
571
- mod_enabled = m_settings.getBool (" load_mod_" +modname);
572
- if (mod_enabled)
573
- new_node->setIcon (CHECKMARK_STR);
574
- else
575
- new_node->setIcon (CROSS_STR);
576
- }
541
+ new_node->setIcon (CROSS_STR);
577
542
}
578
543
}
579
544
}
@@ -690,7 +655,6 @@ void GUIConfigureWorld::enableMod(std::string modname)
690
655
m_nodes.find (modname);
691
656
if (it != m_nodes.end ())
692
657
(*it).second ->setIcon (CHECKMARK_STR);
693
- m_new_mod_names.erase (modname);
694
658
// also enable all dependencies
695
659
for (std::set<std::string>::iterator it=mspec.depends .begin ();
696
660
it != mspec.depends .end (); ++it)
@@ -715,7 +679,6 @@ void GUIConfigureWorld::disableMod(std::string modname)
715
679
m_nodes.find (modname);
716
680
if (it != m_nodes.end ())
717
681
(*it).second ->setIcon (CROSS_STR);
718
- m_new_mod_names.erase (modname);
719
682
// also disable all mods that depend on this one
720
683
std::pair<std::multimap<std::string, std::string>::iterator,
721
684
std::multimap<std::string, std::string>::iterator > rdep =
0 commit comments