From ba031a645e535116b4896a720fa6cf2a737cc671 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 15:17:14 +0100 Subject: [PATCH] update byfron dialog player location --- Bloxstrap/Bootstrapper.cs | 1 + .../UI/Elements/Bootstrapper/ByfronDialog.xaml.cs | 2 +- .../ViewModels/Bootstrapper/ByfronDialogViewModel.cs | 10 ++++++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index d489696..8af91f9 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -59,6 +59,7 @@ namespace Bloxstrap private IReadOnlyDictionary _packageDirectories => _studioLaunch ? PackageMap.Studio : PackageMap.Player; public IBootstrapperDialog? Dialog = null; + public bool IsStudioLaunch => _studioLaunch; #endregion #region Core diff --git a/Bloxstrap/UI/Elements/Bootstrapper/ByfronDialog.xaml.cs b/Bloxstrap/UI/Elements/Bootstrapper/ByfronDialog.xaml.cs index b01d083..e90245a 100644 --- a/Bloxstrap/UI/Elements/Bootstrapper/ByfronDialog.xaml.cs +++ b/Bloxstrap/UI/Elements/Bootstrapper/ByfronDialog.xaml.cs @@ -69,7 +69,7 @@ namespace Bloxstrap.UI.Elements.Bootstrapper public ByfronDialog() { - _viewModel = new ByfronDialogViewModel(this); + _viewModel = new ByfronDialogViewModel(this, Bootstrapper?.IsStudioLaunch ?? false); DataContext = _viewModel; Title = App.Settings.Prop.BootstrapperTitle; Icon = App.Settings.Prop.BootstrapperIcon.GetIcon().GetImageSource(); diff --git a/Bloxstrap/UI/ViewModels/Bootstrapper/ByfronDialogViewModel.cs b/Bloxstrap/UI/ViewModels/Bootstrapper/ByfronDialogViewModel.cs index ed04c64..46d1e0b 100644 --- a/Bloxstrap/UI/ViewModels/Bootstrapper/ByfronDialogViewModel.cs +++ b/Bloxstrap/UI/ViewModels/Bootstrapper/ByfronDialogViewModel.cs @@ -6,6 +6,8 @@ namespace Bloxstrap.UI.ViewModels.Bootstrapper { public class ByfronDialogViewModel : BootstrapperDialogViewModel { + private bool _studioLaunch; + // Using dark theme for default values. public ImageSource ByfronLogoLocation { get; set; } = new BitmapImage(new Uri("pack://application:,,,/Resources/BootstrapperStyles/ByfronDialog/ByfronLogoDark.jpg")); public Thickness DialogBorder { get; set; } = new Thickness(0); @@ -20,7 +22,10 @@ namespace Bloxstrap.UI.ViewModels.Bootstrapper { get { - string playerLocation = Path.Combine(Paths.Versions, App.State.Prop.PlayerVersionGuid, "RobloxPlayerBeta.exe"); + string versionGuid = _studioLaunch ? App.State.Prop.StudioVersionGuid : App.State.Prop.PlayerVersionGuid; + string fileName = _studioLaunch ? "RobloxStudioBeta.exe" : "RobloxPlayerBeta.exe"; + + string playerLocation = Path.Combine(Paths.Versions, versionGuid, fileName); if (!File.Exists(playerLocation)) return ""; @@ -34,8 +39,9 @@ namespace Bloxstrap.UI.ViewModels.Bootstrapper } } - public ByfronDialogViewModel(IBootstrapperDialog dialog) : base(dialog) + public ByfronDialogViewModel(IBootstrapperDialog dialog, bool isStudioLaunch) : base(dialog) { + _studioLaunch = isStudioLaunch; } } }