43 if (mod_config ==
this)
58 mod_config =
new(__FILE__,__LINE__)
ModConfig;
86 strcpy_s(filename,
"mod.cfg");
89 ::fopen_s(&f, filename,
"rb");
92 ::fseek(f, 0, SEEK_END);
94 ::fseek(f, 0, SEEK_SET);
96 block =
new(__FILE__,__LINE__) BYTE[blocklen+1];
99 ::fread(block, blocklen, 1, f);
106 Parser parser(
new(__FILE__,__LINE__)
BlockReader((
const char*) block, blocklen));
110 Print(
"ERROR: could not parse '%s'.\n", filename);
115 if (!file_type || file_type->
value() !=
"MOD_CONFIG") {
116 Print(
"WARNING: invalid '%s' file. No mods deployed\n", filename);
133 enabled.
append(
new(__FILE__,__LINE__)
Text(name));
146 fopen_s(&f,
"mod.cfg",
"w");
148 fprintf(f,
"MOD_CONFIG\n\n");
153 fprintf(f,
"mod: \"%s\"\n", name->
data());
169 loader->
ListFiles(
"*.dat", disabled,
true);
177 if (*name ==
"shatter.dat" ||
178 *name ==
"beta.dat" ||
179 *name ==
"start.dat" ||
180 *name ==
"irunin.dat" ||
181 *name ==
"vox.dat" ||
194 for (
int i = 0; i < mods.
size(); i++) {
209 for (
int i = 0; i < mods.
size(); i++) {
226 if (enabled.
size() < 1)
229 Print(
"\nDEPLOYING MODS\n--------------\n");
237 Print(
" %d. %s is already deployed (skipping)\n", i++, name->
data());
245 if (mod_info->Load(name->
data()) && mod_info->Enable()) {
249 Print(
" Could not deploy '%s' - disabling\n", name->
data());
264 Print(
"UNDEPLOYING MODS\n");
309 if (mod_info->
Load(*mod_name) && mod_info->
Enable()) {
336 disabled.
append(mod_name);
341 if (mod_info->
Name() == *mod_name) {
354 if (mod_index > 0 && mod_index < enabled.
size()) {
355 Text* mod1 = enabled.
at(mod_index-1);
356 Text* mod2 = enabled.
at(mod_index);
358 enabled.
at(mod_index-1) = mod2;
359 enabled.
at(mod_index) = mod1;
366 if (mod_index >= 0 && mod_index < enabled.
size()-1) {
367 Text* mod1 = enabled.
at(mod_index);
368 Text* mod2 = enabled.
at(mod_index+1);
370 enabled.
at(mod_index) = mod2;
371 enabled.
at(mod_index+1) = mod1;