mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 11:22:18 -04:00
final fix
This commit is contained in:
parent
ce1fee04d2
commit
9ba20351a6
@ -111,6 +111,7 @@ typedef struct hu_widget_s
|
|||||||
hu_multiline_t *multiline;
|
hu_multiline_t *multiline;
|
||||||
|
|
||||||
align_t h_align, v_align;
|
align_t h_align, v_align;
|
||||||
|
align_t h_align_orig; // [FG] back up for centered messages
|
||||||
|
|
||||||
// [FG] align_direct
|
// [FG] align_direct
|
||||||
int x, y;
|
int x, y;
|
||||||
|
@ -189,6 +189,7 @@ static hu_widget_t *doom_widget = doom_widgets[0],
|
|||||||
*boom_widget = boom_widgets[0];
|
*boom_widget = boom_widgets[0];
|
||||||
|
|
||||||
static void HU_ParseHUD (void);
|
static void HU_ParseHUD (void);
|
||||||
|
static void HU_set_centered_message (boolean);
|
||||||
|
|
||||||
static char chat_dest[MAXPLAYERS];
|
static char chat_dest[MAXPLAYERS];
|
||||||
boolean chat_on;
|
boolean chat_on;
|
||||||
@ -456,7 +457,9 @@ void HU_Init(void)
|
|||||||
HU_InitCrosshair();
|
HU_InitCrosshair();
|
||||||
|
|
||||||
HU_InitObituaries();
|
HU_InitObituaries();
|
||||||
|
|
||||||
HU_ParseHUD();
|
HU_ParseHUD();
|
||||||
|
HU_set_centered_message(true);
|
||||||
|
|
||||||
// [Woof!] prepare player messages for colorization
|
// [Woof!] prepare player messages for colorization
|
||||||
for (i = 0; i < arrlen(colorize_strings); i++)
|
for (i = 0; i < arrlen(colorize_strings); i++)
|
||||||
@ -469,7 +472,7 @@ void HU_Init(void)
|
|||||||
|
|
||||||
// [FG] support centered player messages
|
// [FG] support centered player messages
|
||||||
|
|
||||||
static void HU_set_centered_message()
|
static void HU_set_centered_message(boolean init)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
@ -481,18 +484,13 @@ static void HU_set_centered_message()
|
|||||||
{
|
{
|
||||||
if (d_w[j].multiline == &w_message)
|
if (d_w[j].multiline == &w_message)
|
||||||
{
|
{
|
||||||
// [FG] save original alignment in the upper bytes of the x coordinate
|
// [FG] save original alignment
|
||||||
if (message_centered)
|
if (init)
|
||||||
{
|
{
|
||||||
d_w[j].x |= (d_w[j].h_align + 1) << 16;
|
d_w[j].h_align_orig = d_w[j].h_align;
|
||||||
d_w[j].h_align = align_center;
|
|
||||||
}
|
|
||||||
else if (d_w[j].x & 0xFF0000)
|
|
||||||
{
|
|
||||||
d_w[j].h_align = ((d_w[j].x >> 16) & 0xFFFF) - 1;
|
|
||||||
d_w[j].x &= 0xFFFF;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
d_w[j].h_align = message_centered ? align_center : d_w[j].h_align_orig;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -655,7 +653,7 @@ void HU_Start(void)
|
|||||||
&boom_font, colrngs[hudcolor_xyco],
|
&boom_font, colrngs[hudcolor_xyco],
|
||||||
NULL, HU_widget_build_rate);
|
NULL, HU_widget_build_rate);
|
||||||
|
|
||||||
HU_set_centered_message();
|
HU_set_centered_message(false);
|
||||||
|
|
||||||
HU_disable_all_widgets();
|
HU_disable_all_widgets();
|
||||||
HUlib_set_margins();
|
HUlib_set_margins();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user