$var =~ s/\.([A-Z]+)$/\[GFX_SPECIAL_ARG_$1\]/;
$var =~ s/\.([A-Z]+)\./\[GFX_SPECIAL_ARG_$1\]./;
- if ($var =~ /^(menu.(enter|leave)_screen)(.[a-z_]+)$/)
+ if ($var =~ /^(menu.(enter|leave|next)_screen)(.[a-z_]+)$/)
{
$var = $1 . "[GFX_SPECIAL_ARG_DEFAULT]" . $3;
}
{ "menu.enter_screen.fade_mode", "fade" },
{ "menu.enter_screen.fade_delay", "250" },
{ "menu.enter_screen.post_delay", "125" },
- { "menu.next_screen.fade_mode", "crossfade" },
- { "menu.next_screen.fade_delay", "250" },
- { "menu.next_screen.post_delay", "125" },
{ "menu.leave_screen.fade_mode", "fade" },
{ "menu.leave_screen.fade_delay", "250" },
{ "menu.leave_screen.post_delay", "125" },
+ { "menu.next_screen.fade_mode", "crossfade" },
+ { "menu.next_screen.fade_delay", "250" },
+ { "menu.next_screen.post_delay", "125" },
+ { "menu.enter_screen.TITLE.fade_mode", "fade" },
+ { "menu.enter_screen.TITLE.fade_delay", "500" },
+ { "menu.enter_screen.TITLE.post_delay", "250" },
{ "menu.enter_screen.SCORES.fade_mode", ARG_DEFAULT },
{ "menu.enter_screen.SCORES.fade_delay", ARG_DEFAULT },
{ "menu.enter_screen.SCORES.post_delay", ARG_DEFAULT },
{ "menu.enter_screen.PLAYING.fade_mode", ARG_DEFAULT },
{ "menu.enter_screen.PLAYING.fade_delay", ARG_DEFAULT },
{ "menu.enter_screen.PLAYING.post_delay", ARG_DEFAULT },
+ { "menu.leave_screen.TITLE.fade_mode", "fade" },
+ { "menu.leave_screen.TITLE.fade_delay", "500" },
+ { "menu.leave_screen.TITLE.post_delay", "250" },
{ "menu.leave_screen.SCORES.fade_mode", ARG_DEFAULT },
{ "menu.leave_screen.SCORES.fade_delay", ARG_DEFAULT },
{ "menu.leave_screen.SCORES.post_delay", ARG_DEFAULT },
{ "menu.leave_screen.PLAYING.fade_mode", ARG_DEFAULT },
{ "menu.leave_screen.PLAYING.fade_delay", ARG_DEFAULT },
{ "menu.leave_screen.PLAYING.post_delay", ARG_DEFAULT },
+ { "menu.next_screen.TITLE.fade_mode", "fade" },
+ { "menu.next_screen.TITLE.fade_delay", "500" },
+ { "menu.next_screen.TITLE.post_delay", "250" },
+ { "menu.next_screen.INFO.fade_mode", ARG_DEFAULT },
+ { "menu.next_screen.INFO.fade_delay", ARG_DEFAULT },
+ { "menu.next_screen.INFO.post_delay", ARG_DEFAULT },
{ "menu.draw_xoffset", "0" },
{ "menu.draw_yoffset", "0" },
/* (eg, init "menu.enter_screen.SCORES.xyz" from "menu.enter_screen.xyz") */
for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++)
{
+ if (i == GFX_SPECIAL_ARG_TITLE) /* title values already initialized */
+ continue;
+
menu.enter_screen[i] = menu.enter_screen[GFX_SPECIAL_ARG_DEFAULT];
menu.leave_screen[i] = menu.leave_screen[GFX_SPECIAL_ARG_DEFAULT];
+ menu.next_screen[i] = menu.next_screen[GFX_SPECIAL_ARG_DEFAULT];
}
/* special case: initialize "ARG_DEFAULT" values in static default config */
viewport.playfield[i] = viewport.playfield[GFX_SPECIAL_ARG_DEFAULT];
viewport.door_1[i] = viewport.door_1[GFX_SPECIAL_ARG_DEFAULT];
- if (i != GFX_SPECIAL_ARG_EDITOR) /* editor value already initialized */
- viewport.door_2[i] = viewport.door_2[GFX_SPECIAL_ARG_DEFAULT];
+ if (i == GFX_SPECIAL_ARG_EDITOR) /* editor values already initialized */
+ continue;
+
+ viewport.door_2[i] = viewport.door_2[GFX_SPECIAL_ARG_DEFAULT];
}
}
static void LoadMenuDesignSettingsFromFilename(char *filename)
{
+ static struct TitleFadingInfo tfi;
static struct TitleMessageInfo tmi;
+ static struct TokenInfo title_tokens[] =
+ {
+ { TYPE_INTEGER, &tfi.fade_mode, ".fade_mode" },
+ { TYPE_INTEGER, &tfi.fade_delay, ".fade_delay" },
+ { TYPE_INTEGER, &tfi.post_delay, ".post_delay" },
+ { TYPE_INTEGER, &tfi.auto_delay, ".auto_delay" },
+
+ { -1, NULL, NULL }
+ };
static struct TokenInfo titlemessage_tokens[] =
{
{ TYPE_INTEGER, &tmi.x, ".x" },
{ -1, NULL, NULL }
};
static struct
+ {
+ struct TitleFadingInfo *info;
+ char *text;
+ }
+ title_info[] =
+ {
+ /* initialize title screens from "next screen" definitions, if defined */
+ { &title_initial_default, "menu.next_screen.TITLE" },
+ { &title_default, "menu.next_screen.TITLE" },
+
+ { NULL, NULL }
+ };
+ static struct
{
struct TitleMessageInfo *array;
char *text;
}
titlemessage_arrays[] =
{
+ /* initialize title messages from "next screen" definitions, if defined */
+ { titlemessage_initial, "menu.next_screen.TITLE" },
+ { titlemessage, "menu.next_screen.TITLE" },
+
+ /* overwrite title messages with title definitions, if defined */
+ { titlemessage_initial, "[title_initial]" },
+ { titlemessage, "[title]" },
+
+ /* overwrite title messages with title message definitions, if defined */
{ titlemessage_initial, "[titlemessage_initial]" },
{ titlemessage, "[titlemessage]" },
char *token_4 = "menu.leave_screen.fade_mode";
char *token_5 = "menu.leave_screen.fade_delay";
char *token_6 = "menu.leave_screen.post_delay";
+ char *token_7 = "menu.next_screen.fade_mode";
+ char *token_8 = "menu.next_screen.fade_delay";
+ char *token_9 = "menu.next_screen.post_delay";
char *value_1 = getHashEntry(setup_file_hash, token_1);
char *value_2 = getHashEntry(setup_file_hash, token_2);
char *value_3 = getHashEntry(setup_file_hash, token_3);
char *value_4 = getHashEntry(setup_file_hash, token_4);
char *value_5 = getHashEntry(setup_file_hash, token_5);
char *value_6 = getHashEntry(setup_file_hash, token_6);
+ char *value_7 = getHashEntry(setup_file_hash, token_7);
+ char *value_8 = getHashEntry(setup_file_hash, token_8);
+ char *value_9 = getHashEntry(setup_file_hash, token_9);
if (value_1 != NULL)
menu.enter_screen[i].fade_mode = get_token_parameter_value(token_1,
if (value_6 != NULL)
menu.leave_screen[i].post_delay = get_token_parameter_value(token_6,
value_6);
+ if (value_7 != NULL)
+ menu.next_screen[i].fade_mode = get_token_parameter_value(token_7,
+ value_7);
+ if (value_8 != NULL)
+ menu.next_screen[i].fade_delay = get_token_parameter_value(token_8,
+ value_8);
+ if (value_9 != NULL)
+ menu.next_screen[i].post_delay = get_token_parameter_value(token_9,
+ value_9);
}
/* special case: initialize with default values that may be overwritten */
value_15);
}
+ /* special case: initialize with default values that may be overwritten */
+ /* (e.g., init "[title].fade_mode" from "menu.next_screen.TITLE.fade_mode") */
+ for (i = 0; title_info[i].info != NULL; i++)
+ {
+ struct TitleFadingInfo *info = title_info[i].info;
+ char *base_token = title_info[i].text;
+
+ for (j = 0; title_tokens[j].type != -1; j++)
+ {
+ char *token = getStringCat2(base_token, title_tokens[j].text);
+ char *value = getHashEntry(setup_file_hash, token);
+
+ if (value != NULL)
+ {
+ int parameter_value = get_token_parameter_value(token, value);
+
+ tfi = *info;
+
+ *(boolean *)title_tokens[j].value = (boolean)parameter_value;
+
+ *info = tfi;
+ }
+
+ free(token);
+ }
+ }
+
/* special case: initialize with default values that may be overwritten */
/* (e.g., init "titlemessage_1.fade_mode" from "[titlemessage].fade_mode") */
for (i = 0; titlemessage_arrays[i].array != NULL; i++)
struct TitleFadingInfo leave_menu;
struct TitleFadingInfo enter_screen[NUM_SPECIAL_GFX_ARGS];
struct TitleFadingInfo leave_screen[NUM_SPECIAL_GFX_ARGS];
- struct TitleFadingInfo next_screen;
+ struct TitleFadingInfo next_screen[NUM_SPECIAL_GFX_ARGS];
int sound[NUM_SPECIAL_GFX_ARGS];
int music[NUM_SPECIAL_GFX_ARGS];
static int last_sound = -1, last_music = -1;
boolean return_to_main_menu = FALSE;
struct TitleControlInfo *tci;
- struct TitleFadingInfo fading_default;
- struct TitleFadingInfo fading_last = fading;
- struct TitleFadingInfo fading_next;
int sound, music;
if (button == MB_MENU_INITIALIZE)
last_sound = SND_UNDEFINED;
last_music = MUS_UNDEFINED;
+ FadeSetEnterScreen();
+
if (game_status_last_screen == GAME_MODE_INFO)
{
if (num_title_screens == 0)
/* only required to update logic for redrawing global border */
ClearField();
+ /* title screens may have different window size */
ChangeViewportPropertiesIfNeeded();
if (tci->is_image)
else
DrawTitleScreenMessage(tci->local_nr, tci->initial);
- fading_default = (tci->initial ? title_initial_default : title_default);
-
- fading = fading_next = getTitleFading(tci);
-
- if (!(fading_last.fade_mode & FADE_TYPE_TRANSFORM) &&
- fading_next.fade_mode & FADE_TYPE_TRANSFORM)
- {
- fading.fade_mode = FADE_MODE_FADE;
- fading.fade_delay = fading_default.fade_delay;
- }
-
sound = getTitleSound(tci);
music = getTitleMusic(tci);
FadeIn(REDRAW_ALL);
- fading = fading_next;
-
DelayReached(&title_delay, 0); /* reset delay counter */
return;
if (music == MUS_UNDEFINED || music != last_music)
FadeMusic();
+ fading = getTitleFading(tci);
+
FadeOut(REDRAW_ALL);
if (tci->is_image)
else
DrawTitleScreenMessage(tci->local_nr, tci->initial);
- fading_next = getTitleFading(tci);
-
sound = getTitleSound(tci);
music = getTitleMusic(tci);
last_sound = sound;
last_music = music;
- /* last screen already faded out, next screen has no animation */
- if (!(fading.fade_mode & FADE_TYPE_TRANSFORM) &&
- fading_next.fade_mode == FADE_MODE_NONE)
- fading = fading_next;
-
FadeIn(REDRAW_ALL);
- fading = fading_next;
-
DelayReached(&title_delay, 0); /* reset delay counter */
}
else
PlayMenuSound();
PlayMenuMusic();
+#if 1
+ // needed after returning from title screens with different window size
+ OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
+#endif
+
DrawMaskedBorder(fade_mask);
FadeIn(fade_mask);
void FadeSetNextScreen()
{
- fading = menu.next_screen;
+ fading = menu.next_screen[game_status];
// (do not overwrite fade mode set by FadeSetEnterScreen)
// FadeSetLeaveNext(fading, TRUE); /* (keep same fade mode) */