From 5f94536fb1f834ea6eac95218bcb994fbf54a171 Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Thu, 25 Jan 2024 22:12:26 +0100 Subject: [PATCH 01/10] First attempt at zone display --- src/clzones.cpp | 291 ++++++++++++++++++++++++++++++++++++++++++++++++ src/clzones.h | 11 +- src/game.cpp | 22 +++- 3 files changed, 317 insertions(+), 7 deletions(-) diff --git a/src/clzones.cpp b/src/clzones.cpp index 9ec467fc76713..843ba73f65546 100644 --- a/src/clzones.cpp +++ b/src/clzones.cpp @@ -50,6 +50,72 @@ static const item_category_id item_category_food( "food" ); static const itype_id itype_disassembly( "disassembly" ); static const itype_id itype_null( "null" ); +static const field_type_str_id fd_ammo_loot_zone( "fd_ammo_loot_zone" ); +static const field_type_str_id fd_armor_loot_zone( "fd_armor_loot_zone" ); +static const field_type_str_id fd_artifacts_loot_zone( "fd_artifacts_loot_zone" ); +static const field_type_str_id fd_auto_drink_zone( "fd_auto_drink_zone" ); +static const field_type_str_id fd_auto_eat_zone( "fd_auto_eat_zone" ); +static const field_type_str_id fd_basecamp_food_zone( "fd_basecamp_food_zone" ); +static const field_type_str_id fd_basecamp_storage_zone( "fd_basecamp_storage_zone" ); +static const field_type_str_id fd_bionics_loot_zone( "fd_bionics_loot_zone" ); +static const field_type_str_id fd_books_loot_zone( "fd_books_loot_zone" ); +static const field_type_str_id fd_chemical_loot_zone( "fd_chemical_loot_zone" ); +static const field_type_str_id fd_chop_trees_zone( "fd_chop_trees_zone" ); +static const field_type_str_id fd_clothing_loot_zone( "fd_clothing_loot_zone" ); +static const field_type_str_id fd_construction_blueprint_zone( "fd_construction_blueprint_zone" ); +static const field_type_str_id fd_containers_loot_zone( "fd_containers_loot_zone" ); +static const field_type_str_id fd_corpses_loot_zone( "fd_corpses_loot_zone" ); +static const field_type_str_id fd_currency_loot_zone( "fd_currency_loot_zone" ); +static const field_type_str_id fd_custom_loot_zone( "fd_custom_loot_zone" ); +static const field_type_str_id fd_default_loot_zone( "fd_default_loot_zone" ); +static const field_type_str_id fd_disassembly_work_zone( "fd_disassembly_work_zone" ); +static const field_type_str_id fd_drink_loot_zone( "fd_drink_loot_zone" ); +static const field_type_str_id fd_drugs_loot_zone( "fd_drugs_loot_zone" ); +static const field_type_str_id fd_farm_plot_zone( "fd_farm_plot_zone" ); +static const field_type_str_id fd_filthy_armor_loot_zone( "fd_filthy_armor_loot_zone" ); +static const field_type_str_id fd_filthy_clothing_loot_zone( "fd_filthy_clothing_loot_zone" ); +static const field_type_str_id fd_firewood_source_zone( "fd_firewood_source_zone" ); +static const field_type_str_id fd_fishing_spot_zone( "fd_fishing_spot_zone" ); +static const field_type_str_id fd_food_loot_zone( "fd_food_loot_zone" ); +static const field_type_str_id fd_fuel_loot_zone( "fd_fuel_loot_zone" ); +static const field_type_str_id fd_guns_loot_zone( "fd_guns_loot_zone" ); +static const field_type_str_id fd_ignore_loot_zone( "fd_ignore_loot_zone" ); +static const field_type_str_id fd_ignore_favorites_loot_zone( "fd_ignore_favorites_loot_zone" ); +static const field_type_str_id fd_item_group_loot_zone( "fd_item_group_loot_zone" ); +static const field_type_str_id fd_keys_loot_zone( "fd_keys_loot_zone" ); +static const field_type_str_id fd_magazines_loot_zone( "fd_magazines_loot_zone" ); +static const field_type_str_id fd_manuals_loot_zone( "fd_manuals_loot_zone" ); +static const field_type_str_id fd_maps_loot_zone( "fd_maps_loot_zone" ); +static const field_type_str_id +fd_martial_arts_manuals_loot_zone( "fd_martial_arts_manuals_loot_zone" ); +static const field_type_str_id fd_mine_terrain_zone( "fd_mine_terrain_zone" ); +static const field_type_str_id fd_mods_loot_zone( "fd_mods_loot_zone" ); +static const field_type_str_id fd_mop_tile_zone( "fd_mop_tile_zone" ); +static const field_type_str_id fd_mutagens_loot_zone( "fd_mutagens_loot_zone" ); +static const field_type_str_id fd_no_auto_pickup_zone( "fd_no_auto_pickup_zone" ); +static const field_type_str_id fd_no_npc_pickup_zone( "fd_no_npc_pickup_zone" ); +static const field_type_str_id fd_npc_ignore_sounds_zone( "fd_npc_ignore_sounds_zone" ); +static const field_type_str_id fd_npc_investigation_area_zone( "fd_npc_investigation_area_zone" ); +static const field_type_str_id fd_npc_retreat_zone( "fd_npc_retreat_zone" ); +static const field_type_str_id fd_other_loot_zone( "fd_other_loot_zone" ); +static const field_type_str_id fd_perishable_drink_loot_zone( "fd_perishable_drink_loot_zone" ); +static const field_type_str_id fd_perishable_food_loot_zone( "fd_perishable_food_loot_zone" ); +static const field_type_str_id fd_seeds_loot_zone( "fd_seeds_loot_zone" ); +static const field_type_str_id fd_spare_parts_loot_zone( "fd_spare_parts_loot_zone" ); +static const field_type_str_id fd_start_point_zone( "fd_start_point_zone" ); +static const field_type_str_id fd_strip_corpses_loot_zone( "fd_strip_corpses_loot_zone" ); +static const field_type_str_id fd_tool_magazines_loot_zone( "fd_tool_magazines_loot_zone" ); +static const field_type_str_id fd_tools_loot_zone( "fd_tools_loot_zone" ); +static const field_type_str_id fd_traps_loot_zone( "fd_traps_loot_zone" ); +static const field_type_str_id fd_unsorted_loot_zone( "fd_unsorted_loot_zone" ); +static const field_type_str_id fd_vehicle_parts_loot_zone( "fd_vehicle_parts_loot_zone" ); +static const field_type_str_id fd_weapons_loot_zone( "fd_weapons_loot_zone" ); +static const field_type_str_id fd_wood_loot_zone( "fd_wood_loot_zone" ); +static const field_type_str_id fd_unload_everything_loot_zone( "fd_unload_everything_loot_zone" ); +static const field_type_str_id fd_vehicle_deconstruct_zone( "fd_vehicle_deconstruct_zone" ); +static const field_type_str_id fd_vehicle_patrol_zone( "fd_vehicle_patrol_zone" ); +static const field_type_str_id fd_vehicle_repair_zone( "fd_vehicle_repair_zone" ); + static const zone_type_id zone_type_AUTO_DRINK( "AUTO_DRINK" ); static const zone_type_id zone_type_AUTO_EAT( "AUTO_EAT" ); static const zone_type_id zone_type_CAMP_FOOD( "CAMP_FOOD" ); @@ -59,28 +125,62 @@ static const zone_type_id zone_type_CONSTRUCTION_BLUEPRINT( "CONSTRUCTION_BLUEPR static const zone_type_id zone_type_DISASSEMBLE( "DISASSEMBLE" ); static const zone_type_id zone_type_FARM_PLOT( "FARM_PLOT" ); static const zone_type_id zone_type_FISHING_SPOT( "FISHING_SPOT" ); +static const zone_type_id zone_type_LOOT_AMMO( "LOOT_AMMO" ); +static const zone_type_id zone_type_LOOT_ARMOR( "LOOT_ARMOR" ); +static const zone_type_id zone_type_LOOT_ARTIFACTS( "LOOT_ARTIFACTS" ); +static const zone_type_id zone_type_LOOT_BIONICS( "LOOT_BIONICS" ); +static const zone_type_id zone_type_LOOT_BOOKS( "LOOT_BOOKS" ); +static const zone_type_id zone_type_LOOT_CHEMICAL( "LOOT_CHEMICAL" ); +static const zone_type_id zone_type_LOOT_CLOTHING( "LOOT_CLOTHING" ); +static const zone_type_id zone_type_LOOT_CONTAINERS( "LOOT_CONTAINERS" ); static const zone_type_id zone_type_LOOT_CORPSE( "LOOT_CORPSE" ); +static const zone_type_id zone_type_LOOT_CURRENCY( "LOOT_CURRENCY" ); static const zone_type_id zone_type_LOOT_CUSTOM( "LOOT_CUSTOM" ); static const zone_type_id zone_type_LOOT_DEFAULT( "LOOT_DEFAULT" ); static const zone_type_id zone_type_LOOT_DRINK( "LOOT_DRINK" ); +static const zone_type_id zone_type_LOOT_DRUGS( "LOOT_DRUGS" ); +static const zone_type_id zone_type_LOOT_FARMOR( "LOOT_FARMOR" ); +static const zone_type_id zone_type_LOOT_FCLOTHING( "LOOT_FCLOTHING" ); static const zone_type_id zone_type_LOOT_FOOD( "LOOT_FOOD" ); +static const zone_type_id zone_type_LOOT_FUEL( "LOOT_FUEL" ); +static const zone_type_id zone_type_LOOT_GUNS( "LOOT_GUNS" ); static const zone_type_id zone_type_LOOT_IGNORE( "LOOT_IGNORE" ); +static const zone_type_id zone_type_LOOT_IGNORE_FAVORITES( "LOOT_IGNORE_FAVORITES" ); static const zone_type_id zone_type_LOOT_ITEM_GROUP( "LOOT_ITEM_GROUP" ); +static const zone_type_id zone_type_LOOT_KEYS( "LOOT_KEYS" ); +static const zone_type_id zone_type_LOOT_MAGAZINES( "LOOT_MAGAZINES" ); +static const zone_type_id zone_type_LOOT_MANUALS( "LOOT_MANUALS" ); +static const zone_type_id zone_type_LOOT_MAPS( "LOOT_MAPS" ); +static const zone_type_id zone_type_LOOT_MA_MANUALS( "LOOT_MA_MANUALS" ); +static const zone_type_id zone_type_LOOT_MODS( "LOOT_MODS" ); +static const zone_type_id zone_type_LOOT_MUTAGENS( "LOOT_MUTAGENS" ); +static const zone_type_id zone_type_LOOT_OTHER( "LOOT_OTHER" ); static const zone_type_id zone_type_LOOT_PDRINK( "LOOT_PDRINK" ); static const zone_type_id zone_type_LOOT_PFOOD( "LOOT_PFOOD" ); static const zone_type_id zone_type_LOOT_SEEDS( "LOOT_SEEDS" ); +static const zone_type_id zone_type_LOOT_SPARE_PARTS( "LOOT_SPARE_PARTS" ); +static const zone_type_id zone_type_LOOT_TOOL_MAGAZINE( "LOOT_TOOL_MAGAZINE" ); +static const zone_type_id zone_type_LOOT_TOOLS( "LOOT_TOOLS" ); +static const zone_type_id zone_type_LOOT_TRAPS( "LOOT_TRAPS" ); static const zone_type_id zone_type_LOOT_UNSORTED( "LOOT_UNSORTED" ); +static const zone_type_id zone_type_LOOT_VEHICLE_PARTS( "LOOT_VEHICLE_PARTS" ); +static const zone_type_id zone_type_LOOT_WEAPONS( "LOOT_WEAPONS" ); static const zone_type_id zone_type_LOOT_WOOD( "LOOT_WOOD" ); static const zone_type_id zone_type_MINING( "MINING" ); static const zone_type_id zone_type_MOPPING( "MOPPING" ); static const zone_type_id zone_type_NO_AUTO_PICKUP( "NO_AUTO_PICKUP" ); static const zone_type_id zone_type_NO_NPC_PICKUP( "NO_NPC_PICKUP" ); +static const zone_type_id zone_type_NPC_NO_INVESTIGATE( "NPC_NO_INVESTIGATE" ); +static const zone_type_id zone_type_NPC_INVESTIGATE_ONLY( "NPC_INVESTIGATE_ONLY" ); +static const zone_type_id zone_type_NPC_RETREAT( "NPC_RETREAT" ); static const zone_type_id zone_type_SOURCE_FIREWOOD( "SOURCE_FIREWOOD" ); static const zone_type_id zone_type_STRIP_CORPSES( "STRIP_CORPSES" ); static const zone_type_id zone_type_UNLOAD_ALL( "UNLOAD_ALL" ); static const zone_type_id zone_type_VEHICLE_DECONSTRUCT( "VEHICLE_DECONSTRUCT" ); static const zone_type_id zone_type_VEHICLE_PATROL( "VEHICLE_PATROL" ); static const zone_type_id zone_type_VEHICLE_REPAIR( "VEHICLE_REPAIR" ); +static const zone_type_id zone_type_ZONE_START_POINT( "ZONE_START_POINT" ); + const std::vector ignorable_zone_types = { zone_type_AUTO_EAT, @@ -732,6 +832,188 @@ void zone_data::set_temporary_disabled( const bool enabled_arg ) temporarily_disabled = enabled_arg; } +static field_type_str_id field_of( zone_data *zone ) +{ + zone_type_id type = zone->get_type(); + + if( type == zone_type_AUTO_DRINK ) { + return fd_auto_drink_zone; + } else if( type == zone_type_AUTO_EAT ) { + return fd_auto_eat_zone; + } else if( type == zone_type_CAMP_FOOD ) { + return fd_basecamp_food_zone; + } else if( type == zone_type_CAMP_STORAGE ) { + return fd_basecamp_storage_zone; + } else if( type == zone_type_CHOP_TREES ) { + return fd_chop_trees_zone; + } else if( type == zone_type_CONSTRUCTION_BLUEPRINT ) { + return fd_construction_blueprint_zone; + } else if( type == zone_type_DISASSEMBLE ) { + return fd_disassembly_work_zone; + } else if( type == zone_type_FARM_PLOT ) { + return fd_farm_plot_zone; + } else if( type == zone_type_FISHING_SPOT ) { + return fd_fishing_spot_zone; + } else if( type == zone_type_LOOT_AMMO ) { + return fd_ammo_loot_zone; + } else if( type == zone_type_LOOT_ARMOR ) { + return fd_armor_loot_zone; + } else if( type == zone_type_LOOT_ARTIFACTS ) { + return fd_artifacts_loot_zone; + } else if( type == zone_type_LOOT_BIONICS ) { + return fd_bionics_loot_zone; + } else if( type == zone_type_LOOT_BOOKS ) { + return fd_books_loot_zone; + } else if( type == zone_type_LOOT_CHEMICAL ) { + return fd_chemical_loot_zone; + } else if( type == zone_type_LOOT_CLOTHING ) { + return fd_clothing_loot_zone; + } else if( type == zone_type_LOOT_CONTAINERS ) { + return fd_containers_loot_zone; + } else if( type == zone_type_LOOT_CORPSE ) { + return fd_corpses_loot_zone; + } else if( type == zone_type_LOOT_CURRENCY ) { + return fd_currency_loot_zone; + } else if( type == zone_type_LOOT_CUSTOM ) { + return fd_custom_loot_zone; + } else if( type == zone_type_LOOT_DEFAULT ) { + return fd_default_loot_zone; + } else if( type == zone_type_LOOT_DRINK ) { + return fd_drink_loot_zone; + } else if( type == zone_type_LOOT_DRUGS ) { + return fd_drugs_loot_zone; + } else if( type == zone_type_LOOT_FARMOR ) { + return fd_filthy_armor_loot_zone; + } else if( type == zone_type_LOOT_FCLOTHING ) { + return fd_filthy_clothing_loot_zone; + } else if( type == zone_type_LOOT_FOOD ) { + return fd_food_loot_zone; + } else if( type == zone_type_LOOT_FUEL ) { + return fd_fuel_loot_zone; + } else if( type == zone_type_LOOT_GUNS ) { + return fd_guns_loot_zone; + } else if( type == zone_type_LOOT_IGNORE ) { + return fd_ignore_loot_zone; + } else if( type == zone_type_LOOT_IGNORE_FAVORITES ) { + return fd_ignore_favorites_loot_zone; + } else if( type == zone_type_LOOT_ITEM_GROUP ) { //### not in UI list... + return fd_item_group_loot_zone; + } else if( type == zone_type_LOOT_KEYS ) { + return fd_keys_loot_zone; + } else if( type == zone_type_LOOT_MAGAZINES ) { + return fd_magazines_loot_zone; + } else if( type == zone_type_LOOT_MANUALS ) { + return fd_manuals_loot_zone; + } else if( type == zone_type_LOOT_MAPS ) { + return fd_maps_loot_zone; + } else if( type == zone_type_LOOT_MA_MANUALS ) { + return fd_martial_arts_manuals_loot_zone; + } else if( type == zone_type_LOOT_MODS ) { + return fd_mods_loot_zone; + } else if( type == zone_type_LOOT_MUTAGENS ) { + return fd_mutagens_loot_zone; + } else if( type == zone_type_LOOT_OTHER ) { + return fd_other_loot_zone; + } else if( type == zone_type_LOOT_PDRINK ) { + return fd_perishable_drink_loot_zone; + } else if( type == zone_type_LOOT_PFOOD ) { + return fd_perishable_food_loot_zone; + } else if( type == zone_type_LOOT_SEEDS ) { + return fd_seeds_loot_zone; + } else if( type == zone_type_LOOT_SPARE_PARTS ) { + return fd_spare_parts_loot_zone; + } else if( type == zone_type_STRIP_CORPSES ) { + return fd_strip_corpses_loot_zone; + } else if( type == zone_type_LOOT_TOOL_MAGAZINE ) { + return fd_tool_magazines_loot_zone; + } else if( type == zone_type_LOOT_TOOLS ) { + return fd_tools_loot_zone; + } else if( type == zone_type_LOOT_TRAPS ) { + return fd_traps_loot_zone; + } else if( type == zone_type_UNLOAD_ALL ) { + return fd_unload_everything_loot_zone; + } else if( type == zone_type_LOOT_UNSORTED ) { + return fd_unsorted_loot_zone; + } else if( type == zone_type_LOOT_VEHICLE_PARTS ) { + return fd_vehicle_parts_loot_zone; + } else if( type == zone_type_LOOT_WEAPONS ) { + return fd_weapons_loot_zone; + } else if( type == zone_type_LOOT_WOOD ) { + return fd_wood_loot_zone; + } else if( type == zone_type_MINING ) { + return fd_mine_terrain_zone; + } else if( type == zone_type_MOPPING ) { + return fd_mop_tile_zone; + } else if( type == zone_type_NO_AUTO_PICKUP ) { + return fd_no_auto_pickup_zone; + } else if( type == zone_type_NO_NPC_PICKUP ) { + return fd_no_npc_pickup_zone; + } else if( type == zone_type_NPC_NO_INVESTIGATE ) { + return fd_npc_ignore_sounds_zone; + } else if( type == zone_type_NPC_INVESTIGATE_ONLY ) { + return fd_npc_investigation_area_zone; + } else if( type == zone_type_NPC_RETREAT ) { + return fd_npc_retreat_zone; + } else if( type == zone_type_SOURCE_FIREWOOD ) { + return fd_firewood_source_zone; + } else if( type == zone_type_ZONE_START_POINT ) { + return fd_start_point_zone; + } else if( type == zone_type_VEHICLE_DECONSTRUCT ) { + return fd_vehicle_deconstruct_zone; + } else if( type == zone_type_VEHICLE_PATROL ) { + return fd_vehicle_patrol_zone; + } else if( type == zone_type_VEHICLE_REPAIR ) { + return fd_vehicle_repair_zone; + } else { + return fd_null; + } +} + +void zone_data::toggle_display() +{ + if( this->is_vehicle ) { + popup( colorize( _( "Zones tied to vehicles cannot be displayed" ), c_magenta ) ); + } + + is_displayed = !is_displayed; + + std::unique_ptr p_update_tmap = std::make_unique(); + tinymap &update_tmap = *p_update_tmap; + + //### failing to get project_remain to accept my parameters, and so resorting to crude alternative. + // Thought it should be: + // point_abs_sm quotient; + // tripoint_sm_ms remainder; + // std::tie(quotient, remainder) = coords::project_remain(get_start_point()); + const tripoint_abs_sm sm_start_pos = coords::project_to( get_start_point() ); + tripoint_abs_ms ms_start_projection = coords::project_to < coords::ms >( sm_start_pos ); + tripoint_rel_ms start_remainder = get_start_point() - ms_start_projection; + // Assuming the code downstream can handle any relative location of start and end. + tripoint_rel_ms end_remainder = get_end_point() - ms_start_projection; + + update_tmap.load( sm_start_pos, true ); + + //### Think there is an iterator for all coordinates in an X/Y block, but can't find it. + int x_start = std::min( start_remainder.x(), end_remainder.x() ); + int x_end = std::max( start_remainder.x(), end_remainder.x() ); + int y_start = std::min( start_remainder.y(), end_remainder.y() ); + int y_end = std::max( start_remainder.y(), end_remainder.y() ); + int z = get_start_point().z(); + field_type_str_id field = field_of( this ); + + if( field != fd_null ) { + for( int x = x_start; x <= x_end; x++ ) { + for( int y = y_start; y <= y_end; y++ ) { + if( is_displayed ) { + update_tmap.add_field( tripoint( x, y, z ), field, 1, time_duration::from_turns( 0 ), false ); + } else { + update_tmap.delete_field( tripoint( x, y, z ), field ); + } + } + } + } +} + void zone_data::set_is_vehicle( const bool is_vehicle_arg ) { is_vehicle = is_vehicle_arg; @@ -1334,6 +1616,9 @@ bool zone_manager::remove( zone_data &zone ) { for( auto it = zones.begin(); it != zones.end(); ++it ) { if( &zone == &*it ) { + if( zone.get_is_displayed() ) { + zone.toggle_display(); + } // if removing a personal zone reduce the number of counted personal zones if( it->get_is_personal() ) { num_personal_zones--; @@ -1524,6 +1809,7 @@ void zone_data::serialize( JsonOut &json ) const json.member( "cached_shift", cached_shift ); json.member( "start", start ); json.member( "end", end ); + json.member( "is_displayed", is_displayed ); options->serialize( json ); json.end_object(); } @@ -1577,6 +1863,11 @@ void zone_data::deserialize( const JsonObject &data ) data.read( "start", start ); data.read( "end", end ); } + if( data.has_member( "is_displayed" ) ) { + data.read( "is_displayed", is_displayed ); + } else { + is_displayed = false; + } auto new_options = zone_options::create( type ); new_options->deserialize( data ); options = new_options; diff --git a/src/clzones.h b/src/clzones.h index 7bc4adf83af1e..9df789ce37f34 100644 --- a/src/clzones.h +++ b/src/clzones.h @@ -361,6 +361,7 @@ class zone_data // for personal zones a cached value for the global shift to where the player was at activity start tripoint_abs_ms cached_shift; shared_ptr_fast options; + bool is_displayed; public: zone_data() { @@ -374,12 +375,14 @@ class zone_data end = tripoint_zero; cached_shift = {}; options = nullptr; + is_displayed = false; } zone_data( const std::string &_name, const zone_type_id &_type, const faction_id &_faction, bool _invert, const bool _enabled, const tripoint &_start, const tripoint &_end, - const shared_ptr_fast &_options = nullptr, bool personal = false ) { + const shared_ptr_fast &_options = nullptr, bool personal = false, + bool _is_displayed = false ) { name = _name; type = _type; faction = _faction; @@ -389,6 +392,7 @@ class zone_data is_personal = personal; start = _start; end = _end; + is_displayed = _is_displayed; // ensure that supplied options is of correct class if( _options == nullptr || !zone_options::is_valid( type, *_options ) ) { @@ -406,6 +410,7 @@ class zone_data bool update_avatar = true, bool skip_cache_update = false ); void set_enabled( bool enabled_arg ); void set_temporary_disabled( bool enabled_arg ); + void toggle_display(); void set_is_vehicle( bool is_vehicle_arg ); static std::string make_type_hash( const zone_type_id &_type, const faction_id &_fac ) { @@ -447,6 +452,10 @@ class zone_data return temporarily_disabled; } + bool get_is_displayed() const { + return is_displayed; + } + bool get_is_vehicle() const { return is_vehicle; } diff --git a/src/game.cpp b/src/game.cpp index 28fd9203abd77..4425453f46668 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -6774,22 +6774,26 @@ static void zones_manager_shortcuts( const catacurses::window &w_info, faction_i tmpx = 1; tmpx += shortcut_print( w_info, point( tmpx, 2 ), c_white, c_light_green, + _( "-Toggle zone display" ) ); + + tmpx = 1; + tmpx += shortcut_print( w_info, point( tmpx, 3 ), c_white, c_light_green, _( "-Enable personal" ) ) + 2; - shortcut_print( w_info, point( tmpx, 2 ), c_white, c_light_green, + shortcut_print( w_info, point( tmpx, 3 ), c_white, c_light_green, _( "-Disable personal" ) ); tmpx = 1; - tmpx += shortcut_print( w_info, point( tmpx, 3 ), c_white, c_light_green, + tmpx += shortcut_print( w_info, point( tmpx, 4 ), c_white, c_light_green, _( "<+-> Move up/down" ) ) + 2; - shortcut_print( w_info, point( tmpx, 3 ), c_white, c_light_green, _( "-Edit" ) ); + shortcut_print( w_info, point( tmpx, 4 ), c_white, c_light_green, _( "-Edit" ) ); tmpx = 1; - tmpx += shortcut_print( w_info, point( tmpx, 4 ), c_white, c_light_green, + tmpx += shortcut_print( w_info, point( tmpx, 5 ), c_white, c_light_green, _( "how all / hide distant" ) ) + 2; - shortcut_print( w_info, point( tmpx, 4 ), c_white, c_light_green, _( "ap" ) ); + shortcut_print( w_info, point( tmpx, 5 ), c_white, c_light_green, _( "ap" ) ); if( debug_mode ) { - shortcut_print( w_info, point( 1, 5 ), c_light_red, c_light_green, + shortcut_print( w_info, point( 1, 6 ), c_light_red, c_light_green, string_format( _( "Shown action: %s" ), faction.str() ) ); } @@ -6897,6 +6901,7 @@ void game::zones_manager() ctxt.register_action( "SHOW_ZONE_ON_MAP" ); ctxt.register_action( "ENABLE_ZONE" ); ctxt.register_action( "DISABLE_ZONE" ); + ctxt.register_action( "TOGGLE_ZONE_DISPLAY" ); ctxt.register_action( "ENABLE_PERSONAL_ZONES" ); ctxt.register_action( "DISABLE_PERSONAL_ZONES" ); ctxt.register_action( "SHOW_ALL_ZONES" ); @@ -7389,6 +7394,11 @@ void game::zones_manager() zones[active_index].get().set_enabled( false ); stuff_changed = true; + + } else if( action == "TOGGLE_ZONE_DISPLAY" ) { + zones[active_index].get().toggle_display(); + stuff_changed = true; + } else if( action == "ENABLE_PERSONAL_ZONES" ) { bool zones_changed = false; From dcaa18929a8553c7f0525fde5765c0f28f24ed87 Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Thu, 25 Jan 2024 22:13:20 +0100 Subject: [PATCH 02/10] Defined fields for all zones plus zone sorting and rearranging --- data/json/field_type.json | 448 ++++++++++++++++++++++++++++++++++++++ data/json/loot_zones.json | 274 +++++++++++------------ data/json/zones.json | 38 +++- 3 files changed, 604 insertions(+), 156 deletions(-) diff --git a/data/json/field_type.json b/data/json/field_type.json index 8e2b04307a668..a0b7f626d2b88 100644 --- a/data/json/field_type.json +++ b/data/json/field_type.json @@ -1993,5 +1993,453 @@ "priority": 1, "display_field": true, "looks_like": "fd_shadow" + }, + { + "id": "fd_auto_drink_zone", + "type": "field_type", + "intensity_levels": [ { "name": "auto drink zone", "sym": "D", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_auto_eat_zone", + "type": "field_type", + "intensity_levels": [ { "name": "auto eat zone", "sym": "E", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_basecamp_food_zone", + "type": "field_type", + "intensity_levels": [ { "name": "basecamp food zone", "sym": "F", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_basecamp_storage_zone", + "type": "field_type", + "intensity_levels": [ { "name": "basecamp storage zone", "sym": "S", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_chop_trees_zone", + "type": "field_type", + "intensity_levels": [ { "name": "chop trees zone", "sym": "T", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_construction_blueprint_zone", + "type": "field_type", + "intensity_levels": [ { "name": "construction blueprint zone", "sym": "#", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_disassembly_work_zone", + "type": "field_type", + "intensity_levels": [ { "name": "disassembly work zone", "sym": "-", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_farm_plot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "farm plot zone", "sym": "P", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_fishing_spot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "fishing spot zone", "sym": "W", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_ammo_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "ammo loot zone", "sym": "a", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_armor_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "armor loot zone", "sym": "A", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_artifacts_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "artifacts loot zone", "sym": "*", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_bionics_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "bionics loot zone", "sym": "b", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_books_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "books loot zone", "sym": "B", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_chemical_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "chemical loot zone", "sym": "C", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_clothing_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "clothing loot zone", "sym": "c", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_containers_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "containers loot zone", "sym": ">", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_corpses_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "corpses loot zone", "sym": "@", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_currency_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "currency loot zone", "sym": "$", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_custom_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "custom loot zone", "sym": "?", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_default_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "default loot zone", "sym": "!", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_drink_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "drink loot zone", "sym": "d", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_drugs_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "drugs loot zone", "sym": "+", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_filthy_armor_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "filthy armor loot zone", "sym": "/", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_filthy_clothing_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "filthy clothing loot zone", "sym": "\\", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_food_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "food loot zone", "sym": "f", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_fuel_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "fuel loot zone", "sym": "'", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_guns_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "guns loot zone", "sym": "g", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_ignore_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "ignore loot zone", "sym": "i", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_ignore_favorites_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "ignore favorites loot zone", "sym": "I", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_item_group_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "item group loot zone", "sym": "9", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_keys_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "keys loot zone", "sym": "k", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_magazines_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "magazines loot zone", "sym": "m", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_manuals_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "manuals loot zone", "sym": "M", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_maps_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "maps loot zone", "sym": "e", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_martial_arts_manuals_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "martial arts manuals loot zone", "sym": "ö", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_mods_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "mods loot zone", "sym": "h", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_mutagens_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "mutagens loot zone", "sym": "H", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_other_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "other loot zone", "sym": "o", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_perishable_drink_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "perishable drink loot zone", "sym": "p", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_perishable_food_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "perishable food loot zone", "sym": "P", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_seeds_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "seeds loot zone", "sym": "s", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_spare_parts_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "spare parts loot zone", "sym": "S", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_strip_corpses_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "strip_corpses loot zone", "sym": "j", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_tool_magazines_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "tool_magazines loot zone", "sym": "J", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_tools_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "tools loot zone", "sym": "t", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_traps_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "traps loot zone", "sym": "^", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_unload_everything_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "unload everything loot zone", "sym": "u", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_unsorted_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "unsorted loot zone", "sym": "U", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_vehicle_parts_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "vehicle parts loot zone", "sym": "v", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_weapons_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "weapons loot zone", "sym": "w", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_wood_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "wood loot zone", "sym": ";", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_mine_terrain_zone", + "type": "field_type", + "intensity_levels": [ { "name": "mine terrain zone", "sym": "x", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_mop_tile_zone", + "type": "field_type", + "intensity_levels": [ { "name": "mop tile zone", "sym": "~", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_no_auto_pickup_zone", + "type": "field_type", + "intensity_levels": [ { "name": "no auto pickup zone", "sym": "1", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_no_npc_pickup_zone", + "type": "field_type", + "intensity_levels": [ { "name": "no npc pickup zone", "sym": "2", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_npc_ignore_sounds_zone", + "type": "field_type", + "intensity_levels": [ { "name": "npc_ignore_sounds zone", "sym": "3", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_npc_investigation_area_zone", + "type": "field_type", + "intensity_levels": [ { "name": "npc investigation area zone", "sym": "4", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_npc_retreat_zone", + "type": "field_type", + "intensity_levels": [ { "name": "npc retreat zone", "sym": "5", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_firewood_source_zone", + "type": "field_type", + "intensity_levels": [ { "name": "firewood source zone", "sym": "6", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_start_point_zone", + "type": "field_type", + "intensity_levels": [ { "name": "start point zone", "sym": "7", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_vehicle_deconstruct_zone", + "type": "field_type", + "intensity_levels": [ { "name": "vehicle deconstruct zone", "sym": "y", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_vehicle_patrol_zone", + "type": "field_type", + "intensity_levels": [ { "name": "vehicle patrol zone", "sym": "8", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_vehicle_repair_zone", + "type": "field_type", + "intensity_levels": [ { "name": "vehicle repair zone", "sym": "Y", "dangerous": false } ], + "priority": 1, + "display_field": true } ] diff --git a/data/json/loot_zones.json b/data/json/loot_zones.json index 08959d879609e..bd727456999e4 100644 --- a/data/json/loot_zones.json +++ b/data/json/loot_zones.json @@ -1,45 +1,52 @@ [ { - "id": "LOOT_UNSORTED", + "id": "LOOT_AMMO", "type": "LOOT_ZONE", - "name": "Loot: Unsorted", + "name": "Loot: Ammo", "can_be_personal": true, - "description": "Place to drop unsorted loot. You can use \"sort out loot\" zone-action to sort items inside. It can overlap with Loot zones of different types." + "description": "Destination for ammo." }, { - "id": "LOOT_DEFAULT", + "id": "LOOT_ARMOR", "type": "LOOT_ZONE", - "name": "Loot: Default", + "name": "Loot: Armor", "can_be_personal": true, - "description": "Destination for any loot without a more specific zone defined." + "description": "Destination for armor. Does include filthy armor if such zone is not specified." }, { - "id": "LOOT_FOOD", + "id": "LOOT_ARTIFACTS", "type": "LOOT_ZONE", - "name": "Loot: Food", + "name": "Loot: Artifacts", "can_be_personal": true, - "description": "Destination for comestibles. If more specific food zone is not defined, all food is moved here." + "description": "Destination for artifacts." }, { - "id": "LOOT_PFOOD", + "id": "LOOT_BIONICS", "type": "LOOT_ZONE", - "name": "Loot: Perishable Food", + "name": "Loot: Bionics", "can_be_personal": true, - "description": "Destination for perishable comestibles. Does include perishable drinks if such zone is not specified." + "description": "Destination for Compact Bionics Modules, a.k.a. CBMs." }, { - "id": "LOOT_DRINK", + "id": "LOOT_BOOKS", "type": "LOOT_ZONE", - "name": "Loot: Drink", + "name": "Loot: Books", "can_be_personal": true, - "description": "Destination for drinks. Does include perishable drinks if such zone is not specified." + "description": "Destination for books and magazines." }, { - "id": "LOOT_PDRINK", + "id": "LOOT_CHEMICAL", "type": "LOOT_ZONE", - "name": "Loot: Perishable Drink", + "name": "Loot: Chemical", "can_be_personal": true, - "description": "Destination for perishable drinks." + "description": "Destination for chemicals." + }, + { + "id": "LOOT_CLOTHING", + "type": "LOOT_ZONE", + "name": "Loot: Clothing", + "can_be_personal": true, + "description": "Destination for clothing. Does include filthy clothing if such zone is not specified." }, { "id": "LOOT_CONTAINERS", @@ -49,53 +56,53 @@ "description": "Destination for empty containers." }, { - "id": "LOOT_GUNS", + "id": "LOOT_CORPSE", "type": "LOOT_ZONE", - "name": "Loot: Guns", + "name": "Loot: Corpses", "can_be_personal": true, - "description": "Destination for guns, bows and similar weapons." + "description": "Destination for corpses." }, { - "id": "LOOT_MAGAZINES", + "id": "LOOT_CURRENCY", "type": "LOOT_ZONE", - "name": "Loot: Magazines", + "name": "Loot: Currency", "can_be_personal": true, - "description": "Destination for gun magazines." + "description": "Destination for currency." }, { - "id": "LOOT_AMMO", + "id": "LOOT_CUSTOM", "type": "LOOT_ZONE", - "name": "Loot: Ammo", + "name": "Loot: Custom", "can_be_personal": true, - "description": "Destination for ammo." + "description": "Destination for loot with a custom filter that you can modify." }, { - "id": "LOOT_WEAPONS", + "id": "LOOT_DEFAULT", "type": "LOOT_ZONE", - "name": "Loot: Weapons", + "name": "Loot: Default", "can_be_personal": true, - "description": "Destination for melee weapons." + "description": "Destination for any loot without a more specific zone defined." }, { - "id": "LOOT_TOOLS", + "id": "LOOT_DRINK", "type": "LOOT_ZONE", - "name": "Loot: Tools", + "name": "Loot: Drink", "can_be_personal": true, - "description": "Destination for tools." + "description": "Destination for drinks. Does include perishable drinks if such zone is not specified." }, { - "id": "LOOT_TOOL_MAGAZINE", + "id": "LOOT_DRUGS", "type": "LOOT_ZONE", - "name": "Loot: Tool Magazines", + "name": "Loot: Drugs", "can_be_personal": true, - "description": "Destination for tool magazines." + "description": "Destination for drugs and other medical items." }, { - "id": "LOOT_CLOTHING", + "id": "LOOT_FARMOR", "type": "LOOT_ZONE", - "name": "Loot: Clothing", + "name": "Loot: Filthy Armor", "can_be_personal": true, - "description": "Destination for clothing. Does include filthy clothing if such zone is not specified." + "description": "Destination for filthy armor." }, { "id": "LOOT_FCLOTHING", @@ -105,74 +112,68 @@ "description": "Destination for filthy clothing." }, { - "id": "LOOT_DRUGS", - "type": "LOOT_ZONE", - "name": "Loot: Drugs", - "can_be_personal": true, - "description": "Destination for drugs and other medical items." - }, - { - "id": "LOOT_BOOKS", + "id": "LOOT_FOOD", "type": "LOOT_ZONE", - "name": "Loot: Books", + "name": "Loot: Food", "can_be_personal": true, - "description": "Destination for books and magazines." + "description": "Destination for comestibles. If more specific food zone is not defined, all food is moved here." }, { - "id": "LOOT_MANUALS", + "id": "LOOT_FUEL", "type": "LOOT_ZONE", - "name": "Loot: Manuals", + "name": "Loot: Fuel", "can_be_personal": true, - "description": "Destination for instructional books and magazines." + "description": "Destination for gasoline, diesel, kerosene and other substances used as a fuel." }, { - "id": "LOOT_MA_MANUALS", + "id": "LOOT_GUNS", "type": "LOOT_ZONE", - "name": "Loot: Martial arts manuals", + "name": "Loot: Guns", "can_be_personal": true, - "description": "Destination for manuals for martial arts." + "description": "Destination for guns, bows and similar weapons." }, { - "id": "LOOT_TRAPS", + "id": "LOOT_IGNORE", "type": "LOOT_ZONE", - "name": "Loot: Traps", + "name": "Loot: Ignore", "can_be_personal": true, - "description": "Destination for traps." + "description": "Items inside of this zone are ignored by \"sort out loot\" zone-action." }, { - "id": "LOOT_MODS", + "id": "LOOT_IGNORE_FAVORITES", "type": "LOOT_ZONE", - "name": "Loot: Mods", + "name": "Loot: Ignore Favorites", "can_be_personal": true, - "description": "Destination for firearm modifications and similar items." + "description": "Favorite items inside of this zone are ignored by \"sort out loot\" zone-action." }, { - "id": "LOOT_MUTAGENS", + "id": "LOOT_ITEM_GROUP", "type": "LOOT_ZONE", - "name": "Loot: Mutagens", - "can_be_personal": true, - "description": "Destination for mutagens, serums, and purifiers." + "name": "Loot: Item Group", + "can_be_personal": false, + "hidden": true, + "description": "Destination for items from an item group." }, { - "id": "LOOT_BIONICS", + "id": "LOOT_KEYS", "type": "LOOT_ZONE", - "name": "Loot: Bionics", + "name": "Loot: Keys", "can_be_personal": true, - "description": "Destination for Compact Bionics Modules, a.k.a. CBMs." + "description": "Destination for keys." }, { - "id": "LOOT_VEHICLE_PARTS", + "id": "LOOT_MAGAZINES", "type": "LOOT_ZONE", - "name": "Loot: Vehicle Parts", + "name": "Loot: Magazines", "can_be_personal": true, - "description": "Destination for vehicle parts." + "description": "Destination for gun magazines." }, { - "id": "LOOT_OTHER", + "id": "LOOT_MANUALS", "type": "LOOT_ZONE", - "name": "Loot: Other", + "name": "Loot: Manuals", "can_be_personal": true, - "description": "Destination for other miscellaneous items." + "description": "Destination for instructional books and magazines." }, { "id": "LOOT_MAPS", @@ -182,139 +183,122 @@ "description": "Destination for maps." }, { - "id": "LOOT_KEYS", + "id": "LOOT_MA_MANUALS", "type": "LOOT_ZONE", - "name": "Loot: Keys", + "name": "Loot: Martial arts manuals", "can_be_personal": true, - "description": "Destination for keys." + "description": "Destination for manuals for martial arts." }, { - "id": "LOOT_CURRENCY", + "id": "LOOT_MODS", "type": "LOOT_ZONE", - "name": "Loot: Currency", + "name": "Loot: Mods", "can_be_personal": true, - "description": "Destination for currency." + "description": "Destination for firearm modifications and similar items." }, { - "id": "LOOT_FUEL", + "id": "LOOT_MUTAGENS", "type": "LOOT_ZONE", - "name": "Loot: Fuel", + "name": "Loot: Mutagens", "can_be_personal": true, - "description": "Destination for gasoline, diesel, kerosene and other substances used as a fuel." + "description": "Destination for mutagens, serums, and purifiers." }, { - "id": "LOOT_SEEDS", + "id": "LOOT_OTHER", "type": "LOOT_ZONE", - "name": "Loot: Seeds", + "name": "Loot: Other", "can_be_personal": true, - "description": "Destination for seeds, stems and similar items." + "description": "Destination for other miscellaneous items." }, { - "id": "LOOT_CHEMICAL", + "id": "LOOT_PDRINK", "type": "LOOT_ZONE", - "name": "Loot: Chemical", + "name": "Loot: Perishable Drink", "can_be_personal": true, - "description": "Destination for chemicals." + "description": "Destination for perishable drinks." }, { - "id": "LOOT_SPARE_PARTS", + "id": "LOOT_PFOOD", "type": "LOOT_ZONE", - "name": "Loot: Spare Parts", + "name": "Loot: Perishable Food", "can_be_personal": true, - "description": "Destination for spare parts." + "description": "Destination for perishable comestibles. Does include perishable drinks if such zone is not specified." }, { - "id": "LOOT_ARTIFACTS", + "id": "LOOT_SEEDS", "type": "LOOT_ZONE", - "name": "Loot: Artifacts", + "name": "Loot: Seeds", "can_be_personal": true, - "description": "Destination for artifacts." + "description": "Destination for seeds, stems and similar items." }, { - "id": "LOOT_CORPSE", + "id": "LOOT_SPARE_PARTS", "type": "LOOT_ZONE", - "name": "Loot: Corpses", + "name": "Loot: Spare Parts", "can_be_personal": true, - "description": "Destination for corpses." + "description": "Destination for spare parts." }, { - "id": "LOOT_ARMOR", + "id": "LOOT_TOOL_MAGAZINE", "type": "LOOT_ZONE", - "name": "Loot: Armor", + "name": "Loot: Tool Magazines", "can_be_personal": true, - "description": "Destination for armor. Does include filthy armor if such zone is not specified." + "description": "Destination for tool magazines." }, { - "id": "LOOT_FARMOR", + "id": "LOOT_TOOLS", "type": "LOOT_ZONE", - "name": "Loot: Filthy Armor", + "name": "Loot: Tools", "can_be_personal": true, - "description": "Destination for filthy armor." + "description": "Destination for tools." }, { - "id": "LOOT_WOOD", + "id": "LOOT_TRAPS", "type": "LOOT_ZONE", - "name": "Loot: Wood", + "name": "Loot: Traps", "can_be_personal": true, - "description": "Destination for firewood and items that can be used as such." + "description": "Destination for traps." }, { - "id": "LOOT_CUSTOM", + "id": "LOOT_UNSORTED", "type": "LOOT_ZONE", - "name": "Loot: Custom", + "name": "Loot: Unsorted", "can_be_personal": true, - "description": "Destination for loot with a custom filter that you can modify." + "description": "Place to drop unsorted loot. You can use \"sort out loot\" zone-action to sort items inside. It can overlap with Loot zones of different types." }, { - "id": "LOOT_IGNORE", + "id": "LOOT_VEHICLE_PARTS", "type": "LOOT_ZONE", - "name": "Loot: Ignore", + "name": "Loot: Vehicle Parts", "can_be_personal": true, - "description": "Items inside of this zone are ignored by \"sort out loot\" zone-action." + "description": "Destination for vehicle parts." }, { - "id": "LOOT_IGNORE_FAVORITES", + "id": "LOOT_WEAPONS", "type": "LOOT_ZONE", - "name": "Loot: Ignore Favorites", + "name": "Loot: Weapons", "can_be_personal": true, - "description": "Favorite items inside of this zone are ignored by \"sort out loot\" zone-action." - }, - { - "id": "LOOT_ITEM_GROUP", - "type": "LOOT_ZONE", - "name": "Loot: Item Group", - "can_be_personal": false, - "hidden": true, - "description": "Destination for items from an item group." - }, - { - "id": "NO_AUTO_PICKUP", - "type": "LOOT_ZONE", - "name": "No Auto Pickup", - "description": "You won't auto-pickup items inside the zone." - }, - { - "id": "NO_NPC_PICKUP", - "type": "LOOT_ZONE", - "name": "No NPC Pickup", - "description": "Friendly NPCs don't pickup items inside the zone." + "description": "Destination for melee weapons." }, { - "id": "NPC_RETREAT", + "id": "LOOT_WOOD", "type": "LOOT_ZONE", - "name": "NPC Retreat", - "description": "When fleeing, friendly NPCs will attempt to retreat toward this zone if it is within 60 tiles." + "name": "Loot: Wood", + "can_be_personal": true, + "description": "Destination for firewood and items that can be used as such." }, { - "id": "NPC_NO_INVESTIGATE", + "id": "STRIP_CORPSES", "type": "LOOT_ZONE", - "name": "NPC Ignore Sounds", - "description": "Friendly NPCs won't investigate unseen sounds coming from this zone." + "name": "Loot: Strip Corpses", + "can_be_personal": true, + "description": "Corpses in this zone you don't otherwise sort will have everything taken off them and dropped on the same tile." }, { - "id": "NPC_INVESTIGATE_ONLY", + "id": "UNLOAD_ALL", "type": "LOOT_ZONE", - "name": "NPC Investigation Area", - "description": "Friendly NPCs will investigate unseen sounds only if they come from inside this area." + "name": "Loot: Unload Everything", + "can_be_personal": true, + "description": "Any containers in this zone you don't otherwise sort will have their contents dumped out and placed on the same tile. This includes corpses, magazines, and magazine wells." } ] diff --git a/data/json/zones.json b/data/json/zones.json index c6f55efd2eeb8..22305f418ae5b 100644 --- a/data/json/zones.json +++ b/data/json/zones.json @@ -6,23 +6,39 @@ "description": "Items in this zone are marked for disassembly" }, { - "id": "STRIP_CORPSES", + "id": "NO_AUTO_PICKUP", "type": "LOOT_ZONE", - "name": "Loot: Strip Corpses", - "can_be_personal": true, - "description": "Corpses in this zone you don't otherwise sort will have everything taken off them and dropped on the same tile." + "name": "No Auto Pickup", + "description": "You won't auto-pickup items inside the zone." }, { - "id": "ZONE_START_POINT", + "id": "NO_NPC_PICKUP", "type": "LOOT_ZONE", - "name": "Start Point", - "description": "A prioritized spawn point." + "name": "No NPC Pickup", + "description": "Friendly NPCs don't pickup items inside the zone." + }, + { + "id": "NPC_NO_INVESTIGATE", + "type": "LOOT_ZONE", + "name": "NPC Ignore Sounds", + "description": "Friendly NPCs won't investigate unseen sounds coming from this zone." }, { - "id": "UNLOAD_ALL", + "id": "NPC_INVESTIGATE_ONLY", "type": "LOOT_ZONE", - "name": "Loot: Unload Everything", - "can_be_personal": true, - "description": "Any containers in this zone you don't otherwise sort will have their contents dumped out and placed on the same tile. This includes corpses, magazines, and magazine wells." + "name": "NPC Investigation Area", + "description": "Friendly NPCs will investigate unseen sounds only if they come from inside this area." + }, + { + "id": "NPC_RETREAT", + "type": "LOOT_ZONE", + "name": "NPC Retreat", + "description": "When fleeing, friendly NPCs will attempt to retreat toward this zone if it is within 60 tiles." + }, + { + "id": "ZONE_START_POINT", + "type": "LOOT_ZONE", + "name": "Start Point", + "description": "A prioritized spawn point." } ] From e30e850d4ea59601ad4ed5eefd9d2a5a9dbc56f7 Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Fri, 26 Jan 2024 19:14:03 +0100 Subject: [PATCH 03/10] Sorted fields, split zones between files, and added hard coded zones --- data/json/field_type.json | 448 -------------------------------- data/json/loot_zones.json | 43 ++++ data/json/zone_field_type.json | 450 +++++++++++++++++++++++++++++++++ data/json/zones.json | 105 ++++++++ data/raw/keybindings.json | 11 + 5 files changed, 609 insertions(+), 448 deletions(-) create mode 100644 data/json/zone_field_type.json diff --git a/data/json/field_type.json b/data/json/field_type.json index a0b7f626d2b88..8e2b04307a668 100644 --- a/data/json/field_type.json +++ b/data/json/field_type.json @@ -1993,453 +1993,5 @@ "priority": 1, "display_field": true, "looks_like": "fd_shadow" - }, - { - "id": "fd_auto_drink_zone", - "type": "field_type", - "intensity_levels": [ { "name": "auto drink zone", "sym": "D", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_auto_eat_zone", - "type": "field_type", - "intensity_levels": [ { "name": "auto eat zone", "sym": "E", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_basecamp_food_zone", - "type": "field_type", - "intensity_levels": [ { "name": "basecamp food zone", "sym": "F", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_basecamp_storage_zone", - "type": "field_type", - "intensity_levels": [ { "name": "basecamp storage zone", "sym": "S", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_chop_trees_zone", - "type": "field_type", - "intensity_levels": [ { "name": "chop trees zone", "sym": "T", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_construction_blueprint_zone", - "type": "field_type", - "intensity_levels": [ { "name": "construction blueprint zone", "sym": "#", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_disassembly_work_zone", - "type": "field_type", - "intensity_levels": [ { "name": "disassembly work zone", "sym": "-", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_farm_plot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "farm plot zone", "sym": "P", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_fishing_spot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "fishing spot zone", "sym": "W", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_ammo_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "ammo loot zone", "sym": "a", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_armor_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "armor loot zone", "sym": "A", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_artifacts_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "artifacts loot zone", "sym": "*", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_bionics_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "bionics loot zone", "sym": "b", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_books_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "books loot zone", "sym": "B", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_chemical_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "chemical loot zone", "sym": "C", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_clothing_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "clothing loot zone", "sym": "c", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_containers_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "containers loot zone", "sym": ">", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_corpses_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "corpses loot zone", "sym": "@", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_currency_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "currency loot zone", "sym": "$", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_custom_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "custom loot zone", "sym": "?", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_default_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "default loot zone", "sym": "!", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_drink_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "drink loot zone", "sym": "d", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_drugs_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "drugs loot zone", "sym": "+", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_filthy_armor_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "filthy armor loot zone", "sym": "/", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_filthy_clothing_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "filthy clothing loot zone", "sym": "\\", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_food_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "food loot zone", "sym": "f", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_fuel_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "fuel loot zone", "sym": "'", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_guns_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "guns loot zone", "sym": "g", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_ignore_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "ignore loot zone", "sym": "i", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_ignore_favorites_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "ignore favorites loot zone", "sym": "I", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_item_group_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "item group loot zone", "sym": "9", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_keys_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "keys loot zone", "sym": "k", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_magazines_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "magazines loot zone", "sym": "m", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_manuals_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "manuals loot zone", "sym": "M", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_maps_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "maps loot zone", "sym": "e", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_martial_arts_manuals_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "martial arts manuals loot zone", "sym": "ö", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_mods_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "mods loot zone", "sym": "h", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_mutagens_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "mutagens loot zone", "sym": "H", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_other_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "other loot zone", "sym": "o", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_perishable_drink_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "perishable drink loot zone", "sym": "p", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_perishable_food_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "perishable food loot zone", "sym": "P", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_seeds_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "seeds loot zone", "sym": "s", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_spare_parts_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "spare parts loot zone", "sym": "S", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_strip_corpses_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "strip_corpses loot zone", "sym": "j", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_tool_magazines_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "tool_magazines loot zone", "sym": "J", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_tools_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "tools loot zone", "sym": "t", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_traps_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "traps loot zone", "sym": "^", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_unload_everything_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "unload everything loot zone", "sym": "u", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_unsorted_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "unsorted loot zone", "sym": "U", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_vehicle_parts_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "vehicle parts loot zone", "sym": "v", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_weapons_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "weapons loot zone", "sym": "w", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_wood_loot_zone", - "type": "field_type", - "intensity_levels": [ { "name": "wood loot zone", "sym": ";", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_mine_terrain_zone", - "type": "field_type", - "intensity_levels": [ { "name": "mine terrain zone", "sym": "x", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_mop_tile_zone", - "type": "field_type", - "intensity_levels": [ { "name": "mop tile zone", "sym": "~", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_no_auto_pickup_zone", - "type": "field_type", - "intensity_levels": [ { "name": "no auto pickup zone", "sym": "1", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_no_npc_pickup_zone", - "type": "field_type", - "intensity_levels": [ { "name": "no npc pickup zone", "sym": "2", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_npc_ignore_sounds_zone", - "type": "field_type", - "intensity_levels": [ { "name": "npc_ignore_sounds zone", "sym": "3", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_npc_investigation_area_zone", - "type": "field_type", - "intensity_levels": [ { "name": "npc investigation area zone", "sym": "4", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_npc_retreat_zone", - "type": "field_type", - "intensity_levels": [ { "name": "npc retreat zone", "sym": "5", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_firewood_source_zone", - "type": "field_type", - "intensity_levels": [ { "name": "firewood source zone", "sym": "6", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_start_point_zone", - "type": "field_type", - "intensity_levels": [ { "name": "start point zone", "sym": "7", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_vehicle_deconstruct_zone", - "type": "field_type", - "intensity_levels": [ { "name": "vehicle deconstruct zone", "sym": "y", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_vehicle_patrol_zone", - "type": "field_type", - "intensity_levels": [ { "name": "vehicle patrol zone", "sym": "8", "dangerous": false } ], - "priority": 1, - "display_field": true - }, - { - "id": "fd_vehicle_repair_zone", - "type": "field_type", - "intensity_levels": [ { "name": "vehicle repair zone", "sym": "Y", "dangerous": false } ], - "priority": 1, - "display_field": true } ] diff --git a/data/json/loot_zones.json b/data/json/loot_zones.json index bd727456999e4..a106d9e8076c2 100644 --- a/data/json/loot_zones.json +++ b/data/json/loot_zones.json @@ -3,6 +3,7 @@ "id": "LOOT_AMMO", "type": "LOOT_ZONE", "name": "Loot: Ammo", + "display_field": "fd_ammo_loot_zone", "can_be_personal": true, "description": "Destination for ammo." }, @@ -10,6 +11,7 @@ "id": "LOOT_ARMOR", "type": "LOOT_ZONE", "name": "Loot: Armor", + "display_field": "fd_armor_loot_zone", "can_be_personal": true, "description": "Destination for armor. Does include filthy armor if such zone is not specified." }, @@ -17,6 +19,7 @@ "id": "LOOT_ARTIFACTS", "type": "LOOT_ZONE", "name": "Loot: Artifacts", + "display_field": "fd_artifacts_loot_zone", "can_be_personal": true, "description": "Destination for artifacts." }, @@ -24,6 +27,7 @@ "id": "LOOT_BIONICS", "type": "LOOT_ZONE", "name": "Loot: Bionics", + "display_field": "fd_bionics_loot_zone", "can_be_personal": true, "description": "Destination for Compact Bionics Modules, a.k.a. CBMs." }, @@ -31,6 +35,7 @@ "id": "LOOT_BOOKS", "type": "LOOT_ZONE", "name": "Loot: Books", + "display_field": "fd_books_loot_zone", "can_be_personal": true, "description": "Destination for books and magazines." }, @@ -38,6 +43,7 @@ "id": "LOOT_CHEMICAL", "type": "LOOT_ZONE", "name": "Loot: Chemical", + "display_field": "fd_chemical_loot_zone", "can_be_personal": true, "description": "Destination for chemicals." }, @@ -45,6 +51,7 @@ "id": "LOOT_CLOTHING", "type": "LOOT_ZONE", "name": "Loot: Clothing", + "display_field": "fd_clothing_loot_zone", "can_be_personal": true, "description": "Destination for clothing. Does include filthy clothing if such zone is not specified." }, @@ -52,6 +59,7 @@ "id": "LOOT_CONTAINERS", "type": "LOOT_ZONE", "name": "Loot: Containers", + "display_field": "fd_containers_loot_zone", "can_be_personal": true, "description": "Destination for empty containers." }, @@ -59,6 +67,7 @@ "id": "LOOT_CORPSE", "type": "LOOT_ZONE", "name": "Loot: Corpses", + "display_field": "fd_corpses_loot_zone", "can_be_personal": true, "description": "Destination for corpses." }, @@ -66,6 +75,7 @@ "id": "LOOT_CURRENCY", "type": "LOOT_ZONE", "name": "Loot: Currency", + "display_field": "fd_currency_loot_zone", "can_be_personal": true, "description": "Destination for currency." }, @@ -73,6 +83,7 @@ "id": "LOOT_CUSTOM", "type": "LOOT_ZONE", "name": "Loot: Custom", + "display_field": "fd_custom_loot_zone", "can_be_personal": true, "description": "Destination for loot with a custom filter that you can modify." }, @@ -80,6 +91,7 @@ "id": "LOOT_DEFAULT", "type": "LOOT_ZONE", "name": "Loot: Default", + "display_field": "fd_default_loot_zone", "can_be_personal": true, "description": "Destination for any loot without a more specific zone defined." }, @@ -87,6 +99,7 @@ "id": "LOOT_DRINK", "type": "LOOT_ZONE", "name": "Loot: Drink", + "display_field": "fd_drink_loot_zone", "can_be_personal": true, "description": "Destination for drinks. Does include perishable drinks if such zone is not specified." }, @@ -94,6 +107,7 @@ "id": "LOOT_DRUGS", "type": "LOOT_ZONE", "name": "Loot: Drugs", + "display_field": "fd_drugs_loot_zone", "can_be_personal": true, "description": "Destination for drugs and other medical items." }, @@ -101,6 +115,7 @@ "id": "LOOT_FARMOR", "type": "LOOT_ZONE", "name": "Loot: Filthy Armor", + "display_field": "fd_filthy_armor_loot_zone", "can_be_personal": true, "description": "Destination for filthy armor." }, @@ -108,6 +123,7 @@ "id": "LOOT_FCLOTHING", "type": "LOOT_ZONE", "name": "Loot: Filthy Clothing", + "display_field": "fd_filthy_clothing_loot_zone", "can_be_personal": true, "description": "Destination for filthy clothing." }, @@ -115,6 +131,7 @@ "id": "LOOT_FOOD", "type": "LOOT_ZONE", "name": "Loot: Food", + "display_field": "fd_food_loot_zone", "can_be_personal": true, "description": "Destination for comestibles. If more specific food zone is not defined, all food is moved here." }, @@ -122,6 +139,7 @@ "id": "LOOT_FUEL", "type": "LOOT_ZONE", "name": "Loot: Fuel", + "display_field": "fd_fuel_loot_zone", "can_be_personal": true, "description": "Destination for gasoline, diesel, kerosene and other substances used as a fuel." }, @@ -129,6 +147,7 @@ "id": "LOOT_GUNS", "type": "LOOT_ZONE", "name": "Loot: Guns", + "display_field": "fd_guns_loot_zone", "can_be_personal": true, "description": "Destination for guns, bows and similar weapons." }, @@ -136,6 +155,7 @@ "id": "LOOT_IGNORE", "type": "LOOT_ZONE", "name": "Loot: Ignore", + "display_field": "fd_ignore_loot_zone", "can_be_personal": true, "description": "Items inside of this zone are ignored by \"sort out loot\" zone-action." }, @@ -143,6 +163,7 @@ "id": "LOOT_IGNORE_FAVORITES", "type": "LOOT_ZONE", "name": "Loot: Ignore Favorites", + "display_field": "fd_ignore_favorites_loot_zone", "can_be_personal": true, "description": "Favorite items inside of this zone are ignored by \"sort out loot\" zone-action." }, @@ -150,6 +171,7 @@ "id": "LOOT_ITEM_GROUP", "type": "LOOT_ZONE", "name": "Loot: Item Group", + "display_field": "fd_item_group_loot_zone", "can_be_personal": false, "hidden": true, "description": "Destination for items from an item group." @@ -158,6 +180,7 @@ "id": "LOOT_KEYS", "type": "LOOT_ZONE", "name": "Loot: Keys", + "display_field": "fd_keys_loot_zone", "can_be_personal": true, "description": "Destination for keys." }, @@ -165,6 +188,7 @@ "id": "LOOT_MAGAZINES", "type": "LOOT_ZONE", "name": "Loot: Magazines", + "display_field": "fd_magazines_loot_zone", "can_be_personal": true, "description": "Destination for gun magazines." }, @@ -172,6 +196,7 @@ "id": "LOOT_MANUALS", "type": "LOOT_ZONE", "name": "Loot: Manuals", + "display_field": "fd_manuals_loot_zone", "can_be_personal": true, "description": "Destination for instructional books and magazines." }, @@ -179,6 +204,7 @@ "id": "LOOT_MAPS", "type": "LOOT_ZONE", "name": "Loot: Maps", + "display_field": "fd_maps_loot_zone", "can_be_personal": true, "description": "Destination for maps." }, @@ -186,6 +212,7 @@ "id": "LOOT_MA_MANUALS", "type": "LOOT_ZONE", "name": "Loot: Martial arts manuals", + "display_field": "fd_martial_arts_manuals_loot_zone", "can_be_personal": true, "description": "Destination for manuals for martial arts." }, @@ -193,6 +220,7 @@ "id": "LOOT_MODS", "type": "LOOT_ZONE", "name": "Loot: Mods", + "display_field": "fd_mods_loot_zone", "can_be_personal": true, "description": "Destination for firearm modifications and similar items." }, @@ -200,6 +228,7 @@ "id": "LOOT_MUTAGENS", "type": "LOOT_ZONE", "name": "Loot: Mutagens", + "display_field": "fd_mutagens_loot_zone", "can_be_personal": true, "description": "Destination for mutagens, serums, and purifiers." }, @@ -207,6 +236,7 @@ "id": "LOOT_OTHER", "type": "LOOT_ZONE", "name": "Loot: Other", + "display_field": "fd_other_loot_zone", "can_be_personal": true, "description": "Destination for other miscellaneous items." }, @@ -214,6 +244,7 @@ "id": "LOOT_PDRINK", "type": "LOOT_ZONE", "name": "Loot: Perishable Drink", + "display_field": "fd_perishable_drink_loot_zone", "can_be_personal": true, "description": "Destination for perishable drinks." }, @@ -221,6 +252,7 @@ "id": "LOOT_PFOOD", "type": "LOOT_ZONE", "name": "Loot: Perishable Food", + "display_field": "fd_perishable_food_loot_zone", "can_be_personal": true, "description": "Destination for perishable comestibles. Does include perishable drinks if such zone is not specified." }, @@ -228,6 +260,7 @@ "id": "LOOT_SEEDS", "type": "LOOT_ZONE", "name": "Loot: Seeds", + "display_field": "fd_seeds_loot_zone", "can_be_personal": true, "description": "Destination for seeds, stems and similar items." }, @@ -235,6 +268,7 @@ "id": "LOOT_SPARE_PARTS", "type": "LOOT_ZONE", "name": "Loot: Spare Parts", + "display_field": "fd_spare_parts_loot_zone", "can_be_personal": true, "description": "Destination for spare parts." }, @@ -242,6 +276,7 @@ "id": "LOOT_TOOL_MAGAZINE", "type": "LOOT_ZONE", "name": "Loot: Tool Magazines", + "display_field": "fd_tool_magazines_loot_zone", "can_be_personal": true, "description": "Destination for tool magazines." }, @@ -249,6 +284,7 @@ "id": "LOOT_TOOLS", "type": "LOOT_ZONE", "name": "Loot: Tools", + "display_field": "fd_tools_loot_zone", "can_be_personal": true, "description": "Destination for tools." }, @@ -256,6 +292,7 @@ "id": "LOOT_TRAPS", "type": "LOOT_ZONE", "name": "Loot: Traps", + "display_field": "fd_traps_loot_zone", "can_be_personal": true, "description": "Destination for traps." }, @@ -263,6 +300,7 @@ "id": "LOOT_UNSORTED", "type": "LOOT_ZONE", "name": "Loot: Unsorted", + "display_field": "fd_unsorted_loot_zone", "can_be_personal": true, "description": "Place to drop unsorted loot. You can use \"sort out loot\" zone-action to sort items inside. It can overlap with Loot zones of different types." }, @@ -270,6 +308,7 @@ "id": "LOOT_VEHICLE_PARTS", "type": "LOOT_ZONE", "name": "Loot: Vehicle Parts", + "display_field": "fd_vehicle_parts_loot_zone", "can_be_personal": true, "description": "Destination for vehicle parts." }, @@ -277,6 +316,7 @@ "id": "LOOT_WEAPONS", "type": "LOOT_ZONE", "name": "Loot: Weapons", + "display_field": "fd_weapons_loot_zone", "can_be_personal": true, "description": "Destination for melee weapons." }, @@ -284,6 +324,7 @@ "id": "LOOT_WOOD", "type": "LOOT_ZONE", "name": "Loot: Wood", + "display_field": "fd_wood_loot_zone", "can_be_personal": true, "description": "Destination for firewood and items that can be used as such." }, @@ -291,6 +332,7 @@ "id": "STRIP_CORPSES", "type": "LOOT_ZONE", "name": "Loot: Strip Corpses", + "display_field": "fd_strip_corpses_loot_zone", "can_be_personal": true, "description": "Corpses in this zone you don't otherwise sort will have everything taken off them and dropped on the same tile." }, @@ -298,6 +340,7 @@ "id": "UNLOAD_ALL", "type": "LOOT_ZONE", "name": "Loot: Unload Everything", + "display_field": "fd_unload_everything_loot_zone", "can_be_personal": true, "description": "Any containers in this zone you don't otherwise sort will have their contents dumped out and placed on the same tile. This includes corpses, magazines, and magazine wells." } diff --git a/data/json/zone_field_type.json b/data/json/zone_field_type.json new file mode 100644 index 0000000000000..236c506564421 --- /dev/null +++ b/data/json/zone_field_type.json @@ -0,0 +1,450 @@ +[ + { + "id": "fd_ammo_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "ammo loot zone", "sym": "a", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_armor_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "armor loot zone", "sym": "A", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_artifacts_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "artifacts loot zone", "sym": "*", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_auto_drink_zone", + "type": "field_type", + "intensity_levels": [ { "name": "auto drink zone", "sym": "D", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_auto_eat_zone", + "type": "field_type", + "intensity_levels": [ { "name": "auto eat zone", "sym": "E", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_basecamp_food_zone", + "type": "field_type", + "intensity_levels": [ { "name": "basecamp food zone", "sym": "F", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_basecamp_storage_zone", + "type": "field_type", + "intensity_levels": [ { "name": "basecamp storage zone", "sym": "S", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_bionics_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "bionics loot zone", "sym": "b", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_books_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "books loot zone", "sym": "B", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_chemical_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "chemical loot zone", "sym": "C", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_chop_trees_zone", + "type": "field_type", + "intensity_levels": [ { "name": "chop trees zone", "sym": "T", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_clothing_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "clothing loot zone", "sym": "c", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_construction_blueprint_zone", + "type": "field_type", + "intensity_levels": [ { "name": "construction blueprint zone", "sym": "#", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_containers_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "containers loot zone", "sym": ">", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_corpses_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "corpses loot zone", "sym": "@", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_currency_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "currency loot zone", "sym": "$", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_custom_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "custom loot zone", "sym": "?", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_default_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "default loot zone", "sym": "!", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_disassembly_work_zone", + "type": "field_type", + "intensity_levels": [ { "name": "disassembly work zone", "sym": "-", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_drink_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "drink loot zone", "sym": "d", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_drugs_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "drugs loot zone", "sym": "+", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_farm_plot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "farm plot zone", "sym": "P", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_filthy_armor_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "filthy armor loot zone", "sym": "/", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_filthy_clothing_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "filthy clothing loot zone", "sym": "\\", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_firewood_source_zone", + "type": "field_type", + "intensity_levels": [ { "name": "firewood source zone", "sym": "6", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_fishing_spot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "fishing spot zone", "sym": "W", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_food_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "food loot zone", "sym": "f", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_fuel_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "fuel loot zone", "sym": "'", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_guns_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "guns loot zone", "sym": "g", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_ignore_favorites_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "ignore favorites loot zone", "sym": "I", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_ignore_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "ignore loot zone", "sym": "i", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_item_group_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "item group loot zone", "sym": "9", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_keys_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "keys loot zone", "sym": "k", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_magazines_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "magazines loot zone", "sym": "m", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_manuals_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "manuals loot zone", "sym": "M", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_maps_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "maps loot zone", "sym": "e", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_martial_arts_manuals_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "martial arts manuals loot zone", "sym": "ö", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_mine_terrain_zone", + "type": "field_type", + "intensity_levels": [ { "name": "mine terrain zone", "sym": "x", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_mods_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "mods loot zone", "sym": "h", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_mop_tile_zone", + "type": "field_type", + "intensity_levels": [ { "name": "mop tile zone", "sym": "~", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_mutagens_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "mutagens loot zone", "sym": "H", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_no_auto_pickup_zone", + "type": "field_type", + "intensity_levels": [ { "name": "no auto pickup zone", "sym": "1", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_no_npc_pickup_zone", + "type": "field_type", + "intensity_levels": [ { "name": "no npc pickup zone", "sym": "2", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_npc_ignore_sounds_zone", + "type": "field_type", + "intensity_levels": [ { "name": "npc_ignore_sounds zone", "sym": "3", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_npc_investigation_area_zone", + "type": "field_type", + "intensity_levels": [ { "name": "npc investigation area zone", "sym": "4", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_npc_retreat_zone", + "type": "field_type", + "intensity_levels": [ { "name": "npc retreat zone", "sym": "5", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_other_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "other loot zone", "sym": "o", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_perishable_drink_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "perishable drink loot zone", "sym": "p", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_perishable_food_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "perishable food loot zone", "sym": "P", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_seeds_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "seeds loot zone", "sym": "s", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_spare_parts_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "spare parts loot zone", "sym": "S", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_start_point_zone", + "type": "field_type", + "intensity_levels": [ { "name": "start point zone", "sym": "7", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_strip_corpses_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "strip_corpses loot zone", "sym": "j", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_tools_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "tools loot zone", "sym": "t", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_tool_magazines_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "tool_magazines loot zone", "sym": "J", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_traps_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "traps loot zone", "sym": "^", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_unload_everything_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "unload everything loot zone", "sym": "u", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_unsorted_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "unsorted loot zone", "sym": "U", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_vehicle_deconstruct_zone", + "type": "field_type", + "intensity_levels": [ { "name": "vehicle deconstruct zone", "sym": "y", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_vehicle_parts_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "vehicle parts loot zone", "sym": "v", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_vehicle_patrol_zone", + "type": "field_type", + "intensity_levels": [ { "name": "vehicle patrol zone", "sym": "8", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_vehicle_repair_zone", + "type": "field_type", + "intensity_levels": [ { "name": "vehicle repair zone", "sym": "Y", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_weapons_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "weapons loot zone", "sym": "w", "dangerous": false } ], + "priority": 1, + "display_field": true + }, + { + "id": "fd_wood_loot_zone", + "type": "field_type", + "intensity_levels": [ { "name": "wood loot zone", "sym": ";", "dangerous": false } ], + "priority": 1, + "display_field": true + } +] diff --git a/data/json/zones.json b/data/json/zones.json index 22305f418ae5b..45933f4aaa4da 100644 --- a/data/json/zones.json +++ b/data/json/zones.json @@ -1,44 +1,149 @@ [ + { + "id": "AUTO_DRINK", + "type": "LOOT_ZONE", + "name": "Auto Drink", + "display_field": "fd_auto_drink_zone", + "description": "Items in this zone will be automatically consumed during a long activity if you get thirsty." + }, + { + "id": "AUTO_EAT", + "type": "LOOT_ZONE", + "name": "Auto Eat", + "display_field": "fd_auto_eat_zone", + "description": "Items in this zone will be automatically eaten during a long activity if you get hungry." + }, + { + "id": "CAMP_FOOD", + "type": "LOOT_ZONE", + "name": "Basecamp: Food", + "display_field": "fd_basecamp_food_zone", + "description": "Items in this zone will be added to a basecamp's food supply in the Distribute Food mission." + }, + { + "id": "CAMP_STORAGE", + "type": "LOOT_ZONE", + "name": "Basecamp: Storage", + "display_field": "fd_basecamp_storage_zone", + "description": "Items in this zone will be added to a basecamp's inventory for use by its workers." + }, + { + "id": "CHOP_TREES", + "type": "LOOT_ZONE", + "name": "Chop Trees", + "display_field": "fd_chop_trees_zone", + "description": "Designate an area to chop down trees." + }, + { + "id": "CONSTRUCTION_BLUEPRINT", + "type": "LOOT_ZONE", + "name": "Construction: Blueprint", + "display_field": "fd_construction_blueprint_zone", + "description": "Designate a blueprint zone for construction." + }, { "id": "DISASSEMBLE", "type": "LOOT_ZONE", "name": "Disassembly Work", + "display_field": "fd_disassembly_work_zone", "description": "Items in this zone are marked for disassembly" }, + { + "id": "FARM_PLOT", + "type": "LOOT_ZONE", + "name": "Farm: Plot", + "display_field": "fd_farm_plot_zone", + "description": "Designate a farm plot for tilling and planting." + }, + { + "id": "FISHING_SPOT", + "type": "LOOT_ZONE", + "name": "Fishing Spot", + "display_field": "fd_fishing_spot_zone", + "description": "Designate an area to fish from." + }, + { + "id": "MINING", + "type": "LOOT_ZONE", + "name": "Mine Terrain", + "display_field": "fd_mine_terrain_zone", + "description": "Designate an area to mine." + }, + { + "id": "MOPPING", + "type": "LOOT_ZONE", + "name": "Mop Tile", + "display_field": "fd_mop_tile_zone", + "description": "Designate an area to mop clean." + }, { "id": "NO_AUTO_PICKUP", "type": "LOOT_ZONE", "name": "No Auto Pickup", + "display_field": "fd_no_auto_pickup_zone", "description": "You won't auto-pickup items inside the zone." }, { "id": "NO_NPC_PICKUP", "type": "LOOT_ZONE", "name": "No NPC Pickup", + "display_field": "fd_no_npc_pickup_zone", "description": "Friendly NPCs don't pickup items inside the zone." }, { "id": "NPC_NO_INVESTIGATE", "type": "LOOT_ZONE", "name": "NPC Ignore Sounds", + "display_field": "fd_npc_ignore_sounds_zone", "description": "Friendly NPCs won't investigate unseen sounds coming from this zone." }, { "id": "NPC_INVESTIGATE_ONLY", "type": "LOOT_ZONE", "name": "NPC Investigation Area", + "display_field": "fd_npc_investigation_area_zone", "description": "Friendly NPCs will investigate unseen sounds only if they come from inside this area." }, { "id": "NPC_RETREAT", "type": "LOOT_ZONE", "name": "NPC Retreat", + "display_field": "fd_npc_retreat_zone", "description": "When fleeing, friendly NPCs will attempt to retreat toward this zone if it is within 60 tiles." }, { "id": "ZONE_START_POINT", "type": "LOOT_ZONE", "name": "Start Point", + "display_field": "fd_start_point_zone", "description": "A prioritized spawn point." + }, + { + "id": "SOURCE_FIREWOOD", + "type": "LOOT_ZONE", + "name": "Source: Firewood", + "display_field": "fd_firewood_source_zone", + "description": "Source for firewood or other flammable materials in this zone may be used to automatically refuel fires. This will be done to maintain light during long-running tasks such as crafting, reading or waiting." + }, + { + "id": "VEHICLE_DECONSTRUCT", + "type": "LOOT_ZONE", + "name": "Vehicle Deconstruct Zone", + "display_field": "fd_vehicle_deconstruct_zone", + "description": "Any vehicles in this area are marked for deconstruction." + }, + { + "id": "VEHICLE_PATROL", + "type": "LOOT_ZONE", + "name": "Vehicle Patrol Zone", + "display_field": "fd_vehicle_patrol_zone", + "description": "Vehicles with an autopilot will patrol in this zone." + }, + { + "id": "VEHICLE_REPAIR", + "type": "LOOT_ZONE", + "name": "Vehicle Repair Zone", + "display_field": "fd_vehicle_repair_zone", + "description": "Any vehicles in this area are marked for repair work." } ] diff --git a/data/raw/keybindings.json b/data/raw/keybindings.json index b3a9c3bb1c61f..af5256a926b4d 100644 --- a/data/raw/keybindings.json +++ b/data/raw/keybindings.json @@ -3431,6 +3431,17 @@ { "input_method": "keyboard_code", "key": "m", "mod": [ "shift" ] } ] }, + { + "type": "keybinding", + "id": "TOGGLE_ZONE_DISPLAY", + "category": "ZONES_MANAGER", + "name": "Toggle display of zone markers", + "bindings": [ + { "input_method": "keyboard_any", "key": "t" }, + { "input_method": "keyboard_char", "key": "T" }, + { "input_method": "keyboard_code", "key": "t", "mod": [ "shift" ] } + ] + }, { "type": "keybinding", "id": "ENABLE_ZONE", From 7d39ba86a2c599dde9659125a16d709b496cd8c5 Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Fri, 26 Jan 2024 19:15:39 +0100 Subject: [PATCH 04/10] Fixed zone toggle UI, JSONified zone->field relation, removed hard coded zone definitions --- src/clzones.cpp | 318 ++++-------------------------------------------- src/clzones.h | 7 +- src/game.cpp | 29 ++++- 3 files changed, 60 insertions(+), 294 deletions(-) diff --git a/src/clzones.cpp b/src/clzones.cpp index 843ba73f65546..24b11f56c81b8 100644 --- a/src/clzones.cpp +++ b/src/clzones.cpp @@ -50,137 +50,29 @@ static const item_category_id item_category_food( "food" ); static const itype_id itype_disassembly( "disassembly" ); static const itype_id itype_null( "null" ); -static const field_type_str_id fd_ammo_loot_zone( "fd_ammo_loot_zone" ); -static const field_type_str_id fd_armor_loot_zone( "fd_armor_loot_zone" ); -static const field_type_str_id fd_artifacts_loot_zone( "fd_artifacts_loot_zone" ); -static const field_type_str_id fd_auto_drink_zone( "fd_auto_drink_zone" ); -static const field_type_str_id fd_auto_eat_zone( "fd_auto_eat_zone" ); -static const field_type_str_id fd_basecamp_food_zone( "fd_basecamp_food_zone" ); -static const field_type_str_id fd_basecamp_storage_zone( "fd_basecamp_storage_zone" ); -static const field_type_str_id fd_bionics_loot_zone( "fd_bionics_loot_zone" ); -static const field_type_str_id fd_books_loot_zone( "fd_books_loot_zone" ); -static const field_type_str_id fd_chemical_loot_zone( "fd_chemical_loot_zone" ); -static const field_type_str_id fd_chop_trees_zone( "fd_chop_trees_zone" ); -static const field_type_str_id fd_clothing_loot_zone( "fd_clothing_loot_zone" ); -static const field_type_str_id fd_construction_blueprint_zone( "fd_construction_blueprint_zone" ); -static const field_type_str_id fd_containers_loot_zone( "fd_containers_loot_zone" ); -static const field_type_str_id fd_corpses_loot_zone( "fd_corpses_loot_zone" ); -static const field_type_str_id fd_currency_loot_zone( "fd_currency_loot_zone" ); -static const field_type_str_id fd_custom_loot_zone( "fd_custom_loot_zone" ); -static const field_type_str_id fd_default_loot_zone( "fd_default_loot_zone" ); -static const field_type_str_id fd_disassembly_work_zone( "fd_disassembly_work_zone" ); -static const field_type_str_id fd_drink_loot_zone( "fd_drink_loot_zone" ); -static const field_type_str_id fd_drugs_loot_zone( "fd_drugs_loot_zone" ); -static const field_type_str_id fd_farm_plot_zone( "fd_farm_plot_zone" ); -static const field_type_str_id fd_filthy_armor_loot_zone( "fd_filthy_armor_loot_zone" ); -static const field_type_str_id fd_filthy_clothing_loot_zone( "fd_filthy_clothing_loot_zone" ); -static const field_type_str_id fd_firewood_source_zone( "fd_firewood_source_zone" ); -static const field_type_str_id fd_fishing_spot_zone( "fd_fishing_spot_zone" ); -static const field_type_str_id fd_food_loot_zone( "fd_food_loot_zone" ); -static const field_type_str_id fd_fuel_loot_zone( "fd_fuel_loot_zone" ); -static const field_type_str_id fd_guns_loot_zone( "fd_guns_loot_zone" ); -static const field_type_str_id fd_ignore_loot_zone( "fd_ignore_loot_zone" ); -static const field_type_str_id fd_ignore_favorites_loot_zone( "fd_ignore_favorites_loot_zone" ); -static const field_type_str_id fd_item_group_loot_zone( "fd_item_group_loot_zone" ); -static const field_type_str_id fd_keys_loot_zone( "fd_keys_loot_zone" ); -static const field_type_str_id fd_magazines_loot_zone( "fd_magazines_loot_zone" ); -static const field_type_str_id fd_manuals_loot_zone( "fd_manuals_loot_zone" ); -static const field_type_str_id fd_maps_loot_zone( "fd_maps_loot_zone" ); -static const field_type_str_id -fd_martial_arts_manuals_loot_zone( "fd_martial_arts_manuals_loot_zone" ); -static const field_type_str_id fd_mine_terrain_zone( "fd_mine_terrain_zone" ); -static const field_type_str_id fd_mods_loot_zone( "fd_mods_loot_zone" ); -static const field_type_str_id fd_mop_tile_zone( "fd_mop_tile_zone" ); -static const field_type_str_id fd_mutagens_loot_zone( "fd_mutagens_loot_zone" ); -static const field_type_str_id fd_no_auto_pickup_zone( "fd_no_auto_pickup_zone" ); -static const field_type_str_id fd_no_npc_pickup_zone( "fd_no_npc_pickup_zone" ); -static const field_type_str_id fd_npc_ignore_sounds_zone( "fd_npc_ignore_sounds_zone" ); -static const field_type_str_id fd_npc_investigation_area_zone( "fd_npc_investigation_area_zone" ); -static const field_type_str_id fd_npc_retreat_zone( "fd_npc_retreat_zone" ); -static const field_type_str_id fd_other_loot_zone( "fd_other_loot_zone" ); -static const field_type_str_id fd_perishable_drink_loot_zone( "fd_perishable_drink_loot_zone" ); -static const field_type_str_id fd_perishable_food_loot_zone( "fd_perishable_food_loot_zone" ); -static const field_type_str_id fd_seeds_loot_zone( "fd_seeds_loot_zone" ); -static const field_type_str_id fd_spare_parts_loot_zone( "fd_spare_parts_loot_zone" ); -static const field_type_str_id fd_start_point_zone( "fd_start_point_zone" ); -static const field_type_str_id fd_strip_corpses_loot_zone( "fd_strip_corpses_loot_zone" ); -static const field_type_str_id fd_tool_magazines_loot_zone( "fd_tool_magazines_loot_zone" ); -static const field_type_str_id fd_tools_loot_zone( "fd_tools_loot_zone" ); -static const field_type_str_id fd_traps_loot_zone( "fd_traps_loot_zone" ); -static const field_type_str_id fd_unsorted_loot_zone( "fd_unsorted_loot_zone" ); -static const field_type_str_id fd_vehicle_parts_loot_zone( "fd_vehicle_parts_loot_zone" ); -static const field_type_str_id fd_weapons_loot_zone( "fd_weapons_loot_zone" ); -static const field_type_str_id fd_wood_loot_zone( "fd_wood_loot_zone" ); -static const field_type_str_id fd_unload_everything_loot_zone( "fd_unload_everything_loot_zone" ); -static const field_type_str_id fd_vehicle_deconstruct_zone( "fd_vehicle_deconstruct_zone" ); -static const field_type_str_id fd_vehicle_patrol_zone( "fd_vehicle_patrol_zone" ); -static const field_type_str_id fd_vehicle_repair_zone( "fd_vehicle_repair_zone" ); - static const zone_type_id zone_type_AUTO_DRINK( "AUTO_DRINK" ); static const zone_type_id zone_type_AUTO_EAT( "AUTO_EAT" ); static const zone_type_id zone_type_CAMP_FOOD( "CAMP_FOOD" ); -static const zone_type_id zone_type_CAMP_STORAGE( "CAMP_STORAGE" ); -static const zone_type_id zone_type_CHOP_TREES( "CHOP_TREES" ); static const zone_type_id zone_type_CONSTRUCTION_BLUEPRINT( "CONSTRUCTION_BLUEPRINT" ); static const zone_type_id zone_type_DISASSEMBLE( "DISASSEMBLE" ); static const zone_type_id zone_type_FARM_PLOT( "FARM_PLOT" ); -static const zone_type_id zone_type_FISHING_SPOT( "FISHING_SPOT" ); -static const zone_type_id zone_type_LOOT_AMMO( "LOOT_AMMO" ); -static const zone_type_id zone_type_LOOT_ARMOR( "LOOT_ARMOR" ); -static const zone_type_id zone_type_LOOT_ARTIFACTS( "LOOT_ARTIFACTS" ); -static const zone_type_id zone_type_LOOT_BIONICS( "LOOT_BIONICS" ); -static const zone_type_id zone_type_LOOT_BOOKS( "LOOT_BOOKS" ); -static const zone_type_id zone_type_LOOT_CHEMICAL( "LOOT_CHEMICAL" ); -static const zone_type_id zone_type_LOOT_CLOTHING( "LOOT_CLOTHING" ); -static const zone_type_id zone_type_LOOT_CONTAINERS( "LOOT_CONTAINERS" ); static const zone_type_id zone_type_LOOT_CORPSE( "LOOT_CORPSE" ); -static const zone_type_id zone_type_LOOT_CURRENCY( "LOOT_CURRENCY" ); static const zone_type_id zone_type_LOOT_CUSTOM( "LOOT_CUSTOM" ); static const zone_type_id zone_type_LOOT_DEFAULT( "LOOT_DEFAULT" ); static const zone_type_id zone_type_LOOT_DRINK( "LOOT_DRINK" ); -static const zone_type_id zone_type_LOOT_DRUGS( "LOOT_DRUGS" ); -static const zone_type_id zone_type_LOOT_FARMOR( "LOOT_FARMOR" ); -static const zone_type_id zone_type_LOOT_FCLOTHING( "LOOT_FCLOTHING" ); static const zone_type_id zone_type_LOOT_FOOD( "LOOT_FOOD" ); -static const zone_type_id zone_type_LOOT_FUEL( "LOOT_FUEL" ); -static const zone_type_id zone_type_LOOT_GUNS( "LOOT_GUNS" ); static const zone_type_id zone_type_LOOT_IGNORE( "LOOT_IGNORE" ); -static const zone_type_id zone_type_LOOT_IGNORE_FAVORITES( "LOOT_IGNORE_FAVORITES" ); static const zone_type_id zone_type_LOOT_ITEM_GROUP( "LOOT_ITEM_GROUP" ); -static const zone_type_id zone_type_LOOT_KEYS( "LOOT_KEYS" ); -static const zone_type_id zone_type_LOOT_MAGAZINES( "LOOT_MAGAZINES" ); -static const zone_type_id zone_type_LOOT_MANUALS( "LOOT_MANUALS" ); -static const zone_type_id zone_type_LOOT_MAPS( "LOOT_MAPS" ); -static const zone_type_id zone_type_LOOT_MA_MANUALS( "LOOT_MA_MANUALS" ); -static const zone_type_id zone_type_LOOT_MODS( "LOOT_MODS" ); -static const zone_type_id zone_type_LOOT_MUTAGENS( "LOOT_MUTAGENS" ); -static const zone_type_id zone_type_LOOT_OTHER( "LOOT_OTHER" ); static const zone_type_id zone_type_LOOT_PDRINK( "LOOT_PDRINK" ); static const zone_type_id zone_type_LOOT_PFOOD( "LOOT_PFOOD" ); static const zone_type_id zone_type_LOOT_SEEDS( "LOOT_SEEDS" ); -static const zone_type_id zone_type_LOOT_SPARE_PARTS( "LOOT_SPARE_PARTS" ); -static const zone_type_id zone_type_LOOT_TOOL_MAGAZINE( "LOOT_TOOL_MAGAZINE" ); -static const zone_type_id zone_type_LOOT_TOOLS( "LOOT_TOOLS" ); -static const zone_type_id zone_type_LOOT_TRAPS( "LOOT_TRAPS" ); static const zone_type_id zone_type_LOOT_UNSORTED( "LOOT_UNSORTED" ); -static const zone_type_id zone_type_LOOT_VEHICLE_PARTS( "LOOT_VEHICLE_PARTS" ); -static const zone_type_id zone_type_LOOT_WEAPONS( "LOOT_WEAPONS" ); static const zone_type_id zone_type_LOOT_WOOD( "LOOT_WOOD" ); -static const zone_type_id zone_type_MINING( "MINING" ); -static const zone_type_id zone_type_MOPPING( "MOPPING" ); static const zone_type_id zone_type_NO_AUTO_PICKUP( "NO_AUTO_PICKUP" ); static const zone_type_id zone_type_NO_NPC_PICKUP( "NO_NPC_PICKUP" ); -static const zone_type_id zone_type_NPC_NO_INVESTIGATE( "NPC_NO_INVESTIGATE" ); -static const zone_type_id zone_type_NPC_INVESTIGATE_ONLY( "NPC_INVESTIGATE_ONLY" ); -static const zone_type_id zone_type_NPC_RETREAT( "NPC_RETREAT" ); static const zone_type_id zone_type_SOURCE_FIREWOOD( "SOURCE_FIREWOOD" ); static const zone_type_id zone_type_STRIP_CORPSES( "STRIP_CORPSES" ); static const zone_type_id zone_type_UNLOAD_ALL( "UNLOAD_ALL" ); -static const zone_type_id zone_type_VEHICLE_DECONSTRUCT( "VEHICLE_DECONSTRUCT" ); -static const zone_type_id zone_type_VEHICLE_PATROL( "VEHICLE_PATROL" ); -static const zone_type_id zone_type_VEHICLE_REPAIR( "VEHICLE_REPAIR" ); -static const zone_type_id zone_type_ZONE_START_POINT( "ZONE_START_POINT" ); - const std::vector ignorable_zone_types = { zone_type_AUTO_EAT, @@ -200,51 +92,6 @@ zone_manager::zone_manager() for( const zone_type &zone : zone_type::get_all() ) { types.emplace( zone.id, zone ); } - - types.emplace( zone_type_AUTO_DRINK, - zone_type( to_translation( "Auto Drink" ), - to_translation( "Items in this zone will be automatically consumed during a long activity if you get thirsty." ) ) ); - types.emplace( zone_type_AUTO_EAT, - zone_type( to_translation( "Auto Eat" ), - to_translation( "Items in this zone will be automatically eaten during a long activity if you get hungry." ) ) ); - types.emplace( zone_type_CAMP_FOOD, - zone_type( to_translation( "Basecamp: Food" ), - to_translation( "Items in this zone will be added to a basecamp's food supply in the Distribute Food mission." ) ) ); - types.emplace( zone_type_CAMP_STORAGE, - zone_type( to_translation( "Basecamp: Storage" ), - to_translation( "Items in this zone will be added to a basecamp's inventory for use by its workers." ) ) ); - types.emplace( zone_type_CHOP_TREES, - zone_type( to_translation( "Chop Trees" ), - to_translation( "Designate an area to chop down trees." ) ) ); - types.emplace( zone_type_CONSTRUCTION_BLUEPRINT, - zone_type( to_translation( "Construction: Blueprint" ), - to_translation( "Designate a blueprint zone for construction." ) ) ); - types.emplace( zone_type_FARM_PLOT, - zone_type( to_translation( "Farm: Plot" ), - to_translation( "Designate a farm plot for tilling and planting." ) ) ); - types.emplace( zone_type_FISHING_SPOT, - zone_type( to_translation( "Fishing Spot" ), - to_translation( "Designate an area to fish from." ) ) ); - types.emplace( zone_type_MINING, - zone_type( to_translation( "Mine Terrain" ), - to_translation( "Designate an area to mine." ) ) ); - types.emplace( zone_type_MOPPING, - zone_type( to_translation( "Mop Tile" ), - to_translation( "Designate an area to mop clean." ) ) ); - types.emplace( zone_type_SOURCE_FIREWOOD, - zone_type( to_translation( "Source: Firewood" ), - to_translation( "Source for firewood or other flammable materials in this zone may be used to automatically refuel fires. " - "This will be done to maintain light during long-running tasks such as crafting, reading or waiting." ) ) ); - types.emplace( zone_type_VEHICLE_DECONSTRUCT, - zone_type( to_translation( "Vehicle Deconstruct Zone" ), - to_translation( "Any vehicles in this area are marked for deconstruction." ) ) ); - types.emplace( zone_type_VEHICLE_PATROL, - zone_type( to_translation( "Vehicle Patrol Zone" ), - to_translation( "Vehicles with an autopilot will patrol in this zone." ) ) ); - types.emplace( zone_type_VEHICLE_REPAIR, - zone_type( to_translation( "Vehicle Repair Zone" ), - to_translation( "Any vehicles in this area are marked for repair work." ) ) ); - } void zone_manager::clear() @@ -268,6 +115,11 @@ std::string zone_type::desc() const return desc_.translated(); } +field_type_str_id zone_type::get_field() const +{ + return field_; +} + namespace { generic_factory zone_type_factory( "zone_type" ); @@ -304,6 +156,7 @@ void zone_type::load( const JsonObject &jo, const std::string_view ) { mandatory( jo, was_loaded, "name", name_ ); mandatory( jo, was_loaded, "id", id ); + mandatory( jo, was_loaded, "display_field", field_ ); optional( jo, was_loaded, "description", desc_, translation() ); optional( jo, was_loaded, "can_be_personal", can_be_personal ); optional( jo, was_loaded, "hidden", hidden ); @@ -813,9 +666,19 @@ void zone_data::set_position( const std::pair &position, debugmsg( "Tried moving a lootzone bound to a vehicle part" ); return; } + bool displayed = is_displayed; + + if( displayed ) { + toggle_display(); + } + start = position.first; end = position.second; + if( displayed ) { + toggle_display(); + } + if( !skip_cache_update ) { zone_manager::get_manager().cache_data( update_avatar ); } @@ -832,147 +695,11 @@ void zone_data::set_temporary_disabled( const bool enabled_arg ) temporarily_disabled = enabled_arg; } -static field_type_str_id field_of( zone_data *zone ) -{ - zone_type_id type = zone->get_type(); - - if( type == zone_type_AUTO_DRINK ) { - return fd_auto_drink_zone; - } else if( type == zone_type_AUTO_EAT ) { - return fd_auto_eat_zone; - } else if( type == zone_type_CAMP_FOOD ) { - return fd_basecamp_food_zone; - } else if( type == zone_type_CAMP_STORAGE ) { - return fd_basecamp_storage_zone; - } else if( type == zone_type_CHOP_TREES ) { - return fd_chop_trees_zone; - } else if( type == zone_type_CONSTRUCTION_BLUEPRINT ) { - return fd_construction_blueprint_zone; - } else if( type == zone_type_DISASSEMBLE ) { - return fd_disassembly_work_zone; - } else if( type == zone_type_FARM_PLOT ) { - return fd_farm_plot_zone; - } else if( type == zone_type_FISHING_SPOT ) { - return fd_fishing_spot_zone; - } else if( type == zone_type_LOOT_AMMO ) { - return fd_ammo_loot_zone; - } else if( type == zone_type_LOOT_ARMOR ) { - return fd_armor_loot_zone; - } else if( type == zone_type_LOOT_ARTIFACTS ) { - return fd_artifacts_loot_zone; - } else if( type == zone_type_LOOT_BIONICS ) { - return fd_bionics_loot_zone; - } else if( type == zone_type_LOOT_BOOKS ) { - return fd_books_loot_zone; - } else if( type == zone_type_LOOT_CHEMICAL ) { - return fd_chemical_loot_zone; - } else if( type == zone_type_LOOT_CLOTHING ) { - return fd_clothing_loot_zone; - } else if( type == zone_type_LOOT_CONTAINERS ) { - return fd_containers_loot_zone; - } else if( type == zone_type_LOOT_CORPSE ) { - return fd_corpses_loot_zone; - } else if( type == zone_type_LOOT_CURRENCY ) { - return fd_currency_loot_zone; - } else if( type == zone_type_LOOT_CUSTOM ) { - return fd_custom_loot_zone; - } else if( type == zone_type_LOOT_DEFAULT ) { - return fd_default_loot_zone; - } else if( type == zone_type_LOOT_DRINK ) { - return fd_drink_loot_zone; - } else if( type == zone_type_LOOT_DRUGS ) { - return fd_drugs_loot_zone; - } else if( type == zone_type_LOOT_FARMOR ) { - return fd_filthy_armor_loot_zone; - } else if( type == zone_type_LOOT_FCLOTHING ) { - return fd_filthy_clothing_loot_zone; - } else if( type == zone_type_LOOT_FOOD ) { - return fd_food_loot_zone; - } else if( type == zone_type_LOOT_FUEL ) { - return fd_fuel_loot_zone; - } else if( type == zone_type_LOOT_GUNS ) { - return fd_guns_loot_zone; - } else if( type == zone_type_LOOT_IGNORE ) { - return fd_ignore_loot_zone; - } else if( type == zone_type_LOOT_IGNORE_FAVORITES ) { - return fd_ignore_favorites_loot_zone; - } else if( type == zone_type_LOOT_ITEM_GROUP ) { //### not in UI list... - return fd_item_group_loot_zone; - } else if( type == zone_type_LOOT_KEYS ) { - return fd_keys_loot_zone; - } else if( type == zone_type_LOOT_MAGAZINES ) { - return fd_magazines_loot_zone; - } else if( type == zone_type_LOOT_MANUALS ) { - return fd_manuals_loot_zone; - } else if( type == zone_type_LOOT_MAPS ) { - return fd_maps_loot_zone; - } else if( type == zone_type_LOOT_MA_MANUALS ) { - return fd_martial_arts_manuals_loot_zone; - } else if( type == zone_type_LOOT_MODS ) { - return fd_mods_loot_zone; - } else if( type == zone_type_LOOT_MUTAGENS ) { - return fd_mutagens_loot_zone; - } else if( type == zone_type_LOOT_OTHER ) { - return fd_other_loot_zone; - } else if( type == zone_type_LOOT_PDRINK ) { - return fd_perishable_drink_loot_zone; - } else if( type == zone_type_LOOT_PFOOD ) { - return fd_perishable_food_loot_zone; - } else if( type == zone_type_LOOT_SEEDS ) { - return fd_seeds_loot_zone; - } else if( type == zone_type_LOOT_SPARE_PARTS ) { - return fd_spare_parts_loot_zone; - } else if( type == zone_type_STRIP_CORPSES ) { - return fd_strip_corpses_loot_zone; - } else if( type == zone_type_LOOT_TOOL_MAGAZINE ) { - return fd_tool_magazines_loot_zone; - } else if( type == zone_type_LOOT_TOOLS ) { - return fd_tools_loot_zone; - } else if( type == zone_type_LOOT_TRAPS ) { - return fd_traps_loot_zone; - } else if( type == zone_type_UNLOAD_ALL ) { - return fd_unload_everything_loot_zone; - } else if( type == zone_type_LOOT_UNSORTED ) { - return fd_unsorted_loot_zone; - } else if( type == zone_type_LOOT_VEHICLE_PARTS ) { - return fd_vehicle_parts_loot_zone; - } else if( type == zone_type_LOOT_WEAPONS ) { - return fd_weapons_loot_zone; - } else if( type == zone_type_LOOT_WOOD ) { - return fd_wood_loot_zone; - } else if( type == zone_type_MINING ) { - return fd_mine_terrain_zone; - } else if( type == zone_type_MOPPING ) { - return fd_mop_tile_zone; - } else if( type == zone_type_NO_AUTO_PICKUP ) { - return fd_no_auto_pickup_zone; - } else if( type == zone_type_NO_NPC_PICKUP ) { - return fd_no_npc_pickup_zone; - } else if( type == zone_type_NPC_NO_INVESTIGATE ) { - return fd_npc_ignore_sounds_zone; - } else if( type == zone_type_NPC_INVESTIGATE_ONLY ) { - return fd_npc_investigation_area_zone; - } else if( type == zone_type_NPC_RETREAT ) { - return fd_npc_retreat_zone; - } else if( type == zone_type_SOURCE_FIREWOOD ) { - return fd_firewood_source_zone; - } else if( type == zone_type_ZONE_START_POINT ) { - return fd_start_point_zone; - } else if( type == zone_type_VEHICLE_DECONSTRUCT ) { - return fd_vehicle_deconstruct_zone; - } else if( type == zone_type_VEHICLE_PATROL ) { - return fd_vehicle_patrol_zone; - } else if( type == zone_type_VEHICLE_REPAIR ) { - return fd_vehicle_repair_zone; - } else { - return fd_null; - } -} - void zone_data::toggle_display() { if( this->is_vehicle ) { popup( colorize( _( "Zones tied to vehicles cannot be displayed" ), c_magenta ) ); + return; } is_displayed = !is_displayed; @@ -999,7 +726,16 @@ void zone_data::toggle_display() int y_start = std::min( start_remainder.y(), end_remainder.y() ); int y_end = std::max( start_remainder.y(), end_remainder.y() ); int z = get_start_point().z(); - field_type_str_id field = field_of( this ); + zone_type_id type = this->get_type(); + + field_type_str_id field = fd_null; + static const std::vector &all_zone_types = zone_type::get_all(); + for( zone_type zone : all_zone_types ) { + if( zone.id == type ) { + field = zone.get_field(); + break; + } + } if( field != fd_null ) { for( int x = x_start; x <= x_end; x++ ) { diff --git a/src/clzones.h b/src/clzones.h index 9df789ce37f34..7518a414d3900 100644 --- a/src/clzones.h +++ b/src/clzones.h @@ -44,6 +44,7 @@ class zone_type private: translation name_; translation desc_; + field_type_str_id field_; public: zone_type_id id; @@ -51,11 +52,13 @@ class zone_type bool was_loaded = false; zone_type() = default; - explicit zone_type( const translation &name, const translation &desc ) : name_( name ), - desc_( desc ) {} + explicit zone_type( const translation &name, const translation &desc, + const field_type_str_id &field ) : name_( name ), + desc_( desc ), field_( field ) {} std::string name() const; std::string desc() const; + field_type_str_id get_field() const; bool can_be_personal = false; bool hidden = false; diff --git a/src/game.cpp b/src/game.cpp index 4425453f46668..e490ea0aadbea 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -6848,7 +6848,7 @@ void game::zones_manager() u.view_offset = tripoint_zero; - const int zone_ui_height = 13; + const int zone_ui_height = 14; const int zone_options_height = debug_mode ? 6 : 7; const int width = 45; @@ -7174,6 +7174,13 @@ void game::zones_manager() break; } + int vehicle_zones_pre = 0; + for( zone_manager::ref_zone_data zone : get_zones() ) { + if( zone.get().get_is_vehicle() ) { + vehicle_zones_pre++; + } + } + // TODO: fix point types mgr.add( name, id, get_player_character().get_faction()->id, false, true, position->first, position->second, options, false ); @@ -7181,6 +7188,17 @@ void game::zones_manager() zones = get_zones(); active_index = zone_cnt - 1; + int vehicle_zones_post = 0; + for( zone_manager::ref_zone_data zone : zones ) { + if( zone.get().get_is_vehicle() ) { + vehicle_zones_post++; + } + } + + if( vehicle_zones_post == vehicle_zones_pre ) { + active_index -= vehicle_zones_post; + } + stuff_changed = true; } while( false ); @@ -7221,6 +7239,15 @@ void game::zones_manager() zones = get_zones(); active_index = zone_cnt - 1; + int vehicle_zones = 0; + for( zone_manager::ref_zone_data zone : zones ) { + if( zone.get().get_is_vehicle() ) { + vehicle_zones++; + } + } + + active_index -= vehicle_zones; + stuff_changed = true; } while( false ); From 2d5632943ff5be488799f268ed666302b91bad72 Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Sat, 27 Jan 2024 01:27:46 +0100 Subject: [PATCH 05/10] Fulfilled demand to not assign variable uselessly --- src/game.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index e490ea0aadbea..f94cc1056b87f 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -6773,10 +6773,9 @@ static void zones_manager_shortcuts( const catacurses::window &w_info, faction_i shortcut_print( w_info, point( tmpx, 1 ), c_white, c_light_green, _( "isable" ) ); tmpx = 1; - tmpx += shortcut_print( w_info, point( tmpx, 2 ), c_white, c_light_green, - _( "-Toggle zone display" ) ); + shortcut_print( w_info, point( tmpx, 2 ), c_white, c_light_green, + _( "-Toggle zone display" ) ); - tmpx = 1; tmpx += shortcut_print( w_info, point( tmpx, 3 ), c_white, c_light_green, _( "-Enable personal" ) ) + 2; shortcut_print( w_info, point( tmpx, 3 ), c_white, c_light_green, From 8c8c587a5e25618acb95faf8467efca088cf82df Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Sat, 27 Jan 2024 10:59:50 +0100 Subject: [PATCH 06/10] Demanded change --- src/clzones.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/clzones.cpp b/src/clzones.cpp index 24b11f56c81b8..5e0858061f325 100644 --- a/src/clzones.cpp +++ b/src/clzones.cpp @@ -730,7 +730,7 @@ void zone_data::toggle_display() field_type_str_id field = fd_null; static const std::vector &all_zone_types = zone_type::get_all(); - for( zone_type zone : all_zone_types ) { + for( const zone_type &zone : all_zone_types ) { if( zone.id == type ) { field = zone.get_field(); break; From 1c1b0cc88a73ff55d2356100dffedefa5debb938 Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Sat, 27 Jan 2024 14:34:44 +0100 Subject: [PATCH 07/10] Implemented overlapping zone display handling --- src/clzones.cpp | 51 ++++++++++++++++++++++++++++++++++++++++++++++--- src/clzones.h | 4 ++++ 2 files changed, 52 insertions(+), 3 deletions(-) diff --git a/src/clzones.cpp b/src/clzones.cpp index 5e0858061f325..deb2acf7e326c 100644 --- a/src/clzones.cpp +++ b/src/clzones.cpp @@ -695,15 +695,13 @@ void zone_data::set_temporary_disabled( const bool enabled_arg ) temporarily_disabled = enabled_arg; } -void zone_data::toggle_display() +void zone_data::refresh_display() const { if( this->is_vehicle ) { popup( colorize( _( "Zones tied to vehicles cannot be displayed" ), c_magenta ) ); return; } - is_displayed = !is_displayed; - std::unique_ptr p_update_tmap = std::make_unique(); tinymap &update_tmap = *p_update_tmap; @@ -750,6 +748,53 @@ void zone_data::toggle_display() } } +void zone_data::toggle_display() +{ + if( this->is_vehicle ) { + popup( colorize( _( "Zones tied to vehicles cannot be displayed" ), c_magenta ) ); + return; + } + + is_displayed = !is_displayed; + + this->refresh_display(); + + // Take care of the situation where parts of overlapping zones were erased by the toggling. + if( !is_displayed ) { + + const point_abs_ms start = point_abs_ms( std::min( this->start.x, this->end.x ), + std::min( this->start.y, this->end.y ) ); + + const point_abs_ms end = point_abs_ms( std::max( this->start.x, this->end.x ), + std::max( this->start.y, this->end.y ) ); + + const inclusive_rectangle zone_rectangle( start, end ); + + for( zone_manager::ref_zone_data zone : zone_manager::get_manager().get_zones() ) { + // Assumes zones are a single Z level only. Also, inclusive_cuboid doesn't have an overlap function... + if( zone.get().get_is_displayed() && zone.get().get_type() == this->get_type() && + this->start.z == zone.get().get_start_point().z() ) { + const point_abs_ms candidate_begin = zone.get().get_start_point().xy(); + const point_abs_ms candidate_stop = zone.get().get_end_point().xy(); + + const point_abs_ms candidate_start = point_abs_ms( std::min( candidate_begin.x(), + candidate_stop.x() ), + std::min( candidate_begin.y(), candidate_stop.y() ) ); + + const point_abs_ms candidate_end = point_abs_ms( std::max( candidate_begin.x(), + candidate_stop.x() ), + std::max( candidate_begin.y(), candidate_stop.y() ) ); + + const inclusive_rectangle candidate_rectangle( candidate_start, candidate_end ); + + if( zone_rectangle.overlaps( candidate_rectangle ) ) { + zone.get().refresh_display(); + } + } + } + } +} + void zone_data::set_is_vehicle( const bool is_vehicle_arg ) { is_vehicle = is_vehicle_arg; diff --git a/src/clzones.h b/src/clzones.h index 7518a414d3900..3c6c62ac5ba18 100644 --- a/src/clzones.h +++ b/src/clzones.h @@ -413,6 +413,10 @@ class zone_data bool update_avatar = true, bool skip_cache_update = false ); void set_enabled( bool enabled_arg ); void set_temporary_disabled( bool enabled_arg ); + // Displays/removes display fields based on the current is_displayed value. + // Can be used to "repair" the display when an overlapping field has removed its + // part of the shared area, as well as for the actual setting/removal of the fields. + void refresh_display() const; void toggle_display(); void set_is_vehicle( bool is_vehicle_arg ); From c0f22e8bebe934e54e2d94becaf70fa6c1a288e5 Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Sat, 27 Jan 2024 19:56:25 +0100 Subject: [PATCH 08/10] Changed glyph to one that displays the same as the JSON entry --- data/json/zone_field_type.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/zone_field_type.json b/data/json/zone_field_type.json index 236c506564421..121dd8c218d66 100644 --- a/data/json/zone_field_type.json +++ b/data/json/zone_field_type.json @@ -254,7 +254,7 @@ { "id": "fd_martial_arts_manuals_loot_zone", "type": "field_type", - "intensity_levels": [ { "name": "martial arts manuals loot zone", "sym": "ö", "dangerous": false } ], + "intensity_levels": [ { "name": "martial arts manuals loot zone", "sym": "O", "dangerous": false } ], "priority": 1, "display_field": true }, From e75742c6e3172819a6673c7d0116f0e72825084c Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Sat, 27 Jan 2024 19:56:57 +0100 Subject: [PATCH 09/10] Implemented multi submap handling (plus a bug fix) --- src/clzones.cpp | 67 +++++++++++++++++++++++++++++++------------------ src/map.cpp | 2 +- 2 files changed, 43 insertions(+), 26 deletions(-) diff --git a/src/clzones.cpp b/src/clzones.cpp index deb2acf7e326c..67886083d9520 100644 --- a/src/clzones.cpp +++ b/src/clzones.cpp @@ -695,6 +695,17 @@ void zone_data::set_temporary_disabled( const bool enabled_arg ) temporarily_disabled = enabled_arg; } +// This operations can presumably be defined using templates. It should also already exist somewhere else. +static std::pair get_corners( tripoint_abs_ms a, + tripoint_abs_ms b ) +{ + const tripoint_abs_ms start = tripoint_abs_ms( std::min( a.x(), b.x() ), std::min( a.y(), b.y() ), + std::min( a.z(), b.z() ) ); + const tripoint_abs_ms end = tripoint_abs_ms( std::max( a.x(), b.x() ), std::max( a.y(), b.y() ), + std::max( a.z(), b.z() ) ); + return { start, end }; +} + void zone_data::refresh_display() const { if( this->is_vehicle ) { @@ -705,25 +716,18 @@ void zone_data::refresh_display() const std::unique_ptr p_update_tmap = std::make_unique(); tinymap &update_tmap = *p_update_tmap; - //### failing to get project_remain to accept my parameters, and so resorting to crude alternative. - // Thought it should be: - // point_abs_sm quotient; - // tripoint_sm_ms remainder; - // std::tie(quotient, remainder) = coords::project_remain(get_start_point()); - const tripoint_abs_sm sm_start_pos = coords::project_to( get_start_point() ); - tripoint_abs_ms ms_start_projection = coords::project_to < coords::ms >( sm_start_pos ); - tripoint_rel_ms start_remainder = get_start_point() - ms_start_projection; - // Assuming the code downstream can handle any relative location of start and end. - tripoint_rel_ms end_remainder = get_end_point() - ms_start_projection; - - update_tmap.load( sm_start_pos, true ); - - //### Think there is an iterator for all coordinates in an X/Y block, but can't find it. - int x_start = std::min( start_remainder.x(), end_remainder.x() ); - int x_end = std::max( start_remainder.x(), end_remainder.x() ); - int y_start = std::min( start_remainder.y(), end_remainder.y() ); - int y_end = std::max( start_remainder.y(), end_remainder.y() ); - int z = get_start_point().z(); + std::pair bounds = get_corners( get_start_point(), + get_end_point() ); + const tripoint_abs_ms start = bounds.first; + const tripoint_abs_ms end = bounds.second; + + const tripoint_abs_sm sm_start_pos = coords::project_to( start ); + const tripoint_abs_sm sm_end_pos = coords::project_to( end ); + const tripoint_rel_ms start_remainder = get_start_point() - coords::project_to < coords::ms > + ( sm_start_pos ); + const tripoint_rel_ms end_remainder = get_end_point() - coords::project_to < coords::ms > + ( sm_end_pos ); + zone_type_id type = this->get_type(); field_type_str_id field = fd_null; @@ -736,12 +740,25 @@ void zone_data::refresh_display() const } if( field != fd_null ) { - for( int x = x_start; x <= x_end; x++ ) { - for( int y = y_start; y <= y_end; y++ ) { - if( is_displayed ) { - update_tmap.add_field( tripoint( x, y, z ), field, 1, time_duration::from_turns( 0 ), false ); - } else { - update_tmap.delete_field( tripoint( x, y, z ), field ); + tripoint start_sm; + tripoint end_sm; + + for( int i = sm_start_pos.x(); i <= sm_end_pos.x(); i++ ) { + for( int k = sm_start_pos.y(); k <= sm_end_pos.y(); k++ ) { + // We assume the Z coordinate will remain fixed + update_tmap.load( { i, k, sm_start_pos.z() }, false ); + + start_sm = tripoint( i > sm_start_pos.x() ? 0 : start_remainder.x(), + k > sm_start_pos.y() ? 0 : start_remainder.y(), start_remainder.z() ); + end_sm = tripoint( i < sm_end_pos.x() ? MAPSIZE : end_remainder.x(), + k < sm_end_pos.y() ? MAPSIZE : end_remainder.y(), end_remainder.z() ); + + for( tripoint pt : update_tmap.points_in_rectangle( start_sm, end_sm ) ) { + if( is_displayed ) { + update_tmap.add_field( pt, field, 1, time_duration::from_turns( 0 ), false ); + } else { + update_tmap.delete_field( pt, field ); + } } } } diff --git a/src/map.cpp b/src/map.cpp index 6c38fab2c5d2a..19acbeaff180b 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -6505,7 +6505,7 @@ void map::delete_field( const tripoint &p, const field_type_id &field_to_remove return; } - for( auto it = curfield.begin(); it != curfield.end(); ) { + for( auto it = curfield.begin(); it != curfield.end(); it++ ) { if( it->second.get_field_type() == field_to_remove ) { --current_submap->field_count; curfield.remove_field( it ); From ff78a04ab91984c5c29f21326218c8a81200a81a Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Sun, 28 Jan 2024 11:19:19 +0100 Subject: [PATCH 10/10] Work around for erroneous clang-tydy rejection --- src/clzones.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/clzones.cpp b/src/clzones.cpp index 67886083d9520..0e5b473e19fd3 100644 --- a/src/clzones.cpp +++ b/src/clzones.cpp @@ -1796,7 +1796,9 @@ void mapgen_place_zone( tripoint const &start, tripoint const &end, zone_type_id tripoint const s_ = std::min( start, end ); tripoint const e_ = std::max( start, end ); if( type == zone_type_LOOT_CUSTOM || type == zone_type_LOOT_ITEM_GROUP ) { - dynamic_cast( &*options )->set_mark( filter ); + if( dynamic_cast( &*options ) != nullptr ) { + dynamic_cast( &*options )->set_mark( filter ); + } } mgr.add( name, type, fac, false, true, s_, e_, options, false, true, pmap ); }