{ "menu.button_prev_level.active", UNDEFINED_FILENAME },
{ "menu.button_prev_level.active.clone_from", "menu.button_left.active" },
+ { "menu.button_next_level2", UNDEFINED_FILENAME },
+ { "menu.button_next_level2.clone_from", "menu.button_right" },
+ { "menu.button_next_level2.active", UNDEFINED_FILENAME },
+ { "menu.button_next_level2.active.clone_from", "menu.button_right.active" },
+ { "menu.button_prev_level2", UNDEFINED_FILENAME },
+ { "menu.button_prev_level2.clone_from", "menu.button_left" },
+ { "menu.button_prev_level2.active", UNDEFINED_FILENAME },
+ { "menu.button_prev_level2.active.clone_from", "menu.button_left.active" },
+
{ "menu.button_name", UNDEFINED_FILENAME },
{ "menu.button_name.clone_from", "menu.button" },
{ "menu.button_name.active", UNDEFINED_FILENAME },
{ "setup.button.touch_next2.x", "-60" },
{ "setup.button.touch_next2.y", "-60" },
+ { "scores.button.prev_level.x", "-1" },
+ { "scores.button.prev_level.y", "-1" },
+ { "scores.button.next_level.x", "-1" },
+ { "scores.button.next_level.y", "-1" },
+
{ "preview.x", "272" },
{ "preview.y", "380" },
{ "preview.align", "center" },
// screen gadget identifiers
#define SCREEN_CTRL_ID_PREV_LEVEL 0
#define SCREEN_CTRL_ID_NEXT_LEVEL 1
-#define SCREEN_CTRL_ID_FIRST_LEVEL 2
-#define SCREEN_CTRL_ID_LAST_LEVEL 3
-#define SCREEN_CTRL_ID_LEVEL_NUMBER 4
-#define SCREEN_CTRL_ID_PREV_PLAYER 5
-#define SCREEN_CTRL_ID_NEXT_PLAYER 6
-#define SCREEN_CTRL_ID_INSERT_SOLUTION 7
-#define SCREEN_CTRL_ID_PLAY_SOLUTION 8
-#define SCREEN_CTRL_ID_SWITCH_ECS_AGA 9
-#define SCREEN_CTRL_ID_TOUCH_PREV_PAGE 10
-#define SCREEN_CTRL_ID_TOUCH_NEXT_PAGE 11
-#define SCREEN_CTRL_ID_TOUCH_PREV_PAGE2 12
-#define SCREEN_CTRL_ID_TOUCH_NEXT_PAGE2 13
-#define SCREEN_CTRL_ID_SCROLL_UP 14
-#define SCREEN_CTRL_ID_SCROLL_DOWN 15
-#define SCREEN_CTRL_ID_SCROLL_VERTICAL 16
-#define SCREEN_CTRL_ID_NETWORK_SERVER 17
-
-#define NUM_SCREEN_GADGETS 18
-
-#define NUM_SCREEN_MENUBUTTONS 14
+#define SCREEN_CTRL_ID_PREV_LEVEL2 2
+#define SCREEN_CTRL_ID_NEXT_LEVEL2 3
+#define SCREEN_CTRL_ID_FIRST_LEVEL 4
+#define SCREEN_CTRL_ID_LAST_LEVEL 5
+#define SCREEN_CTRL_ID_LEVEL_NUMBER 6
+#define SCREEN_CTRL_ID_PREV_PLAYER 7
+#define SCREEN_CTRL_ID_NEXT_PLAYER 8
+#define SCREEN_CTRL_ID_INSERT_SOLUTION 9
+#define SCREEN_CTRL_ID_PLAY_SOLUTION 10
+#define SCREEN_CTRL_ID_SWITCH_ECS_AGA 11
+#define SCREEN_CTRL_ID_TOUCH_PREV_PAGE 12
+#define SCREEN_CTRL_ID_TOUCH_NEXT_PAGE 13
+#define SCREEN_CTRL_ID_TOUCH_PREV_PAGE2 14
+#define SCREEN_CTRL_ID_TOUCH_NEXT_PAGE2 15
+#define SCREEN_CTRL_ID_SCROLL_UP 16
+#define SCREEN_CTRL_ID_SCROLL_DOWN 17
+#define SCREEN_CTRL_ID_SCROLL_VERTICAL 18
+#define SCREEN_CTRL_ID_NETWORK_SERVER 19
+
+#define NUM_SCREEN_GADGETS 20
+
+#define NUM_SCREEN_MENUBUTTONS 16
#define NUM_SCREEN_SCROLLBUTTONS 2
#define NUM_SCREEN_SCROLLBARS 1
#define NUM_SCREEN_TEXTINPUT 1
#define SCREEN_MASK_INPUT (1 << 2)
#define SCREEN_MASK_TOUCH (1 << 3)
#define SCREEN_MASK_TOUCH2 (1 << 4)
+#define SCREEN_MASK_SCORES (1 << 5)
// graphic position and size values for buttons and scrollbars
#define SC_MENUBUTTON_XSIZE TILEX
static void execOfferUploadTapes(void);
static void DrawHallOfFame_setScoreEntries(void);
+static void HandleHallOfFame_SelectLevel(int, int);
static char *getHallOfFameScoreText(int);
static struct GadgetInfo *screen_gadget[NUM_SCREEN_GADGETS];
OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
+ // map gadgets for high score screen
+ if (game_status == GAME_MODE_SCORES)
+ MapScreenMenuGadgets(SCREEN_MASK_SCORES);
+
MapScreenTreeGadgets(*ti_ptr);
+
HandleChooseTree(0, 0, 0, 0, MB_MENU_INITIALIZE, ti_ptr);
DrawMaskedBorder(fade_mask);
y = ti->cl_cursor + dy;
}
- if (dx == 1)
+ if (game_status == GAME_MODE_SCORES && ABS(dx) == 1)
+ {
+ HandleHallOfFame_SelectLevel(1, dx);
+
+ return;
+ }
+ else if (dx == 1)
{
TreeInfo *node_first, *node_cursor;
int entry_pos = ti->cl_first + y;
return score_text;
}
+static void HandleHallOfFame_SelectLevel(int step, int direction)
+{
+ int old_level_nr = level_nr;
+ int new_level_nr = old_level_nr + step * direction;
+
+ if (new_level_nr < leveldir_current->first_level)
+ new_level_nr = leveldir_current->first_level;
+ if (new_level_nr > leveldir_current->last_level)
+ new_level_nr = leveldir_current->last_level;
+
+ if (setup.handicap && new_level_nr > leveldir_current->handicap_level)
+ new_level_nr = leveldir_current->handicap_level;
+
+ if (new_level_nr != old_level_nr)
+ {
+ PlaySound(SND_MENU_ITEM_SELECTING);
+
+ scores.last_level_nr = level_nr = new_level_nr;
+
+ LoadLocalAndServerScore(level_nr, TRUE);
+
+ DrawHallOfFame_setScoreEntries();
+
+ // force remapping optional gadgets (especially scroll bar)
+ UnmapScreenTreeGadgets();
+
+ // redraw complete high score screen, as sub-title has changed
+ ClearField();
+
+ // redraw level selection buttons (which have just been erased)
+ RedrawScreenMenuGadgets(SCREEN_MASK_SCORES);
+
+ HandleChooseTree(0, 0, 0, 0, MB_MENU_INITIALIZE, &score_entry_current);
+
+ SaveLevelSetup_SeriesInfo();
+ }
+}
+
void HandleHallOfFame(int mx, int my, int dx, int dy, int button)
{
HandleChooseTree(mx, my, dx, dy, button, &score_entry_current);
GD_EVENT_PRESSED | GD_EVENT_REPEATED,
FALSE, "next level"
},
+ {
+ IMG_MENU_BUTTON_PREV_LEVEL2, IMG_MENU_BUTTON_PREV_LEVEL2_ACTIVE,
+ &menu.scores.button.prev_level, NULL,
+ SCREEN_CTRL_ID_PREV_LEVEL2,
+ SCREEN_MASK_SCORES,
+ GD_EVENT_PRESSED | GD_EVENT_REPEATED,
+ FALSE, "previous level"
+ },
+ {
+ IMG_MENU_BUTTON_NEXT_LEVEL2, IMG_MENU_BUTTON_NEXT_LEVEL2_ACTIVE,
+ &menu.scores.button.next_level, NULL,
+ SCREEN_CTRL_ID_NEXT_LEVEL2,
+ SCREEN_MASK_SCORES,
+ GD_EVENT_PRESSED | GD_EVENT_REPEATED,
+ FALSE, "next level"
+ },
{
IMG_MENU_BUTTON_FIRST_LEVEL, IMG_MENU_BUTTON_FIRST_LEVEL_ACTIVE,
&menu.main.button.first_level, NULL,
for (i = 0; i < NUM_SCREEN_MENUBUTTONS; i++)
{
struct MenuPosInfo *pos = menubutton_info[i].pos;
+ int screen_mask = menubutton_info[i].screen_mask;
boolean is_touch_button = menubutton_info[i].is_touch_button;
boolean is_check_button = menubutton_info[i].check_value != NULL;
+ boolean is_score_button = (screen_mask == SCREEN_MASK_SCORES);
Bitmap *gd_bitmap_unpressed, *gd_bitmap_pressed;
int gfx_unpressed, gfx_pressed;
int x, y, width, height;
checked = *menubutton_info[i].check_value;
}
+ if (is_score_button)
+ {
+ // if x/y set to -1, dynamically place buttons next to title text
+ int title_width = getTextWidth(INFOTEXT_SCORE_ENTRY, FONT_TITLE_1);
+
+ if (pos->x == -1)
+ x = (id == SCREEN_CTRL_ID_PREV_LEVEL2 ?
+ SX + (SXSIZE - title_width) / 2 - width * 3 / 2 :
+ id == SCREEN_CTRL_ID_NEXT_LEVEL2 ?
+ SX + (SXSIZE + title_width) / 2 + width / 2 : 0);
+
+ if (pos->y == -1)
+ y = mSY + MENU_TITLE1_YPOS;
+ }
+
gi = CreateGadget(GDI_CUSTOM_ID, id,
GDI_CUSTOM_TYPE_ID, i,
GDI_IMAGE_ID, gfx_unpressed,
HandleMainMenu_SelectLevel(step, +1, NO_DIRECT_LEVEL_SELECT);
break;
+ case SCREEN_CTRL_ID_PREV_LEVEL2:
+ HandleHallOfFame_SelectLevel(step, -1);
+ break;
+
+ case SCREEN_CTRL_ID_NEXT_LEVEL2:
+ HandleHallOfFame_SelectLevel(step, +1);
+ break;
+
case SCREEN_CTRL_ID_FIRST_LEVEL:
HandleMainMenu_SelectLevel(MAX_LEVELS, -1, NO_DIRECT_LEVEL_SELECT);
break;