mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-06-23 23:00:23 -07:00
Compare commits
3 Commits
338ebba191
...
49fd8eb2d2
Author | SHA1 | Date | |
---|---|---|---|
|
49fd8eb2d2 | ||
|
d0f1b9de22 | ||
|
f0eb2eb745 |
@ -9,7 +9,7 @@ namespace Bloxstrap
|
||||
/// Should this version automatically open the release notes page?
|
||||
/// Recommended for major updates only.
|
||||
/// </summary>
|
||||
private const bool OpenReleaseNotes = false;
|
||||
private const bool OpenReleaseNotes = true;
|
||||
|
||||
private static string DesktopShortcut => Path.Combine(Paths.Desktop, $"{App.ProjectName}.lnk");
|
||||
|
||||
|
@ -194,11 +194,47 @@ namespace Bloxstrap.UI.ViewModels.Settings
|
||||
|
||||
private void RenameCustomTheme()
|
||||
{
|
||||
if (SelectedCustomTheme is null)
|
||||
const string LOG_IDENT = "AppearanceViewModel::RenameCustomTheme";
|
||||
|
||||
if (SelectedCustomTheme is null || SelectedCustomTheme == SelectedCustomThemeName)
|
||||
return;
|
||||
|
||||
if (SelectedCustomTheme == SelectedCustomThemeName)
|
||||
if (string.IsNullOrEmpty(SelectedCustomThemeName))
|
||||
{
|
||||
Frontend.ShowMessageBox(Strings.CustomTheme_Add_Errors_NameEmpty, MessageBoxImage.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
var validationResult = PathValidator.IsFileNameValid(SelectedCustomThemeName);
|
||||
|
||||
if (validationResult != PathValidator.ValidationResult.Ok)
|
||||
{
|
||||
switch (validationResult)
|
||||
{
|
||||
case PathValidator.ValidationResult.IllegalCharacter:
|
||||
Frontend.ShowMessageBox(Strings.CustomTheme_Add_Errors_NameIllegalCharacters, MessageBoxImage.Error);
|
||||
break;
|
||||
case PathValidator.ValidationResult.ReservedFileName:
|
||||
Frontend.ShowMessageBox(Strings.CustomTheme_Add_Errors_NameReserved, MessageBoxImage.Error);
|
||||
break;
|
||||
default:
|
||||
App.Logger.WriteLine(LOG_IDENT, $"Got unhandled PathValidator::ValidationResult {validationResult}");
|
||||
Debug.Assert(false);
|
||||
|
||||
Frontend.ShowMessageBox(Strings.CustomTheme_Add_Errors_Unknown, MessageBoxImage.Error);
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// better to check for the file instead of the directory so broken themes can be overwritten
|
||||
string path = Path.Combine(Paths.CustomThemes, SelectedCustomThemeName, "Theme.xml");
|
||||
if (File.Exists(path))
|
||||
{
|
||||
Frontend.ShowMessageBox(Strings.CustomTheme_Add_Errors_NameTaken, MessageBoxImage.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
@ -206,7 +242,7 @@ namespace Bloxstrap.UI.ViewModels.Settings
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
App.Logger.WriteException("AppearanceViewModel::RenameCustomTheme", ex);
|
||||
App.Logger.WriteException(LOG_IDENT, ex);
|
||||
Frontend.ShowMessageBox(string.Format(Strings.Menu_Appearance_CustomThemes_RenameFailed, SelectedCustomTheme, ex.Message), MessageBoxImage.Error);
|
||||
return;
|
||||
}
|
||||
|
@ -28,21 +28,21 @@ namespace Bloxstrap
|
||||
|
||||
string? watcherDataArg = App.LaunchSettings.WatcherFlag.Data;
|
||||
|
||||
#if DEBUG
|
||||
if (String.IsNullOrEmpty(watcherDataArg))
|
||||
{
|
||||
#if DEBUG
|
||||
string path = new RobloxPlayerData().ExecutablePath;
|
||||
using var gameClientProcess = Process.Start(path);
|
||||
|
||||
_watcherData = new() { ProcessId = gameClientProcess.Id };
|
||||
}
|
||||
#else
|
||||
if (String.IsNullOrEmpty(watcherDataArg))
|
||||
throw new Exception("Watcher data not specified");
|
||||
#endif
|
||||
|
||||
if (!String.IsNullOrEmpty(watcherDataArg))
|
||||
}
|
||||
else
|
||||
{
|
||||
_watcherData = JsonSerializer.Deserialize<WatcherData>(Encoding.UTF8.GetString(Convert.FromBase64String(watcherDataArg)));
|
||||
}
|
||||
|
||||
if (_watcherData is null)
|
||||
throw new Exception("Watcher data is invalid");
|
||||
|
Loading…
Reference in New Issue
Block a user