diff --git a/Builder.exe b/Builder.exe index 5bb2aa3..a4df16a 100644 Binary files a/Builder.exe and b/Builder.exe differ diff --git a/Builder/BuilderCore.bas b/Builder/BuilderCore.bas index 4623e89..f7380ad 100644 --- a/Builder/BuilderCore.bas +++ b/Builder/BuilderCore.bas @@ -97,6 +97,7 @@ Public Sub Main() MainWindow.WindowState = 1 MainWindow.WindowState = 0 MainWindow.SetFocus + ShowWindow MainWindow.Hwnd, SW_SHOW If SPackage.Files(0).path <> "" Then Open tempPath & "\setupappicon.png" For Binary As #1 @@ -139,6 +140,8 @@ UninstallGame: MainWindow.WindowState = 1 MainWindow.WindowState = 0 MainWindow.SetFocus + ShowWindow MainWindow.Hwnd, SW_SHOW + Kill tempPath & "\setuppack.emrpack" SetupPage.Step = 4 ECore.ActivePage = "SetupPage" diff --git a/Builder/WelcomePage.cls b/Builder/WelcomePage.cls index 370b26e..7c88c55 100644 --- a/Builder/WelcomePage.cls +++ b/Builder/WelcomePage.cls @@ -366,13 +366,13 @@ Public Sub DrawProject() max = Int(UBound(UFiles) / 6) + 1 Page.Writes FileIndex + 1 & "/" & max, 600, 430 + 30 * 7 + 5, 18, argb(255, 242, 242, 242), 120, 20, align:=StringAlignmentCenter If FileIndex + 1 > 1 Then - If Page.ShowColorButton(1, 600, 430 + 30 * 7 + 5, 20, 20, "<", argb(255, 255, 255, 255), argb(255, 35, 170, 242), argb(255, 64, 255, 226), 40, size:=16) = 3 Then + If Page.ShowColorButton(1, 600, 430 + 30 * 7 + 5, 20, 20, "<", argb(255, 255, 255, 255), argb(255, 35, 170, 242), argb(255, 75, 210, 255), 40, size:=16) = 3 Then FileIndex = FileIndex - 1 ECore.NewTransform End If End If If FileIndex + 1 < max Then - If Page.ShowColorButton(1, 700, 430 + 30 * 7 + 5, 20, 20, ">", argb(255, 255, 255, 255), argb(255, 35, 170, 242), argb(255, 64, 255, 226), 40, size:=16) = 3 Then + If Page.ShowColorButton(1, 700, 430 + 30 * 7 + 5, 20, 20, ">", argb(255, 255, 255, 255), argb(255, 35, 170, 242), argb(255, 75, 210, 255), 40, size:=16) = 3 Then FileIndex = FileIndex + 1 ECore.NewTransform End If @@ -381,7 +381,7 @@ Public Sub DrawProject() Page.ShowColorCheckBox BackupSwitch, 384, GH - 80, 200, 20, "同时创建备份", argb(255, 242, 242, 242), argb(255, 35, 170, 242), argb(255, 242, 242, 242), 18 - If Page.ShowColorButton(0, GW - 180, GH - 82, 120, 30, IIf(ReplaceAccept = 0, "替换代码", "确认替换 (" & Round(5 - (GetTickCount - ReplaceAccept) / 1000) & "s)"), argb(255, 255, 255, 255), IIf(ReplaceAccept = 0, argb(255, 35, 170, 242), argb(255, 254, 84, 57)), IIf(ReplaceAccept = 0, argb(255, 64, 255, 226), argb(255, 255, 124, 97)), 40, size:=18) = 3 Then + If Page.ShowColorButton(0, GW - 180, GH - 82, 120, 30, IIf(ReplaceAccept = 0, "替换代码", "确认替换 (" & Round(5 - (GetTickCount - ReplaceAccept) / 1000) & "s)"), argb(255, 255, 255, 255), IIf(ReplaceAccept = 0, argb(255, 35, 170, 242), argb(255, 254, 84, 57)), IIf(ReplaceAccept = 0, argb(255, 75, 210, 255), argb(255, 255, 124, 97)), 40, size:=18) = 3 Then If ReplaceAccept > 0 Then ReplaceAccept = -1 Call ReplaceProject @@ -417,7 +417,7 @@ Public Sub DrawBackup() End If Page.Writes Left(BackupList(I).Name, 22) & IIf(Len(BackupList(I).Name) > 22, "...", "") & " (" & BackupList(I).FileCount & " 个文件)", 392, 120 + 70 * (I - BackupIndex * 6) - 2, 18, argb(255, 255, 255, 255) Page.Writes BackupList(I).Date & " (" & BackupList(I).size & "字节)", 392, 120 + 70 * (I - BackupIndex * 6) - 2 + 25, 18, argb(255, 192, 192, 192) - If Page.ShowColorButton(0, GW - 170, 117 + 70 * (I - BackupIndex * 6) + 8, 100, 30, IIf(BackupList(I).UseTime = 0, "还原", "确认 (" & Round(5 - (GetTickCount - BackupList(I).UseTime) / 1000) & "s)"), argb(255, 255, 255, 255), IIf(BackupList(I).UseTime = 0, argb(255, 35, 170, 242), argb(255, 254, 84, 57)), IIf(BackupList(I).UseTime = 0, argb(255, 64, 255, 226), argb(255, 255, 124, 97)), 40, size:=18) = 3 Then + If Page.ShowColorButton(0, GW - 170, 117 + 70 * (I - BackupIndex * 6) + 8, 100, 30, IIf(BackupList(I).UseTime = 0, "还原", "确认 (" & Round(5 - (GetTickCount - BackupList(I).UseTime) / 1000) & "s)"), argb(255, 255, 255, 255), IIf(BackupList(I).UseTime = 0, argb(255, 35, 170, 242), argb(255, 254, 84, 57)), IIf(BackupList(I).UseTime = 0, argb(255, 75, 210, 255), argb(255, 255, 124, 97)), 40, size:=18) = 3 Then If BackupList(I).UseTime > 0 Then If BackupList(I).size = -1 Then ShellExecuteA 0, "open", OPath & "\.emr\backup\", "", "", SW_SHOW @@ -464,13 +464,13 @@ Public Sub DrawBackup() max = Int(UBound(BackupList) / 6) + 1 Page.Writes BackupIndex + 1 & "/" & max, 600, 430 + 30 * 7 + 5, 18, argb(255, 242, 242, 242), 120, 20, align:=StringAlignmentCenter If BackupIndex + 1 > 1 Then - If Page.ShowColorButton(1, 600, 430 + 30 * 7 + 5, 20, 20, "<", argb(255, 255, 255, 255), argb(255, 35, 170, 242), argb(255, 64, 255, 226), 40, size:=16) = 3 Then + If Page.ShowColorButton(1, 600, 430 + 30 * 7 + 5, 20, 20, "<", argb(255, 255, 255, 255), argb(255, 35, 170, 242), argb(255, 75, 210, 255), 40, size:=16) = 3 Then BackupIndex = BackupIndex - 1 ECore.NewTransform End If End If If BackupIndex + 1 < max Then - If Page.ShowColorButton(1, 700, 430 + 30 * 7 + 5, 20, 20, ">", argb(255, 255, 255, 255), argb(255, 35, 170, 242), argb(255, 64, 255, 226), 40, size:=16) = 3 Then + If Page.ShowColorButton(1, 700, 430 + 30 * 7 + 5, 20, 20, ">", argb(255, 255, 255, 255), argb(255, 35, 170, 242), argb(255, 75, 210, 255), 40, size:=16) = 3 Then BackupIndex = BackupIndex + 1 ECore.NewTransform End If @@ -506,7 +506,7 @@ Public Sub DrawPackage() Page.Writes "我们无法继续制作安装包。", 381, 205, 18, argb(255, 242, 242, 242) Else Page.Writes "一切准备就绪!", 381, 205, 18, argb(255, 242, 242, 242) - If Page.ShowColorButton(0, GW - 220, GH - 112, 150, 40, "制作", argb(255, 255, 255, 255), argb(255, 35, 170, 242), argb(255, 64, 255, 226), 40, size:=18) = 3 Then + If Page.ShowColorButton(0, GW - 220, GH - 112, 150, 40, "制作", argb(255, 255, 255, 255), argb(255, 35, 170, 242), argb(255, 75, 210, 255), 40, size:=18) = 3 Then PackState = 1: PackText = "正在准备..." Call BuildInstaller PackState = 0 @@ -622,7 +622,7 @@ Public Sub Update() End If Page.Clear argb(0, 0, 0, 0) - Page.DrawImage "background" & IIf((ESave.GetData("Emerald 3.1") = "") Or (ReadProject = False And OPath <> "" And Dir(OPath & "\.emerald") = ""), "2", "") & ".png", 0, 0, alpha:=1 + Page.DrawImage "background" & IIf((ESave.GetData("Emerald 3.1") = "") Or (ReadProject = False And OPath <> "" And Dir(OPath & "\.emerald") = ""), "2", "") & ".png", 0, 0, Alpha:=1 If Cliped = 0 Then Cliped = 1 'Page.PaintLine 342, 32 + 24, 342, GH - 40 - 24 + 1, argb(255, 235, 235, 235), 1 @@ -657,19 +657,19 @@ Public Sub Update() SkipThis: Next - Page.DrawImage "project.png", 60, 135, alpha:=1 + Page.DrawImage "project.png", 60, 135, Alpha:=1 Page.Writes "工程", 110, 135, 18, argb(255, 255, 255, 255) - Page.DrawImage "backup.png", 60, 135 + 50, alpha:=1 + Page.DrawImage "backup.png", 60, 135 + 50, Alpha:=1 Page.Writes "备份", 110, 135 + 50, 18, argb(255, 255, 255, 255) - Page.DrawImage "package.png", 60, 135 + 50 * 2, alpha:=1 + Page.DrawImage "package.png", 60, 135 + 50 * 2, Alpha:=1 Page.Writes "打包", 110, 135 + 50 * 2, 18, argb(255, 255, 255, 255) - Page.DrawImage "settings.png", 60, 135 + 50 * 3, alpha:=1 + Page.DrawImage "settings.png", 60, 135 + 50 * 3, Alpha:=1 Page.Writes "设置", 110, 135 + 50 * 3, 18, argb(255, 255, 255, 255) - Page.DrawImage "information.png", 60, 135 + 50 * 4, alpha:=1 + Page.DrawImage "information.png", 60, 135 + 50 * 4, Alpha:=1 Page.Writes "关于", 110, 135 + 50 * 4, 18, argb(255, 255, 255, 255) Select Case PageIndex diff --git a/Core/AboutMe.bas b/Core/AboutMe.bas index 0d170c7..37a071d 100644 --- a/Core/AboutMe.bas +++ b/Core/AboutMe.bas @@ -52,6 +52,9 @@ Attribute VB_Name = "AboutMe" '======================================================== ' 更新日志 '======================================================== +' 更新内容(ver.200129) +' -全新的卷轴模式 +' -不加载错误资源 ' 更新内容(ver.200128) ' -永久移除卷轴模式的相关代码(因为其功能已经过时) ' -修复系统页面被冻结的问题 diff --git a/Core/GCore.bas b/Core/GCore.bas index 9a872ff..ece418e 100644 --- a/Core/GCore.bas +++ b/Core/GCore.bas @@ -8,7 +8,7 @@ Attribute VB_Name = "GCore" State As Integer button As Integer X As Single - y As Single + Y As Single End Type Public Enum PlayStateMark musStopped = 0 @@ -84,7 +84,7 @@ Attribute VB_Name = "GCore" End Enum Public Type GraphicsBound X As Single - y As Single + Y As Single Width As Single Height As Single WSc As Single @@ -112,6 +112,12 @@ Attribute VB_Name = "GCore" ScaleFullScreen = 1 ScaleSuitable = 2 End Enum + Public Type ScrollArea + Width As Long + Height As Long + Graphics As Long + DC As Long + End Type Public SGS() As Suggestion, SGTime As Long Public ColorLists() As ColorCollection Public ECore As GMan, EF As GFont, EAni As Object, ESave As GSaving, EMusic As GMusicList @@ -123,7 +129,7 @@ Attribute VB_Name = "GCore" Public FPSWarn As Long Public EmeraldInstalled As Boolean Public BassInstalled As Boolean - Public Const Version As Long = 20012801 'oka + Public Const Version As Long = 20012901 'okayy Public TextHandle As Long, WaitChr As String Public XPMode As Boolean Public Scales As Single @@ -167,6 +173,31 @@ Attribute VB_Name = "GCore" Data.PutData "UpdateCheckInterval", UpdateCheckInterval Data.PutData "UpdateTimeOut", UpdateTimeOut End Sub + Public Function CreateScrollArea(ByVal Width As Long, ByVal Height As Long) As ScrollArea + With CreateScrollArea + .DC = CreateCDC(Width, Height) + PoolCreateFromHdc .DC, .Graphics + .Width = Width + .Height = Height + GdipSetSmoothingMode .Graphics, SmoothingModeAntiAlias + GdipSetTextRenderingHint .Graphics, TextRenderingHintAntiAlias + End With + End Function + Public Sub StartScrollArea(Page As GPage, Area As ScrollArea) + If Page.ScrollMode Then Suggest "请先结束上一个卷轴区域。", ClearOnUpdate, 1: Exit Sub + Page.OODC = Page.CDC: Page.OOGG = Page.GG + Page.CDC = Area.DC: Page.GG = Area.Graphics + Page.ScrollWidth = Area.Width: Page.ScrollHeight = Area.Height + Page.ScrollMode = True + End Sub + Public Sub EndScrollArea(Page As GPage, ByVal X As Long, ByVal Y As Long, ByVal CX As Long, ByVal CY As Long, Optional ByVal Width As Long = -1, Optional ByVal Height As Long = -1, Optional ByVal Alpha As Single = 1) + If Not Page.ScrollMode Then Suggest "请先启动一个卷轴区域。", ClearOnUpdate, 1: Exit Sub + If Width = -1 Then Width = Page.ScrollWidth + If Height = -1 Then Height = Page.ScrollHeight + PaintDC Page.CDC, Page.OODC, X, Y, CX, CY, Width, Height, Alpha + Page.CDC = Page.OODC: Page.GG = Page.OOGG + Page.ScrollMode = False + End Sub Public Sub GetSettings(Optional SkipDebug As Boolean = False) If App.LogMode <> 0 And SkipDebug = False Then Exit Sub @@ -385,28 +416,28 @@ sth: '画~ PoolDeleteEffect e '垃圾处理 End Sub - Public Sub PaintDC(DC As Long, destDC As Long, Optional X As Long = 0, Optional y As Long = 0, Optional cx As Long = 0, Optional cy As Long = 0, Optional cw, Optional ch, Optional alpha) + Public Sub PaintDC(DC As Long, destDC As Long, Optional X As Long = 0, Optional Y As Long = 0, Optional CX As Long = 0, Optional CY As Long = 0, Optional cw, Optional ch, Optional Alpha) Dim B As BLENDFUNCTION, index As Integer, bl As Long - If Not IsMissing(alpha) Then - If alpha < 0 Then alpha = 0 - If alpha > 1 Then alpha = 1 + If Not IsMissing(Alpha) Then + If Alpha < 0 Then Alpha = 0 + If Alpha > 1 Then Alpha = 1 With B .AlphaFormat = &H1 .BlendFlags = &H0 .BlendOp = 0 - .SourceConstantAlpha = Int(alpha * 255) + .SourceConstantAlpha = Int(Alpha * 255) End With CopyMemory bl, B, 4 End If - If IsMissing(cw) Then cw = RGW - cx - If IsMissing(ch) Then ch = RGH - cy + If IsMissing(cw) Then cw = RGW - CX + If IsMissing(ch) Then ch = RGH - CY - If IsMissing(alpha) Then - BitBlt destDC, X, y, cw, ch, DC, cx, cy, vbSrcCopy + If IsMissing(Alpha) Then + BitBlt destDC, X, Y, cw, ch, DC, CX, CY, vbSrcCopy Else - AlphaBlend destDC, X, y, cw, ch, DC, cx, cy, cw, ch, bl + AlphaBlend destDC, X, Y, cw, ch, DC, CX, CY, cw, ch, bl End If End Sub Function Cubic(t As Single, arg0 As Single, arg1 As Single, arg2 As Single, arg3 As Single) As Single @@ -416,36 +447,36 @@ sth: End Function '======================================================== ' Mouse - Public Sub UpdateMouse(X As Single, y As Single, State As Long, button As Integer) + Public Sub UpdateMouse(X As Single, Y As Single, State As Long, button As Integer) With Mouse .X = X - .y = y + .Y = Y .State = State .button = button End With End Sub - Public Function CheckMouse(ByVal X As Long, ByVal y As Long, ByVal W As Long, ByVal H As Long) As MButtonState + Public Function CheckMouse(ByVal X As Long, ByVal Y As Long, ByVal W As Long, ByVal H As Long) As MButtonState 'Return Value:0=none,1=in,2=down,3=up If Scales <> 1 Then - X = X * Scales: y = y * Scales + X = X * Scales: Y = Y * Scales W = W * Scales H = H * Scales End If If Debug_mouse Then GdipSetSolidFillColor ECore.pB, argb(20, 255, 0, 0) - GdipFillRectangle ECore.UPage.GG, ECore.pB, X, y, W, H + GdipFillRectangle ECore.UPage.GG, ECore.pB, X, Y, W, H End If If ECore.LockPage <> "" Then If ECore.LockPage <> ECore.UpdatingPage Then Exit Function End If - If Mouse.X >= X And Mouse.y >= y And Mouse.X <= X + W And Mouse.y <= y + H Then + If Mouse.X >= X And Mouse.Y >= Y And Mouse.X <= X + W And Mouse.Y <= Y + H Then If ECore.FreezeMode Then ECore.FreezeResetBegin = True If Debug_mouse Then GdipSetSolidFillColor ECore.pB, argb(255, 27, 27, 27) - GdipFillEllipse ECore.UPage.GG, ECore.pB, X - 10, y - 10, 20, 20 + GdipFillEllipse ECore.UPage.GG, ECore.pB, X - 10, Y - 10, 20, 20 GdipSetSolidFillColor ECore.pB, argb(80, 255, 0, 0) - GdipFillRectangle ECore.UPage.GG, ECore.pB, X, y, W, H - EF.Writes Mouse.State + 1, X - 10, y - 7, ECore.UPage.GG, argb(255, 255, 255, 255), 14, 20, 0, StringAlignmentCenter, FontStyleBold + GdipFillRectangle ECore.UPage.GG, ECore.pB, X, Y, W, H + EF.Writes Mouse.State + 1, X - 10, Y - 7, ECore.UPage.GG, argb(255, 255, 255, 255), 14, 20, 0, StringAlignmentCenter, FontStyleBold End If CheckMouse = Mouse.State + 1 If Mouse.State = 2 Then Mouse.State = 0 @@ -455,23 +486,23 @@ sth: 'Return Value:0=none,1=in,2=down,3=up If Debug_mouse Then GdipSetSolidFillColor ECore.pB, argb(20, 0, 0, 255) - GdipFillRectangle ECore.UPage.GG, ECore.pB, DrawF.X, DrawF.y, DrawF.Width, DrawF.Height + GdipFillRectangle ECore.UPage.GG, ECore.pB, DrawF.X, DrawF.Y, DrawF.Width, DrawF.Height End If If ECore.LockPage <> "" Then If ECore.LockPage <> ECore.UpdatingPage Then Exit Function End If - If Mouse.X >= DrawF.X And Mouse.y >= DrawF.y And Mouse.X <= DrawF.X + DrawF.Width And Mouse.y <= DrawF.y + DrawF.Height Then + If Mouse.X >= DrawF.X And Mouse.Y >= DrawF.Y And Mouse.X <= DrawF.X + DrawF.Width And Mouse.Y <= DrawF.Y + DrawF.Height Then If ECore.FreezeMode Then ECore.FreezeResetBegin = True If Debug_mouse Then GdipSetSolidFillColor ECore.pB, argb(255, 27, 27, 27) - GdipFillEllipse ECore.UPage.GG, ECore.pB, DrawF.X - 10, DrawF.y - 10, 20, 20 + GdipFillEllipse ECore.UPage.GG, ECore.pB, DrawF.X - 10, DrawF.Y - 10, 20, 20 GdipSetSolidFillColor ECore.pB, argb(80, 0, 0, 255) - GdipFillRectangle ECore.UPage.GG, ECore.pB, DrawF.X, DrawF.y, DrawF.Width, DrawF.Height - EF.Writes Mouse.State + 1, DrawF.X - 10, DrawF.y - 7, ECore.UPage.GG, argb(255, 255, 255, 255), 14, 20, 0, StringAlignmentCenter, FontStyleBold + GdipFillRectangle ECore.UPage.GG, ECore.pB, DrawF.X, DrawF.Y, DrawF.Width, DrawF.Height + EF.Writes Mouse.State + 1, DrawF.X - 10, DrawF.Y - 7, ECore.UPage.GG, argb(255, 255, 255, 255), 14, 20, 0, StringAlignmentCenter, FontStyleBold End If CheckMouse2 = Mouse.State + 1 If DrawF.CrashIndex <> 0 Then - If ColorLists(DrawF.CrashIndex).IsAlpha((Mouse.X - DrawF.X) * DrawF.WSc, (Mouse.y - DrawF.y) * DrawF.HSc) = False Then CheckMouse2 = mMouseOut: Exit Function + If ColorLists(DrawF.CrashIndex).IsAlpha((Mouse.X - DrawF.X) * DrawF.WSc, (Mouse.Y - DrawF.Y) * DrawF.HSc) = False Then CheckMouse2 = mMouseOut: Exit Function End If If Mouse.State = 2 Then Mouse.State = 0 End If diff --git a/Core/GDebug.cls b/Core/GDebug.cls index 73890aa..182d640 100644 --- a/Core/GDebug.cls +++ b/Core/GDebug.cls @@ -423,7 +423,7 @@ ReCopy: SetConsoleColor colors.DefaultText WriteLine "Active page : " & ECore.ActivePage WriteLine "FPS " & FPS & " , max FPS " & Int(1000 / Int(FPSct / FPS)) & " (per frame " & Int(FPSct / FPS) & " ms)" - WriteLine "Button " & Mouse.button & " , click state " & Mouse.State & " , in (" & Mouse.X & "," & Mouse.y & ")" + WriteLine "Button " & Mouse.button & " , click state " & Mouse.State & " , in (" & Mouse.X & "," & Mouse.Y & ")" NewLine SetConsoleColor colors.HighLightText WriteLine "Visual Basic 6.0 IDE" @@ -688,7 +688,7 @@ ReCopy: Call BackLine: Call ClearLine SetConsoleColor colors.DefaultText Select Case Params(1) - Case "": WriteWord "Button " & Mouse.button & " , click state " & Mouse.State & " , in (" & Mouse.X & "," & Mouse.y & ")" + Case "": WriteWord "Button " & Mouse.button & " , click state " & Mouse.State & " , in (" & Mouse.X & "," & Mouse.Y & ")" Case "-help" WriteWord "No any commands ." Call ExitExec @@ -805,7 +805,7 @@ Public Sub Update2() SetConsoleColor colors.HighLightText WriteLine Version SetConsoleColor colors.ContentText - WriteLine "Copyright (C) 2019 Error404 all rights reserved ." + WriteLine "Copyright (C) 2019-2020 Error404 all rights reserved ." NewLine SetConsoleColor colors.DefaultText WriteWord "Project name : " @@ -840,17 +840,17 @@ Public Sub Update2() PaintDC ConsoleDC, Page.CDC, 20, 40, 0, sy * 3222, GW - 40, IIf(3222 - sy * 3222 < GH, 3222 - sy * 3222, GH), 1 - Dim pro As Long, alpha As Single + Dim pro As Long, Alpha As Single pro = GetTickCount Mod 1000 If pro <= 700 Then - alpha = 1 - Cubic(pro / 700, 0, 1, 1, 1) + Alpha = 1 - Cubic(pro / 700, 0, 1, 1, 1) Else - alpha = Cubic((pro - 700) / 300, 0, 1, 1, 1) + Alpha = Cubic((pro - 700) / 300, 0, 1, 1, 1) End If Page.Writes InputingText, CuX + 20, CuY - sy * 3222 + 40, 16, argb(255, 242, 242, 242) - If GetActiveWindow = Debuginfo.Hwnd Then Page.Paint 0, CuX + 20 + EF.GetWidth(Page.GG, InputingText, 16, StringAlignmentNear, FontStyleRegular), CuY - sy * 3222 + 40, 3, 20, argb(alpha * 255, 255, 255, 255) + If GetActiveWindow = Debuginfo.Hwnd Then Page.Paint 0, CuX + 20 + EF.GetWidth(Page.GG, InputingText, 16, StringAlignmentNear, FontStyleRegular), CuY - sy * 3222 + 40, 3, 20, argb(Alpha * 255, 255, 255, 255) If CuY + 80 >= GH Then Dim MaxY As Single @@ -893,22 +893,22 @@ Public Sub Update() Page.Writes "FPS:" & FPS & "/" & Int(1000 / Int(FPSct / FPS)), 55, 16, 18, TColor, 120 End If - Page.DrawImage "profile.png", 5, 54 / 2 - 48 / 2 + 1, alpha:=1 + Page.DrawImage "profile.png", 5, 54 / 2 - 48 / 2 + 1, Alpha:=1 If Debug_mouse Then Page.Paint 0, GW - 48, 0, 49, GH, argb(60, 255, 255, 255) - Page.DrawImage "mouse" & Mouse.button & ".png", GW - 48, 54 / 2 - 48 / 2 + 1, alpha:=1 + Page.DrawImage "mouse" & Mouse.button & ".png", GW - 48, 54 / 2 - 48 / 2 + 1, Alpha:=1 If Debuginfo.Visible Then Page.Paint 0, GW - 48 * 3, 0, 49, GH, argb(60, 255, 255, 255) - Page.DrawImage "menu.png", GW - 48 * 3, 54 / 2 - 48 / 2 + 1, alpha:=1 + Page.DrawImage "menu.png", GW - 48 * 3, 54 / 2 - 48 / 2 + 1, Alpha:=1 If Debug_umode Then Page.Paint 0, GW - 48 * 5, 0, 49, GH, argb(60, 255, 255, 255) - Page.DrawImage "u" & Debug_umode & ".png", GW - 48 * 5, 54 / 2 - 48 / 2 + 1, alpha:=1 + Page.DrawImage "u" & Debug_umode & ".png", GW - 48 * 5, 54 / 2 - 48 / 2 + 1, Alpha:=1 If Debug_pos Then Page.Paint 0, GW - 48 * 4, 0, 49, GH, argb(60, 255, 255, 255) - Page.DrawImage "pos.png", GW - 48 * 4, 54 / 2 - 48 / 2 + 1, alpha:=1 + Page.DrawImage "pos.png", GW - 48 * 4, 54 / 2 - 48 / 2 + 1, Alpha:=1 If Debug_data Then Page.Paint 0, GW - 48 * 2, 0, 49, GH, argb(60, 255, 255, 255) - Page.DrawImage "data.png", GW - 48 * 2, 54 / 2 - 48 / 2 + 1, alpha:=1 + Page.DrawImage "data.png", GW - 48 * 2, 54 / 2 - 48 / 2 + 1, Alpha:=1 Page.Paint 0, 0, 0, GW + 1, 6, argb(255, 36, 173, 243) If FPS <> 0 Then diff --git a/Core/GPage.cls b/Core/GPage.cls index 7af96e5..5d63f40 100644 --- a/Core/GPage.cls +++ b/Core/GPage.cls @@ -28,6 +28,7 @@ Dim Anis() As AniTask Dim DrawBox As Object, brush As Long, path As Long, Pen As Long Dim CRgn As Long Dim AniCollection() As EAnimation, PlayAni() As EAnimation +Public OODC As Long, OOGG As Long, ScrollMode As Boolean, ScrollWidth As Long, ScrollHeight As Long Public CDC As Long, GG As Long Public Res As GResource Public TopPage As Boolean @@ -82,7 +83,7 @@ Public IsSystem As Boolean End Sub Public Sub Display(DC As Long) If TopPage Then - If Not ECore.FreezeAvailable Then PaintDC CDC, DC, alpha:=1 + If Not ECore.FreezeAvailable Then PaintDC CDC, DC, Alpha:=1 Else If Not ECore.FreezeAvailable Then BitBlt DC, 0, 0, RGW, RGH, CDC, 0, 0, vbSrcCopy End If @@ -164,7 +165,7 @@ Public IsSystem As Boolean End Sub '======================================================== ' Images - Public Sub DrawAnimation(playname As String, X As Long, y As Long, Optional Direction As ImgDirection = DirNormal) + Public Sub DrawAnimation(playname As String, X As Long, Y As Long, Optional Direction As ImgDirection = DirNormal) If ECore.FreezeAvailable Then Exit Sub Dim S As Integer, m As Integer, W As Long, H As Long, last As Boolean @@ -174,16 +175,16 @@ Public IsSystem As Boolean With PlayAni(S).channel(PlayAni(S).CurrentChannel).frames(PlayAni(S).channel(PlayAni(S).CurrentChannel).CurrentFrame) For I = 0 To UBound(.aframes) - If .aframes(I).alpha = 1 Then m = 1 - If .aframes(I).alpha <> 1 Then m = 1 + If .aframes(I).Alpha = 1 Then m = 1 + If .aframes(I).Alpha <> 1 Then m = 1 If .aframes(I).size <> 1 Then m = 0 If m = 0 Then W = Res.ImgSize(.aframes(I).picindex, imgGetWidth) * .aframes(I).size H = Res.ImgSize(.aframes(I).picindex, imgGetHeight) * .aframes(I).size - DrawImageEx .aframes(I).picindex, X + .aframes(I).X, y + .aframes(I).y, W, H, PlayAni(S).position + DrawImageEx .aframes(I).picindex, X + .aframes(I).X, Y + .aframes(I).Y, W, H, PlayAni(S).position Else - DrawImage .aframes(I).picindex, X + .aframes(I).X, y + .aframes(I).y, pos:=PlayAni(S).position, alpha:=.aframes(I).alpha, Direction:=Direction + DrawImage .aframes(I).picindex, X + .aframes(I).X, Y + .aframes(I).Y, pos:=PlayAni(S).position, Alpha:=.aframes(I).Alpha, Direction:=Direction End If Next @@ -215,19 +216,19 @@ Public IsSystem As Boolean If DisposeMark Then DisposePlayAnimation playname End Sub - Public Sub DrawImageEx(n, ByVal X As Single, ByVal y As Single, Optional W, Optional H, Optional pos As PosAlign = posNormal, Optional angle As Long = 0, Optional animation As Integer = 0) + Public Sub DrawImageEx(n, ByVal X As Single, ByVal Y As Single, Optional W, Optional H, Optional pos As PosAlign = posNormal, Optional angle As Long = 0, Optional animation As Integer = 0) Dim index As Integer If ECore.FreezeAvailable And (Not IsSystem) Then Exit Sub If Scales <> 1 Then - X = X * Scales: y = y * Scales + X = X * Scales: Y = Y * Scales If Not IsMissing(W) Then W = W * Scales If Not IsMissing(H) Then H = H * Scales End If Dim OX As Single, OY As Single, ow As Long, oh As Long - OX = X: OY = y: ow = W: oh = H + OX = X: OY = Y: ow = W: oh = H If animation <> 0 Then If Not Anis(animation).mark Then @@ -277,7 +278,7 @@ Public IsSystem As Boolean With DrawF .X = OX - .y = OY + .Y = OY .Width = ow .Height = oh .CrashIndex = Res.ResourceCrashIndex(index) @@ -297,31 +298,31 @@ Public IsSystem As Boolean If Debug_pos Then GdipSetPenWidth Pen, 1 GdipSetPenColor Pen, argb(255, 0, 183, 195) - GdipDrawLine GG, Pen, X - 5, y, X + 5, y - GdipDrawLine GG, Pen, X, y - 5, X, y + 5 + GdipDrawLine GG, Pen, X - 5, Y, X + 5, Y + GdipDrawLine GG, Pen, X, Y - 5, X, Y + 5 End If If ChoosePosition Then Call JudgeChoosePosition(OX, OY, ow, oh) End If End Sub - Public Sub DrawImage(n, ByVal X As Long, ByVal y As Long, Optional cx, Optional cy, Optional cw, Optional ch, Optional alpha, Optional pos As PosAlign = posNormal, Optional animation As Integer = 0, Optional Direction As ImgDirection = DirNormal) + Public Sub DrawImage(n, ByVal X As Long, ByVal Y As Long, Optional CX, Optional CY, Optional cw, Optional ch, Optional Alpha, Optional pos As PosAlign = posNormal, Optional animation As Integer = 0, Optional Direction As ImgDirection = DirNormal) If ECore.FreezeAvailable And (Not IsSystem) Then Exit Sub 'If OutOfScroll Then Exit Sub If Scales <> 1 Then - X = X * Scales: y = y * Scales - If Not IsMissing(cx) Then cx = cx * Scales - If Not IsMissing(cy) Then cy = cy * Scales + X = X * Scales: Y = Y * Scales + If Not IsMissing(CX) Then CX = CX * Scales + If Not IsMissing(CY) Then CY = CY * Scales If Not IsMissing(cw) Then cw = cw * Scales If Not IsMissing(ch) Then ch = ch * Scales End If Dim B As BLENDFUNCTION, index As Integer, bl As Long Dim OX As Long, OY As Long, ow As Long, oh As Long - OX = X: OY = y: ow = W: oh = H + OX = X: OY = Y: ow = W: oh = H Dim ocx As Long, ocy As Long, ocw As Long, och As Long - If Not IsMissing(alpha) Then + If Not IsMissing(Alpha) Then Dim pro As Single pro = 1 If animation <> 0 Then @@ -329,15 +330,15 @@ Public IsSystem As Boolean pro = CallByName(EAni, "GetProgress_" & Anis(animation).profunc, VbMethod, (GetTickCount - Anis(animation).Start - Anis(animation).delay) / Anis(animation).during) End If End If - alpha = alpha * pro + Alpha = Alpha * pro - If alpha < 0 Then alpha = 0 - If alpha > 1 Then alpha = 1 + If Alpha < 0 Then Alpha = 0 + If Alpha > 1 Then Alpha = 1 With B .AlphaFormat = &H1 .BlendFlags = &H0 .BlendOp = 0 - .SourceConstantAlpha = Int(alpha * 255) + .SourceConstantAlpha = Int(Alpha * 255) End With CopyMemory bl, B, 4 End If @@ -348,8 +349,8 @@ Public IsSystem As Boolean index = n End If - If IsMissing(cx) Then ocx = 0 Else: ocx = cx - If IsMissing(cy) Then ocy = 0 Else: ocy = cy + If IsMissing(CX) Then ocx = 0 Else: ocx = CX + If IsMissing(CY) Then ocy = 0 Else: ocy = CY If IsMissing(cw) Then ocw = Res.ImgSize(index, imgGetWidth) - ocx Else: ocw = cw If IsMissing(ch) Then och = Res.ImgSize(index, imgGetHeight) - ocy Else: och = ch @@ -372,7 +373,7 @@ Public IsSystem As Boolean srcDC = Res.ResourceGIFCurrentHandle(index) End If - If IsMissing(alpha) Then + If IsMissing(Alpha) Then BitBlt CDC, OX, OY, ocw, och, srcDC, ocx, ocy, vbSrcCopy Else AlphaBlend CDC, OX, OY, ocw, och, srcDC, ocx, ocy, ocw, och, bl @@ -380,7 +381,7 @@ Public IsSystem As Boolean With DrawF .X = OX - .y = OY + .Y = OY .Width = ocw .Height = och .CrashIndex = Res.ResourceCrashIndex(index) @@ -400,8 +401,8 @@ Public IsSystem As Boolean If Debug_pos Then GdipSetPenWidth Pen, 1 GdipSetPenColor Pen, argb(255, 0, 183, 195) - GdipDrawLine GG, Pen, X - 5, y, X + 5, y - GdipDrawLine GG, Pen, X, y - 5, X, y + 5 + GdipDrawLine GG, Pen, X - 5, Y, X + 5, Y + GdipDrawLine GG, Pen, X, Y - 5, X, Y + 5 End If If ChoosePosition Then @@ -410,20 +411,20 @@ Public IsSystem As Boolean End Sub '======================================================== ' Writer - Public Sub Writes(ByVal Text As String, ByVal X As Single, ByVal y As Single, Optional size As Long = 14, Optional Color As Long, Optional ByVal W As Single = 0, Optional ByVal H As Single = 0, Optional align As StringAlignment = StringAlignmentNear, Optional style As FontStyle = FontStyleRegular, Optional animation As Integer = 0) + Public Sub Writes(ByVal Text As String, ByVal X As Single, ByVal Y As Single, Optional size As Long = 14, Optional Color As Long, Optional ByVal W As Single = 0, Optional ByVal H As Single = 0, Optional align As StringAlignment = StringAlignmentNear, Optional style As FontStyle = FontStyleRegular, Optional animation As Integer = 0) 'If OutOfScroll Then Exit Sub If ECore.FreezeAvailable And (Not IsSystem) Then Exit Sub If Scales <> 1 Then - X = X * Scales: y = y * Scales + X = X * Scales: Y = Y * Scales size = size * Scales If Not IsMissing(W) Then W = W * Scales If Not IsMissing(H) Then H = H * Scales End If Dim OX As Single, OY As Single - OX = X: OY = y + OX = X: OY = Y If animation <> 0 Then If Not Anis(animation).mark Then @@ -444,7 +445,7 @@ Public IsSystem As Boolean EF.Writes Text, OX, OY, GG, Color, size, W, H, align, style With DrawF .X = OX - .y = OY + .Y = OY .Width = W .Height = H .CrashIndex = 0 @@ -460,8 +461,8 @@ Public IsSystem As Boolean If Debug_pos Then GdipSetPenWidth Pen, 1 GdipSetPenColor Pen, argb(255, 0, 183, 195) - GdipDrawLine GG, Pen, X - 5, y, X + 5, y - GdipDrawLine GG, Pen, X, y - 5, X, y + 5 + GdipDrawLine GG, Pen, X - 5, Y, X + 5, Y + GdipDrawLine GG, Pen, X, Y - 5, X, Y + 5 End If If ChoosePosition Then @@ -489,9 +490,9 @@ Public IsSystem As Boolean al = co(3): al = al / 255 If Anis(animation).custom Then - CallByName DrawBox, Anis(animation).func, VbMethod, X, y, W, H, al, pro + CallByName DrawBox, Anis(animation).func, VbMethod, X, Y, W, H, al, pro Else - CallByName EAni, Anis(animation).func, VbMethod, X, y, W, H, al, pro + CallByName EAni, Anis(animation).func, VbMethod, X, Y, W, H, al, pro End If Color = argb(al * 255, co(0), co(1), co(2)) End If @@ -506,7 +507,7 @@ Public IsSystem As Boolean With DrawF .X = IIf(X1 < X2, X1, X2) - .y = IIf(Y1 < Y2, Y1, Y2) + .Y = IIf(Y1 < Y2, Y1, Y2) .Width = IIf(X1 < X2, X2 - X1, X1 - X2) .Height = IIf(Y1 < Y2, Y2 - Y1, Y1 - Y2) .CrashIndex = 0 @@ -518,16 +519,16 @@ Public IsSystem As Boolean If Debug_focus Then GdipSetPenWidth Pen, 1 GdipSetPenColor Pen, argb(255, 240, 176, 0) - GdipDrawRectangle GG, Pen, DrawF.X, DrawF.y, DrawF.Width + 1, DrawF.Height + 1 + GdipDrawRectangle GG, Pen, DrawF.X, DrawF.Y, DrawF.Width + 1, DrawF.Height + 1 End If If ChoosePosition Then Call JudgeChoosePosition(X1, Y1, 0, 0) Call JudgeChoosePosition(X2, Y2, 0, 0) - Call JudgeChoosePosition(DrawF.X, DrawF.y, DrawF.Width, DrawF.Height) + Call JudgeChoosePosition(DrawF.X, DrawF.Y, DrawF.Width, DrawF.Height) End If End Sub - Public Sub Paint(ByVal Shape As Integer, ByVal X As Single, ByVal y As Single, ByVal W As Single, ByVal H As Single, Optional Color As Long, Optional Radius As Long, Optional size As Long = 1, Optional style As Integer = 0, Optional pos As PosAlign = posNormal, Optional animation As Integer = 0) + Public Sub Paint(ByVal Shape As Integer, ByVal X As Single, ByVal Y As Single, ByVal W As Single, ByVal H As Single, Optional Color As Long, Optional Radius As Long, Optional size As Long = 1, Optional style As Integer = 0, Optional pos As PosAlign = posNormal, Optional animation As Integer = 0) 'shape:0=rect,1=ellipse,2=rectr 'style:0=fill,1=border 'If OutOfScroll Then Exit Sub @@ -535,14 +536,14 @@ Public IsSystem As Boolean If ECore.FreezeAvailable And (Not IsSystem) Then Exit Sub If Scales <> 1 Then - X = X * Scales: y = y * Scales + X = X * Scales: Y = Y * Scales W = W * Scales H = H * Scales size = size * Scales End If Dim OX As Single, OY As Single, ow As Single, oh As Single - OX = X: OY = y: ow = W: oh = H + OX = X: OY = Y: ow = W: oh = H If ScrollMode Then OX = OX + ScrollX + ScrollBX: OY = OY + ScrollY + ScrollBY @@ -610,7 +611,7 @@ ReShape: With DrawF .X = OX - .y = OY + .Y = OY .Width = ow .Height = oh .Shape = Shape @@ -628,28 +629,28 @@ ReShape: If Debug_pos Then GdipSetPenWidth Pen, 1 GdipSetPenColor Pen, argb(255, 0, 183, 195) - GdipDrawLine GG, Pen, X - 5, y, X + 5, y - GdipDrawLine GG, Pen, X, y - 5, X, y + 5 + GdipDrawLine GG, Pen, X - 5, Y, X + 5, Y + GdipDrawLine GG, Pen, X, Y - 5, X, Y + 5 End If If ChoosePosition Then Call JudgeChoosePosition(OX, OY, ow, oh) End If End Sub - Public Sub PaintArc(ByVal X As Single, ByVal y As Single, ByVal W As Single, ByVal H As Single, degree As Single, Optional Start As Single = 0, Optional Color As Long, Optional size As Long = 1, Optional style As Integer = 0, Optional pos As PosAlign = posNormal, Optional animation As Integer = 0) + Public Sub PaintArc(ByVal X As Single, ByVal Y As Single, ByVal W As Single, ByVal H As Single, degree As Single, Optional Start As Single = 0, Optional Color As Long, Optional size As Long = 1, Optional style As Integer = 0, Optional pos As PosAlign = posNormal, Optional animation As Integer = 0) 'style:0=fill,1=border,2=sector If ECore.FreezeAvailable And (Not IsSystem) Then Exit Sub If Scales <> 1 Then - X = X * Scales: y = y * Scales + X = X * Scales: Y = Y * Scales W = W * Scales H = H * Scales size = size * Scales End If Dim OX As Single, OY As Single, ow As Single, oh As Single - OX = X: OY = y: ow = W: oh = H + OX = X: OY = Y: ow = W: oh = H If animation <> 0 Then If Not Anis(animation).mark Then @@ -669,7 +670,7 @@ ReShape: GdipResetPath path - If pos = 1 Then OX = Int(X - ow / 2): OY = Int(y - oh / 2) + If pos = 1 Then OX = Int(X - ow / 2): OY = Int(Y - oh / 2) If pos = 2 Then OX = OX - ow If pos = 3 Then OY = OY - oh If pos = 4 Then OX = OX + ow @@ -692,7 +693,7 @@ ReShape: With DrawF .X = OX - .y = OY + .Y = OY .Width = ow .Height = oh .CrashIndex = 0 @@ -710,8 +711,8 @@ ReShape: If Debug_pos Then GdipSetPenWidth Pen, 1 GdipSetPenColor Pen, argb(255, 0, 183, 195) - GdipDrawLine GG, Pen, X - 5, y, X + 5, y - GdipDrawLine GG, Pen, X, y - 5, X, y + 5 + GdipDrawLine GG, Pen, X - 5, Y, X + 5, Y + GdipDrawLine GG, Pen, X, Y - 5, X, Y + 5 End If If ChoosePosition Then @@ -730,7 +731,7 @@ ReShape: Dim p() As POINTF ReDim p((UBound(Points) - 1) / 2) For I = 0 To UBound(Points) Step 2 - p(I / 2).X = Points(I): p(I / 2).y = Points(I + 1) + p(I / 2).X = Points(I): p(I / 2).Y = Points(I + 1) Next If SmoothMode Then @@ -768,7 +769,7 @@ ReShape: Dim p() As POINTF ReDim p((UBound(Points) - 1) / 2) For I = 0 To UBound(Points) Step 2 - p(I / 2).X = Points(I): p(I / 2).y = Points(I + 1) + p(I / 2).X = Points(I): p(I / 2).Y = Points(I + 1) Next If SmoothMode Then @@ -819,11 +820,11 @@ ReShape: End Function '======================================================== 'Control - Public Function ShowEdit(Text As String, Shape As Integer, X As Single, y As Single, W As Single, H As Single, TextColor As Long, Color As Long, HoverColor As Long, LineColor As Long, Optional Radius As Long = 0, Optional ShapeStyle As Integer = 0, Optional size As Long = 14, Optional style As FontStyle = FontStyleRegular) As MButtonState + Public Function ShowEdit(Text As String, Shape As Integer, X As Single, Y As Single, W As Single, H As Single, TextColor As Long, Color As Long, HoverColor As Long, LineColor As Long, Optional Radius As Long = 0, Optional ShapeStyle As Integer = 0, Optional size As Long = 14, Optional style As FontStyle = FontStyleRegular) As MButtonState Dim m As Integer, R As RECT - m = CheckMouse(X, y, W - IIf(TextHandle = VarPtr(Text), H, 0), H) - Paint Shape, X, y, W, H, IIf(m <> 0 Or TextHandle = VarPtr(Text), HoverColor, Color), Radius, style:=ShapeStyle + m = CheckMouse(X, Y, W - IIf(TextHandle = VarPtr(Text), H, 0), H) + Paint Shape, X, Y, W, H, IIf(m <> 0 Or TextHandle = VarPtr(Text), HoverColor, Color), Radius, style:=ShapeStyle If m = 3 Then TextHandle = VarPtr(Text) Dim CtrlPressed As Boolean @@ -852,37 +853,37 @@ ReShape: WaitChr = "" End If - Writes Text, X + Radius / 4, y + H / 2 - size / 0.75 / 2 - 1, size, TextColor, W - Radius / 2 - H, size / 0.75, StringAlignmentNear, style + Writes Text, X + Radius / 4, Y + H / 2 - size / 0.75 / 2 - 1, size, TextColor, W - Radius / 2 - H, size / 0.75, StringAlignmentNear, style If TextHandle = VarPtr(Text) Then - Dim w2 As Long, pro As Long, alpha As Single + Dim w2 As Long, pro As Long, Alpha As Single w2 = EF.GetWidth(GG, Text, size, StringAlignmentNear, style) If w2 > W - Radius / 2 - H Then If Len(Text) > 0 Then Text = Left(Text, Len(Text) - 1): VBA.Beep End If - Paint Shape, X, y, W, H, LineColor, size:=2, Radius:=Radius, style:=1 + Paint Shape, X, Y, W, H, LineColor, size:=2, Radius:=Radius, style:=1 pro = GetTickCount Mod 1000 If pro <= 700 Then - alpha = 1 - Cubic(pro / 700, 0, 1, 1, 1) + Alpha = 1 - Cubic(pro / 700, 0, 1, 1, 1) Else - alpha = Cubic((pro - 700) / 300, 0, 1, 1, 1) + Alpha = Cubic((pro - 700) / 300, 0, 1, 1, 1) End If Dim co(3) As Byte, co2 As Long co2 = IIf(m <> 0 Or TextHandle = VarPtr(Text), HoverColor, Color) CopyMemory co(0), co2, 4 If w2 = 0 Then w2 = size / 4 - If alpha <> 0 Then Paint 0, X + w2 + Radius / 4 - size / 8, y + H / 2 - size / 2, 3, size, argb(Int(alpha * 255), 255 - co(2), 255 - co(1), 255 - co(0)) + If Alpha <> 0 Then Paint 0, X + w2 + Radius / 4 - size / 8, Y + H / 2 - size / 2, 3, size, argb(Int(Alpha * 255), 255 - co(2), 255 - co(1), 255 - co(0)) - Paint Shape, X + W - H, y, H, H, LineColor, Radius:=Radius + Paint Shape, X + W - H, Y, H, H, LineColor, Radius:=Radius If CheckMouse2 = mMouseUp Then TextHandle = 0 m = 4 End If If Shape = 2 Then - Writes ">", X + W - H, y + H / 2 - size / 0.75 / 2 - 1, size, TextColor, H + 6, size / 0.75, StringAlignmentCenter, FontStyleBold + Writes ">", X + W - H, Y + H / 2 - size / 0.75 / 2 - 1, size, TextColor, H + 6, size / 0.75, StringAlignmentCenter, FontStyleBold Else - Writes ">", X + W - H, y + H / 2 - size / 0.75 / 2 - 2, size, TextColor, H + 3, size / 0.75, StringAlignmentCenter, FontStyleBold + Writes ">", X + W - H, Y + H / 2 - size / 0.75 / 2 - 2, size, TextColor, H + 3, size / 0.75, StringAlignmentCenter, FontStyleBold End If End If @@ -891,90 +892,90 @@ ReShape: ShowEdit = m End Function - Public Sub ShowLoading(X As Single, y As Single, W As Single, H As Single, size As Long, color1 As Long, color2 As Long, color3 As Long) + Public Sub ShowLoading(X As Single, Y As Single, W As Single, H As Single, size As Long, color1 As Long, color2 As Long, color3 As Long) - PaintArc X, y, W, H, 120, (GetTickCount Mod 3000) / 3000 * 360, color3, size * 0.86, 1 - PaintArc X, y, W, H, 120, (GetTickCount Mod 1800) / 1800 * 360 + 90, color2, size * 0.93, 1 - PaintArc X, y, W, H, 120, (GetTickCount Mod 1200) / 1200 * 360 + 90, color1, size, 1 + PaintArc X, Y, W, H, 120, (GetTickCount Mod 3000) / 3000 * 360, color3, size * 0.86, 1 + PaintArc X, Y, W, H, 120, (GetTickCount Mod 1800) / 1800 * 360 + 90, color2, size * 0.93, 1 + PaintArc X, Y, W, H, 120, (GetTickCount Mod 1200) / 1200 * 360 + 90, color1, size, 1 'argb(255, 242, 195, 17),argb(255, 240, 127, 34),argb(255, 232, 76, 61) End Sub - Public Function ShowButton(pic As String, X As Long, y As Long, Text As String, Color As Long, Optional size As Long = 14, Optional style As FontStyle = FontStyleRegular) As MButtonState + Public Function ShowButton(pic As String, X As Long, Y As Long, Text As String, Color As Long, Optional size As Long = 14, Optional style As FontStyle = FontStyleRegular) As MButtonState Dim W As Single, H As Single, I As Integer, m As Integer I = Res.GetImage(pic) W = Res.ImgSize(I, imgGetWidth): H = Res.ImgSize(I, imgGetHeight) - m = CheckMouse(X, y, W, Int(H / 2)) - DrawImage I, X, y, cy:=IIf(m <> 0, Int(H / 2), 0), ch:=Int(H / 2), alpha:=1 + m = CheckMouse(X, Y, W, Int(H / 2)) + DrawImage I, X, Y, CY:=IIf(m <> 0, Int(H / 2), 0), ch:=Int(H / 2), Alpha:=1 - Writes Text, X, y + H / 2 / 2 - EF.EmHeight / 18 * size / 2 + 1, size, Color, W, size / 0.75, StringAlignmentCenter, style + Writes Text, X, Y + H / 2 / 2 - EF.EmHeight / 18 * size / 2 + 1, size, Color, W, size / 0.75, StringAlignmentCenter, style ShowButton = m End Function - Public Function ShowSimpleButton(pic As String, X As Long, y As Long, Text As String, Color As Long, Optional size As Long = 14, Optional style As FontStyle = FontStyleRegular) As MButtonState + Public Function ShowSimpleButton(pic As String, X As Long, Y As Long, Text As String, Color As Long, Optional size As Long = 14, Optional style As FontStyle = FontStyleRegular) As MButtonState Dim W As Single, H As Single, I As Integer, m As Integer I = Res.GetImage(pic) W = Res.ImgSize(I, imgGetWidth): H = Res.ImgSize(I, imgGetHeight) - m = CheckMouse(X, y, W, H) - DrawImage I, X, y, alpha:=IIf(m, 1, 0.8) + m = CheckMouse(X, Y, W, H) + DrawImage I, X, Y, Alpha:=IIf(m, 1, 0.8) - Writes Text, X, y + H / 2 - EF.EmHeight / 18 * size / 2 + 1, size, Color, W, size / 0.75, StringAlignmentCenter, style + Writes Text, X, Y + H / 2 - EF.EmHeight / 18 * size / 2 + 1, size, Color, W, size / 0.75, StringAlignmentCenter, style ShowSimpleButton = m End Function - Public Function ShowColorButton(Shape As Integer, X As Single, y As Single, W As Single, H As Single, Text As String, TextColor As Long, Color As Long, HoverColor As Long, Optional Radius As Long = 0, Optional ShapeStyle As Integer = 0, Optional size As Long = 14, Optional style As FontStyle = FontStyleRegular) As MButtonState + Public Function ShowColorButton(Shape As Integer, X As Single, Y As Single, W As Single, H As Single, Text As String, TextColor As Long, Color As Long, HoverColor As Long, Optional Radius As Long = 0, Optional ShapeStyle As Integer = 0, Optional size As Long = 14, Optional style As FontStyle = FontStyleRegular) As MButtonState Dim m As Integer - m = CheckMouse(X, y, W, H) - Paint Shape, X, y, W, H, IIf(m, HoverColor, Color), Radius, style:=ShapeStyle + m = CheckMouse(X, Y, W, H) + Paint Shape, X, Y, W, H, IIf(m, HoverColor, Color), Radius, style:=ShapeStyle - Writes Text, X, y + H / 2 - EF.EmHeight / 18 * size / 2 + 1, size, TextColor, W, size / 0.75, StringAlignmentCenter, style + Writes Text, X, Y + H / 2 - EF.EmHeight / 18 * size / 2 + 1, size, TextColor, W, size / 0.75, StringAlignmentCenter, style ShowColorButton = m End Function - Public Function ShowCheckBox(value, pic As String, X As Long, y As Long, Text As String, Color As Long, Optional size As Long = 14, Optional style As FontStyle = FontStyleRegular) As MButtonState + Public Function ShowCheckBox(value, pic As String, X As Long, Y As Long, Text As String, Color As Long, Optional size As Long = 14, Optional style As FontStyle = FontStyleRegular) As MButtonState Dim W As Single, H As Single, I As Integer, m As Integer Dim X2 As Long, Y2 As Long - X2 = X: Y2 = y + X2 = X: Y2 = Y I = Res.GetImage(pic) W = Res.ImgSize(I, imgGetWidth): H = Res.ImgSize(I, imgGetHeight) - m = CheckMouse(X, y, W, Int(H / 2)) - DrawImage I, X, y, cy:=IIf(value = True, Int(H / 2), 0), ch:=Int(H / 2), alpha:=1 + m = CheckMouse(X, Y, W, Int(H / 2)) + DrawImage I, X, Y, CY:=IIf(value = True, Int(H / 2), 0), ch:=Int(H / 2), Alpha:=1 If m = 3 Then value = IIf(value = True, False, True) Writes Text, X2 + W + EF.EmHeight / 18 * size / 2 + 1, Y2 + H / 2 / 2 - EF.EmHeight / 18 * size / 2 + 1, size, Color, GW, size / 0.75, StringAlignmentNear, style ShowCheckBox = m End Function - Public Function ShowColorCheckBox(value, X As Single, y As Single, W As Single, H As Single, Text As String, DefaultColor As Long, ChooseColor As Long, ForeColor As Long, Optional size As Long = 14, Optional style As FontStyle = FontStyleRegular) As MButtonState + Public Function ShowColorCheckBox(value, X As Single, Y As Single, W As Single, H As Single, Text As String, DefaultColor As Long, ChooseColor As Long, ForeColor As Long, Optional size As Long = 14, Optional style As FontStyle = FontStyleRegular) As MButtonState - m = CheckMouse(X, y, W, H) + m = CheckMouse(X, Y, W, H) - Paint 1, X, y, H, H, IIf(value = True, ChooseColor, DefaultColor) + Paint 1, X, Y, H, H, IIf(value = True, ChooseColor, DefaultColor) If m = 3 Then value = IIf(value = True, False, True) - Writes Text, X + H + EF.EmHeight / 18 * size / 2 + 1, y + H / 2 - EF.EmHeight / 18 * size / 2 + 1, size, ForeColor, GW, size / 0.75, StringAlignmentNear, style + Writes Text, X + H + EF.EmHeight / 18 * size / 2 + 1, Y + H / 2 - EF.EmHeight / 18 * size / 2 + 1, size, ForeColor, GW, size / 0.75, StringAlignmentNear, style ShowColorCheckBox = m End Function - Public Function ShowSliderBar(value, pic As String, X As Long, y As Long) As MButtonState + Public Function ShowSliderBar(value, pic As String, X As Long, Y As Long) As MButtonState Dim W As Single, H As Single, I As Integer, m As Integer Dim X2 As Long, Y2 As Long - X2 = X: Y2 = y + X2 = X: Y2 = Y I = Res.GetImage(pic) W = Res.ImgSize(I, imgGetWidth): H = Res.ImgSize(I, imgGetHeight) - m = CheckMouse(X, y, W, Int(H / 2)) - DrawImage I, X, y, cy:=0, ch:=Int(H / 2), alpha:=1 - DrawImage I, X, y, cy:=Int(H / 2), cw:=value * W, ch:=Int(H / 2), alpha:=1 + m = CheckMouse(X, Y, W, Int(H / 2)) + DrawImage I, X, Y, CY:=0, ch:=Int(H / 2), Alpha:=1 + DrawImage I, X, Y, CY:=Int(H / 2), cw:=value * W, ch:=Int(H / 2), Alpha:=1 If m > 0 And Mouse.button > 0 Then value = (Mouse.X - X) / W @@ -984,12 +985,12 @@ ReShape: ShowSliderBar = m End Function - Public Function ShowHScrollBar(value, X As Single, y As Single, W As Single, H As Single, LineColor As Long, BallColor As Long, Optional size As Long = 2) As MButtonState + Public Function ShowHScrollBar(value, X As Single, Y As Single, W As Single, H As Single, LineColor As Long, BallColor As Long, Optional size As Long = 2) As MButtonState Dim m As Integer - m = CheckMouse(X, y, W, H) - PaintLine X, y + H / 2 - size / 2, X + W, y + H / 2 - size / 2, LineColor, size - Paint 1, X + value * (W - H), y, H, H, BallColor + m = CheckMouse(X, Y, W, H) + PaintLine X, Y + H / 2 - size / 2, X + W, Y + H / 2 - size / 2, LineColor, size + Paint 1, X + value * (W - H), Y, H, H, BallColor If m > 0 And Mouse.button > 0 Then value = (Mouse.X - X) / (W - H) If value < 0 Then value = 0 @@ -998,15 +999,15 @@ ReShape: ShowHScrollBar = m End Function - Public Function ShowVScrollBar(value, X As Single, y As Single, W As Single, H As Single, LineColor As Long, BallColor As Long, Optional size As Long = 2) As MButtonState + Public Function ShowVScrollBar(value, X As Single, Y As Single, W As Single, H As Single, LineColor As Long, BallColor As Long, Optional size As Long = 2) As MButtonState Dim m As Integer - m = CheckMouse(X, y, W, H) - PaintLine X + W / 2 - size / 2, y, X + W / 2 - size / 2, y + H, LineColor, size - Paint 1, X, y + value * (H - W), W, W, BallColor + m = CheckMouse(X, Y, W, H) + PaintLine X + W / 2 - size / 2, Y, X + W / 2 - size / 2, Y + H, LineColor, size + Paint 1, X, Y + value * (H - W), W, W, BallColor If m > 0 And Mouse.button > 0 Then - value = (Mouse.y - y) / (H - W) + value = (Mouse.Y - Y) / (H - W) If value < 0 Then value = 0 If value > 1 Then value = 1 End If diff --git a/Version.txt b/Version.txt index 623afe2..6c7f30a 100644 --- a/Version.txt +++ b/Version.txt @@ -1 +1 @@ -20012801 \ No newline at end of file +20012901 \ No newline at end of file