+2005-05-15
+ * added setup option "skip levels" and possibility to skip levels
+
+2005-04-28
+ * fixed displaying "imported from/by" on preview with empty string
+ * fixed ignoring draw offset for fonts used for level preview texts
+
2005-04-24
* fixed a delay problem with SDL and too many mouse motion events
* added setup option "skip levels" and level skipping functionality
-#define COMPILE_DATE_STRING "[2005-04-23 23:41]"
+#define COMPILE_DATE_STRING "[2005-05-23 21:29]"
if ((level_changed && pressed) || (!level_changed && released))
return;
- if (level_changed && !Request("Level has changed! Discard changes ?",
+ if (level_changed && !Request("Level has changed ! Discard changes ?",
REQ_ASK))
{
if (gadget_id == counterbutton_info[counter_id].gadget_id_text)
{
if (!ask_if_level_has_changed ||
!LevelChanged() ||
- Request("Level has changed! Exit without saving ?",
+ Request("Level has changed ! Exit without saving ?",
REQ_ASK | REQ_STAY_OPEN))
{
#if 1
tape.changed = FALSE;
if (new_tape)
- Request("tape saved !", REQ_CONFIRM);
+ Request("Tape saved !", REQ_CONFIRM);
}
void DumpTape(struct TapeInfo *tape)
void HandleMainMenu(int mx, int my, int dx, int dy, int button)
{
+ static unsigned long level_delay = 0;
static int choice = 5;
int x = 0;
int y = choice;
if (y == 1 && ((x == 10 && level_nr > leveldir_current->first_level) ||
(x == 14 && level_nr < leveldir_current->last_level)) &&
- button)
+ button && DelayReached(&level_delay, GADGET_FRAME_DELAY))
{
- static unsigned long level_delay = 0;
int step = (button == 1 ? 1 : button == 2 ? 5 : 10);
int old_level_nr = level_nr;
int new_level_nr;
new_level_nr = leveldir_current->last_level;
#if 1
- if (setup.handicap && new_level_nr > leveldir_current->handicap_level + 1)
- new_level_nr = leveldir_current->handicap_level;
-
- if (setup.handicap && new_level_nr > leveldir_current->handicap_level &&
- leveldir_current->handicap_level < leveldir_current->last_level)
+ if (setup.handicap && new_level_nr > leveldir_current->handicap_level)
{
- if (setup.skip_levels &&
+ /* skipping levels is only allowed when trying to skip single level */
+ if (setup.skip_levels && step == 1 &&
Request("Level still unsolved ! Skip despite handicap ?", REQ_ASK))
{
leveldir_current->handicap_level++;
new_level_nr = leveldir_current->handicap_level;
#endif
- if (new_level_nr != old_level_nr &&
- DelayReached(&level_delay, GADGET_FRAME_DELAY))
+ if (new_level_nr != old_level_nr)
{
level_nr = new_level_nr;
char label_text[MAX_OUTPUT_LINESIZE + 1];
int max_len_label_text;
int font_nr = FONT_TEXT_2;
+ int i;
if (mode == MICROLABEL_LEVEL_AUTHOR_HEAD ||
mode == MICROLABEL_IMPORTED_FROM_HEAD ||
max_len_label_text = SXSIZE / getFontWidth(font_nr);
+#if 1
+
+ for (i = 0; i < max_len_label_text; i++)
+ label_text[i] = ' ';
+ label_text[max_len_label_text] = '\0';
+
+ if (strlen(label_text) > 0)
+ {
+ int lxpos = SX + (SXSIZE - getTextWidth(label_text, font_nr)) / 2;
+ int lypos = MICROLABEL2_YPOS;
+
+ DrawText(lxpos, lypos, label_text, font_nr);
+ }
+
+#else
+
DrawBackground(SX, MICROLABEL2_YPOS, SXSIZE, getFontHeight(font_nr));
+#endif
+
strncpy(label_text,
(mode == MICROLABEL_LEVEL_NAME ? level.name :
mode == MICROLABEL_LEVEL_AUTHOR_HEAD ? "created by" :
{
int max_label_counter = 23;
- if (leveldir_current->imported_from != NULL)
+ if (leveldir_current->imported_from != NULL &&
+ strlen(leveldir_current->imported_from) > 0)
max_label_counter += 14;
- if (leveldir_current->imported_by != NULL)
+ if (leveldir_current->imported_by != NULL &&
+ strlen(leveldir_current->imported_by) > 0)
max_label_counter += 14;
label_counter = (label_counter + 1) % max_label_counter;