From 81fad5455fb911b5cb78e513dab90cb29d724f07 Mon Sep 17 00:00:00 2001
From: Color_yr <402067010@qq.com>
Date: Tue, 24 Dec 2024 19:22:20 +0800
Subject: [PATCH] =?UTF-8?q?up=20=E4=BF=AE=E6=94=B9=E5=BE=88=E5=A4=9A?=
=?UTF-8?q?=E4=B8=9C=E8=A5=BF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.vscode/settings.json | 3 +
log.md | 16 +-
src/ColorMC.Core/CoreMain.cs | 5 +-
src/ColorMC.Core/Game/Mods.cs | 14 +-
src/ColorMC.Core/Helpers/CheckHelpers.cs | 1 +
src/ColorMC.Core/Helpers/ModPackHelper.cs | 23 +-
src/ColorMC.Core/Helpers/PathHelper.cs | 2 +-
src/ColorMC.Core/Hook/Win32.cs | 7 +-
src/ColorMC.Core/Net/Login/LegacyLogin.cs | 2 +-
src/ColorMC.Gui/ColorMC.Gui.csproj | 4 +
src/ColorMC.Gui/Manager/ImageManager.cs | 15 +-
src/ColorMC.Gui/Manager/WindowManager.cs | 17 +-
.../MusicPlayer/Decoder/Mp3/Bitstream.cs | 54 ++--
.../Decoder/Mp3/BitstreamErrors.cs | 2 +-
.../Decoder/Mp3/BitstreamException.cs | 6 +-
.../MusicPlayer/Decoder/Mp3/Header.cs | 22 +-
.../MusicPlayer/Decoder/Mp3/LayerIDecoder.cs | 28 +-
.../MusicPlayer/Decoder/Mp3/LayerIIDecoder.cs | 24 +-
.../Decoder/Mp3/LayerIIIDecoder.cs | 4 +-
.../MusicPlayer/Decoder/Mp3/Mp3Decoder.cs | 22 +-
.../MusicPlayer/Decoder/Mp3/Mp3Id3.cs | 153 +++++++++
src/ColorMC.Gui/MusicPlayer/Media.cs | 39 +--
src/ColorMC.Gui/Objs/FlyoutMenuObj.cs | 3 -
src/ColorMC.Gui/Resource/Icon/book.svg | 17 +-
src/ColorMC.Gui/Resource/Icon/count.svg | 27 +-
src/ColorMC.Gui/Resource/Icon/setting.svg | 17 +-
.../Resource/Language/gui_zh-cn.json | 9 +-
src/ColorMC.Gui/Resource/Pic/update.png | Bin 0 -> 3755 bytes
src/ColorMC.Gui/Resource/Pic/update1.png | Bin 0 -> 4021 bytes
.../UI/Animations/CardAnimation.cs | 71 +++++
.../UI/Animations/ItemAnimation.cs | 13 +-
.../UI/Controls/Add/AddControl.axaml.cs | 3 -
.../UI/Controls/Add/AddGameControl.axaml.cs | 4 -
.../UI/Controls/Add/AddJavaControl.axaml.cs | 2 -
.../Controls/Add/AddModPackControl.axaml.cs | 3 -
.../UI/Controls/BaseUserControl.cs | 5 +
.../UI/Controls/Count/CountControl.axaml.cs | 5 -
.../Dialog/NbtDialogEditControl.axaml.cs | 1 -
.../Download/DownloadControl.axaml.cs | 5 -
.../UI/Controls/Error/ErrorControl.axaml.cs | 5 -
.../GameCloud/GameCloudControl.axaml.cs | 7 +-
.../GameConfigEditControl.axaml.cs | 3 -
.../GameEdit/GameEditControl.axaml.cs | 4 -
.../Controls/GameEdit/Tab10Control.axaml.cs | 1 -
.../Controls/GameEdit/Tab11Control.axaml.cs | 1 -
.../Controls/GameEdit/Tab12Control.axaml.cs | 1 -
.../UI/Controls/GameEdit/Tab4Control.axaml.cs | 1 -
.../GameExport/GameExportControl.axaml.cs | 2 -
.../Controls/GameLog/GameLogControl.axaml.cs | 2 -
.../Controls/Items/FileItemControl.axaml.cs | 7 +-
.../UI/Controls/Items/GameControl.axaml.cs | 64 ----
.../Items/ResourcePackControl.axaml.cs | 1 -
.../Controls/Items/ScreenshotControl.axaml.cs | 1 -
.../Controls/Items/WorldCloudControl.axaml.cs | 1 -
.../UI/Controls/Main/Cards/LastControl.axaml | 47 +++
.../Controls/Main/Cards/LastControl.axaml.cs | 30 ++
.../UI/Controls/Main/Cards/MusicControl.axaml | 120 +++++++
.../Controls/Main/Cards/MusicControl.axaml.cs | 30 ++
.../UI/Controls/Main/Cards/NewsControl.axaml | 88 +++++
.../Controls/Main/Cards/NewsControl.axaml.cs | 39 +++
.../Controls/Main/Cards/OnlineControl.axaml | 32 ++
.../Main/Cards/OnlineControl.axaml.cs | 30 ++
.../Controls/Main/Cards/UpdateControl.axaml | 44 +++
.../Main/Cards/UpdateControl.axaml.cs | 30 ++
.../UI/Controls/Main/Live2dRender.cs | 1 -
.../UI/Controls/Main/MainControl.axaml | 300 ++++--------------
.../UI/Controls/Main/MainControl.axaml.cs | 41 ++-
.../UI/Controls/Main/MainUserControl.axaml | 11 +-
.../Controls/Main/MinecraftNewsControl.axaml | 36 ---
.../Main/MinecraftNewsControl.axaml.cs | 11 -
.../UI/Controls/MenuControl.axaml.cs | 1 -
.../UI/Controls/NetFrp/NetFrpControl.axaml.cs | 2 -
.../Controls/News/MinecraftNewsControl.axaml | 38 +++
.../News/MinecraftNewsControl.axaml.cs | 40 +++
.../ServerPack/ServerPackControl.axaml.cs | 2 -
.../Controls/ServerPack/Tab4Control.axaml.cs | 1 -
.../UI/Controls/Setting/SettingControl.cs | 2 -
.../UI/Controls/Setting/Tab3Control.axaml.cs | 1 -
.../UI/Controls/Setting/Tab5Control.axaml.cs | 1 -
.../UI/Controls/Setting/Tab6Control.axaml.cs | 1 -
.../UI/Controls/Setting/Tab8Control.axaml.cs | 1 -
.../UI/Controls/Skin/OpenGL/SkinRender.cs | 1 -
.../UI/Controls/Skin/SkinControl.axaml.cs | 1 -
.../UI/Controls/User/UsersControl.axaml.cs | 5 -
src/ColorMC.Gui/UI/Flyouts/GameEditFlyout1.cs | 4 +-
src/ColorMC.Gui/UI/Flyouts/GameEditFlyout5.cs | 3 +-
src/ColorMC.Gui/UI/Flyouts/Live2DFlyout.cs | 7 +-
src/ColorMC.Gui/UI/Flyouts/MainFlyout.cs | 6 +-
src/ColorMC.Gui/UI/Model/Add/AddGameModel.cs | 1 -
.../UI/Model/Items/GameItemModel.cs | 11 +
.../UI/Model/Main/GameListModel.cs | 39 ++-
src/ColorMC.Gui/UI/Model/Main/MainModel.cs | 140 +-------
.../UI/Model/Main/MinecraftNewsModel.cs | 55 ++--
src/ColorMC.Gui/UI/Model/Main/MusicModel.cs | 83 +++++
src/ColorMC.Gui/UI/Model/Main/UpdateModel.cs | 78 +++++
.../UI/Model/News/MinecraftNewsModel.cs | 72 +++++
.../UI/Model/Setting/SettingModel.cs | 2 +-
.../UI/Model/Setting/SettingTab6Model.cs | 2 +-
src/ColorMC.Gui/UI/Model/User/UsersModel.cs | 2 +-
.../UI/Views/WrapPanelWithStretch.cs | 1 -
src/ColorMC.Gui/UI/Windows/ABaseWindow.cs | 4 +-
src/ColorMC.Gui/UI/Windows/ITopWindow.cs | 2 +-
.../UI/Windows/MultiWindow.axaml.cs | 1 -
.../UI/Windows/SingleControl.axaml.cs | 6 +-
src/ColorMC.Gui/UIBinding/BaseBinding.cs | 22 +-
src/ColorMC.Gui/UIBinding/ConfigBinding.cs | 1 -
src/ColorMC.Gui/UIBinding/GameBinding.cs | 2 +-
src/ColorMC.Gui/Utils/GuiConfigUtils.cs | 3 +-
src/ColorMC.Gui/Utils/LaunchSocketUtils.cs | 1 -
109 files changed, 1472 insertions(+), 812 deletions(-)
create mode 100644 .vscode/settings.json
create mode 100644 src/ColorMC.Gui/MusicPlayer/Decoder/Mp3/Mp3Id3.cs
create mode 100644 src/ColorMC.Gui/Resource/Pic/update.png
create mode 100644 src/ColorMC.Gui/Resource/Pic/update1.png
create mode 100644 src/ColorMC.Gui/UI/Animations/CardAnimation.cs
create mode 100644 src/ColorMC.Gui/UI/Controls/Main/Cards/LastControl.axaml
create mode 100644 src/ColorMC.Gui/UI/Controls/Main/Cards/LastControl.axaml.cs
create mode 100644 src/ColorMC.Gui/UI/Controls/Main/Cards/MusicControl.axaml
create mode 100644 src/ColorMC.Gui/UI/Controls/Main/Cards/MusicControl.axaml.cs
create mode 100644 src/ColorMC.Gui/UI/Controls/Main/Cards/NewsControl.axaml
create mode 100644 src/ColorMC.Gui/UI/Controls/Main/Cards/NewsControl.axaml.cs
create mode 100644 src/ColorMC.Gui/UI/Controls/Main/Cards/OnlineControl.axaml
create mode 100644 src/ColorMC.Gui/UI/Controls/Main/Cards/OnlineControl.axaml.cs
create mode 100644 src/ColorMC.Gui/UI/Controls/Main/Cards/UpdateControl.axaml
create mode 100644 src/ColorMC.Gui/UI/Controls/Main/Cards/UpdateControl.axaml.cs
delete mode 100644 src/ColorMC.Gui/UI/Controls/Main/MinecraftNewsControl.axaml
delete mode 100644 src/ColorMC.Gui/UI/Controls/Main/MinecraftNewsControl.axaml.cs
create mode 100644 src/ColorMC.Gui/UI/Controls/News/MinecraftNewsControl.axaml
create mode 100644 src/ColorMC.Gui/UI/Controls/News/MinecraftNewsControl.axaml.cs
create mode 100644 src/ColorMC.Gui/UI/Model/Main/MusicModel.cs
create mode 100644 src/ColorMC.Gui/UI/Model/Main/UpdateModel.cs
create mode 100644 src/ColorMC.Gui/UI/Model/News/MinecraftNewsModel.cs
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 000000000..d09a50ca3
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "svg.preview.background": "transparent"
+}
\ No newline at end of file
diff --git a/log.md b/log.md
index 276a93835..6e16528df 100644
--- a/log.md
+++ b/log.md
@@ -5,8 +5,22 @@
- 加入OpenP2P
- 加入hal映射
+## 已知问题
+- 日志窗口与主窗口启动数据不同步
+- 游戏其他失败后不能再次启动
+- 游戏取消启动处理错误
+
## 已完成 Done
-### 2024.12.22
+### 2024.12.24
+- 修复游戏无法启动问题
+- 修复自定义加载器问题
+- 调整启动器背景音乐播放逻辑
+- 调整启动器主界面图标
+- 调整启动器主界面布局
+- 调整Minecraft News显示方式
+- 添加MP3ID3读取
+
+### 2024.12.22(A34)
- 修复皮肤显示问题
- 修复登录会产生的崩溃
diff --git a/src/ColorMC.Core/CoreMain.cs b/src/ColorMC.Core/CoreMain.cs
index d272e7ae4..77afe88a8 100644
--- a/src/ColorMC.Core/CoreMain.cs
+++ b/src/ColorMC.Core/CoreMain.cs
@@ -16,7 +16,7 @@ public static class ColorMCCore
{
public const int VersionNum = 34;
public const string TopVersion = "A34";
- public const string DateVersion = "20241222";
+ public const string DateVersion = "20241224";
///
/// 版本号
@@ -159,7 +159,8 @@ public static class ColorMCCore
/// 手机端启动
///
public static Func,
- Dictionary, IGameHandel> PhoneGameLaunch { internal get; set; }
+ Dictionary, IGameHandel> PhoneGameLaunch
+ { internal get; set; }
///
/// 手机端Jvm安装
///
diff --git a/src/ColorMC.Core/Game/Mods.cs b/src/ColorMC.Core/Game/Mods.cs
index 207988233..231b9d702 100644
--- a/src/ColorMC.Core/Game/Mods.cs
+++ b/src/ColorMC.Core/Game/Mods.cs
@@ -459,7 +459,7 @@ private static async Task CheckJarInJarAsync(ModObj obj, ZipFile zFile)
}
catch
{
-
+
}
}
@@ -577,8 +577,8 @@ private static async Task CheckJarInJarAsync(ModObj obj, ZipFile zFile)
istest = true;
}
catch
- {
-
+ {
+
}
}
}
@@ -641,9 +641,9 @@ private static async Task CheckJarInJarAsync(ModObj obj, ZipFile zFile)
istest = true;
}
- catch
+ catch
{
-
+
}
}
}
@@ -695,8 +695,8 @@ private static async Task CheckJarInJarAsync(ModObj obj, ZipFile zFile)
istest = true;
}
catch
- {
-
+ {
+
}
}
}
diff --git a/src/ColorMC.Core/Helpers/CheckHelpers.cs b/src/ColorMC.Core/Helpers/CheckHelpers.cs
index 9fc52639b..9073058db 100644
--- a/src/ColorMC.Core/Helpers/CheckHelpers.cs
+++ b/src/ColorMC.Core/Helpers/CheckHelpers.cs
@@ -445,6 +445,7 @@ public static async Task> CheckGameFileAsync(this
var item = node.Value;
if (item.Path != "mods")
{
+ node = node.Next;
array.Remove(item);
continue;
}
diff --git a/src/ColorMC.Core/Helpers/ModPackHelper.cs b/src/ColorMC.Core/Helpers/ModPackHelper.cs
index d61194fdb..84265fabc 100644
--- a/src/ColorMC.Core/Helpers/ModPackHelper.cs
+++ b/src/ColorMC.Core/Helpers/ModPackHelper.cs
@@ -434,13 +434,22 @@ public static async Task InstallCurseForgeModPackAsync(InstallModPackZi
arg.Name = $"{info.Name}-{info.Version}";
}
+ var gameversion = info.Minecraft.Version;
+ if (VersionPath.CheckUpdateAsync(gameversion) == null)
+ {
+ await VersionPath.GetFromWebAsync();
+ if (VersionPath.CheckUpdateAsync(gameversion) == null)
+ {
+ return new();
+ }
+ }
//创建游戏实例
var game = new GameSettingObj()
{
GroupName = arg.Group,
Name = arg.Name,
- Version = info.Minecraft.Version,
+ Version = gameversion,
ModPack = true,
Loader = loaders,
ModPackType = SourceType.CurseForge,
@@ -828,6 +837,16 @@ public static async Task InstallModrinthModPackAsync(InstallModPackZipA
arg.Name = $"{info.Name}-{info.VersionId}";
}
+ var gameversion = info.Dependencies["minecraft"];
+ if (VersionPath.CheckUpdateAsync(gameversion) == null)
+ {
+ await VersionPath.GetFromWebAsync();
+ if (VersionPath.CheckUpdateAsync(gameversion) == null)
+ {
+ return new();
+ }
+ }
+
//创建游戏实例
var game = await InstancesPath.CreateGame(new CreateGameArg
{
@@ -835,7 +854,7 @@ public static async Task InstallModrinthModPackAsync(InstallModPackZipA
{
GroupName = arg.Group,
Name = arg.Name,
- Version = info.Dependencies["minecraft"],
+ Version = gameversion,
ModPack = true,
ModPackType = SourceType.Modrinth,
Loader = loaders,
diff --git a/src/ColorMC.Core/Helpers/PathHelper.cs b/src/ColorMC.Core/Helpers/PathHelper.cs
index 688c1e49f..3cdae54ad 100644
--- a/src/ColorMC.Core/Helpers/PathHelper.cs
+++ b/src/ColorMC.Core/Helpers/PathHelper.cs
@@ -77,7 +77,7 @@ public static Task MoveToTrash(string dir)
}
catch
{
-
+
}
return false;
diff --git a/src/ColorMC.Core/Hook/Win32.cs b/src/ColorMC.Core/Hook/Win32.cs
index 76977087e..7673180fb 100644
--- a/src/ColorMC.Core/Hook/Win32.cs
+++ b/src/ColorMC.Core/Hook/Win32.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Threading.Tasks;
+using System.Runtime.InteropServices;
namespace ColorMC.Core.Hook;
diff --git a/src/ColorMC.Core/Net/Login/LegacyLogin.cs b/src/ColorMC.Core/Net/Login/LegacyLogin.cs
index 0a053691a..c363326c6 100644
--- a/src/ColorMC.Core/Net/Login/LegacyLogin.cs
+++ b/src/ColorMC.Core/Net/Login/LegacyLogin.cs
@@ -108,7 +108,7 @@ public static async Task AuthenticateAsync(string server, string
return new LegacyLoginRes
{
State = LoginState.Done,
- Auth = new()
+ Auth = new()
{
UserName = obj2.SelectedProfile.Name,
UUID = obj2.SelectedProfile.Id,
diff --git a/src/ColorMC.Gui/ColorMC.Gui.csproj b/src/ColorMC.Gui/ColorMC.Gui.csproj
index f491e2922..92db11c62 100644
--- a/src/ColorMC.Gui/ColorMC.Gui.csproj
+++ b/src/ColorMC.Gui/ColorMC.Gui.csproj
@@ -175,6 +175,8 @@
+
+
@@ -304,6 +306,7 @@
+
@@ -317,6 +320,7 @@
+