// checkbuttons/radiobuttons for level/element properties
GADGET_ID_AUTO_COUNT_GEMS,
+ GADGET_ID_RATE_TIME_OVER_SCORE,
GADGET_ID_USE_LEVELSET_ARTWORK,
GADGET_ID_COPY_LEVEL_TEMPLATE,
GADGET_ID_RANDOM_PERCENTAGE,
enum
{
ED_CHECKBUTTON_ID_AUTO_COUNT_GEMS,
+ ED_CHECKBUTTON_ID_RATE_TIME_OVER_SCORE,
ED_CHECKBUTTON_ID_USE_LEVELSET_ARTWORK,
ED_CHECKBUTTON_ID_COPY_LEVEL_TEMPLATE,
ED_CHECKBUTTON_ID_RANDOM_RESTRICTED,
};
#define ED_CHECKBUTTON_ID_LEVEL_FIRST ED_CHECKBUTTON_ID_AUTO_COUNT_GEMS
-#define ED_CHECKBUTTON_ID_LEVEL_LAST ED_CHECKBUTTON_ID_AUTO_COUNT_GEMS
+#define ED_CHECKBUTTON_ID_LEVEL_LAST ED_CHECKBUTTON_ID_RATE_TIME_OVER_SCORE
#define ED_CHECKBUTTON_ID_LEVELSET_FIRST ED_CHECKBUTTON_ID_USE_LEVELSET_ARTWORK
#define ED_CHECKBUTTON_ID_LEVELSET_LAST ED_CHECKBUTTON_ID_COPY_LEVEL_TEMPLATE
"score for time or steps left:", NULL, NULL
},
{
- ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(12),
+ ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(13),
0, 9999,
GADGET_ID_LEVEL_RANDOM_SEED_DOWN, GADGET_ID_LEVEL_RANDOM_SEED_UP,
GADGET_ID_LEVEL_RANDOM_SEED_TEXT, GADGET_ID_NONE,
NULL, NULL, NULL, "time score for 1 or 10 seconds/steps"
},
{
- ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(11),
+ ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(12),
GADGET_ID_GAME_ENGINE_TYPE, GADGET_ID_NONE,
-1,
options_game_engine_type,
NULL, NULL,
"automatically count gems needed", "set counter to number of gems"
},
+ {
+ ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(11),
+ GADGET_ID_RATE_TIME_OVER_SCORE, GADGET_ID_NONE,
+ &level.rate_time_over_score,
+ NULL, NULL,
+ "rate time/steps used over score", "sort high scores by playing time/steps"
+ },
{
ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(7),
GADGET_ID_USE_LEVELSET_ARTWORK, GADGET_ID_NONE,
for (k = 0; k < MAX_SCORE_ENTRIES; k++)
{
- boolean score_is_better = (game.score_final > scores.entry[k].score);
- boolean score_is_equal = (game.score_final == scores.entry[k].score);
- boolean time_is_better = (game.score_time_final < scores.entry[k].time);
-
- if (score_is_better || (score_is_equal && time_is_better))
+ boolean score_is_better = (game.score_final > scores.entry[k].score);
+ boolean score_is_equal = (game.score_final == scores.entry[k].score);
+ boolean time_is_better = (game.score_time_final < scores.entry[k].time);
+ boolean time_is_equal = (game.score_time_final == scores.entry[k].time);
+ boolean better_by_score = (score_is_better ||
+ (score_is_equal && time_is_better));
+ boolean better_by_time = (time_is_better ||
+ (time_is_equal && score_is_better));
+ boolean is_better = (level.rate_time_over_score ? better_by_time :
+ better_by_score);
+ boolean entry_is_empty = (scores.entry[k].score == 0 &&
+ scores.entry[k].time == 0);
+
+ if (is_better || entry_is_empty)
{
// player has made it to the hall of fame
static char *getHallOfFameScoreText(int nr)
{
// use playing time instead of score for Supaplex levels
- if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
+ if (level.rate_time_over_score ||
+ level.game_engine_type == GAME_ENGINE_TYPE_SP)
{
+ if (level.use_step_counter)
+ return int2str(scores.entry[nr].time, 5);
+
static char score_text[10];
int time_final_max = 999;
int time_seconds = scores.entry[nr].time / FRAMES_PER_SECOND;