|
9 | 9 | from Code import AnalisisIndexes |
10 | 10 | from Code import AperturasStd |
11 | 11 | from Code import ControlPGN |
| 12 | +from Code import ControlPosicion |
12 | 13 | from Code import DGT |
13 | 14 | from Code import Jugada |
14 | 15 | from Code import Partida |
|
28 | 29 | from Code.QT import QTUtil2 |
29 | 30 | from Code.QT import QTVarios |
30 | 31 | from Code.QT import WOpeningGuide |
| 32 | +from Code.QT import TabTipos |
31 | 33 | from Code import Util |
32 | 34 | from Code import VarGen |
33 | 35 | from Code import Kibitzers |
@@ -285,18 +287,20 @@ def showCandidates(): |
285 | 287 | if not self.configuracion.siAtajosRaton: |
286 | 288 | if li_destinos: |
287 | 289 | self.atajosRatonOrigen = a1h8 |
288 | | - if self.atajosRatonDestino and self.atajosRatonDestino in li_destinos: |
289 | | - mueve() |
290 | | - else: |
291 | | - self.atajosRatonDestino = None |
292 | | - showCandidates() |
| 290 | + self.atajosRatonDestino = None |
| 291 | + # if self.atajosRatonDestino and self.atajosRatonDestino in li_destinos: |
| 292 | + # mueve() |
| 293 | + # else: |
| 294 | + # self.atajosRatonDestino = None |
| 295 | + showCandidates() |
293 | 296 | return |
294 | 297 | elif li_origenes: |
295 | 298 | self.atajosRatonDestino = a1h8 |
296 | 299 | if self.atajosRatonOrigen and self.atajosRatonOrigen in li_origenes: |
297 | 300 | mueve() |
298 | 301 | else: |
299 | 302 | self.atajosRatonOrigen = None |
| 303 | + self.atajosRatonDestino = None |
300 | 304 | showCandidates() |
301 | 305 | return |
302 | 306 |
|
@@ -520,6 +524,8 @@ def miraKibitzers(self, jg, columnaClave, soloNuevo=False): |
520 | 524 | def paraKibitzers(self): |
521 | 525 | for n, xkibitzer in enumerate(self.liKibitzersActivas): |
522 | 526 | xkibitzer.terminar() #ponFen(None) |
| 527 | + self.procesador.quitaKibitzers() |
| 528 | + self.liKibitzersActivas = [] |
523 | 529 |
|
524 | 530 | def ponPiezasAbajo(self, siBlancas): |
525 | 531 | self.tablero.ponerPiezasAbajo(siBlancas) |
@@ -829,7 +835,6 @@ def gridRightMouse(self, siShift, siControl, siAlt): |
829 | 835 | self.pgnInformacion() |
830 | 836 | self.pantalla.ajustaTam() |
831 | 837 |
|
832 | | - |
833 | 838 | def listado(self, tipo): |
834 | 839 | if tipo == "pgn": |
835 | 840 | return self.pgn.actual() |
@@ -899,7 +904,7 @@ def cambioTutor(self): |
899 | 904 | self.siAnalizadoTutor = False |
900 | 905 |
|
901 | 906 | if self.tipoJuego == kJugEntMaq: |
902 | | - self.analizaTutorInicio() |
| 907 | + self.analizaInicio() |
903 | 908 |
|
904 | 909 | def siTerminada(self): |
905 | 910 | return self.partida.ultPosicion.siTerminada() |
@@ -1054,6 +1059,44 @@ def exePulsadoNum(self, siActivar, numero): |
1054 | 1059 | if self.tablero.flechaSC: |
1055 | 1060 | self.tablero.flechaSC.show() |
1056 | 1061 |
|
| 1062 | + elif numero in [2, 7]: |
| 1063 | + if siActivar: |
| 1064 | + # Que jugada esta en el tablero |
| 1065 | + fen = self.fenActivoConInicio() |
| 1066 | + siBlancas = " w " in fen |
| 1067 | + if numero == 2: |
| 1068 | + siMB = siBlancas |
| 1069 | + else: |
| 1070 | + siMB = not siBlancas |
| 1071 | + if siMB != siBlancas: |
| 1072 | + fen = LCEngine.fenOB(fen) |
| 1073 | + cp = ControlPosicion.ControlPosicion() |
| 1074 | + cp.leeFen(fen) |
| 1075 | + liMovs = cp.aura() |
| 1076 | + |
| 1077 | + self.liMarcosTmp = [] |
| 1078 | + regMarco = TabTipos.Marco() |
| 1079 | + color = self.tablero.confTablero.flechaActivoDefecto().colorinterior |
| 1080 | + if color == -1: |
| 1081 | + color = self.tablero.confTablero.flechaActivoDefecto().color |
| 1082 | + |
| 1083 | + st = set() |
| 1084 | + for h8 in liMovs: |
| 1085 | + if h8 not in st: |
| 1086 | + regMarco.a1h8 = h8 + h8 |
| 1087 | + regMarco.siMovible = True |
| 1088 | + regMarco.color = color |
| 1089 | + regMarco.colorinterior = color |
| 1090 | + regMarco.opacidad = 0.5 |
| 1091 | + marco = self.tablero.creaMarco(regMarco) |
| 1092 | + self.liMarcosTmp.append(marco) |
| 1093 | + st.add(h8) |
| 1094 | + |
| 1095 | + else: |
| 1096 | + for marco in self.liMarcosTmp: |
| 1097 | + self.tablero.xremoveItem(marco) |
| 1098 | + self.liMarcosTmp = [] |
| 1099 | + |
1057 | 1100 | def exePulsadaLetra(self, siActivar, letra): |
1058 | 1101 | if siActivar: |
1059 | 1102 | dic = { 'a':kMoverInicio, |
@@ -1296,7 +1339,6 @@ def configurar(self, liMasOpciones=None, siCambioTutor=False, siSonidos=False, s |
1296 | 1339 | modoPosicionBlind = True |
1297 | 1340 | self.tablero.blindfoldChange(modoPosicionBlind) |
1298 | 1341 |
|
1299 | | - |
1300 | 1342 | elif orden == "conf": |
1301 | 1343 | self.tablero.blindfoldConfig() |
1302 | 1344 |
|
@@ -1505,6 +1547,11 @@ def utilidades(self, liMasOpciones=None, siArbol=True): |
1505 | 1547 |
|
1506 | 1548 | return None |
1507 | 1549 |
|
| 1550 | + def mensajeEnPGN(self, mens, titulo=None): |
| 1551 | + p0 = self.pantalla.base.pgn.pos() |
| 1552 | + p = self.pantalla.mapToGlobal(p0) |
| 1553 | + QTUtil2.mensajeEnPunto(self.pantalla, mens, titulo, p) |
| 1554 | + |
1508 | 1555 | def showAnalisis(self): |
1509 | 1556 | um = self.procesador.unMomento() |
1510 | 1557 | elos = self.partida.calc_elos(self.configuracion) |
|
0 commit comments