diff options
| author | Dusan Durech <dusan@debian.debian> | 2009-04-23 19:17:56 +0200 |
|---|---|---|
| committer | Dusan Durech <dusan@debian.debian> | 2009-04-23 19:22:10 +0200 |
| commit | 9866f48c8716996cd67ccb008471f73f8fc1baa6 (patch) | |
| tree | 5e4a11273ab1c82b06090d97c94a6a18e8fcfe3f /src/screen | |
| parent | 112e8071a8d96f9251ef265e31bd11a4662a893d (diff) | |
support statusbar (need write label)| fix kiks with keycontrol.conf| fix memory leak in font.c
Diffstat (limited to 'src/screen')
| -rw-r--r-- | src/screen/setting.c | 24 | ||||
| -rw-r--r-- | src/screen/settingKeys.c | 6 |
2 files changed, 28 insertions, 2 deletions
diff --git a/src/screen/setting.c b/src/screen/setting.c index 8403056..34e067a 100644 --- a/src/screen/setting.c +++ b/src/screen/setting.c @@ -35,6 +35,7 @@ #include "widget_textfield.h" #include "widget_check.h" #include "widget_select.h" +#include "widget_statusbar.h" static widget_t *image_backgorund; @@ -77,6 +78,8 @@ static widget_t *textfield_name_player2; static widget_t *check_ai; +static widget_t *statusbar; + static textFile_t *configFile; static void hotkey_escape() @@ -145,6 +148,8 @@ void setting_draw() check_draw(check_ai); + statusbar_draw(statusbar); + button_draw(button_back); button_draw(button_keys); } @@ -175,6 +180,8 @@ void setting_event() check_event(check_ai); + statusbar_event(statusbar); + button_event(button_back); button_event(button_keys); } @@ -423,6 +430,21 @@ void setting_init() image_bonus_4x = wid_image_new(580 + WIDGET_CHECK_WIDTH, 250, image_get(IMAGE_GROUP_BASE, "panel_4x"));; image_bonus_hidden = wid_image_new(580 + WIDGET_CHECK_WIDTH, 300, image_get(IMAGE_GROUP_BASE, "panel_hidden"));; + statusbar = statusbar_new(400, 350); + statusbar_add(statusbar, check[GUN_DUAL_SIMPLE], "abc\n123\nkoniec"); + statusbar_add(statusbar, check[GUN_SCATTER], "check 1"); + statusbar_add(statusbar, check[GUN_TOMMY], "check 2"); + statusbar_add(statusbar, check[GUN_LASSER], "check 3"); + statusbar_add(statusbar, check[GUN_MINE], "check 4"); + statusbar_add(statusbar, check[GUN_BOMBBALL], "check 5"); + + statusbar_add(statusbar, check[BONUS_SPEED], "check 6"); + statusbar_add(statusbar, check[BONUS_SHOT], "check 7"); + statusbar_add(statusbar, check[BONUS_TELEPORT], "check 8"); + statusbar_add(statusbar, check[BONUS_GHOST], "check 9"); + statusbar_add(statusbar, check[BONUS_4X], "check 10"); + statusbar_add(statusbar, check[BONUS_HIDDEN], "check 11"); + screen_register( screen_new("setting", screen_startSetting, setting_event, setting_draw, stopScreenSetting)); @@ -533,6 +555,8 @@ void setting_quit() check_destroy(check[i]); } + statusbar_destroy(statusbar); + button_destroy(button_back); button_destroy(button_keys); } diff --git a/src/screen/settingKeys.c b/src/screen/settingKeys.c index 9293e9d..f4338ab 100644 --- a/src/screen/settingKeys.c +++ b/src/screen/settingKeys.c @@ -143,8 +143,10 @@ void key_table_init() keycontrolFile = text_file_new(path); - fprintf(stderr, _("I was unable to create file: %s\n"), path); - return; + if (keycontrolFile == NULL) { + fprintf(stderr, _("I was unable to create file: %s\n"), path); + return; + } } setKeytableFromConfigFile(keycontrolFile); |