Skip to content

Commit

Permalink
Implement AutoMuteUs CDN, fix centering issue
Browse files Browse the repository at this point in the history
  • Loading branch information
CarbonNeuron committed Jan 27, 2021
1 parent 55e6458 commit 3bbf965
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
16 changes: 8 additions & 8 deletions AUCapture-WPF/Controls/PlayerControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,32 @@
<Image Margin="0 0 0 0" Width="148" Height="198" Stretch="Uniform" VerticalAlignment="Bottom">
<Image.Source>
<MultiBinding Converter="{StaticResource PlayerToImage}">
<Binding IsAsync="True" ElementName="PlayerControlWindow" Path="Color"></Binding>
<Binding IsAsync="True" ElementName="PlayerControlWindow" Path="AliveStatus"></Binding>
<Binding ElementName="PlayerControlWindow" Path="Color"></Binding>
<Binding ElementName="PlayerControlWindow" Path="AliveStatus"></Binding>
</MultiBinding>
</Image.Source>
</Image>
<Image Margin="0 0 0 0" Width="148" Height="198" Stretch="Uniform" VerticalAlignment="Bottom">
<Image.Source>
<MultiBinding Converter="{StaticResource PantsConverter}">
<Binding IsAsync="True" ElementName="PlayerControlWindow" Path="PlayerPantsID"></Binding>
<Binding IsAsync="True" ElementName="PlayerControlWindow" Path="AliveStatus"></Binding>
<Binding ElementName="PlayerControlWindow" Path="PlayerPantsID" Delay="100"></Binding>
<Binding ElementName="PlayerControlWindow" Path="AliveStatus" Delay="100"></Binding>
</MultiBinding>
</Image.Source>
</Image>
<Image Margin="0,0,0,0" Stretch="Uniform" VerticalAlignment="Bottom" Width="212" Panel.ZIndex="{Binding ElementName=PlayerControlWindow, Path=PlayerHatID, Converter={StaticResource HatToZ}}">
<Image.Source>
<MultiBinding Converter="{StaticResource HatToImage}">
<Binding IsAsync="True" ElementName="PlayerControlWindow" Path="PlayerHatID"></Binding>
<Binding IsAsync="True" ElementName="PlayerControlWindow" Path="AliveStatus"></Binding>
<Binding ElementName="PlayerControlWindow" Path="PlayerHatID" Delay="100"></Binding>
<Binding ElementName="PlayerControlWindow" Path="AliveStatus" Delay="100"></Binding>
</MultiBinding>
</Image.Source>
</Image>
<Image Margin="0,0,0,0" Stretch="Uniform" VerticalAlignment="Bottom" Width="212" Panel.ZIndex="0">
<Image.Source>
<MultiBinding Converter="{StaticResource PetToIm}">
<Binding IsAsync="True" ElementName="PlayerControlWindow" Path="PlayerPetID"></Binding>
<Binding IsAsync="True" ElementName="PlayerControlWindow" Path="AliveStatus"></Binding>
<Binding ElementName="PlayerControlWindow" Path="PlayerPetID" Delay="100"></Binding>
<Binding ElementName="PlayerControlWindow" Path="AliveStatus" Delay="100"></Binding>
</MultiBinding>
</Image.Source>
</Image>
Expand Down
5 changes: 3 additions & 2 deletions AUCapture-WPF/Converters/HatToImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.Cache;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
Expand Down Expand Up @@ -126,9 +127,9 @@ public object Convert(object[] values, Type targetType, object parameter, Cultur
return new BitmapImage();
}
var finalName = hatID + "-" + Hats[hatID.ToString()];
return new BitmapImage(new Uri($"https://automuteus.nyc3.cdn.digitaloceanspaces.com/Hats/{finalName}.png"));
return new BitmapImage(new Uri($"https://cdn.automute.us/Hats/{finalName}.png"));



}

public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
Expand Down
3 changes: 2 additions & 1 deletion AUCapture-WPF/Converters/PantsConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net.Cache;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
Expand All @@ -20,7 +21,7 @@ public object Convert(object[] values, Type targetType, object parameter, Cultur
var alive = values[1] as bool? ?? false;
return !alive
? new BitmapImage()
: new BitmapImage(new Uri($"https://automuteus.nyc3.cdn.digitaloceanspaces.com/Pants/{pantID}.png"));
: new BitmapImage(new Uri($"https://cdn.automute.us/Pants/{pantID}.png"));
}

return new BitmapImage();
Expand Down
5 changes: 4 additions & 1 deletion AUCapture-WPF/Converters/PetToImageConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net.Cache;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Media.Imaging;

namespace AUCapture_WPF.Converters
Expand All @@ -20,10 +22,11 @@ public object Convert(object[] values, Type targetType, object parameter, Cultur
return new BitmapImage();
}

return new BitmapImage(new Uri($"https://automuteus.nyc3.cdn.digitaloceanspaces.com/Pets/{petID}.png"));
return new BitmapImage(new Uri($"https://cdn.automute.us/Pets/{petID}.png"));

}


public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
Expand Down
6 changes: 3 additions & 3 deletions AUCapture-WPF/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -291,19 +291,19 @@
</TextBlock>
<hc:LoadingCircle Margin="15" IsEnabled="{Binding Connected, Converter={StaticResource BoolInverter}}" Foreground="{DynamicResource MahApps.Brushes.Accent}" Style="{StaticResource LoadingCircleLarge}" Visibility="{Binding Connected, Converter={StaticResource BoolToVisibilityConverterInverted}}" IsRunning="{Binding Connected, Converter={StaticResource BoolInverter}}"/>

<Button Padding="13" Margin="30" HorizontalAlignment="Center"
<Button Padding="14" Margin="30" HorizontalAlignment="Center" VerticalContentAlignment="Center"
Visibility="{Binding Connected, Converter={StaticResource BoolToVisibilityConverterInverted}}"
Command="{Binding OpenAmongUsCMD, Mode=OneWay}">
<Button.Content>
<StackPanel Orientation="Horizontal">
<Path Width="22" Height="22" Fill="{DynamicResource MahApps.Brushes.Text}" StrokeThickness="1">
<Path VerticalAlignment="Center" Width="22" Height="22" Fill="{DynamicResource MahApps.Brushes.Text}" StrokeThickness="1">
<Path.Data>
<PathGeometry>
M22.60107,2.062a1.00088,1.00088,0,0,0-.71289-.71289A11.25224,11.25224,0,0,0,10.46924,4.97217L9.35431,6.296l-2.6048-.62848A2.77733,2.77733,0,0,0,3.36279,7.0249L1.1626,10.9248A.99989.99989,0,0,0,1.82422,12.394l3.07275.65869a13.41952,13.41952,0,0,0-.55517,2.43409,1.00031,1.00031,0,0,0,.28466.83642l3.1001,3.1001a.99941.99941,0,0,0,.707.293c.02881,0,.05762-.00147.08692-.00391a12.16892,12.16892,0,0,0,2.49157-.49l.64368,3.00318a1.0003,1.0003,0,0,0,1.46924.66162l3.90527-2.20264a3.03526,3.03526,0,0,0,1.375-3.30371l-.6687-2.759,1.23706-1.13751A11.20387,11.20387,0,0,0,22.60107,2.062ZM3.57227,10.72314,5.12842,7.96338a.82552.82552,0,0,1,1.06982-.37549l1.71741.4162-.65.77179A13.09523,13.09523,0,0,0,5.67633,11.174Zm12.47021,8.22217L13.32666,20.477l-.4295-2.00464a11.33992,11.33992,0,0,0,2.41339-1.61987l.74353-.68366.40344,1.66462A1.041,1.041,0,0,1,16.04248,18.94531ZM17.65674,11.98l-3.68457,3.38623a9.77348,9.77348,0,0,1-5.17041,2.3042l-2.4043-2.4043a10.932,10.932,0,0,1,2.40088-5.206l1.67834-1.99268a.9635.9635,0,0,0,.07813-.09277L11.98975,6.271a9.27757,9.27757,0,0,1,8.80957-3.12012A9.21808,9.21808,0,0,1,17.65674,11.98Zm-.923-6.16376a1.5,1.5,0,1,0,1.5,1.5A1.49992,1.49992,0,0,0,16.7337,5.81622Z
</PathGeometry>
</Path.Data>
</Path>
<TextBlock Margin="5 0 0 0"> Launch Among Us</TextBlock>
<TextBlock VerticalAlignment="Center" Margin="5 0 0 5"> Launch Among Us</TextBlock>
</StackPanel>

</Button.Content>
Expand Down

0 comments on commit 3bbf965

Please sign in to comment.