From 1f972d16d85630742b020a6b03d46494249f7813 Mon Sep 17 00:00:00 2001 From: Gonzalo Odiard Date: Fri, 08 Aug 2014 20:27:35 +0000 Subject: Don't show the status in the screen --- diff --git a/dominoactivity.py b/dominoactivity.py index b417ee9..a6a5503 100644 --- a/dominoactivity.py +++ b/dominoactivity.py @@ -214,9 +214,6 @@ class Domino(activity.Activity): if player_with_minus_pieces == player: win = True - if self.game.table: - self.game.table.show_status(ctx, self.game.get_status()) - if end_game: self.add_points_by_name(self.game.processor.get_name(), win) self.game.table.msg_end_game(ctx, win) @@ -270,9 +267,9 @@ class Domino(activity.Activity): piece.draw(surf_ctx, False, flipped) # to debug - #self.game.table.show_values(surf_ctx, self.game.values) - #self.game.table.mark_tile(surf_ctx, self.game.start) - #self.game.table.mark_tile(surf_ctx, self.game.end) + # self.game.table.show_values(surf_ctx, self.game.values) + # self.game.table.mark_tile(surf_ctx, self.game.start) + # self.game.table.mark_tile(surf_ctx, self.game.end) def _start_game(self, button): if self.show_scores: diff --git a/dominogame.py b/dominogame.py index 7de697d..bd23483 100644 --- a/dominogame.py +++ b/dominogame.py @@ -1,6 +1,5 @@ import random import logging -from gettext import gettext as _ from sugar3 import profile @@ -161,16 +160,6 @@ class DominoGame: x = x + dominoview.SIZE + separacion_x piece.visible = True - def get_status(self): - players_status = '' - for player in self.players: - players_status = players_status + player.get_status() - - if len(self.pieces) > 0: - players_status = players_status + _("Stack")+" : " + \ - str(len(self.pieces)) - return players_status - class DominoGamePoints: diff --git a/dominoplayer.py b/dominoplayer.py index 9d05c64..3f4d704 100644 --- a/dominoplayer.py +++ b/dominoplayer.py @@ -70,13 +70,6 @@ class DominoPlayer: self._pieces.remove(cantPieces) return - def get_status(self): - if (len(self._pieces) > 0): - return self.name + ' - ' + str(len(self._pieces)) + \ - ' ' + _('pieces') + '. ' - else: - return self.name + ' - ' + _('WIN') + '!!!!. ' - def test_good_position(self, tile, piece): n, p = tile.n, tile.p logging.error('tile value %s direction %s piece a %s piece b %s', diff --git a/dominoview.py b/dominoview.py index 2317ece..2065de5 100644 --- a/dominoview.py +++ b/dominoview.py @@ -11,8 +11,6 @@ from gi.repository import Rsvg from gettext import gettext as _ -import cairoutils - from sugar3.graphics import style # SIZE Es el ancho de una ficha (y la mitads del largo) @@ -120,32 +118,6 @@ class DominoTableView(): def get_tile_position(self, n, p): return self._margin_x + n * SIZE, self._margin_y + p * SIZE - def get_tile_coord(self, x, y): - return (x - self._margin_x) / SIZE, (y / SIZE) + 1 - - def show_status(self, ctx, text): - xIni = 10 - yIni = 5 - - stroke_r, stroke_g, stroke_b = 0, 0, 0 - alpha = 0.6 - ctx.set_source_rgba(stroke_r, stroke_g, stroke_b, alpha) - - ctx.select_font_face("Sans", cairo.FONT_SLANT_NORMAL, - cairo.FONT_WEIGHT_NORMAL) - ctx.set_font_size(12) - x_bearing, y_bearing, width, height, x_advance, y_advance = \ - ctx.text_extents(text) - - radio = 16 - - cairoutils.draw_round_rect(ctx, xIni, yIni, width + radio * 2, - height * 2, radio) - ctx.stroke() - - ctx.move_to(xIni + radio + x_bearing, yIni + height) - ctx.show_text(text) - def show_scores(self, ctx, score_list): alto = 5 ctx.move_to(alto, alto) -- cgit v0.9.1