diff --git a/Launcher-Core/Utils.cs b/Launcher-Core/Utils.cs index 8308af8..13db5d3 100644 --- a/Launcher-Core/Utils.cs +++ b/Launcher-Core/Utils.cs @@ -1,5 +1,4 @@ -using System; -using System.IO; + using CmlLib.Core; using CmlLib.Core.Auth; using XboxAuthNet.Game.Msal; @@ -43,6 +42,7 @@ static public class Utils Console.WriteLine(deviceCode.Message); return Task.CompletedTask; })); + authenticator.AddMsalOAuth(app, msal => msal.Silent()); authenticator.AddXboxAuthForJE(xbox => xbox.Basic()); authenticator.AddJEAuthenticator(); return await authenticator.ExecuteForLauncherAsync(); diff --git a/Launcher-UI/LauncherUtils.cs b/Launcher-UI/LauncherUtils.cs index dc0dd1f..0fb7874 100644 --- a/Launcher-UI/LauncherUtils.cs +++ b/Launcher-UI/LauncherUtils.cs @@ -24,4 +24,9 @@ public class LauncherUtils await loading.RunMinecraft(); return; } + + private static async Task CreateLicensedMinecraftInstance() + { + + } } diff --git a/Launcher-UI/ViewModels/MainWindowViewModel.cs b/Launcher-UI/ViewModels/MainWindowViewModel.cs index f334bfd..bcde692 100644 --- a/Launcher-UI/ViewModels/MainWindowViewModel.cs +++ b/Launcher-UI/ViewModels/MainWindowViewModel.cs @@ -15,4 +15,21 @@ public partial class MainWindowViewModel : ViewModelBase private string? _runtimeLocation = ConfigManager.ReadConfig("runtime-path"); public string? RuntimeLocation { get => _runtimeLocation; set { _runtimeLocation = value; OnPropertyChanged(nameof(RuntimeLocation)); } } + + // Session information + private string? _loginMethod = ConfigManager.ReadConfig("login-method"); + public string? LoginMethod { get => _loginMethod; set { _loginMethod = value; OnPropertyChanged(nameof(LoginMethod)); } } + + private string? _accsessToken = ConfigManager.ReadConfig("accsess-token"); + public string? AccsesToken { get => _accsessToken; set { _accsessToken = value; OnPropertyChanged(nameof(AccsesToken)); } } + + private string? _clientToken = ConfigManager.ReadConfig("client-token"); + public string? ClientToken { get => _clientToken; set { _clientToken = value; OnPropertyChanged(nameof(ClientToken)); } } + + private string? _uuid = ConfigManager.ReadConfig("uuid"); + public string? UUID { get => _uuid; set { _uuid = value; OnPropertyChanged(nameof(UUID)); } } + + // Tweaks managment + private string? _tweaksVersion = ConfigManager.ReadConfig("tweaks-version"); + public string? TweaksVersion { get => _tweaksVersion; set { _tweaksVersion = value; OnPropertyChanged(nameof(TweaksVersion)); } } } diff --git a/Launcher-UI/Views/MainWindow.axaml.cs b/Launcher-UI/Views/MainWindow.axaml.cs index 32195e6..5b28613 100644 --- a/Launcher-UI/Views/MainWindow.axaml.cs +++ b/Launcher-UI/Views/MainWindow.axaml.cs @@ -85,7 +85,12 @@ public partial class MainWindow : Window private void OnAccountSettingsPressed(object sender, RoutedEventArgs e) { - //todo: account managment window + if (sender is not Image img) return; + + if (img.GetVisualRoot() is not MainWindow root) return; + + SessionManagmentWindow sessionManager = new(DataContext as MainWindowViewModel); + sessionManager.Show(root); } } diff --git a/Launcher-UI/Views/SessionManagmentWindow.axaml b/Launcher-UI/Views/SessionManagmentWindow.axaml new file mode 100644 index 0000000..6682519 --- /dev/null +++ b/Launcher-UI/Views/SessionManagmentWindow.axaml @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +