Skip to content

Commit

Permalink
fix: 录像文件不记录mode;重开不刷新mode
Browse files Browse the repository at this point in the history
  • Loading branch information
eee555 committed Sep 6, 2024
1 parent 796770b commit ecef6ee
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions src/mineSweeperGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ def game_state(self, game_state: str):
self.ui_video_control.QWidget.close()
self.label.paint_cursor = False
self.set_country_flag()
self.score_board_manager.with_namespace({
"checksum_ok": "--",
"is_official": "--",
"is_fair": "--",
"mode": mm.trans_game_mode(self.gameMode),
})
self.score_board_manager.show(self.label.ms_board, index_type = 1)

elif self._game_state == 'study':
self.num_bar_ui.QWidget.close()
self._game_state = game_state
Expand Down Expand Up @@ -586,12 +594,6 @@ def gameRestart(self, e = None): # 画界面,但是不埋雷,改数据而
# self.label.paint_cursor = False
# self.label.setMouseTracking(False) # 鼠标未按下时,组织移动事件回调

self.score_board_manager.with_namespace({
"checksum_ok": "--",
"is_official": "--",
"is_fair": "--"
})


# 游戏结束画残局,改状态
def gameFinished(self):
Expand Down Expand Up @@ -655,6 +657,7 @@ def dump_evf_file_data(self):
self.label.ms_board.is_official = self.is_official()

self.label.ms_board.software = "元3.1.10".encode( "UTF-8" )
self.label.ms_board.mode = self.gameMode
self.label.ms_board.player_identifier = self.player_identifier.encode( "UTF-8" )
self.label.ms_board.race_identifier = self.race_identifier.encode( "UTF-8" )
self.label.ms_board.uniqueness_identifier = self.unique_identifier.encode( "UTF-8" )
Expand Down Expand Up @@ -1255,10 +1258,18 @@ def play_video(self, video):
# 检查evf的checksum,其余录像没有鉴定能力
if isinstance(video, ms.EvfVideo):
self.score_board_manager.with_namespace({
"checksum_ok": self.checksum_guard.valid_checksum(video.raw_data[:-33], video.checksum),
"is_official": video.is_official,
"is_fair": video.is_fair
"checksum_ok": self.checksum_guard.\
valid_checksum(video.raw_data[:-33], video.checksum),
})
else:
self.score_board_manager.with_namespace({
"checksum_ok": False,
})
self.score_board_manager.with_namespace({
"is_official": video.is_official,
"is_fair": video.is_fair,
"mode": mm.trans_game_mode(video.mode),
})
video.analyse_for_features(["high_risk_guess", "jump_judge", "needless_guess",
"mouse_trace", "vision_transfer", "survive_poss"])

Expand Down

0 comments on commit ecef6ee

Please sign in to comment.