Skip to content

Commit 81fad54

Browse files
committed
up 修改很多东西
1 parent e58c251 commit 81fad54

File tree

109 files changed

+1472
-812
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+1472
-812
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"svg.preview.background": "transparent"
3+
}

log.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,22 @@
55
- 加入OpenP2P
66
- 加入hal映射
77

8+
## 已知问题
9+
- 日志窗口与主窗口启动数据不同步
10+
- 游戏其他失败后不能再次启动
11+
- 游戏取消启动处理错误
12+
813
## 已完成 Done
9-
### 2024.12.22
14+
### 2024.12.24
15+
- 修复游戏无法启动问题
16+
- 修复自定义加载器问题
17+
- 调整启动器背景音乐播放逻辑
18+
- 调整启动器主界面图标
19+
- 调整启动器主界面布局
20+
- 调整Minecraft News显示方式
21+
- 添加MP3ID3读取
22+
23+
### 2024.12.22(A34)
1024
- 修复皮肤显示问题
1125
- 修复登录会产生的崩溃
1226

src/ColorMC.Core/CoreMain.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static class ColorMCCore
1616
{
1717
public const int VersionNum = 34;
1818
public const string TopVersion = "A34";
19-
public const string DateVersion = "20241222";
19+
public const string DateVersion = "20241224";
2020

2121
/// <summary>
2222
/// 版本号
@@ -159,7 +159,8 @@ public static class ColorMCCore
159159
/// 手机端启动
160160
/// </summary>
161161
public static Func<LoginObj, GameSettingObj, JavaInfo, List<string>,
162-
Dictionary<string, string>, IGameHandel> PhoneGameLaunch { internal get; set; }
162+
Dictionary<string, string>, IGameHandel> PhoneGameLaunch
163+
{ internal get; set; }
163164
/// <summary>
164165
/// 手机端Jvm安装
165166
/// </summary>

src/ColorMC.Core/Game/Mods.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ private static async Task CheckJarInJarAsync(ModObj obj, ZipFile zFile)
459459
}
460460
catch
461461
{
462-
462+
463463
}
464464
}
465465

@@ -577,8 +577,8 @@ private static async Task CheckJarInJarAsync(ModObj obj, ZipFile zFile)
577577
istest = true;
578578
}
579579
catch
580-
{
581-
580+
{
581+
582582
}
583583
}
584584
}
@@ -641,9 +641,9 @@ private static async Task CheckJarInJarAsync(ModObj obj, ZipFile zFile)
641641

642642
istest = true;
643643
}
644-
catch
644+
catch
645645
{
646-
646+
647647
}
648648
}
649649
}
@@ -695,8 +695,8 @@ private static async Task CheckJarInJarAsync(ModObj obj, ZipFile zFile)
695695
istest = true;
696696
}
697697
catch
698-
{
699-
698+
{
699+
700700
}
701701
}
702702
}

src/ColorMC.Core/Helpers/CheckHelpers.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ public static async Task<ConcurrentBag<DownloadItemObj>> CheckGameFileAsync(this
445445
var item = node.Value;
446446
if (item.Path != "mods")
447447
{
448+
node = node.Next;
448449
array.Remove(item);
449450
continue;
450451
}

src/ColorMC.Core/Helpers/ModPackHelper.cs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,13 +434,22 @@ public static async Task<GameRes> InstallCurseForgeModPackAsync(InstallModPackZi
434434
arg.Name = $"{info.Name}-{info.Version}";
435435
}
436436

437+
var gameversion = info.Minecraft.Version;
438+
if (VersionPath.CheckUpdateAsync(gameversion) == null)
439+
{
440+
await VersionPath.GetFromWebAsync();
441+
if (VersionPath.CheckUpdateAsync(gameversion) == null)
442+
{
443+
return new();
444+
}
445+
}
437446

438447
//创建游戏实例
439448
var game = new GameSettingObj()
440449
{
441450
GroupName = arg.Group,
442451
Name = arg.Name,
443-
Version = info.Minecraft.Version,
452+
Version = gameversion,
444453
ModPack = true,
445454
Loader = loaders,
446455
ModPackType = SourceType.CurseForge,
@@ -828,14 +837,24 @@ public static async Task<GameRes> InstallModrinthModPackAsync(InstallModPackZipA
828837
arg.Name = $"{info.Name}-{info.VersionId}";
829838
}
830839

840+
var gameversion = info.Dependencies["minecraft"];
841+
if (VersionPath.CheckUpdateAsync(gameversion) == null)
842+
{
843+
await VersionPath.GetFromWebAsync();
844+
if (VersionPath.CheckUpdateAsync(gameversion) == null)
845+
{
846+
return new();
847+
}
848+
}
849+
831850
//创建游戏实例
832851
var game = await InstancesPath.CreateGame(new CreateGameArg
833852
{
834853
Game = new GameSettingObj()
835854
{
836855
GroupName = arg.Group,
837856
Name = arg.Name,
838-
Version = info.Dependencies["minecraft"],
857+
Version = gameversion,
839858
ModPack = true,
840859
ModPackType = SourceType.Modrinth,
841860
Loader = loaders,

src/ColorMC.Core/Helpers/PathHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public static Task<bool> MoveToTrash(string dir)
7777
}
7878
catch
7979
{
80-
80+
8181
}
8282

8383
return false;

src/ColorMC.Core/Hook/Win32.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Runtime.InteropServices;
5-
using System.Text;
6-
using System.Threading.Tasks;
1+
using System.Runtime.InteropServices;
72

83
namespace ColorMC.Core.Hook;
94

src/ColorMC.Core/Net/Login/LegacyLogin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public static async Task<LegacyLoginRes> AuthenticateAsync(string server, string
108108
return new LegacyLoginRes
109109
{
110110
State = LoginState.Done,
111-
Auth = new()
111+
Auth = new()
112112
{
113113
UserName = obj2.SelectedProfile.Name,
114114
UUID = obj2.SelectedProfile.Id,

src/ColorMC.Gui/ColorMC.Gui.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@
175175
<None Remove="Resource\Pic\launch.png" />
176176
<None Remove="Resource\Pic\load.png" />
177177
<None Remove="Resource\Pic\pic1.png" />
178+
<None Remove="Resource\Pic\update.png" />
179+
<None Remove="Resource\Pic\update1.png" />
178180
</ItemGroup>
179181
<ItemGroup>
180182
<EmbeddedResource Include="icon.ico" />
@@ -304,6 +306,7 @@
304306
<AvaloniaResource Include="Resource\Icon\Setting\svg9.svg" />
305307
<AvaloniaResource Include="Resource\Icon\skin.svg" />
306308
<AvaloniaResource Include="Resource\Icon\pause.svg" />
309+
<EmbeddedResource Include="Resource\Pic\update.png" />
307310
<EmbeddedResource Include="Resource\Pic\1.png" />
308311
<EmbeddedResource Include="Resource\Pic\2.png" />
309312
<EmbeddedResource Include="Resource\Pic\3.png" />
@@ -317,6 +320,7 @@
317320
<EmbeddedResource Include="Resource\Pic\game.png" />
318321
<EmbeddedResource Include="Resource\Pic\launch.png" />
319322
<EmbeddedResource Include="Resource\Pic\load.png" />
323+
<EmbeddedResource Include="Resource\Pic\update1.png" />
320324
</ItemGroup>
321325
<ItemGroup>
322326
<!--This helps with theme dll-s trimming.

0 commit comments

Comments
 (0)