add infos in Modes and Secrets tabs
[neverball] / ball / st_conf.c
index 906ed79..d203242 100644 (file)
@@ -1,4 +1,4 @@
-/*   
+/*
  * Copyright (C) 2003 Robert Kooima
  *
  * NEVERBALL is  free software; you can redistribute  it and/or modify
@@ -20,6 +20,7 @@
 #include "game.h"
 #include "audio.h"
 #include "config.h"
+#include "st_shared.h"
 
 #include "st_conf.h"
 #include "st_title.h"
@@ -76,7 +77,7 @@ static int conf_action(int i)
         r = config_mode(0, w, h);
         goto_state(&st_conf);
         break;
-        
+
     case CONF_TEXHI:
         goto_state(&st_null);
         config_set_d(CONFIG_TEXTURES, 1);
@@ -158,18 +159,18 @@ static int conf_action(int i)
     case CONF_BACK:
         goto_state(&st_title);
         break;
-       
+
     case CONF_LANG:
         goto_state(&st_lang);
         break;
-       
+
     case CONF_RESOL:
         goto_state(&st_resol);
         break;
 
     case CONF_PLAYER:
-       goto_name(&st_conf, &st_conf);
-       break;
+        goto_name(&st_conf, &st_conf);
+        break;
 
     default:
         if (100 <= i && i <= 110)
@@ -229,17 +230,18 @@ static int conf_enter(void)
 
             /* Add mode selectors only for existing modes. */
 
-           if ((kd = gui_harray(jd)))
+            if ((kd = gui_harray(jd)))
             {
                 gui_state(kd, _("No"), GUI_SML, CONF_WIN, (f == 0));
                 gui_state(kd, _("Yes"),  GUI_SML, CONF_FULL, (f == 1));
             }
-           
-           {
-               static char msg[20];
-               sprintf(msg, "%d x %d", config_get_d(CONFIG_WIDTH), config_get_d(CONFIG_HEIGHT));
-               gui_state(jd, msg, GUI_SML, CONF_RESOL, 0);
-           }
+
+            {
+                static char msg[20];
+                sprintf(msg, "%d x %d", config_get_d(CONFIG_WIDTH),
+                        config_get_d(CONFIG_HEIGHT));
+                gui_state(jd, msg, GUI_SML, CONF_RESOL, 0);
+            }
 
             if ((kd = gui_harray(jd)))
             {
@@ -293,7 +295,7 @@ static int conf_enter(void)
             if ((kd = gui_harray(jd)))
             {
                 /* A series of empty buttons forms the music volume control. */
+
                 music_id[10] = gui_state(kd, NULL, GUI_SML, 210, (m == 10));
                 music_id[ 9] = gui_state(kd, NULL, GUI_SML, 209, (m ==  9));
                 music_id[ 8] = gui_state(kd, NULL, GUI_SML, 208, (m ==  8));
@@ -306,8 +308,9 @@ static int conf_enter(void)
                 music_id[ 1] = gui_state(kd, NULL, GUI_SML, 201, (m ==  1));
                 music_id[ 0] = gui_state(kd, NULL, GUI_SML, 200, (m ==  0));
             }
-           gui_state(jd, _(language_get_name(language_from_code(config_simple_get_s(CONFIG_LANG)))), GUI_SML, CONF_LANG, 0);
-           gui_state(jd, config_simple_get_s(CONFIG_PLAYER), GUI_SML, CONF_PLAYER, 0);
+            gui_state(jd, _(language_get_name(language_from_code(config_simple_get_s(CONFIG_LANG)))), GUI_SML, CONF_LANG, 0);
+            gui_state(jd, config_simple_get_s(CONFIG_PLAYER), GUI_SML,
+                      CONF_PLAYER, 0);
         }
         if ((jd = gui_vstack(id)))
         {
@@ -355,32 +358,6 @@ static void conf_paint(int id, float st)
     gui_paint(id);
 }
 
-static void conf_timer(int id, float dt)
-{
-    gui_timer(id, dt);
-    audio_timer(dt);
-}
-
-static void conf_point(int id, int x, int y, int dx, int dy)
-{
-    gui_pulse(gui_point(id, x, y), 1.2f);
-}
-
-static void conf_stick(int id, int a, int v)
-{
-    if (config_tst_d(CONFIG_JOYSTICK_AXIS_X, a))
-        gui_pulse(gui_stick(id, v, 0), 1.2f);
-    if (config_tst_d(CONFIG_JOYSTICK_AXIS_Y, a))
-        gui_pulse(gui_stick(id, 0, v), 1.2f);
-}
-
-static int conf_click(int b, int d)
-{
-    if (b < 0 && d == 1)
-        return conf_action(gui_token(gui_click()));
-    return 1;
-}
-
 static int conf_buttn(int b, int d)
 {
     if (d)
@@ -402,7 +379,7 @@ static int null_enter(void)
     swch_free();
     jump_free();
     goal_free();
-    coin_free();
+    item_free();
     ball_free();
     shad_free();
     part_free();
@@ -417,7 +394,7 @@ static void null_leave(int id)
     part_init(GOAL_HEIGHT);
     shad_init();
     ball_init(g);
-    coin_init(g);
+    item_init(g);
     goal_init(g);
     jump_init(g);
     swch_init(g);
@@ -431,10 +408,10 @@ struct state st_conf = {
     conf_enter,
     conf_leave,
     conf_paint,
-    conf_timer,
-    conf_point,
-    conf_stick,
-    conf_click,
+    shared_timer,
+    shared_point,
+    shared_stick,
+    shared_click,
     NULL,
     conf_buttn,
     1, 0