Compare commits

..

20 Commits

Author SHA1 Message Date
RMBGAME ed5cc929d3 📃 Text 2024-07-02 09:51:11 +08:00
Aigio Liu 213b2c2644 🔖 3.0.0 rc.9 2024-07-01 16:45:04 +08:00
RMBGAME e1adf07789 🐛 加速数据树结构某些情况下选中状态也异常问题修复 2024-07-01 16:38:08 +08:00
john.jiang 83f0634863 🎨 挂卡自动刷新token,bug修复 2024-07-01 16:16:18 +08:00
yingpanwang f08122769f 🐛 本地令牌 "确认交易" 时,当access_token 过期时使用refresh_token 刷新当前 access_token 以保持会话 (#3381)
* 🐛 本地令牌 "确认交易" 时,当access_token 过期时使用refresh_token 刷新当前 access_token 以保持会话

* 🎨 调整代码排版
2024-07-01 16:15:51 +08:00
RMBGAME 49fdeadfd2 🐛 HttpVersion 因按原本逻辑转发 2024-07-01 15:08:46 +08:00
RMBGAME bca80245bb 🐛 Misc 2024-06-30 19:00:17 +08:00
RMBGAME 0f6c127ad3 🐛 Misc 2024-06-30 16:00:46 +08:00
Aigio L c087a02303 Update CI.yml 2024-06-29 17:01:31 +08:00
Aigio Liu 6c84a876ff 🐛 ClrearLastLookNoticeDateTime 2024-06-29 16:52:52 +08:00
ff m df27068329 🐛 防止 添加 cookie 报错 2024-06-29 16:41:52 +08:00
ff m f10df31edd 🐛 更新子模块 适配转发请求头 2024-06-29 16:30:35 +08:00
RMBGAME 902919cf98 💄 Misc 2024-06-29 15:55:11 +08:00
RMBGAME a6aec5ad62 🐛 fixed Misc 2024-06-29 15:20:02 +08:00
RMBGAME 2fd651fd25 🐛 窗口偏移位置调整 2024-06-29 13:52:03 +08:00
RMBGAME 67615028e1 ✨🐛 新增 网络加速 二级代理支持
修复 Request Header 中存在非 ASCII 字符导致代理异常的状况
close #2753 #2523 #1661 #488
fix #1825
2024-06-29 00:43:17 +08:00
RMBGAME 1eca159e23 💄 Misc 2024-06-28 16:32:31 +08:00
RMBGAME d1d9ca82df 🐛 fix #3360
修复重启程序窗口增高问题
修复挂卡登录状态丢失挂卡依然继续问题
2024-06-28 16:02:06 +08:00
RMBGAME 88bd2dbfe9 🚑 库存游戏新 appinfo 解析 2024-06-28 13:57:44 +08:00
Mossimo ae2b2970db 🐛 修复 Linux 非 Host 模式不检测 443 占用 2024-06-27 16:32:47 +08:00
346 changed files with 3276 additions and 2506 deletions
+5 -5
View File
@@ -68,19 +68,19 @@ jobs:
run: dotnet --info
- name: Build BD.WTTS.Client.AppHost
run: dotnet build -c Release src\BD.WTTS.Client.AppHost\BD.WTTS.Client.AppHost.csproj --nologo -v q --property:WarningLevel=1;DebugType=pdbonly
run: dotnet build -c Release src\BD.WTTS.Client.AppHost\BD.WTTS.Client.AppHost.csproj --nologo -v q --property:WarningLevel=1 --property:DebugType=pdbonly
- name: Build BD.WTTS.Client.Plugins.Accelerator.ReverseProxy
run: dotnet build -c Release src\BD.WTTS.Client.Plugins.Accelerator.ReverseProxy\BD.WTTS.Client.Plugins.Accelerator.ReverseProxy.csproj --nologo -v q --property:WarningLevel=1;DebugType=pdbonly
run: dotnet build -c Release src\BD.WTTS.Client.Plugins.Accelerator.ReverseProxy\BD.WTTS.Client.Plugins.Accelerator.ReverseProxy.csproj --nologo -v q --property:WarningLevel=1 --property:DebugType=pdbonly
- name: Build BD.WTTS.Client.Avalonia.App
run: dotnet build -c Release src\BD.WTTS.Client.Avalonia.App\BD.WTTS.Client.Avalonia.App.csproj --nologo -v q --property:WarningLevel=1;DebugType=pdbonly
run: dotnet build -c Release src\BD.WTTS.Client.Avalonia.App\BD.WTTS.Client.Avalonia.App.csproj --nologo -v q --property:WarningLevel=1 --property:DebugType=pdbonly
- name: Build BD.WTTS.Client.Avalonia.Designer.HostApp
run: dotnet build -c Release src\BD.WTTS.Client.Avalonia.Designer.HostApp\BD.WTTS.Client.Avalonia.Designer.HostApp.csproj --nologo -v q --property:WarningLevel=1;DebugType=pdbonly
run: dotnet build -c Release src\BD.WTTS.Client.Avalonia.Designer.HostApp\BD.WTTS.Client.Avalonia.Designer.HostApp.csproj --nologo -v q --property:WarningLevel=1 --property:DebugType=pdbonly
- name: Test
run: dotnet test src/BD.WTTS.UnitTest/BD.WTTS.UnitTest.csproj -c Release -p:GeneratePackageOnBuild=false --nologo -v q --property:WarningLevel=1;DebugType=pdbonly
run: dotnet test src/BD.WTTS.UnitTest/BD.WTTS.UnitTest.csproj -c Release -p:GeneratePackageOnBuild=false --nologo -v q --property:WarningLevel=1 --property:DebugType=pdbonly
# release:
# name: Release
+2 -2
View File
@@ -964,8 +964,8 @@
},
{
"TypeName": "bool",
"PropertyName": "UseDoh",
"DefaultValue": "true",
"PropertyName": "UseDoh2",
"DefaultValue": "false",
"DefaultValueIsConst": true,
"Summary": "启用 DNS over HTTPS",
"IsRegionOrEndregion": null,
+1 -25
View File
@@ -3,14 +3,6 @@ namespace BD.WTTS;
/// <summary>
/// 提供用来获取应用程序信息(如版本号、说明、加载的程序集等)的属性。
/// </summary>
[Mobius3(
"""
Mobius.AssemblyInfo
AssemblyInfo.cs
AssemblyInfo.Version.cs
AssemblyInfo.Version.NativeHost.cs
AssemblyInfo.Version.Setup.Windows.cs
""")]
public static partial class AssemblyInfo
{
const string Version2 = "3.0";
@@ -29,7 +21,7 @@ public static partial class AssemblyInfo
/// <summary>
/// RC 版本号,范围 0~9,只增不减
/// </summary>
const string ver_for_rc = "8";
const string ver_for_rc = "9";
public const string FileVersion = $"{Version2}.{ver_for_rc}0{ver_for_preview}.0";
@@ -154,20 +146,4 @@ false
#endif
}
[AttributeUsage(AttributeTargets.All, Inherited = false)]
sealed class Mobius3Attribute : Attribute
{
public Mobius3Attribute()
{
}
public Mobius3Attribute(string str)
{
}
public bool Obsolete { get; set; }
}
-1
View File
@@ -1,4 +1,3 @@
// Mobius Properties\XmlnsDefinition.cs
#if (WINDOWS || MACCATALYST || MACOS || LINUX) && !(IOS || ANDROID)
// C# 10 定义全局 using
File diff suppressed because it is too large Load Diff
@@ -11,7 +11,7 @@
<Identity
Name="4651ED44255E.47979655102CE"
Publisher="CN=A90E406B-B2D3-4A23-B061-0FA1D65C4F66"
Version="3.0.999.0" />
Version="3.0.207.0" />
<Properties>
<DisplayName>Watt Toolkit</DisplayName>
@@ -66,6 +66,15 @@
</Application>
</Applications>
<Extensions>
<desktop2:Extension Category="windows.firewallRules">
<desktop2:FirewallRules Executable="Steam++\modules\Accelerator\Steam++.Accelerator.exe">
<desktop2:Rule Direction="in" IPProtocol="TCP" Profile="all"/>
<desktop2:Rule Direction="in" IPProtocol="UDP" Profile="all"/>
</desktop2:FirewallRules>
</desktop2:Extension>
</Extensions>
<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="runFullTrust" />
@@ -1,9 +1,5 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.WaveProgressGradientOffsetConverter
""")]
public sealed class BitmapAssetValueConverter : ImageValueConverter
{
public override object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
@@ -1,9 +1,5 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.ColorStringToBrushConverter
""")]
public sealed class ColorStringToBrushConverter : IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
@@ -1,9 +1,5 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.EnumConverter
""")]
public sealed class EnumConverter : IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
@@ -2,10 +2,6 @@ using IBinding = BD.WTTS.Converters.Abstractions.IBinding;
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.EnumEqualValueConverter
""")]
public sealed class EnumEqualValueConverter : IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
@@ -1,9 +1,5 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.EnumLocalizationNameConverter
""")]
public sealed class EnumLocalizationNameConverter : IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
@@ -2,10 +2,6 @@ using SkiaSharp;
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.Abstractions.ImageValueConverter
""")]
public abstract class ImageValueConverter : IValueConverter
{
public abstract object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture);
@@ -50,7 +46,6 @@ public abstract class ImageValueConverter : IValueConverter
/// <param name="clipStream"></param>
/// <param name="bitmap"></param>
/// <returns></returns>
[Mobius("", Obsolete = true)]
static bool TryGetBitmap([NotNullWhen(true)] ImageSource.ClipStream? clipStream, [NotNullWhen(true)] out SKBitmap? bitmap)
{
if (clipStream?.Stream == null)
@@ -1,9 +1,5 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.IsNullConverter
""")]
public sealed class IsNullConverter : IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
@@ -1,9 +1,5 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.NameToFontFamilyConverter
""")]
public sealed class NameToFontFamilyConverter : IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
@@ -1,9 +1,5 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.RangeToSweepConverter
""")]
public sealed class RangeToSweepConverter : IMultiValueConverter
{
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
@@ -1,9 +1,5 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.ResourceKeyValueConverter
""")]
public sealed class ResourceKeyValueConverter : IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
@@ -1,9 +1,5 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.StringEqualsConverter
""")]
public class StringEqualsConverter : IValueConverter
{
static string ToString(object? obj) => obj?.ToString() ?? string.Empty;
@@ -2,10 +2,6 @@ using SteamKit2;
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.StringFormatConverter
""")]
public sealed class StringFormatConverter : IValueConverter, IMultiValueConverter
{
const string Size = "size";
@@ -1,9 +1,5 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.VisibleStringConverter
""")]
public sealed class VisibleStringConverter : IMultiValueConverter
{
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
@@ -1,9 +1,5 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.WaveProgressValueConverter
""")]
public sealed class WaveProgressValueConverter : IValueConverter
{
public static readonly WaveProgressValueConverter Instance = new();
@@ -22,10 +18,6 @@ public sealed class WaveProgressValueConverter : IValueConverter
}
}
[Mobius(
"""
Mobius.UI.Converters.WaveProgressValueColorConverter
""")]
public class WaveProgressValueColorConverter : IValueConverter
{
public static readonly WaveProgressValueColorConverter Instance = new();
@@ -45,10 +37,6 @@ public class WaveProgressValueColorConverter : IValueConverter
}
}
[Mobius(
"""
Mobius.UI.Converters.WaveProgressValueTextConverter
""")]
public class WaveProgressValueTextConverter : IValueConverter
{
public static readonly WaveProgressValueTextConverter Instance = new();
@@ -66,10 +54,6 @@ public class WaveProgressValueTextConverter : IValueConverter
}
}
[Mobius(
"""
Mobius.UI.Converters.WaveProgressGradientOffsetConverter
""")]
public class WaveProgressGradientOffsetConverter : IValueConverter
{
public static readonly WaveProgressGradientOffsetConverter Instance = new();
@@ -2,10 +2,6 @@ namespace BD.WTTS.UI;
public static class ControlExtensions
{
[Mobius(
"""
Mobius.UI.ControlExtensions.SetViewModel
""")]
public static void SetViewModel<T>(this Control c, bool useCache = false) where T : ViewModelBase, new()
{
if (c.DataContext == null || c.DataContext.GetType() != typeof(T))
@@ -3,10 +3,6 @@ namespace BD.WTTS;
/// <summary>
/// <see cref="IEnumerable"/> extensions methods
/// </summary>
[Mobius(
"""
Mobius.IEnumerableExtensions
""")]
public static class IEnumerableExtensions
{
public static IEnumerable<IEnumerable> Batch(this IEnumerable source, int size)
@@ -1,10 +1,6 @@
// ReSharper disable once CheckNamespace
namespace Avalonia.Controls;
[BD.Mobius(
"""
Mobius.UI.WindowExtensions
""")]
public static partial class WindowExtensions
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -3,10 +3,6 @@ namespace BD.WTTS;
public static class WindowTransparencyLevelExtensions
{
[Mobius(
"""
Mobius.Enums.UI.WindowTransparencyLevelExtensions
""")]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static WindowTransparencyLevel ToWindowTransparencyLevel(
this WindowBackgroundMaterial value)
@@ -17,6 +13,7 @@ Mobius.Enums.UI.WindowTransparencyLevelExtensions
WindowBackgroundMaterial.Blur => WindowTransparencyLevel.Blur,
WindowBackgroundMaterial.AcrylicBlur => WindowTransparencyLevel.AcrylicBlur,
WindowBackgroundMaterial.Mica => WindowTransparencyLevel.Mica,
WindowBackgroundMaterial.Transparent => WindowTransparencyLevel.Transparent,
_ => WindowTransparencyLevel.None,
};
}
@@ -2,10 +2,6 @@ using BD.WTTS.Markup.Abstractions;
namespace BD.WTTS.Markup;
[Mobius(
"""
Mobius.UI.Markup.OnPlatformExtension
""")]
public sealed class OnPlatformExtension : MarkupExtension<bool>
{
public OnPlatformExtension(string member) : base(member)
@@ -1,9 +1,5 @@
namespace BD.WTTS.Services.Implementation;
[Mobius(
"""
BD.Common8.Essentials.Services.Implementation.AvaloniaMainThreadPlatformServiceImpl
""")]
sealed class MainThreadPlatformServiceImpl : IMainThreadPlatformService
{
public bool PlatformIsMainThread
@@ -4,18 +4,10 @@ using System.Collections.Immutable;
namespace BD.WTTS.Services.Implementation;
/// <inheritdoc cref="IWindowManager"/>
[Mobius(
"""
Mobius.Services.WindowManagerService
""")]
public sealed class AvaloniaWindowManagerImpl : IWindowManagerImpl
{
Type? IWindowManagerImpl.WindowType => typeof(Window);
[Mobius(
"""
Mobius.Services.WindowManagerService.GetWindowTopLevel
""")]
public static TopLevel? GetWindowTopLevel()
{
if (App.Instance.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
@@ -3,10 +3,6 @@ using static System.Net.Mime.MediaTypeNames;
namespace BD.WTTS.Services.Implementation;
[Mobius(
"""
BD.Common8.Essentials.Services.Implementation.AvaloniaClipboardPlatformServiceImpl
""")]
public sealed class AvaloniaClipboardPlatformService : IClipboardPlatformService
{
public bool PlatformHasText => !string.IsNullOrEmpty(PlatformGetTextAsync().GetAwaiter().GetResult());
@@ -5,10 +5,6 @@ using AvaNotificationType = Avalonia.Controls.Notifications.NotificationType;
namespace BD.WTTS.Services.Implementation;
[Mobius(
"""
Mobius.Services.ToastService
""")]
[TemplatePart("PART_Items", typeof(Panel))]
[PseudoClasses(":topleft", ":topright", ":bottomleft", ":bottomright")]
sealed class AvaloniaToastServiceImpl : IToastService
@@ -8,10 +8,6 @@ using WinUI = Windows.UI.StartScreen;
namespace BD.WTTS.Services.Implementation;
/// <inheritdoc cref="IJumpListService"/>
[Mobius(
"""
Mobius.Services.Platform.Windows.Abstractions.IJumpListService
""")]
internal sealed class JumpListServiceImpl : IJumpListService
{
#if WINDOWS
@@ -6,10 +6,6 @@ using System.Xml.Linq;
namespace BD.WTTS.Services.Implementation;
[Mobius(
"""
Mobius.Services.NavigationService
""")]
public sealed class NavigationService : INavigationService
{
public static NavigationService Instance { get; } = (NavigationService)Ioc.Get<INavigationService>();
@@ -18,14 +14,6 @@ public sealed class NavigationService : INavigationService
public Type? CurrnetPage => _frame?.CurrentSourcePageType;
[Mobius(
"""
isCreateInstance = true
Mobius.Services.NavigationService.GetViewModelToPageContent
isCreateInstance = false
Mobius.Services.NavigationService.GetViewModelToPageContentType
""")]
public object? GetViewModelToPageContent(object viewModel, bool isCreateInstance = true)
{
string name;
@@ -7,28 +7,12 @@ namespace BD.WTTS.UI;
partial class App
{
[Mobius(
"""
App.DefaultActualTheme
""")]
const AppTheme _DefaultActualTheme = AppTheme.FollowingSystem;
[Mobius(
"""
App.DefaultActualTheme
""")]
AppTheme IApplication.DefaultActualTheme => _DefaultActualTheme;
[Mobius(
"""
App.mTheme
""")]
AppTheme mTheme = _DefaultActualTheme;
[Mobius(
"""
App.Theme
""")]
public AppTheme Theme
{
get => mTheme;
@@ -66,10 +50,6 @@ App.Theme
}
}
[Mobius(
"""
App.SetThemeNotChangeValue
""")]
public void SetThemeNotChangeValue(AppTheme value)
{
var mode = value switch
@@ -91,10 +71,6 @@ App.SetThemeNotChangeValue
}
}
[Mobius(
"""
App.SetThemeAccent
""")]
public static void SetThemeAccent(string? colorHex)
{
if (colorHex == null)
@@ -9,34 +9,14 @@ namespace BD.WTTS.UI;
partial class App
{
[Mobius(
"""
App.TrayMenus
""")]
public Dictionary<string, TrayMenuItem> TrayMenus { get; } = new Dictionary<string, TrayMenuItem>();
[Mobius(
"""
App.TrayIcons
""")]
public TrayIcons TrayIcons { get; init; } = new TrayIcons();
[Mobius(
"""
App.trayIconMenus
""")]
readonly Dictionary<string, ICommand> trayIconMenus = new();
[Mobius(
"""
App.TrayIconMenus
""")]
public IReadOnlyDictionary<string, ICommand> TrayIconMenus => trayIconMenus;
[Mobius(
"""
App.InitTrayIcon
""")]
void InitTrayIcon()
{
if (ApplicationLifetime is not
@@ -87,10 +67,6 @@ App.InitTrayIcon
}
}
[Mobius(
"""
App.UpdateMenuItems
""")]
public void UpdateMenuItems()
{
MainThread2.BeginInvokeOnMainThread(() =>
@@ -190,10 +166,6 @@ App.UpdateMenuItems
});
}
[Mobius(
"""
App.UpdateMenuItems
""")]
public void UpdateMenuItems(string menuKey, TrayMenuItem trayMenuItem)
{
if (TrayMenus != null)
@@ -7,10 +7,6 @@ using System.Drawing.Drawing2D;
namespace BD.WTTS.UI;
[Mobius(
"""
Mobius.UI.App
""")]
public sealed partial class App : Application
{
const string TAG = "AvaApp";
@@ -237,12 +233,6 @@ public sealed partial class App : Application
public ICommand OpenBrowserCommand { get; }
[Mobius(
"""
Mobius.UI.App.OpenBrowserCommandCore
1. 不提示 打开链接失败
2. 使用统一的 OpenAuthUrl
""")]
public async void OpenBrowserCommandCore(object? url)
{
try
@@ -276,11 +266,6 @@ Mobius.UI.App.OpenBrowserCommandCore
public ICommand CopyToClipboardCommand { get; }
[Mobius(
"""
Mobius.UI.App.OpenBrowserCommandCore
1. 不提示 复制内容失败
""")]
public async void CopyToClipboardCommandCore(object? text)
{
try
@@ -5,10 +5,6 @@ using Visual = Avalonia.Visual;
namespace BD.WTTS.UI;
[Mobius(
"""
Mobius.UI.Animations.Animations
""")]
public static class Animations
{
private static readonly Easing DefaultEasing = new LinearEasing();
@@ -3,10 +3,6 @@ using System.Windows.Input;
namespace BD.WTTS.UI;
[Mobius(
"""
Mobius.UI.Views.Controls.Stepper.DelegateInputCommand
""")]
internal class Command : ICommand
{
private readonly Action<object?> _onExecute;
@@ -3,10 +3,6 @@ using FluentAvalonia.UI.Media.Animation;
namespace BD.WTTS.UI;
[Mobius(
"""
Mobius.UI.Animations.FrameEffect
""")]
public static class FrameEffect
{
public static SlideNavigationTransitionEffect GetEffect(int oldIndex, int index)
@@ -6,10 +6,6 @@ using System.Collections.Specialized;
namespace BD.WTTS.UI;
[Mobius(
"""
Mobius.UI.Behaviors.ItemDragBehavior
""")]
public class ItemDragBehavior : Behavior<Control>
{
private bool _enableDrag;
@@ -3,10 +3,6 @@ namespace BD.WTTS.UI.Styling;
/// <summary>
/// Includes the fluent theme in an application.
/// </summary>
[Mobius(
"""
Mobius.UI.Styling.CustomTheme
""")]
public class CustomTheme : Styles, IResourceProvider
{
public const string LightModeString = "Light";
@@ -5,10 +5,6 @@ using FluentAvalonia.UI.Navigation;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages.Abstractions.PageBase
""")]
public class PageBase : UserControl
{
public PageBase() : base()
@@ -325,10 +321,6 @@ public class PageBase : UserControl
private CompositeDisposable _disposables;
}
[Mobius(
"""
Mobius.UI.Views.Pages.Abstractions.PageBase<TViewModel>
""")]
public class PageBase<TViewModel> : PageBase, IViewFor<TViewModel> where TViewModel : class
{
public static readonly StyledProperty<TViewModel?> ViewModelProperty = AvaloniaProperty.Register<PageBase<TViewModel>, TViewModel?>(nameof(ViewModel));
@@ -7,10 +7,6 @@ namespace BD.WTTS.UI.Views.Windows;
/// and vice versa.
/// </summary>
/// <typeparam name="TViewModel">ViewModel type.</typeparam>
[Mobius(
"""
Mobius.UI.Views.Windows.Abstractions.ReactiveAppWindow<TViewModel>
""")]
public class ReactiveAppWindow<TViewModel> : AppWindow, IViewFor<TViewModel>, IViewFor, IActivatableView where TViewModel : class
{
public static readonly StyledProperty<TViewModel?> ViewModelProperty = ReactiveWindow<TViewModel>.ViewModelProperty.AddOwner<ReactiveAppWindow<TViewModel>>();
@@ -139,11 +135,11 @@ public class ReactiveAppWindow<TViewModel> : AppWindow, IViewFor<TViewModel>, IV
if (SizePosition.Height > 0 &&
primaryScreenBounds.Height >= SizePosition.Height)
Height = SizePosition.Height;
Height = SizePosition.Height - 31; // appwindow偏移量
if (SizePosition.X > 0 && SizePosition.Y > 0)
{
var leftTopPoint = new PixelPoint(SizePosition.X, SizePosition.Y);
var leftTopPoint = new PixelPoint(SizePosition.X, SizePosition.Y + 31);
var rightBottomPoint = new PixelPoint(SizePosition.X + (int)Width, SizePosition.Y + (int)Height);
if (primaryScreenBounds.Contains(leftTopPoint) &&
primaryScreenBounds.Contains(rightBottomPoint))
@@ -4,10 +4,6 @@ using FluentAvalonia.Core;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public partial class AdControl : UserControl
{
/// <summary>
@@ -4,10 +4,6 @@ using System.Numerics;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class AppItem : TemplatedControl
{
public static readonly StyledProperty<string> TitleProperty =
@@ -4,10 +4,6 @@ using FluentAvalonia.Core;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class ContentLoader : ContentControl
{
/// <summary>
@@ -2,10 +2,6 @@ using Avalonia.Input;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public sealed class CustomFilePicker : ContentControl
{
public static readonly StyledProperty<string?> FileNameProperty = AvaloniaProperty.Register<CustomFilePicker, string?>(nameof(FileName), null);
@@ -1,9 +1,5 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public enum AlignContent
{
FlexStart,
@@ -1,9 +1,6 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
[SuppressMessage("Naming", "CA1717:Only FlagsAttribute enums should have plural names")]
public enum AlignItems
{
FlexStart,
@@ -1,9 +1,5 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public static class Flex
{
/// <summary>
@@ -1,9 +1,5 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public readonly struct FlexBasis : IEquatable<FlexBasis>
{
public double Value { get; }
@@ -1,9 +1,5 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public enum FlexBasisKind
{
Auto,
@@ -1,9 +1,5 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public enum FlexDirection
{
Row,
@@ -1,9 +1,5 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public sealed class FlexPanel : Panel
{
private static readonly Func<Layoutable, int> s_getOrder = x => x is { } y ? Flex.GetOrder(y) : 0;
@@ -1,9 +1,5 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public enum FlexWrap
{
NoWrap,
@@ -1,9 +1,5 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public enum JustifyContent
{
FlexStart,
@@ -1,9 +1,5 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
internal readonly struct Uv(double u, double v)
{
public double U { get; } = u;
@@ -2,10 +2,6 @@ using Avalonia.Controls;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class OptionsDisplayItem : TemplatedControl
{
public static readonly StyledProperty<object?> HeaderProperty =
@@ -1,9 +1,5 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class PureCircle : Control
{
public static readonly StyledProperty<double> DiameterProperty = AvaloniaProperty.Register<PureCircle, double>(
@@ -3,10 +3,6 @@ namespace BD.WTTS.UI.Views.Controls;
/// <summary>
/// Provide the most simplified shape implementation. This is a rectangle with a background, without border and corner radius.
/// </summary>
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class PureRectangle : Control
{
public static readonly StyledProperty<IBrush?> BackgroundProperty =
@@ -1,9 +1,5 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class PureRing : PureCircle
{
public static readonly StyledProperty<double> InnerDiameterProperty = AvaloniaProperty.Register<PureRing, double>(
@@ -6,10 +6,6 @@ namespace BD.WTTS.UI.Views.Controls;
/// <summary>
/// An <see cref="INotificationManager"/> that displays notifications in a <see cref="Window"/>.
/// </summary>
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
[TemplatePart("PART_Items", typeof(Panel))]
[PseudoClasses(":topleft", ":topright", ":bottomleft", ":bottomright")]
public class SnackbarManager : TemplatedControl, IManagedNotificationManager
@@ -2,10 +2,6 @@ using Avalonia.Controls;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public partial class SplashScreen : UserControl
{
public SplashScreen()
@@ -3,10 +3,6 @@ using BD.Common.Models.Abstractions;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public partial class TitleBar : UserControl
{
public Image WindowIcon => BarIcon;
@@ -3,10 +3,6 @@ using FluentAvalonia.Core;
namespace BD.WTTS.UI.Views.Controls
{
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public partial class CarouselBanner : UserControl
{
/// <summary>
@@ -5,10 +5,6 @@ using System.Reactive;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class CarouselItems : ItemsControl
{
/// <summary>
@@ -5,10 +5,6 @@ namespace BD.WTTS.UI.Views.Controls;
/// <summary>
/// 固定的 WrapPanel
/// </summary>
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class FixedWrapPanel : Panel, INavigableContainer
{
/// <summary>
@@ -3,10 +3,6 @@ using Avalonia.Controls.Shapes;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class Ripple : Ellipse
{
private static Easing _easing = new CircularEaseOut();
@@ -2,10 +2,6 @@ using Avalonia.Controls.Shapes;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class RippleEffect : ContentControl
{
// ReSharper disable once InconsistentNaming
@@ -1,9 +1,5 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class Skeleton : ContentControl
{
public static readonly StyledProperty<bool> IsActiveProperty =
@@ -3,10 +3,6 @@ using Avalonia.Controls.Notifications;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class Snackbar : InfoBar
{
private bool _isClosing;
@@ -1,9 +1,5 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
[TemplatePart("PART_ItemsPresenter", typeof(ItemsPresenter))]
[TemplatePart("PART_ProgressBar", typeof(ProgressBar))]
public class Stepper : SelectingItemsControl
@@ -4,10 +4,6 @@ using Avalonia.Controls.Mixins;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
[PseudoClasses(":pressed", ":selected")]
public class StepperItem : ContentControl, ISelectable
{
@@ -1,9 +1,5 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public sealed class TaskDialogEx : TaskDialog
{
private Button? _closeButton;
@@ -1,9 +1,5 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public sealed partial class WaveProgress : UserControl
{
public static readonly DirectProperty<WaveProgress, double> ValueProperty =
@@ -3,10 +3,6 @@ using BD.WTTS.Services;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class AboutPage : ReactiveUserControl<AboutPageViewModel>
{
public AboutPage()
@@ -1,9 +1,5 @@
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class MessageBoxPage : ReactiveUserControl<MessageBoxWindowViewModel>
{
public MessageBoxPage()
@@ -2,10 +2,6 @@ using Avalonia.Markup.Xaml.MarkupExtensions;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class TextInputDialogPage : ReactiveUserControl<TextBoxWindowViewModel>
{
public TextInputDialogPage()
@@ -2,10 +2,6 @@ using Avalonia.Controls;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class DebugPage : PageBase<DebugPageViewModel>
{
public DebugPage()
@@ -2,10 +2,6 @@ using Avalonia.Controls;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class ErrorPage : UserControl
{
public ErrorPage()
@@ -74,13 +74,18 @@
MaxWidth="1080"
Spacing="20">
<spp:Snackbar
Title="{Binding Path=Res.Notice_Tray_Title, Mode=OneWay, Source={x:Static s:ResourceService.Current}}"
VerticalAlignment="Top"
IsClosable="False"
IsOpen="True"
IsVisible="{spp:OnPlatform !GA}"
Message="当前使用的程序版本为测试版本,可能会有各种各样不可言明的 Bug,遇到问题请理性反馈,谢谢。"
Severity="Warning" />
<spp:Snackbar
VerticalAlignment="Top"
IsClosable="False"
IsOpen="True"
IsVisible="{spp:OnPlatform !GA}"
Message="如果您不喜欢当前主页为默认启动页面可以在【设置-界面设置-启动时默认打开页面】处更改" />
<spp:Snackbar
Title="{Binding Path=Res.Notice_Tray_Title, Mode=OneWay, Source={x:Static s:ResourceService.Current}}"
VerticalAlignment="Top"
@@ -2,10 +2,6 @@ using BD.WTTS.Client.Resources;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class HomePage : ReactiveUserControl<HomePageViewModel>
{
public HomePage()
@@ -218,6 +218,7 @@
<TextBlock Text="{Binding Path=User.NickName, Mode=OneWay, Source={x:Static s:UserService.Current}}" />
<Border
Padding="5,1"
HorizontalAlignment="Left"
VerticalAlignment="Center"
CornerRadius="2"
IsVisible="{Binding Path=User.UserType, Mode=OneWay, Source={x:Static s:UserService.Current}, Converter={StaticResource EnumEqualValueConverter}, ConverterParameter={x:Static enum:UserType.Sponsor}}">
@@ -6,10 +6,6 @@ using FluentAvalonia.UI.Navigation;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public sealed partial class MainView : ReactiveUserControl<MainWindowViewModel>
{
public MainView()
@@ -3,10 +3,6 @@ using FluentAvalonia.UI.Navigation;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class PluginStorePage : UserControl
{
public PluginStorePage()
@@ -2,10 +2,6 @@ using Avalonia;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class SettingsPage : PageBase<SettingsPageViewModel>
{
public SettingsPage()
@@ -2,10 +2,6 @@ using Avalonia.Controls;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class Settings_General : UserControl
{
public Settings_General()
@@ -2,10 +2,6 @@ using Avalonia.Controls;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class Settings_Plugin : ReactiveUserControl<SettingsPageViewModel>
{
public Settings_Plugin()
@@ -2,10 +2,6 @@ using Avalonia.Controls;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class Settings_Steam : UserControl
{
public Settings_Steam()
@@ -341,6 +341,7 @@
<ComboBox SelectedItem="{Binding Source={x:Static ms:UISettings.WindowBackgroundMaterial}, Path=Value, Mode=TwoWay}">
<ComboBox.Items>
<spp:WindowBackgroundMaterial>None</spp:WindowBackgroundMaterial>
<spp:WindowBackgroundMaterial>Transparent</spp:WindowBackgroundMaterial>
<spp:WindowBackgroundMaterial>Blur</spp:WindowBackgroundMaterial>
<spp:WindowBackgroundMaterial>AcrylicBlur</spp:WindowBackgroundMaterial>
<spp:WindowBackgroundMaterial>Mica</spp:WindowBackgroundMaterial>
@@ -2,10 +2,6 @@ using Avalonia.Controls;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class Settings_UI : UserControl
{
public List<Color> PredefinedColors { get; } = new List<Color>
@@ -1,9 +1,5 @@
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class LoginOrRegisterPage : ReactiveUserControl<LoginOrRegisterWindowViewModel>
{
public LoginOrRegisterPage()
@@ -2,10 +2,6 @@ using Avalonia.Controls;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class NoticeFlyout : UserControl
{
public NoticeFlyout()
@@ -1,9 +1,5 @@
namespace BD.WTTS.UI.Views.Windows;
[Mobius(
"""
Mobius.UI.Views.Windows
""")]
public partial class ContentWindow : ReactiveAppWindow<ContentWindowViewModel>
{
public ContentWindow()
@@ -1,9 +1,5 @@
namespace BD.WTTS.UI.Views.Windows;
[Mobius(
"""
Mobius.UI.Views.Windows
""")]
public partial class DebugWindow : Window
{
public DebugWindow()
@@ -6,10 +6,6 @@ using static BD.WTTS.Startup;
namespace BD.WTTS.UI.Views.Windows;
[Mobius(
"""
Mobius.UI.Views.Windows.MainWindow
""")]
public sealed partial class MainWindow : ReactiveAppWindow<MainWindowViewModel>
{
public MainWindow()
@@ -66,7 +62,7 @@ public sealed partial class MainWindow : ReactiveAppWindow<MainWindowViewModel>
pageType = page.PageType;
}
}
INavigationService.Instance.Navigate(pageType ?? typeof(PluginStorePage));
INavigationService.Instance.Navigate(pageType ?? typeof(HomePage));
return true;
}
@@ -100,10 +96,6 @@ public sealed partial class MainWindow : ReactiveAppWindow<MainWindowViewModel>
}
}
[Mobius(
"""
Mobius.UI.MobiusSplashScreen
""")]
public sealed class AppSplashScreen : IApplicationSplashScreen
{
public static bool IsInitialized = false;
@@ -1,17 +0,0 @@
namespace BD;
[AttributeUsage(AttributeTargets.All, Inherited = false)]
public sealed class MobiusAttribute : Attribute
{
public MobiusAttribute()
{
}
public MobiusAttribute(string str)
{
}
public bool Obsolete { get; set; }
}
@@ -6,7 +6,6 @@ namespace BD.WTTS.Services;
/// <summary>
/// 子进程的 IPC 服务实现
/// </summary>
[Mobius(Obsolete = true)]
public interface IPCSubProcessService : IDisposable
{
/// <summary>
@@ -1,17 +0,0 @@
namespace BD;
[AttributeUsage(AttributeTargets.All, Inherited = false)]
public sealed class MobiusAttribute : Attribute
{
public MobiusAttribute()
{
}
public MobiusAttribute(string str)
{
}
public bool Obsolete { get; set; }
}

Some files were not shown because too many files have changed in this diff Show More