2
0
flabbet 1 жил өмнө
parent
commit
7e04fb6f6d

+ 13 - 1
src/PixiEditor.ClosedBeta/ClosedBetaExtension.cs

@@ -6,9 +6,21 @@ public class ClosedBetaExtension : PixiEditorExtension
 {
     public override void OnInitialized()
     {
+        if (Api.Preferences.GetPreference<bool>("ClosedBetaWelcomeShown"))
+        {
+            return;   
+        }
+        
         WelcomeMessage welcomeMessage = new();
         var window = Api.WindowProvider.CreatePopupWindow("Welcome to the closed beta!", welcomeMessage);
-        welcomeMessage.OnContinue += () => window.Close();
+        welcomeMessage.OnContinue += () =>
+        {
+            Api.Preferences.UpdatePreference("ClosedBetaWelcomeShown", true);
+            window.Close();
+        };
+
+        window.Width = 800;
+        window.Height = 600;
         
         window.CanResize = false;
         window.CanMinimize = false;

+ 14 - 7
src/PixiEditor.ClosedBeta/WelcomeMessageState.cs

@@ -34,21 +34,28 @@ I understand that:
                     new Center(new Text("Welcome to the closed beta of PixiEditor 2.0!", TextWrap.Wrap,
                         FontStyle.Normal,
                         fontSize: 24)),
-                    new Text(Body, TextWrap.Wrap, fontSize: 18),
-                    new CheckBox(new Text("The app is unstable and may crash and freeze"),
+                    new Text(Body, TextWrap.Wrap, fontSize: 16),
+                    new CheckBox(
+                        new Text("The app is unstable and may crash and freeze", fontSize: 16,
+                            fontStyle: FontStyle.Italic),
                         onCheckedChanged: (args) => CheckboxChanged(args.Sender as CheckBox, 0)),
-                    new CheckBox(new Text("I may encounter unfinished features and placeholders"),
+                    new CheckBox(
+                        new Text("I may encounter unfinished features and placeholders", fontSize: 16,
+                            fontStyle: FontStyle.Italic),
                         onCheckedChanged: (args) => CheckboxChanged(args.Sender as CheckBox, 1)),
-                    new CheckBox(new Text("I may lose my work due to bugs"),
+                    new CheckBox(new Text("I may lose my work due to bugs", fontSize: 16, fontStyle: FontStyle.Italic),
                         onCheckedChanged: (args) => CheckboxChanged(args.Sender as CheckBox, 2)),
-                    new CheckBox(new Text("I will have a lot of fun testing the app"),
+                    new CheckBox(
+                        new Text("I will have a lot of fun testing the app", fontSize: 16,
+                            fontStyle: FontStyle.Italic),
                         onCheckedChanged: (args) => CheckboxChanged(args.Sender as CheckBox, 3)),
                     new Container(
-                        width: 100,
+                        margin: new Edges(0, 5, 0, 0),
+                        width: AllCheckBoxesChecked() ? 100 : 200,
                         child:
                         AllCheckBoxesChecked()
                             ? new Button(new Text("Continue"), onClick: (args) => { OnContinue?.Invoke(); })
-                            : new Text("Select All Checkboxes to continue", fontSize: 12)
+                            : new Text("Select All Checkboxes to continue")
                     )
                 )
             )

+ 4 - 2
src/PixiEditor.Extensions/FlyUI/Converters/EnumToEnumConverter.cs

@@ -9,7 +9,8 @@ public class EnumToEnumConverter<T1, T2> : IValueConverter
     {
         if (value is T1 enumValue)
         {
-            return (T2)(object)enumValue;
+            int enumInt = (int)(object)enumValue;
+            return Enum.ToObject(typeof(T2), enumInt);
         }
 
         return null;
@@ -19,7 +20,8 @@ public class EnumToEnumConverter<T1, T2> : IValueConverter
     {
         if (value is T2 enumValue)
         {
-            return (T1)(object)enumValue;
+            int enumInt = (int)(object)enumValue;
+            return Enum.ToObject(typeof(T1), enumInt);
         }
 
         return null;