Skip to content

Commit

Permalink
Fix for vanishing Game End message
Browse files Browse the repository at this point in the history
  • Loading branch information
tosca07 authored May 14, 2023
1 parent c903018 commit e79423a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions picochess.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
Expand Down Expand Up @@ -1489,6 +1489,7 @@ def process_fen(fen: str, state: PicochessState):
handled_fen = True
state.error_fen = None
legal_fens_pico = compute_legal_fens(state.game.copy())

# Check for same position
if fen == state.game.board_fen():
logger.debug("Already in this fen: %s", fen)
Expand Down Expand Up @@ -1951,7 +1952,7 @@ def process_fen(fen: str, state: PicochessState):
time.sleep(1)
if not state.done_computer_fen:
state.start_clock()
DisplayMsg.show(Message.EXIT_MENU())
DisplayMsg.show(Message.EXIT_MENU())
state.position_mode = False
else:
if fen == chess.STARTING_BOARD_FEN:
Expand All @@ -1968,7 +1969,7 @@ def process_fen(fen: str, state: PicochessState):
else:
state.error_fen = fen
start_fen_timer(state)

def call_pico_coach(state):
if (
(state.game.turn == chess.WHITE and state.play_mode == PlayMode.USER_WHITE)
Expand Down Expand Up @@ -4731,7 +4732,7 @@ def takeback(state: PicochessState):
)
engine.startup(old_options, state.rating)
stop_search_and_clock()
print("rdisp=", state.dgtmenu.get_engine_rdisplay(), "art_in_use=", state.artwork_in_use, "rwind=", state.dgtmenu.get_engine_rwindow())

if state.dgtmenu.get_engine_rdisplay() and not state.dgtmenu.get_engine_rwindow() and state.artwork_in_use:
#switch to fullscreen
cmd = "xdotool keydown alt key F11; sleep 0.2 xdotool keyup alt"
Expand Down

0 comments on commit e79423a

Please sign in to comment.