menu.list_size[game_status] : \
MAX_MENU_ENTRIES_ON_SCREEN)
+#define IN_VIS_MENU(x, y) IN_FIELD(x, y, SCR_FIELDX, \
+ NUM_MENU_ENTRIES_ON_SCREEN)
+
/* title display and control definitions */
y += dy;
}
- if (IN_VIS_FIELD(x, y) &&
+ if (IN_VIS_MENU(x, y) &&
y >= 0 && y < num_info_info && info_info[y].type & ~TYPE_SKIP_ENTRY)
{
if (button)
first_entry);
}
+static void clearMenuListArea()
+{
+ int scrollbar_xpos = mSX + SC_SCROLLBAR_XPOS + menu.scrollbar_xoffset;
+
+ /* correct scrollbar position if placed outside menu (playfield) area */
+ if (scrollbar_xpos > SC_SCROLLBAR_XPOS)
+ scrollbar_xpos = SC_SCROLLBAR_XPOS;
+
+ /* clear menu list area, but not title or scrollbar */
+ DrawBackground(mSX, mSY + MENU_SCREEN_START_YPOS * 32,
+ scrollbar_xpos - mSX, NUM_MENU_ENTRIES_ON_SCREEN * 32);
+}
+
static void drawChooseTreeList(int first_entry, int num_page_entries,
TreeInfo *ti)
{
DrawTextSCentered(mSY - SY + yoffset, FONT_TITLE_1, title_string);
- /* clear tree list area, but not title or scrollbar */
- DrawBackground(mSX, mSY + MENU_SCREEN_START_YPOS * 32,
- SC_SCROLLBAR_XPOS + menu.scrollbar_xoffset,
- NUM_MENU_ENTRIES_ON_SCREEN * 32);
+ clearMenuListArea();
for (i = 0; i < num_page_entries; i++)
{
}
if (!anyScrollbarGadgetActive() &&
- IN_VIS_FIELD(x, y) &&
+ IN_VIS_MENU(x, y) &&
mx < screen_gadget[SCREEN_CTRL_ID_SCROLL_VERTICAL]->x &&
y >= 0 && y < num_page_entries)
{
if (first_entry + num_page_entries > max_setup_info)
first_entry = 0;
- /* clear tree list area, but not title or scrollbar */
- DrawBackground(mSX, mSY + MENU_SCREEN_START_YPOS * 32,
- SC_SCROLLBAR_XPOS + menu.scrollbar_xoffset,
- NUM_MENU_ENTRIES_ON_SCREEN * 32);
+ clearMenuListArea();
for (i = 0; i < num_page_entries; i++)
{
setup_info[first_entry + y].type & TYPE_SKIP_ENTRY)
y += dy;
- if (!IN_VIS_FIELD(x, y))
+ if (!IN_VIS_MENU(x, y))
{
choice += y - y_old;
}
if (!anyScrollbarGadgetActive() &&
- IN_VIS_FIELD(x, y) &&
+ IN_VIS_MENU(x, y) &&
mx < screen_gadget[SCREEN_CTRL_ID_SCROLL_VERTICAL]->x &&
y >= 0 && y < num_page_entries)
{
{
HandleSetupScreen_Input_Player(1, dx < 0 ? -1 : +1);
}
- else if (IN_VIS_FIELD(x, y) &&
+ else if (IN_VIS_FIELD(x, y) && // (does not use "IN_VIS_MENU()" yet)
y >= pos_start && y <= pos_end &&
!(y >= pos_empty1 && y <= pos_empty2))
{
width = SC_SCROLLBUTTON_XSIZE;
height = SC_SCROLLBUTTON_YSIZE;
+ /* correct scrollbar position if placed outside menu (playfield) area */
+ if (x > SC_SCROLL_UP_XPOS)
+ x = SC_SCROLL_UP_XPOS;
+
if (id == SCREEN_CTRL_ID_SCROLL_DOWN)
y = mSY + (SC_SCROLL_VERTICAL_YPOS +
(NUM_MENU_ENTRIES_ON_SCREEN - 2) * SC_SCROLLBUTTON_YSIZE);
width = scrollbar_info[i].width;
height = scrollbar_info[i].height;
+ /* correct scrollbar position if placed outside menu (playfield) area */
+ if (x > SC_SCROLL_VERTICAL_XPOS)
+ x = SC_SCROLL_VERTICAL_XPOS;
+
if (id == SCREEN_CTRL_ID_SCROLL_VERTICAL)
height = (NUM_MENU_ENTRIES_ON_SCREEN - 2) * SC_SCROLLBUTTON_YSIZE;