Skip to content

Commit

Permalink
Version 2.06b
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmonk committed Mar 1, 2023
1 parent 33f7839 commit c6b8f70
Show file tree
Hide file tree
Showing 21 changed files with 298 additions and 257 deletions.
Binary file modified Resources/Locale/es/LC_MESSAGES/lucaschess.mo
Binary file not shown.
Binary file modified Resources/Locale/fr/LC_MESSAGES/lucaschess.mo
Binary file not shown.
439 changes: 225 additions & 214 deletions Resources/Locale/messages.pot

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions bin/Code/Base/Game.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,41 @@ def titulo(self, *litags, sep=" ∣ "):
li.append(tag)
return sep.join(li)

def window_title(self):
white = ""
black = ""
event = ""
site = ""
date = ""
result = ""
for key, valor in self.li_tags:
if key.upper() == "WHITE":
white = valor
elif key.upper() == "BLACK":
black = valor
elif key.upper() == "EVENT":
event = valor
elif key.upper() == "SITE":
site = valor
elif key.upper() == "DATE":
date = valor.replace("?", "").replace(" ", "").strip(".")
elif key.upper() == "RESULT":
if valor in ("1-0", "0-1", "1/2-1/2"):
result = valor
li = []
if event:
li.append(event)
if site:
li.append(site)
if date:
li.append(date)
if result:
li.append(result)
titulo = "%s-%s" % (white, black)
if li:
titulo += " (%s)" % (" - ".join(li),)
return titulo

def primeraJugada(self):
return self.first_position.num_moves

Expand Down
3 changes: 2 additions & 1 deletion bin/Code/Board/BoardTypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def __init__(self, dic=None):

class Pizarra(QtWidgets.QWidget):
def __init__(self, guion, board, ancho, edit_mode=False, with_continue=False):
QtWidgets.QWidget.__init__(self)
QtWidgets.QWidget.__init__(self, board)

self.guion = guion
self.tarea = None
Expand All @@ -432,6 +432,7 @@ def __init__(self, guion, board, ancho, edit_mode=False, with_continue=False):

self.pb = None
self.chb = None
self.bloqueada = False
if edit_mode:
self.chb = Controles.CHB(self, _("With continue button"), False).capture_changes(self, self.save)
self.mensaje.capturaCambios(self.save)
Expand Down
4 changes: 2 additions & 2 deletions bin/Code/Board/Eboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,8 @@ def activate(self, dispatch):
except:
pass

os.chdir(Code.current_dir)

if driver is None:
os.chdir(Code.current_dir)
return False

cmpfunc = functype(ctypes.c_int, ctypes.c_char_p)
Expand Down Expand Up @@ -286,6 +285,7 @@ def activate(self, dispatch):

driver._DGTDLL_ShowDialog(ctypes.c_int(1))

os.chdir(Code.current_dir)
self.driver = driver
return True

Expand Down
2 changes: 0 additions & 2 deletions bin/Code/CompetitionWithTutor/CompetitionWithTutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ def nuevo(self, from_sq, to_sq, min_puntos):
name = None
for elo, key, cm in self.li_rivales:
if from_sq <= elo <= to_sq:
if key.startswith("maia"):
continue
li_rivales_uno.append(cm)
if elo < minimo:
minimo = elo
Expand Down
6 changes: 5 additions & 1 deletion bin/Code/CompetitionWithTutor/ManagerCompeticion.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def base_inicio(self, categorias, categoria, nivel, is_white, puntos):

self.rival_conf = self.dbm.get_current_rival()
self.xrival = self.procesador.creaManagerMotor(self.rival_conf, None, nivel)
self.is_maia = self.xrival.name.lower().startswith("maia")

self.set_toolbar((TB_CANCEL, TB_RESIGN, TB_TAKEBACK, TB_REINIT, TB_ADJOURN, TB_CONFIG, TB_UTILITIES))
self.main_window.activaJuego(True, False)
Expand Down Expand Up @@ -262,7 +263,10 @@ def play_next_move(self):
self.in_the_opening = False

if siPensar:
self.rm_rival = self.xrival.play_game(self.game)
if self.is_maia:
self.rm_rival = self.xrival.play_game(self.game)
else:
self.rm_rival = self.xrival.play_game_maia(self.game)

self.thinking(False)

Expand Down
10 changes: 7 additions & 3 deletions bin/Code/Databases/WDB_Games.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from Code.Base.Constantes import WHITE, BLACK
from Code.Databases import DBgames, WDB_Utils
from Code.GM import GM
from Code.LearnGame import WindowPlayGame, WindowLearnGame
from Code.Openings import OpeningsStd
from Code.Polyglots import PolyglotImportExports
from Code.QT import Colocacion
Expand All @@ -27,7 +28,6 @@
from Code.QT import QTUtil2
from Code.QT import QTVarios
from Code.QT import SelectFiles
from Code.LearnGame import WindowPlayGame, WindowLearnGame
from Code.QT import WindowSavePGN
from Code.SQL import UtilSQL
from Code.Themes import WDB_Theme_Analysis
Expand Down Expand Up @@ -695,13 +695,17 @@ def tw_options(self):
return None

dic_data = w.dic_data_resp
self.dbGames.read_options()
db.read_options()
db.save_config("ALLOWS_DUPLICATES", dic_data["ALLOWS_DUPLICATES"])
db.save_config("ALLOWS_POSITIONS", dic_data["ALLOWS_POSITIONS"])
db.save_config("ALLOWS_COMPLETE_GAMES", dic_data["ALLOWS_COMPLETE_GAMES"])
db.save_config("ALLOWS_ZERO_MOVES", dic_data["ALLOWS_ZERO_MOVES"])

# Comprobamos depth
new_depth = dic_data["SUMMARY_DEPTH"]
if new_depth != self.dbGames.depth_stat():
self.wsummary.reindexar_question(new_depth, False)
self.dbGames.save_config("SUMMARY_DEPTH", new_depth)
db.save_config("SUMMARY_DEPTH", new_depth)

# Si ha cambiado la localización, se cierra, se mueve y se reabre en la nueva
# Internal -> Internal
Expand Down
9 changes: 9 additions & 0 deletions bin/Code/Engines/EngineManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,15 @@ def play_game(self, game, nAjustado=0):
else:
return mrm.mejorMov()

def play_game_maia(self, game):
self.check_engine()

if self.depth_engine:
self.engine.nodes = int(self.depth_engine**2)

mrm = self.engine.bestmove_game(game, self.mstime_engine, self.depth_engine)
return mrm.mejorMov()

def play_fixed_depth_time_tourney(self, game):
self.check_engine()

Expand Down
2 changes: 1 addition & 1 deletion bin/Code/MainWindow/WBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ def teclaPulsada(self, tipo, tecla, modifiers=None):
elif tecla in (QtCore.Qt.Key_Enter, QtCore.Qt.Key_Return):
row, column = self.pgn.current_position()
if column.key != "NUMBER":
if hasattr(self.manager, "analizaPosicion"):
if hasattr(self.manager, "analize_position"):
self.manager.analize_position(row, column.key)
else:
if hasattr(self.manager, "control_teclado"):
Expand Down
24 changes: 2 additions & 22 deletions bin/Code/ManagerGame.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import FasterCode

from PySide2 import QtCore

from Code import Manager
Expand Down Expand Up @@ -28,9 +27,9 @@
from Code.QT import QTUtil
from Code.QT import QTUtil2
from Code.QT import QTVarios
from Code.Voyager import Voyager
from Code.QT import WindowPgnTags
from Code.Translations import TrListas
from Code.Voyager import Voyager


class ManagerGame(Manager.Manager):
Expand Down Expand Up @@ -145,14 +144,14 @@ def run_action(self, key):
elif key == TB_PGN_LABELS:
self.informacion()

# elif key in (TB_CANCEL, TB_END_GAME, TB_CLOSE):
elif key in (TB_CANCEL, TB_CLOSE):
self.end_game()

elif key in (TB_PREVIOUS, TB_NEXT):
if self.ask_for_save_game():
self.with_previous_next("save", self.game)
game1 = self.with_previous_next("previous" if key == TB_PREVIOUS else "next", self.game)
self.main_window.setWindowTitle(game1.window_title())
self.start(game1, self.is_complete, self.only_consult, self.with_previous_next, self.save_routine)

else:
Expand Down Expand Up @@ -440,25 +439,6 @@ def change_rival(self):
self.play_against_engine = True
self.configuration.write_variables("ENG_MANAGERSOLO", dic)

def window_title(self):
white = ""
black = ""
event = ""
date = ""
result = ""
for key, valor in self.game.li_tags:
if key.upper() == "WHITE":
white = valor
elif key.upper() == "BLACK":
black = valor
elif key.upper() == "EVENT":
event = valor
elif key.upper() == "DATE":
date = valor
elif key.upper() == "RESULT":
result = valor
return "%s-%s (%s, %s,%s)" % (white, black, event, date, result)

def takeback(self):
if len(self.game):
self.game.anulaSoloUltimoMovimiento()
Expand Down
2 changes: 1 addition & 1 deletion bin/Code/Procesador.py
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ def manager_game(
board.dbvisual_set_file(father_board.dbVisual.file)
board.dbvisual_set_show_always(father_board.dbVisual.show_always)

resp = clon_procesador.main_window.show_variations(clon_procesador.manager.window_title())
resp = clon_procesador.main_window.show_variations(game.window_title())
if father_board:
father_board.dbvisual_set_file(father_board.dbVisual.file)
father_board.dbvisual_set_show_always(father_board.dbVisual.show_always())
Expand Down
13 changes: 6 additions & 7 deletions bin/Code/Tournaments/WTournamentRun.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import Code
from Code import CPU
from Code import ControlPGN
from Code import TimeControl
from Code import Util
from Code.Sound import Sound
from Code.Base import Game, Move
from Code.Base.Constantes import (
ST_PLAYING,
Expand All @@ -33,8 +33,8 @@
from Code.QT import QTUtil
from Code.QT import QTVarios
from Code.SQL import UtilSQL
from Code.Sound import Sound
from Code.Tournaments import Tournament
from Code import TimeControl


class TournamentRun:
Expand Down Expand Up @@ -320,10 +320,8 @@ def procesa_game(self):
self.board.set_position(self.game.last_position)
self.grid_pgn.refresh()



self.tc_white = TimeControl.TimeControl(self, self.game, WHITE)
self.tc_white.config_clock(self.max_seconds-59.5, self.seconds_per_move, 0, 0)
self.tc_white.config_clock(self.max_seconds, self.seconds_per_move, 0, 0)
self.tc_white.set_labels()
self.tc_black = TimeControl.TimeControl(self, self.game, BLACK)
self.tc_black.config_clock(self.max_seconds, self.seconds_per_move, 0, 0)
Expand Down Expand Up @@ -538,7 +536,8 @@ def play_next_move(self):
ok, mens, move = Move.get_game_move(self.game, self.game.last_position, from_sq, to_sq, promotion)
if not move:
if not self.clocks_finished():
self.game.set_termination(TERMINATION_ADJUDICATION, RESULT_WIN_BLACK if self.current_side == WHITE else RESULT_WIN_WHITE)
self.game.set_termination(TERMINATION_ADJUDICATION,
RESULT_WIN_BLACK if self.current_side == WHITE else RESULT_WIN_WHITE)
return False
if analysis:
move.analysis = analysis
Expand Down Expand Up @@ -716,7 +715,7 @@ def move_the_pieces(self, liMovs):
dc = ord(from_sq[0]) - ord(to_sq[0])
df = int(from_sq[1]) - int(to_sq[1])
# Maxima distancia = 9.9 ( 9,89... sqrt(7**2+7**2)) = 4 seconds
dist = (dc**2 + df**2) ** 0.5
dist = (dc ** 2 + df ** 2) ** 0.5
seconds = 4.0 * dist / (9.9 * rapidez)
cpu.muevePieza(movim[1], movim[2], siExclusiva=False, seconds=seconds)

Expand Down
2 changes: 1 addition & 1 deletion bin/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def relative_root(path):


BASE_VERSION = "B" # Para el control de updates que necesitan reinstalar entero
VERSION = "R 2.06a"
VERSION = "R 2.06b"
DEBUG = False
DEBUG_ENGINES = False

Expand Down
Binary file added bin/OS/linux/DigitalBoards/libsimpleble-c.so
Binary file not shown.
Binary file added bin/OS/linux/DigitalBoards/libsimpleble-c.so.0
Binary file not shown.
Binary file added bin/OS/linux/DigitalBoards/libsimpleble.so
Binary file not shown.
Binary file added bin/OS/linux/DigitalBoards/libsimpleble.so.0
Binary file not shown.
2 changes: 1 addition & 1 deletion bin/OS/linux/DigitalBoards/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6
7
2 changes: 1 addition & 1 deletion bin/bug.log
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Version R 2.06a
Version R 2.06b

0 comments on commit c6b8f70

Please sign in to comment.