[gcompris] braille lotto: fixed not to go back to the main menu at the end
- From: Bruno Coudoin <bcoudoin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcompris] braille lotto: fixed not to go back to the main menu at the end
- Date: Thu, 29 Dec 2011 20:28:07 +0000 (UTC)
commit d3ee8e0d578cf6ce5df499a6185f0a2bebd54a58
Author: Bruno Coudoin <bruno coudoin free fr>
Date: Thu Dec 29 21:08:00 2011 +0100
braille lotto: fixed not to go back to the main menu at the end
At the end, this activity was not cleaning itself properly.
Improved it a little bit the layour to accomodate with longer translated text
Added sound effects.
src/braille_lotto-activity/braille_lotto.py | 41 ++++++++------
.../resources/braille_lotto/button1.svg | 55 +++++++------------
.../resources/braille_lotto/callout1.svg | 29 ++++++----
.../resources/braille_lotto/callout2.svg | 29 ++++++----
4 files changed, 77 insertions(+), 77 deletions(-)
---
diff --git a/src/braille_lotto-activity/braille_lotto.py b/src/braille_lotto-activity/braille_lotto.py
index e06d155..ab8dc9d 100644
--- a/src/braille_lotto-activity/braille_lotto.py
+++ b/src/braille_lotto-activity/braille_lotto.py
@@ -25,6 +25,7 @@ import gcompris.skin
import gcompris.bonus
import gcompris.timer
import gcompris.anim
+import gcompris.sound
import goocanvas
import random
import pango
@@ -137,9 +138,9 @@ class Gcompris_braille_lotto:
x = 25,
y = 350,
width = 170,
- height = 90,
- radius_x = 17,
- radius_y = 17,
+ height = 120,
+ radius_x = 5,
+ radius_y = 5,
stroke_color = "black",
fill_color = "#d38d5f" ,
line_width = 2)
@@ -149,9 +150,11 @@ class Gcompris_braille_lotto:
parent = self.root,
text= _("Check Number"),
font = gcompris.skin.get_font("gcompris/board/medium"),
- x = 110,
- y = 380,
+ x = 100,
+ y = 384,
+ width = 140,
anchor = gtk.ANCHOR_CENTER,
+ alignment = pango.ALIGN_CENTER,
)
@@ -164,7 +167,7 @@ class Gcompris_braille_lotto:
svg_id = "#FIG1",
tooltip = _("Click me to get some hint")
)
- self.hint_left_button.translate(210, 330)
+ self.hint_left_button.translate(200, 330)
self.hint_left_button.connect("button_press_event", self.clue_left)
gcompris.utils.item_focus_init(self.hint_left_button, None)
@@ -189,9 +192,9 @@ class Gcompris_braille_lotto:
parent = self.root,
text = _("I don't have this number PLAYER {number}").format(number = str(index + 1)),
font = gcompris.skin.get_font("gcompris/board/medium"),
- x = index * 230 + 310,
+ x = 290 if index == 0 else 540,
y = 395,
- width = 150,
+ width = 140,
anchor=gtk.ANCHOR_CENTER,
)
self.text_array.append(clue_text)
@@ -212,7 +215,7 @@ class Gcompris_braille_lotto:
text = _("Lotto Master"),
font = gcompris.skin.get_font("gcompris/board/medium"),
x = 410,
- y = 455,
+ y = 460,
anchor=gtk.ANCHOR_CENTER,
)
@@ -221,9 +224,9 @@ class Gcompris_braille_lotto:
x = 610,
y = 350,
width = 170,
- height = 90,
- radius_x = 17,
- radius_y = 17,
+ height = 120,
+ radius_x = 5,
+ radius_y = 5,
stroke_color = "black",
fill_color = "#d33e5f",
line_width = 2)
@@ -236,7 +239,7 @@ class Gcompris_braille_lotto:
text = _("Generate a number"),
font = gcompris.skin.get_font("gcompris/board/medium"),
x = 695,
- y = 390,
+ y = 410,
width = 50,
anchor = gtk.ANCHOR_CENTER,
alignment = pango.ALIGN_CENTER,
@@ -348,13 +351,14 @@ class Gcompris_braille_lotto:
def number_call(self):
if(self.counter == 11):
self.displayGameStatus( _("Game Over") )
- self.timer_inc = gobject.timeout_add(1000, self.game_over)
+ self.timer_inc = gobject.timeout_add(5000, self.game_over)
elif (self.counter < 11):
+ gcompris.sound.play_ogg("sounds/flip.wav")
self.check_number = \
goocanvas.Text(parent = self.root,
text = self.check_random[self.counter],
x=110,
- y=420,
+ y=440,
font = gcompris.skin.get_font("gcompris/board/title bold"),
anchor=gtk.ANCHOR_CENTER,
)
@@ -427,6 +431,7 @@ class Gcompris_braille_lotto:
def cross_number(self, item, event, target, index):
if( self.check_random[self.counter] == self.ticket_array[index]):
# This is a win
+ gcompris.sound.play_ogg("sounds/tuxok.wav")
if(index in (0, 1, 2, 3, 4, 5)):
self.score_player_a +=1
else:
@@ -440,6 +445,7 @@ class Gcompris_braille_lotto:
)
else :
# This is a loss, indicate it with a cross mark
+ gcompris.sound.play_ogg("sounds/crash.wav")
item = \
goocanvas.Image(parent = self.root,
pixbuf = gcompris.utils.load_pixmap("braille_lotto/cross_button.png"),
@@ -457,7 +463,7 @@ class Gcompris_braille_lotto:
if winner:
self.displayGameStatus( \
_("Congratulation player {player_id}, you won").format(player_id = str(winner) ) )
- self.timer_inc = gobject.timeout_add(1500, self.timer_loop)
+ self.timer_inc = gobject.timeout_add(5000, self.timer_loop)
def displayGameStatus(self, message):
@@ -489,10 +495,9 @@ class Gcompris_braille_lotto:
# Remove the root item removes all the others inside it
self.root.remove()
self.map_rootitem.remove()
- gcompris.end_board()
def ok(self):
- print("braille_lotto ok.")
+ pass
def repeat(self):
if(self.mapActive):
diff --git a/src/braille_lotto-activity/resources/braille_lotto/button1.svg b/src/braille_lotto-activity/resources/braille_lotto/button1.svg
index 8c86c5a..d61e2a8 100644
--- a/src/braille_lotto-activity/resources/braille_lotto/button1.svg
+++ b/src/braille_lotto-activity/resources/braille_lotto/button1.svg
@@ -10,25 +10,15 @@
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="318.89764"
- height="120.17"
+ width="318.06125"
+ height="136.39911"
id="svg3195"
version="1.1"
- inkscape:version="0.48.0 r9654"
+ inkscape:version="0.48.2 r9819"
sodipodi:docname="button1.svg">
<defs
id="defs3">
<linearGradient
- y2="211.73659"
- x2="854.75134"
- y1="211.73657"
- x1="649.69342"
- gradientTransform="matrix(0.09226556,0.62993533,-0.75623168,0.1856578,239.02994,-421.47677)"
- gradientUnits="userSpaceOnUse"
- id="linearGradient3135"
- xlink:href="#linearGradient752-9-2"
- inkscape:collect="always" />
- <linearGradient
id="linearGradient752-9-2">
<stop
style="stop-color:#ffff00;stop-opacity:1;"
@@ -60,16 +50,6 @@
offset="1"
id="stop754-7" />
</linearGradient>
- <linearGradient
- y2="211.73659"
- x2="854.75134"
- y1="211.73657"
- x1="649.69342"
- gradientTransform="matrix(-0.09226556,-0.62993533,0.75623168,-0.1856578,77.636559,657.47413)"
- gradientUnits="userSpaceOnUse"
- id="linearGradient3193"
- xlink:href="#linearGradient752-9"
- inkscape:collect="always" />
</defs>
<sodipodi:namedview
id="base"
@@ -78,17 +58,22 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="1.2"
- inkscape:cx="160"
- inkscape:cy="74.166666"
+ inkscape:zoom="1.6970563"
+ inkscape:cx="112.35612"
+ inkscape:cy="5.9403376"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
- inkscape:window-width="1256"
- inkscape:window-height="701"
+ inkscape:window-width="1680"
+ inkscape:window-height="1026"
inkscape:window-x="0"
- inkscape:window-y="37"
- inkscape:window-maximized="1" />
+ inkscape:window-y="24"
+ inkscape:window-maximized="1"
+ units="mm"
+ fit-margin-top="1"
+ fit-margin-left="1"
+ fit-margin-right="1"
+ fit-margin-bottom="1" />
<metadata
id="metadata3199">
<rdf:RDF>
@@ -105,16 +90,16 @@
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
- transform="translate(0,-56.995248)">
+ transform="translate(0.70250074,-68.425443)">
<path
- style="font-size:12px;fill:url(#linearGradient3193);fill-opacity:1;fill-rule:evenodd"
- d="m 170.69939,149.90754 c 3.84643,7.6376 10.33685,10.00025 14.25702,10.31944 l 118.21897,2.7129 c 6.28155,0.54614 9.75939,-1.80109 9.64472,-11.41652 -8.96622,-14.39298 -13.17646,-47.04794 -9.71595,-63.492491 -0.11474,-9.615527 -4.1272,-14.501285 -10.40867,-15.04734 l -112.98693,2.502105 c -6.28159,-0.545985 -9.0323,1.511018 -11.5979,10.167309 -4.11354,12.168839 -3.89954,48.472297 2.58874,64.254597 z"
+ style="font-size:12px;fill:#e8caca;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 170.69939,181.23639 c 3.84643,10.74817 10.33685,14.07306 14.25702,14.52224 l 118.21897,3.81779 c 6.28155,0.76856 9.75939,-2.53462 9.64472,-16.06613 -8.96622,-20.25481 -6.10539,-66.20916 -2.64488,-89.351089 -0.11474,-13.531644 -4.1272,-20.407225 -10.40867,-21.175672 l -120.058,3.521138 c -6.28159,-0.768349 -9.0323,2.12641 -11.5979,14.30815 -4.11354,17.124843 -3.89954,68.213613 2.58874,90.423573 z"
id="FIG2"
sodipodi:nodetypes="cccccccsc"
inkscape:connector-curvature="0" />
<path
- style="font-size:12px;fill:url(#linearGradient3135);fill-opacity:1;fill-rule:evenodd"
- d="M 145.96711,86.089839 C 142.12067,78.452244 135.63026,76.089593 131.71009,75.770402 L 13.49111,73.057511 C 7.2095754,72.51137 3.7317364,74.858604 3.846399,84.47403 c 8.966213,14.392975 13.176455,47.04794 9.715949,63.4925 0.11474,9.61552 4.127211,14.50128 10.408666,15.04733 l 112.986926,-2.5021 c 6.28159,0.54598 9.03232,-1.51101 11.5979,-10.16732 4.11353,-12.16884 3.89955,-48.47231 -2.58873,-64.254601 z"
+ style="font-size:12px;fill:#e8caca;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="M 145.96711,91.427648 C 142.12067,80.679488 135.63026,77.3546 131.71009,76.905412 L 13.49111,73.087642 c -6.2815346,-0.768568 -9.7593736,2.534624 -9.644711,16.066126 8.966213,20.254802 5.5161315,66.798422 2.0556255,89.940362 0.11474,13.53163 4.1272115,20.40722 10.4086665,21.17566 l 120.647249,-4.1104 c 6.28159,0.76835 9.03232,-2.12639 11.5979,-14.30816 4.11353,-17.12485 3.89955,-68.21364 -2.58873,-90.423582 z"
id="FIG1"
sodipodi:nodetypes="cccccccsc"
inkscape:connector-curvature="0" />
diff --git a/src/braille_lotto-activity/resources/braille_lotto/callout1.svg b/src/braille_lotto-activity/resources/braille_lotto/callout1.svg
index b4e130e..bd44dac 100644
--- a/src/braille_lotto-activity/resources/braille_lotto/callout1.svg
+++ b/src/braille_lotto-activity/resources/braille_lotto/callout1.svg
@@ -9,11 +9,11 @@
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="171.17999"
- height="111.34"
+ width="162.42834"
+ height="141.73228"
id="svg3004"
version="1.1"
- inkscape:version="0.48.0 r9654"
+ inkscape:version="0.48.2 r9819"
sodipodi:docname="callout1.svg">
<defs
id="defs3" />
@@ -25,16 +25,21 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.2"
- inkscape:cx="160"
- inkscape:cy="58.333332"
+ inkscape:cx="152.40668"
+ inkscape:cy="54.027978"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
- inkscape:window-width="1256"
- inkscape:window-height="701"
+ inkscape:window-width="1680"
+ inkscape:window-height="1026"
inkscape:window-x="0"
- inkscape:window-y="37"
- inkscape:window-maximized="1" />
+ inkscape:window-y="24"
+ inkscape:window-maximized="1"
+ units="mm"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0" />
<metadata
id="metadata3008">
<rdf:RDF>
@@ -51,10 +56,10 @@
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
- transform="translate(0,-79.997721)">
+ transform="translate(-7.5933242,-45.300075)">
<path
- style="fill:#e6e6e6;fill-opacity:0.82352941;stroke:#0e181a;stroke-width:2.04655623;stroke-miterlimit:4;stroke-opacity:1;display:inline;enable-background:new"
- d="m 12.913142,84.348146 135.955358,0 c 2.38029,0 4.29656,8.578011 4.29656,19.233164 l -0.83791,10.24761 16.67124,59.61368 c -23.33333,-26.01149 -17.7496,12.56648 -20.12989,12.56648 l -135.955358,0 c -2.38029,0 -4.2965397,-8.57797 -4.2965397,-19.23315 l 0,-63.19462 c 0,-10.655154 1.9162497,-19.233164 4.2965397,-19.233164 z"
+ style="fill:#e6e6e6;fill-opacity:0.82352941;stroke:#0e181a;stroke-width:2.39338589;stroke-miterlimit:4;stroke-opacity:1;display:inline;enable-background:new"
+ d="m 13.077265,46.496768 135.661355,0 c 2.37514,0 4.28727,11.757226 4.28727,26.361432 l -0.8361,14.045619 16.63519,35.874601 c -23.28288,-35.651973 -17.71122,63.05725 -20.08636,63.05725 l -135.661355,0 c -2.375142,0 -4.2872479,-11.75717 -4.2872479,-26.36142 l 0,-86.61605 c 0,-14.604208 1.9121059,-26.361432 4.2872479,-26.361432 z"
id="BUBBLE1"
sodipodi:nodetypes="cccccccccc"
inkscape:label="#BUBBLE1"
diff --git a/src/braille_lotto-activity/resources/braille_lotto/callout2.svg b/src/braille_lotto-activity/resources/braille_lotto/callout2.svg
index 1f801c2..97187db 100644
--- a/src/braille_lotto-activity/resources/braille_lotto/callout2.svg
+++ b/src/braille_lotto-activity/resources/braille_lotto/callout2.svg
@@ -9,11 +9,11 @@
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="165.17999"
- height="110.34"
+ width="162.625"
+ height="141.71875"
id="svg3004"
version="1.1"
- inkscape:version="0.48.0 r9654"
+ inkscape:version="0.48.2 r9819"
sodipodi:docname="callout2.svg">
<defs
id="defs3" />
@@ -25,16 +25,21 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.2"
- inkscape:cx="160"
- inkscape:cy="58.333332"
+ inkscape:cx="158.28125"
+ inkscape:cy="87.401333"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
- inkscape:window-width="1256"
- inkscape:window-height="701"
+ inkscape:window-width="1680"
+ inkscape:window-height="1026"
inkscape:window-x="0"
- inkscape:window-y="37"
- inkscape:window-maximized="1" />
+ inkscape:window-y="24"
+ inkscape:window-maximized="1"
+ units="mm"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0" />
<metadata
id="metadata3008">
<rdf:RDF>
@@ -51,10 +56,10 @@
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
- transform="translate(0,-80.998257)">
+ transform="translate(-1.71875,-78.6875)">
<path
- style="fill:#e6e6e6;fill-opacity:0.82352941;stroke:#0e181a;stroke-width:2.04655623;stroke-miterlimit:4;stroke-opacity:1;display:inline;enable-background:new"
- d="m 158.86809,187.67575 -135.955348,0 c -2.38029,0 9.87188,-31.24753 -4.29656,-19.23316 L 3.6211826,179.02831 21.116182,115.24796 c 0,-10.65518 -0.58373,-29.23315 1.79656,-29.23315 l 135.955348,0 c 2.38029,0 4.29654,8.57797 4.29654,19.23315 l 0,63.19463 c 0,10.65514 -1.91625,19.23316 -4.29654,19.23316 z"
+ style="fill:#e6e6e6;fill-opacity:0.82352941;stroke:#0e181a;stroke-width:2.3955636;stroke-miterlimit:4;stroke-opacity:1;display:inline;enable-background:new"
+ d="m 158.84317,219.22045 -135.910458,0 c -2.379504,0 9.86862,-87.82793 -4.295142,-71.36101 L 3.6475222,162.36825 21.136745,119.95075 c 0,-14.60401 -0.583537,-40.067019 1.795967,-40.067019 l 135.910458,0 c 2.3795,0 4.29512,11.756986 4.29512,26.360999 l 0,86.61471 c 0,14.60396 -1.91562,26.36101 -4.29512,26.36101 z"
id="BUBBLE1"
sodipodi:nodetypes="cccccccccc"
inkscape:label="#BUBBLE1"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]