2 * Copyright (C) 2003 Robert Kooima
4 * NEVERBALL is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published
6 * by the Free Software Foundation; either version 2 of the License,
7 * or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
19 #include "st_shared.h"
24 /*---------------------------------------------------------------------------*/
32 extern struct state st_help2;
33 extern struct state st_help3;
34 extern struct state st_help4;
36 static int help_action(int i)
38 audio_play(AUD_MENU, 1.0f);
42 case HELP_BACK: return goto_state(&st_title);
43 case HELP_RULE: return goto_state(&st_help);
44 case HELP_CONT: return goto_state(&st_help2);
45 case HELP_MODE: return goto_state(&st_help3);
46 case HELP_CRED: return goto_state(&st_help4);
51 static int help_button(int id, const char *text, int token, int atoken)
53 int kd = gui_state(id, text, GUI_SML, token, token == atoken);
57 static int help_menu(int id, int i)
61 if ((jd = gui_harray(id)))
63 help_button(jd, _("Credits"), HELP_CRED, i);
64 help_button(jd, _("Modes"), HELP_MODE, i);
65 help_button(jd, _("Controls"), HELP_CONT, i);
66 help_button(jd, _("Rules"), HELP_RULE, i);
67 kd = help_button(jd, _("Back"), HELP_BACK, i);
74 static int help1_enter(void)
77 "Move the mouse or joystick\\"
78 "or use keyboard arrows to\\"
79 "tilt the floor causing the\\"
82 "Roll over coins to collect\\"
83 "them. Collect coins to\\"
84 "unlock the goal and finish\\"
88 int w = config_get_d(CONFIG_WIDTH);
89 int h = config_get_d(CONFIG_HEIGHT);
93 if ((id = gui_vstack(0)))
95 help_menu(id, HELP_RULE);
97 if ((jd = gui_hstack(id)))
99 gui_image(jd, "", 6 * w / 16, 6 * h / 16);
101 gui_multi(jd, s0, GUI_SML, GUI_ALL, gui_wht, gui_wht);
103 if ((jd = gui_hstack(id)))
105 gui_multi(jd, s1, GUI_SML, GUI_ALL, gui_wht, gui_wht);
107 gui_image(jd, "", 6 * w / 16, 6 * h / 16);
109 gui_layout(id, 0, +1);
114 static int help2_enter(void)
116 const char *s4 = _("Left and right mouse buttons rotate the view.");
117 const char *s5 = _("Hold Shift for faster view rotation.");
118 const char *s6 = _("Pause / Release Pointer");
119 const char *s7 = _("Exit / Cancel Menu");
120 const char *s8 = _("Chase View");
121 const char *s9 = _("Lazy View");
122 const char *sA = _("Manual View");
123 const char *sB = _("Show FPS");
124 const char *sC = _("Screenshot");
125 const char *sD = _("Toggle Fullscreen");
127 const char *k0 = _("Spacebar");
128 const char *k1 = _("Escape");
129 const char *k2 = SDL_GetKeyName(config_get_d(CONFIG_KEY_CAMERA_1));
130 const char *k3 = SDL_GetKeyName(config_get_d(CONFIG_KEY_CAMERA_2));
131 const char *k4 = SDL_GetKeyName(config_get_d(CONFIG_KEY_CAMERA_3));
132 const char *k5 = SDL_GetKeyName(SDLK_F9);
133 const char *k6 = SDL_GetKeyName(SDLK_F10);
134 const char *k7 = SDL_GetKeyName(SDLK_F11);
138 if ((id = gui_vstack(0)))
140 help_menu(id, HELP_CONT);
142 if ((jd = gui_harray(id)))
144 gui_label(jd, s6, GUI_SML, GUI_NE, gui_wht, gui_wht);
145 gui_label(jd, k0, GUI_SML, GUI_NW, gui_yel, gui_yel);
147 if ((jd = gui_harray(id)))
149 gui_label(jd, s7, GUI_SML, 0, gui_wht, gui_wht);
150 gui_label(jd, k1, GUI_SML, 0, gui_yel, gui_yel);
152 if ((jd = gui_harray(id)))
154 gui_label(jd, s8, GUI_SML, 0, gui_wht, gui_wht);
155 gui_label(jd, k2, GUI_SML, 0, gui_yel, gui_yel);
157 if ((jd = gui_harray(id)))
159 gui_label(jd, s9, GUI_SML, 0, gui_wht, gui_wht);
160 gui_label(jd, k3, GUI_SML, 0, gui_yel, gui_yel);
162 if ((jd = gui_harray(id)))
164 gui_label(jd, sA, GUI_SML, GUI_SE, gui_wht, gui_wht);
165 gui_label(jd, k4, GUI_SML, GUI_SW, gui_yel, gui_yel);
167 if ((jd = gui_harray(id)))
169 gui_label(jd, sB, GUI_SML, GUI_SE, gui_wht, gui_wht);
170 gui_label(jd, k5, GUI_SML, GUI_SW, gui_yel, gui_yel);
172 if ((jd = gui_harray(id)))
174 gui_label(jd, sC, GUI_SML, GUI_SE, gui_wht, gui_wht);
175 gui_label(jd, k6, GUI_SML, GUI_SW, gui_yel, gui_yel);
177 if ((jd = gui_harray(id)))
179 gui_label(jd, sD, GUI_SML, GUI_SE, gui_wht, gui_wht);
180 gui_label(jd, k7, GUI_SML, GUI_SW, gui_yel, gui_yel);
184 gui_label(id, s4, GUI_SML, GUI_TOP, gui_wht, gui_wht);
185 gui_label(id, s5, GUI_SML, GUI_BOT, gui_wht, gui_wht);
187 gui_layout(id, 0, +1);
192 static int help3_enter(void)
196 if ((id = gui_vstack(0)))
198 help_menu(id, HELP_MODE);
200 if ((jd = gui_hstack(id)))
201 gui_label(jd, _("Normal"), GUI_SML, GUI_TOP, 0, 0);
203 "Finish a level before the time run out.\\"
204 "You need to collect coins in order to open the goal.",
205 GUI_SML, GUI_BOT | GUI_RGT, gui_wht, gui_wht);
209 if ((jd = gui_hstack(id)))
211 gui_label(jd, _("Practice"), GUI_SML, GUI_TOP, 0, 0);
215 "Play a level without time or coin constraint.",
216 GUI_SML, GUI_BOT | GUI_LFT, gui_wht, gui_wht);
220 if ((jd = gui_hstack(id)))
221 gui_label(jd, _("Challenge"), GUI_SML, GUI_TOP, 0, 0);
223 "Start playing from the first level of the level set.\\"
224 "You start with only four balls, do not lose them.\\"
225 "Earn an extra ball for each 100 coins collected.",
226 GUI_SML, GUI_BOT | GUI_RGT, gui_wht, gui_wht);
228 gui_layout(id, 0, +1);
234 static int help4_enter(void)
238 if ((id = gui_vstack(0)))
240 help_menu(id, HELP_CRED);
242 gui_label(id, _("LEAD MAINTAINER"), GUI_SML, GUI_TOP, 0, 0);
243 gui_label(id, "Robert Kooima <robert.kooima@gmail.com>", GUI_SML, GUI_BOT , gui_wht, gui_wht);
247 gui_label(id, _("DEVELOPERS"), GUI_SML, GUI_TOP, 0, 0);
248 gui_label(id, "Robert Kooima - Jean Privat", GUI_SML, GUI_BOT , gui_wht, gui_wht);
252 gui_label(id, _("LEVEL CONTRIBUTION"), GUI_SML, GUI_TOP, 0, 0);
253 gui_multi(id, "Pasi Kallinen - Robert Kooima\\Michael Middleton - Jānis Rūcis\\Paul Tompkins - Mehdi Yousfi-Monod", GUI_SML, GUI_BOT , gui_wht, gui_wht);
257 gui_label(id, _("TRANSLATION"), GUI_SML, GUI_TOP, 0, 0);
258 gui_multi(id, "French: Jean Privat - Mehdi Yousfi-Monod\\"
259 "German: Georg Wachter\\"
260 "Latavian: Jānis Rūcis", GUI_SML, GUI_BOT , gui_wht, gui_wht);
262 gui_layout(id, 0, +1);
268 static int help_buttn(int b, int d)
272 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b))
273 return help_action(gui_token(gui_click()));
274 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
275 return help_action(HELP_BACK);
280 /*---------------------------------------------------------------------------*/
282 struct state st_help = {
295 struct state st_help2 = {
308 struct state st_help3 = {
321 struct state st_help4 = {