├── .gitattributes
├── .gitignore
├── Plain Craft Launcher Admin Manager
├── ApplicationEvents.vb
├── My Project
│ ├── Application.Designer.vb
│ ├── Application.myapp
│ ├── AssemblyInfo.vb
│ ├── Resources.Designer.vb
│ ├── Resources.resx
│ ├── Settings.Designer.vb
│ ├── Settings.settings
│ └── app.manifest
└── Plain Craft Launcher Admin Manager.vbproj
├── Plain Craft Launcher.sln
├── Plain Craft Launcher.vshost.exe.manifest
├── Plain Craft Launcher.xml
├── Plain Craft Launcher
├── Application.xaml
├── Application.xaml.vb
├── Base
│ ├── Button.xaml
│ ├── Button.xaml.vb
│ ├── Checkbox.xaml
│ ├── Checkbox.xaml.vb
│ ├── InfoBox.xaml
│ ├── InfoBox.xaml.vb
│ ├── ListItem.xaml
│ ├── ListItem.xaml.vb
│ ├── Loading.xaml
│ ├── Loading.xaml.vb
│ ├── MetroMsgbox.xaml
│ ├── MetroMsgbox.xaml.vb
│ ├── Modules.vb
│ ├── Radiobox.xaml
│ ├── Radiobox.xaml.vb
│ ├── RightList.xaml
│ ├── RightList.xaml.vb
│ ├── RoundProcessbar.xaml
│ ├── RoundProcessbar.xaml.vb
│ ├── Selecter.xaml
│ ├── Selecter.xaml.vb
│ ├── Timer.xaml
│ ├── Timer.xaml.vb
│ ├── VScroll.xaml
│ └── VScroll.xaml.vb
├── Images
│ ├── Back.png
│ ├── Block-Add.png
│ ├── Block-Anvil.png
│ ├── Block-CobbleStone.png
│ ├── Block-CommandBlock.png
│ ├── Block-Dirt.png
│ ├── Block-False.png
│ ├── Block-Glass.png
│ ├── Block-Grass.png
│ ├── Block-RedstoneBlock.png
│ ├── Block-Settings.png
│ ├── Block-True.png
│ ├── Checked-Black.png
│ ├── Checked-Blue.png
│ ├── Checked-Gray.png
│ ├── False.png
│ ├── Hint-Critical.png
│ ├── Hint-Finish.png
│ ├── Hint-Info.png
│ ├── Hint-Warn.png
│ ├── Infobox-Bg.png
│ ├── LeftBar-BG_Black.png
│ ├── LeftBar-BG_Blue.png
│ ├── LeftBar-BG_DeathBlue.png
│ ├── LeftBar-BG_Green.png
│ ├── LeftBar-BG_Hunluan.png
│ ├── LeftBar-BG_Orange.png
│ ├── Stats-Fail.png
│ ├── Stats-Finish.png
│ ├── Stats-Retry.png
│ ├── Stats-Running.png
│ ├── Stats-Wait.png
│ ├── True.png
│ ├── alex.png
│ ├── appbar.inbox.in.png
│ ├── appbar.settings.png
│ ├── icon.ico
│ ├── imgMusic.png
│ ├── imgTopClose.png
│ ├── imgTopMin.png
│ ├── infobox-blue.png
│ ├── infobox-brown.png
│ ├── infobox-green.png
│ ├── infobox-orange.png
│ ├── infobox-purple.png
│ ├── infobox-yellow.png
│ └── steve.png
├── My Project
│ ├── AssemblyInfo.vb
│ ├── MyExtensions
│ │ └── MyWpfExtension.vb
│ ├── Resources.Designer.vb
│ ├── Resources.resx
│ ├── Settings.Designer.vb
│ ├── Settings.settings
│ └── app.manifest
├── Pages
│ ├── formDownloadLeft.xaml
│ ├── formDownloadLeft.xaml.vb
│ ├── formDownloadRight.xaml
│ ├── formDownloadRight.xaml.vb
│ ├── formGuild.xaml
│ ├── formGuild.xaml.vb
│ ├── formHelpLeft.xaml
│ ├── formHelpLeft.xaml.vb
│ ├── formHomeLeft.xaml
│ ├── formHomeLeft.xaml.vb
│ ├── formHomeRight.xaml
│ ├── formHomeRight.xaml.vb
│ ├── formManageLeft.xaml
│ ├── formManageLeft.xaml.vb
│ ├── formSetup.xaml
│ └── formSetup.xaml.vb
├── Plain Craft Launcher.vbproj
├── PopupPage
│ ├── msgSource.xaml
│ ├── msgSource.xaml.vb
│ ├── msgVersion.xaml
│ └── msgVersion.xaml.vb
├── Resources
│ ├── Ionic.Zip.dll
│ ├── Newtonsoft.Json.dll
│ ├── Plain Craft Launcher Admin Manager.exe
│ ├── Plain Craft Launcher Admin Manager.vshost.exe
│ ├── Plain Craft Launcher Admin Manager.vshost.exe.manifest
│ ├── Plain Craft Launcher Admin Manager.xml
│ └── UpdateLog.txt
├── formBlueScreen.xaml
├── formBlueScreen.xaml.vb
├── formHint.xaml
├── formHint.xaml.vb
├── formMain.xaml
├── formMain.xaml.vb
├── formMain2.xaml
├── formMinecraft.xaml
├── formMinecraft.xaml.vb
├── formStart.xaml
├── formStart.xaml.vb
├── modMain.vb
└── modStart.vb
└── README.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Oo]ut/
33 | [Ll]og/
34 | [Ll]ogs/
35 |
36 | # Visual Studio 2015/2017 cache/options directory
37 | .vs/
38 | # Uncomment if you have tasks that create the project's static files in wwwroot
39 | #wwwroot/
40 |
41 | # Visual Studio 2017 auto generated files
42 | Generated\ Files/
43 |
44 | # MSTest test Results
45 | [Tt]est[Rr]esult*/
46 | [Bb]uild[Ll]og.*
47 |
48 | # NUnit
49 | *.VisualState.xml
50 | TestResult.xml
51 | nunit-*.xml
52 |
53 | # Build Results of an ATL Project
54 | [Dd]ebugPS/
55 | [Rr]eleasePS/
56 | dlldata.c
57 |
58 | # Benchmark Results
59 | BenchmarkDotNet.Artifacts/
60 |
61 | # .NET Core
62 | project.lock.json
63 | project.fragment.lock.json
64 | artifacts/
65 |
66 | # ASP.NET Scaffolding
67 | ScaffoldingReadMe.txt
68 |
69 | # StyleCop
70 | StyleCopReport.xml
71 |
72 | # Files built by Visual Studio
73 | *_i.c
74 | *_p.c
75 | *_h.h
76 | *.ilk
77 | *.meta
78 | *.obj
79 | *.iobj
80 | *.pch
81 | *.pdb
82 | *.ipdb
83 | *.pgc
84 | *.pgd
85 | *.rsp
86 | *.sbr
87 | *.tlb
88 | *.tli
89 | *.tlh
90 | *.tmp
91 | *.tmp_proj
92 | *_wpftmp.csproj
93 | *.log
94 | *.vspscc
95 | *.vssscc
96 | .builds
97 | *.pidb
98 | *.svclog
99 | *.scc
100 |
101 | # Chutzpah Test files
102 | _Chutzpah*
103 |
104 | # Visual C++ cache files
105 | ipch/
106 | *.aps
107 | *.ncb
108 | *.opendb
109 | *.opensdf
110 | *.sdf
111 | *.cachefile
112 | *.VC.db
113 | *.VC.VC.opendb
114 |
115 | # Visual Studio profiler
116 | *.psess
117 | *.vsp
118 | *.vspx
119 | *.sap
120 |
121 | # Visual Studio Trace Files
122 | *.e2e
123 |
124 | # TFS 2012 Local Workspace
125 | $tf/
126 |
127 | # Guidance Automation Toolkit
128 | *.gpState
129 |
130 | # ReSharper is a .NET coding add-in
131 | _ReSharper*/
132 | *.[Rr]e[Ss]harper
133 | *.DotSettings.user
134 |
135 | # TeamCity is a build add-in
136 | _TeamCity*
137 |
138 | # DotCover is a Code Coverage Tool
139 | *.dotCover
140 |
141 | # AxoCover is a Code Coverage Tool
142 | .axoCover/*
143 | !.axoCover/settings.json
144 |
145 | # Coverlet is a free, cross platform Code Coverage Tool
146 | coverage*.json
147 | coverage*.xml
148 | coverage*.info
149 |
150 | # Visual Studio code coverage results
151 | *.coverage
152 | *.coveragexml
153 |
154 | # NCrunch
155 | _NCrunch_*
156 | .*crunch*.local.xml
157 | nCrunchTemp_*
158 |
159 | # MightyMoose
160 | *.mm.*
161 | AutoTest.Net/
162 |
163 | # Web workbench (sass)
164 | .sass-cache/
165 |
166 | # Installshield output folder
167 | [Ee]xpress/
168 |
169 | # DocProject is a documentation generator add-in
170 | DocProject/buildhelp/
171 | DocProject/Help/*.HxT
172 | DocProject/Help/*.HxC
173 | DocProject/Help/*.hhc
174 | DocProject/Help/*.hhk
175 | DocProject/Help/*.hhp
176 | DocProject/Help/Html2
177 | DocProject/Help/html
178 |
179 | # Click-Once directory
180 | publish/
181 |
182 | # Publish Web Output
183 | *.[Pp]ublish.xml
184 | *.azurePubxml
185 | # Note: Comment the next line if you want to checkin your web deploy settings,
186 | # but database connection strings (with potential passwords) will be unencrypted
187 | *.pubxml
188 | *.publishproj
189 |
190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
191 | # checkin your Azure Web App publish settings, but sensitive information contained
192 | # in these scripts will be unencrypted
193 | PublishScripts/
194 |
195 | # NuGet Packages
196 | *.nupkg
197 | # NuGet Symbol Packages
198 | *.snupkg
199 | # The packages folder can be ignored because of Package Restore
200 | **/[Pp]ackages/*
201 | # except build/, which is used as an MSBuild target.
202 | !**/[Pp]ackages/build/
203 | # Uncomment if necessary however generally it will be regenerated when needed
204 | #!**/[Pp]ackages/repositories.config
205 | # NuGet v3's project.json files produces more ignorable files
206 | *.nuget.props
207 | *.nuget.targets
208 |
209 | # Microsoft Azure Build Output
210 | csx/
211 | *.build.csdef
212 |
213 | # Microsoft Azure Emulator
214 | ecf/
215 | rcf/
216 |
217 | # Windows Store app package directories and files
218 | AppPackages/
219 | BundleArtifacts/
220 | Package.StoreAssociation.xml
221 | _pkginfo.txt
222 | *.appx
223 | *.appxbundle
224 | *.appxupload
225 |
226 | # Visual Studio cache files
227 | # files ending in .cache can be ignored
228 | *.[Cc]ache
229 | # but keep track of directories ending in .cache
230 | !?*.[Cc]ache/
231 |
232 | # Others
233 | ClientBin/
234 | ~$*
235 | *~
236 | *.dbmdl
237 | *.dbproj.schemaview
238 | *.jfm
239 | *.pfx
240 | *.publishsettings
241 | orleans.codegen.cs
242 |
243 | # Including strong name files can present a security risk
244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
245 | #*.snk
246 |
247 | # Since there are multiple workflows, uncomment next line to ignore bower_components
248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
249 | #bower_components/
250 |
251 | # RIA/Silverlight projects
252 | Generated_Code/
253 |
254 | # Backup & report files from converting an old project file
255 | # to a newer Visual Studio version. Backup files are not needed,
256 | # because we have git ;-)
257 | _UpgradeReport_Files/
258 | Backup*/
259 | UpgradeLog*.XML
260 | UpgradeLog*.htm
261 | ServiceFabricBackup/
262 | *.rptproj.bak
263 |
264 | # SQL Server files
265 | *.mdf
266 | *.ldf
267 | *.ndf
268 |
269 | # Business Intelligence projects
270 | *.rdl.data
271 | *.bim.layout
272 | *.bim_*.settings
273 | *.rptproj.rsuser
274 | *- [Bb]ackup.rdl
275 | *- [Bb]ackup ([0-9]).rdl
276 | *- [Bb]ackup ([0-9][0-9]).rdl
277 |
278 | # Microsoft Fakes
279 | FakesAssemblies/
280 |
281 | # GhostDoc plugin setting file
282 | *.GhostDoc.xml
283 |
284 | # Node.js Tools for Visual Studio
285 | .ntvs_analysis.dat
286 | node_modules/
287 |
288 | # Visual Studio 6 build log
289 | *.plg
290 |
291 | # Visual Studio 6 workspace options file
292 | *.opt
293 |
294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
295 | *.vbw
296 |
297 | # Visual Studio LightSwitch build output
298 | **/*.HTMLClient/GeneratedArtifacts
299 | **/*.DesktopClient/GeneratedArtifacts
300 | **/*.DesktopClient/ModelManifest.xml
301 | **/*.Server/GeneratedArtifacts
302 | **/*.Server/ModelManifest.xml
303 | _Pvt_Extensions
304 |
305 | # Paket dependency manager
306 | .paket/paket.exe
307 | paket-files/
308 |
309 | # FAKE - F# Make
310 | .fake/
311 |
312 | # CodeRush personal settings
313 | .cr/personal
314 |
315 | # Python Tools for Visual Studio (PTVS)
316 | __pycache__/
317 | *.pyc
318 |
319 | # Cake - Uncomment if you are using it
320 | # tools/**
321 | # !tools/packages.config
322 |
323 | # Tabs Studio
324 | *.tss
325 |
326 | # Telerik's JustMock configuration file
327 | *.jmconfig
328 |
329 | # BizTalk build output
330 | *.btp.cs
331 | *.btm.cs
332 | *.odx.cs
333 | *.xsd.cs
334 |
335 | # OpenCover UI analysis results
336 | OpenCover/
337 |
338 | # Azure Stream Analytics local run output
339 | ASALocalRun/
340 |
341 | # MSBuild Binary and Structured Log
342 | *.binlog
343 |
344 | # NVidia Nsight GPU debugger configuration file
345 | *.nvuser
346 |
347 | # MFractors (Xamarin productivity tool) working folder
348 | .mfractor/
349 |
350 | # Local History for Visual Studio
351 | .localhistory/
352 |
353 | # BeatPulse healthcheck temp database
354 | healthchecksdb
355 |
356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
357 | MigrationBackup/
358 |
359 | # Ionide (cross platform F# VS Code tools) working folder
360 | .ionide/
361 |
362 | # Fody - auto-generated XML schema
363 | FodyWeavers.xsd
--------------------------------------------------------------------------------
/Plain Craft Launcher Admin Manager/ApplicationEvents.vb:
--------------------------------------------------------------------------------
1 | Imports System.IO
2 | Imports System.Threading
3 |
4 | Namespace My
5 | Partial Friend Class MyApplication
6 | Public Shared Sub Main()
7 | Try
8 | '处理启动参数
9 | Dim StartScript As String = ""
10 | For Each Child As String In Application.CommandLineArgs
11 | StartScript = StartScript & Child & " "
12 | Next
13 | If StartScript.EndsWith(" ") Then StartScript = Mid(StartScript, 1, Len(StartScript) - 1)
14 |
15 | '判断启动参数头
16 | Dim Data As String = StartScript.Replace(Split(StartScript, ":")(0) & ":", "")
17 | Select Case Split(StartScript, ":")(0)
18 |
19 | Case "Set Environment Variable"
20 | '设置环境变量
21 | Environment.SetEnvironmentVariable("Path", Data, EnvironmentVariableTarget.Machine)
22 |
23 | Case "Auto Update"
24 | '自动更新
25 | Dim RetryCount As Integer = 0
26 | Dim ProcessId As Integer = Val(Data.Split("|")(1))
27 | Data = Data.Split("|")(0)
28 | Retry:
29 | '关闭PCL进程
30 | Try
31 | Dim Process As Process = Process.GetProcessById(ProcessId)
32 | Process.Kill()
33 | Catch
34 | End Try
35 | Try
36 | Dim f = New Func
37 | f.CopyDerictory(New DirectoryInfo(Data & "PCL\Update\"), New DirectoryInfo(Data))
38 | Directory.Delete(Data & "PCL\Update", True)
39 | Shell(Data & "PCL.exe", AppWinStyle.NormalFocus)
40 | Catch ex As Exception
41 | RetryCount = RetryCount + 1
42 | If RetryCount < 10 Then
43 | Thread.Sleep(1500)
44 | GoTo Retry
45 | End If
46 | MsgBox("自动更新失败:" & ex.ToString, MsgBoxStyle.Critical, "Plain Craft Launcher - PCLAM")
47 | End Try
48 |
49 | End Select
50 |
51 | Catch ex As Exception
52 | MsgBox("处理失败:" & ex.ToString, MsgBoxStyle.Critical, "Plain Craft Launcher - PCLAM")
53 | End Try
54 | End Sub
55 |
56 | End Class
57 | End Namespace
58 |
59 | Public Class Func
60 |
61 |
62 | Public Sub CopyDerictory(ByVal DirectorySrc As DirectoryInfo, ByVal DirectoryDes As DirectoryInfo)
63 | Dim strDirectoryDesPath As String = DirectoryDes.FullName '& "" & DirectorySrc.Name
64 | If Not Directory.Exists(strDirectoryDesPath) Then Directory.CreateDirectory(strDirectoryDesPath)
65 | Dim f, fs() As FileInfo
66 | fs = DirectorySrc.GetFiles()
67 | For Each f In fs
68 | File.Copy(f.FullName, strDirectoryDesPath & f.Name.ToString, True)
69 | Next
70 | Dim DirSrc, Dirs() As DirectoryInfo
71 | Dirs = DirectorySrc.GetDirectories()
72 | '递归调用自身
73 | For Each DirSrc In Dirs
74 | Dim DirDes As New DirectoryInfo(strDirectoryDesPath)
75 | CopyDerictory(DirSrc, DirDes)
76 | Next
77 | End Sub
78 |
79 | End Class
--------------------------------------------------------------------------------
/Plain Craft Launcher Admin Manager/My Project/Application.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' 此代码由工具生成。
4 | ' 运行时版本:4.0.30319.42000
5 | '
6 | ' 对此文件的更改可能会导致不正确的行为,并且如果
7 | ' 重新生成代码,这些更改将会丢失。
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
--------------------------------------------------------------------------------
/Plain Craft Launcher Admin Manager/My Project/Application.myapp:
--------------------------------------------------------------------------------
1 |
2 |
3 | false
4 | false
5 | 0
6 | true
7 | 1
8 | true
9 |
--------------------------------------------------------------------------------
/Plain Craft Launcher Admin Manager/My Project/AssemblyInfo.vb:
--------------------------------------------------------------------------------
1 | Imports System
2 | Imports System.Reflection
3 | Imports System.Runtime.InteropServices
4 |
5 | ' 有关程序集的常规信息通过下列特性集
6 | ' 控制。更改这些特性值可修改
7 | ' 与程序集关联的信息。
8 |
9 | ' 查看程序集特性的值
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | '如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
21 |
22 |
23 | ' 程序集的版本信息由下面四个值组成:
24 | '
25 | ' 主版本
26 | ' 次版本
27 | ' 内部版本号
28 | ' 修订号
29 | '
30 | ' 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
31 | ' 方法是按如下所示使用“*”:
32 | '
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/Plain Craft Launcher Admin Manager/My Project/Resources.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' 此代码由工具生成。
4 | ' 运行时版本:4.0.30319.42000
5 | '
6 | ' 对此文件的更改可能会导致不正确的行为,并且如果
7 | ' 重新生成代码,这些更改将会丢失。
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 | Imports System
15 |
16 | Namespace My.Resources
17 |
18 | '此类是由 StronglyTypedResourceBuilder
19 | '类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | '若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | '(以 /str 作为命令选项),或重新生成 VS 项目。
22 | '''
23 | ''' 一个强类型的资源类,用于查找本地化的字符串等。
24 | '''
25 | _
29 | Friend Module Resources
30 |
31 | Private resourceMan As Global.System.Resources.ResourceManager
32 |
33 | Private resourceCulture As Global.System.Globalization.CultureInfo
34 |
35 | '''
36 | ''' 返回此类使用的缓存的 ResourceManager 实例。
37 | '''
38 | _
39 | Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
40 | Get
41 | If Object.ReferenceEquals(resourceMan, Nothing) Then
42 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Plain_Craft_Launcher_Admin_Manager.Resources", GetType(Resources).Assembly)
43 | resourceMan = temp
44 | End If
45 | Return resourceMan
46 | End Get
47 | End Property
48 |
49 | '''
50 | ''' 使用此强类型资源类,为所有资源查找
51 | ''' 重写当前线程的 CurrentUICulture 属性。
52 | '''
53 | _
54 | Friend Property Culture() As Global.System.Globalization.CultureInfo
55 | Get
56 | Return resourceCulture
57 | End Get
58 | Set
59 | resourceCulture = value
60 | End Set
61 | End Property
62 | End Module
63 | End Namespace
64 |
--------------------------------------------------------------------------------
/Plain Craft Launcher Admin Manager/My Project/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/Plain Craft Launcher Admin Manager/My Project/Settings.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' 此代码由工具生成。
4 | ' 运行时版本:4.0.30319.42000
5 | '
6 | ' 对此文件的更改可能会导致不正确的行为,并且如果
7 | ' 重新生成代码,这些更改将会丢失。
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 | Namespace My
16 |
17 | _
20 | Partial Friend NotInheritable Class MySettings
21 | Inherits Global.System.Configuration.ApplicationSettingsBase
22 |
23 | Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
24 |
25 | #Region "My.Settings 自动保存功能"
26 | #If _MyType = "WindowsForms" Then
27 | Private Shared addedHandler As Boolean
28 |
29 | Private Shared addedHandlerLockObject As New Object
30 |
31 | _
32 | Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
33 | If My.Application.SaveMySettingsOnExit Then
34 | My.Settings.Save()
35 | End If
36 | End Sub
37 | #End If
38 | #End Region
39 |
40 | Public Shared ReadOnly Property [Default]() As MySettings
41 | Get
42 |
43 | #If _MyType = "WindowsForms" Then
44 | If Not addedHandler Then
45 | SyncLock addedHandlerLockObject
46 | If Not addedHandler Then
47 | AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
48 | addedHandler = True
49 | End If
50 | End SyncLock
51 | End If
52 | #End If
53 | Return defaultInstance
54 | End Get
55 | End Property
56 | End Class
57 | End Namespace
58 |
59 | Namespace My
60 |
61 | _
64 | Friend Module MySettingsProperty
65 |
66 | _
67 | Friend ReadOnly Property Settings() As Global.Plain_Craft_Launcher_Admin_Manager.My.MySettings
68 | Get
69 | Return Global.Plain_Craft_Launcher_Admin_Manager.My.MySettings.Default
70 | End Get
71 | End Property
72 | End Module
73 | End Namespace
74 |
--------------------------------------------------------------------------------
/Plain Craft Launcher Admin Manager/My Project/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Plain Craft Launcher Admin Manager/My Project/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/Plain Craft Launcher Admin Manager/Plain Craft Launcher Admin Manager.vbproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | x86
6 |
7 |
8 | 2.0
9 | {A4D5D793-DEE9-431C-92BD-B1B2B5A0356F}
10 | WinExe
11 | Sub Main
12 | Plain_Craft_Launcher_Admin_Manager
13 | Plain Craft Launcher Admin Manager
14 | 512
15 | WindowsFormsWithCustomSubMain
16 | v4.0
17 | Client
18 |
19 |
20 | AnyCPU
21 | true
22 | full
23 | true
24 | true
25 | ..\Debug
26 | Plain Craft Launcher Admin Manager.xml
27 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
28 |
29 |
30 | x86
31 | pdbonly
32 | false
33 | true
34 | true
35 | ..\Debug
36 | Plain Craft Launcher Admin Manager.xml
37 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
38 |
39 |
40 | On
41 |
42 |
43 | Binary
44 |
45 |
46 | Off
47 |
48 |
49 | On
50 |
51 |
52 | My Project\app.manifest
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 | True
87 | Application.myapp
88 |
89 |
90 | True
91 | True
92 | Resources.resx
93 |
94 |
95 | True
96 | Settings.settings
97 | True
98 |
99 |
100 |
101 |
102 | VbMyResourcesResXFileCodeGenerator
103 | Resources.Designer.vb
104 | My.Resources
105 | Designer
106 |
107 |
108 |
109 |
110 |
111 | MyApplicationCodeGenerator
112 | Application.Designer.vb
113 |
114 |
115 | SettingsSingleFileGenerator
116 | My
117 | Settings.Designer.vb
118 |
119 |
120 |
121 |
128 |
--------------------------------------------------------------------------------
/Plain Craft Launcher.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.31410.357
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Plain Craft Launcher", "Plain Craft Launcher\Plain Craft Launcher.vbproj", "{D73DA5E6-9D38-4559-8904-1CFF2434415A}"
7 | EndProject
8 | Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Plain Craft Launcher Admin Manager", "Plain Craft Launcher Admin Manager\Plain Craft Launcher Admin Manager.vbproj", "{A4D5D793-DEE9-431C-92BD-B1B2B5A0356F}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|x86 = Debug|x86
13 | Release|x86 = Release|x86
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {D73DA5E6-9D38-4559-8904-1CFF2434415A}.Debug|x86.ActiveCfg = Debug|x86
17 | {D73DA5E6-9D38-4559-8904-1CFF2434415A}.Debug|x86.Build.0 = Debug|x86
18 | {D73DA5E6-9D38-4559-8904-1CFF2434415A}.Release|x86.ActiveCfg = Release|x86
19 | {D73DA5E6-9D38-4559-8904-1CFF2434415A}.Release|x86.Build.0 = Release|x86
20 | {A4D5D793-DEE9-431C-92BD-B1B2B5A0356F}.Debug|x86.ActiveCfg = Debug|x86
21 | {A4D5D793-DEE9-431C-92BD-B1B2B5A0356F}.Debug|x86.Build.0 = Debug|x86
22 | {A4D5D793-DEE9-431C-92BD-B1B2B5A0356F}.Release|x86.ActiveCfg = Release|x86
23 | {A4D5D793-DEE9-431C-92BD-B1B2B5A0356F}.Release|x86.Build.0 = Release|x86
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {1A8E94D0-205A-4FF4-A6F9-390DF3DD7A0A}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/Plain Craft Launcher.vshost.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/Plain Craft Launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | pcl
6 |
7 |
8 |
9 |
10 |
11 | InitializeComponent
12 |
13 |
14 |
15 | formLaunchDownload
16 |
17 |
18 |
19 | CreateInstance
20 |
21 |
22 |
23 | GetPropertyValue
24 |
25 |
26 |
27 | SetPropertyValue
28 |
29 |
30 |
31 | CreateDelegate
32 |
33 |
34 |
35 | AddEventHandler
36 |
37 |
38 |
39 | GeneratedInternalTypeHelper
40 |
41 |
42 |
43 | InitializeComponent
44 |
45 |
46 |
47 | Button
48 |
49 |
50 |
51 | InitializeComponent
52 |
53 |
54 |
55 | Radiobox
56 |
57 |
58 |
59 | InitializeComponent
60 |
61 |
62 |
63 | Application Entry Point.
64 |
65 |
66 |
67 | Application
68 |
69 |
70 |
71 | InitializeComponent
72 |
73 |
74 |
75 | JumpupHint
76 |
77 |
78 |
79 | InitializeComponent
80 |
81 |
82 |
83 | formStart
84 |
85 |
86 |
87 | InitializeComponent
88 |
89 |
90 |
91 | MCButton
92 |
93 |
94 |
95 | InitializeComponent
96 |
97 |
98 |
99 | Checkbox
100 |
101 |
102 |
103 | InitializeComponent
104 |
105 |
106 |
107 | formLaunchManage
108 |
109 |
110 |
111 | InitializeComponent
112 |
113 |
114 |
115 | MetroMsgbox
116 |
117 |
118 |
119 | InitializeComponent
120 |
121 |
122 |
123 | RoundProcessbar
124 |
125 |
126 |
127 | InitializeComponent
128 |
129 |
130 |
131 | formLaunch
132 |
133 |
134 |
135 | InitializeComponent
136 |
137 |
138 |
139 | formMain
140 |
141 |
142 |
143 | InitializeComponent
144 |
145 |
146 |
147 | VScroll
148 |
149 |
150 |
151 | InitializeComponent
152 |
153 |
154 |
155 | formLaunchNews
156 |
157 |
158 |
159 | InitializeComponent
160 |
161 |
162 |
163 | ListItem
164 |
165 |
166 |
167 | InitializeComponent
168 |
169 |
170 |
171 | Processbar
172 |
173 |
174 |
175 | InitializeComponent
176 |
177 |
178 |
179 | Timer
180 |
181 |
182 |
183 | 返回此类使用的缓存的 ResourceManager 实例。
184 |
185 |
186 |
187 | 使用此强类型资源类,为所有资源查找
188 | 重写当前线程的 CurrentUICulture 属性。
189 |
190 |
191 |
192 | 一个强类型的资源类,用于查找本地化的字符串等。
193 |
194 |
195 |
196 | 返回正在运行的应用程序的应用程序对象
197 |
198 |
199 |
200 | 返回有关主机计算机的信息。
201 |
202 |
203 |
204 | 返回当前用户的信息。如果希望使用当前的
205 | Windows 用户凭据来运行应用程序,请调用 My.User.InitializeWithWindowsUser()。
206 |
207 |
208 |
209 | 返回应用程序日志。可以使用应用程序的配置文件配置侦听器。
210 |
211 |
212 |
213 | 返回项目中定义的 Windows 集合。
214 |
215 |
216 |
217 | 用于定义“我的 WPF 命名空间”中的可用属性的模块
218 |
219 |
220 |
221 |
222 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Application.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
31 |
32 |
33 |
56 |
57 |
58 | #FFD5E9FF
59 | #FF6AB1FF
60 | #FF0079FF
61 | #FF0051AA
62 | #FF002855
63 | #FFD5E9FF
64 | #FF6AB1FF
65 | #FF0079FF
66 | #FF0051AA
67 | #FF002855
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Application.xaml.vb:
--------------------------------------------------------------------------------
1 | Imports System.Reflection
2 |
3 | Class Application
4 |
5 | Private Sub Application_Startup(ByVal sender As Object, ByVal e As System.Windows.StartupEventArgs) Handles Me.Startup
6 | Try
7 | Process.GetCurrentProcess.PriorityClass = ProcessPriorityClass.High
8 | Application.Current.Dispatcher.Thread.Priority = ThreadPriority.AboveNormal
9 | '基础初始化
10 | AddHandler AppDomain.CurrentDomain.AssemblyResolve, AddressOf AssemblyResolve '动态 DLL 调用
11 | LoadTimeCost = My.Computer.Clock.TickCount
12 | Directory.CreateDirectory(PATH & "PCL")
13 | Directory.CreateDirectory(PATH & "PCL\cache")
14 | Directory.CreateDirectory(PATH & "PCL\download")
15 | Try
16 | File.Delete(PATH & "PCL\log.txt")
17 | Catch
18 | End Try
19 | log("[Application] 程序启动,版本:" & VERSION_NAME & "(" & VERSION_CODE & ")")
20 | '读取设置
21 | MODE_DEBUG = ReadReg("SysTest", "False")
22 | MODE_DEVELOPER = File.Exists(PATH & "Plain Craft Launcher Developer Tag")
23 | '配置初始化
24 | Net.ServicePointManager.DefaultConnectionLimit = 1024
25 | Catch ex As Exception
26 | If MsgBox("程序初始化时出现异常:" & GetStringFromException(ex, True) & vbCrLf & "是否愿意打开反馈页面来反馈这个问题?" & vbCrLf & "这会帮助作者解决问题,否则它将永远不会得到解决!", MsgBoxStyle.Critical + MsgBoxStyle.YesNo, "炸了") = MsgBoxResult.Yes Then Feedback()
27 | End Try
28 | End Sub
29 | Private Sub Application_DispatcherUnhandledException(ByVal sender As Object, ByVal e As System.Windows.Threading.DispatcherUnhandledExceptionEventArgs) Handles Me.DispatcherUnhandledException
30 | On Error Resume Next
31 | log("[Application] 请把这个 Log 文件发送给作者,以助于改进这个启动器,谢谢~")
32 | log("[Application] 异常的详细信息:" & vbCrLf & GetStringFromException(e.Exception, True))
33 | If MsgBox("程序出现异常:" & GetStringFromException(e.Exception, True) & vbCrLf & "是否愿意打开反馈页面来反馈这个问题?" & vbCrLf & "这会帮助作者解决问题,否则它将永远不会得到解决!", MsgBoxStyle.Critical + MsgBoxStyle.YesNo, "炸了") = MsgBoxResult.Yes Then Feedback()
34 | EndForce()
35 | End Sub
36 |
37 | '动态 DLL 调用
38 | Private Ionic As Assembly = Assembly.Load(My.Resources.ResourceManager.GetObject("Ionic_Zip"))
39 | Private Newtonsoft As Assembly = Assembly.Load(My.Resources.ResourceManager.GetObject("Newtonsoft_Json"))
40 | Private Function AssemblyResolve(sender As Object, args As ResolveEventArgs) As Assembly
41 | Dim Name As String = New AssemblyName(args.Name).Name
42 | Select Case Name
43 | Case "Ionic.Zip"
44 | Return Ionic
45 | Case "Newtonsoft.Json"
46 | Return Newtonsoft
47 | Case Else
48 | Return Nothing
49 | End Select
50 | End Function
51 |
52 | End Class
53 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Base/Button.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Base/Button.xaml.vb:
--------------------------------------------------------------------------------
1 | Public Class Button
2 |
3 | '声明
4 | Public Event Click(ByVal sender As Object, ByVal e As EventArgs) '自定义事件
5 |
6 | '自定义属性
7 | Public Property Text As String
8 | Get
9 | Return labText.Content
10 | End Get
11 | Set(ByVal value As String)
12 | labText.Content = value
13 | End Set
14 | End Property '显示文本
15 | Public Property TextPadding As Thickness
16 | Get
17 | Return labText.Padding
18 | End Get
19 | Set(ByVal value As Thickness)
20 | labText.Padding = value
21 | End Set
22 | End Property
23 | Private _ColorType As State = State.COMMON '配色方案
24 | Public Property ColorType As State
25 | Get
26 | Return _ColorType
27 | End Get
28 | Set(ByVal value As State)
29 | _ColorType = value
30 | RefreshColor()
31 | End Set
32 | End Property
33 | Public Enum State As Byte
34 | COMMON = 0
35 | HIGHLIGHT = 1
36 | RED = 2
37 | End Enum
38 |
39 | '自定义事件
40 | Private Sub RefreshColor() Handles Me.MouseEnter, Me.MouseLeave, Me.Loaded, Me.IsEnabledChanged
41 | Try
42 | If Me.IsEnabled Then
43 | Select Case Me._ColorType '选取颜色种类
44 | Case State.COMMON
45 | If Me.IsMouseOver Then
46 | '指向
47 | AniStart({ _
48 | AaBackGround(Border, New MyColor(Color.FromArgb(255, 248, 248, 248)) - Border.Background, 150),
49 | AaBorderBrush(Me, New MyColor(Color.FromArgb(255, 42, 42, 42)) - Me.BorderBrush, 150),
50 | AaOpacity(Me, 1 - Me.Opacity, 200)
51 | }, "BtnColor" & Me.Name)
52 | Else
53 | '普通
54 | AniStart({ _
55 | AaBackGround(Border, New MyColor(Color.FromArgb(128, 248, 248, 248)) - Border.Background, 150),
56 | AaBorderBrush(Me, New MyColor(Color.FromArgb(255, 42, 42, 42)) - Me.BorderBrush, 150),
57 | AaOpacity(Me, 0.8 - Me.Opacity, 200)
58 | }, "BtnColor" & Me.Name)
59 | End If
60 | Case State.HIGHLIGHT
61 | If Me.IsMouseOver Then
62 | '高亮指向
63 | AniStart({
64 | AaBackGround(Border, New MyColor(Color.FromArgb(255, 248, 248, 248)) - Border.Background, 150),
65 | AaBorderBrush(Me, New MyColor(CType(Application.Current.Resources("Color5"), SolidColorBrush).Color) - Me.BorderBrush, 150),
66 | AaOpacity(Me, 1 - Me.Opacity, 200)
67 | }, "BtnColor" & Me.Name)
68 | Else
69 | '高亮普通
70 | AniStart({
71 | AaBackGround(Border, New MyColor(Color.FromArgb(128, 248, 248, 248)) - Border.Background, 150),
72 | AaBorderBrush(Me, New MyColor(CType(Application.Current.Resources("Color5"), SolidColorBrush).Color) - Me.BorderBrush, 150),
73 | AaOpacity(Me, 0.8 - Me.Opacity, 200)
74 | }, "BtnColor" & Me.Name)
75 | End If
76 | Case State.RED
77 | If Me.IsMouseOver Then
78 | '红色指向
79 | AniStart({ _
80 | AaBackGround(Border, New MyColor(Color.FromArgb(255, 248, 248, 248)) - Border.Background, 150),
81 | AaBorderBrush(Me, New MyColor(Color.FromArgb(255, 200, 20, 20)) - Me.BorderBrush, 150),
82 | AaOpacity(Me, 1 - Me.Opacity, 200)
83 | }, "BtnColor" & Me.Name)
84 | Else
85 | '红色普通
86 | AniStart({ _
87 | AaBackGround(Border, New MyColor(Color.FromArgb(128, 248, 248, 248)) - Border.Background, 150),
88 | AaBorderBrush(Me, New MyColor(Color.FromArgb(255, 200, 20, 20)) - Me.BorderBrush, 150),
89 | AaOpacity(Me, 0.8 - Me.Opacity, 200)
90 | }, "BtnColor" & Me.Name)
91 | End If
92 | End Select
93 | Else
94 | '灰色(不可用)
95 | AniStart({ _
96 | AaBackGround(Border, New MyColor(Color.FromArgb(128, 248, 248, 248)) - Border.Background, 150),
97 | AaBorderBrush(Me, New MyColor(Color.FromArgb(255, 144, 144, 144)) - Me.BorderBrush, 150),
98 | AaOpacity(Me, 0.8 - Me.Opacity, 200)
99 | }, "BtnColor" & Me.Name)
100 | End If
101 | Catch ex As Exception
102 | ExShow(ex, "刷新按钮出错")
103 | End Try
104 | End Sub
105 |
106 | '默认事件
107 | Private Sub Button_Mouse(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles Me.MouseLeftButtonUp
108 | RaiseEvent Click(sender, e)
109 | End Sub
110 |
111 | End Class
112 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Base/Checkbox.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Base/Checkbox.xaml.vb:
--------------------------------------------------------------------------------
1 | Public Class Checkbox
2 |
3 | Public Event Change(ByVal sender As Object, ByVal raiseByMouse As Boolean)
4 |
5 | '自定义属性
6 | Private _Checked As Boolean = True '是否选中
7 | Public Property Checked As Boolean
8 | Get
9 | Return _Checked
10 | End Get
11 | Set(ByVal value As Boolean)
12 | If Not value = _Checked Then '只有改变了才触发
13 | _Checked = value
14 | If Me.IsLoaded Then RaiseEvent Change(Me, False) 'Change事件只在控件加载后触发,以防止默认属性设置触发事件
15 | If Me.IsLoaded And UseControlAnimation Then '防止默认属性设置触发动画
16 | Refresh()
17 | Else
18 | Check.Opacity = If(_Checked, 1, 0)
19 | End If
20 | End If
21 | End Set
22 | End Property
23 | Public Property Context As String
24 | Get
25 | Return label.Content
26 | End Get
27 | Set(ByVal value As String)
28 | label.Content = value
29 | End Set
30 | End Property '内容
31 |
32 | '自定义事件
33 | Private Sub Refresh()
34 | 'Checked变更
35 | If _Checked Then
36 | AniStop("Ch" & Me.Name & "CheckedChange") '停止旧动画实行相对动画
37 | AniStart({
38 | AaScale(border, 4 / border.Width - 1, 150),
39 | AaOpacity(Check, 1 - Check.Opacity, 1, , , True),
40 | AaX(imgBlack, -14 - imgBlack.Margin.Left, 1),
41 | AaY(imgBlack, -14 - imgBlack.Margin.Left, 1),
42 | AaX(imgBlue, -14 - imgBlue.Margin.Left, 1),
43 | AaY(imgBlue, -14 - imgBlue.Margin.Left, 1),
44 | AaX(imgGray, -14 - imgGray.Margin.Left, 1),
45 | AaY(imgGray, -14 - imgGray.Margin.Left, 1),
46 | AaX(imgBlack, 14, 150, , , True),
47 | AaY(imgBlack, 14, 150),
48 | AaX(imgBlue, 14, 150),
49 | AaY(imgBlue, 14, 150),
50 | AaX(imgGray, 14, 150),
51 | AaY(imgGray, 14, 150),
52 | AaScale(border, 14 / border.Width, 150)
53 | }, "Ch" & Me.Name & "CheckedChange")
54 | Else
55 | AniStop("Ch" & Me.Name & "CheckedChange")
56 | AniStart({ _
57 | AaX(imgBlack, imgBlack.Margin.Left - 14, 150),
58 | AaY(imgBlack, imgBlack.Margin.Left - 14, 150),
59 | AaX(imgBlue, imgBlue.Margin.Left - 14, 150),
60 | AaY(imgBlue, imgBlue.Margin.Left - 14, 150),
61 | AaX(imgGray, imgGray.Margin.Left - 14, 150),
62 | AaY(imgGray, imgGray.Margin.Left - 14, 150),
63 | AaScale(border, 4 / border.Width - 1, 150),
64 | AaOpacity(Check, -Check.Opacity, 1, , , True),
65 | AaScale(border, 14 / border.Width, 150) _
66 | }, "Ch" & Me.Name & "CheckedChange")
67 | End If
68 | End Sub
69 |
70 | '默认事件
71 | Private Sub Checkbox_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles Me.MouseDown
72 | _Checked = Not _Checked
73 | If Me.IsLoaded Then
74 | RaiseEvent Change(Me, True) 'Change事件只在控件加载后触发,以防止默认属性设置触发事件
75 | Refresh()
76 | Else
77 | Check.Opacity = If(_Checked, 1, 0)
78 | End If
79 | End Sub
80 | Private Sub Checkbox_IsEnabledChanged(ByVal sender As Object, ByVal e As System.Windows.DependencyPropertyChangedEventArgs) Handles Me.IsEnabledChanged
81 | If Me.IsLoaded And UseControlAnimation Then '防止默认属性设置触发动画
82 | If Me.IsEnabled Then
83 | AniStop("Ch" & Me.Name & "PointChange")
84 | AniStart({
85 | AaOpacity(imgBlack, 1 - imgBlack.Opacity, 150),
86 | AaBorderBrush(border, New MyColor(50, 50, 50) - border.BorderBrush, 150),
87 | AaForeGround(Me, New MyColor(50, 50, 50) - Me.Foreground, 150),
88 | AaOpacity(imgBlue, -imgBlue.Opacity, 150, 50),
89 | AaOpacity(imgGray, -imgGray.Opacity, 150, 50)
90 | }, "Ch" & Me.Name & "PointChange")
91 | Else
92 | AniStop("Ch" & Me.Name & "PointChange")
93 | AniStart({
94 | AaOpacity(imgGray, 1 - imgGray.Opacity, 150),
95 | AaBorderBrush(border, New MyColor(145, 145, 145) - border.BorderBrush, 150),
96 | AaForeGround(Me, New MyColor(145, 145, 145) - Me.Foreground, 150),
97 | AaOpacity(imgBlue, -imgBlue.Opacity, 150, 50),
98 | AaOpacity(imgBlack, -imgBlack.Opacity, 150, 50)
99 | }, "Ch" & Me.Name & "PointChange")
100 | End If
101 | Else
102 | If Me.IsEnabled Then
103 | imgGray.Opacity = 0
104 | imgBlack.Opacity = 1
105 | border.BorderBrush = New MyColor(50, 50, 50)
106 | Me.Foreground = New MyColor(50, 50, 50)
107 | Else
108 | imgGray.Opacity = 1
109 | imgBlack.Opacity = 0
110 | border.BorderBrush = New MyColor(145, 145, 145)
111 | Me.Foreground = New MyColor(145, 145, 145)
112 | End If
113 | End If
114 | End Sub
115 |
116 | '鼠标指向
117 | Private Sub Checkbox_MouseEnter(ByVal sender As Object, ByVal e As System.Windows.Input.MouseEventArgs) Handles Me.MouseEnter
118 | If Me.Name = "" Then Me.Name = "Check" & GetUUID()
119 | AniStop("Ch" & Me.Name & "PointChange")
120 | AniStart({
121 | AaOpacity(panMain, 1 - panMain.Opacity, 200)
122 | }, "Ch" & Me.Name & "PointChange")
123 | End Sub
124 | Private Sub Checkbox_MouseLeave(ByVal sender As Object, ByVal e As System.Windows.Input.MouseEventArgs) Handles Me.MouseLeave
125 | 'MouseLeave比IsEnabledChanged后执行,所以如果自定义事件修改了IsEnabled,将导致颜色显示错误,这个判断语句为了修复此bug
126 | If Me.IsEnabled Then
127 | AniStop("Ch" & Me.Name & "PointChange")
128 | AniStart({
129 | AaOpacity(panMain, 0.8 - panMain.Opacity, 200)
130 | }, "Ch" & Me.Name & "PointChange")
131 | End If
132 | End Sub
133 |
134 | End Class
135 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Base/InfoBox.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Base/ListItem.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Base/ListItem.xaml.vb:
--------------------------------------------------------------------------------
1 | Public Class ListItem
2 |
3 | Public Event Click(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) '单击事件
4 | Public Event Change(ByVal sender As Object, ByVal e As EventArgs) '选择改变事件
5 | Public Event ButtonClick(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) '按钮按下事件
6 | Public Event IconClick(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) '图标按下事件
7 |
8 | #Region "自定义属性"
9 |
10 | Private _CanCheck As Boolean = True
11 | Public Property CanCheck As Boolean
12 | Get
13 | Return _CanCheck
14 | End Get
15 | Set(ByVal value As Boolean)
16 | _CanCheck = value
17 | Checked = False
18 | End Set
19 | End Property '能否选中
20 | Private _Checked As Boolean = False
21 | Public Property Checked As Boolean
22 | Get
23 | Return _Checked
24 | End Get
25 | Set(ByVal value As Boolean)
26 | If Not value = _Checked Then '只有变更时才执行
27 | _Checked = value
28 | If Me.IsLoaded Then '防止默认属性加载时导致错误
29 | RaiseChange()
30 | '同一容器中保证只有1个单选框选中
31 | Dim parentControl As Object = Me.Parent
32 | Dim checkedControl As ArrayList = New ArrayList
33 | Dim checkedCount As Byte = 0
34 | '统计单选框控件与选中个数
35 | For Each con In parentControl.Children
36 | If con.GetType.Name = "ListItem" Then
37 | checkedControl.Add(con)
38 | If con.Checked Then checkedCount = checkedCount + 1
39 | End If
40 | Next
41 | Select Case checkedCount
42 | Case 0 '没有选中项目
43 | If AtLeastCheck Then checkedControl(0).Checked = True
44 | Case Is > 1 '选中项目多于1个
45 | If Me.Checked Then
46 | '如果本控件选中则取消其它所有控件的选中
47 | For Each con As ListItem In checkedControl
48 | If con.Checked And Not con.Equals(Me) Then con.Checked = False
49 | Next
50 | Else
51 | '如果本控件未选中则只保留第一个选中的控件
52 | checkedCount = False '重复使用变量,实则统计是否为第一个选中控件
53 | For Each con As ListItem In checkedControl
54 | If con.Checked Then
55 | If checkedCount Then
56 | con.Checked = False '修改Checked会自动触发Change事件,所以不用额外触发
57 | Else
58 | checkedCount = True
59 | End If
60 | End If
61 | Next
62 | End If
63 | End Select
64 | End If
65 | Refresh()
66 | End If
67 | End Set
68 | End Property '是否选中
69 | Private _ShowButton As Boolean = True
70 | Public Property ShowButton As Boolean
71 | Get
72 | Return _ShowButton
73 | End Get
74 | Set(ByVal value As Boolean)
75 | If Not value = _ShowButton Then '只有变更时才执行
76 | _ShowButton = value
77 | border.Visibility = If(value, Visibility.Visible, Visibility.Hidden)
78 | If _ShowButton = False Then ListItem_MouseLeave(Nothing, Nothing)
79 | End If
80 | End Set
81 | End Property '是否显示按钮
82 | Public Property MainText As String
83 | Get
84 | Return labMain.Content
85 | End Get
86 | Set(ByVal value As String)
87 | labMain.Content = value
88 | End Set
89 | End Property '主内容
90 | Public Property SubText As String
91 | Get
92 | Return labSub.Text
93 | End Get
94 | Set(ByVal value As String)
95 | If value = "" Xor labSub.Text = "" Then
96 | If Me.Name = "" Then Me.Name = "ListItem" & GetUUID()
97 | If Me.IsLoaded And UseControlAnimation Then
98 | If value = "" Then
99 | AniStart({
100 | AaY(labMain, (Me.Height - labMain.Height) / 2 - GetTop(labMain), , , New AniEaseEnd)
101 | }, "Li" & Me.Name & "Sub")
102 | Else
103 | AniStart({
104 | AaY(labMain, -GetTop(labMain), , , New AniEaseEnd)
105 | }, "Li" & Me.Name & "Sub")
106 | End If
107 | Else
108 | If value = "" Then
109 | SetTop(labMain, (Me.Height - labMain.Height) / 2)
110 | Else
111 | SetTop(labMain, 0)
112 | End If
113 | End If
114 | End If
115 | labSub.Text = value
116 | End Set
117 | End Property '副内容
118 | Public Property Logo As ImageSource
119 | Get
120 | Return imgLeft.Source
121 | End Get
122 | Set(ByVal value As ImageSource)
123 | imgLeft.Source = value
124 | End Set
125 | End Property '图标
126 | Public Property LogoSize As Double
127 | Get
128 | Return imgLeft.Height
129 | End Get
130 | Set(ByVal value As Double)
131 | imgLeft.Height = value
132 | imgLeft.Width = value
133 | End Set
134 | End Property '图标尺寸
135 | Public Property ButtonLogo As ImageSource
136 | Get
137 | Return btnRight.Source
138 | End Get
139 | Set(ByVal value As ImageSource)
140 | btnRight.Source = value
141 | End Set
142 | End Property '按钮图标
143 | Public Property ButtonLogoSize As Double
144 | Get
145 | Return btnRight.Height
146 | End Get
147 | Set(ByVal value As Double)
148 | btnRight.Height = value
149 | btnRight.Width = value
150 | End Set
151 | End Property '按钮图标尺寸
152 | Public Property ButtonBack As Brush
153 | Get
154 | Return border.Background
155 | End Get
156 | Set(ByVal value As Brush)
157 | border.Background = value
158 | End Set
159 | End Property '按钮背景颜色
160 | Public AtLeastCheck As Boolean = True '是否必须有一项被选中
161 | Public Version As New MCVersion("")
162 |
163 | #End Region
164 |
165 | '自定义事件
166 | Public Sub RaiseChange()
167 | RaiseEvent Change(Me, Nothing)
168 | End Sub '用于其它控件来引发本控件的Change事件
169 | Private Sub Refresh()
170 | Dim shouldOpacity As Double = 0
171 | If Me.IsMouseOver Then shouldOpacity = 0.1
172 | If Me._Checked Then shouldOpacity = shouldOpacity / 2 + 0.14
173 | If shouldOpacity = labBack.Opacity Then
174 | AniStop("Li" & Me.Name & "Refresh")
175 | Exit Sub
176 | End If
177 | AniStart({
178 | AaOpacity(labBack, shouldOpacity - labBack.Opacity, 100)
179 | }, "Li" & Me.Name & "Refresh", False)
180 | End Sub
181 | Private Sub btnRight_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles border.MouseLeftButtonDown
182 | RaiseEvent ButtonClick(Me, e)
183 | End Sub
184 |
185 | '系统事件
186 | '改成MouseDown是因为拖动滚动条后在其上释放鼠标会导致点击
187 | Private Sub ListItem_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles mouseCheck.MouseLeftButtonDown
188 | If CanCheck Then
189 | Me.Checked = True
190 | RaiseEvent Click(Me, e)
191 | End If
192 | End Sub
193 | Private Sub imgLeft_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles imgLeft.MouseLeftButtonDown
194 | RaiseEvent IconClick(Me, e)
195 | ListItem_MouseUp(sender, e)
196 | End Sub
197 | Private Sub ListItem_SizeChanged(ByVal sender As Object, ByVal e As System.Windows.SizeChangedEventArgs) Handles Me.SizeChanged
198 | panBack.Width = Me.Width + 0.51 '防止按钮莫名显示越界
199 | SetLeft(border, Me.ActualWidth - 40)
200 | End Sub
201 | Private Sub ListItem_MouseEnter(ByVal sender As Object, ByVal e As System.Windows.Input.MouseEventArgs) Handles Me.MouseEnter
202 | If ShowButton Then
203 | AniStart({
204 | AaX(border, Me.ActualWidth - 81 - border.Margin.Left, 200, , New AniEaseJumpEnd(0.6))
205 | }, "Li" & Me.Name & "PointChange", False)
206 | End If
207 | Refresh()
208 | End Sub
209 | Private Sub ListItem_MouseLeave(ByVal sender As Object, ByVal e As System.Windows.Input.MouseEventArgs) Handles Me.MouseLeave
210 | If Me.ActualWidth = 0 Then
211 | '防止初始化加载
212 | Refresh()
213 | Exit Sub
214 | End If
215 | AniStart({
216 | AaX(border, Me.ActualWidth - 40 - border.Margin.Left, 150, , New AniEaseStart)
217 | }, "Li" & Me.Name & "PointChange", False)
218 | Refresh()
219 | End Sub
220 |
221 | End Class
222 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Base/Loading.xaml.vb:
--------------------------------------------------------------------------------
1 | Public Class Loading
2 |
3 | End Class
4 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Base/MetroMsgbox.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Base/MetroMsgbox.xaml.vb:
--------------------------------------------------------------------------------
1 | Public Class MetroMsgbox
2 |
3 | Private MyConverter As MyMsgboxConverter
4 |
5 | Public Sub New(ByVal Converter As MyMsgboxConverter)
6 | InitializeComponent()
7 | btn1.Name = btn1.Name & GetUUID()
8 | btn2.Name = btn2.Name & GetUUID()
9 | btn3.Name = btn3.Name & GetUUID()
10 | MyConverter = Converter
11 | labTitle.Text = Converter.Title
12 | labCaption.Text = Converter.Caption
13 | btn1.Text = Converter.Button1
14 | If Converter.IsWarn Then btn1.ColorType = Button.State.RED
15 | btn2.Text = Converter.Button2
16 | btn3.Text = Converter.Button3
17 | btn2.Visibility = If(Converter.Button2 = "", Visibility.Collapsed, Visibility.Visible)
18 | btn3.Visibility = If(Converter.Button3 = "", Visibility.Collapsed, Visibility.Visible)
19 | End Sub
20 |
21 | Private Sub Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Loaded
22 | Try
23 | log("[MsgBox] 显示弹窗:" & labTitle.Text)
24 | log("[MsgBox] 弹窗内容:" & Mid(labCaption.Text, 1, 400) & If(Len(labCaption.Text) > 400, "...", ""))
25 | If panCaption.ActualWidth = panMain.ActualWidth Then panMain.Width = panMain.ActualWidth + 75
26 | panMain.UpdateLayout()
27 | '配色初始化
28 | If btn2.IsVisible And Not btn1.ColorType = Button.State.RED Then btn1.ColorType = Button.State.HIGHLIGHT
29 | '延时执行的动画
30 | Me.Name = "frm" & GetUUID()
31 | AniStart({
32 | AaBackGround(Me, New MyColor(20, 0, 0, 0), 500, , New AniEaseStart),
33 | AaBackGround(panMain, New MyColor(255, 0, 0, 0), 300, , New AniEaseStart),
34 | AaOpacity(shadow, 0.75, 600, 150),
35 | AaWidth(line, panMain.ActualWidth - 40, 350, 150, New AniEaseEnd),
36 | AaOpacity(line, 1, 250, 150),
37 | AaWidth(labTitle, labTitle.ActualWidth, 250, 200, New AniEaseEnd),
38 | AaOpacity(labTitle, 1, 200, 200),
39 | AaOpacity(panCaption, 1, 250, 250),
40 | AaHeight(btn1, btn1.ActualHeight, 150, 300),
41 | AaHeight(btn2, btn2.ActualHeight, 150, 350),
42 | AaHeight(btn3, btn3.ActualHeight, 150, 400)
43 | }, "MsgboxStart" & Me.Name)
44 | '动画初始化
45 | panBtn.Height = panBtn.ActualHeight
46 | btn1.Height = 0
47 | btn2.Height = 0
48 | btn3.Height = 0
49 | labTitle.Width = 0
50 | labTitle.Opacity = 0
51 | labTitle.TextWrapping = TextWrapping.NoWrap
52 | panCaption.Opacity = 0
53 | Catch ex As Exception
54 | ExShow(ex, "弹窗显示失败", ErrorLevel.AllUsers)
55 | End Try
56 | End Sub
57 | Private Sub CloseWindow()
58 | log("[MsgBox] 关闭弹窗,返回值:" & MyConverter.ReturnCode)
59 | AniStart({
60 | AaBackGround(Me, New MyColor(-20, 0, 0, 0), 300, , New AniEaseStart),
61 | AaBackGround(panMain, New MyColor(-255, 0, 0, 0), 300, 100, New AniEaseStart),
62 | AaOpacity(shadow, -0.75, 150),
63 | AaWidth(line, -line.ActualWidth, 250, , New AniEaseStart),
64 | AaOpacity(line, -1, 150, 100),
65 | AaWidth(labTitle, -labTitle.ActualWidth, 250),
66 | AaOpacity(labTitle, -1, 200),
67 | AaOpacity(panCaption, -1, 200),
68 | AaHeight(btn1, -btn1.ActualHeight, 150, 60),
69 | AaHeight(btn2, -btn2.ActualHeight, 150, 30),
70 | AaHeight(btn3, -btn3.ActualHeight, 150),
71 | AaCode({"Close", Me}, , True)
72 | }, "MsgboxClose" & Me.Name)
73 | End Sub
74 |
75 | Private Sub MetroMsgbox_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Input.KeyEventArgs) Handles Me.KeyDown
76 | If e.Key = Key.Enter Then btn1_Click()
77 | End Sub
78 | Private Sub btn1_Click() Handles btn1.Click
79 | If MyConverter.IsExited Then Exit Sub
80 | MyConverter.IsExited = True
81 | MyConverter.ReturnCode = 1
82 | CloseWindow()
83 | End Sub
84 | Private Sub btn2_Click() Handles btn2.Click
85 | If MyConverter.IsExited Then Exit Sub
86 | MyConverter.IsExited = True
87 | MyConverter.ReturnCode = 2
88 | CloseWindow()
89 | End Sub
90 | Private Sub btn3_Click() Handles btn3.Click
91 | If MyConverter.IsExited Then Exit Sub
92 | MyConverter.IsExited = True
93 | MyConverter.ReturnCode = 3
94 | CloseWindow()
95 | End Sub
96 |
97 | End Class
98 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Base/Radiobox.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Base/Radiobox.xaml.vb:
--------------------------------------------------------------------------------
1 | Public Class Radiobox
2 |
3 | Public Event Change(ByVal sender As Object, ByVal raiseByMouse As Boolean)
4 |
5 | '自定义属性
6 | Private _Checked As Boolean = False '是否选中
7 | Public Property Checked As Boolean
8 | Get
9 | Return _Checked
10 | End Get
11 | Set(ByVal value As Boolean)
12 | SetChecked(value, False)
13 | End Set
14 | End Property
15 | Public Sub SetChecked(ByVal value As Boolean, ByVal raiseByHand As Boolean)
16 | If Not value = _Checked Then '只有变更时才执行
17 | _Checked = value
18 | If Me.IsLoaded Then '防止默认属性加载时导致错误
19 | RaiseEvent Change(Me, raiseByHand)
20 | '同一容器中保证只有1个单选框选中
21 | Dim parentControl As Object = Me.Parent
22 | If IsNothing(parentControl) Then Exit Sub
23 | Dim checkedControl As ArrayList = New ArrayList
24 | Dim checkedCount As Byte = 0
25 | '统计单选框控件与选中个数
26 | For Each con In parentControl.Children
27 | If con.GetType.Name = "Radiobox" Then
28 | checkedControl.Add(con)
29 | If con.Checked Then checkedCount = checkedCount + 1
30 | End If
31 | Next
32 | Select Case checkedCount
33 | Case 0 '没有选中项目
34 | checkedControl(0).Checked = True
35 | Case Is > 1 '选中项目多于1个
36 | If Me.Checked Then
37 | '如果本控件选中则取消其它所有控件的选中
38 | For Each con As Radiobox In checkedControl
39 | If con.Checked And Not con.Equals(Me) Then con.Checked = False
40 | Next
41 | Else
42 | '如果本控件未选中则只保留第一个选中的控件
43 | checkedCount = False '重复使用变量,实则统计是否为第一个选中控件
44 | For Each con As Radiobox In checkedControl
45 | If con.Checked Then
46 | If checkedCount Then
47 | con.Checked = False '修改Checked会自动触发Change事件,所以不用额外触发
48 | Else
49 | checkedCount = True
50 | End If
51 | End If
52 | Next
53 | End If
54 | End Select
55 | End If
56 |
57 | If Me.IsLoaded And UseControlAnimation Then '防止默认属性变更触发动画
58 | If _Checked Then
59 | AniStop("Ra" & Me.Name & "CheckedChange")
60 | AniStart({
61 | AaScale(border, 4 / border.Width - 1, 140),
62 | AaOpacity(inner, 1 - inner.Opacity, 1, , , True),
63 | AaScale(inner, 10 - inner.Width, 140, , , , True),
64 | AaScale(border, 14 / border.Width, 140)
65 | }, "Ra" & Me.Name & "CheckedChange")
66 | Else
67 | AniStop("Ra" & Me.Name & "CheckedChange")
68 | AniStart({
69 | AaScale(border, 4 / border.Width - 1, 140),
70 | AaScale(inner, 4 - inner.Width, 40, 100, , , True),
71 | AaOpacity(inner, -inner.Opacity, 1, , , True),
72 | AaScale(border, 14 / border.Width, 140)
73 | }, "Ra" & Me.Name & "CheckedChange")
74 | End If
75 | Else
76 | inner.Opacity = If(_Checked, 1, 0)
77 | End If
78 | End If
79 | End Sub
80 | Public Property Context As String
81 | Get
82 | Return label.Content
83 | End Get
84 | Set(ByVal value As String)
85 | label.Content = value
86 | End Set
87 | End Property '内容
88 |
89 | '自定义事件
90 | Public Sub RaiseChange()
91 | RaiseEvent Change(Me, False)
92 | End Sub '用于其它控件来引发本控件的Change事件
93 |
94 | '默认事件
95 | Private Sub Radiobox_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles Me.MouseLeftButtonDown
96 | SetChecked(True, True)
97 | End Sub
98 | Private Sub Radiobox_IsEnabledChanged(ByVal sender As Object, ByVal e As System.Windows.DependencyPropertyChangedEventArgs) Handles Me.IsEnabledChanged
99 | If Me.IsLoaded And UseControlAnimation Then '防止默认属性变更触发动画
100 | If Me.IsEnabled Then
101 | AniStop("Ra" & Me.Name & "PointChange")
102 | AniStart({
103 | AaBorderBrush(border, New MyColor(50, 50, 50) - border.BorderBrush, 150),
104 | AaStroke(inner, New MyColor(50, 50, 50) - inner.Stroke, 150),
105 | AaForeGround(label, New MyColor(50, 50, 50) - label.Foreground, 150)
106 | }, "Ra" & Me.Name & "PointChange")
107 | Else
108 | AniStop("Ra" & Me.Name & "PointChange")
109 | AniStart({
110 | AaBorderBrush(border, New MyColor(145, 145, 145) - border.BorderBrush, 150),
111 | AaStroke(inner, New MyColor(145, 145, 145) - inner.Stroke, 150),
112 | AaForeGround(label, New MyColor(145, 145, 145) - label.Foreground, 150)
113 | }, "Ra" & Me.Name & "PointChange")
114 | End If
115 | Else
116 | If Me.IsEnabled Then
117 | inner.Stroke = New MyColor(50, 50, 50)
118 | border.BorderBrush = New MyColor(50, 50, 50)
119 | label.Foreground = New MyColor(50, 50, 50)
120 | Else
121 | inner.Stroke = New MyColor(145, 145, 145)
122 | border.BorderBrush = New MyColor(145, 145, 145)
123 | label.Foreground = New MyColor(145, 145, 145)
124 | End If
125 | End If
126 | End Sub
127 |
128 | '鼠标指向
129 | Private Sub Radiobox_MouseEnter(ByVal sender As Object, ByVal e As System.Windows.Input.MouseEventArgs) Handles Me.MouseEnter
130 | If Me.Name = "" Then Me.Name = "Radio" & GetUUID()
131 | AniStop("Ra" & Me.Name & "PointChange")
132 | AniStart({
133 | AaOpacity(panMain, 1 - panMain.Opacity, 200)
134 | }, "Ra" & Me.Name & "PointChange")
135 | End Sub
136 | Private Sub Radiobox_MouseLeave(ByVal sender As Object, ByVal e As System.Windows.Input.MouseEventArgs) Handles Me.MouseLeave
137 | 'MouseLeave比IsEnabledChanged后执行,所以如果自定义事件修改了IsEnabled,将导致颜色显示错误,这个判断语句为了修复此bug
138 | If Me.IsEnabled Then
139 | AniStop("Ra" & Me.Name & "PointChange")
140 | AniStart({
141 | AaOpacity(panMain, 0.8 - panMain.Opacity, 200)
142 | }, "Ra" & Me.Name & "PointChange")
143 | End If
144 | End Sub
145 |
146 | End Class
--------------------------------------------------------------------------------
/Plain Craft Launcher/Base/RightList.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Base/RightList.xaml.vb:
--------------------------------------------------------------------------------
1 | Public Class RightList
2 |
3 | End Class
4 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Base/RoundProcessbar.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Base/RoundProcessbar.xaml.vb:
--------------------------------------------------------------------------------
1 | Public Class RoundProcessbar
2 |
3 | '自定义属性
4 | Private _Max As Integer = 100 '最大值
5 | Public Property Max As Integer
6 | Get
7 | Return _Max
8 | End Get
9 | Set(ByVal value As Integer)
10 | _Max = value
11 | Refresh()
12 | End Set
13 | End Property
14 | Private _Value As Double = 66 '当前值
15 | Public Property Value As Double
16 | Get
17 | Return _Value
18 | End Get
19 | Set(ByVal value As Double)
20 | Me._Value = value
21 | Refresh()
22 | End Set
23 | End Property
24 | Private _Radius As Integer = 10 '半径
25 | Public Property Radius As Integer
26 | Get
27 | Return _Radius
28 | End Get
29 | Set(ByVal value As Integer)
30 | _Radius = value
31 | Refresh()
32 | End Set
33 | End Property
34 | Private _ShowAtTaskbar As Boolean = False '是否绑定到任务栏
35 | Public Property ShowAtTaskbar As Boolean
36 | Get
37 | Return _ShowAtTaskbar
38 | End Get
39 | Set(ByVal value As Boolean)
40 | If value <> Me._ShowAtTaskbar Then
41 | _ShowAtTaskbar = value
42 | Refresh()
43 | End If
44 | End Set
45 | End Property
46 | Private _TaskbarState As Integer = TaskbarItemProgressState.Normal '显示在任务栏的状态
47 | Public Property TaskbarState As TaskbarItemProgressState
48 | Get
49 | Return _TaskbarState
50 | End Get
51 | Set(ByVal value As TaskbarItemProgressState)
52 | If _ShowAtTaskbar Then
53 | If Not value = _TaskbarState Then
54 | Me._TaskbarState = value
55 | Refresh()
56 | End If
57 | Else
58 | Me._TaskbarState = value
59 | End If
60 | End Set
61 | End Property
62 | Private _OverValue As Boolean = False '是否允许超范围的Value
63 | Public Property OverValue As Boolean
64 | Get
65 | Return _OverValue
66 | End Get
67 | Set(ByVal value As Boolean)
68 | If value <> Me._OverValue Then
69 | _OverValue = value
70 | Refresh()
71 | End If
72 | End Set
73 | End Property
74 |
75 | '默认事件
76 | Private Sub RoundProcessbar_SizeChanged(ByVal sender As Object, ByVal e As System.Windows.SizeChangedEventArgs) Handles Me.SizeChanged
77 | Refresh()
78 | End Sub
79 |
80 | '自定义事件
81 | Private Sub Refresh()
82 | Me._Value = If(Me._OverValue, Me._Value, MathRange(Me._Value, 0, Me._Max))
83 | Dim Angle As Double = 2 * Math.PI * MathRange(Me._Value / Me._Max, 0, 1) '计算饼状图角度
84 | If Me._Value / Me._Max > 0.5 Then
85 | Round.Data = New GeometryConverter().ConvertFrom( _
86 | "M" & Me.Width / 2 & ",0" & _
87 | "L" & Me.Width / 2 & "," & Me._Radius & _
88 | "A" & Me.Width / 2 - Me._Radius & "," & Me.Width / 2 - Me._Radius & ",0,0,1," & Me.Width / 2 & "," & Me.Width - Me._Radius & _
89 | "A" & Me.Width / 2 - Me._Radius & "," & Me.Width / 2 - Me._Radius & ",0,0,1," & Me.Width / 2 + (Me.Width / 2 - Me._Radius) * Math.Sin(Angle) & "," & Me.Width / 2 - (Me.Width / 2 - Me._Radius) * Math.Cos(Angle) & _
90 | "L" & Me.Width / 2 * (1 + Math.Sin(Angle)) & "," & Me.Width / 2 * (1 - Math.Cos(Angle)) & _
91 | "A" & Me.Width / 2 & "," & Me.Width / 2 & ",0,0,0," & Me.Width / 2 & "," & Me.Width & _
92 | "A" & Me.Width / 2 & "," & Me.Width / 2 & ",0,0,0," & Me.Width / 2 & ",0" & _
93 | "Z")
94 | Else
95 | Round.Data = New GeometryConverter().ConvertFrom( _
96 | "M" & Me.Width / 2 & ",0" & _
97 | "L" & Me.Width / 2 & "," & Me._Radius & _
98 | "A" & Me.Width / 2 - Me._Radius & "," & Me.Width / 2 - Me._Radius & ",0,0,1," & Me.Width / 2 + (Me.Width / 2 - Me._Radius) * Math.Sin(Angle) & "," & Me.Width / 2 - (Me.Width / 2 - Me._Radius) * Math.Cos(Angle) & _
99 | "L" & Me.Width / 2 * (1 + Math.Sin(Angle)) & "," & Me.Width / 2 * (1 - Math.Cos(Angle)) & _
100 | "A" & Me.Width / 2 & "," & Me.Width / 2 & ",0,0,0," & Me.Width / 2 & ",0" & _
101 | "Z")
102 | End If
103 |
104 | If _ShowAtTaskbar Then '如果在任务栏显示
105 | frmMain.Dispatcher.Invoke(Sub()
106 | If Me._Value / Me._Max < 0.0001 Then '没有进度时(兼容<0的Value)
107 | frmMain.TaskbarItemInfo.ProgressState = TaskbarItemProgressState.Indeterminate '设置为准备模式
108 | Else
109 | frmMain.TaskbarItemInfo.ProgressValue = MathRange(Me._Value, 0) / Me._Max '设置进度
110 | frmMain.TaskbarItemInfo.ProgressState = Me._TaskbarState '设置模式
111 | End If
112 | End Sub)
113 | End If
114 |
115 | End Sub '重绘饼状图
116 |
117 | End Class
118 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Base/Selecter.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Base/Selecter.xaml.vb:
--------------------------------------------------------------------------------
1 | Public Class Selecter
2 |
3 | Public Event SelectionChange(ByVal Selection As String)
4 | Public Event Click(ByVal Selection As String, ByVal Index As Integer)
5 | Public NowSelect As New Label
6 |
7 | #Region "属性"
8 | '线条宽度
9 | Public Property LineWidth As Integer
10 | Get
11 | Return lineSelect.Width
12 | End Get
13 | Set(ByVal value As Integer)
14 | lineSelect.Width = value
15 | End Set
16 | End Property
17 | '显示的选项
18 | Private _ShowList As Object() = {}
19 | Public Property ShowList As Object()
20 | Get
21 | Return _ShowList
22 | End Get
23 | Set(ByVal value As Object())
24 | If _ShowList.Equals(value) Then Exit Property
25 | _ShowList = value
26 |
27 | Try
28 | panLabs.Children.Clear() '清空已有选项
29 | Dim i = 0
30 | For Each selection As String In value
31 | '每个选项
32 | Dim newLabel As New Label With {.Padding = New Thickness(0), .Name = "LabSelect" & GetUUID(), .Content = selection, .Height = 32, .HorizontalContentAlignment = HorizontalAlignment.Left, .VerticalContentAlignment = VerticalAlignment.Center, .Background = New MyColor(1, 200, 200, 200), .Opacity = 0.5, .FontSize = panBack.FontSize}
33 | newLabel.SetBinding(Control.ForegroundProperty, New Binding("Foreground") With {.ElementName = "panBack"})
34 | If HintList.Length > i Then newLabel.ToolTip = HintList(i)
35 | AddHandler newLabel.MouseEnter, AddressOf LabMouseEnter
36 | AddHandler newLabel.MouseLeave, AddressOf LabMouseLeave
37 | AddHandler newLabel.MouseUp, AddressOf LabMouseUp
38 | '添加Label
39 | panLabs.Children.Add(newLabel)
40 | i = i + 1
41 | Next
42 | NowSelect = panLabs.Children(0)
43 | SelectIndex = 0
44 | AniStop(Me.Name)
45 | NowSelect.Opacity = 1
46 | SetTop(lineSelect, 4)
47 | panLabs.IsHitTestVisible = True
48 | Catch ex As Exception
49 | ExShow(ex, "设置选择条选项失败", ErrorLevel.MsgboxAndFeedback)
50 | End Try
51 | End Set
52 | End Property
53 | '选择选项
54 | Public SelectIndexName As String = ""
55 | Private _SelectIndex As Byte = 0
56 | Public Property SelectIndex As Byte
57 | Get
58 | Return _SelectIndex
59 | End Get
60 | Set(ByVal value As Byte)
61 | Try
62 | value = MathRange(value, 0, panLabs.Children.Count - 1)
63 | Dim sender As Label = panLabs.Children(value)
64 | If sender.Content.Equals(SelectIndexName) Then Exit Property
65 | SelectIndexName = sender.Content
66 | If If(IsNothing(Me.Name), True, Me.Name = "selecter") Then Me.Name = "selecter" & GetUUID()
67 | '动画
68 | panLabs.IsHitTestVisible = False
69 | Dim AnimationList As New ArrayList
70 | For Each Lab As Label In panLabs.Children
71 | AniStart({AaOpacity(Lab, If(Lab.Equals(sender), 1, 0.5) - Lab.Opacity, 100)}, Lab.Name, False)
72 | Next
73 | AnimationList.Add(AaY(lineSelect, 4 + panLabs.Children.IndexOf(sender) * 32 - lineSelect.Margin.Top, , , New AniEaseJumpEnd(0.7)))
74 | AnimationList.Add(AaCode({"IsHitTestVisible", panLabs, True}, , True))
75 | AniStart(AnimationList, Me.Name)
76 | '切换选项
77 | NowSelect = sender
78 | '引发事件
79 | _SelectIndex = panLabs.Children.IndexOf(sender)
80 | RaiseEvent SelectionChange(NowSelect.Content)
81 | Catch ex As Exception
82 | ExShow(ex, "切换选择条选项失败", ErrorLevel.MsgboxAndFeedback)
83 | End Try
84 | End Set
85 | End Property
86 | '点击可以改变
87 | Public Property ClickToChange As Boolean = True
88 | '各个选项的指向提示
89 | Public Property HintList As String() = {}
90 | #End Region
91 |
92 | Private Sub LabMouseEnter(ByVal sender As Label, ByVal e As System.Windows.Input.MouseEventArgs)
93 | If Not NowSelect.Equals(sender) Then
94 | AniStart({AaOpacity(sender, 0.8 - sender.Opacity, 70)}, sender.Name)
95 | End If
96 | End Sub
97 | Private Sub LabMouseLeave(ByVal sender As Label, ByVal e As System.Windows.Input.MouseEventArgs)
98 | If Not NowSelect.Equals(sender) Then
99 | AniStart({AaOpacity(sender, 0.5 - sender.Opacity, 70)}, sender.Name)
100 | End If
101 | End Sub
102 | Private Sub LabMouseUp(ByVal sender As Label, ByVal e As System.Windows.Input.MouseButtonEventArgs)
103 | If ClickToChange And Not NowSelect.Equals(sender) Then SelectIndex = panLabs.Children.IndexOf(sender)
104 | RaiseEvent Click(sender.Content, panLabs.Children.IndexOf(sender))
105 | End Sub
106 | End Class
107 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Base/Timer.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Base/Timer.xaml.vb:
--------------------------------------------------------------------------------
1 | Imports System.Windows.Threading
2 |
3 | Public Class Timer
4 |
5 | '声明
6 | Public Event Tick() '自定义事件
7 |
8 | Public Timer As New DispatcherTimer() '时钟
9 | Public TimerLoaded As Boolean = False '是否已经加载过了
10 |
11 | '自定义属性
12 | Private _Interval As Integer = 1000 '执行间隔
13 | Public Property Interval As Integer
14 | Get
15 | Try
16 | NameShow.Content = If(Me.Name.StartsWith("Timer") Or Me.Name.StartsWith("timer"), Me.Name.Remove(0, 5), Me.Name)
17 | Catch ex As Exception
18 | NameShow.Content = Me.Name
19 | End Try
20 | Return _Interval
21 | End Get
22 | Set(ByVal value As Integer)
23 | _Interval = value
24 | Timer.Interval = TimeSpan.FromMilliseconds(_Interval) '设置时钟Interval
25 | TimeShow.Content = If(_Interval < 11, "MAX", Interval) '设置显示的Interval(由于每秒最多执行64次,故设置10及以下显示MAX)
26 | End Set
27 | End Property
28 |
29 | '默认属性
30 | Private Sub Timer_IsEnabledChanged(ByVal sender As Object, ByVal e As System.Windows.DependencyPropertyChangedEventArgs) Handles Me.IsEnabledChanged
31 | Timer.IsEnabled = Me.IsEnabled '修改时钟Enabled
32 | If Me.IsEnabled Then '修改显示颜色
33 | Me.Background = New MyColor(Color.FromArgb(160, 85, 164, 255)) '蓝色
34 | Me.BorderBrush = New MyColor(Color.FromArgb(220, 10, 120, 255))
35 | Else
36 | Me.Background = New MyColor(Color.FromArgb(160, 255, 20, 0)) '红色
37 | Me.BorderBrush = New MyColor(Color.FromArgb(220, 255, 20, 0))
38 | End If
39 | End Sub
40 |
41 | '自定义事件
42 | '''
43 | ''' 重新开始本次计时。
44 | '''
45 | '''
46 | Public Sub Reset()
47 | Timer.Stop()
48 | Timer.Start()
49 | Timer.IsEnabled = Me.IsEnabled '修改时钟Enabled
50 | End Sub
51 |
52 | '默认事件
53 | Private Sub Timer_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
54 | If TimerLoaded Then Exit Sub
55 |
56 | '初始化时钟
57 | TimerLoaded = True
58 | Timer.Interval = TimeSpan.FromMilliseconds(_Interval)
59 | AddHandler Timer.Tick, Sub() RaiseEvent Tick()
60 | Timer.Start()
61 | Timer.IsEnabled = Me.IsEnabled '修改时钟Enabled
62 |
63 | '修改Name显示
64 | Try
65 | NameShow.Content = If(Me.Name.StartsWith("Timer") Or Me.Name.StartsWith("timer"), Me.Name.Remove(0, 5), Me.Name)
66 | Catch ex As Exception
67 | NameShow.Content = Me.Name
68 | End Try
69 |
70 | End Sub
71 |
72 | End Class
73 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Base/VScroll.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Back.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Block-Add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Block-Add.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Block-Anvil.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Block-Anvil.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Block-CobbleStone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Block-CobbleStone.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Block-CommandBlock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Block-CommandBlock.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Block-Dirt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Block-Dirt.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Block-False.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Block-False.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Block-Glass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Block-Glass.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Block-Grass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Block-Grass.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Block-RedstoneBlock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Block-RedstoneBlock.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Block-Settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Block-Settings.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Block-True.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Block-True.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Checked-Black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Checked-Black.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Checked-Blue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Checked-Blue.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Checked-Gray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Checked-Gray.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/False.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/False.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Hint-Critical.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Hint-Critical.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Hint-Finish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Hint-Finish.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Hint-Info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Hint-Info.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Hint-Warn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Hint-Warn.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Infobox-Bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Infobox-Bg.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/LeftBar-BG_Black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/LeftBar-BG_Black.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/LeftBar-BG_Blue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/LeftBar-BG_Blue.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/LeftBar-BG_DeathBlue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/LeftBar-BG_DeathBlue.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/LeftBar-BG_Green.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/LeftBar-BG_Green.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/LeftBar-BG_Hunluan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/LeftBar-BG_Hunluan.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/LeftBar-BG_Orange.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/LeftBar-BG_Orange.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Stats-Fail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Stats-Fail.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Stats-Finish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Stats-Finish.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Stats-Retry.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Stats-Retry.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Stats-Running.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Stats-Running.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/Stats-Wait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/Stats-Wait.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/True.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/True.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/alex.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/alex.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/appbar.inbox.in.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/appbar.inbox.in.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/appbar.settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/appbar.settings.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/icon.ico
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/imgMusic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/imgMusic.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/imgTopClose.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/imgTopClose.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/imgTopMin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/imgTopMin.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/infobox-blue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/infobox-blue.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/infobox-brown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/infobox-brown.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/infobox-green.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/infobox-green.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/infobox-orange.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/infobox-orange.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/infobox-purple.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/infobox-purple.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/infobox-yellow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/infobox-yellow.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/Images/steve.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Images/steve.png
--------------------------------------------------------------------------------
/Plain Craft Launcher/My Project/AssemblyInfo.vb:
--------------------------------------------------------------------------------
1 | Imports System.Reflection
2 | Imports System.Runtime.InteropServices
3 | Imports System.Resources
4 |
5 | ' 有关程序集的常规信息通过下列特性集
6 | ' 控制。更改这些特性值可修改
7 | ' 与程序集关联的信息。
8 |
9 | ' 查看程序集特性的值
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | '若要开始生成可本地化的应用程序,请
20 | '在您的 .vbproj 文件中的 内设置 CultureYouAreCodingWith。
21 | '例如,如果您在源文件中使用的是美国英语,
22 | '请将 设置为“en-US”。然后取消下面对
23 | 'NeutralResourceLanguage 特性的注释。更新下面行中的“en-US”
24 | '以与项目文件中的 UICulture 设置匹配。
25 |
26 | '
27 |
28 |
29 | 'ThemeInfo 特性说明在何处可以找到任何特定于主题的和一般性的资源词典。
30 | '第一个参数: 特定于主题的资源词典的位置
31 | '(在页面或应用程序资源词典中
32 | ' 未找到某个资源的情况下使用)
33 |
34 | '第二个参数: 一般性资源词典的位置
35 | '(未在页、应用程序和任何特定于主题的
36 | '资源词典中找到资源时使用)
37 |
38 |
39 |
40 |
41 | '如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
42 |
43 |
44 | ' 程序集的版本信息由下面四个值组成:
45 | '
46 | ' 主版本
47 | ' 次版本
48 | ' 内部版本号
49 | ' 修订号
50 | '
51 | ' 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
52 | ' 方法是按如下所示使用“*”:
53 | '
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/My Project/MyExtensions/MyWpfExtension.vb:
--------------------------------------------------------------------------------
1 | #If _MyType <> "Empty" Then
2 |
3 | Namespace My
4 | '''
5 | ''' 用于定义“我的 WPF 命名空间”中的可用属性的模块
6 | '''
7 | '''
8 | _
9 | Module MyWpfExtension
10 | Private s_Computer As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Devices.Computer)
11 | Private s_User As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.User)
12 | Private s_Windows As New ThreadSafeObjectProvider(Of MyWindows)
13 | Private s_Log As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.Log)
14 | '''
15 | ''' 返回正在运行的应用程序的应用程序对象
16 | '''
17 | _
18 | Friend ReadOnly Property Application() As Application
19 | Get
20 | Return CType(Global.System.Windows.Application.Current, Application)
21 | End Get
22 | End Property
23 | '''
24 | ''' 返回有关主机计算机的信息。
25 | '''
26 | _
27 | Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.Computer
28 | Get
29 | Return s_Computer.GetInstance()
30 | End Get
31 | End Property
32 | '''
33 | ''' 返回当前用户的信息。如果希望使用当前的
34 | ''' Windows 用户凭据来运行应用程序,请调用 My.User.InitializeWithWindowsUser()。
35 | '''
36 | _
37 | Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.User
38 | Get
39 | Return s_User.GetInstance()
40 | End Get
41 | End Property
42 | '''
43 | ''' 返回应用程序日志。可以使用应用程序的配置文件配置侦听器。
44 | '''
45 | _
46 | Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.Log
47 | Get
48 | Return s_Log.GetInstance()
49 | End Get
50 | End Property
51 |
52 | '''
53 | ''' 返回项目中定义的 Windows 集合。
54 | '''
55 | _
56 | Friend ReadOnly Property Windows() As MyWindows
57 | _
58 | Get
59 | Return s_Windows.GetInstance()
60 | End Get
61 | End Property
62 | _
63 | _
64 | Friend NotInheritable Class MyWindows
65 | _
66 | Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Window})(ByVal Instance As T) As T
67 | If Instance Is Nothing Then
68 | If s_WindowBeingCreated IsNot Nothing Then
69 | If s_WindowBeingCreated.ContainsKey(GetType(T)) = True Then
70 | Throw New Global.System.InvalidOperationException("The window cannot be accessed via My.Windows from the Window constructor.")
71 | End If
72 | Else
73 | s_WindowBeingCreated = New Global.System.Collections.Hashtable()
74 | End If
75 | s_WindowBeingCreated.Add(GetType(T), Nothing)
76 | Return New T()
77 | s_WindowBeingCreated.Remove(GetType(T))
78 | Else
79 | Return Instance
80 | End If
81 | End Function
82 | _
83 | _
84 | Private Sub Dispose__Instance__(Of T As Global.System.Windows.Window)(ByRef instance As T)
85 | instance = Nothing
86 | End Sub
87 | _
88 | _
89 | Public Sub New()
90 | MyBase.New()
91 | End Sub
92 | Private Shared s_WindowBeingCreated As Global.System.Collections.Hashtable
93 | Public Overrides Function Equals(ByVal o As Object) As Boolean
94 | Return MyBase.Equals(o)
95 | End Function
96 | Public Overrides Function GetHashCode() As Integer
97 | Return MyBase.GetHashCode
98 | End Function
99 | _
100 | _
101 | Friend Overloads Function [GetType]() As Global.System.Type
102 | Return GetType(MyWindows)
103 | End Function
104 | Public Overrides Function ToString() As String
105 | Return MyBase.ToString
106 | End Function
107 | End Class
108 | End Module
109 | End Namespace
110 | Partial Class Application
111 | Inherits Global.System.Windows.Application
112 | _
113 | _
114 | Friend ReadOnly Property Info() As Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo
115 | _
116 | Get
117 | Return New Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo(Global.System.Reflection.Assembly.GetExecutingAssembly())
118 | End Get
119 | End Property
120 | End Class
121 | #End If
--------------------------------------------------------------------------------
/Plain Craft Launcher/My Project/Resources.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' 此代码由工具生成。
4 | ' 运行时版本:4.0.30319.42000
5 | '
6 | ' 对此文件的更改可能会导致不正确的行为,并且如果
7 | ' 重新生成代码,这些更改将会丢失。
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 | Imports System
15 |
16 | Namespace My.Resources
17 |
18 | '此类是由 StronglyTypedResourceBuilder
19 | '类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | '若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | '(以 /str 作为命令选项),或重新生成 VS 项目。
22 | '''
23 | ''' 一个强类型的资源类,用于查找本地化的字符串等。
24 | '''
25 | _
29 | Friend Module Resources
30 |
31 | Private resourceMan As Global.System.Resources.ResourceManager
32 |
33 | Private resourceCulture As Global.System.Globalization.CultureInfo
34 |
35 | '''
36 | ''' 返回此类使用的缓存的 ResourceManager 实例。
37 | '''
38 | _
39 | Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
40 | Get
41 | If Object.ReferenceEquals(resourceMan, Nothing) Then
42 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("pcl.Resources", GetType(Resources).Assembly)
43 | resourceMan = temp
44 | End If
45 | Return resourceMan
46 | End Get
47 | End Property
48 |
49 | '''
50 | ''' 使用此强类型资源类,为所有资源查找
51 | ''' 重写当前线程的 CurrentUICulture 属性。
52 | '''
53 | _
54 | Friend Property Culture() As Global.System.Globalization.CultureInfo
55 | Get
56 | Return resourceCulture
57 | End Get
58 | Set
59 | resourceCulture = value
60 | End Set
61 | End Property
62 |
63 | '''
64 | ''' 查找 System.Byte[] 类型的本地化资源。
65 | '''
66 | Friend ReadOnly Property Ionic_Zip() As Byte()
67 | Get
68 | Dim obj As Object = ResourceManager.GetObject("Ionic_Zip", resourceCulture)
69 | Return CType(obj,Byte())
70 | End Get
71 | End Property
72 |
73 | '''
74 | ''' 查找 System.Byte[] 类型的本地化资源。
75 | '''
76 | Friend ReadOnly Property Newtonsoft_Json() As Byte()
77 | Get
78 | Dim obj As Object = ResourceManager.GetObject("Newtonsoft_Json", resourceCulture)
79 | Return CType(obj,Byte())
80 | End Get
81 | End Property
82 |
83 | '''
84 | ''' 查找 System.Byte[] 类型的本地化资源。
85 | '''
86 | Friend ReadOnly Property PCLAM() As Byte()
87 | Get
88 | Dim obj As Object = ResourceManager.GetObject("PCLAM", resourceCulture)
89 | Return CType(obj,Byte())
90 | End Get
91 | End Property
92 |
93 | '''
94 | ''' 查找 System.Byte[] 类型的本地化资源。
95 | '''
96 | Friend ReadOnly Property UpdateLog() As Byte()
97 | Get
98 | Dim obj As Object = ResourceManager.GetObject("UpdateLog", resourceCulture)
99 | Return CType(obj,Byte())
100 | End Get
101 | End Property
102 | End Module
103 | End Namespace
104 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/My Project/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\Ionic.Zip.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
123 |
124 |
125 | ..\Resources\Newtonsoft.Json.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
126 |
127 |
128 | ..\Resources\Plain Craft Launcher Admin Manager.exe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
129 |
130 |
131 | ..\Resources\UpdateLog.txt;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
132 |
133 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/My Project/Settings.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' 此代码由工具生成。
4 | ' 运行时版本:4.0.30319.42000
5 | '
6 | ' 对此文件的更改可能会导致不正确的行为,并且如果
7 | ' 重新生成代码,这些更改将会丢失。
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 |
16 | _
19 | Partial Friend NotInheritable Class Settings
20 | Inherits Global.System.Configuration.ApplicationSettingsBase
21 |
22 | Private Shared defaultInstance As Settings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New Settings()),Settings)
23 |
24 | #Region "My.Settings 自动保存功能"
25 | #If _MyType = "WindowsForms" Then
26 | Private Shared addedHandler As Boolean
27 |
28 | Private Shared addedHandlerLockObject As New Object
29 |
30 | _
31 | Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
32 | If My.Application.SaveMySettingsOnExit Then
33 | My.Settings.Save()
34 | End If
35 | End Sub
36 | #End If
37 | #End Region
38 |
39 | Public Shared ReadOnly Property [Default]() As Settings
40 | Get
41 |
42 | #If _MyType = "WindowsForms" Then
43 | If Not addedHandler Then
44 | SyncLock addedHandlerLockObject
45 | If Not addedHandler Then
46 | AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
47 | addedHandler = True
48 | End If
49 | End SyncLock
50 | End If
51 | #End If
52 | Return defaultInstance
53 | End Get
54 | End Property
55 | End Class
56 |
57 | Namespace My
58 |
59 | _
62 | Friend Module MySettingsProperty
63 |
64 | _
65 | Friend ReadOnly Property Settings() As Global.pcl.Settings
66 | Get
67 | Return Global.pcl.Settings.Default
68 | End Get
69 | End Property
70 | End Module
71 | End Namespace
72 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/My Project/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/My Project/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Pages/formDownloadLeft.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Pages/formDownloadRight.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Pages/formGuild.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | Minecraft 需要 Java 才能运行。在开始游戏前,你首先需要下载安装 Java。如果你已经安装了 Java,请点击“手动选择”进行查找。
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | 选择一个你喜欢的主题配色。稍后你可以在设置页面更改这些设置,或者自定义自己想要的主题配色。
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | 你是刚接触 Minecraft 不久的新玩家,还是一位熟知 Minecraft 的老玩家?PCL 将会为新玩家自动选择较为合适的配置,为老玩家提供更充分的自定义空间。
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | 是使用官方启动器的 Minecraft 文件夹,还是在当前目录下创建一个新的文件夹?稍后你可以在设置页面更改这个设置,或者添加其它的 Minecraft 文件夹。
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 | 请选择你希望的版本隔离模式。进行版本隔离后,版本的 MOD、存档、资源包等将分别保存在该版本的版本文件夹中,各个版本互不干涉(各个版本文件夹位置为 .minecraft/versions/版本名/ )。这在使用多个版本的 Forge 时可以有效防止 MOD 版本冲突,但也会因为存档、设置等无法跨版本带来一些麻烦。如果不清楚应该选什么,请选择“不隔离”。
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Pages/formHelpLeft.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Pages/formHelpLeft.xaml.vb:
--------------------------------------------------------------------------------
1 | Public Class formHelpLeft
2 |
3 | End Class
4 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Pages/formHomeLeft.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Pages/formHomeLeft.xaml.vb:
--------------------------------------------------------------------------------
1 | Public Class formHomeLeft
2 |
3 | Public LoadingItem As New ArrayList '正在加载的首页项目
4 | Public LoadedItem As New ArrayList '加载结束但没有编入随机位的首页项目
5 | Public RandomedItem As New ArrayList '已随机处理的首页项目
6 |
7 | Private ShowingCount As Integer = 0 '正在显示的首页项目计数,用于排布位置
8 | Private ShowingPage As Integer = 0 '正在显示的页码
9 |
10 | Private LoadedRefreshCount As Integer = 0 '刷新计数
11 |
12 | Public HideNotfull As Boolean = True
13 |
14 | Private Sub timerLoad_Tick() Handles timerLoad.Tick
15 | If MODE_OFFLINE Then Exit Sub
16 |
17 | '检查是否存在加载结束的项目(成功或是失败)
18 | If LoadingItem.Count > 0 Then
19 | For i = 0 To LoadingItem.Count - 1
20 | Dim item As InfoBoxSource = LoadingItem(i) '当前的InfoBox
21 | If IsNothing(item) Then Exit Sub
22 | frmStart.IsPushLoading = False
23 | Select Case item.State
24 | Case LoadState.Loaded
25 | '移动到加载结束的数组
26 | LoadingItem.Remove(item)
27 | LoadedItem.Add(item)
28 | i = i - 1
29 | Case LoadState.Failed
30 | '输出信息并移除
31 | log("[HomeLeft] 信息框加载失败:" & item.Source & " - " & item.Title, True)
32 | LoadingItem.Remove(item)
33 | i = i - 1
34 | End Select
35 | If i >= LoadingItem.Count - 1 Then Exit For
36 | Next i
37 | End If
38 |
39 | '检查是否存在可显示的项目
40 | Dim Count As Integer = 0
41 | Do While LoadedItem.Count > 0 And Count < 4
42 | Count = Count + 1
43 | '处理源
44 | Dim itemSource As InfoBoxSource = LoadedItem(RandomInteger(0, LoadedItem.Count - 1))
45 | LoadedItem.Remove(itemSource)
46 | RandomedItem.Add(itemSource)
47 | '处理新的控件
48 | Dim item As New InfoBox With {.Margin = New Thickness(0, 0, 15, 0), .UseLayoutRounding = False}
49 | item.Show(itemSource)
50 | '添加到 UI
51 | If ReadIni("setup", "HomeEnabled", "True") = "True" Then
52 | Select Case ShowingCount
53 | Case 0, 1
54 | If panTop.Children.Count < 2 Then SendStat("推荐源", "显示", item.Source & "(" & item.Title & ")") : item.IsSendStat = True
55 | panTop.Children.Add(item)
56 | ShowingCount = ShowingCount + 1
57 | Case 2
58 | If panBottom.Children.Count < 2 Then SendStat("推荐源", "显示", item.Source & "(" & item.Title & ")") : item.IsSendStat = True
59 | panBottom.Children.Add(item)
60 | ShowingCount = ShowingCount + 1
61 | Case 3
62 | If panBottom.Children.Count < 2 Then SendStat("推荐源", "显示", item.Source & "(" & item.Title & ")") : item.IsSendStat = True
63 | panBottom.Children.Add(item)
64 | ShowingCount = 0
65 | End Select
66 | End If
67 | Loop
68 |
69 | '检查是否需要刷新计数
70 | If Not RandomedItem.Count = LoadedRefreshCount Then
71 | LoadedRefreshCount = RandomedItem.Count
72 | '刷新页面计数器
73 | Dim NewPageAnimation As New ArrayList
74 | Do While panPage.Children.Count < If(HideNotfull, Math.Floor(LoadedRefreshCount / 4), Math.Floor((LoadedRefreshCount - 1) / 4) + 1)
75 | '添加新页面按钮
76 | Dim NewPage As Integer = panPage.Children.Count + 1 '新添加的页面编号
77 | Dim NewBorder As New Border With {.Name = "btnPage" & NewPage, .VerticalAlignment = VerticalAlignment.Center, .Height = 0, .Width = 0, .BorderThickness = New Thickness(2), .Margin = New Thickness(20 * (NewPage - 1) + 6, 0, 0, 0), .IsHitTestVisible = False, .HorizontalAlignment = HorizontalAlignment.Left, .RenderTransform = New RotateTransform(0), .RenderTransformOrigin = New Point(0.5, 0.5), .Background = New MyColor(128, 255, 255, 255), .UseLayoutRounding = True}
78 | NewBorder.SetResourceReference(BorderBrushProperty, "Color4")
79 | panPage.Children.Add(NewBorder)
80 | '按钮动画(每一页都按次序执行动画)
81 | NewPageAnimation.AddRange({
82 | AaWidth(panPage, 20, 300, , , True),
83 | AaWidth(NewBorder, 8, 250, 50),
84 | AaHeight(NewBorder, 8, 250, 50)
85 | })
86 | Loop
87 | If NewPageAnimation.Count > 0 Then AniStart(NewPageAnimation, "HomeLeftNewPage" & GetUUID()) '点点的动画
88 | ChangeWidth()
89 | End If
90 |
91 | End Sub
92 |
93 | Public Sub ChangeWidth() Handles panMain.Loaded
94 | '如果是离线模式或者没有推荐则直接隐藏,并且还顺便改变登录页大小
95 | Dim TotalCount As Integer = LoadingItem.Count + LoadedItem.Count + RandomedItem.Count
96 | If MODE_OFFLINE Or TotalCount = 0 Or ReadIni("setup", "HomeEnabled", "True") = "False" Then
97 | panMain.Visibility = Visibility.Collapsed
98 | Else
99 | panMain.Visibility = Visibility.Visible
100 | End If
101 | End Sub
102 |
103 | Private Sub StatShow() Handles panMain.Loaded
104 | Dim IsSendStat As Boolean = RandomInteger(1, 100) = 66 '1%的情况下反馈显示推荐源信息
105 | Dim Info As InfoBox
106 | If ShowingPage * 2 < panTop.Children.Count Then
107 | Info = CType(panTop.Children(ShowingPage * 2), InfoBox)
108 | If Info.IsSendStat = False Then
109 | Info.IsSendStat = True
110 | If IsSendStat Then SendStat("推荐源", "显示", Info.Source & "(" & Info.Title & ")")
111 | End If
112 | End If
113 | If ShowingPage * 2 + 1 < panTop.Children.Count Then
114 | Info = CType(panTop.Children(ShowingPage * 2 + 1), InfoBox)
115 | If Info.IsSendStat = False Then
116 | Info.IsSendStat = True
117 | If IsSendStat Then SendStat("推荐源", "显示", Info.Source & "(" & Info.Title & ")")
118 | End If
119 | End If
120 | If ShowingPage * 2 < panBottom.Children.Count Then
121 | Info = CType(panBottom.Children(ShowingPage * 2), InfoBox)
122 | If Info.IsSendStat = False Then
123 | Info.IsSendStat = True
124 | If IsSendStat Then SendStat("推荐源", "显示", Info.Source & "(" & Info.Title & ")")
125 | End If
126 | End If
127 | If ShowingPage * 2 + 1 < panBottom.Children.Count Then
128 | Info = CType(panBottom.Children(ShowingPage * 2 + 1), InfoBox)
129 | If Info.IsSendStat = False Then
130 | Info.IsSendStat = True
131 | If IsSendStat Then SendStat("推荐源", "显示", Info.Source & "(" & Info.Title & ")")
132 | End If
133 | End If
134 | End Sub
135 |
136 | '''
137 | ''' 切换页面的点击事件。
138 | '''
139 | '''
140 | '''
141 | '''
142 | Private Sub panPage_MouseLeftButtonDown(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles panPage.MouseLeftButtonDown
143 |
144 | '初始化
145 | Dim ClickedPage As Integer = Math.Floor(e.GetPosition(panPage).X / 20)
146 | If ClickedPage = ShowingPage Then Exit Sub
147 |
148 | ChangePage(ClickedPage)
149 |
150 | End Sub
151 |
152 | Private Sub ChangePage(ByVal ClickedPage As Integer)
153 | If Not frmMain.PageSelect = "首页" Then Exit Sub
154 |
155 | '小点的动画
156 | Dim OldDot As Border = panPage.Children(ShowingPage)
157 | Dim NewDot As Border = panPage.Children(ClickedPage)
158 | AniStart({
159 | AaWidth(OldDot, 8 - OldDot.Width, 100),
160 | AaHeight(OldDot, 8 - OldDot.Height, 100),
161 | AaX(OldDot, 20 * ShowingPage + 6 - OldDot.Margin.Left, 100),
162 | AaBorderThickness(OldDot, 2 - OldDot.BorderThickness.Bottom, 60),
163 | AaRotateTransform(OldDot, -CType(OldDot.RenderTransform, RotateTransform).Angle, 100,, New AniEaseEnd),
164 | AaWidth(NewDot, 12 - NewDot.Width, 100),
165 | AaHeight(NewDot, 12 - NewDot.Height, 100),
166 | AaX(NewDot, 20 * ClickedPage + 4 - NewDot.Margin.Left, 100),
167 | AaBorderThickness(NewDot, 6 - NewDot.BorderThickness.Bottom, 60),
168 | AaRotateTransform(NewDot, 45 - CType(NewDot.RenderTransform, RotateTransform).Angle, 100,, New AniEaseEnd),
169 | AaX(panTop, -ClickedPage * 2 * (230 + 15) - panTop.Margin.Left, 250,, New AniEaseEnd()),
170 | AaX(panBottom, -ClickedPage * 2 * (230 + 15) - panBottom.Margin.Left, 250,, New AniEaseEnd())
171 | }, "HomeLeftPushChange")
172 |
173 | '结束
174 | ShowingPage = ClickedPage
175 | timerPage.Reset()
176 | StatShow()
177 | End Sub
178 |
179 | Public Sub ChangeSetup() Handles panMain.Loaded
180 | timerPage.IsEnabled = ReadIni("setup", "HomeAutoplay", "True") = "True"
181 | HideNotfull = ReadIni("setup", "HomeFull", "True")
182 | If timerPage.IsEnabled Then
183 | Select Case ReadIni("setup", "raHomeAutoplaySpeed", "1")
184 | Case "0"
185 | timerPage.Interval = 5000
186 | Case "1"
187 | timerPage.Interval = 10000
188 | Case "2"
189 | timerPage.Interval = 20000
190 | End Select
191 | End If
192 | End Sub
193 |
194 | Private Sub timerPage_Tick() Handles timerPage.Tick
195 | If panBottom.Children.Count >= 4 Then
196 | Dim NewPageId As Integer = ShowingPage + 1
197 | If NewPageId >= panPage.Children.Count Then NewPageId = 0
198 | ChangePage(NewPageId)
199 | End If
200 | End Sub
201 |
202 | End Class
203 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Pages/formManageLeft.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Pages/formManageLeft.xaml.vb:
--------------------------------------------------------------------------------
1 | Public Class formManageLeft
2 |
3 | End Class
4 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/PopupPage/msgSource.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/PopupPage/msgSource.xaml.vb:
--------------------------------------------------------------------------------
1 | Public Class msgSource
2 |
3 | Dim Source As ListItem = Nothing
4 |
5 | Public Sub New(ByVal Source As ListItem)
6 | InitializeComponent()
7 | Me.Source = Source
8 | Me.textName.Text = Source.MainText
9 | Me.textURL.Text = Source.SubText
10 | End Sub
11 |
12 | Private Sub textName_TextChanged(ByVal sender As Object, ByVal e As System.Windows.Controls.TextChangedEventArgs) Handles textName.TextChanged
13 | If Not IsNothing(Source) Then Source.MainText = textName.Text
14 | End Sub
15 |
16 | Private Sub textURL_TextChanged(ByVal sender As Object, ByVal e As System.Windows.Controls.TextChangedEventArgs) Handles textURL.TextChanged
17 | If Not IsNothing(Source) Then Source.SubText = textURL.Text
18 | End Sub
19 | End Class
20 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/PopupPage/msgVersion.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/PopupPage/msgVersion.xaml.vb:
--------------------------------------------------------------------------------
1 | Public Class msgVersion
2 |
3 | Private CanWrite As Boolean = False
4 | Private Version As MCVersion
5 |
6 | Public Sub New(ByVal version As MCVersion)
7 | InitializeComponent()
8 | UseControlAnimation = False
9 | Me.Version = version
10 | panMain.UpdateLayout()
11 |
12 | '读取设置
13 | Select Case Val(ReadIni(version.Path & "\PCL\AdvancedSetup.ini", "CustomType", "0"))
14 | Case 1
15 | radioType1.Checked = True
16 | Case 2
17 | radioType2.Checked = True
18 | Case 3
19 | radioType3.Checked = True
20 | Case Else
21 | radioType0.Checked = True
22 | End Select
23 |
24 | UseControlAnimation = True
25 | CanWrite = True '可以写入设置
26 | End Sub
27 |
28 | Private Sub WriteSetup() Handles radioType0.MouseUp, radioType1.MouseUp, radioType2.MouseUp, radioType3.MouseUp
29 | If CanWrite Then
30 | File.Create(Version.Path & "\PCL\AdvancedSetup.ini").Dispose()
31 | Using iniWriter As New StreamWriter(Version.Path & "\PCL\AdvancedSetup.ini", False, Encoding.Unicode)
32 | iniWriter.WriteLine()
33 | If radioType1.Checked Then
34 | iniWriter.WriteLine("CustomType:1")
35 | ElseIf radioType2.Checked Then
36 | iniWriter.WriteLine("CustomType:2")
37 | ElseIf radioType3.Checked Then
38 | iniWriter.WriteLine("CustomType:3")
39 | End If
40 | iniWriter.Flush()
41 | End Using
42 | End If
43 | End Sub
44 |
45 | End Class
46 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Resources/Ionic.Zip.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Resources/Ionic.Zip.dll
--------------------------------------------------------------------------------
/Plain Craft Launcher/Resources/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Resources/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/Plain Craft Launcher/Resources/Plain Craft Launcher Admin Manager.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Resources/Plain Craft Launcher Admin Manager.exe
--------------------------------------------------------------------------------
/Plain Craft Launcher/Resources/Plain Craft Launcher Admin Manager.vshost.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Resources/Plain Craft Launcher Admin Manager.vshost.exe
--------------------------------------------------------------------------------
/Plain Craft Launcher/Resources/Plain Craft Launcher Admin Manager.vshost.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Resources/Plain Craft Launcher Admin Manager.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PlainCraftLauncherAdminManager
6 |
7 |
8 |
9 |
10 |
11 | 返回此类使用的缓存的 ResourceManager 实例。
12 |
13 |
14 |
15 | 使用此强类型资源类,为所有资源查找
16 | 重写当前线程的 CurrentUICulture 属性。
17 |
18 |
19 |
20 | 一个强类型的资源类,用于查找本地化的字符串等。
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/Resources/UpdateLog.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LTCatt/PCL1/27e55fe96d1f73a63ff2bff945041a70c9a54acc/Plain Craft Launcher/Resources/UpdateLog.txt
--------------------------------------------------------------------------------
/Plain Craft Launcher/formBlueScreen.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/formBlueScreen.xaml.vb:
--------------------------------------------------------------------------------
1 | Public Class formBlueScreen
2 |
3 | Private Sub formBlueScreen_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
4 | Me.Width = My.Computer.Screen.Bounds.Width
5 | Me.Height = My.Computer.Screen.Bounds.Height
6 | End Sub
7 |
8 | Dim AnimationProcess As Integer = 0
9 | Dim AnimationWaiting As Integer = 0
10 | Private Sub timerAnimation_Tick() Handles timerAnimation.Tick
11 | AnimationProcess = AnimationProcess + 1
12 | Select Case AnimationProcess
13 | Case 0, 1, 2, 3, 4, 13, 14, 16, 17, 18
14 | Me.Visibility = Visibility.Visible
15 | Case 5, 6, 7, 8, 9, 10, 11, 12, 15
16 | Me.Visibility = Visibility.Collapsed
17 | Case 19, 20, 21, 22
18 | Me.Visibility = Visibility.Visible
19 | panMain.Visibility = Visibility.Visible
20 | Case Else
21 | If Val(labProcess.Content) < 100 Then
22 | If RandomInteger(0, 4) = 4 Then
23 | labProcess.Content = Int(MathRange(Val(labProcess.Content) + RandomInteger(2, 30), 0, 100))
24 | End If
25 | Else
26 | AnimationWaiting = AnimationWaiting + 1
27 | If AnimationWaiting = 40 Then
28 | Me.Close()
29 | IsShowingDeathBlue = False
30 | If ReadReg("ThemeDeathBlue", "False") = "False" Then
31 | WriteReg("ThemeDeathBlue", "True")
32 | MyMsgbox("隐藏主题 死机蓝 已解锁,请到设置页面查看!", "主题已解锁", "我知道了")
33 | SendStat("彩蛋", "主题", "死机蓝")
34 | Else
35 | ShowHint("你是不是闲得无聊……")
36 | End If
37 | End If
38 | End If
39 | End Select
40 | End Sub
41 |
42 | End Class
43 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/formHint.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/formHint.xaml.vb:
--------------------------------------------------------------------------------
1 | Public Class formHint
2 |
3 | Private Sub formHint_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
4 | Me.Height = panStack.ActualHeight
5 | Me.Width = panStack.ActualWidth
6 | Me.Top = My.Computer.Screen.WorkingArea.Height - Me.Height - 50
7 | Me.Left = My.Computer.Screen.WorkingArea.Width - Me.Width
8 | panBack.Width = Me.Width
9 | SetLeft(panBack, Me.Width)
10 | Me.Name = "frmHint" & GetUUID()
11 | AniStart({
12 | AaOpacity(Me, 1, 100),
13 | AaX(panBack, -Me.Width, 300, Ease:=New AniEaseEnd),
14 | AaX(panBack, Me.Width, 300, 3000, New AniEaseStart),
15 | AaCode({"Close", Me}, , True)
16 | }, Me.Name)
17 | End Sub
18 | Private Sub formHint_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles Me.MouseUp
19 | Me.IsEnabled = False
20 | AniStart({
21 | AaOpacity(Me, -1, 150),
22 | AaCode({"Close", Me}, , True)
23 | }, Me.Name & "Close")
24 | End Sub
25 |
26 | End Class
27 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/formMain2.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/formMinecraft.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/formStart.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Plain Craft Launcher/formStart.xaml.vb:
--------------------------------------------------------------------------------
1 | Public Class formStart
2 |
3 | Public IsPushLoading As Boolean = ReadIni("setup", "HomeEnabled", "True") = "True"
4 | Public IsVersionLoading As Boolean = True
5 | Public IsFirstUsing As Boolean = False
6 | Private Sub Window_Loaded(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.ContentRendered
7 | Try
8 |
9 | log("[Start] 开始执行用户代码")
10 | frmStart = Me
11 | If ReadIni("setup", "UiShowLogo", "True") = "True" Then
12 | Me.Opacity = 1
13 | Me.IsHitTestVisible = True
14 | Else
15 | Me.Opacity = 0
16 | Me.IsHitTestVisible = False
17 | End If
18 |
19 | '旧版本处理
20 | If ReadIni("setup", "UiHiddenSource", "") = "True" And ReadIni("setup", "HomeEnabled", "Nothing") = "Nothing" Then WriteIni("setup", "HomeEnabled", "False")
21 | If ReadIni("setup", "LaunchJVM", "").Length > 0 Then WriteIni("setup", "LaunchJVM", ReadIni("setup", "LaunchJVM", "").Replace("-XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump ", ""))
22 |
23 | '初始化设置
24 | AllowFeedback = ReadReg("SysFeed", "True")
25 | RefreshOffline()
26 | IsFirstUsing = ReadIni("setup", "LastVersionCode", "0") = "0" And ReadIni("setup", "Count", "0") = "0"
27 | WriteIni("setup", "Count", Val(ReadIni("setup", "Count", "0")) + 1)
28 | PATH_DOWNLOAD = ReadIni("setup", "DownFolder", "")
29 | If Not PATH_DOWNLOAD.Contains("\") Then PATH_DOWNLOAD = PATH & "PCL\download\"
30 | '线程池初始化
31 | Dim PoolThread As New Thread(AddressOf PoolLoader)
32 | PoolThread.Start()
33 | ''静默模式检查
34 | 'If (Not GetProgramArgument("Version") = "") And (Not GetProgramArgument("Method") = "") Then
35 | ' labProcess.Content = "正在检查信息"
36 | ' labProcess.Visibility = Visibility.Visible
37 | ' Me.Opacity = 1
38 | ' GoTo SlientMode
39 | 'End If
40 | '线程池添加
41 | If IsFirstUsing Then
42 | IsVersionLoading = False
43 | Else
44 | If ReadIni("setup", "HomeAutologin", "True") = "True" Then Pool.Add(New Thread(Sub() PoolLogin(True)))
45 | Pool.Add(New Thread(Sub() PoolJavaFolder(False)))
46 | Pool.Add(New Thread(Sub() PoolMinecraftFolder()))
47 | End If
48 | If IsPushLoading Then Pool.Add(New Thread(AddressOf PoolPush))
49 | Pool.Add(New Thread(AddressOf PoolUpdate) With {.Priority = ThreadPriority.BelowNormal})
50 | Pool.Add(New Thread(AddressOf PoolLoadPictures) With {.Priority = ThreadPriority.BelowNormal})
51 | If ReadIni("setup", "HomeUpdate", "True") = "True" Then Pool.Add(New Thread(Sub() frmDownloadLeft.GetMinecraftBasic(False)) With {.Priority = ThreadPriority.BelowNormal})
52 | log("[Start] 初始化线程池结束")
53 | '初始化Timer
54 | ControlStartRun()
55 | WebStartRun()
56 | '主题及窗体加载
57 | RefreshTheme()
58 | log("[Start] 主题加载结束")
59 | 'Debug 模式警告
60 | #If CONFIG = "Debug" Then
61 | ShowHint("当前为 Debug 模式,不要用于正式版发布!")
62 | #End If
63 | '初始化窗体
64 | SetupRefreshHidden()
65 | frmMain.Opacity = 0
66 | frmMain.Width = MAINFORM_WIDTH
67 | frmMain.Height = MAINFORM_HEIGHT
68 | frmMain.imgMainBg.Opacity = ReadIni("setup", "UiBackgroundOpacity", "50") / 100
69 | frmMain.labTopVer.Content = VERSION_NAME & If(MODE_DEVELOPER, " | 开发者模式", If(MODE_DEBUG, " | 调试模式", "")) & If(MODE_OFFLINE, " | 离线模式", "")
70 | '切换到首页
71 | If Not IsNothing(frmHomeLeft.panMain.Parent) Then frmHomeLeft.panMain.Parent.SetValue(ContentPresenter.ContentProperty, Nothing)
72 | If Not IsNothing(frmHomeRight.panMain.Parent) Then frmHomeRight.panMain.Parent.SetValue(ContentPresenter.ContentProperty, Nothing)
73 | frmMain.panHostLeft.Children.Add(frmHomeLeft.panMain)
74 | frmMain.panHostRight.Children.Add(frmHomeRight.panMain)
75 | frmMain.btnTopMain.Opacity = 1
76 | '显示
77 | If MODE_DEVELOPER Then
78 | log("[Start] PCL 以开发者模式运行")
79 | MODE_DEBUG = True
80 | End If
81 | If MODE_OFFLINE Then log("[Start] PCL 以离线模式运行")
82 | If MODE_DEBUG Then log("[Start] PCL 以调试模式运行")
83 | frmMain.Show()
84 | '检查加载结束
85 | Dim th As New Thread(Sub()
86 | Do While IsVersionLoading Or IsPushLoading
87 | Thread.Sleep(5)
88 | Loop
89 | LoadTimeCost = My.Computer.Clock.TickCount - LoadTimeCost
90 | log("[Start] 初始化结束,总耗时:" & LoadTimeCost / 1000 & "s")
91 | If LoadTimeCost < 20000 And RandomInteger(1, 10) = 4 Then SendStat("反馈", "加载用时", LoadTimeCost, LoadTimeCost) '发送打开统计
92 | frmMain.Dispatcher.Invoke(Sub()
93 | AniStart({
94 | AaScaleTransform(frmMain.panAllBack, -0.05, 1),
95 | AaScaleTransform(frmMain.panAllBack, 0.05, 250, 80, New AniEaseJumpEnd(0.6)),
96 | AaOpacity(frmMain, ReadIni("setup", "UiLauncherOpacity", "100") / 100, 250, 80),
97 | AaCode({"Close", frmStart}, 370),
98 | AaCode(Sub() Process.GetCurrentProcess.PriorityClass = ProcessPriorityClass.Normal, 400)
99 | }, "MainStart")
100 | frmHomeLeft.timerPage.Reset()
101 | End Sub)
102 | End Sub)
103 | th.Start()
104 |
105 | 'Exit Sub
106 | 'SlientMode:
107 | ' Dim Version As String = GetProgramArgument("Version")
108 | ' Dim Method As String = GetProgramArgument("Method")
109 | ' log("[Start] PCL 以静默模式运行,目标版本:" & Version & ",登录方式:" & Method)
110 | ' 'Java 校验
111 | ' PATH_JAVA = ReadReg("SetupJavaPath")
112 | ' Dim Env As String = PathEnv
113 | ' If File.Exists(PATH_JAVA & "\javaw.exe") And (File.Exists(PATH_JAVA & "\jli.dll") Or PATH_JAVA.Contains("javapath")) And Env.Contains(PATH_JAVA) Then
114 | ' log("[Start] Java路径:" & PATH_JAVA)
115 | ' Else
116 | ' labProcess.Content = "Java 路径不正确"
117 | ' GoTo EndSlient
118 | ' End If
119 | ' 'Minecraft 校验
120 | ' PATH_MC = ReadIni("setup", "LaunchFolderSelect", "")
121 | ' If CheckDirectoryPermission(PATH_MC & "versions\" & Version & "\PCL") Then
122 | ' log("[Start] .minecraft文件夹:" & PATH_MC)
123 | ' Else
124 | ' labProcess.Content = "Minecraft " & Version & " 未找到"
125 | ' GoTo EndSlient
126 | ' End If
127 | ' '结束
128 | ' labProcess.Content = "已启动"
129 | ' GoTo EndSlient
130 |
131 | 'EndSlient:
132 | ' Dim th As New Thread(Sub()
133 | ' Thread.Sleep(2000)
134 | ' frmStart.Dispatcher.Invoke(Sub() EndForce())
135 | ' End Sub)
136 | ' th.Start()
137 |
138 | Catch ex As Exception
139 | ExShow(ex, "全局初始化失败", ErrorLevel.Barrier)
140 | End Try
141 | End Sub
142 |
143 | End Class
144 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Plain Craft Launcher 1
2 |
3 | MC 启动器 PCL2 的前身,PCL1。
4 |
5 | 来自 2017 年的远古黑历史,代码质量不堪入目,时至今日毫无维护,Bug 一堆,基本能跑不能用,就别喷了……
6 |
7 | #
8 |
9 | PCL1 采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。
10 |
11 |
12 |
--------------------------------------------------------------------------------