void DrawHeadline()
{
- int font1_width = getFontWidth(FONT_TITLE_1);
- int font2_width = getFontWidth(FONT_TITLE_2);
- int x1 = SX + (SXSIZE - strlen(PROGRAM_TITLE_STRING) * font1_width) / 2;
- int x2 = SX + (SXSIZE - strlen(WINDOW_SUBTITLE_STRING) * font2_width) / 2;
+ int text1_width = getTextWidth(PROGRAM_TITLE_STRING, FONT_TITLE_1);
+ int text2_width = getTextWidth(WINDOW_SUBTITLE_STRING, FONT_TITLE_2);
+ int x1 = SX + (SXSIZE - text1_width) / 2;
+ int x2 = SX + (SXSIZE - text2_width) / 2;
DrawText(x1, SY + 8, PROGRAM_TITLE_STRING, FONT_TITLE_1);
DrawText(x2, SY + 46, WINDOW_SUBTITLE_STRING, FONT_TITLE_2);
{
static LevelDirTree *leveldir_last_valid = NULL;
char *name_text = (!options.network && setup.team_mode ? "Team:" : "Name:");
- int font_width = getFontWidth(FONT_MENU_1);
- int name_width = font_width * strlen("Name:");
- int level_width = font_width * strlen("Level:");
+ int name_width = getTextWidth("Name:", FONT_MENU_1);
+ int level_width = getTextWidth("Level:", FONT_MENU_1);
int i;
UnmapAllGadgets();
/* needed if last screen was the setup screen and fullscreen state changed */
ToggleFullscreenIfNeeded();
+ /* leveldir_current may be invalid (level group, parent link) */
+ if (!validLevelSeries(leveldir_current))
+ leveldir_current = getFirstValidTreeInfoEntry(leveldir_last_valid);
+
+ /* store valid level series information */
+ leveldir_last_valid = leveldir_current;
+
/* needed if last screen (level choice) changed graphics, sounds or music */
ReloadCustomArtwork();
/* map gadgets for main menu screen */
MapTapeButtons();
- /* leveldir_current may be invalid (level group, parent link) */
- if (!validLevelSeries(leveldir_current))
- leveldir_current = getFirstValidTreeInfoEntry(leveldir_last_valid);
-
- /* store valid level series information */
- leveldir_last_valid = leveldir_current;
-
/* level_nr may have been set to value over handicap with level editor */
if (setup.handicap && level_nr > leveldir_current->handicap_level)
level_nr = leveldir_current->handicap_level;
IMG_INVISIBLE_WALL, -1, HA_NEXT,
- IMG_WALL_CRUMBLED, -1, HA_NEXT,
+ IMG_WALL_SLIPPERY, -1, HA_NEXT,
IMG_FONT_GAME_INFO, -1, HA_NEXT,
i++;
}
+#if 1
+ redraw_mask |= REDRAW_FIELD;
+#else
for(i=2; i<16; i++)
{
MarkTileDirty(0, i);
MarkTileDirty(1, i);
}
+#endif
FrameCounter++;
}
static void DrawChooseTree(TreeInfo **ti_ptr)
{
UnmapAllGadgets();
+
+ FreeScreenGadgets();
+ CreateScreenGadgets();
+
CloseDoor(DOOR_CLOSE_2);
ClearWindow();
int yoffset = (ti->type == TREE_TYPE_LEVEL_DIR ? 0 : yoffset_setup);
int last_game_status = game_status; /* save current game status */
+#if 1
+ DrawBackground(mSX, mSY, SXSIZE - 32 + menu.scrollbar_xoffset, SYSIZE);
+#else
DrawBackground(SX, SY, SXSIZE - 32, SYSIZE);
- redraw_mask |= REDRAW_FIELD;
+#endif
title_string =
(ti->type == TREE_TYPE_LEVEL_DIR ? "Level Directories" :
}
game_status = last_game_status; /* restore current game status */
+
+ redraw_mask |= REDRAW_FIELD;
}
static void drawChooseTreeInfo(int entry_pos, TreeInfo *ti)
int step = (button == 1 ? 1 : button == 2 ? 5 : 10);
int num_entries = numTreeInfoInGroup(ti);
int num_page_entries;
+ int last_game_status = game_status; /* save current game status */
+
+ /* force LEVELS draw offset on choose level and artwork setup screen */
+ game_status = GAME_MODE_LEVELS;
if (num_entries <= NUM_MENU_ENTRIES_ON_SCREEN)
num_page_entries = num_entries;
else
num_page_entries = NUM_MENU_ENTRIES_ON_SCREEN;
+ game_status = last_game_status; /* restore current game status */
+
if (button == MB_MENU_INITIALIZE)
{
int num_entries = numTreeInfoInGroup(ti);
static void execSetupArtwork()
{
- /* needed if last screen (setup choice) changed graphics, sounds or music */
- ReloadCustomArtwork();
-
setup.graphics_set = artwork.gfx_current->identifier;
setup.sounds_set = artwork.snd_current->identifier;
setup.music_set = artwork.mus_current->identifier;
+ /* needed if last screen (setup choice) changed graphics, sounds or music */
+ ReloadCustomArtwork();
+
/* needed for displaying artwork name instead of artwork identifier */
graphics_set_name = artwork.gfx_current->name;
sounds_set_name = artwork.snd_current->name;
{ TYPE_SWITCH, &setup.editor.el_dx_boulderdash,"DX Boulderd.:" },
{ TYPE_SWITCH, &setup.editor.el_chars, "Characters:" },
{ TYPE_SWITCH, &setup.editor.el_custom, "Custom:" },
+ { TYPE_SWITCH, &setup.editor.el_custom_more, "More Custom:" },
{ TYPE_EMPTY, NULL, "" },
{ TYPE_LEAVE_MENU, execSetupMain, "Back" },
{ 0, NULL, NULL }
static struct TokenInfo setup_info_sound[] =
{
- { TYPE_SWITCH, &setup.sound, "Sound:", },
- { TYPE_EMPTY, NULL, "" },
{ TYPE_SWITCH, &setup.sound_simple, "Simple Sound:" },
{ TYPE_SWITCH, &setup.sound_loops, "Sound Loops:" },
{ TYPE_SWITCH, &setup.sound_music, "Game Music:" },
int font_nr = FONT_MENU_1;
/* set some entries to "unchangeable" according to other variables */
- if ((value_ptr == &setup.sound && !audio.sound_available) ||
- (value_ptr == &setup.sound_loops && !audio.loops_available) ||
- (value_ptr == &setup.sound_music && !audio.music_available) ||
- (value_ptr == &setup.fullscreen && !video.fullscreen_available))
+ if ((value_ptr == &setup.sound_simple && !audio.sound_available) ||
+ (value_ptr == &setup.sound_loops && !audio.loops_available) ||
+ (value_ptr == &setup.sound_music && !audio.music_available) ||
+ (value_ptr == &setup.fullscreen && !video.fullscreen_available))
setup_info[i].type |= TYPE_GHOSTED;
if (setup_info[i].type & TYPE_STRING)
#else
IMG_MENU_SCROLLBAR, IMG_MENU_SCROLLBAR_ACTIVE,
#endif
- SX + SC_SCROLL_VERTICAL_XPOS, SY + SC_SCROLL_VERTICAL_YPOS,
+ SC_SCROLL_VERTICAL_XPOS, SC_SCROLL_VERTICAL_YPOS,
SC_SCROLL_VERTICAL_XSIZE, SC_SCROLL_VERTICAL_YSIZE,
GD_TYPE_SCROLLBAR_VERTICAL,
SCREEN_CTRL_ID_SCROLL_VERTICAL,
int gd_x1, gd_x2, gd_y1, gd_y2;
int id = scrollbutton_info[i].gadget_id;
- x = scrollbutton_info[i].x;
- y = scrollbutton_info[i].y;
-
event_mask = GD_EVENT_PRESSED | GD_EVENT_REPEATED;
- x += SX;
- y += SY;
+ x = mSX + scrollbutton_info[i].x + menu.scrollbar_xoffset;
+ y = mSY + scrollbutton_info[i].y;
width = SC_SCROLLBUTTON_XSIZE;
height = SC_SCROLLBUTTON_YSIZE;
+ if (id == SCREEN_CTRL_ID_SCROLL_DOWN)
+ y = mSY + (SC_SCROLL_VERTICAL_YPOS +
+ (NUM_MENU_ENTRIES_ON_SCREEN - 2) * SC_SCROLLBUTTON_YSIZE);
+
gfx_unpressed = scrollbutton_info[i].gfx_unpressed;
gfx_pressed = scrollbutton_info[i].gfx_pressed;
gd_bitmap_unpressed = graphic_info[gfx_unpressed].bitmap;
#if !defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
int gfx_unpressed, gfx_pressed;
#endif
+ int x, y, width, height;
int gd_x1, gd_x2, gd_y1, gd_y2;
struct GadgetInfo *gi;
int items_max, items_visible, item_position;
int num_page_entries = NUM_MENU_ENTRIES_ON_SCREEN;
int id = scrollbar_info[i].gadget_id;
+ event_mask = GD_EVENT_MOVING | GD_EVENT_OFF_BORDERS;
+
+ x = mSX + scrollbar_info[i].x + menu.scrollbar_xoffset;
+ y = mSY + scrollbar_info[i].y;
+ width = scrollbar_info[i].width;
+ height = scrollbar_info[i].height;
+
+ if (id == SCREEN_CTRL_ID_SCROLL_VERTICAL)
+ height = (NUM_MENU_ENTRIES_ON_SCREEN - 2) * SC_SCROLLBUTTON_YSIZE;
+
items_max = num_page_entries;
items_visible = num_page_entries;
item_position = 0;
- event_mask = GD_EVENT_MOVING | GD_EVENT_OFF_BORDERS;
-
#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
gd_bitmap_unpressed = *scrollbar_info[i].gfx_unpressed;
gd_bitmap_pressed = *scrollbar_info[i].gfx_pressed;
gi = CreateGadget(GDI_CUSTOM_ID, id,
GDI_CUSTOM_TYPE_ID, i,
GDI_INFO_TEXT, scrollbar_info[i].infotext,
- GDI_X, scrollbar_info[i].x,
- GDI_Y, scrollbar_info[i].y,
- GDI_WIDTH, scrollbar_info[i].width,
- GDI_HEIGHT, scrollbar_info[i].height,
+ GDI_X, x,
+ GDI_Y, y,
+ GDI_WIDTH, width,
+ GDI_HEIGHT, height,
GDI_TYPE, scrollbar_info[i].type,
GDI_SCROLLBAR_ITEMS_MAX, items_max,
GDI_SCROLLBAR_ITEMS_VISIBLE, items_visible,
void CreateScreenGadgets()
{
+ int last_game_status = game_status; /* save current game status */
+
#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
int i;
}
#endif
+ /* force LEVELS draw offset for scrollbar / scrollbutton gadgets */
+ game_status = GAME_MODE_LEVELS;
+
CreateScreenScrollbuttons();
CreateScreenScrollbars();
+
+ game_status = last_game_status; /* restore current game status */
}
void FreeScreenGadgets()