return info_text;
}
+char *getElementDescriptionFilename(int element)
+{
+ char *docs_dir = options.docs_directory;
+ char *elements_subdir = "elements";
+ static char *filename = NULL;
+ char basename[MAX_FILENAME_LEN];
+
+ checked_free(filename);
+
+ /* 1st try: look for element description file for exactly this element */
+ sprintf(basename, "%s.txt", element_info[element].token_name);
+ filename = getPath3(docs_dir, elements_subdir, basename);
+ if (fileExists(filename))
+ return filename;
+
+ free(filename);
+
+ /* 2nd try: look for element description file for this element's class */
+ sprintf(basename, "%s.txt", element_info[element].class_name);
+ filename = getPath3(docs_dir, elements_subdir, basename);
+ if (fileExists(filename))
+ return filename;
+
+ return NULL;
+}
+
static void InitDynamicEditorElementList(int **elements, int *num_elements)
{
boolean element_found[NUM_FILE_ELEMENTS];
CopyClassicElementPropertiesToGame(element);
}
+void CheckElementDescriptions()
+{
+ int i;
+
+ for (i = 0; i < NUM_FILE_ELEMENTS; i++)
+ if (getElementDescriptionFilename(i) == NULL && !IS_OBSOLETE(i))
+ Error(ERR_WARN, "no element description for element '%s'", EL_NAME(i));
+}
+
void DrawLevelEd()
{
CloseDoor(DOOR_CLOSE_ALL);
OpenDoor(DOOR_OPEN_2 | DOOR_NO_DELAY);
+#if DEBUG
+ CheckElementDescriptions();
+#endif
+
if (level_editor_test_game)
{
CopyPlayfield(level.field, Feld);
MapTextAreaGadget(ED_TEXTAREA_ID_ENVELOPE_INFO);
}
-char *getElementDescriptionFilename(int element)
-{
- char *docs_dir = options.docs_directory;
- char *elements_subdir = "elements";
- static char *filename = NULL;
- char basename[MAX_FILENAME_LEN];
-
- checked_free(filename);
-
- /* 1st try: look for element description file for exactly this element */
- sprintf(basename, "%s.txt", element_info[element].token_name);
- filename = getPath3(docs_dir, elements_subdir, basename);
- if (fileExists(filename))
- return filename;
-
- free(filename);
-
- /* 2nd try: look for element description file for this element's class */
- sprintf(basename, "%s.txt", element_info[element].class_name);
- filename = getPath3(docs_dir, elements_subdir, basename);
- if (fileExists(filename))
- return filename;
-
- return NULL;
-}
-
static boolean PrintInfoText(char *text, int font_nr, int start_line)
{
int font_height = getFontHeight(font_nr);
/* screens on the info screen */
#define INFO_MODE_MAIN 0
-#define INFO_MODE_ELEMENTS 1
-#define INFO_MODE_MUSIC 2
-#define INFO_MODE_CREDITS 3
-#define INFO_MODE_PROGRAM 4
-#define INFO_MODE_LEVELSET 5
+#define INFO_MODE_TITLESCREEN 1
+#define INFO_MODE_ELEMENTS 2
+#define INFO_MODE_MUSIC 3
+#define INFO_MODE_CREDITS 4
+#define INFO_MODE_PROGRAM 5
+#define INFO_MODE_LEVELSET 6
-#define MAX_INFO_MODES 6
+#define MAX_INFO_MODES 7
/* for various menu stuff */
#define MENU_SCREEN_START_XPOS 1
static void DrawInfoScreen(void);
static void DrawSetupScreen(void);
+static void DrawInfoScreenExt(int);
static void DrawInfoScreen_HelpAnim(int, int, boolean);
static void DrawInfoScreen_HelpText(int, int, int, int);
static void HandleInfoScreen_Main(int, int, int, int, int);
+static void HandleInfoScreen_TitleScreen(int);
static void HandleInfoScreen_Elements(int);
static void HandleInfoScreen_Music(int);
static void HandleInfoScreen_Credits(int);
#if 0
FadeToFront();
+#endif
+#if 0
InitAnimation();
#endif
PlayMenuSound();
PlayMenuMusic();
+#if 0
#if 1
OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2);
#else
else
OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2);
#endif
+#endif
+
+#if 0
+ InitAnimation();
+#endif
#if 1
/* map gadgets for main menu screen */
MapTapeButtons();
#endif
+#if 1
#if 1
FadeIn(fade_delay);
+#else
+ BackToFront();
+#endif
+#endif
+#if 1
InitAnimation();
#endif
+
+#if 1
+ OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2);
+#endif
}
void DrawMainMenu()
{
- DrawMainMenuExt(FALSE);
+ DrawMainMenuExt(0);
}
#if 0
{
title_nr = 0;
+ if (game_status == GAME_MODE_INFO)
+ {
+ FadeSoundsAndMusic();
+
+ FadeOut(fade_delay, post_delay);
+ }
+
DrawTitleScreenImage(title_nr);
FadeIn(fade_delay);
if (return_to_main_menu)
{
+ int menu_fade_delay = (use_fading_main_menu ? fade_delay : 0);
+
RedrawBackground();
-#if 1
- OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2 | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
-#endif
+ if (game_status == GAME_MODE_INFO)
+ {
+ OpenDoor(DOOR_CLOSE_1 | DOOR_CLOSE_2 | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
- game_status = GAME_MODE_MAIN;
- DrawMainMenuExt(use_fading_main_menu ? fade_delay : 0);
+ info_mode = INFO_MODE_MAIN;
+ DrawInfoScreenExt(menu_fade_delay);
+ }
+ else /* default: return to main menu */
+ {
+ OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2 | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
+
+ game_status = GAME_MODE_MAIN;
+ DrawMainMenuExt(menu_fade_delay);
+ }
}
}
static struct TokenInfo *info_info;
static int num_info_info;
+static void execInfoTitleScreen()
+{
+ info_mode = INFO_MODE_TITLESCREEN;
+ DrawInfoScreen();
+}
+
static void execInfoElements()
{
info_mode = INFO_MODE_ELEMENTS;
static struct TokenInfo info_info_main[] =
{
+ { TYPE_ENTER_SCREEN, execInfoTitleScreen, "Title Screen" },
{ TYPE_ENTER_SCREEN, execInfoElements, "Elements Info" },
{ TYPE_ENTER_SCREEN, execInfoMusic, "Music Info" },
{ TYPE_ENTER_SCREEN, execInfoCredits, "Credits" },
{ 0, NULL, NULL }
};
-static void DrawInfoScreen_Main()
+static void DrawInfoScreen_Main(int fade_delay)
{
int i;
num_info_info++;
}
+#if 1
+
+ HandleInfoScreen_Main(0, 0, 0, 0, MB_MENU_INITIALIZE);
+
+ PlayMenuSound();
+ PlayMenuMusic();
+
+ FadeIn(fade_delay);
+ InitAnimation();
+
+#else
+
FadeToFront();
InitAnimation();
PlayMenuMusic();
HandleInfoScreen_Main(0, 0, 0, 0, MB_MENU_INITIALIZE);
+#endif
}
void HandleInfoScreen_Main(int mx, int my, int dx, int dy, int button)
max_chars_per_line, max_lines_per_text);
}
+void DrawInfoScreen_TitleScreen()
+{
+ DrawTitleScreen();
+}
+
+void HandleInfoScreen_TitleScreen(int button)
+{
+ HandleTitleScreen(0, 0, 0, 0, button);
+}
+
void DrawInfoScreen_Elements()
{
SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_ELEMENTS);
}
}
-void DrawInfoScreen()
+static void DrawInfoScreenExt(int fade_delay)
{
SetMainBackgroundImage(IMG_BACKGROUND_INFO);
- if (info_mode == INFO_MODE_ELEMENTS)
+ if (info_mode == INFO_MODE_TITLESCREEN)
+ DrawInfoScreen_TitleScreen();
+ else if (info_mode == INFO_MODE_ELEMENTS)
DrawInfoScreen_Elements();
else if (info_mode == INFO_MODE_MUSIC)
DrawInfoScreen_Music();
else if (info_mode == INFO_MODE_LEVELSET)
DrawInfoScreen_LevelSet();
else
- DrawInfoScreen_Main();
+ DrawInfoScreen_Main(fade_delay);
if (info_mode != INFO_MODE_MUSIC)
{
}
}
+void DrawInfoScreen()
+{
+ DrawInfoScreenExt(0);
+}
+
void HandleInfoScreen(int mx, int my, int dx, int dy, int button)
{
- if (info_mode == INFO_MODE_ELEMENTS)
+ if (info_mode == INFO_MODE_TITLESCREEN)
+ HandleInfoScreen_TitleScreen(button);
+ else if (info_mode == INFO_MODE_ELEMENTS)
HandleInfoScreen_Elements(button);
else if (info_mode == INFO_MODE_MUSIC)
HandleInfoScreen_Music(button);