From 0fa8efbfff1a3166b6fea9bd44a04981065ade37 Mon Sep 17 00:00:00 2001 From: rmbgame Date: Thu, 13 May 2021 03:21:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/Pages/About/About_ChangeLog.axaml | 12 +++ .../Pages/About/About_Changelog.axaml.cs | 78 +++++++++++++++++++ .../UI/Views/Pages/AboutPage.axaml | 37 +++++---- .../GameRelated_BorderlessPage.axaml | 1 - .../ST.Client.Desktop.Avalonia.csproj | 3 + .../UI/Resx/AppResources.Designer.cs | 9 +++ .../UI/Resx/AppResources.resx | 3 + 7 files changed, 125 insertions(+), 18 deletions(-) create mode 100644 src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/About/About_ChangeLog.axaml create mode 100644 src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/About/About_Changelog.axaml.cs diff --git a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/About/About_ChangeLog.axaml b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/About/About_ChangeLog.axaml new file mode 100644 index 000000000..8580f6bea --- /dev/null +++ b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/About/About_ChangeLog.axaml @@ -0,0 +1,12 @@ + + + + + + diff --git a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/About/About_Changelog.axaml.cs b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/About/About_Changelog.axaml.cs new file mode 100644 index 000000000..ecb4b68a0 --- /dev/null +++ b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/About/About_Changelog.axaml.cs @@ -0,0 +1,78 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.LogicalTree; +using Avalonia.Markup.Xaml; +using CefNet; +using System.Application.UI.Resx; +using System.Application.UI.Views.Controls; + +namespace System.Application.UI.Views.Pages +{ + public class About_ChangeLog : UserControl, IDisposable + { + readonly WebView3 webViewQA; + readonly ProgressRing webViewQALoading; + bool disposedValue; + + public About_ChangeLog() + { + InitializeComponent(); + + webViewQALoading = this.FindControl(nameof(webViewQALoading)); + webViewQA = this.FindControl(nameof(webViewQA)); + webViewQA.Opacity = 0; + webViewQA.LoadingStateChange += WebView_LoadingStateChange; + webViewQA.InitialUrl = string.Format( + "https://steampp.net/changelogbox?theme={0}&language={1}", + CefNetApp.GetTheme(), + R.Language); + } + + private void WebView_LoadingStateChange(object? sender, LoadingStateChangeEventArgs e) + { + if (!e.Busy) + { + if (webViewQA.Opacity != 1) webViewQA.Opacity = 1; + if (webViewQALoading.IsVisible) webViewQALoading.IsVisible = false; + } + } + + private void InitializeComponent() + { + AvaloniaXamlLoader.Load(this); + } + + protected override void OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs e) + { + base.OnDetachedFromLogicalTree(e); + Dispose(); + } + + protected virtual void Dispose(bool disposing) + { + if (!disposedValue) + { + if (disposing) + { + // TODO: 释放托管状态(托管对象) + if (webViewQA != null) + { + webViewQA.LoadingStateChange -= WebView_LoadingStateChange; + ((IDisposable)webViewQA).Dispose(); + } + } + + // TODO: 释放未托管的资源(未托管的对象)并替代终结器 + // TODO: 将大型字段设置为 null + disposedValue = true; + } + } + + public void Dispose() + { + // 不要更改此代码。请将清理代码放入“Dispose(bool disposing)”方法中 + Dispose(disposing: true); + GC.SuppressFinalize(this); + } + } +} \ No newline at end of file diff --git a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/AboutPage.axaml b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/AboutPage.axaml index 714825bd9..4e10e4d6c 100644 --- a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/AboutPage.axaml +++ b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/AboutPage.axaml @@ -8,21 +8,24 @@ mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="System.Application.UI.Views.Pages.AboutPage"> - - - - - - - - - - - - - - - - - \ No newline at end of file + + diff --git a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/GameRelated/GameRelated_BorderlessPage.axaml b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/GameRelated/GameRelated_BorderlessPage.axaml index ce5b9b859..3aad20567 100644 --- a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/GameRelated/GameRelated_BorderlessPage.axaml +++ b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/GameRelated/GameRelated_BorderlessPage.axaml @@ -79,7 +79,6 @@ diff --git a/src/ST.Client.Desktop.Avalonia/ST.Client.Desktop.Avalonia.csproj b/src/ST.Client.Desktop.Avalonia/ST.Client.Desktop.Avalonia.csproj index 7009abc74..84b2c965f 100644 --- a/src/ST.Client.Desktop.Avalonia/ST.Client.Desktop.Avalonia.csproj +++ b/src/ST.Client.Desktop.Avalonia/ST.Client.Desktop.Avalonia.csproj @@ -58,6 +58,9 @@ + + About_ChangeLog.axaml + GameRelatedPage.axaml diff --git a/src/ST.Client.Desktop/UI/Resx/AppResources.Designer.cs b/src/ST.Client.Desktop/UI/Resx/AppResources.Designer.cs index fa8f0ba1c..f76d94882 100644 --- a/src/ST.Client.Desktop/UI/Resx/AppResources.Designer.cs +++ b/src/ST.Client.Desktop/UI/Resx/AppResources.Designer.cs @@ -132,6 +132,15 @@ namespace System.Application.UI.Resx { } } + /// + /// 查找类似 更新日志 的本地化字符串。 + /// + public static string About_UpdateLog { + get { + return ResourceManager.GetString("About_UpdateLog", resourceCulture); + } + } + /// /// 查找类似 描述 的本地化字符串。 /// diff --git a/src/ST.Client.Desktop/UI/Resx/AppResources.resx b/src/ST.Client.Desktop/UI/Resx/AppResources.resx index d807e1c5a..c347376d2 100644 --- a/src/ST.Client.Desktop/UI/Resx/AppResources.resx +++ b/src/ST.Client.Desktop/UI/Resx/AppResources.resx @@ -141,6 +141,9 @@ 更新记录 + + 更新日志 + 成就管理