Skip to content

Commit 0a3155f

Browse files
committed
2 parents 6a466bd + 2a57ad9 commit 0a3155f

34 files changed

Lines changed: 1424 additions & 647 deletions

.github/workflows/python-app.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
9595
# upload the result package as an artifact
9696
- name: Upload artifacts
97-
uses: actions/upload-artifact@v2
97+
uses: actions/upload-artifact@v4
9898
if: success()
9999
with:
100100
name: Metaminesweeper-snapshot

README.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# MetaSweeper-v3.1.9 —— project with 8 modes of minesweeper, third generation minesweeper video player and high performance algorithm toolbox
1+
# MetaSweeper-v3.1.11 —— project with 8 modes of minesweeper, third generation minesweeper video player and high performance algorithm toolbox
22

3-
# 元扫雷v3.1.9 —— 包含8种模式的扫雷项目、第三代扫雷录像播放器及高性能算法工具箱
3+
# 元扫雷v3.1.11 —— 包含8种模式的扫雷项目、第三代扫雷录像播放器及高性能算法工具箱
44

5-
[![MetaSweeper](https://img.shields.io/badge/MetaSweeper-v3.1.6-brightgreen.svg)](https://github.com/eee555/Solvable-Minesweeper)
5+
[![MetaSweeper](https://img.shields.io/badge/MetaSweeper-v3.1.11-brightgreen.svg)](https://github.com/eee555/Solvable-Minesweeper)
66
[![stars](https://img.shields.io/github/stars/eee555/Solvable-Minesweeper)](https://github.com/eee555/Solvable-Minesweeper/stargazers)
77
[![forks](https://img.shields.io/github/forks/eee555/Solvable-Minesweeper)](https://github.com/eee555/Solvable-Minesweeper/forks)
88

99

1010
## 简介
1111

12-
元扫雷v3.1.9是由热爱扫雷的玩家开发的扫雷游戏。这个项目并非简单重复已有的工作,而是集中了一批扫雷游戏的现代化设计。
12+
元扫雷v3.1.11是由热爱扫雷的玩家开发的扫雷游戏。这个项目并非简单重复已有的工作,而是集中了一批扫雷游戏的现代化设计。
1313

1414
优势:
1515

@@ -39,7 +39,7 @@
3939

4040
## Introduction
4141

42-
Minesweeper v3.1.9 is a mineswering game developed by players who are passionate about the game. This project is not a simple repetition of existing work, but a concentration of modern design elements for minesweeper games.
42+
Minesweeper v3.1.10 is a mineswering game developed by players who are passionate about the game. This project is not a simple repetition of existing work, but a concentration of modern design elements for minesweeper games.
4343

4444
Advantages:
4545

@@ -76,7 +76,7 @@ Currently in the lengthy development phase, with updates approximately every 1 t
7676
## 安装
7777
建议在`Windows 10``Windows 11`下运行本游戏,其它操作系统未经测试,可能出现意想不到的问题。
7878

79-
### 方案1:通过网盘安装(推荐)
79+
### 方案1:通过官方下载链接安装(推荐)
8080
在下面的[下载链接](#下载链接)中找到最新的版本,然后下载,解压,直接运行`main.exe`文件(如果警告请点击“仍然运行”),开箱即用。通过此方法安装的软件,是`正版`的软件,能够对录像文件进行官方的签名(签名功能打包在“metaminesweeper_checksum.pyd”中,占比很小,且是闭源的)。
8181

8282
### 方案2:通过Github Actions安装(最安全)
@@ -86,7 +86,7 @@ Currently in the lengthy development phase, with updates approximately every 1 t
8686
### 方案3:从源码安装(不推荐)
8787
**请注意**:通过此方法安装的软件,不能对录像文件进行正确的签名。即,自行打包的软件,其生成的录像文件,无法通过`正版`的软件的校验。但其余功能保证与`正版`相同。同时,如有需要,玩家可通过这种方式安装来自行制作改版,并自行实现秘密的签名。
8888
在编译之前,请确保自己拥有:
89-
* Python >=3.7(推荐3.10)
89+
* Python >=3.7, <=3.11(推荐3.10,即打包使用的版本
9090
* 会用Powershell或者其它命令行工具的能力
9191

9292
以下为安装步骤:
@@ -110,6 +110,10 @@ Currently in the lengthy development phase, with updates approximately every 1 t
110110
安装requirements.txt中除ms_toollib外剩余的依赖
111111
```
112112

113+
* 为了跑通全部功能,从下载的以往版本中找到en_US.qm、de_DE.qm、pl_PL.qm等语言文件,复制到Solvable-Minesweeper下
114+
115+
* 为了跑通全部功能,从下载的以往版本中找到params.onnx神经网络模型数据,复制到Solvable-Minesweeper\src下
116+
113117
* 运行程序,大功告成了~
114118
```sh
115119
py -3 src/main.py # Windows
@@ -131,7 +135,8 @@ Currently in the lengthy development phase, with updates approximately every 1 t
131135
元扫雷网官方扫雷软件[https://fff666.top](https://fff666.top)
132136

133137
## 赞助
134-
感谢您考虑支持我们的开源项目,赞助时请备注您的称呼(或Github主页)。您的赞助将有助于项目的持续发展和改进,使我们能够继续提高软件的质量(owner许诺向所有contributor按合理的比例分配赞助得到的收入)。
138+
感谢您考虑支持我们的开源项目,赞助时请备注您的称呼(或Github主页)。您的赞助将有助于项目的持续发展和改进,使我们能够继续提高软件的质量(owner许诺向所有contributor按获得赞助时commit数量的比例分配赞助得到的收入)。
139+
135140
### 一般赞助者
136141
- 一次性捐款¥10或以上
137142
- 您的名字将出现在项目的贡献者列表中
@@ -154,9 +159,18 @@ Currently in the lengthy development phase, with updates approximately every 1 t
154159

155160
## 下载链接
156161

162+
### 正式版v3.1.11:
163+
修复了若干严重问题。计数器标题可以翻译。兼容高清屏。
164+
链接:[https://fff666.top/download/Metaminesweeper-v3.1.11.zip](https://fff666.top/download/Metaminesweeper-v3.1.11.zip)
165+
166+
### 正式版v3.1.10:
167+
修复了快捷键切换难度后局面约束不能变化、研究模式中快捷键切换难度后卡死、鼠标设置阻塞进程、回放时切换难度崩溃等、标错雷时概率计算错误、回放时右上角时间不变化等问题。现在回放时可以显示正确的国旗。可以设置唯一性标识。录像可以回放、手动保存。每个级别的模式、尺寸可以分别保存。双击猜雷可以起作用。可以限制鼠标移动范围为游戏局面区域。
168+
链接:无(不安全,已下架)
169+
157170
### 正式版v3.1.9:
158171

159172
修复了7个bug,包括弱可猜模式可能踩雷;用设置修改尺寸时,布局出错;使用快捷键切换模式时,部分操作引发异常等。计数器中可以使用"is_offical", "is_fair"来检查录像合法性。提高了对某种作弊手段的防御能力。升级了录像格式到evf-v0.3。
173+
链接:[https://fff666.top/download/Metaminesweeper-v3.1.9.zip](https://fff666.top/download/Metaminesweeper-v3.1.9.zip)
160174

161175
### 正式版v3.1.7:
162176

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
pyQt5==5.15.7
2-
ms-toollib==1.4.10
2+
ms-toollib==1.4.12

src/gameDefinedParameter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
from ui.uiComponents import RoundQDialog
99

1010
class ui_Form(Ui_Form):
11-
def __init__(self, r_path, row, column, num):
11+
def __init__(self, r_path, row, column, num, parent):
1212
self.row = row
1313
self.column = column
1414
self.mineNum = num
1515
# self.maxRow = 1e6
1616
# self.maxColumn = 1e6
1717
self.alter = False
18-
self.Dialog = RoundQDialog()
18+
self.Dialog = RoundQDialog(parent)
1919
self.setupUi (self.Dialog)
2020
self.setParameter()
2121
self.Dialog.setWindowIcon (QtGui.QIcon (str(r_path.with_name('media').joinpath('cat.ico')).replace("\\", "/")))

src/gameRecordPop.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
from ui.uiComponents import RoundQDialog
44

55
class ui_Form(Ui_Form):
6-
def __init__(self, r_path, del_items: list, pb_bbbv):
6+
def __init__(self, r_path, del_items: list, pb_bbbv, nf_items, parent):
77
# 关于界面,继承一下就好
8-
self.Dialog = RoundQDialog()
9-
self.setupUi (self.Dialog)
8+
self.Dialog = RoundQDialog(parent)
9+
self.setupUi(self.Dialog)
1010
self.Dialog.setWindowIcon (QtGui.QIcon (str(r_path.with_name('media').joinpath('cat.ico'))))
1111

12+
for i in nf_items:
13+
eval(f"self.label_{i}.setText('NF ' + self.label_{i}.text())")
1214
for i in del_items:
1315
eval("self.widget" + str(i) + ".setHidden(True)")
1416

@@ -47,9 +49,9 @@ def __init__(self, r_path, del_items: list, pb_bbbv):
4749
self.pushButton.setStyleSheet("border-image: url(" + str(r_path.with_name('media').joinpath('button.png')).replace("\\", "/") + ");\n"
4850
"font: 16pt \"黑体\";\n"
4951
"color:white;font: bold;")
50-
self.label__13.setText(str(pb_bbbv))
51-
self.label__14.setText(str(pb_bbbv))
52-
self.label__15.setText(str(pb_bbbv))
52+
self.label__13.setText(str(pb_bbbv) + " bv")
53+
self.label__14.setText(str(pb_bbbv) + " bv")
54+
self.label__15.setText(str(pb_bbbv) + " bv")
5355

5456
# self.Dialog.setFixedSize(self.Dialog.minimumSize())
5557

src/gameScoreBoard.py

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@
66
from safe_eval import safe_eval
77
from PyQt5.QtWidgets import QTableWidgetItem
88
from PyQt5 import QtCore, QtGui
9-
from PyQt5.QtWidgets import QShortcut
10-
from PyQt5.QtCore import Qt
9+
from PyQt5.QtWidgets import QShortcut, QHeaderView
1110

1211
class ui_Form(Ui_Form):
1312
# barSetMineNum = QtCore.pyqtSignal(int)
1413
# barSetMineNumCalPoss = QtCore.pyqtSignal(int)
1514
# doubleClick = QtCore.pyqtSignal (int, int)
1615
# leftClick = QtCore.pyqtSignal (int, int)
17-
def __init__(self, r_path, pix_size):
16+
def __init__(self, r_path, pix_size, parent):
1817
self.pix_size = pix_size
19-
self.QWidget = RoundQWidget()
18+
self.QWidget = RoundQWidget(parent)
2019
self.setupUi(self.QWidget)
2120

2221
self.tableWidget.setColumnWidth(0, 80)
23-
self.tableWidget.setColumnWidth(1, 120)
24-
self.tableWidget.verticalHeader().setDefaultSectionSize(24)
22+
self.tableWidget.setColumnWidth(1, 150)
23+
self.tableWidget.verticalHeader().setDefaultSectionSize(25)
24+
self.tableWidget.verticalHeader().setSectionResizeMode(QHeaderView.Fixed)
2525

2626
self.QWidget.setWindowIcon (QtGui.QIcon (str(r_path.with_name('media').joinpath('cat.ico'))))
2727

@@ -37,13 +37,11 @@ def reshow(self, index_name_list: list[str], index_value_list: list[str]):
3737
# 更新数值、指标。指标数量可能变
3838
table_height = len(index_name_list)*24
3939
self.tableWidget.setRowCount(len(index_name_list))
40-
self.tableWidget.setMinimumWidth(202)
41-
self.tableWidget.setMaximumWidth(202)
40+
# self.tableWidget.setMinimumWidth(232)
41+
# self.tableWidget.setMaximumWidth(232)
4242
self.tableWidget.setMaximumHeight(table_height + len(index_name_list) + 2)
4343
self.tableWidget.setMinimumHeight(table_height + len(index_name_list) + 2)
4444

45-
# self.QWidget.setMinimumSize(QtCore.QSize(224+2, table_height + 88))
46-
# self.QWidget.setMaximumSize(QtCore.QSize(224+2, table_height + 88))
4745
for idx, i in enumerate(index_name_list):
4846
self.tableWidget.setItem(idx, 0, QTableWidgetItem(i))
4947
self.show(index_value_list)
@@ -79,7 +77,7 @@ class gameScoreBoardManager():
7977

8078
# is_visible = False
8179
# 5、错误的表达式,一旦算出报错,永远不再算,显示error
82-
def __init__(self, r_path, score_board_path, game_setting_path, pix_size):
80+
def __init__(self, r_path, score_board_path, game_setting_path, pix_size, parent):
8381
# 从文件中读取指标并设置
8482
# self.ms_board = None
8583
self.pix_size = pix_size
@@ -121,7 +119,7 @@ def __init__(self, r_path, score_board_path, game_setting_path, pix_size):
121119
i in _score_board_items]
122120
self.update_score_board_items_type()
123121
self.index_num = len(self.score_board_items_type)
124-
self.ui = ui_Form(r_path, pix_size)
122+
self.ui = ui_Form(r_path, pix_size, parent)
125123
self.ui.tableWidget.doubleClicked.connect(self.__table_change)
126124
self.ui.tableWidget.clicked.connect(self.__table_ok)
127125
self.ui.tableWidget.cellChanged.connect(self.__cell_changed)
@@ -131,12 +129,6 @@ def __init__(self, r_path, score_board_path, game_setting_path, pix_size):
131129
self.editing_row = -1 # -1不在编辑状态,-2不能编辑(正在游戏)
132130
self.editing_column = -1
133131

134-
# self.ui.QWidget.closeEvent_.connect(self.close)
135-
136-
# def keyPressEvent(self, event):
137-
# print(666)
138-
# if event.key() == Qt.Key_Return:
139-
# self.__table_ok()
140132

141133
def update_score_board_items_type(self):
142134
self.score_board_items_type = []
@@ -154,6 +146,9 @@ def with_namespace(self, namespace: dict):
154146
# 埋雷结束后调用,固化参数
155147
# self.pix_size = pix_size
156148
# self.board = board
149+
if "mode" in namespace:
150+
self._game_mode_code: int = namespace["mode"]
151+
namespace["mode"] = mm.trans_game_mode(namespace["mode"])
157152
self.namespace.update(namespace)
158153
# race_designator, mode .etc
159154
# self.ms_board = ms.BaseVideo(board, pix_size)
@@ -251,7 +246,16 @@ def show(self, ms_board, index_type):
251246
# if self.ui.QWidget.isVisible():
252247
# self.visible()
253248

254-
def reshow(self, ms_board, index_type):
249+
def reshow(self, ms_board, index_type = 0):
250+
if not index_type:
251+
if self.ms_board.game_board_state == 1\
252+
or self.ms_board.game_board_state == 2\
253+
or self.ms_board.game_board_state == 5:
254+
index_type = 1
255+
else:
256+
# 3、4为win和loss
257+
index_type = 2
258+
255259
# 指标数量有变。增删指标用。游戏开始前。index_type是2
256260
self.ms_board = ms_board
257261
index_value_list = self.cal_index_value(ms_board, index_type)
@@ -265,7 +269,16 @@ def time_step(self):
265269

266270

267271
self.show()
268-
272+
273+
# 重写窗口的翻译方法。主要是模式的翻译问题
274+
def retranslateUi(self, Form):
275+
self.ui.retranslateUi(Form)
276+
if hasattr(self, "ms_board"):
277+
self.with_namespace({
278+
"mode": self._game_mode_code,
279+
})
280+
self.show(self.ms_board, index_type = 1)
281+
269282
def __table_change(self, e):
270283
# 编辑开始时,把数值换成公式
271284
if e.column() == 1 and self.editing_row == -1:
@@ -298,13 +311,7 @@ def __table_ok(self, e = None):
298311
else:
299312
self.score_board_items[self.editing_row][1] = new_formula
300313
self.update_score_board_items_type()
301-
if self.ms_board.game_board_state == 1\
302-
or self.ms_board.game_board_state == 2\
303-
or self.ms_board.game_board_state == 5:
304-
self.reshow(self.ms_board, 1)
305-
else:
306-
# 3、4为win和loss
307-
self.reshow(self.ms_board, 2)
314+
self.reshow(self.ms_board)
308315
self.editing_row = -1
309316
self.editing_column = -1
310317

@@ -319,7 +326,7 @@ def __add_blank_line(self):
319326
# 添加一个空开的行,并刷新显示
320327
self.score_board_items.append(["", ""])
321328
self.score_board_items_type.append(1)
322-
self.reshow(self.ms_board, 1)
329+
self.reshow(self.ms_board)
323330

324331
def close(self):
325332
config = configparser.ConfigParser()

src/gameScores.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def paintIndex(self, scores):
191191
'EstTime':'52.247', '3BV':'123/200', 'Ops':'12',
192192
'Isls':'10', 'Thrp':'0.968', 'Corr':'0.963',
193193
'Left':'123@3.21', 'Right':'123@3.21', 'Double':'123@3.21',
194-
'Cl':'123@3.21', 'Ces':'123@3.21', 'Mode':'竞速无猜',
194+
'Cl':'123@3.21', 'Ces':'123@3.21', 'Mode':'经典无猜',
195195
'Difficulty':'高级'}
196196
scoresValue = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6]
197197
app = QApplication(sys.argv)

src/gameSettingShortcuts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
# 减少ui文件生成的原始的.py的改动
88

99
class myGameSettingShortcuts(Ui_Form):
10-
def __init__(self, game_setting_path, ico_path, r_path):
10+
def __init__(self, game_setting_path, ico_path, r_path, parent):
1111
self.game_setting_path = game_setting_path
1212
self.r_path = r_path
13-
self.Dialog = RoundQDialog()
13+
self.Dialog = RoundQDialog(parent)
1414
self.setupUi(self.Dialog)
1515
self.setParameter()
1616
self.Dialog.setWindowIcon(QtGui.QIcon (ico_path))

0 commit comments

Comments
 (0)