Commit 060d9b52 authored by Bruno Coudoin's avatar Bruno Coudoin

added transportation levels added transportation created. created by Bruno

	* boards/chronos.xml.in: added transportation levels
	* boards/chronos/Makefile.am:  added transportation
	* boards/chronos/images/README: created.
	* boards/chronos/images/vicking_boat.png: created by Bruno coudoin. Released under the GPL.
	* boards/dataset/mrpatate.xml: added the viking boat
	* boards/gletters/README: created bt Yan Seiner
	* boards/redraw_symmetrical.xml.in: reset the name. I have a problem with the web site generation here.
	the name field was supose to be used for web generation and was set to the file name. It has changed for python.
	need to find a way to fix that. Most important is that the game works.
	* src/boards/shapegame.c: (create_title), (add_xml_shape_to_data): added a black shadow under the text. Fixed title alignment.
	* src/gcompris/help.c: (gcompris_help_start), (set_content),
	(item_event_help): changed to use the rich text item. Now the line wrapping is done automatically.
parent a328823f
2004-02-28 Bruno coudoin <bruno.coudoin@free.fr>
* boards/chronos.xml.in: added transportation levels
* boards/chronos/Makefile.am: added transportation
* boards/chronos/images/README: created.
* boards/chronos/images/vicking_boat.png: created by Bruno coudoin. Released under the GPL.
* boards/dataset/mrpatate.xml: added the viking boat
* boards/gletters/README: created bt Yan Seiner
* boards/redraw_symmetrical.xml.in: reset the name. I have a problem with the web site generation here.
the name field was supose to be used for web generation and was set to the file name. It has changed for python.
need to find a way to fix that. Most important is that the game works.
* src/boards/shapegame.c: (create_title), (add_xml_shape_to_data): added a black shadow under the text. Fixed title alignment.
* src/gcompris/help.c: (gcompris_help_start), (set_content),
(item_event_help): changed to use the rich text item. Now the line wrapping is done automatically.
2004-02-28 Bruno coudoin <bruno.coudoin@free.fr>
* .cvsignore: added list_translators.sh
......
......@@ -14,8 +14,9 @@
<_manual>Pick the pictures on the left and put them on the red points</_manual>
<_goal>Order the pictures to tell the story</_goal>
<_prerequisite>Tell a short story</_prerequisite>
<_credit>Moon photo comes from NASA\n
Space sounds from Tuxpaint and Vegastrike</_credit>
<_credit>Moon photo comes from NASA
Space sounds from Tuxpaint and Vegastrike.
Date of Transportation are based on those found in http://www.wikipedia.org</_credit>
</Board>
</GCompris>
......@@ -3,7 +3,12 @@ xmldir = $(pkgdatadir)/@PACKAGE_DATA_DIR@/chronos
xml_in_files = \
board1_0.xml.in \
board2_0.xml.in
board2_0.xml.in \
board3_0.xml.in \
board3_1.xml.in \
board3_2.xml.in \
board3_3.xml.in \
board3_4.xml.in
xml_DATA = $(xml_in_files:.xml.in=.xml)
......
Moon photo comes from NASA
Space sounds from Tuxpaint and Vegastrike.
viking_boat created by Bruno coudoin with OODraw. Released under GPL.
......@@ -42,6 +42,7 @@
<Image filename="gcompris/misc/parachute.png"/>
</ImageSet>
<ImageSet filename="gcompris/misc/car.png">
<Image filename="chronos/images/viking_boat.png"/>
<Image filename="gcompris/misc/car.png"/>
<Image filename="gcompris/misc/minivan.png"/>
<Image filename="gcompris/misc/truck.png"/>
......
Important: These files must be UTF-8 formated.
To do this, you can use gedit, oowrite or any text editor that supports UTF-8.
The locale files are a combination letters and configuration files.
The most important part of these files are levels. Each level consists of those characters you want dropped at that level. Do not use quotes and spaces are not allowed. The levels should be progressive in difficulty; level 1 might only contain upper case ASCII, level 2 might add numerals, level 3 might add lower case, and so on. There is currently a hard limit of 9 levels; this is simply because the scoring graphic does not extent beyond 9. If someone generates scoring icons beyond 9, I'll be happy to increase the level limit. Look at gletters.cz and gletters.ja for examples.
You as the translator should provide sufficient levels to be challenging in your native alphabet or alphabets. gletters is currently limited to at most 9 levels of play. Each level drops characters more frequently and faster than the previous level.
Scoring and progression to the next level is based on the number of characters at the current level.
If you skip a level, gletters will use default POSIX/ASCII upper case letters for that level.
Keymaps allow you to map characters that need to be composed via either alternate input methods, AltGr key or some such method to keyboard keys. For examples of this, look at gletters.ja and gletters.cz.
If your native alphabet uses only latin letters with perhaps some accents (as in the majority of Western European languages) you may not need a keymap. If your native alphabet uses additional or different characters you need to map those characters to keys normally found on your keyboard. Since gletters does not recognize alternate input methods, you must explicitly map alternate alphabets to latin letters.
A keymap essentially allows a single key to "pop" multiple characters. You do not need to map upper and lower case letters normally found in your locate; gletters checks for case automatically according to the rules of the locale.
Because alternate keyboards can be considerably slower, especially for beginning users, there are two special keywords that can be used to control how fast characters fall and how fast they are dropped.
The fallrate is the rate at which letters fall. The smaller the numbers, the faster the letters fall. The first number is the base; the second number is the variability by level. You should start with the sum of the numbers around 140 and experiment to find an appropriate fall speed for your users.
The droprate is the rate at which letters are dropped. The smaller the numbers, the more letters drop. The first number is the base; the second number is the variability by level. You should start with the sum of the numbers around 9000 and experiment to find an appropriate drop rate for your users.
Gletters was written to try and keep going even if there are errors in the config files. If things don't work as you expect, gletters does try to print warnings about things it doesn't understand in the config files; look at the output generated by gcompris before filing a bug report. If you file a bug report, please include your gletters.xx file, and any output generated by gcompris.
Known bugs
If you have characters in your level set that are not in your locale, they may not be rendered full-size. This appears to be a pango bug, not a gcompris bug.
Report bugs in UTF-8 implementation to gcompris-devel@lists.sourceforge.net and cc yan@seiner.com
UTF-8 mods to gletters.c (C) Yan Seiner 2004
Released under the same GPL license as gcompris
<?xml version="1.0" encoding="UTF-8"?>
<GCompris>
<Board
name="redraw_symmetrical"
name="redraw"
type="pythonboard"
section="/fun/."
mode="symmetrical"
......
/* gcompris - shapegame.c
*
* Time-stamp: <2004/02/20 00:54:46 bcoudoin>
* Time-stamp: <2004/02/28 14:06:30 bcoudoin>
*
* Copyright (C) 2000 Bruno Coudoin
*
......@@ -149,7 +149,7 @@ static Shape *create_shape(ShapeType type, char *name, char *pixmapfile, Gnom
char *targetfile, double x, double y, double l, double h, double zoomx,
double zoomy, guint position, char *soundfile);
static gboolean increment_sublevel(void);
static void create_title(char *name, double x, double y, char *justification);
static void create_title(char *name, double x, double y, GtkJustification justification);
static gint item_event_ok(GnomeCanvasItem *item, GdkEvent *event, gpointer data);
static gint item_event_edition(GnomeCanvasItem *item, GdkEvent *event, Shape *shape);
......@@ -1456,10 +1456,25 @@ add_shape_to_canvas(Shape *shape)
}
static void create_title(char *name, double x, double y, char *justification)
static void create_title(char *name, double x, double y, GtkJustification justification)
{
GnomeCanvasItem *item;
/* Shadow */
item = \
gnome_canvas_item_new (GNOME_CANVAS_GROUP(shape_root_item),
gnome_canvas_text_get_type (),
"text", name,
"font", gcompris_skin_font_board_medium,
"x", x + 1,
"y", y + 1,
"anchor", GTK_ANCHOR_CENTER,
"justification", justification,
"fill_color", "black",
NULL);
gnome_canvas_item_raise_to_top(item);
item = \
gnome_canvas_item_new (GNOME_CANVAS_GROUP(shape_root_item),
gnome_canvas_text_get_type (),
......@@ -1518,6 +1533,7 @@ static void
add_xml_shape_to_data(xmlDocPtr doc, xmlNodePtr xmlnode, GNode * child)
{
char *name, *cx, *cy, *cd, *czoomx, *czoomy, *cposition, *ctype, *justification;
GtkJustification justification_gtk;
char *pixmapfile = NULL;
char *targetfile = NULL;
char *soundfile = NULL;
......@@ -1632,8 +1648,19 @@ add_xml_shape_to_data(xmlDocPtr doc, xmlNodePtr xmlnode, GNode * child)
type = SHAPE_COLORLIST;
/* get the JUSTIFICATION of the Title */
justification_gtk = GTK_JUSTIFY_CENTER; /* GTK_JUSTIFICATION_CENTER is default */
justification = xmlGetProp(xmlnode,"justification");
if(!justification) justification = "GTK_JUSTIFICATION_CENTER"; /* GTK_JUSTIFICATION_CENTER is default */
if(justification) {
if (strcmp(justification, "GTK_JUSTIFY_LEFT") == 0) {
justification_gtk = GTK_JUSTIFY_LEFT;
} else if (strcmp(justification, "GTK_JUSTIFY_RIGHT") == 0) {
justification_gtk = GTK_JUSTIFY_RIGHT;
} else if (strcmp(justification, "GTK_JUSTIFY_CENTER") == 0) {
justification_gtk = GTK_JUSTIFY_CENTER;
} else if (strcmp(justification, "GTK_JUSTIFY_FILL") == 0) {
justification_gtk = GTK_JUSTIFY_FILL;
}
}
/* get the name of the shape */
name = NULL;
......@@ -1669,7 +1696,7 @@ add_xml_shape_to_data(xmlDocPtr doc, xmlNodePtr xmlnode, GNode * child)
}
else if (g_strcasecmp(xmlnode->name,"Title")==0)
{
create_title(name, x, y, justification);
create_title(name, x, y, justification_gtk);
}
}
......
/* gcompris - help.c
*
* Time-stamp: <2003/07/20 18:57:49 bcoudoin>
* Time-stamp: <2004/02/28 16:03:20 bcoudoin>
*
* Copyright (C) 2000 Bruno Coudoin
*
......@@ -35,11 +35,13 @@
static gint item_event_help(GnomeCanvasItem *item, GdkEvent *event, gpointer data);
static void select_item(GnomeCanvasItem *item, GnomeCanvasItem *item_text);
static void set_content(char *text);
static gboolean help_displayed = FALSE;
static GnomeCanvasItem *rootitem = NULL;
static GnomeCanvasItem *item_content = NULL;
static GnomeCanvasItem *item_content_shadow = NULL;
static gchar *prerequisite = NULL;
static gchar *goal = NULL;
......@@ -309,16 +311,35 @@ void gcompris_help_start (GcomprisBoard *gcomprisBoard)
}
y_start += 5;
item_content_shadow = gnome_canvas_item_new (GNOME_CANVAS_GROUP(rootitem),
gnome_canvas_rich_text_get_type (),
"x", (double) x_start + 45 + 1,
"y", (double) y_start + 1,
"width", 620.0,
"height", 400.0,
"anchor", GTK_ANCHOR_NW,
"grow_height", FALSE,
"cursor_visible", FALSE,
"cursor_blink", FALSE,
"editable", FALSE,
NULL);
item_content = gnome_canvas_item_new (GNOME_CANVAS_GROUP(rootitem),
gnome_canvas_text_get_type (),
"text", text_to_display,
"font", gcompris_skin_font_content,
gnome_canvas_rich_text_get_type (),
"x", (double) x_start + 45,
"y", (double) y_start,
"width", 620.0,
"height", 400.0,
"anchor", GTK_ANCHOR_NW,
"fill_color_rgba", gcompris_skin_color_content,
"grow_height", FALSE,
"cursor_visible", FALSE,
"cursor_blink", FALSE,
"editable", FALSE,
NULL);
set_content(text_to_display);
// OK
pixmap = gcompris_load_skin_pixmap("button_large.png");
......@@ -419,6 +440,42 @@ static void select_item(GnomeCanvasItem *item, GnomeCanvasItem *item_text)
item_selected_text = item_text;
}
/* Apply the style to the given RichText item */
static void set_content(gchar *text) {
GtkTextIter iter_start, iter_end;
GtkTextBuffer *buffer;
GtkTextTag *txt_tag;
gnome_canvas_item_set(item_content,
"text", text,
NULL);
buffer = gnome_canvas_rich_text_get_buffer(GNOME_CANVAS_RICH_TEXT(item_content));
txt_tag = gtk_text_buffer_create_tag(buffer, NULL,
"foreground", "black",
"font", "Sans 10",
NULL);
gtk_text_buffer_get_end_iter(buffer, &iter_end);
gtk_text_buffer_get_start_iter(buffer, &iter_start);
gtk_text_buffer_apply_tag(buffer, txt_tag, &iter_start, &iter_end);
gnome_canvas_item_set(item_content_shadow,
"text", text,
NULL);
buffer = gnome_canvas_rich_text_get_buffer(GNOME_CANVAS_RICH_TEXT(item_content));
txt_tag = gtk_text_buffer_create_tag(buffer, NULL,
"foreground", "blue",
"font", "Sans 10",
NULL);
gtk_text_buffer_get_end_iter(buffer, &iter_end);
gtk_text_buffer_get_start_iter(buffer, &iter_start);
gtk_text_buffer_apply_tag(buffer, txt_tag, &iter_start, &iter_end);
}
/* Callback for the bar operations */
static gint
item_event_help(GnomeCanvasItem *item, GdkEvent *event, gpointer data)
......@@ -438,34 +495,22 @@ item_event_help(GnomeCanvasItem *item, GdkEvent *event, gpointer data)
else if(!strcmp((char *)data, "prerequisite"))
{
select_item(item_prerequisite, item_prerequisite_text);
gnome_canvas_item_set(item_content,
"text", prerequisite,
NULL);
set_content(prerequisite);
}
else if(!strcmp((char *)data, "goal"))
{
select_item(item_goal, item_goal_text);
gnome_canvas_item_set(item_content,
"text", goal,
NULL);
set_content(goal);
}
else if(!strcmp((char *)data, "manual"))
{
select_item(item_manual, item_manual_text);
gnome_canvas_item_set(item_content,
"text", manual,
NULL);
set_content(manual);
}
else if(!strcmp((char *)data, "credit"))
{
select_item(item_credit, item_credit_text);
gnome_canvas_item_set(item_content,
"text", credit,
NULL);
set_content(credit);
}
default:
break;
......
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