mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-23 02:51:26 -07:00
this was done to: - ensure robloxplayerbeta launches as an orphaned process - help alleviate problems with multiple instances - alleviate problems with the notifyicon causing blocking conflicts on the bootstrapper ui thread - help reduce functional dependency on the bootstrapper, makes it less monolithic and more maintainable ive always wanted to do this for a long while, but have always put it off because of how painful it would be this may genuinely be the most painful refactoring i've ever had to do, but after 2 days, i managed to do it, and it works great!
28 lines
983 B
C#
28 lines
983 B
C#
using System.Windows.Input;
|
|
using CommunityToolkit.Mvvm.Input;
|
|
|
|
using Bloxstrap.UI.Elements.About;
|
|
|
|
namespace Bloxstrap.UI.ViewModels.Installer
|
|
{
|
|
// TODO: have it so it shows "Launch Roblox"/"Install and Launch Roblox" depending on state of /App/ folder
|
|
public class LaunchMenuViewModel
|
|
{
|
|
public string Version => string.Format(Strings.Menu_About_Version, App.Version);
|
|
|
|
public ICommand LaunchSettingsCommand => new RelayCommand(LaunchSettings);
|
|
|
|
public ICommand LaunchRobloxCommand => new RelayCommand(LaunchRoblox);
|
|
|
|
public ICommand LaunchAboutCommand => new RelayCommand(LaunchAbout);
|
|
|
|
public event EventHandler<NextAction>? CloseWindowRequest;
|
|
|
|
private void LaunchSettings() => CloseWindowRequest?.Invoke(this, NextAction.LaunchSettings);
|
|
|
|
private void LaunchRoblox() => CloseWindowRequest?.Invoke(this, NextAction.LaunchRoblox);
|
|
|
|
private void LaunchAbout() => new MainWindow().ShowDialog();
|
|
}
|
|
}
|