From dd3431c312ecd766efb8e01567ce2d0060db65ca Mon Sep 17 00:00:00 2001 From: Li Date: Thu, 11 Jan 2024 21:29:23 +1300 Subject: [PATCH] Fix bugs --- ChovySign-CLI/ChovySign-CLI.csproj.user | 2 +- ChovySign-GUI/Global/BrowseButton.axaml.cs | 15 ++++++++++++--- ChovySign-GUI/Ps1/GameInfoSelector.axaml.cs | 9 ++++++--- ChovySign-GUI/Ps1/Ps1Tab.axaml.cs | 2 -- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/ChovySign-CLI/ChovySign-CLI.csproj.user b/ChovySign-CLI/ChovySign-CLI.csproj.user index dea5502..812fbc4 100644 --- a/ChovySign-CLI/ChovySign-CLI.csproj.user +++ b/ChovySign-CLI/ChovySign-CLI.csproj.user @@ -1,6 +1,6 @@  - <_LastSelectedProfileId>C:\Users\Li\Documents\git\Chovy-Sign-v2\ChovySign-CLI\Properties\PublishProfiles\Win64.pubxml + <_LastSelectedProfileId>C:\Users\Li\Desktop\git\chovy-sign\ChovySign-CLI\Properties\PublishProfiles\Linux64.pubxml \ No newline at end of file diff --git a/ChovySign-GUI/Global/BrowseButton.axaml.cs b/ChovySign-GUI/Global/BrowseButton.axaml.cs index 42352dc..a816733 100644 --- a/ChovySign-GUI/Global/BrowseButton.axaml.cs +++ b/ChovySign-GUI/Global/BrowseButton.axaml.cs @@ -176,19 +176,28 @@ namespace ChovySign_GUI.Global } } + public BrowseButton() { InitializeComponent(); - this.filePath.KeyUp += onKeyPress; + this.filePath.PropertyChanged += onPropertyChanged; this.extension = ""; this.fileTypeName = "All Files"; } - private void onKeyPress(object? sender, KeyEventArgs e) + private void onPropertyChanged(object? sender, AvaloniaPropertyChangedEventArgs e) { - OnFileChanged(new EventArgs()); + TextBox? txt = sender as TextBox; + if (txt is null) return; + + if (e.Property.Name == "Text") + { + if (txt.Text is null) return; + if (!ContainsFile) return; + OnFileChanged(new EventArgs()); + } } } } diff --git a/ChovySign-GUI/Ps1/GameInfoSelector.axaml.cs b/ChovySign-GUI/Ps1/GameInfoSelector.axaml.cs index a1cf6c0..16ccff1 100644 --- a/ChovySign-GUI/Ps1/GameInfoSelector.axaml.cs +++ b/ChovySign-GUI/Ps1/GameInfoSelector.axaml.cs @@ -99,9 +99,12 @@ namespace ChovySign_GUI.Ps1 Title = disc.DiscName; DiscId = disc.DiscId; - byte[] newCover = await Downloader.DownloadCover(disc); - loadIcon(newCover); - iconCache = newCover; + if (!File.Exists(this.iconFile.FilePath)) + { + byte[] newCover = await Downloader.DownloadCover(disc); + loadIcon(newCover); + iconCache = newCover; + } } catch (Exception e) { Window? currentWindow = this.VisualRoot as Window; diff --git a/ChovySign-GUI/Ps1/Ps1Tab.axaml.cs b/ChovySign-GUI/Ps1/Ps1Tab.axaml.cs index 3524cfa..c1f79cd 100644 --- a/ChovySign-GUI/Ps1/Ps1Tab.axaml.cs +++ b/ChovySign-GUI/Ps1/Ps1Tab.axaml.cs @@ -1,11 +1,9 @@ using Avalonia.Controls; -using Avalonia.Interactivity; using ChovySign_GUI.Global; using ChovySign_GUI.Popup.Global; using ChovySign_GUI.Settings; using GameBuilder.Psp; using LibChovy; -using LibChovy.Config; using System; using System.Linq; using Vita.ContentManager;