Skip to content

Commit

Permalink
s/_path_path()/_path()/g
Browse files Browse the repository at this point in the history
  • Loading branch information
akrieger committed Oct 14, 2024
1 parent 944a053 commit 16b832f
Show file tree
Hide file tree
Showing 19 changed files with 55 additions and 55 deletions.
4 changes: 2 additions & 2 deletions src/auto_note.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace auto_notes
{
cata_path auto_note_settings::build_save_path() const
{
return PATH_INFO::player_base_save_path_path() + ".ano.json";
return PATH_INFO::player_base_save_path() + ".ano.json";
}

void auto_note_settings::clear()
Expand All @@ -42,7 +42,7 @@ void auto_note_settings::clear()

bool auto_note_settings::save( bool bCharacter )
{
if( bCharacter && !file_exist( PATH_INFO::player_base_save_path_path() + ".sav" ) ) {
if( bCharacter && !file_exist( PATH_INFO::player_base_save_path() + ".sav" ) ) {
return true;
}
cata_path sGlobalFile = PATH_INFO::autonote();
Expand Down
6 changes: 3 additions & 3 deletions src/auto_pickup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -937,9 +937,9 @@ bool player_settings::save( const bool bCharacter )
cata_path savefile = PATH_INFO::autopickup();

if( bCharacter ) {
savefile = PATH_INFO::player_base_save_path_path() + ".apu.json";
savefile = PATH_INFO::player_base_save_path() + ".apu.json";

const cata_path player_save = PATH_INFO::player_base_save_path_path() + ".sav";
const cata_path player_save = PATH_INFO::player_base_save_path() + ".sav";
//Character not saved yet.
if( !file_exist( player_save ) ) {
return true;
Expand All @@ -966,7 +966,7 @@ void player_settings::load( const bool bCharacter )
{
cata_path sFile = PATH_INFO::autopickup();
if( bCharacter ) {
sFile = PATH_INFO::player_base_save_path_path() + ".apu.json";
sFile = PATH_INFO::player_base_save_path() + ".apu.json";
}

read_from_file_optional_json( sFile, [&]( const JsonValue & jv ) {
Expand Down
4 changes: 2 additions & 2 deletions src/clzones.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1693,9 +1693,9 @@ namespace
cata_path _savefile( std::string const &suffix, bool player )
{
if( player ) {
return PATH_INFO::player_base_save_path_path() + string_format( ".zones%s.json", suffix );
return PATH_INFO::player_base_save_path() + string_format( ".zones%s.json", suffix );
} else {
return PATH_INFO::world_base_save_path_path() / string_format( "zones%s.json", suffix );
return PATH_INFO::world_base_save_path() / string_format( "zones%s.json", suffix );
}
}
} // namespace
Expand Down
2 changes: 1 addition & 1 deletion src/debug_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ void write_min_archive()
tripoint_abs_om const om = project_to<coords::om>( get_avatar().get_location() );
tripoint_range<tripoint> const oms = points_in_radius( tripoint{ om.raw().xy(), 0 }, 1 );

fs::path const save_root( PATH_INFO::world_base_save_path_path() );
fs::path const save_root( PATH_INFO::world_base_save_path() );
std::string const ofile = save_root.string() + "-trimmed.tar.gz";

tgz_archiver tgz( ofile );
Expand Down
6 changes: 3 additions & 3 deletions src/diary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ void diary::export_to_txt( bool lastexport )
{
std::ofstream myfile;
cata_path path = lastexport ? PATH_INFO::memorialdir_path() :
PATH_INFO::world_base_save_path_path();
PATH_INFO::world_base_save_path();
path = path / ( owner + "s_diary.txt" );
myfile.open( path.get_unrelative_path() );

Expand All @@ -697,7 +697,7 @@ void diary::export_to_txt( bool lastexport )
bool diary::store()
{
std::string name = base64_encode( get_avatar().get_save_id() + "_diary" );
cata_path path = PATH_INFO::world_base_save_path_path() / ( name + ".json" );
cata_path path = PATH_INFO::world_base_save_path() / ( name + ".json" );
const bool iswriten = write_to_file( path, [&]( std::ostream & fout ) {
serialize( fout );
}, _( "diary data" ) );
Expand Down Expand Up @@ -748,7 +748,7 @@ void diary::serialize( JsonOut &jsout )
void diary::load()
{
std::string name = base64_encode( get_avatar().get_save_id() + "_diary" );
cata_path path = PATH_INFO::world_base_save_path_path() / ( name + ".json" );
cata_path path = PATH_INFO::world_base_save_path() / ( name + ".json" );
if( file_exist( path ) ) {
read_from_file_json( path, [&]( const JsonValue & jv ) {
deserialize( jv );
Expand Down
32 changes: 16 additions & 16 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2991,7 +2991,7 @@ static std::string timestamp_now()

void game::move_save_to_graveyard()
{
const cata_path save_dir = PATH_INFO::world_base_save_path_path();
const cata_path save_dir = PATH_INFO::world_base_save_path();
const cata_path graveyard_dir = PATH_INFO::graveyarddir_path() / timestamp_now();
const std::string prefix = base64_encode( u.get_save_id() ) + ".";

Expand Down Expand Up @@ -3023,7 +3023,7 @@ void game::move_save_to_graveyard()

void game::load_master()
{
const cata_path datafile = PATH_INFO::world_base_save_path_path() / SAVE_MASTER;
const cata_path datafile = PATH_INFO::world_base_save_path() / SAVE_MASTER;
read_from_file_optional( datafile, [this, &datafile]( std::istream & is ) {
unserialize_master( datafile, is );
} );
Expand Down Expand Up @@ -3055,8 +3055,8 @@ bool game::load( const std::string &world )

bool game::load( const save_t &name )
{
const cata_path worldpath = PATH_INFO::world_base_save_path_path();
const cata_path save_file_path = PATH_INFO::world_base_save_path_path() /
const cata_path worldpath = PATH_INFO::world_base_save_path();
const cata_path save_file_path = PATH_INFO::world_base_save_path() /
( name.base_path() + SAVE_EXTENSION );

bool abort = false;
Expand Down Expand Up @@ -3138,7 +3138,7 @@ bool game::load( const save_t &name )
get_safemode().load_character(); // Load character safemode rules
zone_manager::get_manager().load_zones(); // Load character world zones
read_from_file_optional_json(
PATH_INFO::world_base_save_path_path() / "uistate.json",
PATH_INFO::world_base_save_path() / "uistate.json",
[]( const JsonValue & jsin ) {
uistate.deserialize( jsin.get_object() );
} );
Expand Down Expand Up @@ -3243,8 +3243,8 @@ void game::load_world_modfiles()
load_packs( _( "Loading files" ), mods );

// Load additional mods from that world-specific folder
load_mod_data_from_dir( PATH_INFO::world_base_save_path_path() / "mods", "custom" );
load_mod_interaction_data_from_dir( PATH_INFO::world_base_save_path_path() / "mods" /
load_mod_data_from_dir( PATH_INFO::world_base_save_path() / "mods", "custom" );
load_mod_interaction_data_from_dir( PATH_INFO::world_base_save_path() / "mods" /
"mod_interactions", "custom" );

DynamicDataLoader::get_instance().finalize_loaded_data();
Expand Down Expand Up @@ -3328,7 +3328,7 @@ void game::reset_npc_dispositions()
//Saves all factions and missions and npcs.
bool game::save_factions_missions_npcs()
{
cata_path masterfile = PATH_INFO::world_base_save_path_path() / SAVE_MASTER;
cata_path masterfile = PATH_INFO::world_base_save_path() / SAVE_MASTER;
return write_to_file( masterfile, [&]( std::ostream & fout ) {
serialize_master( fout );
}, _( "factions data" ) );
Expand All @@ -3349,7 +3349,7 @@ bool game::save_maps()

bool game::save_player_data()
{
const cata_path playerfile = PATH_INFO::player_base_save_path_path();
const cata_path playerfile = PATH_INFO::player_base_save_path();

const bool saved_data = write_to_file( playerfile + SAVE_EXTENSION, [&]( std::ostream & fout ) {
serialize( fout );
Expand Down Expand Up @@ -3495,7 +3495,7 @@ bool game::save()
!get_auto_notes_settings().save( true ) ||
!get_safemode().save_character() ||
!zone_manager::get_manager().save_zones() ||
!write_to_file( PATH_INFO::world_base_save_path_path() / "uistate.json", [&](
!write_to_file( PATH_INFO::world_base_save_path() / "uistate.json", [&](
std::ostream & fout ) {
JsonOut jsout( fout );
uistate.serialize( jsout );
Expand All @@ -3507,7 +3507,7 @@ bool game::save()
world_generator->last_character_name = u.name;
world_generator->save_last_world_info();
world_generator->active_world->add_save( save_t::from_save_id( u.get_save_id() ) );
write_to_file( PATH_INFO::world_base_save_path_path() / ( base64_encode(
write_to_file( PATH_INFO::world_base_save_path() / ( base64_encode(
u.get_save_id() ) + ".pt" ), [&total_time_played]( std::ostream & fout ) {
fout.imbue( std::locale::classic() );
fout << total_time_played.count();
Expand Down Expand Up @@ -8015,7 +8015,7 @@ bool game::take_screenshot( const std::string &path ) const
bool game::take_screenshot() const
{
// check that the current '<world>/screenshots' directory exists
cata_path map_directory = PATH_INFO::world_base_save_path_path() / "screenshots";
cata_path map_directory = PATH_INFO::world_base_save_path() / "screenshots";
assure_dir_exist( map_directory );

// build file name: <map_dir>/screenshots/[<character_name>]_<date>.png
Expand Down Expand Up @@ -13264,17 +13264,17 @@ Creature *game::get_creature_if( const std::function<bool( const Creature & )> &
return nullptr;
}

cata_path PATH_INFO::player_base_save_path_path()
cata_path PATH_INFO::player_base_save_path()
{
return PATH_INFO::world_base_save_path_path() / base64_encode( get_avatar().get_save_id() );
return PATH_INFO::world_base_save_path() / base64_encode( get_avatar().get_save_id() );
}

cata_path PATH_INFO::world_base_save_path_path()
cata_path PATH_INFO::world_base_save_path()
{
if( world_generator->active_world == nullptr ) {
return PATH_INFO::savedir_path();
}
return world_generator->active_world->folder_path_path();
return world_generator->active_world->folder_path();
}

void game::shift_destination_preview( const point &delta )
Expand Down
2 changes: 1 addition & 1 deletion src/json_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace
{
flexbuffer_cache &base_cache()
{
static flexbuffer_cache cache{ ( PATH_INFO::base_path_path() / "cache" ).get_unrelative_path(), PATH_INFO::base_path_path().get_unrelative_path() };
static flexbuffer_cache cache{ ( PATH_INFO::base_path() / "cache" ).get_unrelative_path(), PATH_INFO::base_path().get_unrelative_path() };
return cache;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ bool main_menu::load_game( std::string const &worldname, save_t const &savegame
static std::optional<std::chrono::seconds> get_playtime_from_save( const WORLD *world,
const save_t &save )
{
cata_path playtime_file = world->folder_path_path() / ( save.base_path() + ".pt" );
cata_path playtime_file = world->folder_path() / ( save.base_path() + ".pt" );
std::optional<std::chrono::seconds> pt_seconds;
if( file_exist( playtime_file ) ) {
read_from_file( playtime_file, [&pt_seconds]( std::istream & fin ) {
Expand Down
2 changes: 1 addition & 1 deletion src/map_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static constexpr int MM_SIZE = MAPSIZE * 2;

static cata_path find_mm_dir()
{
return PATH_INFO::player_base_save_path_path() + ".mm1";
return PATH_INFO::player_base_save_path() + ".mm1";
}

static cata_path find_region_path( const cata_path &dirname, const tripoint &p )
Expand Down
4 changes: 2 additions & 2 deletions src/mapbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static cata_path find_quad_path( const cata_path &dirname, const tripoint_abs_om
static cata_path find_dirname( const tripoint_abs_omt &om_addr )
{
const tripoint_abs_seg segment_addr = project_to<coords::seg>( om_addr );
return PATH_INFO::world_base_save_path_path() / "maps" / string_format( "%d.%d.%d",
return PATH_INFO::world_base_save_path() / "maps" / string_format( "%d.%d.%d",
segment_addr.x(),
segment_addr.y(), segment_addr.z() );
}
Expand Down Expand Up @@ -136,7 +136,7 @@ bool mapbuffer::submap_exists( const tripoint_abs_sm &p )

void mapbuffer::save( bool delete_after_save )
{
assure_dir_exist( PATH_INFO::world_base_save_path_path() / "maps" );
assure_dir_exist( PATH_INFO::world_base_save_path() / "maps" );

int num_saved_submaps = 0;
int num_total_submaps = submaps.size();
Expand Down
2 changes: 1 addition & 1 deletion src/mod_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ void mod_manager::load_mod_info( const cata_path &info_file_path )

cata_path mod_manager::get_mods_list_file( const WORLD *world )
{
return world->folder_path_path() / "mods.json";
return world->folder_path() / "mods.json";
}

void mod_manager::save_mods_list( const WORLD *world ) const
Expand Down
4 changes: 2 additions & 2 deletions src/overmapbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ int camp_reference::get_distance_from_bounds() const

cata_path overmapbuffer::terrain_filename( const point_abs_om &p )
{
return PATH_INFO::world_base_save_path_path() / string_format( "o.%d.%d", p.x(), p.y() );
return PATH_INFO::world_base_save_path() / string_format( "o.%d.%d", p.x(), p.y() );
}

cata_path overmapbuffer::player_filename( const point_abs_om &p )
{
return PATH_INFO::player_base_save_path_path() + string_format( ".seen.%d.%d", p.x(), p.y() );
return PATH_INFO::player_base_save_path() + string_format( ".seen.%d.%d", p.x(), p.y() );
}

overmap &overmapbuffer::get( const point_abs_om &p )
Expand Down
2 changes: 1 addition & 1 deletion src/path_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ cata_path PATH_INFO::base_colors()
{
return config_dir_path_value / "base_colors.json";
}
cata_path PATH_INFO::base_path_path()
cata_path PATH_INFO::base_path()
{
return base_path_path_value;
}
Expand Down
6 changes: 3 additions & 3 deletions src/path_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ std::string title( holiday current_holiday );
cata_path autopickup();
cata_path autonote();
cata_path base_colors();
cata_path base_path_path();
cata_path base_path();
cata_path color_templates();
cata_path color_themes();
cata_path colors();
Expand Down Expand Up @@ -82,7 +82,7 @@ cata_path mods_replacements();
cata_path names();
cata_path options();
cata_path panel_options();
cata_path player_base_save_path_path();
cata_path player_base_save_path();
cata_path pocket_presets();
cata_path safemode();
cata_path savedir_path();
Expand All @@ -92,7 +92,7 @@ cata_path user_gfx();
cata_path user_keybindings();
cata_path user_moddir_path();
cata_path user_sound();
cata_path world_base_save_path_path();
cata_path world_base_save_path();

void set_datadir( const std::string &datadir );
void set_config_dir( const std::string &config_dir );
Expand Down
6 changes: 3 additions & 3 deletions src/safemode_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,8 +785,8 @@ bool safemode::save( const bool is_character_in )
cata_path file = PATH_INFO::safemode();

if( is_character ) {
file = PATH_INFO::player_base_save_path_path() + ".sfm.json";
if( !file_exist( PATH_INFO::player_base_save_path_path() + ".sav" ) ) {
file = PATH_INFO::player_base_save_path() + ".sfm.json";
if( !file_exist( PATH_INFO::player_base_save_path() + ".sav" ) ) {
return true; //Character not saved yet.
}
}
Expand Down Expand Up @@ -818,7 +818,7 @@ void safemode::load( const bool is_character_in )
std::ifstream fin;
cata_path file = PATH_INFO::safemode();
if( is_character ) {
file = PATH_INFO::player_base_save_path_path() + ".sfm.json";
file = PATH_INFO::player_base_save_path() + ".sfm.json";
}

fs::path file_path = file.get_unrelative_path();
Expand Down
4 changes: 2 additions & 2 deletions src/translations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ std::string locale_dir()
#endif

#if !defined(__ANDROID__) && ((defined(__linux__) || defined(CATA_IS_ON_BSD) || (defined(MACOSX) && !defined(TILES))))
if( !PATH_INFO::base_path_path().get_logical_root_path().empty() ) {
loc_dir = ( PATH_INFO::base_path_path() / "share" / "locale" ).generic_u8string();
if( !PATH_INFO::base_path().get_logical_root_path().empty() ) {
loc_dir = ( PATH_INFO::base_path() / "share" / "locale" ).generic_u8string();
} else {
loc_dir = PATH_INFO::langdir();
}
Expand Down
Loading

0 comments on commit 16b832f

Please sign in to comment.