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 #ifdef STARSHATTER_DEMO_RELEASE
230 Print(
"\nPACKAGED MODS ARE NOT SUPPORTED IN THIS DEMO\n");
232 Print(
"\nDEPLOYING MODS\n--------------\n");
240 Print(
" %d. %s is already deployed (skipping)\n", i++, name->
data());
248 if (mod_info->Load(name->
data()) && mod_info->Enable()) {
252 Print(
" Could not deploy '%s' - disabling\n", name->
data());
268 Print(
"UNDEPLOYING MODS\n");
291 #ifdef STARSHATTER_DEMO_RELEASE
317 if (mod_info->
Load(*mod_name) && mod_info->
Enable()) {
345 disabled.
append(mod_name);
350 if (mod_info->
Name() == *mod_name) {
363 if (mod_index > 0 && mod_index < enabled.
size()) {
364 Text* mod1 = enabled.
at(mod_index-1);
365 Text* mod2 = enabled.
at(mod_index);
367 enabled.
at(mod_index-1) = mod2;
368 enabled.
at(mod_index) = mod1;
375 if (mod_index >= 0 && mod_index < enabled.
size()-1) {
376 Text* mod1 = enabled.
at(mod_index);
377 Text* mod2 = enabled.
at(mod_index+1);
379 enabled.
at(mod_index) = mod2;
380 enabled.
at(mod_index+1) = mod1;