@@ -248,7 +248,7 @@ DFhackCExport command_result plugin_shutdown (color_ostream &out) {
248248 return CR_OK ;
249249}
250250
251- static void validate_config (color_ostream &out, bool verbose = false ) {
251+ static void validate_materials_config (color_ostream &out, bool verbose = false ) {
252252 if (config.get_bool (CONFIG_BLOCKS )
253253 || config.get_bool (CONFIG_BOULDERS )
254254 || config.get_bool (CONFIG_LOGS )
@@ -307,7 +307,9 @@ DFhackCExport command_result plugin_load_site_data (color_ostream &out) {
307307 DEBUG (control,out).print (" no config found in this save; initializing\n " );
308308 config = World::AddPersistentSiteData (CONFIG_KEY );
309309 }
310- validate_config (out);
310+ if (config.get_int (CONFIG_RECONSTRUCT ) == -1 )
311+ config.set_bool (CONFIG_RECONSTRUCT , true );
312+ validate_materials_config (out);
311313
312314 DEBUG (control,out).print (" loading persisted state\n " );
313315
@@ -548,6 +550,8 @@ static void printStatus(color_ostream &out) {
548550 out.print (" use boulders: %s\n " , config.get_bool (CONFIG_BOULDERS ) ? " yes" : " no" );
549551 out.print (" use logs: %s\n " , config.get_bool (CONFIG_LOGS ) ? " yes" : " no" );
550552 out.print (" use bars: %s\n " , config.get_bool (CONFIG_BARS ) ? " yes" : " no" );
553+ out.print (" plan constructions on tiles with existing constructed floors/ramps when using box select: %s\n " ,
554+ config.get_bool (CONFIG_RECONSTRUCT ) ? " yes" : " no" );
551555 out.print (" \n " );
552556
553557 size_t bld_count = 0 ;
@@ -598,12 +602,14 @@ static bool setSetting(color_ostream &out, string name, bool value) {
598602 config.set_bool (CONFIG_LOGS , value);
599603 else if (name == " bars" )
600604 config.set_bool (CONFIG_BARS , value);
605+ else if (name == " reconstruct" )
606+ config.set_bool (CONFIG_RECONSTRUCT , value);
601607 else {
602608 out.printerr (" unrecognized setting: '%s'\n " , name.c_str ());
603609 return false ;
604610 }
605611
606- validate_config (out, true );
612+ validate_materials_config (out, true );
607613 call_buildingplan_lua (&out, " signal_reset" );
608614 return true ;
609615}
@@ -747,6 +753,7 @@ static int getGlobalSettings(lua_State *L) {
747753 settings.emplace (" logs" , config.get_bool (CONFIG_LOGS ));
748754 settings.emplace (" boulders" , config.get_bool (CONFIG_BOULDERS ));
749755 settings.emplace (" bars" , config.get_bool (CONFIG_BARS ));
756+ settings.emplace (" reconstruct" , config.get_bool (CONFIG_RECONSTRUCT ));
750757 Lua::Push (L, settings);
751758 return 1 ;
752759}
0 commit comments