From 68feb5c409c185f6d52f730b0d3a57a8b2561fce Mon Sep 17 00:00:00 2001 From: ZouJin Date: Fri, 17 Feb 2023 22:42:07 +1100 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E6=84=8F=E5=B7=A5=E5=9D=8A=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Core/Handle/Function.cs | 2 +- .../WinDesign/winConsole.xaml | 2 +- .../WinDesign/winGameSetting.xaml | 4 +-- .../WinDesign/winGameSetting.xaml.cs | 29 ++++++++++++++----- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/VPet-Simulator.Core/Handle/Function.cs b/VPet-Simulator.Core/Handle/Function.cs index cb79d5e..2a1786f 100644 --- a/VPet-Simulator.Core/Handle/Function.cs +++ b/VPet-Simulator.Core/Handle/Function.cs @@ -18,7 +18,7 @@ namespace VPet_Simulator.Core /// public static Brush ResourcesBrush(BrushType name) { - return (Brush)Application.Current.Resources.MergedDictionaries.Last()[name.ToString()]; + return (Brush)Application.Current.Resources.MergedDictionaries.First()[name.ToString()]; } public enum BrushType { diff --git a/VPet-Simulator.Windows/WinDesign/winConsole.xaml b/VPet-Simulator.Windows/WinDesign/winConsole.xaml index f321553..64f55a7 100644 --- a/VPet-Simulator.Windows/WinDesign/winConsole.xaml +++ b/VPet-Simulator.Windows/WinDesign/winConsole.xaml @@ -3,7 +3,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:local="clr-namespace:VPet_Simulator.Windows" mc:Ignorable="d" Title="桌宠管理控制台" Height="450" Width="450" + xmlns:local="clr-namespace:VPet_Simulator.Windows" mc:Ignorable="d" Title="桌宠管理开发控制台" Height="450" Width="450" FontSize="16"> diff --git a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml index bc0216a..6ac4302 100644 --- a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml +++ b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml @@ -448,11 +448,11 @@ + MouseDown="ButtonPublish_MouseDown" /> + MouseDown="ButtonSteam_MouseDown" /> 核心文件,无法发布\n如需发布自定义内容,请复制并更改名称", "MOD上传失败", MessageBoxIcon.Error); return; } + if (!File.Exists(mod.Path.FullName + @"\icon.png") || new FileInfo(mod.Path.FullName + @"\icon.png").Length > 524288) + { + MessageBoxX.Show("封面图片(icon.png)大于500kb,请修改后重试", "MOD上传失败", MessageBoxIcon.Error); + return; + } #if DEMO MessageBoxX.Show("经测试,除正式版均无创意工坊权限,此功能仅作为展示", "特殊版无法上传创意工坊"); #endif @@ -349,23 +357,28 @@ namespace VPet_Simulator.Windows .WithDescription(mod.Intro) .WithPublicVisibility() .WithPreviewFile(mod.Path.FullName + @"\icon.png") - .WithContent(mod.Path); - //foreach (string tag in mod.Content.Trim('\n').Split('\n')) - // result.WithTag(tag); + .WithContent(mod.Path.FullName); + foreach (string tag in mod.Content.Trim('\n').Split('\n')) + result.WithTag(tag); var r = await result.SubmitAsync(new ProgressClass(ProgressBarUpload)); - + mod.AuthorID = Steamworks.SteamClient.SteamId.AccountId; + mod.WriteFile(); if (r.Success) { - mod.AuthorID = Steamworks.SteamClient.SteamId.AccountId; mod.ItemID = r.FileId.Value; mod.WriteFile(); + //ProgressBarUpload.Value = 0; + //await result.SubmitAsync(new ProgressClass(ProgressBarUpload)); if (MessageBoxX.Show($"{mod.Name} 成功上传至WorkShop服务器\n是否跳转至创意工坊页面进行编辑详细介绍和图标?", "MOD上传成功", MessageBoxButton.YesNo, MessageBoxIcon.Success) == MessageBoxResult.Yes) { System.Diagnostics.Process.Start("https://steamcommunity.com/sharedfiles/filedetails/?id=" + r.FileId); } } else - MessageBoxX.Show($"{mod.Name} 上传至WorkShop服务器失败\n请检查网络后重试\n请注意:上传和下载工坊物品可能需要良好的网络条件\n 如需代上传物品可以联系作者", $"MOD上传失败 {r.Result}"); + { + mod.AuthorID = 0; mod.WriteFile(); + MessageBoxX.Show($"{mod.Name} 上传至WorkShop服务器失败\n请检查网络后重试\n请注意:上传和下载工坊物品可能需要良好的网络条件\n失败原因:{r.Result}", $"MOD上传失败 {r.Result}"); + } } else if (mod.AuthorID == Steamworks.SteamClient.SteamId.AccountId) { @@ -386,7 +399,7 @@ namespace VPet_Simulator.Windows System.Diagnostics.Process.Start("https://steamcommunity.com/sharedfiles/filedetails/?id=" + r.FileId); } else - MessageBoxX.Show($"{mod.Name} 上传至WorkShop服务器失败\n请检查网络后重试\n请注意:上传和下载工坊物品可能需要良好的网络条件", "MOD更新失败", MessageBoxIcon.Error); + MessageBoxX.Show($"{mod.Name} 上传至WorkShop服务器失败\n请检查网络后重试\n请注意:上传和下载工坊物品可能需要良好的网络条件\n失败原因:{r.Result}", $"MOD更新失败 {r.Result}"); } ButtonPublish.IsEnabled = true; ButtonPublish.Text = "任务完成";