if (pos_text != NULL && text != NULL)
{
struct MenuPosInfo *pos = pos_text;
- int x = mSX + ALIGNED_XPOS(pos->x, pos->width, pos->align);
- int y = mSY + pos->y;
+ int x = mSX + ALIGNED_MENU_XPOS(pos);
+ int y = mSY + ALIGNED_MENU_YPOS(pos);
DrawBackgroundForFont(x, y, pos->width, pos->height, font_text);
DrawText(x, y, text, font_text);
if (pos_input != NULL && input != NULL)
{
struct MenuPosInfo *pos = pos_input;
- int x = mSX + ALIGNED_XPOS(pos->x, pos->width, pos->align);
- int y = mSY + pos->y;
+ int x = mSX + ALIGNED_MENU_XPOS(pos);
+ int y = mSY + ALIGNED_MENU_YPOS(pos);
DrawBackgroundForFont(x, y, pos->width, pos->height, font_input);
DrawText(x, y, input, font_input);
if (rect == NULL)
return FALSE;
- int rect_x = ALIGNED_XPOS(rect->x, rect->width, rect->align);
- int rect_y = rect->y;
+ int rect_x = ALIGNED_MENU_XPOS(rect);
+ int rect_y = ALIGNED_MENU_YPOS(rect);
return (x >= rect_x && x < rect_x + rect->width &&
y >= rect_y && y < rect_y + rect->height);
title.auto_delay_final = graphic_info[graphic].auto_delay;
}
+void DrawTitleScreenMessage(char *filename)
+{
+ int font_nr = FONT_TEXT_1;
+ int font_width;
+ int font_height;
+ int pad_x = 16;
+ int pad_y = 32;
+ int sx = pad_x;
+ int sy = pad_y;
+ int max_chars_per_line;
+ int max_lines_per_screen;
+ int last_game_status = game_status; /* save current game status */
+
+ if (filename == NULL)
+ return;
+
+ SetDrawBackgroundMask(REDRAW_ALL);
+ SetWindowBackgroundImageIfDefined(IMG_BACKGROUND_MESSAGE);
+
+ ClearRectangleOnBackground(drawto, 0, 0, WIN_XSIZE, WIN_YSIZE);
+
+ /* force MESSAGE font on title message screen */
+ game_status = GAME_MODE_MESSAGE;
+
+ font_width = getFontWidth(font_nr);
+ font_height = getFontHeight(font_nr);
+ max_chars_per_line = (WIN_XSIZE - 2 * pad_x) / font_width;
+ max_lines_per_screen = (WIN_YSIZE - pad_y) / font_height - 1;
+
+ DrawTextFromFile(sx, sy, filename, font_nr, max_chars_per_line,
+ max_lines_per_screen, FALSE);
+
+ game_status = last_game_status; /* restore current game status */
+}
+
void DrawTitleScreen()
{
KeyboardAutoRepeatOff();
if (setup.show_titlescreen &&
((levelset_has_changed &&
- graphic_info[IMG_TITLESCREEN_1].bitmap != NULL) ||
+ (graphic_info[IMG_TITLESCREEN_1].bitmap != NULL ||
+ getLevelSetMessageFilename() != NULL)) ||
(show_titlescreen_initial &&
graphic_info[IMG_TITLESCREEN_INITIAL_1].bitmap != NULL)))
{
{
static unsigned long title_delay = 0;
static int title_nr = 0;
+ static boolean showing_message = FALSE;
+ char *filename = getLevelSetMessageFilename();
boolean return_to_main_menu = FALSE;
boolean use_fading_main_menu = TRUE;
boolean use_cross_fading = !show_titlescreen_initial; /* default */
+ boolean no_title_info = (graphic_info[IMG_TITLESCREEN_1].bitmap == NULL &&
+ filename == NULL);
if (button == MB_MENU_INITIALIZE)
{
title_delay = 0;
title_nr = 0;
+ showing_message = FALSE;
if (show_titlescreen_initial &&
graphic_info[IMG_TITLESCREEN_INITIAL_1].bitmap == NULL)
if (game_status == GAME_MODE_INFO)
{
- if (graphic_info[IMG_TITLESCREEN_1].bitmap == NULL)
+ if (no_title_info)
{
DrawInfoScreen_NotAvailable("Title screen information:",
"No title screen for this level set.");
game_status = last_game_status; /* restore current game status */
- DrawTitleScreenImage(title_nr);
+ if (graphic_info[getTitleScreenGraphic()].bitmap != NULL)
+ {
+ DrawTitleScreenImage(title_nr);
+ }
+ else
+ {
+ DrawTitleScreenMessage(filename);
+
+ showing_message = TRUE;
+
+ title.fade_delay_final = title.fade_delay;
+ title.post_delay_final = title.post_delay;
+ title.auto_delay_final = -1;
+ }
FadeIn(REDRAW_ALL);
{
int anim_mode;
- if (game_status == GAME_MODE_INFO &&
- graphic_info[IMG_TITLESCREEN_1].bitmap == NULL)
+ if (game_status == GAME_MODE_INFO && no_title_info)
{
FadeOut(REDRAW_FIELD);
DelayReached(&title_delay, 0); /* reset delay counter */
}
+ else if (!showing_message && filename != NULL)
+ {
+ if (use_cross_fading)
+ FadeCrossSaveBackbuffer();
+
+ DrawTitleScreenMessage(filename);
+
+ if (use_cross_fading)
+ FadeCross(REDRAW_ALL);
+ else
+ FadeIn(REDRAW_ALL);
+
+ DelayReached(&title_delay, 0); /* reset delay counter */
+
+ showing_message = TRUE;
+ }
else
{
FadeSoundsAndMusic();
void DrawInfoScreen_HelpText(int element, int action, int direction, int ypos)
{
+#if 1
+ int font_nr = FONT_INFO_ELEMENTS;
+#else
int font_nr = FONT_LEVEL_NUMBER;
+#endif
int font_width = getFontWidth(font_nr);
int sx = mSX + MINI_TILEX + TILEX + MINI_TILEX;
int sy = mSY + 65 + 2 * 32 + 1;
int ystart = 150;
int ybottom = SYSIZE - 20;
char *filename = getLevelSetInfoFilename();
+#if 1
+ int font_nr = FONT_INFO_LEVELSET;
+#else
int font_nr = FONT_LEVEL_NUMBER;
+#endif
int font_width = getFontWidth(font_nr);
int font_height = getFontHeight(font_nr);
int pad_x = 32;
if (filename != NULL)
DrawTextFromFile(sx, sy, filename, font_nr, max_chars_per_line,
- max_lines_per_screen);
+ max_lines_per_screen, TRUE);
else
DrawTextSCentered(ystart, FONT_TEXT_2,
"No information for this level set.");
struct MainControlInfo *mci = getMainControlInfo(MAIN_CONTROL_NAME);
#if 1
struct MenuPosInfo *pos = mci->pos_input;
- int startx = mSX + ALIGNED_XPOS(pos->x, pos->width, pos->align);
- int starty = mSY + pos->y;
+ int startx = mSX + ALIGNED_MENU_XPOS(pos);
+ int starty = mSY + ALIGNED_MENU_YPOS(pos);
#endif
#if 1
static int xpos = 0;
{ TYPE_SWITCH, &setup.editor.el_dx_boulderdash,"DX-Boulderdash:" },
#endif
{ TYPE_SWITCH, &setup.editor.el_chars, "Text Characters:" },
+ { TYPE_SWITCH, &setup.editor.el_steel_chars, "Text Characters (Steel):" },
{ TYPE_SWITCH, &setup.editor.el_custom, "Custom & Group Elements:" },
#if 0
{ TYPE_SWITCH, &setup.editor.el_headlines, "Headlines:" },