Skip to content

Commit bbe5a60

Browse files
committed
fix: trans country of rmv to evf rightly
1 parent 7210e77 commit bbe5a60

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pyQt5==5.15.11
2-
ms-toollib==1.5.1
2+
ms-toollib==1.5.3
33
setuptools==80.9.0
44
pyinstaller==6.16.0
55
msgspec>=0.20.0

src/gameAbout.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
from PyQt5 import QtGui
22
from ui.ui_about import Ui_Form
33
from ui.uiComponents import RoundQDialog
4+
from PyQt5.QtWidgets import QShortcut
5+
from PyQt5.QtGui import QKeySequence
6+
from PyQt5.QtCore import Qt
47

58
class ui_Form(Ui_Form):
69
def __init__(self, r_path, parent):
710
# 关于界面,继承一下就好
811
self.Dialog = RoundQDialog(parent)
912
self.setupUi (self.Dialog)
10-
# self.Dialog.setWindowIcon (QtGui.QIcon (str(r_path.with_name('media').joinpath('cat.ico'))))
11-
12-
13-
13+
14+
# 空格键快捷键关闭这个窗口。回车不需要设置,在ui文件中已经设置。
15+
QShortcut(QKeySequence("Space"), self.Dialog, activated=self.pushButton.click)
1416

src/mineSweeperGUI.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,22 @@ def dump_evf_file_data(self):
640640
self.label.ms_board.generate_evf_v4_raw_data()
641641
return
642642
elif isinstance(self.label.ms_board, ms.RmvVideo):
643-
self.label.ms_board.country = "CN"
643+
# rmv的国家是用户手动输入的,工具箱无法自动解析两位字母缩写
644+
# 在元扫雷端解析完,传如工具箱
645+
country = self.label.ms_board.country
646+
if not country:
647+
country = "XX"
648+
elif len(country) == 2 and country.isalpha() and country.isascii():
649+
file_path = self.r_path.with_name('media') / (country.lower() + ".svg")
650+
if os.path.exists(file_path):
651+
country = country.upper()
652+
elif country in country_name:
653+
country = country_name[country].upper()
654+
elif c := country.capitalize() in country_name:
655+
country = country_name[c].upper()
656+
else:
657+
country = "XX"
658+
self.label.ms_board.country = country
644659
self.label.ms_board.generate_evf_v4_raw_data()
645660
return
646661

src/superGUI.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,6 @@ def set_country_flag(self, country = None):
557557
”cn“等情况,全部应该要正确解析。
558558
不修改self.country变量
559559
'''
560-
print(country)
561560
if country == None:
562561
country = self.country
563562
if country == None:

0 commit comments

Comments
 (0)