@@ -91,17 +91,6 @@ def save_evf_file_integrated():
9191 self .action_open_ini .triggered .connect (
9292 lambda : QDesktopServices .openUrl (QUrl .fromLocalFile (str (self .setting_path ))))
9393
94- # config = configparser.ConfigParser()
95- # config.read(self.game_setting_path, encoding='utf-8')
96-
97- if (self .row , self .column , self .minenum ) == (8 , 8 , 10 ):
98- self .actionChecked ('B' )
99- elif (self .row , self .column , self .minenum ) == (16 , 16 , 40 ):
100- self .actionChecked ('I' )
101- elif (self .row , self .column , self .minenum ) == (16 , 30 , 99 ):
102- self .actionChecked ('E' )
103- else :
104- self .actionChecked ('C' )
10594
10695 self .frameShortcut1 .activated .connect (lambda : self .predefined_Board (1 ))
10796 self .frameShortcut2 .activated .connect (lambda : self .predefined_Board (2 ))
@@ -198,10 +187,10 @@ def pixSize(self, pixSize):
198187 else :
199188 self .predefinedBoardPara [0 ]['pixsize' ] = pixSize
200189
201- self .label .setMinimumSize (QtCore .QSize (
202- pixSize * self .column + 8 , pixSize * self .row + 8 ))
203- self .label .setMaximumSize (QtCore .QSize (
204- pixSize * self .column + 8 , pixSize * self .row + 8 ))
190+ # self.label.setMinimumSize(QtCore.QSize(
191+ # pixSize * self.column + 8, pixSize * self.row + 8))
192+ # self.label.setMaximumSize(QtCore.QSize(
193+ # pixSize * self.column + 8, pixSize * self.row + 8))
205194 # self.label.setFixedSize(QtCore.QSize(self.pixSize*self.column + 8, self.pixSize*self.row + 8))
206195
207196 self .reimportLEDPic (pixSize ) # 重新导入图片,无磁盘io
@@ -250,6 +239,7 @@ def game_state(self, game_state: str):
250239 self .timer_video .stop ()
251240 self .ui_video_control .QWidget .close ()
252241 self .label .paint_cursor = False
242+ self .label .paintProbability = False
253243 self .set_country_flag ()
254244 self .score_board_manager .with_namespace ({
255245 "is_official" : "--" ,
@@ -498,7 +488,7 @@ def gameStart(self):
498488 self .timer_10ms .stop ()
499489 self .score_board_manager .editing_row = - 1
500490
501- self .label .paintProbability = False
491+ # self.label.paintProbability = False
502492 self .label_info .setText (self .player_identifier )
503493
504494 # 这里有点乱
@@ -541,7 +531,7 @@ def gameRestart(self, e=None): # 画界面,但是不埋雷,改数据而不
541531 self .label .ms_board .reset (self .row , self .column , self .pixSize )
542532 self .label .update ()
543533
544- self .label .paintProbability = False
534+ # self.label.paintProbability = False
545535 # self.label.paint_cursor = False
546536 # self.label.setMouseTracking(False) # 鼠标未按下时,组织移动事件回调
547537
@@ -965,20 +955,6 @@ def showTime(self, t):
965955 elif t >= 1000 :
966956 return
967957
968- def actionChecked (self , k ):
969- # 菜单前面打勾
970- self .actionchu_ji .setChecked (False )
971- self .actionzhogn_ji .setChecked (False )
972- self .actiongao_ji .setChecked (False )
973- self .actionzi_ding_yi .setChecked (False )
974- if k == 'B' :
975- self .actionchu_ji .setChecked (True )
976- elif k == 'I' :
977- self .actionzhogn_ji .setChecked (True )
978- elif k == 'E' :
979- self .actiongao_ji .setChecked (True )
980- elif k == 'C' :
981- self .actionzi_ding_yi .setChecked (True )
982958
983959 def predefined_Board (self , k ):
984960 # 按快捷键123456时的回调
@@ -1023,7 +999,6 @@ def replay_game(self):
1023999
10241000 def action_CEvent (self ):
10251001 # 点击菜单栏的自定义后回调
1026- self .actionChecked ('C' )
10271002 ui = gameDefinedParameter .ui_Form (self .r_path , self .row , self .column ,
10281003 self .minenum , self .mainWindow )
10291004 ui .Dialog .setModal (True )
@@ -1037,56 +1012,49 @@ def action_CEvent(self):
10371012 # "minenum": self.minenum,
10381013 # })
10391014
1040- def setBoard (self , row , column , minenum ):
1015+ def set_board_params (self , row , column , minenum ):
10411016 # 把局面设置成(row, column, minenum),同时提取配套参数
10421017 # 打开录像时、改级别、改设置时用
10431018 self .row = row
10441019 self .column = column
10451020 self .minenum = minenum
10461021 if (row , column , minenum ) == (8 , 8 , 10 ):
1047- self .actionChecked ('B' )
10481022 self .pixSize = self .predefinedBoardPara [1 ]['pixsize' ]
10491023 self .gameMode = self .predefinedBoardPara [1 ]['gamemode' ]
10501024 self .board_constraint = self .predefinedBoardPara [1 ]['board_constraint' ]
10511025 self .attempt_times_limit = self .predefinedBoardPara [1 ]['attempt_times_limit' ]
10521026 elif (row , column , minenum ) == (16 , 16 , 40 ):
1053- self .actionChecked ('I' )
10541027 self .pixSize = self .predefinedBoardPara [2 ]['pixsize' ]
10551028 self .gameMode = self .predefinedBoardPara [2 ]['gamemode' ]
10561029 self .board_constraint = self .predefinedBoardPara [2 ]['board_constraint' ]
10571030 self .attempt_times_limit = self .predefinedBoardPara [2 ]['attempt_times_limit' ]
10581031 elif (row , column , minenum ) == (16 , 30 , 99 ):
1059- self .actionChecked ('E' )
10601032 self .pixSize = self .predefinedBoardPara [3 ]['pixsize' ]
10611033 self .gameMode = self .predefinedBoardPara [3 ]['gamemode' ]
10621034 self .board_constraint = self .predefinedBoardPara [3 ]['board_constraint' ]
10631035 self .attempt_times_limit = self .predefinedBoardPara [3 ]['attempt_times_limit' ]
10641036 elif (row , column , minenum ) == (self .predefinedBoardPara [4 ]['row' ],
10651037 self .predefinedBoardPara [4 ]['column' ],
10661038 self .predefinedBoardPara [4 ]['mine_num' ]):
1067- self .actionChecked ('C' )
10681039 self .pixSize = self .predefinedBoardPara [4 ]['pixsize' ]
10691040 self .gameMode = self .predefinedBoardPara [4 ]['gamemode' ]
10701041 self .board_constraint = self .predefinedBoardPara [4 ]['board_constraint' ]
10711042 self .attempt_times_limit = self .predefinedBoardPara [4 ]['attempt_times_limit' ]
10721043 elif (row , column , minenum ) == (self .predefinedBoardPara [5 ]['row' ],
10731044 self .predefinedBoardPara [5 ]['column' ],
10741045 self .predefinedBoardPara [5 ]['mine_num' ]):
1075- self .actionChecked ('C' )
10761046 self .pixSize = self .predefinedBoardPara [5 ]['pixsize' ]
10771047 self .gameMode = self .predefinedBoardPara [5 ]['gamemode' ]
10781048 self .board_constraint = self .predefinedBoardPara [5 ]['board_constraint' ]
10791049 self .attempt_times_limit = self .predefinedBoardPara [5 ]['attempt_times_limit' ]
10801050 elif (row , column , minenum ) == (self .predefinedBoardPara [6 ]['row' ],
10811051 self .predefinedBoardPara [6 ]['column' ],
10821052 self .predefinedBoardPara [6 ]['mine_num' ]):
1083- self .actionChecked ('C' )
10841053 self .pixSize = self .predefinedBoardPara [6 ]['pixsize' ]
10851054 self .gameMode = self .predefinedBoardPara [6 ]['gamemode' ]
10861055 self .board_constraint = self .predefinedBoardPara [6 ]['board_constraint' ]
10871056 self .attempt_times_limit = self .predefinedBoardPara [6 ]['attempt_times_limit' ]
10881057 else :
1089- self .actionChecked ('C' )
10901058 self .pixSize = self .predefinedBoardPara [0 ]['pixsize' ]
10911059 self .gameMode = self .predefinedBoardPara [0 ]['gamemode' ]
10921060 self .board_constraint = self .predefinedBoardPara [0 ]['board_constraint' ]
@@ -1095,17 +1063,17 @@ def setBoard(self, row, column, minenum):
10951063 def setBoard_and_start (self , row , column , minenum ):
10961064 # 把局面设置成(row, column, minenum),把3BV的限制设置成min3BV, max3BV
10971065 # 比gameStart更高级
1098- if self .game_state == 'display' or self .game_state == 'showdisplay' :
1099- self .label .paintProbability = False
1066+ # if self.game_state == 'display' or self.game_state == 'showdisplay':
1067+ # self.label.paintProbability = False
11001068 if (self .row , self .column , self .minenum ) != (row , column , minenum ):
1101- self .setBoard (row , column , minenum )
1069+ self .set_board_params (row , column , minenum )
1070+ self .label .set_rcp (row , column , self .pixSize )
11021071 self .gameStart ()
11031072 else :
11041073 self .gameRestart ()
11051074
11061075 def action_NEvent (self ):
11071076 # 游戏设置
1108- self .actionChecked ('N' )
11091077 ui = gameSettings .ui_Form (self )
11101078 ui .Dialog .setModal (True )
11111079 ui .Dialog .show ()
@@ -1158,7 +1126,6 @@ def action_NEvent(self):
11581126
11591127 def action_QEvent (self ):
11601128 # 快捷键设置的回调
1161- self .actionChecked ('Q' )
11621129 ui = gameSettingShortcuts .myGameSettingShortcuts (self .game_setting ,
11631130 self .ico_path , self .r_path ,
11641131 self .mainWindow )
@@ -1177,7 +1144,6 @@ def action_mouse_setting(self):
11771144
11781145 def action_AEvent (self ):
11791146 # 关于
1180- self .actionChecked ('A' )
11811147 ui = gameAbout .ui_Form (self .r_path , self .mainWindow )
11821148 ui .Dialog .setModal (True )
11831149 ui .Dialog .show ()
0 commit comments