{ "menu.draw_xoffset.SETUP", "0" },
{ "menu.draw_yoffset.SETUP", "0" },
+ { "menu.scrollbar_xoffset", "0" },
+
{ "menu.list_size", "-1" },
{ "menu.list_size.LEVELS", "-1" },
{ "menu.list_size.SCORES", "-1" },
-#define COMPILE_DATE_STRING "[2003-07-26 03:06]"
+#define COMPILE_DATE_STRING "[2003-07-29 00:38]"
return;
}
#if 1
- else if (impact && CheckElementChange(x, y, element, ACTION_IMPACT))
+ else if (impact && CheckElementChange(x, y, element, CE_IMPACT))
{
PlaySoundLevelElementAction(x, y, element, ACTION_IMPACT);
return;
}
+#if 0
GfxAction[x][y] = ACTION_MOVING;
+#endif
}
/* now make next step */
if (!change->only_complete || complete_change)
{
+ boolean something_has_changed = FALSE;
+
if (change->only_complete && change->use_random_change &&
RND(100) < change->random)
return;
ChangeElementNowExt(ex, ey, change->content[xx][yy]);
+ something_has_changed = TRUE;
+
/* for symmetry reasons, stop newly created border elements */
if (ex != x || ey != y)
Stop[ex][ey] = TRUE;
}
}
- return;
+ if (something_has_changed)
+ PlaySoundLevelElementAction(x, y, element, ACTION_CHANGING);
}
}
+ else
+ {
+ ChangeElementNowExt(x, y, change->target_element);
- ChangeElementNowExt(x, y, change->target_element);
+ PlaySoundLevelElementAction(x, y, element, ACTION_CHANGING);
+ }
}
static void ChangeElement(int x, int y)
sound_info[i].loop = FALSE;
#if 0
- printf("::: sound: '%s'\n", sound->token);
+ printf("::: sound %d: '%s'\n", i, sound->token);
#endif
/* determine all loop sounds and identify certain sound classes */
element_action_info[j].suffix) == 0)
{
sound_effect_properties[i] = element_action_info[j].value;
+ sound_info[i].loop = element_action_info[j].is_loop_sound;
- if (element_action_info[j].is_loop_sound)
- sound_info[i].loop = TRUE;
+ break;
}
}
{
ImageInfo *img_info;
-#if 0
+#if 1
printf("loading PCX file '%s'\n", filename);
#endif
/* before sorting, the first entries will be from the user directory */
artwork.gfx_current =
getTreeInfoFromIdentifier(artwork.gfx_first, setup.graphics_set);
+ if (artwork.gfx_current == NULL)
+ artwork.gfx_current =
+ getTreeInfoFromIdentifier(artwork.gfx_first, GRAPHICS_SUBDIR);
if (artwork.gfx_current == NULL)
artwork.gfx_current = getFirstValidTreeInfoEntry(artwork.gfx_first);
artwork.snd_current =
getTreeInfoFromIdentifier(artwork.snd_first, setup.sounds_set);
+ if (artwork.snd_current == NULL)
+ artwork.snd_current =
+ getTreeInfoFromIdentifier(artwork.snd_first, SOUNDS_SUBDIR);
if (artwork.snd_current == NULL)
artwork.snd_current = getFirstValidTreeInfoEntry(artwork.snd_first);
artwork.mus_current =
getTreeInfoFromIdentifier(artwork.mus_first, setup.music_set);
+ if (artwork.mus_current == NULL)
+ artwork.mus_current =
+ getTreeInfoFromIdentifier(artwork.mus_first, MUSIC_SUBDIR);
if (artwork.mus_current == NULL)
artwork.mus_current = getFirstValidTreeInfoEntry(artwork.mus_first);
{
artwork.gfx_current =
getTreeInfoFromIdentifier(artwork.gfx_first, setup.graphics_set);
+ if (artwork.gfx_current == NULL)
+ artwork.gfx_current =
+ getTreeInfoFromIdentifier(artwork.gfx_first, GRAPHICS_SUBDIR);
if (artwork.gfx_current == NULL)
artwork.gfx_current = getFirstValidTreeInfoEntry(artwork.gfx_first);
}
{
artwork.snd_current =
getTreeInfoFromIdentifier(artwork.snd_first, setup.sounds_set);
+ if (artwork.snd_current == NULL)
+ artwork.snd_current =
+ getTreeInfoFromIdentifier(artwork.snd_first, SOUNDS_SUBDIR);
if (artwork.snd_current == NULL)
artwork.snd_current = getFirstValidTreeInfoEntry(artwork.snd_first);
}
{
artwork.mus_current =
getTreeInfoFromIdentifier(artwork.mus_first, setup.music_set);
+ if (artwork.mus_current == NULL)
+ artwork.mus_current =
+ getTreeInfoFromIdentifier(artwork.mus_first, MUSIC_SUBDIR);
if (artwork.mus_current == NULL)
artwork.mus_current = getFirstValidTreeInfoEntry(artwork.mus_first);
}
/* element action and direction definitions */
/* ------------------------------------------------------------------------- */
-struct ElementActionInfo element_action_info[NUM_ACTIONS + 1] =
+struct ElementActionInfo element_action_info[NUM_ACTIONS + 1 + 1] =
{
{ ".[DEFAULT]", ACTION_DEFAULT, TRUE },
{ ".waiting", ACTION_WAITING, TRUE },
{ "menu.draw_xoffset.SETUP", &menu.draw_xoffset[GFX_SPECIAL_ARG_SETUP] },
{ "menu.draw_yoffset.SETUP", &menu.draw_yoffset[GFX_SPECIAL_ARG_SETUP] },
+ { "menu.scrollbar_xoffset", &menu.scrollbar_xoffset },
+
{ "menu.list_size", &menu.list_size_default },
{ "menu.list_size.LEVELS", &menu.list_size[GFX_SPECIAL_ARG_LEVELS] },
{ "menu.list_size.SCORES", &menu.list_size[GFX_SPECIAL_ARG_SCORES] },
int draw_xoffset[NUM_SPECIAL_GFX_ARGS];
int draw_yoffset[NUM_SPECIAL_GFX_ARGS];
+ int scrollbar_xoffset;
+
int list_size_default;
int list_size[NUM_SPECIAL_GFX_ARGS];
};
static void DrawChooseTree(TreeInfo **ti_ptr)
{
UnmapAllGadgets();
+
+ FreeScreenGadgets();
+ CreateScreenGadgets();
+
CloseDoor(DOOR_CLOSE_2);
ClearWindow();
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);
#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()