{ "font.option_off.y", "160" },
{ "font.option_off.width", "32" },
{ "font.option_off.height", "32" },
+ { "font.option_off_narrow", UNDEFINED_FILENAME },
+ { "font.option_off_narrow.clone_from", "font.text_2.LEVELS" },
{ "font.option_on", "RocksFontBig.png" },
{ "font.option_on.x", "0" },
{ "font.option_on.y", "480" },
{ "font.option_on.width", "32" },
{ "font.option_on.height", "32" },
+ { "font.option_on_narrow", UNDEFINED_FILENAME },
+ { "font.option_on_narrow.clone_from", "font.text_4.LEVELS" },
{ "font.value_1", "RocksFontBig.png" },
{ "font.value_1.x", "0" },
{ "font.value_old.y", "160" },
{ "font.value_old.width", "32" },
{ "font.value_old.height", "32" },
+ { "font.value_narrow", UNDEFINED_FILENAME },
+ { "font.value_narrow.clone_from", "font.text_4.LEVELS" },
{ "font.level_number", "RocksFontSmall.png" },
{ "font.level_number.x", "0" },
{ "font.input_2.active" },
{ "font.input_1" },
{ "font.input_2" },
+ { "font.option_off_narrow" },
{ "font.option_off" },
+ { "font.option_on_narrow" },
{ "font.option_on" },
{ "font.value_1" },
{ "font.value_2" },
{ "font.value_old" },
+ { "font.value_narrow" },
{ "font.level_number.active" },
{ "font.level_number" },
{ "font.tape_recorder" },
#define FONT_INPUT_2_ACTIVE 24
#define FONT_INPUT_1 25
#define FONT_INPUT_2 26
-#define FONT_OPTION_OFF 27
-#define FONT_OPTION_ON 28
-#define FONT_VALUE_1 29
-#define FONT_VALUE_2 30
-#define FONT_VALUE_OLD 31
-#define FONT_LEVEL_NUMBER_ACTIVE 32
-#define FONT_LEVEL_NUMBER 33
-#define FONT_TAPE_RECORDER 34
-#define FONT_GAME_INFO 35
-#define FONT_INFO_ELEMENTS 36
-#define FONT_INFO_LEVELSET 37
-
-#define NUM_FONTS 38
+#define FONT_OPTION_OFF_NARROW 27
+#define FONT_OPTION_OFF 28
+#define FONT_OPTION_ON_NARROW 29
+#define FONT_OPTION_ON 30
+#define FONT_VALUE_1 31
+#define FONT_VALUE_2 32
+#define FONT_VALUE_OLD 33
+#define FONT_VALUE_NARROW 34
+#define FONT_LEVEL_NUMBER_ACTIVE 35
+#define FONT_LEVEL_NUMBER 36
+#define FONT_TAPE_RECORDER 37
+#define FONT_GAME_INFO 38
+#define FONT_INFO_ELEMENTS 39
+#define FONT_INFO_LEVELSET 40
+
+#define NUM_FONTS 41
#define NUM_INITIAL_FONTS 4
/* values for toon animation configuration */
return FONT_VALUE_1;
}
+static int getSetupValueFontNarrow(int type, int font_nr)
+{
+ return (font_nr == FONT_VALUE_1 ? FONT_VALUE_NARROW :
+ font_nr == FONT_OPTION_ON ? FONT_OPTION_ON_NARROW :
+ font_nr == FONT_OPTION_OFF ? FONT_OPTION_OFF_NARROW :
+ font_nr);
+}
+
static void drawSetupValue(int screen_pos, int setup_info_pos_raw)
{
int si_pos = (setup_info_pos_raw < 0 ? screen_pos : setup_info_pos_raw);
struct TokenInfo *si = &setup_info[si_pos];
boolean font_draw_xoffset_modified = FALSE;
+ boolean scrollbar_needed = (num_setup_info < max_setup_info);
int font_draw_xoffset_old = -1;
- int xoffset = (num_setup_info < max_setup_info ? -1 : 0);
+ int xoffset = (scrollbar_needed ? -1 : 0);
int menu_screen_value_xpos = MENU_SCREEN_VALUE_XPOS + xoffset;
int menu_screen_max_xpos = MENU_SCREEN_MAX_XPOS + xoffset;
int xpos = menu_screen_value_xpos;
font_nr = getSetupValueFont(type, value);
font_width = getFontWidth(font_nr);
+ // special check if right-side setup values moved left due to scrollbar
+ if (scrollbar_needed && xpos > MENU_SCREEN_START_XPOS)
+ {
+ int max_menu_text_length = 26; // maximum text length for classic menu
+ int font_xoffset = getFontBitmapInfo(font_nr)->draw_xoffset;
+ int text_startx = mSX + MENU_SCREEN_START_XPOS * 32;
+ int text_font_nr = getMenuTextFont(FONT_MENU_2);
+ int text_font_xoffset = getFontBitmapInfo(text_font_nr)->draw_xoffset;
+ int text_width = max_menu_text_length * getFontWidth(text_font_nr);
+
+ if (startx + font_xoffset < text_startx + text_width + text_font_xoffset)
+ {
+ xpos += 1;
+ startx = mSX + xpos * 32;
+
+ font_nr = getSetupValueFontNarrow(type, font_nr);
+ font_width = getFontWidth(font_nr);
+ }
+ }
+
/* downward compatibility correction for Juergen Bonhagen's menu settings */
if (setup_mode != SETUP_MODE_INPUT)
{