mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-23 20:17:58 -04:00
optional widescreen widget arrangement (#1176)
This commit is contained in:
parent
837212ebde
commit
5c11fb69d8
28
src/hu_lib.c
28
src/hu_lib.c
@ -53,6 +53,22 @@ void HUlib_resetAlignOffsets (void)
|
||||
align_offset[align_bottomcenter] = bottom;
|
||||
}
|
||||
|
||||
#define HU_GAPX 2
|
||||
static int left_margin, right_margin;
|
||||
int hud_widescreen_widgets;
|
||||
|
||||
void HUlib_setMargins (void)
|
||||
{
|
||||
left_margin = HU_GAPX;
|
||||
|
||||
if (hud_widescreen_widgets)
|
||||
{
|
||||
left_margin -= WIDESCREENDELTA;
|
||||
}
|
||||
|
||||
right_margin = ORIGWIDTH - left_margin;
|
||||
}
|
||||
|
||||
//
|
||||
// not used currently
|
||||
// code to initialize HUlib would go here if needed
|
||||
@ -190,10 +206,6 @@ static boolean HUlib_delCharFromTextLine(hu_textline_t* t)
|
||||
// Returns nothing
|
||||
//
|
||||
|
||||
#define HU_GAPX 2
|
||||
#define HU_GAPX_L (HU_GAPX - WIDESCREENDELTA)
|
||||
#define HU_GAPX_R (ORIGWIDTH - HU_GAPX_L)
|
||||
|
||||
static void HUlib_alignWidget(hu_textline_t *l, align_t align)
|
||||
{
|
||||
patch_t *const *const f = *l->f;
|
||||
@ -203,25 +215,25 @@ static void HUlib_alignWidget(hu_textline_t *l, align_t align)
|
||||
{
|
||||
case align_topleft:
|
||||
case align_topleft_exclusive:
|
||||
l->x = HU_GAPX_L;
|
||||
l->x = left_margin;
|
||||
l->y = align_offset[align_topleft];
|
||||
align_offset[align_topleft] += font_height;
|
||||
if (align == align_topleft_exclusive)
|
||||
align_offset[align_topright] = align_offset[align_topleft];
|
||||
break;
|
||||
case align_topright:
|
||||
l->x = HU_GAPX_R - l->width;
|
||||
l->x = right_margin - l->width;
|
||||
l->y = align_offset[align_topright];
|
||||
align_offset[align_topright] += font_height;
|
||||
break;
|
||||
case align_bottomleft:
|
||||
align_offset[align_bottomleft] -= font_height;
|
||||
l->x = HU_GAPX_L;
|
||||
l->x = left_margin;
|
||||
l->y = align_offset[align_bottomleft];
|
||||
break;
|
||||
case align_bottomright:
|
||||
align_offset[align_bottomright] -= font_height;
|
||||
l->x = HU_GAPX_R - l->width;
|
||||
l->x = right_margin - l->width;
|
||||
l->y = align_offset[align_bottomright];
|
||||
break;
|
||||
case align_topcenter:
|
||||
|
@ -164,6 +164,7 @@ void HUlib_addStringToTextLine(hu_textline_t *t, char *s);
|
||||
// draws tline
|
||||
void HUlib_drawTextLine(hu_textline_t *l, align_t align, boolean drawcursor);
|
||||
void HUlib_resetAlignOffsets();
|
||||
void HUlib_setMargins (void);
|
||||
|
||||
// erases text line
|
||||
void HUlib_eraseTextLine(hu_textline_t *l);
|
||||
|
@ -632,6 +632,7 @@ void HU_Start(void)
|
||||
HU_widget_build_title();
|
||||
|
||||
HU_disableAllWidgets();
|
||||
HUlib_setMargins();
|
||||
|
||||
// init crosshair
|
||||
if (hud_crosshair)
|
||||
|
@ -81,6 +81,7 @@ extern int hud_secret_message; // "A secret is revealed!" message
|
||||
extern int map_player_coords, map_level_stats, map_level_time; // [FG] level stats and level time widgets
|
||||
extern int hud_level_stats, hud_level_time;
|
||||
extern int hud_widget_font;
|
||||
extern int hud_widescreen_widgets;
|
||||
extern int hud_draw_bargraphs;
|
||||
extern boolean message_centered; // center messages
|
||||
extern boolean message_colorized; // colorize player messages
|
||||
|
@ -3359,6 +3359,7 @@ enum {
|
||||
stat2_title2,
|
||||
stat2_crispyhud,
|
||||
stat2_hudfont,
|
||||
stat2_widescreen,
|
||||
stat2_bargraphs,
|
||||
};
|
||||
|
||||
@ -3409,7 +3410,8 @@ setup_menu_t stat_settings2[] =
|
||||
|
||||
{"PREFER CRISPY HUD OVER BOOM HUD" ,S_YESNO ,m_null,M_X,M_Y+stat2_crispyhud*M_SPC, {"crispy_hud"}},
|
||||
{"USE STANDARD DOOM FONT FOR WIDGETS", S_CHOICE,m_null,M_X,M_Y+stat2_hudfont*M_SPC, {"hud_widget_font"}, 0, NULL, show_widgets_strings},
|
||||
{"DRAW BAR GRAPHS IN BOOM HUD", S_YESNO,m_null,M_X,M_Y+stat2_bargraphs*M_SPC, {"hud_draw_bargraphs"}},
|
||||
{"WIDESCREEN WIDGET ARRANGEMENT", S_YESNO,m_null,M_X,M_Y+stat2_widescreen*M_SPC, {"hud_widescreen_widgets"}},
|
||||
{"DRAW BAR GRAPHS IN WIDGETS", S_YESNO,m_null,M_X,M_Y+stat2_bargraphs*M_SPC, {"hud_draw_bargraphs"}},
|
||||
|
||||
{"<- PREV" ,S_SKIP|S_PREV,m_null,M_X_PREV,M_Y_PREVNEXT, {stat_settings1}},
|
||||
{"NEXT ->", S_SKIP|S_NEXT,m_null,M_X_NEXT,M_Y_PREVNEXT, {stat_settings3}},
|
||||
|
@ -2671,6 +2671,13 @@ default_t defaults[] = {
|
||||
"use standard Doom font for widgets (1 = on Automap, 2 = always)"
|
||||
},
|
||||
|
||||
{
|
||||
"hud_widescreen_widgets",
|
||||
(config_t *) &hud_widescreen_widgets, NULL,
|
||||
{1}, {0,1}, number, ss_stat, wad_no,
|
||||
"arrange widgets on widescreen edges"
|
||||
},
|
||||
|
||||
{
|
||||
"hud_draw_bargraphs",
|
||||
(config_t *) &hud_draw_bargraphs, NULL,
|
||||
|
Loading…
x
Reference in New Issue
Block a user