From 58b6de3d004c1dc3cd01dc0b741b4e29f01ab5d9 Mon Sep 17 00:00:00 2001
From: Li
Date: Fri, 12 Apr 2024 14:47:18 +1200
Subject: [PATCH] Get it working on .net 8.0 and latest avalonia!
---
ChovySign-CLI/ChovySign-CLI.csproj | 2 +-
.../Properties/PublishProfiles/Linux64.pubxml | 2 +-
.../Properties/PublishProfiles/Win64.pubxml | 2 +-
ChovySign-GUI/App.axaml | 202 ++++++++----------
ChovySign-GUI/ChovySign-GUI.csproj | 10 +-
ChovySign-GUI/Global/LabeledComboBox.axaml.cs | 4 +-
.../Popup/Global/CmaBackupPicker.axaml.cs | 4 +-
ChovySign-GUI/Settings/SettingsTab.axaml | 30 ++-
DiscUtils/DiscUtils.csproj | 2 +-
GameBuilder/GameBuilder.csproj | 2 +-
LiLib/LiLib.csproj | 2 +-
LibChovy/Art/Downloader.cs | 1 +
LibChovy/Art/Resizer.cs | 4 +-
LibChovy/ChovyStream.cs | 77 +++++++
LibChovy/LibChovy.csproj | 4 +-
PbpResign/PbpResign.csproj | 4 +-
.../PublishProfiles/FolderProfile.pubxml | 4 +-
PspCrypto/PspCrypto.csproj | 4 +-
Vita/Vita.csproj | 4 +-
19 files changed, 216 insertions(+), 148 deletions(-)
create mode 100644 LibChovy/ChovyStream.cs
diff --git a/ChovySign-CLI/ChovySign-CLI.csproj b/ChovySign-CLI/ChovySign-CLI.csproj
index 002e97a..c105fb0 100644
--- a/ChovySign-CLI/ChovySign-CLI.csproj
+++ b/ChovySign-CLI/ChovySign-CLI.csproj
@@ -2,7 +2,7 @@
Exe
- net6.0
+ net8.0
ChovySign_CLI
enable
enable
diff --git a/ChovySign-CLI/Properties/PublishProfiles/Linux64.pubxml b/ChovySign-CLI/Properties/PublishProfiles/Linux64.pubxml
index 862ba73..e96f70e 100644
--- a/ChovySign-CLI/Properties/PublishProfiles/Linux64.pubxml
+++ b/ChovySign-CLI/Properties/PublishProfiles/Linux64.pubxml
@@ -9,7 +9,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
bin\Release\Linux
FileSystem
<_TargetId>Folder
- net6.0
+ net8.0
linux-x64
true
true
diff --git a/ChovySign-CLI/Properties/PublishProfiles/Win64.pubxml b/ChovySign-CLI/Properties/PublishProfiles/Win64.pubxml
index fc063c7..d0b9003 100644
--- a/ChovySign-CLI/Properties/PublishProfiles/Win64.pubxml
+++ b/ChovySign-CLI/Properties/PublishProfiles/Win64.pubxml
@@ -9,7 +9,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
bin\Release\Windows
FileSystem
<_TargetId>Folder
- net6.0
+ net8.0
win-x64
true
true
diff --git a/ChovySign-GUI/App.axaml b/ChovySign-GUI/App.axaml
index 71d7a00..0d6bf4a 100644
--- a/ChovySign-GUI/App.axaml
+++ b/ChovySign-GUI/App.axaml
@@ -1,153 +1,123 @@
+ x:Class="ChovySign_GUI.App"
+ RequestedThemeVariant="Dark">
-
+
-
+
+
-
+
+
-
+
-
+
+
-
+
+
-
-
+
+
+
+
-
-
+
+
+
-
+
+
-
-
+
diff --git a/ChovySign-GUI/ChovySign-GUI.csproj b/ChovySign-GUI/ChovySign-GUI.csproj
index 1f0c11c..7670045 100644
--- a/ChovySign-GUI/ChovySign-GUI.csproj
+++ b/ChovySign-GUI/ChovySign-GUI.csproj
@@ -1,7 +1,7 @@
WinExe
- net6.0
+ net8.0
enable
true
app.manifest
@@ -39,11 +39,11 @@
-
-
+
+
-
-
+
+
diff --git a/ChovySign-GUI/Global/LabeledComboBox.axaml.cs b/ChovySign-GUI/Global/LabeledComboBox.axaml.cs
index b36f1e5..692ba56 100644
--- a/ChovySign-GUI/Global/LabeledComboBox.axaml.cs
+++ b/ChovySign-GUI/Global/LabeledComboBox.axaml.cs
@@ -54,13 +54,13 @@ namespace ChovySign_GUI.Global
{
get
{
- string[]? strings = this.comboBox.Items as string[];
+ string[]? strings = this.comboBox.ItemsSource as string[];
if (strings is null) return new string[0];
return strings;
}
set
{
- this.comboBox.Items = value;
+ this.comboBox.ItemsSource = value;
}
}
diff --git a/ChovySign-GUI/Popup/Global/CmaBackupPicker.axaml.cs b/ChovySign-GUI/Popup/Global/CmaBackupPicker.axaml.cs
index 671169f..993431e 100644
--- a/ChovySign-GUI/Popup/Global/CmaBackupPicker.axaml.cs
+++ b/ChovySign-GUI/Popup/Global/CmaBackupPicker.axaml.cs
@@ -170,7 +170,7 @@ namespace ChovySign_GUI.Popup.Global
private void reloadBackupsList()
{
this.selectBtn.IsEnabled = false;
- this.backupList.Items = new string[0];
+ this.backupList.ItemsSource = new string[0];
try
{
string[] gameBackupDirectories = GetAllDriectories(backupSearchFolders);
@@ -202,7 +202,7 @@ namespace ChovySign_GUI.Popup.Global
}
this.gameDirectories = filteredGameDirectories.ToArray();
- this.backupList.Items = gameList;
+ this.backupList.ItemsSource = gameList;
}
catch { }
}
diff --git a/ChovySign-GUI/Settings/SettingsTab.axaml b/ChovySign-GUI/Settings/SettingsTab.axaml
index 890b9e6..68afd43 100644
--- a/ChovySign-GUI/Settings/SettingsTab.axaml
+++ b/ChovySign-GUI/Settings/SettingsTab.axaml
@@ -18,15 +18,33 @@
-
+
-
+
-
+
-
+
diff --git a/DiscUtils/DiscUtils.csproj b/DiscUtils/DiscUtils.csproj
index 132c02c..30402ac 100644
--- a/DiscUtils/DiscUtils.csproj
+++ b/DiscUtils/DiscUtils.csproj
@@ -1,7 +1,7 @@
- net6.0
+ net8.0
enable
enable
diff --git a/GameBuilder/GameBuilder.csproj b/GameBuilder/GameBuilder.csproj
index 4534cb1..8f50189 100644
--- a/GameBuilder/GameBuilder.csproj
+++ b/GameBuilder/GameBuilder.csproj
@@ -1,7 +1,7 @@
- net6.0
+ net8.0
enable
enable
diff --git a/LiLib/LiLib.csproj b/LiLib/LiLib.csproj
index 132c02c..30402ac 100644
--- a/LiLib/LiLib.csproj
+++ b/LiLib/LiLib.csproj
@@ -1,7 +1,7 @@
- net6.0
+ net8.0
enable
enable
diff --git a/LibChovy/Art/Downloader.cs b/LibChovy/Art/Downloader.cs
index 4f60d1c..82b6264 100644
--- a/LibChovy/Art/Downloader.cs
+++ b/LibChovy/Art/Downloader.cs
@@ -1,4 +1,5 @@
using GameBuilder.Pops;
+using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Processing;
using System;
using System.Collections.Generic;
diff --git a/LibChovy/Art/Resizer.cs b/LibChovy/Art/Resizer.cs
index 8f35f83..f7f0b22 100644
--- a/LibChovy/Art/Resizer.cs
+++ b/LibChovy/Art/Resizer.cs
@@ -1,4 +1,6 @@
-using System;
+using SixLabors.ImageSharp;
+using SixLabors.ImageSharp.Processing;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
diff --git a/LibChovy/ChovyStream.cs b/LibChovy/ChovyStream.cs
new file mode 100644
index 0000000..bd45a34
--- /dev/null
+++ b/LibChovy/ChovyStream.cs
@@ -0,0 +1,77 @@
+using DiscUtils.Streams;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace LiLib
+{
+ public class ChovyStream : Stream
+ {
+ private Stream underylingStream;
+
+ public ChovyStream()
+ {
+ underylingStream = new MemoryStream();
+ }
+
+ public override bool CanRead {
+ get {
+ return underylingStream.CanRead;
+ }
+ }
+
+ public override bool CanSeek {
+ get {
+ return underylingStream.CanSeek;
+ }
+ }
+
+ public override bool CanWrite {
+ get {
+ return underylingStream.CanWrite;
+ }
+ }
+
+ public override long Length {
+ get {
+ return underylingStream.Length;
+ }
+ }
+
+ public override long Position {
+ get {
+ return underylingStream.Position;
+ }
+ set {
+ underylingStream.Position = value;
+ }
+ }
+
+ public override void Flush()
+ {
+ underylingStream.Flush();
+ }
+
+ public override int Read(byte[] buffer, int offset, int count)
+ {
+ return underylingStream.Read(buffer, offset, count);
+ }
+
+ public override long Seek(long offset, SeekOrigin origin)
+ {
+ return underylingStream.Seek(offset, origin);
+ }
+
+ public override void SetLength(long value)
+ {
+ underylingStream.SetLength(value);
+ }
+
+ public override void Write(byte[] buffer, int offset, int count)
+ {
+ underylingStream.Write(buffer, offset, count);
+ }
+ }
+}
diff --git a/LibChovy/LibChovy.csproj b/LibChovy/LibChovy.csproj
index 60b3eb0..964ad9a 100644
--- a/LibChovy/LibChovy.csproj
+++ b/LibChovy/LibChovy.csproj
@@ -2,13 +2,13 @@
Library
- net6.0
+ net8.0
enable
enable
-
+
diff --git a/PbpResign/PbpResign.csproj b/PbpResign/PbpResign.csproj
index ed087da..a160372 100644
--- a/PbpResign/PbpResign.csproj
+++ b/PbpResign/PbpResign.csproj
@@ -2,12 +2,12 @@
Exe
- net6.0
+ net8.0
true
-
+
diff --git a/PbpResign/Properties/PublishProfiles/FolderProfile.pubxml b/PbpResign/Properties/PublishProfiles/FolderProfile.pubxml
index c1ba699..4ef35fc 100644
--- a/PbpResign/Properties/PublishProfiles/FolderProfile.pubxml
+++ b/PbpResign/Properties/PublishProfiles/FolderProfile.pubxml
@@ -6,10 +6,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
Release
Any CPU
- bin\Release\net6.0\publish\win-x64\
+ bin\Release\net8.0\publish\win-x64\
FileSystem
<_TargetId>Folder
- net6.0
+ net8.0
win-x64
true
true
diff --git a/PspCrypto/PspCrypto.csproj b/PspCrypto/PspCrypto.csproj
index 12d46cb..e39d427 100644
--- a/PspCrypto/PspCrypto.csproj
+++ b/PspCrypto/PspCrypto.csproj
@@ -1,12 +1,12 @@
- net6.0
+ net8.0
true
-
+
diff --git a/Vita/Vita.csproj b/Vita/Vita.csproj
index 8820e9b..2a15aaa 100644
--- a/Vita/Vita.csproj
+++ b/Vita/Vita.csproj
@@ -1,13 +1,13 @@
- net6.0
+ net8.0
enable
enable
-
+