mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
add process priority (sync)
This commit is contained in:
parent
7e95fb4d8f
commit
187b3d9b8f
@ -374,6 +374,27 @@ namespace Bloxstrap
|
||||
}
|
||||
}
|
||||
|
||||
Process[] processes = Process.GetProcessesByName("RobloxPlayerBeta");
|
||||
#if STUDIO_FEATURES
|
||||
if (_launchMode == LaunchMode.Studio)
|
||||
processes = Process.GetProcessesByName("RobloxStudioBeta");
|
||||
#endif
|
||||
|
||||
ProcessPriorityClass[] PriorityThing = {
|
||||
ProcessPriorityClass.Idle,
|
||||
ProcessPriorityClass.BelowNormal,
|
||||
ProcessPriorityClass.Normal,
|
||||
ProcessPriorityClass.AboveNormal,
|
||||
ProcessPriorityClass.High
|
||||
};
|
||||
|
||||
foreach (Process proc in processes)
|
||||
{
|
||||
proc.PriorityClass = PriorityThing[(int)App.Settings.Prop.ChoosePriorityClass];
|
||||
|
||||
App.Logger.WriteLine(LOG_IDENT, $"Launching with priority '{proc.PriorityClass}'");
|
||||
}
|
||||
|
||||
// event fired, wait for 3 seconds then close
|
||||
await Task.Delay(3000);
|
||||
Dialog?.CloseBootstrapper();
|
||||
|
11
Bloxstrap/Enums/PriorityClass.cs
Normal file
11
Bloxstrap/Enums/PriorityClass.cs
Normal file
@ -0,0 +1,11 @@
|
||||
namespace Bloxstrap.Enums
|
||||
{
|
||||
public enum PriorityClasses
|
||||
{
|
||||
Idle,
|
||||
BelowNormal,
|
||||
Normal,
|
||||
AboveNormal,
|
||||
High
|
||||
}
|
||||
}
|
@ -10,6 +10,7 @@ namespace Bloxstrap.Models
|
||||
public string BootstrapperTitle { get; set; } = App.ProjectName;
|
||||
public string BootstrapperIconCustomLocation { get; set; } = "";
|
||||
public Theme Theme { get; set; } = Theme.Default;
|
||||
public PriorityClasses ChoosePriorityClass { get; set; } = PriorityClasses.Normal;
|
||||
public bool CheckForUpdates { get; set; } = true;
|
||||
public bool CreateDesktopIcon { get; set; } = true;
|
||||
public bool ConfirmLaunches { get; set; } = false;
|
||||
|
72
Bloxstrap/Resources/Strings.Designer.cs
generated
72
Bloxstrap/Resources/Strings.Designer.cs
generated
@ -2963,5 +2963,77 @@ namespace Bloxstrap.Resources {
|
||||
return ResourceManager.GetString("Uninstaller.Uninstall", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Change the priority class Roblox uses..
|
||||
/// </summary>
|
||||
public static string Menu_Behaviour_ChangePriorityClass_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Menu.Behaviour.ChangePriorityClass.Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Set priority.
|
||||
/// </summary>
|
||||
public static string Menu_Behaviour_ChangePriorityClass_Title {
|
||||
get {
|
||||
return ResourceManager.GetString("Menu.Behaviour.ChangePriorityClass.Title", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Low.
|
||||
/// </summary>
|
||||
public static string Enums_PriorityClasses_Idle {
|
||||
get {
|
||||
return ResourceManager.GetString("Enums.PriorityClasses.Idle", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Below normal.
|
||||
/// </summary>
|
||||
public static string Enums_PriorityClasses_BelowNormal {
|
||||
get {
|
||||
return ResourceManager.GetString("Enums.PriorityClasses.BelowNormal", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Normal.
|
||||
/// </summary>
|
||||
public static string Enums_PriorityClasses_Normal {
|
||||
get {
|
||||
return ResourceManager.GetString("Enums.PriorityClasses.Normal", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Above normal.
|
||||
/// </summary>
|
||||
public static string Enums_PriorityClasses_AboveNormal {
|
||||
get {
|
||||
return ResourceManager.GetString("Enums.PriorityClasses.AboveNormal", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to High.
|
||||
/// </summary>
|
||||
public static string Enums_PriorityClasses_High {
|
||||
get {
|
||||
return ResourceManager.GetString("Enums.PriorityClasses.High", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Realtime.
|
||||
/// </summary>
|
||||
public static string Enums_PriorityClasses_RealTime {
|
||||
get {
|
||||
return ResourceManager.GetString("Enums.PriorityClasses.RealTime", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1120,4 +1120,28 @@ If not, then please report this exception to the maintainers of this fork. Do NO
|
||||
<data name="Menu.Shortcuts.Function.Description" xml:space="preserve">
|
||||
<value>Create shortcuts for quick access to specific functions. These will all be placed on the Desktop.</value>
|
||||
</data>
|
||||
<data name="Menu.Behaviour.ChangePriorityClass.Title" xml:space="preserve">
|
||||
<value>Set priority</value>
|
||||
</data>
|
||||
<data name="Menu.Behaviour.ChangePriorityClass.Description" xml:space="preserve">
|
||||
<value>Change the priority class Roblox uses.</value>
|
||||
</data>
|
||||
<data name="Enums.PriorityClasses.Idle" xml:space="preserve">
|
||||
<value>Low</value>
|
||||
</data>
|
||||
<data name="Enums.PriorityClasses.BelowNormal" xml:space="preserve">
|
||||
<value>Below normal</value>
|
||||
</data>
|
||||
<data name="Enums.PriorityClasses.Normal" xml:space="preserve">
|
||||
<value>Normal</value>
|
||||
</data>
|
||||
<data name="Enums.PriorityClasses.AboveNormal" xml:space="preserve">
|
||||
<value>Above normal</value>
|
||||
</data>
|
||||
<data name="Enums.PriorityClasses.High" xml:space="preserve">
|
||||
<value>High</value>
|
||||
</data>
|
||||
<data name="Enums.PriorityClasses.RealTime" xml:space="preserve">
|
||||
<value>Realtime</value>
|
||||
</data>
|
||||
</root>
|
@ -17,6 +17,18 @@
|
||||
<StackPanel Margin="0,0,14,14">
|
||||
<TextBlock Margin="0,0,0,8" Text="{x:Static resources:Strings.Menu_Behaviour_Description}" FontSize="14" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
|
||||
|
||||
<controls:OptionControl
|
||||
Header="{x:Static resources:Strings.Menu_Behaviour_ChangePriorityClass_Title}"
|
||||
Description="{x:Static resources:Strings.Menu_Behaviour_ChangePriorityClass_Description}">
|
||||
<ComboBox Width="200" Padding="10,5,10,5" ItemsSource="{Binding PriorityClassesList, Mode=OneTime}" Text="{Binding ChoosePriorityClass, Mode=TwoWay}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=., Converter={StaticResource EnumNameConverter}}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</controls:OptionControl>
|
||||
|
||||
<controls:OptionControl
|
||||
Header="{x:Static resources:Strings.Menu_Behaviour_CreateDesktopIcon_Title}"
|
||||
Description="{x:Static resources:Strings.Menu_Behaviour_CreateDesktopIcon_Description}">
|
||||
|
@ -5,6 +5,14 @@
|
||||
private string _oldPlayerVersionGuid = "";
|
||||
private string _oldStudioVersionGuid = "";
|
||||
|
||||
public IEnumerable<PriorityClasses> PriorityClassesList { get; } = Enum.GetValues(typeof(PriorityClasses)).Cast<PriorityClasses>();
|
||||
|
||||
public PriorityClasses ChoosePriorityClass
|
||||
{
|
||||
get => App.Settings.Prop.ChoosePriorityClass;
|
||||
set => App.Settings.Prop.ChoosePriorityClass = value;
|
||||
}
|
||||
|
||||
public bool CreateDesktopIcon
|
||||
{
|
||||
get => App.Settings.Prop.CreateDesktopIcon;
|
||||
|
Loading…
Reference in New Issue
Block a user