Skip to content

Commit 5d69c6f

Browse files
committed
...
1 parent 14ab655 commit 5d69c6f

2 files changed

Lines changed: 30 additions & 26 deletions

File tree

src/mineSweeperGUI.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,37 @@
2121

2222
class MineSweeperGUI(superGUI.Ui_MainWindow):
2323
def __init__(self, MainWindow, args):
24+
print(args)
2425
self.mainWindow = MainWindow
26+
self.checksum_guard = metaminesweeper_checksum.ChecksumGuard()
27+
if len(args) == 3:
28+
print(args)
29+
if args[1] == "-v":
30+
print(superGUI.version)
31+
return
32+
elif args[1] == "-t":
33+
if args[2][-3:] == "evf":
34+
video = ms.EvfVideo(args[2])
35+
else:
36+
print("unknown")
37+
return
38+
try:
39+
video.parse_video()
40+
except:
41+
print("false")
42+
return
43+
44+
if self.checksum_guard.\
45+
valid_checksum(video.raw_data[:-33], video.checksum):
46+
print("true")
47+
return
48+
else:
49+
print("false")
50+
return
51+
2552
super(MineSweeperGUI, self).__init__(MainWindow, args)
53+
54+
2655
# MineSweeperGUI父类的init中读.ini、读图片、设置字体、局面初始化等
2756

2857
self.time_10ms: int = 0 # 已毫秒为单位的游戏时间,全局统一的

src/superGUI.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,33 +25,8 @@ class Ui_MainWindow(Ui_MainWindow):
2525
def __init__(self, MainWindow, args):
2626
self.mainWindow = MainWindow
2727
self.setupUi(self.mainWindow)
28-
29-
self.checksum_guard = metaminesweeper_checksum.ChecksumGuard()
30-
if len(args) == 3:
31-
print(args)
32-
if args[1] == "-v":
33-
print(version)
34-
return
35-
elif args[1] == "-t":
36-
if args[2][-3:] == "evf":
37-
video = ms.EvfVideo(args[2])
38-
else:
39-
print("unknown")
40-
return
41-
try:
42-
video.parse_video()
43-
except:
44-
print("false")
45-
return
46-
47-
if self.checksum_guard.\
48-
valid_checksum(video.raw_data[:-33], video.checksum):
49-
print("true")
50-
return
51-
else:
52-
print("false")
53-
return
5428

29+
5530
# 设置全局路径
5631
r_path = Path(args[0]).parent
5732
self.r_path = r_path

0 commit comments

Comments
 (0)