From 51a93d141465c1c3fe575acc3a8995e9a4e11e89 Mon Sep 17 00:00:00 2001 From: qe201020335 Date: Sat, 12 Oct 2024 22:06:20 -0400 Subject: [PATCH] Show currently installed version and author --- QuestPatcher/ViewModels/ModBrowser/ExternalModViewModel.cs | 6 +++++- QuestPatcher/Views/ModBrowser/ExternalModView.axaml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/QuestPatcher/ViewModels/ModBrowser/ExternalModViewModel.cs b/QuestPatcher/ViewModels/ModBrowser/ExternalModViewModel.cs index 70280f4..09e0bfa 100644 --- a/QuestPatcher/ViewModels/ModBrowser/ExternalModViewModel.cs +++ b/QuestPatcher/ViewModels/ModBrowser/ExternalModViewModel.cs @@ -22,7 +22,7 @@ public class ExternalModViewModel : ViewModelBase public string Id => Mod.Id; public string Name => Mod.Name; public string Description => Mod.Description; - public string Author => Mod.Author; + public string Author => $"(作者: {Mod.Author})"; public string Version => Mod.VersionString; private bool _isChecked; @@ -53,6 +53,8 @@ public string InstallButtonText public bool IsLatestInstalled => _installedMod != null && Mod.Version <= _installedMod.Version; public bool ShouldEnableButton => _locker.IsFree && !IsLatestInstalled; + + public string InstalledVersionText => _installedMod == null ? "(未安装)" : $"(已安装 {_installedMod.Version})"; private readonly object _installedModLock = new(); private IMod? _installedMod; @@ -103,6 +105,8 @@ public void UpdateInstallStatus(IMod? installedMod) InstallButtonText = current == null ? "安装" : (Mod.Version > current.Version ? "更新" : "已安装"); this.RaisePropertyChanged(nameof(ShouldEnableButton)); + this.RaisePropertyChanged(nameof(IsLatestInstalled)); + this.RaisePropertyChanged(nameof(InstalledVersionText)); } } diff --git a/QuestPatcher/Views/ModBrowser/ExternalModView.axaml b/QuestPatcher/Views/ModBrowser/ExternalModView.axaml index 3124dd0..766de09 100644 --- a/QuestPatcher/Views/ModBrowser/ExternalModView.axaml +++ b/QuestPatcher/Views/ModBrowser/ExternalModView.axaml @@ -32,6 +32,7 @@ +