Browse Source

Updated Discord Rich Presence

CPKreuz 3 years ago
parent
commit
136a7edc42

+ 2 - 7
PixiEditor/ViewModels/SubViewModels/Main/DiscordViewModel.cs

@@ -31,7 +31,7 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
             }
         }
 
-        private bool showDocumentName = IPreferences.Current.GetPreference(nameof(ShowDocumentName), true);
+        private bool showDocumentName = IPreferences.Current.GetPreference(nameof(ShowDocumentName), false);
 
         public bool ShowDocumentName
         {
@@ -117,7 +117,7 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
             {
                 richPresence.WithTimestamps(new Timestamps(document.OpenedUTC));
 
-                richPresence.Details = ShowDocumentName ? $"Editing {document.Name}".Limit(128) : "Editing something (incognito)";
+                richPresence.Details = ShowDocumentName ? $"Editing {document.Name}".Limit(128) : "Editing an image";
 
                 string state = string.Empty;
 
@@ -154,11 +154,6 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
             {
                 Details = "Staring at absolutely",
                 State = "nothing",
-                Buttons = new Button[]
-                {
-                    new Button() { Label = "Download PixiEditor", Url = "https://www.github.com/PixiEditor/PixiEditor/releases/latest" },
-                    new Button() { Label = "Watch trailer", Url = "https://youtu.be/QKnXBUY0Pqk" }
-                },
 
                 Assets = new Assets
                 {

+ 2 - 2
PixiEditor/ViewModels/SubViewModels/UserPreferences/Settings/DiscordSettings.cs

@@ -14,7 +14,7 @@
             }
         }
 
-        private bool showDocumentName = GetPreference(nameof(ShowDocumentName), true);
+        private bool showDocumentName = GetPreference(nameof(ShowDocumentName), false);
 
         public bool ShowDocumentName
         {
@@ -57,7 +57,7 @@
         {
             get
             {
-                return ShowDocumentName ? $"Editing coolPixelArt.pixi" : "Editing something (incognito)";
+                return ShowDocumentName ? $"Editing coolPixelArt.pixi" : "Editing an image";
             }
         }
 

+ 31 - 36
PixiEditor/Views/UserControls/DiscordRPPreview.xaml

@@ -7,61 +7,56 @@
              mc:Ignorable="d" 
              d:DesignHeight="280" d:DesignWidth="300"
              x:Name="uc">
-    <UserControl.Resources>
-        <BoolToVisibilityConverter x:Key="BoolToVisibility"/>
-        <converters:BrushTuple FirstBrush="#7289da" SecondBrush="#202225" x:Key="BackgroundBrushTuple"/>
-        <converters:BrushTuple FirstBrush="White" SecondBrush="#7289da" x:Key="BotLabelTuple"/>
-        <converters:BrushTuple FirstBrush="#7289da" SecondBrush="White" x:Key="BotTextTuple"/>
-        <converters:BrushTuple FirstBrush="White" SecondBrush="#b9bbbe" x:Key="DiscriminatorTuple"/>
-    </UserControl.Resources>
     <Grid>
-        <Grid.OpacityMask>
-            <VisualBrush Visual="{Binding ElementName=OutsideBorder}"/>
-        </Grid.OpacityMask>
-        <Border CornerRadius="5" Background="{Binding ElementName=uc, Path=IsPlaying, Converter={converters:BoolToBrushConverter}, ConverterParameter={StaticResource BackgroundBrushTuple}}" x:Name="OutsideBorder"/>
-        <Grid x:Name="background">
-            <Grid.RowDefinitions>
+        <Border CornerRadius="5" Background="#18191C" x:Name="OutsideBorder">
+            <Grid>
+                <Grid.RowDefinitions>
                     <RowDefinition Height="Auto"/>
                     <RowDefinition Height="Auto"/>
                 </Grid.RowDefinitions>
 
-                <Grid VerticalAlignment="Center">
+                <Grid>
+                    <Border CornerRadius="5,5,0,0" Background="#e3042c" Height="60" VerticalAlignment="Top"/>
                     <StackPanel>
-                        <Grid  Width="80" Height="80" Margin="20">
-                            <Image Source="{Binding ElementName=uc, Path=UserSource}"/>
-                        <Border Height="30" Width="30" Background="#FF43B581" CornerRadius="90" BorderThickness="5" 
-                                BorderBrush="{Binding ElementName=uc, Path=IsPlaying, Converter={converters:BoolToBrushConverter}, ConverterParameter={StaticResource BackgroundBrushTuple}}">
-                                <Border.RenderTransform>
-                                    <TransformGroup>
-                                        <TranslateTransform X="27" Y="27"></TranslateTransform>
-                                    </TransformGroup>
-                                </Border.RenderTransform>
-                            </Border>
-                        </Grid>
+                        <Border HorizontalAlignment="Left" Width="85" Height="85" Margin="15" BorderThickness="6" BorderBrush="#18191C" CornerRadius="90">
+                            <Grid>
+                                <Image Source="{Binding ElementName=uc, Path=UserSource}"/>
+                                <Border Height="30" Width="30" Background="#FF43B581" CornerRadius="90" BorderThickness="6" 
+                                BorderBrush="#18191C">
+                                    <Border.RenderTransform>
+                                        <TransformGroup>
+                                            <TranslateTransform X="27" Y="27"></TranslateTransform>
+                                        </TransformGroup>
+                                    </Border.RenderTransform>
+                                </Border>
+                            </Grid>
+                        </Border>
 
-                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,15">
-                            <TextBlock Foreground="White" FontSize="16" FontWeight="SemiBold">PixiBot</TextBlock>
-                        <TextBlock Foreground="{Binding ElementName=uc, Path=IsPlaying, Converter={converters:BoolToBrushConverter}, ConverterParameter={StaticResource DiscriminatorTuple}}" FontSize="16">#8523</TextBlock>
-                        <Border CornerRadius="3" BorderThickness="1" Background="{Binding ElementName=uc, Path=IsPlaying, Converter={converters:BoolToBrushConverter}, ConverterParameter={StaticResource BotLabelTuple}}" Margin="5,0,0,0" VerticalAlignment="Center">
-                            <TextBlock Foreground="{Binding ElementName=uc, Path=IsPlaying, Converter={converters:BoolToBrushConverter}, ConverterParameter={StaticResource BotTextTuple}}" FontSize="12" Margin="4,2,4,2" FontWeight="Medium">BOT</TextBlock>
+                        <StackPanel Orientation="Horizontal" Margin="15,0">
+                            <TextBlock Foreground="White" FontSize="22" FontWeight="SemiBold">PixiBot</TextBlock>
+                            <TextBlock Foreground="#b9bbbe" FontSize="22" FontWeight="SemiBold">#8523</TextBlock>
+                            <Border CornerRadius="3" BorderThickness="1" Background="#5865f2" Margin="5,0,0,0" VerticalAlignment="Center">
+                                <TextBlock Foreground="White" FontSize="12" Margin="4,2,4,2" FontWeight="Medium">BOT</TextBlock>
                             </Border>
                         </StackPanel>
                     </StackPanel>
                 </Grid>
-                <Grid Grid.Row="1" Background="#0D000000" Visibility="{Binding ElementName=uc, Path=IsPlaying, Converter={StaticResource BoolToVisibility}}">
-                    <StackPanel Orientation="Vertical" Margin="15">
+                <Grid Grid.Row="1" Visibility="{Binding ElementName=uc, Path=IsPlaying, Converter={BoolToVisibilityConverter}}">
+                    <StackPanel Orientation="Vertical" Margin="15,0,15,15">
+                        <Grid Margin="0,15" Background="#262729" Height="1"/>
                         <TextBlock FontWeight="Bold" FontSize="12" Foreground="White" Margin="0,0,0,10">PLAYING A "GAME"</TextBlock>
                         <StackPanel Orientation="Horizontal">
                             <Image Source="../../Images/PixiEditorLogo.png" Height="70"/>
                             <StackPanel Margin="15,0,0,0" VerticalAlignment="Center">
                                 <TextBlock Foreground="White" FontSize="12" FontWeight="SemiBold">PixiEditor</TextBlock>
-                            <TextBlock Foreground="White" FontSize="12" Text="{Binding ElementName=uc, Path=Detail}" Visibility="{Binding ElementName=uc, Path=Detail, Converter={converters:EmptyStringToVisibilityConverter}}"/>
-                            <TextBlock Foreground="White" FontSize="12" Text="{Binding ElementName=uc, Path=State}" Visibility="{Binding ElementName=uc, Path=State, Converter={converters:EmptyStringToVisibilityConverter}}"/>
-                            <TextBlock Foreground="White" FontSize="12">00:00 elapsed</TextBlock>
+                                <TextBlock Foreground="White" FontSize="12" Text="{Binding ElementName=uc, Path=Detail}" Visibility="{Binding ElementName=uc, Path=Detail, Converter={converters:EmptyStringToVisibilityConverter}}"/>
+                                <TextBlock Foreground="White" FontSize="12" Text="{Binding ElementName=uc, Path=State}" Visibility="{Binding ElementName=uc, Path=State, Converter={converters:EmptyStringToVisibilityConverter}}"/>
+                                <TextBlock Foreground="White" FontSize="12">00:00 elapsed</TextBlock>
                             </StackPanel>
                         </StackPanel>
                     </StackPanel>
                 </Grid>
             </Grid>
-        </Grid>
+        </Border>
+    </Grid>
 </UserControl>