Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
VPet
提交
f986bf90
V
VPet
项目概览
jobily
/
VPet
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
VPet
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f986bf90
编写于
8月 16, 2023
作者:
Z
ZouJin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复上传mod时点击变换的bug
上级
4196fcea
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
28 addition
and
27 deletion
+28
-27
VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs
VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs
+28
-27
未找到文件。
VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs
浏览文件 @
f986bf90
...
...
@@ -460,17 +460,18 @@ namespace VPet_Simulator.Windows
}
private
async
void
ButtonPublish_MouseDown
(
object
sender
,
MouseButtonEventArgs
e
)
{
var
mods
=
mod
;
if
(!
mw
.
IsSteamUser
)
{
MessageBoxX
.
Show
(
"请先登录Steam后才能上传文件"
.
Translate
(),
"上传MOD需要Steam登录"
.
Translate
(),
MessageBoxIcon
.
Warning
);
return
;
}
if
(
mod
.
Name
.
ToLower
()
==
"core"
)
if
(
mod
s
.
Name
.
ToLower
()
==
"core"
)
{
MessageBoxX
.
Show
(
"模组 Core 为<虚拟桌宠模拟器>核心文件,无法发布\n如需发布自定义内容,请复制并更改名称"
.
Translate
(),
"MOD上传失败"
.
Translate
(),
MessageBoxIcon
.
Error
);
return
;
}
if
(!
File
.
Exists
(
mod
.
Path
.
FullName
+
@"\icon.png"
)
||
new
FileInfo
(
mod
.
Path
.
FullName
+
@"\icon.png"
).
Length
>
524288
)
if
(!
File
.
Exists
(
mod
s
.
Path
.
FullName
+
@"\icon.png"
)
||
new
FileInfo
(
mods
.
Path
.
FullName
+
@"\icon.png"
).
Length
>
524288
)
{
MessageBoxX
.
Show
(
"封面图片(icon.png)大于500kb,请修改后重试"
.
Translate
(),
"MOD上传失败"
.
Translate
(),
MessageBoxIcon
.
Error
);
return
;
...
...
@@ -482,59 +483,59 @@ namespace VPet_Simulator.Windows
ButtonPublish
.
Text
=
"正在上传"
;
ProgressBarUpload
.
Visibility
=
Visibility
.
Visible
;
ProgressBarUpload
.
Value
=
0
;
if
(
mod
.
ItemID
==
0
)
if
(
mod
s
.
ItemID
==
0
)
{
var
result
=
Editor
.
NewCommunityFile
.
WithTitle
(
mod
.
Name
)
.
WithDescription
(
mod
.
Intro
)
.
WithTitle
(
mod
s
.
Name
)
.
WithDescription
(
mod
s
.
Intro
)
.
WithPublicVisibility
()
.
WithPreviewFile
(
mod
.
Path
.
FullName
+
@"\icon.png"
)
.
WithContent
(
mod
.
Path
.
FullName
);
foreach
(
string
tag
in
mod
.
Tag
)
.
WithPreviewFile
(
mod
s
.
Path
.
FullName
+
@"\icon.png"
)
.
WithContent
(
mod
s
.
Path
.
FullName
);
foreach
(
string
tag
in
mod
s
.
Tag
)
result
.
WithTag
(
tag
);
var
r
=
await
result
.
SubmitAsync
(
new
ProgressClass
(
ProgressBarUpload
));
mod
.
AuthorID
=
Steamworks
.
SteamClient
.
SteamId
.
AccountId
;
mod
.
WriteFile
();
mod
s
.
AuthorID
=
Steamworks
.
SteamClient
.
SteamId
.
AccountId
;
mod
s
.
WriteFile
();
if
(
r
.
Success
)
{
mod
.
ItemID
=
r
.
FileId
.
Value
;
mod
.
WriteFile
();
mod
s
.
ItemID
=
r
.
FileId
.
Value
;
mod
s
.
WriteFile
();
//ProgressBarUpload.Value = 0;
//await result.SubmitAsync(new ProgressClass(ProgressBarUpload));
if
(
MessageBoxX
.
Show
(
"{0} 成功上传至WorkShop服务器\n是否跳转至创意工坊页面进行编辑详细介绍和图标?"
.
Translate
(
mod
.
Name
),
"MOD上传成功"
.
Translate
(),
MessageBoxButton
.
YesNo
,
MessageBoxIcon
.
Success
)
==
MessageBoxResult
.
Yes
)
if
(
MessageBoxX
.
Show
(
"{0} 成功上传至WorkShop服务器\n是否跳转至创意工坊页面进行编辑详细介绍和图标?"
.
Translate
(
mod
s
.
Name
),
"MOD上传成功"
.
Translate
(),
MessageBoxButton
.
YesNo
,
MessageBoxIcon
.
Success
)
==
MessageBoxResult
.
Yes
)
{
ExtensionSetting
.
StartURL
(
"https://steamcommunity.com/sharedfiles/filedetails/?id="
+
r
.
FileId
);
}
}
else
{
mod
.
AuthorID
=
0
;
mod
.
WriteFile
();
mod
s
.
AuthorID
=
0
;
mods
.
WriteFile
();
MessageBoxX
.
Show
(
"{0} 上传至WorkShop服务器失败\n请检查网络后重试\n请注意:上传和下载工坊物品可能需要良好的网络条件\n失败原因:{1}"
.
Translate
(
mod
.
Name
,
r
.
Result
),
"MOD上传失败 {0}"
.
Translate
(
r
.
Result
));
.
Translate
(
mod
s
.
Name
,
r
.
Result
),
"MOD上传失败 {0}"
.
Translate
(
r
.
Result
));
}
}
else
if
(
mod
.
AuthorID
==
Steamworks
.
SteamClient
.
SteamId
.
AccountId
)
else
if
(
mod
s
.
AuthorID
==
Steamworks
.
SteamClient
.
SteamId
.
AccountId
)
{
var
result
=
new
Editor
(
new
Steamworks
.
Data
.
PublishedFileId
()
{
Value
=
mod
.
ItemID
})
.
WithTitle
(
mod
.
Name
)
.
WithDescription
(
mod
.
Intro
)
.
WithPreviewFile
(
mod
.
Path
.
FullName
+
@"\icon.png"
)
.
WithContent
(
mod
.
Path
);
foreach
(
string
tag
in
mod
.
Tag
)
var
result
=
new
Editor
(
new
Steamworks
.
Data
.
PublishedFileId
()
{
Value
=
mod
s
.
ItemID
})
.
WithTitle
(
mod
s
.
Name
)
.
WithDescription
(
mod
s
.
Intro
)
.
WithPreviewFile
(
mod
s
.
Path
.
FullName
+
@"\icon.png"
)
.
WithContent
(
mod
s
.
Path
);
foreach
(
string
tag
in
mod
s
.
Tag
)
result
.
WithTag
(
tag
);
var
r
=
await
result
.
SubmitAsync
(
new
ProgressClass
(
ProgressBarUpload
));
if
(
r
.
Success
)
{
mod
.
AuthorID
=
Steamworks
.
SteamClient
.
SteamId
.
AccountId
;
mod
.
ItemID
=
r
.
FileId
.
Value
;
mod
.
WriteFile
();
if
(
MessageBoxX
.
Show
(
"{0} 成功上传至WorkShop服务器\n是否跳转至创意工坊页面进行编辑新内容?"
.
Translate
(
mod
.
Name
)
mod
s
.
AuthorID
=
Steamworks
.
SteamClient
.
SteamId
.
AccountId
;
mod
s
.
ItemID
=
r
.
FileId
.
Value
;
mod
s
.
WriteFile
();
if
(
MessageBoxX
.
Show
(
"{0} 成功上传至WorkShop服务器\n是否跳转至创意工坊页面进行编辑新内容?"
.
Translate
(
mod
s
.
Name
)
,
"MOD更新成功"
.
Translate
(),
MessageBoxButton
.
YesNo
,
MessageBoxIcon
.
Success
)
==
MessageBoxResult
.
Yes
)
ExtensionSetting
.
StartURL
(
"https://steamcommunity.com/sharedfiles/filedetails/?id="
+
r
.
FileId
);
}
else
MessageBoxX
.
Show
(
"{0} 上传至WorkShop服务器失败\n请检查网络后重试\n请注意:上传和下载工坊物品可能需要良好的网络条件\n失败原因:{1}"
.
Translate
(
mod
.
Name
,
r
.
Result
),
"MOD上传失败 {0}"
.
Translate
(
r
.
Result
));
.
Translate
(
mod
s
.
Name
,
r
.
Result
),
"MOD上传失败 {0}"
.
Translate
(
r
.
Result
));
}
ButtonPublish
.
IsEnabled
=
true
;
ButtonPublish
.
Text
=
"任务完成"
.
Translate
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录