From dcd5ca94de0deca4a2c078d03e118a89b48c3b80 Mon Sep 17 00:00:00 2001 From: Coloryr <402067010@qq.com> Date: Tue, 16 Jul 2024 19:38:20 +0800 Subject: [PATCH] =?UTF-8?q?up=20=E4=BF=AE=E6=94=B9=E4=B8=BB=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ColorMC.Core/CoreMain.cs | 2 +- src/ColorMC.Gui/ColorMC.Gui.csproj | 3 + src/ColorMC.Gui/Manager/ThemeManager.cs | 6 +- src/ColorMC.Gui/Manager/WindowManager.cs | 6 +- .../Resource/Icon/Setting/svg16.svg | 3 +- .../Resource/Language/gui_zh-cn.json | 3 +- src/ColorMC.Gui/Style/DataGrid.axaml | 5 + .../UI/Controls/Add/AddControl.axaml | 70 ++- .../UI/Controls/Add/AddControl.axaml.cs | 6 + .../UI/Controls/Add/AddJavaControl.axaml | 3 +- .../UI/Controls/Add/AddModPackControl.axaml | 26 +- .../Controls/Add/AddModPackControl.axaml.cs | 2 + .../Dialog/NbtDialogEditControl.axaml | 3 +- .../GameConfigEditControl.axaml | 2 +- .../UI/Controls/GameEdit/Tab4Control.axaml | 7 +- .../UI/Controls/GameExport/Tab2Control.axaml | 9 +- .../UI/Controls/GameExport/Tab3Control.axaml | 2 +- .../UI/Controls/GameExport/Tab4Control.axaml | 7 +- .../Controls/Items/DownloadItemControl.axaml | 9 +- .../Controls/Items/FileItemControl.axaml.cs | 73 +++ .../UI/Controls/Items/GameControl.axaml | 12 +- .../Controls/Items/ResourcePackControl.axaml | 2 +- .../UI/Controls/Items/WorldCloudControl.axaml | 2 +- .../UI/Controls/Items/WorldControl.axaml | 2 +- .../UI/Controls/Main/GameGroupControl.axaml | 6 +- .../UI/Controls/Main/MainControl.axaml | 528 ++++++++---------- .../UI/Controls/Main/MainControl.axaml.cs | 52 +- .../UI/Controls/Main/MainEmptyControl.axaml | 6 +- .../UI/Controls/Main/MainGamesControl.axaml | 8 +- .../Controls/Main/MainGamesControl.axaml.cs | 1 - .../UI/Controls/Main/MainStartControl.axaml | 5 +- .../Controls/Main/MainStartControl.axaml.cs | 3 - .../UI/Controls/Main/MainUserControl.axaml | 103 ++++ .../UI/Controls/Main/MainUserControl.axaml.cs | 11 + .../Controls/Main/MinecraftNewsControl.axaml | 26 +- .../Main/MinecraftNewsControl.axaml.cs | 11 +- .../UI/Controls/ServerMotdControl.axaml | 6 +- .../UI/Controls/ServerPack/Tab2Control.axaml | 2 +- .../UI/Controls/ServerPack/Tab3Control.axaml | 2 +- .../UI/Controls/ServerPack/Tab4Control.axaml | 125 ++--- .../UI/Controls/Setting/Tab5Control.axaml | 163 +++--- .../UI/Controls/Setting/Tab6Control.axaml | 8 +- .../UI/Controls/Setting/Tab8Control.axaml | 8 +- .../UI/Controls/User/UsersControl.axaml | 2 +- .../UI/Controls/User/UsersControl.axaml.cs | 6 + .../UI/Model/GameEdit/GameEditTab10Model.cs | 5 +- .../UI/Model/Main/GameListModel.cs | 15 +- src/ColorMC.Gui/UI/Model/Main/MainModel.cs | 49 +- .../UI/Model/Setting/SettingTab6Model.cs | 1 + src/ColorMC.Gui/UI/Model/TopModel.cs | 4 +- src/ColorMC.Gui/UI/Model/User/UsersModel.cs | 17 + src/ColorMC.Gui/UI/Windows/AllControl.axaml | 2 +- .../UI/Windows/SelfBaseWindow.axaml | 5 +- src/ColorMC.Gui/UIBinding/BaseBinding.cs | 18 +- src/ColorMC.Gui/UIBinding/GameBinding.cs | 8 +- 55 files changed, 806 insertions(+), 665 deletions(-) create mode 100644 src/ColorMC.Gui/UI/Controls/Main/MainUserControl.axaml create mode 100644 src/ColorMC.Gui/UI/Controls/Main/MainUserControl.axaml.cs diff --git a/src/ColorMC.Core/CoreMain.cs b/src/ColorMC.Core/CoreMain.cs index 50897c6cb..ec1496836 100644 --- a/src/ColorMC.Core/CoreMain.cs +++ b/src/ColorMC.Core/CoreMain.cs @@ -15,7 +15,7 @@ namespace ColorMC.Core; public static class ColorMCCore { public const string TopVersion = "A27"; - public const string DateVersion = "20240715"; + public const string DateVersion = "20240716"; /// /// 版本号 diff --git a/src/ColorMC.Gui/ColorMC.Gui.csproj b/src/ColorMC.Gui/ColorMC.Gui.csproj index fdf2b7c8a..0ab75c607 100644 --- a/src/ColorMC.Gui/ColorMC.Gui.csproj +++ b/src/ColorMC.Gui/ColorMC.Gui.csproj @@ -333,4 +333,7 @@ + + + diff --git a/src/ColorMC.Gui/Manager/ThemeManager.cs b/src/ColorMC.Gui/Manager/ThemeManager.cs index 5152a47aa..a308a8132 100644 --- a/src/ColorMC.Gui/Manager/ThemeManager.cs +++ b/src/ColorMC.Gui/Manager/ThemeManager.cs @@ -406,7 +406,7 @@ static ThemeManager() ProgressBarBG = Brush.Parse("#FFe4e4e7"), MainGroupBG = Brush.Parse("#FFd4d4d8"), MainGroupBorder = Brush.Parse("#FFE0E0E0"), - ItemBG = Brush.Parse("#FFFFFFFF"), + ItemBG = Brush.Parse("#CFFFFFFF"), GameItemBG = Brush.Parse("#FFF2F2F2"), TopViewBG = Brush.Parse("#886D6D6D"), AllBorder = Brush.Parse("#FFe5e7eb"), @@ -426,7 +426,7 @@ static ThemeManager() ProgressBarBG = Brush.Parse("#FF3f3f46"), MainGroupBG = Brush.Parse("#FF27272a"), MainGroupBorder = Brush.Parse("#FFE0E0E0"), - ItemBG = Brush.Parse("#FF27272a"), + ItemBG = Brush.Parse("#CF27272a"), GameItemBG = Brush.Parse("#FFc7c7cb"), TopViewBG = Brush.Parse("#886D6D6D"), AllBorder = Brush.Parse("#FFe5e7eb"), @@ -434,7 +434,7 @@ static ThemeManager() TopBGColor = Brush.Parse("#FFF4F4F5"), TopGridColor = Brush.Parse("#FF202020"), OverBGColor = Brush.Parse("#FF000000"), - OverBrushColor = Brush.Parse("#FF1d1d1d") + OverBrushColor = Brush.Parse("#FF1d1d1d"), }; } } diff --git a/src/ColorMC.Gui/Manager/WindowManager.cs b/src/ColorMC.Gui/Manager/WindowManager.cs index 871ba84eb..4c153dc16 100644 --- a/src/ColorMC.Gui/Manager/WindowManager.cs +++ b/src/ColorMC.Gui/Manager/WindowManager.cs @@ -222,7 +222,7 @@ public static DownloadArg ShowDownload() }); } - public static void ShowUser(bool add = false, string? url = null) + public static void ShowUser(bool add = false, bool relogin = false, string? url = null) { if (UserWindow != null) { @@ -242,6 +242,10 @@ public static void ShowUser(bool add = false, string? url = null) { UserWindow?.Add(); } + if (relogin) + { + UserWindow?.Relogin(); + } } public static void ShowMain() diff --git a/src/ColorMC.Gui/Resource/Icon/Setting/svg16.svg b/src/ColorMC.Gui/Resource/Icon/Setting/svg16.svg index e6aa5baac..26c2c5a12 100644 --- a/src/ColorMC.Gui/Resource/Icon/Setting/svg16.svg +++ b/src/ColorMC.Gui/Resource/Icon/Setting/svg16.svg @@ -1,6 +1,5 @@ - - \ No newline at end of file diff --git a/src/ColorMC.Gui/Resource/Language/gui_zh-cn.json b/src/ColorMC.Gui/Resource/Language/gui_zh-cn.json index cb5380f79..1da24181a 100644 --- a/src/ColorMC.Gui/Resource/Language/gui_zh-cn.json +++ b/src/ColorMC.Gui/Resource/Language/gui_zh-cn.json @@ -14,7 +14,7 @@ "MainWindow.Text15": "发现启动器更新!", "MainWindow.Text16": "立即升级", "MainWindow.Text17": "更新日志", - "MainWindow.Text18": "映射大厅", + "MainWindow.Text18": "映射大厅 一起联机!", "MainWindow.Text19": "查看列表", "MainWindow.Text20": "Minecraft News", "MainWindow.Text21": "没有News", @@ -84,6 +84,7 @@ "MainWindow.Error5": "游戏实例复制失败", "MainWindow.Error6": "至少登录一个正版账户才能使用映射功能", "MainWindow.Error7": "未知用户类型", + "MainWindow.Error8": "{0}\n是否要重新登录账户", "UserWindow.Title": "用户列表", "UserWindow.DataGrid.Text1": "使用", "UserWindow.DataGrid.Text3": "账户类型", diff --git a/src/ColorMC.Gui/Style/DataGrid.axaml b/src/ColorMC.Gui/Style/DataGrid.axaml index 07e5b77c7..4dbc41908 100644 --- a/src/ColorMC.Gui/Style/DataGrid.axaml +++ b/src/ColorMC.Gui/Style/DataGrid.axaml @@ -21,10 +21,15 @@ @@ -57,7 +57,7 @@ - + diff --git a/src/ColorMC.Gui/UI/Controls/Main/MainControl.axaml b/src/ColorMC.Gui/UI/Controls/Main/MainControl.axaml index b46f5c0e2..9c7b7d454 100644 --- a/src/ColorMC.Gui/UI/Controls/Main/MainControl.axaml +++ b/src/ColorMC.Gui/UI/Controls/Main/MainControl.axaml @@ -15,7 +15,10 @@ x:DataType="model:MainModel" DragDrop.AllowDrop="True" mc:Ignorable="d"> - + @@ -30,121 +33,31 @@ Height="{Binding Live2dHeight}" HorizontalAlignment="{Binding L2dPos}" VerticalAlignment="{Binding L2dPos1}" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - + + + + - - - - - - + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + - + + + - + - - + + - - - + Width="40" + Margin="0,0,5,0" + HorizontalAlignment="Right" + Text="{Binding MusicVolume, StringFormat='{}{0}%', FallbackValue=100%}" /> + - - - - - - - - - - + + + - - - - - - - - - + + + + + + + + + diff --git a/src/ColorMC.Gui/UI/Controls/Main/MainUserControl.axaml.cs b/src/ColorMC.Gui/UI/Controls/Main/MainUserControl.axaml.cs new file mode 100644 index 000000000..efb2a6e4e --- /dev/null +++ b/src/ColorMC.Gui/UI/Controls/Main/MainUserControl.axaml.cs @@ -0,0 +1,11 @@ +using Avalonia.Controls; + +namespace ColorMC.Gui.UI.Controls.Main; + +public partial class MainUserControl : UserControl +{ + public MainUserControl() + { + InitializeComponent(); + } +} diff --git a/src/ColorMC.Gui/UI/Controls/Main/MinecraftNewsControl.axaml b/src/ColorMC.Gui/UI/Controls/Main/MinecraftNewsControl.axaml index 64a94181e..273cafa05 100644 --- a/src/ColorMC.Gui/UI/Controls/Main/MinecraftNewsControl.axaml +++ b/src/ColorMC.Gui/UI/Controls/Main/MinecraftNewsControl.axaml @@ -11,18 +11,16 @@ d:DesignWidth="800" x:DataType="model:MainModel" mc:Ignorable="d"> - - - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/src/ColorMC.Gui/UI/Controls/Main/MinecraftNewsControl.axaml.cs b/src/ColorMC.Gui/UI/Controls/Main/MinecraftNewsControl.axaml.cs index b83fd57aa..7c8f9d74f 100644 --- a/src/ColorMC.Gui/UI/Controls/Main/MinecraftNewsControl.axaml.cs +++ b/src/ColorMC.Gui/UI/Controls/Main/MinecraftNewsControl.axaml.cs @@ -1,12 +1,11 @@ using Avalonia.Controls; -namespace ColorMC.Gui.UI.Controls.Main +namespace ColorMC.Gui.UI.Controls.Main; + +public partial class MinecraftNewsControl : UserControl { - public partial class MinecraftNewsControl : UserControl + public MinecraftNewsControl() { - public MinecraftNewsControl() - { - InitializeComponent(); - } + InitializeComponent(); } } diff --git a/src/ColorMC.Gui/UI/Controls/ServerMotdControl.axaml b/src/ColorMC.Gui/UI/Controls/ServerMotdControl.axaml index ce9b1b7be..5751d8e7f 100644 --- a/src/ColorMC.Gui/UI/Controls/ServerMotdControl.axaml +++ b/src/ColorMC.Gui/UI/Controls/ServerMotdControl.axaml @@ -21,9 +21,9 @@