diff --git a/lib/main/framework/ui/basic_configuration_tab.dart b/lib/main/framework/ui/basic_configuration_tab.dart index 8ce10fd..692449e 100644 --- a/lib/main/framework/ui/basic_configuration_tab.dart +++ b/lib/main/framework/ui/basic_configuration_tab.dart @@ -50,6 +50,6 @@ class _BasicConfigurationTabState extends State { } void _downloadServerFile() { - context.read().add(VanillaServerFileDownloadedEvent()); + context.read().add(VanillaServerFileDownloadedEvent('.')); } } diff --git a/lib/vanilla/adapter/presentation/vanilla_bloc.dart b/lib/vanilla/adapter/presentation/vanilla_bloc.dart index 23cb010..845aabd 100644 --- a/lib/vanilla/adapter/presentation/vanilla_bloc.dart +++ b/lib/vanilla/adapter/presentation/vanilla_bloc.dart @@ -28,7 +28,7 @@ class VanillaBloc extends Bloc { emit(state.copyWith(selectedGameVersion: event.gameVersion)); }); - on((_, emit) async { + on((event, emit) async { final gameVersion = state.selectedGameVersion; if (gameVersion == null) { return; @@ -37,7 +37,7 @@ class VanillaBloc extends Bloc { emit(state.copyWith(isLocked: true)); await _downloadServerFileUseCase( gameVersion.toEntity(), - path.join('.', Constants.serverFileName), + path.join(event.savePath, Constants.serverFileName), onProgressChanged: (progress) => add(_VanillaDownloadProgressChangedEvent(progress)), ); emit(state.copyWith(isLocked: false)); @@ -65,7 +65,11 @@ class VanillaGameVersionSelectedEvent extends VanillaEvent { VanillaGameVersionSelectedEvent(this.gameVersion); } -class VanillaServerFileDownloadedEvent extends VanillaEvent {} +class VanillaServerFileDownloadedEvent extends VanillaEvent { + final String savePath; + + VanillaServerFileDownloadedEvent(this.savePath); +} class _VanillaDownloadProgressChangedEvent extends VanillaEvent { final double progress;