From 1a376c854dc4af77f3cdccd6685a8ea97e8d12e4 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Tue, 14 Apr 2020 17:52:56 +0800 Subject: [PATCH] v1.3 --- Form_Game.frm | 44 ++++++++++++++++++++++++++++++++++++++++++-- Form_Rand_Case.frm | 23 +++++++++++++++++++---- HRD_Game.vbp | 2 +- HRD_Game.vbw | 2 +- 4 files changed, 63 insertions(+), 8 deletions(-) diff --git a/Form_Game.frm b/Form_Game.frm index eb180be..4c5803d 100644 --- a/Form_Game.frm +++ b/Form_Game.frm @@ -2,7 +2,7 @@ VERSION 5.00 Begin VB.Form Form_Game AutoRedraw = -1 'True BorderStyle = 1 'Fixed Single - Caption = "HRD Game v1.2 by Dnomd343" + Caption = "HRD Game v1.3 by Dnomd343" ClientHeight = 7305 ClientLeft = 45 ClientTop = 690 @@ -14,6 +14,22 @@ Begin VB.Form Form_Game ScaleHeight = 7305 ScaleWidth = 7290 StartUpPosition = 2 '屏幕中心 + Begin VB.CommandButton Command_Reduction_Snapshot + Caption = "还原快照" + Height = 495 + Left = 5760 + TabIndex = 10 + Top = 3480 + Width = 1335 + End + Begin VB.CommandButton Command_Create_Snapshot + Caption = "创建快照" + Height = 495 + Left = 5760 + TabIndex = 9 + Top = 2880 + Width = 1335 + End Begin VB.CommandButton Command_Rand_Case Caption = "随机生成布局" Height = 495 @@ -48,7 +64,7 @@ Begin VB.Form Form_Game Height = 495 Left = 5760 TabIndex = 1 - Top = 2760 + Top = 4080 Width = 1335 End Begin VB.Timer Timer_Get_Time @@ -138,6 +154,28 @@ Dim mouse_x As Long, mouse_y As Long, mouse_button As Integer Dim last_move As Integer, move_times As Integer Dim total_steps As Long, total_time As Long Dim Start_Code As String +Dim snapshot_code As String, snapshot_step As Long + +Private Sub Command_Create_Snapshot_Click() + If solve_compete = True Then MsgBox "你已经解好啦", , "> _ <": Exit Sub + If playing = False Then MsgBox "你还没开始呢", , "> _ <": Exit Sub + snapshot_code = Label_Code + snapshot_step = total_steps + MsgBox "快照创建成功" & vbCrLf & "编码: " & snapshot_code & vbCrLf & "步数: " & snapshot_step, , "> _ <" +End Sub + +Private Sub Command_Reduction_Snapshot_Click() + If solve_compete = True Then MsgBox "你已经解好啦", , "> _ <": Exit Sub + If playing = False Then MsgBox "你还没开始呢", , "> _ <": Exit Sub + If snapshot_step = -1 Then MsgBox "你还没创建快照呢", , "> _ <": Exit Sub + If MsgBox("真要还原快照?", vbOKCancel, "^ - ^") = vbCancel Then Exit Sub + total_steps = snapshot_step + last_move = 10 + Call Analyse(snapshot_code) + Call Output_Graph + Label_Step = "步数: " & total_steps + Label_Code = snapshot_code +End Sub Private Sub Menu_Debug_Mode_Click() Menu_Debug_Mode.Checked = Not Menu_Debug_Mode.Checked @@ -275,9 +313,11 @@ End Sub Private Sub init() playing = False solve_compete = False + snapshot_step = -1 last_move = 10 move_times = 0 total_steps = 0 + total_time = 0 start_x = 180 start_y = 300 gap = 105 diff --git a/Form_Rand_Case.frm b/Form_Rand_Case.frm index dc061f7..0cf565d 100644 --- a/Form_Rand_Case.frm +++ b/Form_Rand_Case.frm @@ -138,16 +138,16 @@ Private Sub Form_Load() SetWindowPos Me.hwnd, -2, 0, 0, 0, 0, 1 Or 2 End If Call Get_Rand_Data - Print_Block start_x, start_y, square_width * 4 + gap * 5, square_width * 5 + gap * 6, case_line_width, case_color, case_line_color + Call Command_Create_Click End Sub Private Sub Command_Confirm_Click() - If Option_Difficulty_1.Value = False And Option_Difficulty_2.Value = False And Option_Difficulty_3.Value = False And Option_Difficulty_4.Value = False And Option_Difficulty_5.Value = False Then Exit Sub - change_case_title = "随机 - " + change_case_title = "随机-" If Option_Difficulty_1.Value = True Then change_case_title = change_case_title & "入门" If Option_Difficulty_2.Value = True Then change_case_title = change_case_title & "进阶" If Option_Difficulty_3.Value = True Then change_case_title = change_case_title & "中阶" If Option_Difficulty_4.Value = True Then change_case_title = change_case_title & "困难" If Option_Difficulty_5.Value = True Then change_case_title = change_case_title & "骨灰" + If change_case_title = "随机-" Then change_case_title = "随机" change_case_code = Text_Code change_case = True Unload Form_Rand_Case @@ -155,7 +155,7 @@ End Sub Private Sub Command_Create_Click() Dim min_step As Integer, max_step As Integer Dim index As Long, code As String, step As Integer - If Option_Difficulty_1.Value = False And Option_Difficulty_2.Value = False And Option_Difficulty_3.Value = False And Option_Difficulty_4.Value = False And Option_Difficulty_5.Value = False Then Exit Sub + If Option_Difficulty_1.Value = False And Option_Difficulty_2.Value = False And Option_Difficulty_3.Value = False And Option_Difficulty_4.Value = False And Option_Difficulty_5.Value = False Then min_step = 0: max_step = 138 If Option_Difficulty_1.Value = True Then min_step = 0: max_step = 20 If Option_Difficulty_2.Value = True Then min_step = 21: max_step = 50 If Option_Difficulty_3.Value = True Then min_step = 51: max_step = 80 @@ -172,6 +172,21 @@ retry: Call Analyse_Code(code) Call Output_Graph End Sub +Private Sub Option_Difficulty_1_Click() + Call Command_Create_Click +End Sub +Private Sub Option_Difficulty_2_Click() + Call Command_Create_Click +End Sub +Private Sub Option_Difficulty_3_Click() + Call Command_Create_Click +End Sub +Private Sub Option_Difficulty_4_Click() + Call Command_Create_Click +End Sub +Private Sub Option_Difficulty_5_Click() + Call Command_Create_Click +End Sub Private Sub Get_Rand_Data() Dim i As Long Dim temp As String diff --git a/HRD_Game.vbp b/HRD_Game.vbp index 9dc91ec..e0e177e 100644 --- a/HRD_Game.vbp +++ b/HRD_Game.vbp @@ -15,7 +15,7 @@ Name="HRD_Game" HelpContextID="0" CompatibleMode="0" MajorVer=1 -MinorVer=2 +MinorVer=3 RevisionVer=0 AutoIncrementVer=0 ServerSupportFiles=0 diff --git a/HRD_Game.vbw b/HRD_Game.vbw index 11ba98c..215b5dc 100644 --- a/HRD_Game.vbw +++ b/HRD_Game.vbw @@ -1,5 +1,5 @@ Form_Game = 52, 52, 883, 479, , 26, 28, 857, 453, C -Module = 52, 52, 883, 479, +Module = 52, 52, 883, 479, Z Form_Classic_Cases = 104, 104, 891, 531, , 104, 104, 937, 531, C Form_Creator = 130, 130, 917, 557, , 104, 104, 891, 531, C Form_Rand_Case = 78, 78, 855, 505, , 156, 156, 933, 583, C