public BoolWithMessage LoadMap(MapListItem map) { if (SessionPath.IsSessionPathValid() == false) { return(BoolWithMessage.False("Cannot Load: 'Path to Session' is invalid.")); } if (SessionPath.IsSessionRunning() == false || FirstLoadedMap == null) { FirstLoadedMap = map; } if (map.IsDefaultMap) { return(LoadDefaultMap(map)); } try { // delete session map file / custom maps from game DeleteMapFilesFromNYCFolder(); CopyMapFilesToNYCFolder(map); // update the ini file with the new map path string selectedMapPath = "/Game/Art/Env/NYC/" + map.MapName; SetGameDefaultMapSetting(selectedMapPath); return(BoolWithMessage.True($"{map.MapName} Loaded!")); } catch (Exception e) { Logger.Error(e); return(BoolWithMessage.False($"Failed to load {map.MapName}: {e.Message}")); } }