Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新功能:加入一系列简单的管理版本资源界面 #4770

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d932678
feat: 截图查看管理界面
tangge233 Sep 21, 2024
2aba4a9
fix: 截图不存在提示 & 查看版本错误
tangge233 Sep 21, 2024
832d0ec
fix: 复制文件而不是文件内容
tangge233 Sep 21, 2024
4b62cb1
feat: 存档查看
tangge233 Sep 21, 2024
6d915e2
feat: 复制图标
tangge233 Sep 21, 2024
26939cc
feat: 存档详细信息查看 & 操作按钮
tangge233 Sep 21, 2024
a7469e2
feat: 光影 & 资源包 界面
tangge233 Sep 21, 2024
ce1f45c
feat: 打开文件按钮
tangge233 Sep 21, 2024
e800b5a
feat: 截图图标
tangge233 Sep 21, 2024
fc81f94
feat: 截图图标
tangge233 Sep 21, 2024
5eb2bf4
feat: 调整顺序
tangge233 Sep 21, 2024
6c7fbcd
feat: 按钮居中
tangge233 Sep 21, 2024
62805dc
feat: 修改建议
tangge233 Sep 21, 2024
8000b3e
fix: 缓存目录创建与删除问题
tangge233 Sep 21, 2024
ad46cc1
Update Plain Craft Launcher 2/Pages/PageVersion/PageVersionScreenshot…
tangge233 Sep 21, 2024
668c83f
fix: 可能出现的复制错误
tangge233 Sep 21, 2024
a55e8cf
fix: 不合理的剪切板操作
tangge233 Sep 21, 2024
0665e81
feat: 粘贴按钮
tangge233 Sep 22, 2024
f8bebb5
fix: 文本描述
tangge233 Sep 22, 2024
688c884
Apply suggestions from code review
tangge233 Sep 22, 2024
2c3f87c
fix: UI 错误
tangge233 Sep 22, 2024
dfa2663
feat: 截图界面改进
tangge233 Sep 22, 2024
903fec8
Merge branch 'main' into InstanceResource
tangge233 Sep 22, 2024
8902ffd
chore: 调整界面
tangge233 Sep 22, 2024
eb52f3e
fix: 空值检查对象错误
tangge233 Sep 22, 2024
ca6c786
fix: 界面元素有时看不到
tangge233 Sep 22, 2024
62be47d
feat: 资源包展示支持文件夹类型
tangge233 Sep 23, 2024
7123f89
Apply suggestions from code review
tangge233 Sep 23, 2024
b5d721e
fix: 目录不存在时报错
tangge233 Sep 28, 2024
3accfe0
chore: 资源包使用内部自带描述
tangge233 Sep 28, 2024
3f0ed3a
chore: 加入 Try Catch
tangge233 Sep 28, 2024
e49f038
fix: 不合理的路径获取方式
tangge233 Sep 28, 2024
c15590c
Merge branch 'main' into InstanceResource
tangge233 Sep 28, 2024
cf56f94
chore: that's better
tangge233 Sep 29, 2024
7f5edb1
Merge branch 'main' into InstanceResource
tangge233 Oct 3, 2024
4f47ae3
chore: 序号后退,给导出整合包让位
tangge233 Oct 7, 2024
9e864b8
Merge branch 'Hex-Dragon:main' into InstanceResource
tangge233 Oct 13, 2024
a64d6f5
Merge branch 'main' into InstanceResource
tangge233 Oct 29, 2024
34c88a9
feat: 处理文件拖拽
tangge233 Nov 2, 2024
f71d493
Merge branch 'main' into InstanceResource
tangge233 Nov 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 41 additions & 2 deletions Plain Craft Launcher 2/FormMain.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,41 @@ Install:
End If
Exit Sub
End If
'处理资源安装
If PageCurrent = PageType.VersionSetup AndAlso {"zip"}.Any(Function(i) i = Extension) Then
Select Case PageCurrentSub
Case PageSubType.VersionWorld
Dim DestFolder = PageVersionLeft.Version.PathIndie + "saves\" + GetFileNameWithoutExtentionFromPath(FilePath)
If Directory.Exists(DestFolder) Then
Hint("发现同名文件夹,无法粘贴:" + DestFolder, HintType.Critical)
Exit Sub
End If
ExtractFile(FilePath, DestFolder)
Hint($"已导入 {GetFileNameWithoutExtentionFromPath(FilePath)}", HintType.Finish)
If FrmVersionWorld IsNot Nothing Then RunInUi(Sub() FrmVersionWorld.Reload())
Exit Sub
Case PageSubType.VersionResourcePack
Dim DestFile = PageVersionLeft.Version.PathIndie + "resourcepacks\" + GetFileNameFromPath(FilePath)
If File.Exists(DestFile) Then
Hint("已存在同名文件:" + DestFile, HintType.Critical)
Exit Sub
End If
CopyFile(FilePath, DestFile)
Hint($"已导入 {GetFileNameFromPath(FilePath)}", HintType.Finish)
If FrmVersionResourcePack IsNot Nothing Then RunInUi(Sub() FrmVersionResourcePack.Reload())
Exit Sub
Case PageSubType.VersionShader
Dim DestFile = PageVersionLeft.Version.PathIndie + "shaderpacks\" + GetFileNameFromPath(FilePath)
If File.Exists(DestFile) Then
Hint("已存在同名文件:" + DestFile, HintType.Critical)
Exit Sub
End If
CopyFile(FilePath, DestFile)
Hint($"已导入 {GetFileNameFromPath(FilePath)}", HintType.Finish)
If FrmVersionShader IsNot Nothing Then RunInUi(Sub() FrmVersionShader.Reload())
Exit Sub
End Select
End If
'安装整合包
If {"zip", "rar", "mrpack"}.Any(Function(t) t = Extension) Then '部分压缩包是 zip 格式但后缀为 rar,总之试一试
Log("[System] 文件为压缩包,尝试作为整合包安装")
Expand Down Expand Up @@ -967,8 +1002,12 @@ Install:
OtherTest = 2
VersionOverall = 0
VersionSetup = 1
VersionMod = 2
VersionModDisabled = 3
VersionWorld = 3
VersionScreenshot = 4
VersionMod = 5
VersionModDisabled = 6
VersionResourcePack = 7
VersionShader = 8
End Enum
''' <summary>
''' 获取次级页面的名称。若并非次级页面则返回空字符串,故可以以此判断是否为次级页面。
Expand Down
4 changes: 4 additions & 0 deletions Plain Craft Launcher 2/Modules/Base/ModBase.vb
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ Public Module ModBase
''' </summary>
Public Const IconButtonServer As String = "M224 160a64 64 0 0 0-64 64v576a64 64 0 0 0 64 64h576a64 64 0 0 0 64-64V224a64 64 0 0 0-64-64H224z m0 384h576v256H224v-256z m192 96v64h320v-64H416z m-128 0v64h64v-64H288zM224 224h576v256H224V224z m192 96v64h320v-64H416z m-128 0v64h64v-64H288z"
''' <summary>
''' 图标按钮,复制
''' </summary>
Public Const IconButtonCopy As String = "M394.666667 106.666667h448a74.666667 74.666667 0 0 1 74.666666 74.666666v448a74.666667 74.666667 0 0 1-74.666666 74.666667H394.666667a74.666667 74.666667 0 0 1-74.666667-74.666667V181.333333a74.666667 74.666667 0 0 1 74.666667-74.666666z m0 64a10.666667 10.666667 0 0 0-10.666667 10.666666v448a10.666667 10.666667 0 0 0 10.666667 10.666667h448a10.666667 10.666667 0 0 0 10.666666-10.666667V181.333333a10.666667 10.666667 0 0 0-10.666666-10.666666H394.666667z m245.333333 597.333333a32 32 0 0 1 64 0v74.666667a74.666667 74.666667 0 0 1-74.666667 74.666666H181.333333a74.666667 74.666667 0 0 1-74.666666-74.666666V394.666667a74.666667 74.666667 0 0 1 74.666666-74.666667h74.666667a32 32 0 0 1 0 64h-74.666667a10.666667 10.666667 0 0 0-10.666666 10.666667v448a10.666667 10.666667 0 0 0 10.666666 10.666666h448a10.666667 10.666667 0 0 0 10.666667-10.666666v-74.666667z"
''' <summary>
''' 图标,音符,1x
''' </summary>
Public Const IconMusic As String = "M348.293565 716.53287V254.797913c0-41.672348 28.004174-78.358261 68.919652-90.37913L815.994435 40.826435c62.775652-18.610087 125.907478 26.579478 125.907478 89.933913v539.158261c8.013913 42.25113-8.94887 89.177043-47.014956 127.109565a232.848696 232.848696 0 0 1-170.785392 65.758609c-61.885217-2.938435-111.081739-33.435826-129.113043-80.050087-18.031304-46.614261-2.137043-102.177391 41.672348-145.853218a232.848696 232.848696 0 0 1 170.785391-65.80313c21.014261 1.024 40.514783 5.164522 57.878261 12.065391V233.338435c0-12.109913-10.551652-20.034783-20.569044-20.034783a24.620522 24.620522 0 0 0-5.787826 0.934957L439.785739 338.18713a19.545043 19.545043 0 0 0-14.825739 19.144348v438.984348H423.846957c11.53113 43.987478-5.164522 94.208-45.412174 134.322087a232.848696 232.848696 0 0 1-170.785392 65.758609c-61.885217-2.938435-111.081739-33.435826-129.113043-80.050087-18.031304-46.614261-2.137043-102.177391 41.672348-145.853218a232.848696 232.848696 0 0 1 170.785391-65.80313c20.791652 1.024 40.069565 5.075478 57.299478 11.842783z"
Expand Down
4 changes: 4 additions & 0 deletions Plain Craft Launcher 2/Modules/ModMain.vb
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@ EndHint:
Public FrmVersionOverall As PageVersionOverall
Public FrmVersionMod As PageVersionMod
Public FrmVersionModDisabled As PageVersionModDisabled
Public FrmVersionScreenshot As PageVersionScreenshot
Public FrmVersionWorld As PageVersionWorld
Public FrmVersionShader As PageVersionShader
Public FrmVersionResourcePack As PageVersionResourcePack
Public FrmVersionSetup As PageVersionSetup

'资源信息分页声明
Expand Down
Loading