提交 5d35de8f 编写于 作者: R RMBGAME

💄 Steam 动态头像框展示支持

上级 09be4c71
Subproject commit e3527552162b91038d538d9ec6446d0be5524fbe Subproject commit 1fb8d0397ee26dc43ba858f9d08f22dbe0fe0753
...@@ -6,7 +6,6 @@ namespace Avalonia; ...@@ -6,7 +6,6 @@ namespace Avalonia;
public static class DrawingContextExtensions public static class DrawingContextExtensions
{ {
public static void DrawBitmap2(this DrawingContext context, Bitmap source, double opacity, Rect sourceRect, Rect destRect) public static void DrawBitmap2(this DrawingContext context, Bitmap source, double opacity, Rect sourceRect, Rect destRect)
{ {
context.DrawBitmap(source.PlatformImpl, opacity, sourceRect, destRect); context.DrawBitmap(source.PlatformImpl, opacity, sourceRect, destRect);
......
...@@ -16,6 +16,8 @@ public interface IAccount ...@@ -16,6 +16,8 @@ public interface IAccount
string? ImagePath { get; set; } string? ImagePath { get; set; }
string? AvatarFramePath { get; set; }
ThirdpartyPlatform Platform { get; init; } ThirdpartyPlatform Platform { get; init; }
string? PlatformName { get; init; } string? PlatformName { get; init; }
......
...@@ -16,6 +16,8 @@ public sealed class BasicAccount : ReactiveObject, IAccount ...@@ -16,6 +16,8 @@ public sealed class BasicAccount : ReactiveObject, IAccount
public string? ImagePath { get; set; } public string? ImagePath { get; set; }
public string? AvatarFramePath { get; set; }
public ThirdpartyPlatform Platform { get; init; } public ThirdpartyPlatform Platform { get; init; }
public string? PlatformName { get; init; } public string? PlatformName { get; init; }
......
...@@ -40,6 +40,12 @@ public sealed class SteamAccount : ReactiveObject, IAccount ...@@ -40,6 +40,12 @@ public sealed class SteamAccount : ReactiveObject, IAccount
set => this.SteamUser.AvatarMedium = value; set => this.SteamUser.AvatarMedium = value;
} }
public string? AvatarFramePath
{
get => this.SteamUser.MiniProfile?.AvatarFrame;
set => this.SteamUser.MiniProfile.AvatarFrame = value;
}
public bool MostRecent public bool MostRecent
{ {
get => this.SteamUser.MostRecent; get => this.SteamUser.MostRecent;
......
...@@ -142,13 +142,32 @@ ...@@ -142,13 +142,32 @@
</ia:EventTriggerBehavior> </ia:EventTriggerBehavior>
</i:Interaction.Behaviors> </i:Interaction.Behaviors>
<spp:AppItem.Image> <spp:AppItem.Image>
<spp:Image2 <Panel>
Width="128" <spp:Image2
Height="128" Width="128"
FallbackSource="avares://BD.WTTS.Client.Avalonia/UI/Assets/avatar.jpg" Height="128"
RenderOptions.BitmapInterpolationMode="HighQuality" FallbackSource="avares://BD.WTTS.Client.Avalonia/UI/Assets/avatar.jpg"
Source="{Binding ImagePath}" RenderOptions.BitmapInterpolationMode="HighQuality"
Stretch="UniformToFill" /> Source="{Binding ImagePath}"
Stretch="UniformToFill" />
<spp:Image2
Width="155"
Height="155"
IsVisible="{ReflectionBinding #u.DataContext.IsSteamPlatform}"
RenderOptions.BitmapInterpolationMode="MediumQuality"
Source="{Binding AvatarFramePath}"
Stretch="UniformToFill">
<!--<spp:Image2.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<ReflectionBinding ElementName="u" Path="DataContext.IsSteamPlatform" />
<CompiledBinding
Converter="{StaticResource IsNullConverter}"
ConverterParameter="invert"
Path="AvatarFramePath" />
</MultiBinding>
</spp:Image2.IsVisible>-->
</spp:Image2>
</Panel>
</spp:AppItem.Image> </spp:AppItem.Image>
</spp:AppItem> </spp:AppItem>
</Border> </Border>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册