mirror of
https://gitlab.com/nullmax17/PlombirLauncher.git
synced 2025-03-15 02:11:11 +03:00
23 lines
784 B
C#
23 lines
784 B
C#
|
using System.Threading.Tasks;
|
||
|
using Avalonia.Controls;
|
||
|
using LauncherGUI.ViewModels;
|
||
|
using LauncherGUI.Views;
|
||
|
|
||
|
namespace PlombirLauncher;
|
||
|
|
||
|
public class LauncherUtils
|
||
|
{
|
||
|
public async static Task CreateMinecraftInstance(MainWindowViewModel vm, Window windowCaller)
|
||
|
{
|
||
|
System.Console.WriteLine($"Creating minecraft instance for {vm.Usernick}, {vm.SelectedVersion} in {vm.RuntimeLocation}");
|
||
|
LoadingWindow loading = new(vm.Usernick, vm.SelectedVersion, vm.RuntimeLocation);
|
||
|
ConfigManager.WriteInConfig("last-version-launched", vm.SelectedVersion);
|
||
|
ConfigManager.WriteInConfig("nickname", vm.Usernick);
|
||
|
|
||
|
loading.Show();
|
||
|
await loading.InitLoading();
|
||
|
loading.Close();
|
||
|
await loading.RunMinecraft();
|
||
|
return;
|
||
|
}
|
||
|
}
|