| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
#include <gtk/gtk.h> |
| 9 |
|
| 10 |
#include "gtkballs.h" |
| 11 |
#include "gtkutils.h" |
| 12 |
|
| 13 |
|
| 14 |
void show_rules (GtkWidget *widget, gpointer data) |
| 15 |
{ |
| 16 |
GtkWidget * dialog; |
| 17 |
GtkWidget * main_vbox, * vbox, * hbox; |
| 18 |
GtkWidget * label; |
| 19 |
|
| 20 |
dialog = gtkutil_dialog_new (_("Rules"), main_window, TRUE, &main_vbox); |
| 21 |
vbox = gtkutil_frame_vbox (_("Rules"), main_vbox); |
| 22 |
|
| 23 |
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); |
| 24 |
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); |
| 25 |
|
| 26 |
label = gtk_label_new (_("The standard play area of GtkBalls is a 9x9\n" \ |
| 27 |
"grid (it can be changed through \"Rules\"\n" \ |
| 28 |
"option in ingame menu). When GtkBalls is\n" \ |
| 29 |
"first started a number of balls are placed\n" \ |
| 30 |
"in a random manner on the grid. Balls are\n" \ |
| 31 |
"in different colors (and/or shape). You may\n" \ |
| 32 |
"move balls on the grid by selecting them and\n" \ |
| 33 |
"selecting an empty square on the grid as\n" \ |
| 34 |
"destination for the ball you selected. Balls\n" \ |
| 35 |
"will only move if they are not blocked by\n" \ |
| 36 |
"other balls. Each time you move a ball,\n" \ |
| 37 |
"unless you score some points, new balls\n" \ |
| 38 |
"appear in a random manner on the grid. If\n" \ |
| 39 |
"the grid is full then the game is lost.\n" \ |
| 40 |
"However this is bound to happen, your goal\n" \ |
| 41 |
"is to make the highest score. In order to do\n" \ |
| 42 |
"this you must make lines in a vertical,\n" \ |
| 43 |
"horizontal or diagonal way with balls of the\n" \ |
| 44 |
"same color. By default a line must have at\n" \ |
| 45 |
"least five balls of the same color (it can\n" \ |
| 46 |
"also be changed through \"Rules\" option in\n" \ |
| 47 |
"ingame menu). Making a line of minimum amount\n" \ |
| 48 |
"of the balls, specifed in rules, will earn you\n" \ |
| 49 |
"twice the points for your score. If you make\n" \ |
| 50 |
"lines over minimum amount of the balls it will\n" \ |
| 51 |
"earn you even more points. In order to help you\n" \ |
| 52 |
"decide which ball you are going to move, there\n" \ |
| 53 |
"is an indicator on top of the grid that shows\n" \ |
| 54 |
"what colors the next balls that will appear on\n" \ |
| 55 |
"the grid will be.")); |
| 56 |
gtk_box_pack_start (GTK_BOX(hbox), label, TRUE, TRUE, 5); |
| 57 |
|
| 58 |
gtk_dialog_add_button (GTK_DIALOG (dialog), "gtk-close", GTK_RESPONSE_OK); |
| 59 |
g_signal_connect_swapped (dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog); |
| 60 |
|
| 61 |
gtk_widget_show_all (dialog); |
| 62 |
} |