diff --git a/code/qcommon/q_shared.h b/code/qcommon/q_shared.h index 59a938dd4..a570c3838 100644 --- a/code/qcommon/q_shared.h +++ b/code/qcommon/q_shared.h @@ -322,6 +322,7 @@ typedef enum { #define PROP_GAP_WIDTH 2 #define PROP_SPACE_WIDTH 8 #define PROP_HEIGHT 27 +#define PROP_TINY_SIZE_SCALE 0.6 #define PROP_SMALL_SIZE_SCALE 0.75 #define BLINK_DIVISOR 200 @@ -333,6 +334,7 @@ typedef enum { #define UI_CENTER 0x00000001 #define UI_RIGHT 0x00000002 #define UI_FORMATMASK 0x00000007 +#define UI_TINYFONT 0x00000008 #define UI_SMALLFONT 0x00000010 #define UI_BIGFONT 0x00000020 // default #define UI_GIANTFONT 0x00000040 diff --git a/code/ui/ui_atoms.c b/code/ui/ui_atoms.c index f8becae1f..ecb1d3552 100644 --- a/code/ui/ui_atoms.c +++ b/code/ui/ui_atoms.c @@ -415,6 +415,9 @@ float UI_ProportionalSizeScale(int style) { if (style & UI_SMALLFONT) { return PROP_SMALL_SIZE_SCALE; } + if (style & UI_TINYFONT) { + return PROP_SMALL_SIZE_SCALE; + } return 1.0f; } @@ -484,6 +487,9 @@ static int CharWidthForStringStyle(int style) { else if (style & UI_GIANTFONT) return GIANTCHAR_WIDTH; + else if (style & UI_TINYFONT) + return TINYCHAR_WIDTH; + return BIGCHAR_WIDTH; } @@ -494,6 +500,9 @@ static int CharHeightForStringStyle(int style) { else if (style & UI_GIANTFONT) return GIANTCHAR_HEIGHT; + else if (style & UI_TINYFONT) + return TINYCHAR_HEIGHT; + return BIGCHAR_HEIGHT; } @@ -991,7 +1000,7 @@ void UI_MouseEvent(int dx, int dy) { trap_S_StartLocalSound(sfx, CHAN_LOCAL_SOUND); } else { trap_S_StartLocalSound(menuMoveSound, CHAN_LOCAL_SOUND); - } + } } } diff --git a/code/ui/ui_local.h b/code/ui/ui_local.h index 3bd289e9c..283f2f31f 100644 --- a/code/ui/ui_local.h +++ b/code/ui/ui_local.h @@ -32,7 +32,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "../client/keycodes.h" #include "../game/bg_public.h" -// For only widescreen menu SCREEN_* must be seprate values for UI, CGame, and Client. +// For only widescreen menu SCREEN_* must be separate values for UI, CGame, and Client. #undef SCREEN_WIDTH #undef SCREEN_HEIGHT #define SCREEN_WIDTH 864 diff --git a/code/ui/ui_qmenu.c b/code/ui/ui_qmenu.c index 08be40ca6..53c14ce12 100644 --- a/code/ui/ui_qmenu.c +++ b/code/ui/ui_qmenu.c @@ -1431,10 +1431,10 @@ static void Menu_AdjustCursor(menuframework_s *m, int dir) { } static void UI_DrawToolTip(const menucommon_s *focusItem) { - static const int textStyleFlags = UI_SMALLFONT; + static const int textStyleFlags = UI_TINYFONT; static const int maxTextWidth = 250; static const int boxMargin = 5; - static const int lineHeight = 20; + static const int lineHeight = TINYCHAR_HEIGHT; static const int outerMargin = 10; int numLines; int boxWidth, boxHeight; @@ -1476,7 +1476,7 @@ static void UI_DrawToolTip(const menucommon_s *focusItem) { textY = boxY + boxMargin; UI_FillRect(boxX, boxY, boxWidth, boxHeight, color_orange); - UI_DrawString_AutoWrapped(textX, textY, maxTextWidth, 20, focusItem->toolTip, textStyleFlags, menu_text_color, + UI_DrawString_AutoWrapped(textX, textY, maxTextWidth, lineHeight, focusItem->toolTip, textStyleFlags, menu_text_color, qfalse); UI_DrawRect(boxX, boxY, boxWidth, boxHeight, colorYellow, 2);