static struct GadgetInfo *screen_gadget[NUM_SCREEN_GADGETS];
static int setup_mode = SETUP_MODE_MAIN;
-#if 0
-static int mSX = SX;
-static int mSY = SY;
-#else
-#define mSX (SX + (game_status == MAINMENU ? global.menu_draw_xoffset_MAIN : \
- global.menu_draw_xoffset))
-#define mSY (SY + (game_status == MAINMENU ? global.menu_draw_yoffset_MAIN : \
- global.menu_draw_yoffset))
-#endif
+#define mSX (SX + (game_status >= GAME_MODE_MAIN && \
+ game_status <= GAME_MODE_SETUP ? \
+ menu.draw_xoffset[game_status] : menu.draw_xoffset_default))
+#define mSY (SY + (game_status >= GAME_MODE_MAIN && \
+ game_status <= GAME_MODE_SETUP ? \
+ menu.draw_yoffset[game_status] : menu.draw_yoffset_default))
+
+#define NUM_MENU_ENTRIES_ON_SCREEN (menu.list_size[game_status] > 2 ? \
+ menu.list_size[game_status] : \
+ MAX_MENU_ENTRIES_ON_SCREEN)
#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
#define NUM_SCROLLBAR_BITMAPS 2
ypos += MENU_SCREEN_START_YPOS;
-#if 1
DrawBackground(mSX + xpos * TILEX, mSY + ypos * TILEY, TILEX, TILEY);
DrawGraphicThruMaskExt(drawto, mSX + xpos * TILEX, mSY + ypos * TILEY,
graphic, 0);
-#else
- DrawBackground(SX + xpos * 32, SY + ypos * 32, TILEX, TILEY);
- DrawGraphicThruMask(xpos, ypos, graphic, 0);
-#endif
}
static void initCursor(int ypos, int graphic)
int level_width = font_width * strlen("Level:");
int i;
-#if 0
- mSX = SX + global.menu_draw_xoffset;
- mSY = SY + global.menu_draw_yoffset;
-#endif
-
UnmapAllGadgets();
FadeSounds();
/* needed if last screen was the playing screen, invoked from level editor */
if (level_editor_test_game)
{
- game_status = LEVELED;
+ game_status = GAME_MODE_EDITOR;
DrawLevelEd();
return;
}
DrawText(mSX + 32, mSY + 3*32, "Level:", FONT_MENU_1);
DrawText(mSX + 32, mSY + 4*32, "Hall Of Fame", FONT_MENU_1);
DrawText(mSX + 32, mSY + 5*32, "Level Creator", FONT_MENU_1);
- DrawText(mSY + 32, mSY + 6*32, "Info Screen", FONT_MENU_1);
+ DrawText(mSX + 32, mSY + 6*32, "Info Screen", FONT_MENU_1);
DrawText(mSX + 32, mSY + 7*32, "Start Game", FONT_MENU_1);
DrawText(mSX + 32, mSY + 8*32, "Setup", FONT_MENU_1);
DrawText(mSX + 32, mSY + 9*32, "Quit", FONT_MENU_1);
DrawTextF(mSX + 32 + level_width - 2, mSY + 3*32 + 1, FONT_TEXT_3, "%d-%d",
leveldir_current->first_level, leveldir_current->last_level);
- /*
if (leveldir_current->readonly)
- */
{
- DrawTextF(mSX + level_width + 9*32 - 2,
- mSY + 3*32 + 1 - 7, FONT_TEXT_3, "READ");
- DrawTextF(mSX + level_width + 9*32 - 2,
- mSY + 3*32 + 1 + 7, FONT_TEXT_3, "ONLY");
+ DrawTextF(mSX + level_width + 9 * 32 - 2,
+ mSY + 3 * 32 + 1 - 7, FONT_TEXT_3, "READ");
+ DrawTextF(mSX + level_width + 9 * 32 - 2,
+ mSY + 3 * 32 + 1 + 7, FONT_TEXT_3, "ONLY");
}
for(i=0; i<8; i++)
int num_page_entries;
int cl_first, cl_cursor;
- if (num_leveldirs <= MAX_MENU_ENTRIES_ON_SCREEN)
+ if (num_leveldirs <= NUM_MENU_ENTRIES_ON_SCREEN)
num_page_entries = num_leveldirs;
else
- num_page_entries = MAX_MENU_ENTRIES_ON_SCREEN - 1;
+ num_page_entries = NUM_MENU_ENTRIES_ON_SCREEN;
cl_first = MAX(0, leveldir_pos - num_page_entries + 1);
cl_cursor = leveldir_pos - cl_first;
if (mx || my) /* mouse input */
{
- x = (mx - SX) / 32;
- y = (my - SY) / 32 - MENU_SCREEN_START_YPOS;
+ x = (mx - mSX) / 32;
+ y = (my - mSY) / 32 - MENU_SCREEN_START_YPOS;
}
else if (dx || dy) /* keyboard input */
{
{
if (y == 0)
{
- game_status = TYPENAME;
+ game_status = GAME_MODE_PSEUDO_TYPENAME;
HandleTypeName(strlen(setup.player_name), 0);
}
else if (y == 1)
{
if (leveldir_first)
{
- game_status = CHOOSELEVEL;
+ game_status = GAME_MODE_LEVELS;
SaveLevelSetup_LastSeries();
SaveLevelSetup_SeriesInfo();
}
else if (y == 2)
{
- game_status = HALLOFFAME;
+ game_status = GAME_MODE_SCORES;
DrawHallOfFame(-1);
}
else if (y == 3)
if (leveldir_current->readonly &&
strcmp(setup.player_name, "Artsoft") != 0)
Request("This level is read only !", REQ_CONFIRM);
- game_status = LEVELED;
+ game_status = GAME_MODE_EDITOR;
DrawLevelEd();
}
else if (y == 4)
{
- game_status = HELPSCREEN;
+ game_status = GAME_MODE_INFO;
DrawHelpScreen();
}
else if (y == 5)
else
#endif
{
- game_status = PLAYING;
+ game_status = GAME_MODE_PLAYING;
StopAnimation();
InitGame();
}
}
else if (y == 6)
{
- game_status = SETUP;
+ game_status = GAME_MODE_SETUP;
setup_mode = SETUP_MODE_MAIN;
DrawSetupScreen();
}
SaveLevelSetup_LastSeries();
SaveLevelSetup_SeriesInfo();
if (Request("Do you really want to quit ?", REQ_ASK | REQ_STAY_CLOSED))
- game_status = EXITGAME;
+ game_status = GAME_MODE_QUIT;
}
}
}
out:
- if (game_status == MAINMENU)
+ if (game_status == GAME_MODE_MAIN)
{
DrawMicroLevel(MICROLEV_XPOS, MICROLEV_YPOS, FALSE);
DoAnimation();
int graphic;
int frame_count;
int sync_frame;
- int frame;
while (helpscreen_action[j] != HA_END)
{
}
j++;
+#if 1
+ ClearRectangleOnBackground(drawto, xstart, ystart + (i - start) * ystep,
+ TILEX, TILEY);
+ DrawGraphicAnimationExt(drawto, xstart, ystart + (i - start) * ystep,
+ graphic, sync_frame, USE_MASKING);
+#else
frame = getGraphicAnimationFrame(graphic, sync_frame);
DrawGraphicExt(drawto, xstart, ystart + (i-start) * ystep,
graphic, frame);
+#endif
i++;
}
{
FadeSounds();
- game_status = MAINMENU;
+ game_status = GAME_MODE_MAIN;
DrawMainMenu();
}
}
DrawText(startx + xpos * font_width, starty, " ", FONT_INPUT_1_ACTIVE);
SaveSetup();
- game_status = MAINMENU;
+ game_status = GAME_MODE_MAIN;
}
BackToFront();
int items_max, items_visible, item_position;
items_max = numTreeInfoInGroup(ti);
- items_visible = MAX_MENU_ENTRIES_ON_SCREEN - 1;
+ items_visible = NUM_MENU_ENTRIES_ON_SCREEN;
item_position = first_entry;
if (item_position > items_max - items_visible)
int i;
char buffer[SCR_FIELDX * 2];
int max_buffer_len = (SCR_FIELDX - 2) * 2;
- int num_entries = numTreeInfoInGroup(ti);
char *title_string = NULL;
- int offset = (ti->type == TREE_TYPE_LEVEL_DIR ? 0 : 16);
+ int xoffset_setup = 16;
+ int yoffset_setup = 16;
+ int xoffset = (ti->type == TREE_TYPE_LEVEL_DIR ? 0 : xoffset_setup);
+ int yoffset = (ti->type == TREE_TYPE_LEVEL_DIR ? 0 : yoffset_setup);
int last_game_status = game_status; /* save current game status */
DrawBackground(SX, SY, SXSIZE - 32, SYSIZE);
ti->type == TREE_TYPE_SOUNDS_DIR ? "Custom Sounds" :
ti->type == TREE_TYPE_MUSIC_DIR ? "Custom Music" : "");
- DrawText(SX + offset, SY + offset, title_string, FONT_TITLE_1);
+ DrawText(SX + xoffset, SY + yoffset, title_string, FONT_TITLE_1);
- game_status = CHOOSELEVEL; /* force LEVELS font on artwork setup screen */
+ /* force LEVELS font on artwork setup screen */
+ game_status = GAME_MODE_LEVELS;
for(i=0; i<num_page_entries; i++)
{
initCursor(i, IMG_MENU_BUTTON);
}
- if (first_entry > 0)
- {
- int ypos = 1;
-
- DrawBackground(SX, SY + ypos * 32, TILEX, TILEY);
- DrawGraphicThruMask(0, ypos, IMG_MENU_BUTTON_UP, 0);
- }
-
- if (first_entry + num_page_entries < num_entries)
- {
- int ypos = MAX_MENU_ENTRIES_ON_SCREEN + 1;
-
- DrawBackground(SX, SY + ypos * 32, TILEX, TILEY);
- DrawGraphicThruMask(0, ypos, IMG_MENU_BUTTON_DOWN, 0);
- }
-
game_status = last_game_status; /* restore current game status */
}
static void HandleChooseTree(int mx, int my, int dx, int dy, int button,
TreeInfo **ti_ptr)
{
- static unsigned long choose_delay = 0;
TreeInfo *ti = *ti_ptr;
int x = 0;
int y = ti->cl_cursor;
int num_entries = numTreeInfoInGroup(ti);
int num_page_entries;
- if (num_entries <= MAX_MENU_ENTRIES_ON_SCREEN)
+ if (num_entries <= NUM_MENU_ENTRIES_ON_SCREEN)
num_page_entries = num_entries;
else
- num_page_entries = MAX_MENU_ENTRIES_ON_SCREEN - 1;
+ num_page_entries = NUM_MENU_ENTRIES_ON_SCREEN;
if (button == MB_MENU_INITIALIZE)
{
*ti_ptr = ti->node_parent;
DrawChooseTree(ti_ptr);
}
- else if (game_status == SETUP)
+ else if (game_status == GAME_MODE_SETUP)
{
execSetupArtwork();
}
else
{
- game_status = MAINMENU;
+ game_status = GAME_MODE_MAIN;
DrawMainMenu();
}
if (mx || my) /* mouse input */
{
- x = (mx - SX) / 32;
- y = (my - SY) / 32 - MENU_SCREEN_START_YPOS;
+ x = (mx - mSX) / 32;
+ y = (my - mSY) / 32 - MENU_SCREEN_START_YPOS;
}
- else if (dx || dy) /* keyboard input */
+ else if (dx || dy) /* keyboard or scrollbar/scrollbutton input */
{
- if (dy)
- y = ti->cl_cursor + dy;
+ /* move cursor instead of scrolling when already at start/end of list */
+ if (dy == -1 * SCROLL_LINE && ti->cl_first == 0)
+ dy = -1;
+ else if (dy == +1 * SCROLL_LINE &&
+ ti->cl_first + num_page_entries == num_entries)
+ dy = 1;
- if (ABS(dy) == SCR_FIELDY) /* handle KSYM_Page_Up, KSYM_Page_Down */
+ /* handle scrolling screen one line or page */
+ if (ti->cl_cursor + dy < 0 ||
+ ti->cl_cursor + dy > num_page_entries - 1)
{
- dy = SIGN(dy);
- step = num_page_entries - 1;
- y = (dy < 0 ? -1 : num_page_entries);
- }
- }
+ if (ABS(dy) == SCROLL_PAGE)
+ step = num_page_entries - 1;
- if (x == 0 && y == -1)
- {
- if (ti->cl_first > 0 &&
- (dy || DelayReached(&choose_delay, GADGET_FRAME_DELAY)))
- {
- ti->cl_first -= step;
- if (ti->cl_first < 0)
- ti->cl_first = 0;
+ if (dy < 0 && ti->cl_first > 0)
+ {
+ /* scroll page/line up */
- drawChooseTreeList(ti->cl_first, num_page_entries, ti);
- drawChooseTreeInfo(ti->cl_first + ti->cl_cursor, ti);
- drawCursor(ti->cl_cursor, FC_RED);
- AdjustChooseTreeScrollbar(SCREEN_CTRL_ID_SCROLL_VERTICAL,
- ti->cl_first, ti);
- return;
- }
- }
- else if (x == 0 && y > num_page_entries - 1)
- {
- if (ti->cl_first + num_page_entries < num_entries &&
- (dy || DelayReached(&choose_delay, GADGET_FRAME_DELAY)))
- {
- ti->cl_first += step;
- if (ti->cl_first + num_page_entries > num_entries)
- ti->cl_first = MAX(0, num_entries - num_page_entries);
+ ti->cl_first -= step;
+ if (ti->cl_first < 0)
+ ti->cl_first = 0;
+
+ drawChooseTreeList(ti->cl_first, num_page_entries, ti);
+ drawChooseTreeInfo(ti->cl_first + ti->cl_cursor, ti);
+ drawCursor(ti->cl_cursor, FC_RED);
+ AdjustChooseTreeScrollbar(SCREEN_CTRL_ID_SCROLL_VERTICAL,
+ ti->cl_first, ti);
+ }
+ else if (dy > 0 && ti->cl_first + num_page_entries < num_entries)
+ {
+ /* scroll page/line down */
+
+ ti->cl_first += step;
+ if (ti->cl_first + num_page_entries > num_entries)
+ ti->cl_first = MAX(0, num_entries - num_page_entries);
+
+ drawChooseTreeList(ti->cl_first, num_page_entries, ti);
+ drawChooseTreeInfo(ti->cl_first + ti->cl_cursor, ti);
+ drawCursor(ti->cl_cursor, FC_RED);
+ AdjustChooseTreeScrollbar(SCREEN_CTRL_ID_SCROLL_VERTICAL,
+ ti->cl_first, ti);
+ }
- drawChooseTreeList(ti->cl_first, num_page_entries, ti);
- drawChooseTreeInfo(ti->cl_first + ti->cl_cursor, ti);
- drawCursor(ti->cl_cursor, FC_RED);
- AdjustChooseTreeScrollbar(SCREEN_CTRL_ID_SCROLL_VERTICAL,
- ti->cl_first, ti);
return;
}
+
+ /* handle moving cursor one line */
+ y = ti->cl_cursor + dy;
}
if (dx == 1)
TapeErase();
}
- if (game_status == SETUP)
+ if (game_status == GAME_MODE_SETUP)
{
execSetupArtwork();
}
else
{
- game_status = MAINMENU;
+ game_status = GAME_MODE_MAIN;
DrawMainMenu();
}
}
BackToFront();
- if (game_status == CHOOSELEVEL || game_status == SETUP)
+ if (game_status == GAME_MODE_LEVELS || game_status == GAME_MODE_SETUP)
DoAnimation();
}
DrawText(mSX + 80, mSY + 8, "Hall Of Fame", FONT_TITLE_1);
DrawTextFCentered(46, FONT_TITLE_2, "HighScores of Level %d", level_nr);
- for(i=0; i<MAX_MENU_ENTRIES_ON_SCREEN; i++)
+ for(i=0; i<NUM_MENU_ENTRIES_ON_SCREEN; i++)
{
int entry = first_entry + i;
+ boolean active = (entry == highlight_position);
+ int font_nr1 = (active ? FONT_TEXT_1_ACTIVE : FONT_TEXT_1);
+ int font_nr2 = (active ? FONT_TEXT_2_ACTIVE : FONT_TEXT_2);
+ int font_nr3 = (active ? FONT_TEXT_3_ACTIVE : FONT_TEXT_3);
+ int font_nr4 = (active ? FONT_TEXT_4_ACTIVE : FONT_TEXT_4);
+ int dx1 = 3 * getFontWidth(font_nr1);
+ int dx2 = dx1 + getFontWidth(font_nr1);
+ int dx3 = dx2 + 25 * getFontWidth(font_nr3);
+ int sy = mSY + 64 + i * 32;
- DrawText(mSX, mSY + 64 + i * 32, "..................................",
- (entry == highlight_position ? FONT_TEXT_4 : FONT_TEXT_2));
- DrawText(mSX, mSY + 64 + i * 32, int2str(entry + 1, 3),
- (entry == highlight_position ? FONT_TEXT_4 : FONT_TEXT_2));
- DrawText(mSX + 64, mSY + 64 + i * 32, highscore[entry].Name,
- (entry == highlight_position ? FONT_TEXT_3 : FONT_TEXT_1));
- DrawText(mSX + 14 * 32 + 16, mSY + 64 + i * 32,
- int2str(highscore[entry].Score, 5),
- (entry == highlight_position ? FONT_TEXT_4 : FONT_TEXT_2));
+ DrawText(mSX, sy, int2str(entry + 1, 3), font_nr1);
+ DrawText(mSX + dx1, sy, ".", font_nr1);
+ DrawText(mSX + dx2, sy, ".........................", font_nr3);
+ if (strcmp(highscore[entry].Name, EMPTY_PLAYER_NAME) != 0)
+ DrawText(mSX + dx2, sy, highscore[entry].Name, font_nr2);
+ DrawText(mSX + dx3, sy, int2str(highscore[entry].Score, 5), font_nr4);
}
}
return;
}
- if (ABS(dy) == SCR_FIELDY) /* handle KSYM_Page_Up, KSYM_Page_Down */
- step = MAX_MENU_ENTRIES_ON_SCREEN - 1;
+ if (ABS(dy) == SCROLL_PAGE) /* handle scrolling one page */
+ step = NUM_MENU_ENTRIES_ON_SCREEN - 1;
if (dy < 0)
{
}
else if (dy > 0)
{
- if (first_entry + MAX_MENU_ENTRIES_ON_SCREEN < MAX_SCORE_ENTRIES)
+ if (first_entry + NUM_MENU_ENTRIES_ON_SCREEN < MAX_SCORE_ENTRIES)
{
first_entry += step;
- if (first_entry + MAX_MENU_ENTRIES_ON_SCREEN > MAX_SCORE_ENTRIES)
- first_entry = MAX(0, MAX_SCORE_ENTRIES - MAX_MENU_ENTRIES_ON_SCREEN);
+ if (first_entry + NUM_MENU_ENTRIES_ON_SCREEN > MAX_SCORE_ENTRIES)
+ first_entry = MAX(0, MAX_SCORE_ENTRIES - NUM_MENU_ENTRIES_ON_SCREEN);
drawHallOfFameList(first_entry, highlight_position);
return;
if (button_released)
{
FadeSound(SND_BACKGROUND_SCORES);
- game_status = MAINMENU;
+ game_status = GAME_MODE_MAIN;
DrawMainMenu();
}
BackToFront();
- if (game_status == HALLOFFAME)
+ if (game_status == GAME_MODE_SCORES)
{
DoAnimation();
#if 1
static void execExitSetup()
{
- game_status = MAINMENU;
+ game_status = GAME_MODE_MAIN;
DrawMainMenu();
}
if (strlen(value_string) > max_value_len)
value_string[max_value_len] = '\0';
}
- else if (setup_info[pos].type & TYPE_BOOLEAN_STYLE &&
- !*(boolean *)(setup_info[pos].value))
- font_nr = FONT_OPTION_OFF;
+ else if (setup_info[pos].type & TYPE_BOOLEAN_STYLE)
+ {
+ font_nr = (*(boolean *)(setup_info[pos].value) ? FONT_OPTION_ON :
+ FONT_OPTION_OFF);
+ }
DrawText(mSX + xpos * 32, mSY + ypos * 32,
(xpos == 3 ? " " : " "), font_nr);
DrawText(mSX + 16, mSY + 16, title_string, FONT_TITLE_1);
num_setup_info = 0;
- for(i=0; setup_info[i].type != 0 && i < MAX_MENU_ENTRIES_ON_SCREEN; i++)
+ for(i=0; setup_info[i].type != 0 && i < NUM_MENU_ENTRIES_ON_SCREEN; i++)
{
void *value_ptr = setup_info[i].value;
int ypos = MENU_SCREEN_START_YPOS + i;
if (mx || my) /* mouse input */
{
- x = (mx - SX) / 32;
- y = (my - SY) / 32 - MENU_SCREEN_START_YPOS;
+ x = (mx - mSX) / 32;
+ y = (my - mSY) / 32 - MENU_SCREEN_START_YPOS;
}
else if (dx || dy) /* keyboard input */
{
BackToFront();
- if (game_status == SETUP)
+ if (game_status == GAME_MODE_SETUP)
DoAnimation();
}
if (mx || my) /* mouse input */
{
- x = (mx - SX) / 32;
- y = (my - SY) / 32 - MENU_SCREEN_START_YPOS;
+ x = (mx - mSX) / 32;
+ y = (my - mSY) / 32 - MENU_SCREEN_START_YPOS;
}
else if (dx || dy) /* keyboard input */
{
out:
- if (game_status == SETUP)
+ if (game_status == GAME_MODE_SETUP)
DoAnimation();
}
void HandleGameActions()
{
- if (game_status != PLAYING)
+ if (game_status != GAME_MODE_PLAYING)
return;
if (local_player->LevelSolved)
GameActions();
BackToFront();
+
+#if 1
+ if (tape.auto_play && !tape.playing)
+ AutoPlayTape(); /* continue automatically playing next tape */
+#endif
}
/* ---------- new screen button stuff -------------------------------------- */
/* graphic position and size values for buttons and scrollbars */
-#define SC_SCROLLBUTTON_XSIZE 32
-#define SC_SCROLLBUTTON_YSIZE 32
+#define SC_SCROLLBUTTON_XSIZE TILEX
+#define SC_SCROLLBUTTON_YSIZE TILEY
+#define SC_SCROLL_VERTICAL_XSIZE SC_SCROLLBUTTON_XSIZE
+#define SC_SCROLL_VERTICAL_YSIZE ((MAX_MENU_ENTRIES_ON_SCREEN - 2) * \
+ SC_SCROLLBUTTON_YSIZE)
#define SC_SCROLL_UP_XPOS (SXSIZE - SC_SCROLLBUTTON_XSIZE)
-#define SC_SCROLL_UP_YPOS SC_SCROLLBUTTON_YSIZE
-#define SC_SCROLL_DOWN_XPOS SC_SCROLL_UP_XPOS
-#define SC_SCROLL_DOWN_YPOS (SYSIZE - SC_SCROLLBUTTON_YSIZE)
+#define SC_SCROLL_UP_YPOS (2 * SC_SCROLLBUTTON_YSIZE)
#define SC_SCROLL_VERTICAL_XPOS SC_SCROLL_UP_XPOS
-#define SC_SCROLL_VERTICAL_YPOS (SC_SCROLL_UP_YPOS + SC_SCROLLBUTTON_YSIZE)
-#define SC_SCROLL_VERTICAL_XSIZE SC_SCROLLBUTTON_XSIZE
-#define SC_SCROLL_VERTICAL_YSIZE (SYSIZE - 3 * SC_SCROLLBUTTON_YSIZE)
+#define SC_SCROLL_VERTICAL_YPOS (SC_SCROLL_UP_YPOS + \
+ SC_SCROLLBUTTON_YSIZE)
+#define SC_SCROLL_DOWN_XPOS SC_SCROLL_UP_XPOS
+#define SC_SCROLL_DOWN_YPOS (SC_SCROLL_VERTICAL_YPOS + \
+ SC_SCROLL_VERTICAL_YSIZE)
#define SC_BORDER_SIZE 14
struct GadgetInfo *gi;
int items_max, items_visible, item_position;
unsigned long event_mask;
- int num_page_entries = MAX_MENU_ENTRIES_ON_SCREEN - 1;
+ int num_page_entries = NUM_MENU_ENTRIES_ON_SCREEN;
int id = scrollbar_info[i].gadget_id;
items_max = num_page_entries;
int num_entries = numTreeInfoInGroup(ti);
int i;
- if (num_entries <= MAX_MENU_ENTRIES_ON_SCREEN)
+ if (num_entries <= NUM_MENU_ENTRIES_ON_SCREEN)
return;
for (i=0; i<NUM_SCREEN_GADGETS; i++)
{
int id = gi->custom_id;
- if (game_status != CHOOSELEVEL && game_status != SETUP)
+ if (game_status != GAME_MODE_LEVELS && game_status != GAME_MODE_SETUP)
return;
switch (id)
{
case SCREEN_CTRL_ID_SCROLL_UP:
- if (game_status == CHOOSELEVEL)
- HandleChooseLevel(SX,SY + 32, 0,0, MB_MENU_MARK);
- else if (game_status == SETUP)
- HandleSetupScreen(SX,SY + 32, 0,0, MB_MENU_MARK);
+ if (game_status == GAME_MODE_LEVELS)
+ HandleChooseLevel(0,0, 0, -1 * SCROLL_LINE, MB_MENU_MARK);
+ else if (game_status == GAME_MODE_SETUP)
+ HandleSetupScreen(0,0, 0, -1 * SCROLL_LINE, MB_MENU_MARK);
break;
case SCREEN_CTRL_ID_SCROLL_DOWN:
- if (game_status == CHOOSELEVEL)
- HandleChooseLevel(SX,SY + SYSIZE - 32, 0,0, MB_MENU_MARK);
- else if (game_status == SETUP)
- HandleSetupScreen(SX,SY + SYSIZE - 32, 0,0, MB_MENU_MARK);
+ if (game_status == GAME_MODE_LEVELS)
+ HandleChooseLevel(0,0, 0, +1 * SCROLL_LINE, MB_MENU_MARK);
+ else if (game_status == GAME_MODE_SETUP)
+ HandleSetupScreen(0,0, 0, +1 * SCROLL_LINE, MB_MENU_MARK);
break;
case SCREEN_CTRL_ID_SCROLL_VERTICAL:
- if (game_status == CHOOSELEVEL)
+ if (game_status == GAME_MODE_LEVELS)
HandleChooseLevel(0,0, 999,gi->event.item_position,MB_MENU_INITIALIZE);
- else if (game_status == SETUP)
+ else if (game_status == GAME_MODE_SETUP)
HandleSetupScreen(0,0, 999,gi->event.item_position,MB_MENU_INITIALIZE);
break;