[Tux4kids-commits] r669 - in tuxtype/branches/soc-mobin: po src
mobin-guest at alioth.debian.org
mobin-guest at alioth.debian.org
Tue Aug 26 04:18:18 UTC 2008
Author: mobin-guest
Date: 2008-08-26 04:18:17 +0000 (Tue, 26 Aug 2008)
New Revision: 669
Added:
tuxtype/branches/soc-mobin/po/as.po
tuxtype/branches/soc-mobin/po/ta.po
Modified:
tuxtype/branches/soc-mobin/po/LINGUAS
tuxtype/branches/soc-mobin/src/titlescreen.c
tuxtype/branches/soc-mobin/src/titlescreen.h
Log:
Modified: tuxtype/branches/soc-mobin/po/LINGUAS
===================================================================
--- tuxtype/branches/soc-mobin/po/LINGUAS 2008-08-23 11:52:40 UTC (rev 668)
+++ tuxtype/branches/soc-mobin/po/LINGUAS 2008-08-26 04:18:17 UTC (rev 669)
@@ -4,6 +4,7 @@
ml
ru
ar
+as
ne
nb
pt
@@ -22,5 +23,6 @@
nn
sv
sw
+ta
wo
Added: tuxtype/branches/soc-mobin/po/as.po
===================================================================
--- tuxtype/branches/soc-mobin/po/as.po (rev 0)
+++ tuxtype/branches/soc-mobin/po/as.po 2008-08-26 04:18:17 UTC (rev 669)
@@ -0,0 +1,165 @@
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Amitakhya Phukan <aphukan at redhat.com>, 2008.
+msgid ""
+msgstr ""
+"Project-Id-Version: Tux Typing 1.5.16\n"
+"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev at lists.alioth.debian.org\n"
+"POT-Creation-Date: 2008-08-13 19:23+0530\n"
+"PO-Revision-Date: 2008-08-22 12:36+0530\n"
+"Last-Translator: Amitakhya Phukan <aphukan at redhat.com>\n"
+"Language-Team: American English <kde-i18n-doc at lists.kde.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KAider 0.1\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/pause.c:286
+msgid "Sound Effects Volume"
+msgstr "ধ্বনিৰ ফলাফল উচ্চতা"
+
+#: src/pause.c:295
+msgid "Music Volume"
+msgstr "সঙ্গিতৰ ধ্বনিৰ উচ্চতা"
+
+#: src/pause.c:306
+msgid "Sound & Music Disabled"
+msgstr "ধ্বনি & সঙ্গিত নিষ্ক্ৰীয়"
+
+#: src/pause.c:316
+msgid "Paused!"
+msgstr "ৰখোৱা হ'ল!"
+
+#: src/pause.c:325
+msgid "Press escape again to return to menu"
+msgstr "তালিকালৈ ঘূৰি যাবলৈ পুনঃ escape টিপক"
+
+#: src/pause.c:334
+msgid "Press space bar to return to game"
+msgstr "খেললৈ ঘূৰি যাবলৈ space bar টিপক"
+
+#: src/playgame.c:945
+msgid "Level"
+msgstr "স্তৰ"
+
+#: src/playgame.c:946
+msgid "Lives"
+msgstr "জীৱন"
+
+#: src/playgame.c:947
+msgid "Fish"
+msgstr "Fish"
+
+#: src/playgame.c:949 src/titlescreen.c:74
+msgid "Easy"
+msgstr "সহজ"
+
+#: src/playgame.c:950 src/titlescreen.c:75
+msgid "Medium"
+msgstr "মাধ্যম"
+
+#: src/playgame.c:951 src/titlescreen.c:76
+msgid "Hard"
+msgstr "কঠোৰ"
+
+#: src/playgame.c:952 src/titlescreen.c:75
+msgid "Practice"
+msgstr "অভ্যাস"
+
+#: src/playgame.c:963
+msgid "Congratulations"
+msgstr "অভিনন্দন"
+
+#: src/playgame.c:967
+msgid "Oh No!"
+msgstr "অঃ নহয়!"
+
+#: src/practice.c:239
+msgid "Great!"
+msgstr "বঢ়িয়া!"
+
+#: src/practice.c:589
+msgid "Next letter "
+msgstr "পিছৰ আখৰ"
+
+#: src/titlescreen.c:74
+msgid "Fish Cascade"
+msgstr "Fish Cascade"
+
+#: src/titlescreen.c:74
+msgid "Space Cadet"
+msgstr "Space Cadet"
+
+#: src/titlescreen.c:74
+msgid "Edit Word Lists"
+msgstr "শব্দৰ তালিকা সম্পাদন কৰক"
+
+#: src/titlescreen.c:75
+msgid "Comet Zap"
+msgstr "Comet Zap"
+
+#: src/titlescreen.c:75
+msgid "Pilot"
+msgstr "পাইলট"
+
+#: src/titlescreen.c:76
+msgid "Lessons"
+msgstr "পাঠ"
+
+#: src/titlescreen.c:76
+msgid "Ace"
+msgstr "Ace"
+
+#: src/titlescreen.c:76
+msgid "Project Info"
+msgstr "পৰিকল্পনাৰ তথ্য"
+
+#: src/titlescreen.c:77
+msgid "Options"
+msgstr "বিকল্প"
+
+#: src/titlescreen.c:77
+msgid "Instructions"
+msgstr "নিৰ্দেশ"
+
+#: src/titlescreen.c:77
+msgid "Commander"
+msgstr "কামান্ডাৰ"
+
+#: src/titlescreen.c:77
+msgid "Setup Language"
+msgstr "প্ৰতিষ্ঠাৰ ভাষা"
+
+#: src/titlescreen.c:78
+msgid "Quit"
+msgstr "বাহিৰ হওক"
+
+#: src/titlescreen.c:78
+msgid "Main Menu"
+msgstr "মূখ্য তালিকা"
+
+#: src/titlescreen.c:1156
+msgid "Work In Progress!"
+msgstr "কাম চলি আছে!"
+
+#: src/titlescreen.c:1157
+msgid "This feature is not ready yet"
+msgstr "এই গুণ এতিয়া প্ৰস্তুত নহয়"
+
+#: src/titlescreen.c:1158
+msgid "Discuss the future of TuxTyping at"
+msgstr "TuxTyping ৰ গুণৰ আলোচনা ইয়াত কৰক"
+
+msgid "Short Words"
+msgstr "সৰু শব্দ"
+
+msgid "Medium Words"
+msgstr "মধ্যম শব্দ"
+
+msgid "Long Words"
+msgstr "দীঘল শব্দ"
+
+msgid "Alphabet"
+msgstr "বৰ্ণমালা"
+
Added: tuxtype/branches/soc-mobin/po/ta.po
===================================================================
--- tuxtype/branches/soc-mobin/po/ta.po (rev 0)
+++ tuxtype/branches/soc-mobin/po/ta.po 2008-08-26 04:18:17 UTC (rev 669)
@@ -0,0 +1,165 @@
+# translation of tuxtype.po to Tamil
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: tuxtype\n"
+"Report-Msgid-Bugs-To: tux4kids-tuxtype-dev at lists.alioth.debian.org\n"
+"POT-Creation-Date: 2008-08-13 19:23+0530\n"
+"PO-Revision-Date: 2008-08-22 12:41+0530\n"
+"Last-Translator: \n"
+"Language-Team: <en at li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#: src/pause.c:286
+msgid "Sound Effects Volume"
+msgstr "ஒலி விளைவுகளின் ஒலிஅளவு"
+
+#: src/pause.c:295
+msgid "Music Volume"
+msgstr "இசை ஒலிஅளவு"
+
+#: src/pause.c:306
+msgid "Sound & Music Disabled"
+msgstr "ஒலி & இசை செயல்நீக்கப்பட்டது"
+
+#: src/pause.c:316
+msgid "Paused!"
+msgstr "இடைநிறுத்தப்பட்டது!"
+
+#: src/pause.c:325
+msgid "Press escape again to return to menu"
+msgstr "மெனுவுக்கு செல்ல மீண்டும் escape ஐ அழுத்தவும்"
+
+#: src/pause.c:334
+msgid "Press space bar to return to game"
+msgstr "விளையாட்டுக்கு செல்ல space barஐ அழுத்தவும்"
+
+#: src/playgame.c:945
+msgid "Level"
+msgstr "நிலை"
+
+#: src/playgame.c:946
+msgid "Lives"
+msgstr "லைவ்ஸ்"
+
+#: src/playgame.c:947
+msgid "Fish"
+msgstr "ஃபிஷ்"
+
+#: src/playgame.c:949 src/titlescreen.c:74
+msgid "Easy"
+msgstr "எளியது"
+
+#: src/playgame.c:950 src/titlescreen.c:75
+msgid "Medium"
+msgstr "நடுத்தரம்"
+
+#: src/playgame.c:951 src/titlescreen.c:76
+msgid "Hard"
+msgstr "கடினம்"
+
+#: src/playgame.c:952 src/titlescreen.c:75
+msgid "Practice"
+msgstr "பயிற்சி"
+
+#: src/playgame.c:963
+msgid "Congratulations"
+msgstr "வாழ்த்துக்கள்"
+
+#: src/playgame.c:967
+msgid "Oh No!"
+msgstr "இல்லை!"
+
+#: src/practice.c:239
+msgid "Great!"
+msgstr "சபாஷ்!"
+
+#: src/practice.c:589
+msgid "Next letter "
+msgstr "அடுத்த எழுத்து"
+
+#: src/titlescreen.c:74
+msgid "Fish Cascade"
+msgstr "ஃபிஷ் கேஸ்கேட்"
+
+#: src/titlescreen.c:74
+msgid "Space Cadet"
+msgstr "ஸ்பேஸ் கேடெட்"
+
+#: src/titlescreen.c:74
+msgid "Edit Word Lists"
+msgstr "சொல் பட்டியல்களை திருத்து"
+
+#: src/titlescreen.c:75
+msgid "Comet Zap"
+msgstr "கமெட் ஸெப்"
+
+#: src/titlescreen.c:75
+msgid "Pilot"
+msgstr "பைலட்"
+
+#: src/titlescreen.c:76
+msgid "Lessons"
+msgstr "பாடங்கள்"
+
+#: src/titlescreen.c:76
+msgid "Ace"
+msgstr "ஏஸ்"
+
+#: src/titlescreen.c:76
+msgid "Project Info"
+msgstr "திட்ட விவரம்"
+
+#: src/titlescreen.c:77
+msgid "Options"
+msgstr "விருப்பங்கள்"
+
+#: src/titlescreen.c:77
+msgid "Instructions"
+msgstr "தகவல்கள்"
+
+#: src/titlescreen.c:77
+msgid "Commander"
+msgstr "கமெண்டர்"
+
+#: src/titlescreen.c:77
+msgid "Setup Language"
+msgstr "அமைவு மொழி"
+
+#: src/titlescreen.c:78
+msgid "Quit"
+msgstr "வெளியேறு"
+
+#: src/titlescreen.c:78
+msgid "Main Menu"
+msgstr "முதன்மை மெனு"
+
+#: src/titlescreen.c:1156
+msgid "Work In Progress!"
+msgstr "பணி நடைபெறுகிறது!"
+
+#: src/titlescreen.c:1157
+msgid "This feature is not ready yet"
+msgstr "இந்த வசதி இதுவரை இல்லை"
+
+#: src/titlescreen.c:1158
+msgid "Discuss the future of TuxTyping at"
+msgstr "TuxTyping எதிர்கால திட்டத்தை இங்கு விவாதிக்கவும்"
+
+msgid "Short Words"
+msgstr "குறைந்த சொற்கள்"
+
+msgid "Medium Words"
+msgstr "நடுத்தர சொற்கள்"
+
+msgid "Long Words"
+msgstr "நீண்ட சொற்கள்"
+
+msgid "Alphabet"
+msgstr "எழுத்து"
+
Modified: tuxtype/branches/soc-mobin/src/titlescreen.c
===================================================================
--- tuxtype/branches/soc-mobin/src/titlescreen.c 2008-08-23 11:52:40 UTC (rev 668)
+++ tuxtype/branches/soc-mobin/src/titlescreen.c 2008-08-26 04:18:17 UTC (rev 669)
@@ -59,7 +59,8 @@
/* Local function prototypes: */
static int chooseWordlist(void);
static void draw_button(int id, sprite* s);
-static void not_implemented(void);
+static void ChooseWord(char *words_file);
+static void ChooseFile(void);
static int load_media(void);
static void load_menu(void);
static void unload_media(void);
@@ -513,9 +514,9 @@
}
- if (menu_opt == NOT_CODED)
+ if (menu_opt == EDIT_WORDLIST)
{
- not_implemented();
+ ChooseFile();
redraw = 1;
}
@@ -1588,6 +1589,449 @@
}
+static void ChooseFile(void)
+{
+ SDL_Surface* titles[MAX_WORD_LISTS] = {NULL};
+ SDL_Surface* select[MAX_WORD_LISTS] = {NULL};
+ SDL_Surface *photo = NULL;
+ SDL_Surface* bkg = NULL;
+ TTF_Font* font = NULL;
+ SDL_Rect titleRects[8];
+ int stop = 0;
+ int loc = 0;
+ int old_loc = 1;
+ int themes = 0;
+ int i;
+ unsigned char fn[FNLEN];
+ unsigned char wordTypes[MAX_WORD_LISTS][FNLEN];
+ unsigned char fileNames[MAX_WORD_LISTS][FNLEN];
+ int old_use_english;
+ char old_theme_path[FNLEN];
+ FILE *fp;
+
+ DIR* themesDir = NULL;
+ struct dirent* themesFile = NULL;
+
+ /* save previous settings in case we back out: */
+ old_use_english = settings.use_english;
+ strncpy(old_theme_path, settings.theme_data_path, FNLEN - 1);
+
+ sprintf(fn , "%s/words", settings.theme_data_path);
+
+ themesDir = opendir(fn);
+
+ if (!themesDir)
+ {
+ fprintf(stderr, "Choosefile() - cannot open themes directory!");
+ return;
+ }
+
+ do
+ {
+ themesFile = readdir(themesDir);
+ if (!themesFile)
+ break;
+
+ /* we ignore any hidden file and CVS */
+
+ if (themesFile->d_name[0] == '.')
+ continue;
+
+ if (strcmp("CVS", themesFile->d_name)==0)
+ continue;
+
+
+ sprintf(fn, "%s/words/%s", settings.theme_data_path, themesFile->d_name);
+
+
+ /* CheckFile() returns 2 if dir, 1 if file, 0 if neither: */
+ if (CheckFile(fn) == 1) {
+ fp=fopen(fn,"r");
+ /* HACK: we should get the names from file :) */
+ fscanf(fp, "%[^\n]\n", wordTypes[themes]);
+ /* Make sure theme name is capitalized: */
+ wordTypes[themes][0] = toupper(wordTypes[themes][0]);
+ fclose(fp);
+ strncpy( fileNames[themes++], themesFile->d_name, FNLEN-1 );
+
+ }
+ } while (1);
+
+ closedir(themesDir);
+
+ settings.use_english = 1;
+ // HACK: is font empty now???
+ font = LoadFont(settings.theme_font_name, MENU_FONT_SIZE);
+
+
+ for (i = 0; i<themes; i++) {
+ titles[i] = BlackOutline( wordTypes[i], font, &white );
+ select[i] = BlackOutline( wordTypes[i], font, &yellow);
+ }
+
+
+ TTF_CloseFont(font);
+ font = NULL;
+
+ settings.use_english = old_use_english;
+
+ bkg = LoadImage("main_bkg.png", IMG_REGULAR);
+
+
+ /* set initial rect sizes */
+ titleRects[0].y = 150;
+ titleRects[0].w = titleRects[0].h = titleRects[0].x = 0;
+ for (i = 1; i<8; i++) {
+ titleRects[i].y = titleRects[i-1].y + 50;
+ titleRects[i].w = titleRects[i].h = titleRects[i].x = 0;
+ }
+
+
+ while (!stop) {
+ while (SDL_PollEvent(&event))
+ switch (event.type) {
+ case SDL_QUIT:
+ exit(0);
+ break;
+ case SDL_MOUSEMOTION:
+ for (i=0; (i<8) && (loc-(loc%8)+i<themes); i++)
+ if (inRect( titleRects[i], event.motion.x, event.motion.y )) {
+ loc = loc-(loc%8)+i;
+ break;
+ }
+
+ break;
+ case SDL_MOUSEBUTTONDOWN:
+
+ for (i=0; (i<8) && (loc-(loc%8)+i<themes); i++)
+ if (inRect(titleRects[i], event.button.x, event.button.y)) {
+ loc = loc-(loc%8)+i;
+ ChooseWord(fileNames[loc]);
+ break;
+ }
+ break;
+ case SDL_KEYDOWN:
+ if (event.key.keysym.sym == SDLK_ESCAPE) {
+ settings.use_english = old_use_english;
+ strncpy(settings.theme_data_path, old_theme_path, FNLEN - 1);
+ stop = 1;
+ break;
+ }
+ if (event.key.keysym.sym == SDLK_RETURN) {
+ ChooseWord(fileNames[loc]);
+ loc=0;
+ break;
+
+ }
+
+ if ((event.key.keysym.sym == SDLK_LEFT) || (event.key.keysym.sym == SDLK_PAGEUP)) {
+ if (loc-(loc%8)-8 >= 0)
+ loc=loc-(loc%8)-8;
+ }
+
+ if ((event.key.keysym.sym == SDLK_RIGHT) || (event.key.keysym.sym == SDLK_PAGEDOWN)) {
+ if (loc-(loc%8)+8 < themes)
+ loc=(loc-(loc%8)+8);
+ }
+
+ if (event.key.keysym.sym == SDLK_UP) {
+ if (loc > 0)
+ loc--;
+ }
+
+ if (event.key.keysym.sym == SDLK_DOWN) {
+ if (loc+1<themes)
+ loc++;
+ }
+ }
+
+ if (old_loc != loc) {
+ int start;
+
+ SDL_BlitSurface( bkg, NULL, screen, NULL );
+
+ //if (loc) SetupPaths(fileNames[loc]); else SetupPaths(NULL);
+
+ start = loc - (loc % 8);
+ for (i = start; i<MIN(start+8,themes); i++) {
+ titleRects[i%8].x = 320 - (titles[i]->w/2);
+ if (i == loc)
+ SDL_BlitSurface(select[loc], NULL, screen, &titleRects[i%8]);
+ else
+ SDL_BlitSurface(titles[i], NULL, screen, &titleRects[i%8]);
+ }
+
+ SDL_UpdateRect(screen, 0, 0, 0 ,0);
+ }
+ SDL_Delay(40);
+ old_loc = loc;
+ }
+
+ /* --- clear graphics before quitting --- */
+
+ for (i = 0; i<themes; i++)
+ {
+ SDL_FreeSurface(titles[i]);
+ SDL_FreeSurface(select[i]);
+ }
+
+
+ SDL_FreeSurface(bkg);
+
+ bkg = NULL; /* the other pointers are going out of scope so we don't */
+ /* have to worry about setting them to NULL */
+}
+
+
+static void ChooseWord(char *words_file)
+{
+ SDL_Surface* titles[MAX_WORD_LISTS] = {NULL};
+ SDL_Surface* select[MAX_WORD_LISTS] = {NULL};
+ SDL_Surface* left = NULL, *right = NULL;
+ SDL_Rect leftRect, rightRect;
+ SDL_Surface *photo = NULL;
+ SDL_Surface* bkg = NULL;
+ TTF_Font* font = NULL;
+ SDL_Rect worldRect, photoRect;
+ SDL_Rect titleRects[8];
+ int stop = 0;
+ int loc = 0;
+ int old_loc = 1;
+
+ FILE *fp;
+
+ int start,themes = 0;
+ int i,len;
+ unsigned char fn[FNLEN];
+ unsigned char str[FNLEN];
+ unsigned char editWordW[MAX_WORD_LISTS][FNLEN];
+ unsigned char editWordY[MAX_WORD_LISTS][FNLEN];
+
+ wchar_t temp[FNLEN];
+
+ int old_use_english;
+ char old_theme_path[FNLEN];
+
+
+
+ /* save previous settings in case we back out: */
+ old_use_english = settings.use_english;
+ strncpy(old_theme_path, settings.theme_data_path, FNLEN - 1);
+
+ sprintf(fn , "%s/words/%s", settings.theme_data_path,words_file);
+
+ fp=fopen(fn,"r");
+ fscanf(fp, "%[^\n]\n", str);
+
+ while(!feof(fp))
+ {
+ /* HACK: we should get the strings from file :) */
+ fscanf(fp, "%[^\n]\n", editWordW[themes]);
+ strcpy(editWordY[themes++],editWordW[themes]);
+ }
+
+ fclose(fp);
+
+ settings.use_english = 1;
+ // HACK: is font empty now???
+ font = LoadFont(settings.theme_font_name, MENU_FONT_SIZE);
+
+ for (i = 0; i<themes; i++) {
+ titles[i] = BlackOutline( editWordW[i], font, &white );
+ strcat(editWordY[i],"|");
+ select[i] = BlackOutline( editWordY[i], font, &yellow);
+ }
+
+ TTF_CloseFont(font);
+ font = NULL;
+
+ settings.use_english = old_use_english;
+ strncpy(settings.theme_data_path, old_theme_path, FNLEN - 1);
+
+ bkg = LoadImage("main_bkg.png", IMG_REGULAR);
+
+ left = LoadImage("left.png", IMG_ALPHA);
+ leftRect.w = left->w; leftRect.h = left->h;
+ leftRect.x = 320 - 100 - (leftRect.w/2); leftRect.y = 430;
+
+ right = LoadImage("right.png", IMG_ALPHA);
+ rightRect.w = right->w; rightRect.h = right->h;
+ rightRect.x = 320 + 100 - (rightRect.w/2); rightRect.y = 430;
+
+ /* set initial rect sizes */
+ titleRects[0].y = 30;
+ titleRects[0].w = titleRects[0].h = titleRects[0].x = 0;
+ for (i = 1; i<8; i++) {
+ titleRects[i].y = titleRects[i-1].y + 50;
+ titleRects[i].w = titleRects[i].h = titleRects[i].x = 0;
+ }
+
+
+ while (!stop) {
+ while (SDL_PollEvent(&event))
+ switch (event.type) {
+ case SDL_QUIT:
+ exit(0);
+ break;
+ case SDL_MOUSEMOTION:
+ if (inRect( leftRect, event.button.x, event.button.y ))
+ if (loc-(loc%8)-8 >= 0) {
+ loc=loc-(loc%8)-8;
+ break;
+ }
+ if (inRect( rightRect, event.button.x, event.button.y ))
+ if (loc-(loc%8)+8 < themes) {
+ loc=loc-(loc%8)+8;
+ break;
+ }
+ for (i=0; (i<8) && (loc-(loc%8)+i<themes); i++)
+ if (inRect( titleRects[i], event.motion.x, event.motion.y )) {
+ loc = loc-(loc%8)+i;
+ break;
+ }
+
+ break;
+
+ case SDL_KEYDOWN:
+ i=1;
+ if (event.key.keysym.sym == SDLK_BACKSPACE) {
+ font = LoadFont(settings.theme_font_name, MENU_FONT_SIZE);
+
+ len=ConvertFromUTF8(temp,editWordW[loc]);
+ temp[len-1]=temp[len];
+ len=ConvertToUTF8(temp,editWordW[loc]);
+ titles[loc] = BlackOutline(editWordW[loc], font, &white );
+ len=ConvertFromUTF8(temp,editWordY[loc]);
+ temp[len-2]=temp[len-1];
+ temp[len-1]=temp[len];
+ len=ConvertToUTF8(temp,editWordY[loc]);
+ select[loc] = BlackOutline(editWordY[loc], font, &yellow);
+ TTF_CloseFont(font);
+ font = NULL;
+ break;
+ }
+
+ if (event.key.keysym.sym == SDLK_ESCAPE) {
+ settings.use_english = old_use_english;
+ strncpy(settings.theme_data_path, old_theme_path, FNLEN - 1);
+ stop = 1;
+ break;
+ }
+
+ if ((event.key.keysym.sym == SDLK_LEFT) || (event.key.keysym.sym == SDLK_PAGEUP)) {
+ if (loc-(loc%8)-8 >= 0)
+ loc=loc-(loc%8)-8;
+ break;
+ }
+
+ if ((event.key.keysym.sym == SDLK_RIGHT) || (event.key.keysym.sym == SDLK_PAGEDOWN)) {
+ if (loc-(loc%8)+8 < themes)
+ loc=(loc-(loc%8)+8);
+ break;
+ }
+
+
+ if (event.key.keysym.sym == SDLK_UP) {
+ if (loc > 0)
+ loc--;
+ break;
+ }
+
+ if (event.key.keysym.sym == SDLK_DOWN) {
+ if (loc+1<themes)
+ loc++;
+ break;
+ }
+ switch (event.key.keysym.sym){
+ case SDLK_RALT:
+ case SDLK_LALT:
+ case SDLK_RSHIFT:
+ case SDLK_LSHIFT:
+ case SDLK_RCTRL:
+ case SDLK_LCTRL:i=0;
+ break;
+ }
+ if(i){
+
+ font = LoadFont(settings.theme_font_name, MENU_FONT_SIZE);
+
+ len=ConvertFromUTF8(temp,editWordW[loc]);
+ temp[len]=event.key.keysym.unicode;
+ temp[len+1]=0;
+ ConvertToUTF8(temp,editWordW[loc]);
+ titles[loc] = BlackOutline(editWordW[loc], font, &white );
+
+ len=ConvertFromUTF8(temp,editWordY[loc]);
+ temp[len+1]=0;
+ temp[len]=temp[len-1];
+ temp[len-1]=event.key.keysym.unicode;
+ ConvertToUTF8(temp,editWordY[loc]);
+ select[loc] = BlackOutline(editWordY[loc], font, &yellow);
+ TTF_CloseFont(font);
+ font = NULL;
+ i=0;
+ break;
+ }
+ }
+ if(!stop){
+ SDL_BlitSurface( bkg, NULL, screen, NULL );
+
+// if (loc) SetupPaths(fileNames[loc]); else SetupPaths(NULL);
+
+ start = loc - (loc % 8);
+ for (i = start; i<MIN(start+8,themes); i++) {
+ titleRects[i%8].x = 320 - (titles[i]->w/2);
+ if (i == loc)
+ SDL_BlitSurface(select[loc], NULL, screen, &titleRects[i%8]);
+ else
+ SDL_BlitSurface(titles[i], NULL, screen, &titleRects[i%8]);
+ }
+
+ /* --- draw buttons --- */
+
+ if (start>0)
+ SDL_BlitSurface( left, NULL, screen, &leftRect );
+
+ if (start+8<themes)
+ SDL_BlitSurface( right, NULL, screen, &rightRect );
+
+ SDL_UpdateRect(screen, 0, 0, 0 ,0);
+ }
+ //SDL_Delay(40);
+ old_loc = loc;
+ }
+
+
+ fp=fopen(fn,"w");
+ fseek(fp,0,SEEK_SET);
+ fprintf(fp, "%s\n", str);
+ i=0;
+
+ while(i<themes)
+ {
+ fprintf(fp, "%s\n", editWordW[i++]);
+ i++;
+ }
+
+ fclose(fp);
+
+ /* --- clear graphics before quitting --- */
+
+ for (i = 0; i<themes; i++)
+ {
+ SDL_FreeSurface(titles[i]);
+ SDL_FreeSurface(select[i]);
+ }
+
+ SDL_FreeSurface(bkg);
+ SDL_FreeSurface(left);
+ SDL_FreeSurface(right);
+ bkg = NULL; /* the other pointers are going out of scope so we don't */
+ /* have to worry about setting them to NULL */
+}
+
+
+
Modified: tuxtype/branches/soc-mobin/src/titlescreen.h
===================================================================
--- tuxtype/branches/soc-mobin/src/titlescreen.h 2008-08-23 11:52:40 UTC (rev 668)
+++ tuxtype/branches/soc-mobin/src/titlescreen.h 2008-08-26 04:18:17 UTC (rev 669)
@@ -12,7 +12,7 @@
/* --- define menu structure --- */
/* (these values are all in the Game_Type enum in globals.h) */
const int menu_item[][6]= {{0, 0, 0, 0, 0},
- {0, CASCADE, LEVEL1, LEVEL1, NOT_CODED },
+ {0, CASCADE, LEVEL1, LEVEL1, EDIT_WORDLIST },
{0, LASER, LEVEL2, LEVEL2, FREETYPE },
{0, LESSONS, LEVEL3, LEVEL3, PROJECT_INFO },
{0, OPTIONS, INSTRUCT, LEVEL4, SET_LANGUAGE},
More information about the Tux4kids-commits
mailing list