[atomix] Added gameplay tips (bgo#587868)
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [atomix] Added gameplay tips (bgo#587868)
- Date: Mon, 23 Nov 2015 19:50:10 +0000 (UTC)
commit 3b3285d6bee40d676be6594cc8caa2735a4bb33c
Author: Robert Roth <robert roth off gmail com>
Date: Mon Nov 23 21:49:56 2015 +0200
Added gameplay tips (bgo#587868)
src/board-gtk.c | 25 ++++++++++++++++++++-----
src/board-gtk.h | 1 +
2 files changed, 21 insertions(+), 5 deletions(-)
---
diff --git a/src/board-gtk.c b/src/board-gtk.c
index 561ebe6..d52aaf2 100644
--- a/src/board-gtk.c
+++ b/src/board-gtk.c
@@ -317,16 +317,31 @@ static void create_logo (void)
{
GdkPixbuf *pixbuf;
int tile_width, tile_height;
+ GtkWidget *logo_image;
+ GtkWidget *tips_label;
+
theme_get_tile_size (board_theme, &tile_width, &tile_height);
pixbuf = gdk_pixbuf_new_from_file (DATADIR "/atomix/atomix-logo.png", NULL);
- level_items->logo = gtk_image_new_from_pixbuf (pixbuf);
- gtk_widget_show (level_items->logo);
- gtk_fixed_put (GTK_FIXED (board_canvas), level_items->logo,
- BGR_FLOOR_COLS * tile_width/2 - gdk_pixbuf_get_width (pixbuf)/2,
- BGR_FLOOR_ROWS * tile_height/2 - gdk_pixbuf_get_height (pixbuf)/2);
+ level_items->logo = gtk_box_new (GTK_ORIENTATION_VERTICAL, 15);
+
+ logo_image = gtk_image_new_from_pixbuf (pixbuf);
+ gtk_container_add (GTK_CONTAINER (level_items->logo), logo_image);
+ tips_label = gtk_label_new (_("Guide the atoms through the maze to form molecules.\n"
+ "Click, or use the arrow keys and Enter, to select an atom and move it.\n"
+ "Be careful, though: an atom keeps moving until it hits a wall.\n"));
+ gtk_container_add (GTK_CONTAINER (level_items->logo), tips_label);
+ gtk_widget_show_all (level_items->logo);
+
+ gtk_fixed_put (GTK_FIXED (board_canvas), level_items->logo,
+ 0,
+ (BGR_FLOOR_ROWS * tile_height - gdk_pixbuf_get_height (pixbuf)) / 3);
+ gtk_widget_set_size_request (GTK_WIDGET (tips_label), BGR_FLOOR_COLS * tile_width, -1);
+ gtk_label_set_justify (GTK_LABEL (tips_label), GTK_JUSTIFY_CENTER);
+ gtk_label_set_line_wrap (GTK_LABEL (tips_label), TRUE);
+
g_object_unref (pixbuf);
}
diff --git a/src/board-gtk.h b/src/board-gtk.h
index 563dc7e..8800796 100644
--- a/src/board-gtk.h
+++ b/src/board-gtk.h
@@ -21,6 +21,7 @@
#define _ATOMIX_BOARD_GTK_H_
#include <gtk/gtk.h>
+#include <glib/gi18n.h>
#include <math.h>
#include "theme.h"
#include "playfield.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]