Skip to content

Commit 116a2d4

Browse files
committed
Beta notices
1 parent 180770f commit 116a2d4

File tree

3 files changed

+70
-4
lines changed

3 files changed

+70
-4
lines changed

Amethyst/MainWindow.axaml.cs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,44 @@ private void MainGrid_Loaded(object sender, RoutedEventArgs e)
10781078
// Register a theme watchdog
10791079
NavView.ActualThemeVariantChanged += MainWindow_ActualThemeChanged;
10801080

1081+
// Show the testing notice
1082+
if (!_mainPageLoadedOnce && !Debugger.IsAttached)
1083+
new ContentDialog()
1084+
{
1085+
DefaultButton = ContentDialogButton.Close,
1086+
IsPrimaryButtonEnabled = false,
1087+
IsSecondaryButtonEnabled = false,
1088+
CloseButtonText = "Ok",
1089+
Content = new Grid()
1090+
{
1091+
MaxHeight = 550,
1092+
Margin = new Thickness(0, -40, 0, 0),
1093+
VerticalAlignment = VerticalAlignment.Stretch,
1094+
RowDefinitions = { new RowDefinition(GridLength.Auto), new RowDefinition(GridLength.Star), },
1095+
Children =
1096+
{
1097+
new TextBlock() { Text = "Amethyst 2.0 Technical Preview", FontSize = 30, Margin = new Thickness(0, 0, 0, 20) }.InGrid(0),
1098+
new TextBlock()
1099+
{
1100+
FontSize = 16,
1101+
MaxHeight = 450,
1102+
TextWrapping = TextWrapping.Wrap,
1103+
Text = "This is a testing build of Amethyst 2.0, currently being dragged through the Avalonia porting process.\n\n" +
1104+
"Things will break. Some of them already have. That’s normal.\n\n" +
1105+
"If (when) you find something that doesn't work:\n" +
1106+
"• Report it directly to the me (公彦赤屋先/akaya) or\n" +
1107+
"• Post it on the Discord server, preferably pinging a team member\n\n" +
1108+
"Please:\n" +
1109+
"• Check and toggle everything you can\n" +
1110+
"• Test edge cases and invalid data inputs\n" +
1111+
"• Try to break stuff, if you feel like it\n\n" +
1112+
"By continuing, you acknowledge that this is an unstable test build. Please confirm, and report any issues you encounter.\n\n" +
1113+
"Thank you for helping shape the new Amethyst! 💜",
1114+
}.InGrid(1)
1115+
}
1116+
}
1117+
}.ShowAsync();
1118+
10811119
// Mark as loaded
10821120
_mainPageLoadedOnce = true;
10831121
}

Amethyst/Utils/TypeUtils.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,10 @@ public static Uri ToUri(this string source)
644644

645645
public static async Task Launch(this string uri)
646646
{
647-
return; // TODO
647+
Logger.Warn("TODO Tried to start the app with URI: " + uri);
648648

649+
return; //TODO
650+
649651
try
650652
{
651653
// If we've found who asked
@@ -796,3 +798,13 @@ public bool Match(object data)
796798
return Templates.ContainsKey(data?.GetType() ?? typeof(object));
797799
}
798800
}
801+
802+
public static class GridExtensions
803+
{
804+
public static T InGrid<T>(this T control, int row, int column = 0) where T : Control
805+
{
806+
Grid.SetRow(control, row);
807+
Grid.SetColumn(control, column);
808+
return control;
809+
}
810+
}

Amethyst/ViewModels/Main.cs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
using System.Diagnostics;
12
using Amethyst.Classes;
23
using Amethyst.Contract;
34
using Amethyst.Schedulers;
45
using Amethyst.Utils;
6+
using Avalonia.Controls;
57
using CommunityToolkit.Mvvm.ComponentModel;
68
using CommunityToolkit.Mvvm.Input;
79
using FluentAvalonia.UI.Controls;
@@ -245,12 +247,25 @@ public MainViewModel()
245247
{
246248
NoticeType.Testing, new NoticeViewModel()
247249
{
248-
IsOpen = true,
250+
IsOpen = !Debugger.IsAttached,
249251
Closable = false,
250252
Severity = InfoBarSeverity.Error,
251253
IconSource = new SymbolIconSource() { Symbol = Symbol.Warning },
252254
Title = "This is a technical preview version of Amethyst.",
253-
Message = $"Please report any bugs or inconsistencies you encounter." +
255+
Message = "Please report any bugs or inconsistencies you encounter." +
256+
(AppData.VersionString.Internal.StartsWith("AZ") ? string.Empty : $" ID: {AppData.VersionString.Internal}"),
257+
ActionContent = "Discord",
258+
Action = () => TopLevel.GetTopLevel(Shared.Main.Window)?.Launcher.LaunchUriAsync("https://discord.gg/YBQCRDG".ToUri())
259+
}
260+
},
261+
{
262+
NoticeType.Debug, new NoticeViewModel()
263+
{
264+
IsOpen = Debugger.IsAttached,
265+
Closable = false,
266+
Severity = InfoBarSeverity.Warning,
267+
Title = "Debugger attached.",
268+
Message = "To evaluate application commands, double tap the large icon on the Info page." +
254269
(AppData.VersionString.Internal.StartsWith("AZ") ? string.Empty : $" ID: {AppData.VersionString.Internal}")
255270
}
256271
},
@@ -405,5 +420,6 @@ public enum NoticeType
405420
Playback,
406421
Plugin,
407422
RelayActive,
408-
Testing
423+
Testing,
424+
Debug
409425
}

0 commit comments

Comments
 (0)