Commit 4f11619b authored by Bruno Coudoin's avatar Bruno Coudoin

bar adjustments all around.

svn path=/branches/gcomprixogoo/; revision=3529
parent 8a702d05
......@@ -168,6 +168,7 @@ static void start_board (GcomprisBoard *agcomprisBoard)
canal_lock_next_level();
gc_bar_set(0);
gc_bar_location(0, -1, 0.7);
animation = FALSE;
......
......@@ -245,6 +245,7 @@ static void start_board (GcomprisBoard *agcomprisBoard)
} else {
gc_bar_set(GC_BAR_CONFIG);
}
gc_bar_location(0, -1, 0.7);
gamewon = FALSE;
......
......@@ -205,7 +205,7 @@ static void start_board (GcomprisBoard *agcomprisBoard)
gcomprisBoard->sublevel = 1;
gcomprisBoard->number_of_sublevel = 1; /* Go to next level after this number of 'play' */
gc_bar_set(GC_BAR_LEVEL);
gc_bar_location (BOARDWIDTH-BARWIDTH/2, -1, 0.5);
gc_bar_location (BOARDWIDTH-BARWIDTH/2, -1, 0.7);
gc_set_background(goo_canvas_get_root_item(gcomprisBoard->canvas),
"crane/crane-bg.svgz");
......
......@@ -318,16 +318,20 @@ gc_bar_set_repeat_icon (GdkPixbuf *pixmap)
/** Setting the bar location
* @param[in] x the bar x coordinate, -1 to set the default
* @param[in] y the bar x coordinate, -1 to set the default
* @param[in] y the bar y coordinate, -1 to set the default
* @param[in] zoom the bar zoom factor, -1 to set the default
*/
void
gc_bar_location (int x, int y, double zoom)
{
// Make the y coord be assigned at its bottom
int ny = (y == -1 ? _default_y : y);
ny += BARHEIGHT - (zoom == -1 ? _default_zoom : zoom) * BARHEIGHT;
goo_canvas_item_set_transform(rootitem, NULL);
goo_canvas_item_translate(rootitem,
(x == -1 ? _default_x : x),
(y == -1 ? _default_y : y));
y = ny);
goo_canvas_item_scale(rootitem,
(zoom == -1 ? _default_zoom : zoom),
(zoom == -1 ? _default_zoom : zoom));
......
......@@ -158,6 +158,7 @@ static void start_board (GcomprisBoard *agcomprisBoard) {
gcomprisBoard->number_of_sublevel = NUMBER_OF_SUBLEVELS;
gc_score_start(SCORESTYLE_NOTE, 10, 50, gcomprisBoard->number_of_sublevel);
gc_bar_set(GC_BAR_LEVEL);
gc_bar_location(BOARDWIDTH-BARWIDTH + 110, 5, 0.8);
leftright_next_level();
......
......@@ -168,7 +168,7 @@ static void start_board (GcomprisBoard *agcomprisBoard)
gcomprisBoard->level = 1;
gcomprisBoard->maxlevel = 6;
gc_bar_set(GC_BAR_LEVEL);
gc_bar_location(30, -1, 0.6);
gc_bar_location(BOARDWIDTH-BARWIDTH + 100, -1, 0.7);
/* Init of paratrooper struct */
paratrooperItem.rootitem = NULL;
......@@ -216,6 +216,7 @@ static gint key_press(guint keyval, gchar *commit_str, gchar *preedit_str)
switch (keyval)
{
/* Avoid all this keys to be interpreted by this game */
case 0:
case GDK_Shift_L:
case GDK_Shift_R:
case GDK_Control_L:
......@@ -597,6 +598,8 @@ void next_state()
bounds.y2);
drop_tux_id = \
gtk_timeout_add (10, (GtkFunction) paratrooper_move_tux, NULL);
gc_item_focus_remove(planeitem, NULL);
}
break;
......@@ -612,7 +615,7 @@ void next_state()
"rsvg-handle", svg_handle,
NULL);
gc_item_focus_init(paratrooperItem.paratrooper, NULL);
gc_item_focus_remove(paratrooperItem.paratrooper, NULL);
g_object_unref(svg_handle);
paratrooperItem.status = TUX_FLYING;
......@@ -640,6 +643,7 @@ void next_state()
paratrooperItem.speed = 3;
g_object_set (paratrooperItem.paratrooper, "visibility", GOO_CANVAS_ITEM_INVISIBLE, NULL);
g_object_set (planeitem, "visibility", GOO_CANVAS_ITEM_VISIBLE, NULL);
gc_item_focus_init(planeitem, NULL);
break;
default:
......@@ -657,15 +661,6 @@ item_event (GooCanvasItem *item,
if(!gcomprisBoard)
return FALSE;
switch (event->type)
{
case GDK_BUTTON_PRESS:
next_state();
break;
default:
break;
}
return FALSE;
}
next_state();
return FALSE;
}
......@@ -187,6 +187,7 @@ static void start_board (GcomprisBoard *agcomprisBoard)
} else {
gc_bar_set(GC_BAR_LEVEL|GC_BAR_REPEAT);
}
gc_bar_location(BOARDWIDTH-BARWIDTH + 120, 0, 0.7);
railroad_next_level();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment