diff --git a/.gitignore b/.gitignore index 651ae83..ae737ae 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ *.docx video/* -runtime/* \ No newline at end of file +runtime/* +article/* +experiment/* \ No newline at end of file diff --git a/Builder.exe b/Builder.exe index 0702d15..08565bf 100644 Binary files a/Builder.exe and b/Builder.exe differ diff --git a/Core/GAnimation.cls b/Core/GAnimation.cls index ff91c4e..6104d44 100644 --- a/Core/GAnimation.cls +++ b/Core/GAnimation.cls @@ -32,39 +32,39 @@ Attribute VB_Exposed = False GetProgress_3 = Cubic(pro, 0, 1, 1, 1) End Function '================================================================ - 'Animation Project - Public Sub FadeIn(X, Y, w, h, Alpha, pro As Single) - Alpha = Alpha * pro + 'Animation Solution + Public Sub FadeIn(X, y, w, h, alpha, pro As Single) + alpha = alpha * pro End Sub - Public Sub FadeOut(X, Y, w, h, Alpha, pro As Single) - Alpha = Alpha - Alpha * pro + Public Sub FadeOut(X, y, w, h, alpha, pro As Single) + alpha = alpha - alpha * pro End Sub - Public Sub FlyInFromLeft(X, Y, w, h, Alpha, pro As Single) + Public Sub FlyInFromLeft(X, y, w, h, alpha, pro As Single) X = X * pro End Sub - Public Sub FlyInFromRight(X, Y, w, h, Alpha, pro As Single) + Public Sub FlyInFromRight(X, y, w, h, alpha, pro As Single) X = X + (GW - X) * pro End Sub - Public Sub FlyInFromTop(X, Y, w, h, Alpha, pro As Single) - Y = Y * pro + Public Sub FlyInFromTop(X, y, w, h, alpha, pro As Single) + y = y * pro End Sub - Public Sub FlyInFromBottom(X, Y, w, h, Alpha, pro As Single) - Y = Y + (GH - Y) * pro + Public Sub FlyInFromBottom(X, y, w, h, alpha, pro As Single) + y = y + (GH - y) * pro End Sub - Public Sub FlyInFromLeftFade(X, Y, w, h, Alpha, pro As Single) + Public Sub FlyInFromLeftFade(X, y, w, h, alpha, pro As Single) X = X * pro - Alpha = Alpha * pro + alpha = alpha * pro End Sub - Public Sub FlyInFromRightFade(X, Y, w, h, Alpha, pro As Single) + Public Sub FlyInFromRightFade(X, y, w, h, alpha, pro As Single) X = X + (GW - X) * pro - Alpha = Alpha * pro + alpha = alpha * pro End Sub - Public Sub FlyInFromTopFade(X, Y, w, h, Alpha, pro As Single) - Y = Y * pro - Alpha = Alpha * pro + Public Sub FlyInFromTopFade(X, y, w, h, alpha, pro As Single) + y = y * pro + alpha = alpha * pro End Sub - Public Sub FlyInFromBottomFade(X, Y, w, h, Alpha, pro As Single) - Y = Y + (GH - Y) * pro - Alpha = Alpha * pro + Public Sub FlyInFromBottomFade(X, y, w, h, alpha, pro As Single) + y = y + (GH - y) * pro + alpha = alpha * pro End Sub '================================================================ diff --git a/Core/GCore.bas b/Core/GCore.bas index 9e95fc2..5fce20f 100644 --- a/Core/GCore.bas +++ b/Core/GCore.bas @@ -113,6 +113,11 @@ Attribute VB_Name = "GCore" ScaleFullScreen = 1 ScaleSuitable = 2 End Enum + Public Enum ERenderMode + RenderModeDefault = 0 + RenderModeFillPath = 1 + RenderModeClearType = 2 + End Enum Public Type ScrollArea Width As Long Height As Long @@ -131,7 +136,7 @@ Attribute VB_Name = "GCore" Public EmeraldInstalled As Boolean Public BassInstalled As Boolean '版本号说明:[年份][月份][日期][版次] - Public Const Version As Long = 20040201 '20年4月2日,第1个版本 + Public Const Version As Long = 20092701 '20年9月27日,第1个版本 Public TextHandle As Long, WaitChr As String, LastUpdateTime As Long, HighCPUPermission As Integer Public XPMode As Boolean Public Scales As Single diff --git a/Core/GFont.cls b/Core/GFont.cls index c96f4bf..3fd8c13 100644 --- a/Core/GFont.cls +++ b/Core/GFont.cls @@ -17,7 +17,7 @@ Private Declare Function AddFontResource Lib "gdi32" Alias "AddFontResourceA" (B Private Declare Function RemoveFontResource Lib "gdi32" Alias "RemoveFontResourceA" (ByVal lpFileName As String) As Long Dim brush As Long, fFile As String, fFam As Long, StrF(2) As Long, Font(8, 1 To 1000) As Long, Spath As Long, Spen As Long Public EmHeight As Long -Public RenderMode As Integer +Public RenderMode As ERenderMode '======================================================== ' Init Public Sub MakeFont(Name As String) @@ -85,19 +85,20 @@ Public RenderMode As Integer GetHeight = R.Bottom End Function - Public Sub Writes(Text As String, X As Single, Y As Single, g As Long, Color As Long, ByVal size As Long, W As Single, H As Single, ByVal align As StringAlignment, ByVal style As FontStyle, Optional ByVal BorderColor As Long, Optional ByVal BorderSize As Long = 0) + Public Sub Writes(Text As String, X As Single, y As Single, g As Long, Color As Long, ByVal size As Long, w As Single, h As Single, ByVal align As StringAlignment, ByVal style As FontStyle, Optional ByVal BorderColor As Long, Optional ByVal BorderSize As Long = 0) 'On Error Resume Next If Font(style, size) = 0 Then PoolCreateFont fFam, size, style, UnitPixel, Font(style, size) End If If EmHeight = 0 Then EmHeight = GetHeight(g, "ABCDEFG", 18, StringAlignmentNear, FontStyleRegular) - If RenderMode = 0 Then - GdipDrawString g, StrPtr(Text), -1, Font(style, size), NewRectF(X, Y, W, H), StrF(align), brush + GdipSetSolidFillColor brush, Color + + If RenderMode <> RenderModeFillPath Then + GdipDrawString g, StrPtr(Text), -1, Font(style, size), NewRectF(X, y, w, h), StrF(align), brush Else GdipResetPath Spath - GdipAddPathString Spath, StrPtr(Text), -1, fFam, style, size, NewRectF(X, Y, W, H), StrF(align) - GdipSetSolidFillColor brush, Color + GdipAddPathString Spath, StrPtr(Text), -1, fFam, style, size, NewRectF(X, y, w, h), StrF(align) GdipFillPath g, brush, Spath If BorderSize > 0 Then diff --git a/Core/GPage.cls b/Core/GPage.cls index 9c22cda..2c25707 100644 --- a/Core/GPage.cls +++ b/Core/GPage.cls @@ -46,7 +46,11 @@ Public IsSystem As Boolean PoolCreateFromHdc CDC, GG GdipSetSmoothingMode GG, SmoothingModeAntiAlias - GdipSetTextRenderingHint GG, TextRenderingHintAntiAlias + If EF.RenderMode = RenderModeClearType Then + GdipSetTextRenderingHint GG, TextRenderingHintClearTypeGridFit + Else + GdipSetTextRenderingHint GG, TextRenderingHintAntiAlias + End If Set DrawBox = dBox diff --git a/Core/GSaving.cls b/Core/GSaving.cls index 7545da6..b942670 100644 --- a/Core/GSaving.cls +++ b/Core/GSaving.cls @@ -27,6 +27,21 @@ Public sToken As Boolean, path As String Public Key As String '======================================================== ' Init + Public Function FetchUserName() As String + On Error Resume Next + FetchUserName = "default" + FetchUserName = PoolCreateObject("Wscript.Network").Username + End Function + Public Sub CheckFullPath(path As String) + Dim S() As String + S = Split(path, "\") + Dim p As String + p = S(0) & "\" + For I = 1 To UBound(S) + p = p & S(I) & "\" + If Dir(p, vbDirectory) = "" Then MkDir p + Next + End Sub Public Function Create(Name As String, Optional BMKey) As Boolean If ESave Is Nothing Then Set ESave = Me @@ -34,9 +49,11 @@ Public Key As String If Dir("C:\Emerad\", vbDirectory) = "" Then MkDir "C:\Emerad\" path = "C:\Emerad\" & Name Else - path = "C:\Users\" & PoolCreateObject("Wscript.Network").Username & "\AppData\Local\" & Name + path = "C:\Users\" & FetchUserName & "\AppData\Local\" & Name End If + Call CheckFullPath(path) + AutoSave = True If Not IsMissing(BMKey) Then Key = BMKey @@ -64,13 +81,13 @@ Public Key As String ErrHandle: If Err.Number <> 0 Then MsgBox "存档已经损坏!", 16, DisplayName: ReDim MySave.Data(0) - Suggest "应用存档损坏。", NeverClear, 2 + Suggest "游戏存档损坏。", NeverClear, 2 End If End If Create = True End If - If Create = False Then Suggest "应用存档授权失败。", NeverClear, 1 + If Create = False Then Suggest "游戏存档授权失败。", NeverClear, 1 sToken = Create End Function @@ -90,7 +107,7 @@ ErrHandle: If msg <> "" Then Call Save MsgBox "已经发现并删除存档中以下非法数据:" & vbCrLf & msg, 64 - Suggest "应用存档中含有非法数据。", NeverClear, 1 + Suggest "游戏存档中含有非法数据。", NeverClear, 1 End If End Sub '======================================================== @@ -133,3 +150,4 @@ ErrHandle: End Sub '======================================================== + diff --git a/Emerald.exe b/Emerald.exe new file mode 100644 index 0000000..e69de29 diff --git a/Emerald.vbp b/Emerald.vbp index ab94b65..096866a 100644 --- a/Emerald.vbp +++ b/Emerald.vbp @@ -1,6 +1,6 @@ Type=Exe Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\Windows\SysWOW64\stdole2.tlb#OLE Automation -Reference=*\G{13FC9823-115E-4CB2-9A02-881895942E28}#1.646#0#..\Muing II\Win32Api.tlb#Win32API之vb6头文件 2017-5-4修正更新 made by 棉花糖 +Reference=*\G{13FC9823-115E-4CB2-9A02-881895942E28}#1.646#0#..\ClassYET\Win32Api.tlb#Win32API之vb6头文件 2017-5-4修正更新 made by 棉花糖 Class=GPage; Core\GPage.cls Module=Bass; Core\Bass.bas Module=GCore; Core\GCore.bas diff --git a/Emerald.vbw b/Emerald.vbw index 158029d..1783a73 100644 --- a/Emerald.vbw +++ b/Emerald.vbw @@ -2,7 +2,7 @@ GPage = -284, 138, 576, 514, Bass = 130, 130, 990, 509, GCore = 104, 104, 845, 544, GMan = 104, 104, 964, 483, -GFont = 182, 182, 923, 622, +GFont = 182, 182, 923, 622, Z GMusic = 52, 52, 903, 467, GMusicList = 78, 78, 929, 488, GSaving = 104, 104, 955, 514, @@ -30,6 +30,6 @@ GCrashBox = 192, 192, 913, 615, Gdiplus = 0, 0, 955, 411, ResPool = 192, 192, 1147, 603, BuilderCore = 64, 64, 1019, 475, -ToNewPage = 0, 0, 955, 411, Z +ToNewPage = 0, 0, 955, 411, MD5 = 64, 64, 1019, 475, SetupPage = 64, 64, 1051, 427, diff --git "a/\344\275\234\345\223\201\347\273\223\346\236\204\347\256\200\345\233\276.jpg" "b/\344\275\234\345\223\201\347\273\223\346\236\204\347\256\200\345\233\276.jpg" new file mode 100644 index 0000000..ef20daa Binary files /dev/null and "b/\344\275\234\345\223\201\347\273\223\346\236\204\347\256\200\345\233\276.jpg" differ