|
|
@ -1,111 +1,102 @@
|
|
|
|
#define DF_VERSION 42004
|
|
|
|
#define DF_VERSION 42004
|
|
|
|
|
|
|
|
|
|
|
|
// some headers required for a plugin. Nothing special, just the basics.
|
|
|
|
#include <cstdio>
|
|
|
|
#include "Core.h"
|
|
|
|
#include <time.h>
|
|
|
|
#include <Console.h>
|
|
|
|
#include <vector>
|
|
|
|
#include <Export.h>
|
|
|
|
|
|
|
|
#include <PluginManager.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// DF data structure definition headers
|
|
|
|
#include "Console.h"
|
|
|
|
|
|
|
|
#include "Core.h"
|
|
|
|
#include "DataDefs.h"
|
|
|
|
#include "DataDefs.h"
|
|
|
|
#include "df/world.h"
|
|
|
|
#include "Export.h"
|
|
|
|
#include "df/ui.h"
|
|
|
|
#include "Hooks.h"
|
|
|
|
#include "df/item.h"
|
|
|
|
#include "MiscUtils.h"
|
|
|
|
#include "df/creature_raw.h"
|
|
|
|
#include "PluginManager.h"
|
|
|
|
#include "df/caste_raw.h"
|
|
|
|
#include "RemoteFortressReader.pb.h"
|
|
|
|
#include "df/body_part_raw.h"
|
|
|
|
#include "RemoteServer.h"
|
|
|
|
#include "df/historical_figure.h"
|
|
|
|
#include "SDL_events.h"
|
|
|
|
#include "df/world_history.h"
|
|
|
|
#include "SDL_keyboard.h"
|
|
|
|
|
|
|
|
#include "TileTypes.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "df/job_item.h"
|
|
|
|
#include "modules/Buildings.h"
|
|
|
|
#include "df/job_material_category.h"
|
|
|
|
#include "modules/Gui.h"
|
|
|
|
#include "df/dfhack_material_category.h"
|
|
|
|
#include "modules/Items.h"
|
|
|
|
#include "df/matter_state.h"
|
|
|
|
#include "modules/MapCache.h"
|
|
|
|
#include "df/material_vec_ref.h"
|
|
|
|
#include "modules/Maps.h"
|
|
|
|
#include "df/builtin_mats.h"
|
|
|
|
#include "modules/Materials.h"
|
|
|
|
#include "df/map_block_column.h"
|
|
|
|
#include "modules/Translation.h"
|
|
|
|
#include "df/plant.h"
|
|
|
|
#include "modules/Units.h"
|
|
|
|
#include "df/plant_raw_flags.h"
|
|
|
|
#include "modules/World.h"
|
|
|
|
#if DF_VERSION > 40001
|
|
|
|
|
|
|
|
#include "df/plant_tree_info.h"
|
|
|
|
#include "df/army.h"
|
|
|
|
#include "df/plant_tree_tile.h"
|
|
|
|
#include "df/army_flags.h"
|
|
|
|
#include "df/plant_growth.h"
|
|
|
|
#include "df/block_square_event_item_spatterst.h"
|
|
|
|
#include "df/plant_growth_print.h"
|
|
|
|
#include "df/block_square_event_material_spatterst.h"
|
|
|
|
#endif
|
|
|
|
#include "df/body_appearance_modifier.h"
|
|
|
|
#include "df/itemdef.h"
|
|
|
|
#include "df/body_part_layer_raw.h"
|
|
|
|
#include "df/building_def_workshopst.h"
|
|
|
|
#include "df/body_part_raw.h"
|
|
|
|
|
|
|
|
#include "df/bp_appearance_modifier.h"
|
|
|
|
|
|
|
|
#include "df/building_axle_horizontalst.h"
|
|
|
|
|
|
|
|
#include "df/building_bridgest.h"
|
|
|
|
#include "df/building_def_furnacest.h"
|
|
|
|
#include "df/building_def_furnacest.h"
|
|
|
|
#include "df/building_wellst.h"
|
|
|
|
#include "df/building_def_workshopst.h"
|
|
|
|
#include "df/building_water_wheelst.h"
|
|
|
|
#include "df/building_rollersst.h"
|
|
|
|
#include "df/building_screw_pumpst.h"
|
|
|
|
#include "df/building_screw_pumpst.h"
|
|
|
|
#include "df/building_axle_horizontalst.h"
|
|
|
|
|
|
|
|
#include "df/building_windmillst.h"
|
|
|
|
|
|
|
|
#include "df/building_siegeenginest.h"
|
|
|
|
#include "df/building_siegeenginest.h"
|
|
|
|
#include "df/building_rollersst.h"
|
|
|
|
#include "df/building_water_wheelst.h"
|
|
|
|
#include "df/building_bridgest.h"
|
|
|
|
#include "df/building_wellst.h"
|
|
|
|
|
|
|
|
#include "df/building_windmillst.h"
|
|
|
|
|
|
|
|
#include "df/builtin_mats.h"
|
|
|
|
|
|
|
|
#include "df/caste_raw.h"
|
|
|
|
|
|
|
|
#include "df/caste_raw.h"
|
|
|
|
|
|
|
|
#include "df/color_modifier_raw.h"
|
|
|
|
|
|
|
|
#include "df/creature_raw.h"
|
|
|
|
|
|
|
|
#include "df/creature_raw.h"
|
|
|
|
#include "df/descriptor_color.h"
|
|
|
|
#include "df/descriptor_color.h"
|
|
|
|
|
|
|
|
#include "df/descriptor_color.h"
|
|
|
|
|
|
|
|
#include "df/descriptor_pattern.h"
|
|
|
|
#include "df/descriptor_pattern.h"
|
|
|
|
#include "df/descriptor_pattern.h"
|
|
|
|
#include "df/descriptor_shape.h"
|
|
|
|
#include "df/descriptor_shape.h"
|
|
|
|
|
|
|
|
#include "df/dfhack_material_category.h"
|
|
|
|
#include "df/physical_attribute_type.h"
|
|
|
|
#include "df/enabler.h"
|
|
|
|
|
|
|
|
#include "df/graphic.h"
|
|
|
|
|
|
|
|
#include "df/historical_figure.h"
|
|
|
|
|
|
|
|
#include "df/item.h"
|
|
|
|
|
|
|
|
#include "df/itemdef.h"
|
|
|
|
|
|
|
|
#include "df/job_item.h"
|
|
|
|
|
|
|
|
#include "df/job_material_category.h"
|
|
|
|
|
|
|
|
#include "df/map_block_column.h"
|
|
|
|
|
|
|
|
#include "df/material_vec_ref.h"
|
|
|
|
|
|
|
|
#include "df/matter_state.h"
|
|
|
|
#include "df/mental_attribute_type.h"
|
|
|
|
#include "df/mental_attribute_type.h"
|
|
|
|
#include "df/color_modifier_raw.h"
|
|
|
|
#include "df/physical_attribute_type.h"
|
|
|
|
#include "df/descriptor_color.h"
|
|
|
|
#include "df/plant.h"
|
|
|
|
#include "df/descriptor_pattern.h"
|
|
|
|
#include "df/plant_raw_flags.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "df/region_map_entry.h"
|
|
|
|
#include "df/region_map_entry.h"
|
|
|
|
#include "df/world_region_details.h"
|
|
|
|
|
|
|
|
#include "df/world_region.h"
|
|
|
|
|
|
|
|
#include "df/army.h"
|
|
|
|
|
|
|
|
#include "df/army_flags.h"
|
|
|
|
|
|
|
|
#include "df/world_geo_biome.h"
|
|
|
|
|
|
|
|
#include "df/world_geo_layer.h"
|
|
|
|
|
|
|
|
#include "df/world_population.h"
|
|
|
|
|
|
|
|
#include "df/world_site.h"
|
|
|
|
|
|
|
|
#include "df/world_site_realization.h"
|
|
|
|
|
|
|
|
#include "df/site_realization_building.h"
|
|
|
|
#include "df/site_realization_building.h"
|
|
|
|
#include "df/site_realization_building_info_castle_towerst.h"
|
|
|
|
#include "df/site_realization_building_info_castle_towerst.h"
|
|
|
|
#include "df/site_realization_building_info_castle_wallst.h"
|
|
|
|
#include "df/site_realization_building_info_castle_wallst.h"
|
|
|
|
#include "df/site_realization_building_info_trenchesst.h"
|
|
|
|
#include "df/site_realization_building_info_trenchesst.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "df/unit.h"
|
|
|
|
|
|
|
|
#include "df/creature_raw.h"
|
|
|
|
|
|
|
|
#include "df/caste_raw.h"
|
|
|
|
|
|
|
|
#include "df/tissue.h"
|
|
|
|
#include "df/tissue.h"
|
|
|
|
|
|
|
|
#include "df/ui.h"
|
|
|
|
#include "df/enabler.h"
|
|
|
|
#include "df/unit.h"
|
|
|
|
#include "df/graphic.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "df/viewscreen_choose_start_sitest.h"
|
|
|
|
#include "df/viewscreen_choose_start_sitest.h"
|
|
|
|
|
|
|
|
#include "df/world.h"
|
|
|
|
|
|
|
|
#include "df/world_data.h"
|
|
|
|
|
|
|
|
#include "df/world_geo_biome.h"
|
|
|
|
|
|
|
|
#include "df/world_geo_layer.h"
|
|
|
|
|
|
|
|
#include "df/world_history.h"
|
|
|
|
|
|
|
|
#include "df/world_population.h"
|
|
|
|
|
|
|
|
#include "df/world_region.h"
|
|
|
|
|
|
|
|
#include "df/world_region_details.h"
|
|
|
|
|
|
|
|
#include "df/world_site.h"
|
|
|
|
|
|
|
|
#include "df/world_site_realization.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "df/bp_appearance_modifier.h"
|
|
|
|
#if DF_VERSION > 40001
|
|
|
|
#include "df/body_part_layer_raw.h"
|
|
|
|
#include "df/plant_growth.h"
|
|
|
|
#include "df/body_appearance_modifier.h"
|
|
|
|
#include "df/plant_growth_print.h"
|
|
|
|
|
|
|
|
#include "df/plant_tree_info.h"
|
|
|
|
//DFhack specific headers
|
|
|
|
#include "df/plant_tree_tile.h"
|
|
|
|
#include "modules/Maps.h"
|
|
|
|
#endif
|
|
|
|
#include "modules/MapCache.h"
|
|
|
|
|
|
|
|
#include "modules/Materials.h"
|
|
|
|
|
|
|
|
#include "modules/Gui.h"
|
|
|
|
|
|
|
|
#include "modules/Translation.h"
|
|
|
|
|
|
|
|
#include "modules/Items.h"
|
|
|
|
|
|
|
|
#include "modules/Buildings.h"
|
|
|
|
|
|
|
|
#include "modules/Units.h"
|
|
|
|
|
|
|
|
#include "modules/World.h"
|
|
|
|
|
|
|
|
#include "TileTypes.h"
|
|
|
|
|
|
|
|
#include "MiscUtils.h"
|
|
|
|
|
|
|
|
#include "Hooks.h"
|
|
|
|
|
|
|
|
#include "SDL_events.h"
|
|
|
|
|
|
|
|
#include "SDL_keyboard.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
#include <cstdio>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "RemoteFortressReader.pb.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "RemoteServer.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using namespace DFHack;
|
|
|
|
using namespace DFHack;
|
|
|
|
using namespace df::enums;
|
|
|
|
using namespace df::enums;
|
|
|
@ -113,7 +104,8 @@ using namespace RemoteFortressReader;
|
|
|
|
using namespace std;
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
|
|
DFHACK_PLUGIN("RemoteFortressReader");
|
|
|
|
DFHACK_PLUGIN("RemoteFortressReader");
|
|
|
|
#if DF_VERSION < 40024
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef REQUIRE_GLOBAL
|
|
|
|
using namespace df::global;
|
|
|
|
using namespace df::global;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
REQUIRE_GLOBAL(world);
|
|
|
|
REQUIRE_GLOBAL(world);
|
|
|
@ -2502,7 +2494,7 @@ static void CopyLocalMap(df::world_data * worldData, df::world_region_details* w
|
|
|
|
out_wall->set_end_z(wall_info->end_z);
|
|
|
|
out_wall->set_end_z(wall_info->end_z);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2603,7 +2595,7 @@ static command_result GetCreatureRaws(color_ostream &stream, const EmptyMessage
|
|
|
|
if (!orig_part)
|
|
|
|
if (!orig_part)
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
auto send_part = send_caste->add_body_parts();
|
|
|
|
auto send_part = send_caste->add_body_parts();
|
|
|
|
|
|
|
|
|
|
|
|
send_part->set_token(orig_part->token);
|
|
|
|
send_part->set_token(orig_part->token);
|
|
|
|
send_part->set_category(orig_part->category);
|
|
|
|
send_part->set_category(orig_part->category);
|
|
|
|
send_part->set_parent(orig_part->con_part_id);
|
|
|
|
send_part->set_parent(orig_part->con_part_id);
|
|
|
@ -2712,7 +2704,7 @@ static command_result GetCreatureRaws(color_ostream &stream, const EmptyMessage
|
|
|
|
send_caste->set_description(orig_caste->description);
|
|
|
|
send_caste->set_description(orig_caste->description);
|
|
|
|
send_caste->set_adult_size(orig_caste->misc.adult_size);
|
|
|
|
send_caste->set_adult_size(orig_caste->misc.adult_size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (int j = 0; j < orig_creature->tissue.size(); j++)
|
|
|
|
for (int j = 0; j < orig_creature->tissue.size(); j++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
auto orig_tissue = orig_creature->tissue[j];
|
|
|
|
auto orig_tissue = orig_creature->tissue[j];
|
|
|
|