diff --git a/base/all-all/sbardef.lmp b/base/all-all/sbardef.lmp index c9b6e69ae..fd87a64b9 100644 --- a/base/all-all/sbardef.lmp +++ b/base/all-all/sbardef.lmp @@ -911,12 +911,13 @@ "widget": { "x": 2, - "y": 152, + "y": 8, "alignment": 16, "tranmap": null, "translation": null, "type": 0, "font": "Digits", + "vertical": true, "conditions": [ { @@ -931,7 +932,7 @@ "widget": { "x": 2, - "y": 144, + "y": 40, "alignment": 16, "tranmap": null, "translation": null, @@ -942,10 +943,6 @@ { "condition": 19, "param": 3 - }, - { - "condition": 20, - "param": 0 } ], "children": null @@ -954,22 +951,18 @@ { "widget": { - "x": 2, - "y": 152, - "alignment": 16, + "x": 318, + "y": 8, + "alignment": 34, "tranmap": null, "translation": null, - "type": 1, + "type": 2, "font": "Digits", "conditions": [ { "condition": 19, - "param": 3 - }, - { - "condition": 21, - "param": 0 + "param": 4 } ], "children": null @@ -978,14 +971,21 @@ { "widget": { - "x": 318, + "x": 256, "y": 8, - "alignment": 34, + "alignment": 32, "tranmap": null, "translation": null, "type": 2, "font": "Digits", - "conditions": null, + "vertical": true, + "conditions": + [ + { + "condition": 19, + "param": 3 + } + ], "children": null } }, @@ -1752,12 +1752,13 @@ "widget": { "x": 2, - "y": 147, + "y": 8, "alignment": 16, "tranmap": null, "translation": null, "type": 0, "font": "Digits", + "vertical": true, "conditions": [ { @@ -1772,7 +1773,7 @@ "widget": { "x": 2, - "y": 139, + "y": 40, "alignment": 16, "tranmap": null, "translation": null, @@ -1783,10 +1784,6 @@ { "condition": 19, "param": 3 - }, - { - "condition": 20, - "param": 0 } ], "children": null @@ -1795,22 +1792,18 @@ { "widget": { - "x": 2, - "y": 147, - "alignment": 16, + "x": 318, + "y": 8, + "alignment": 34, "tranmap": null, "translation": null, - "type": 1, + "type": 2, "font": "Digits", "conditions": [ { "condition": 19, - "param": 3 - }, - { - "condition": 21, - "param": 0 + "param": 4 } ], "children": null @@ -1819,14 +1812,21 @@ { "widget": { - "x": 318, + "x": 256, "y": 8, - "alignment": 34, + "alignment": 32, "tranmap": null, "translation": null, "type": 2, "font": "Digits", - "conditions": null, + "vertical": true, + "conditions": + [ + { + "condition": 19, + "param": 3 + } + ], "children": null } }, @@ -2795,12 +2795,13 @@ "widget": { "x": 2, - "y": 152, + "y": 8, "alignment": 16, "tranmap": null, "translation": null, "type": 0, "font": "Digits", + "vertical": true, "conditions": [ { @@ -2815,7 +2816,7 @@ "widget": { "x": 2, - "y": 144, + "y": 40, "alignment": 16, "tranmap": null, "translation": null, @@ -2826,10 +2827,6 @@ { "condition": 19, "param": 3 - }, - { - "condition": 20, - "param": 0 } ], "children": null @@ -2838,22 +2835,18 @@ { "widget": { - "x": 2, - "y": 152, - "alignment": 16, + "x": 318, + "y": 8, + "alignment": 34, "tranmap": null, "translation": null, - "type": 1, + "type": 2, "font": "Digits", "conditions": [ { "condition": 19, - "param": 3 - }, - { - "condition": 21, - "param": 0 + "param": 4 } ], "children": null @@ -2862,14 +2855,21 @@ { "widget": { - "x": 318, + "x": 256, "y": 8, - "alignment": 34, + "alignment": 32, "tranmap": null, "translation": null, "type": 2, "font": "Digits", - "conditions": null, + "vertical": true, + "conditions": + [ + { + "condition": 19, + "param": 3 + } + ], "children": null } }, @@ -3085,12 +3085,13 @@ "widget": { "x": 2, - "y": 184, + "y": 8, "alignment": 16, "tranmap": null, "translation": null, "type": 0, "font": "Digits", + "vertical": true, "conditions": [ { @@ -3105,7 +3106,7 @@ "widget": { "x": 2, - "y": 176, + "y": 40, "alignment": 16, "tranmap": null, "translation": null, @@ -3116,10 +3117,6 @@ { "condition": 19, "param": 3 - }, - { - "condition": 20, - "param": 0 } ], "children": null @@ -3128,22 +3125,18 @@ { "widget": { - "x": 2, - "y": 184, - "alignment": 16, + "x": 318, + "y": 8, + "alignment": 34, "tranmap": null, "translation": null, - "type": 1, + "type": 2, "font": "Digits", "conditions": [ { "condition": 19, - "param": 3 - }, - { - "condition": 21, - "param": 0 + "param": 4 } ], "children": null @@ -3152,14 +3145,21 @@ { "widget": { - "x": 318, + "x": 256, "y": 8, - "alignment": 34, + "alignment": 32, "tranmap": null, "translation": null, "type": 2, "font": "Digits", - "conditions": null, + "vertical": true, + "conditions": + [ + { + "condition": 19, + "param": 3 + } + ], "children": null } }, diff --git a/base/extras.wad/sbardef.lmp b/base/extras.wad/sbardef.lmp index c9b6e69ae..fd87a64b9 100644 --- a/base/extras.wad/sbardef.lmp +++ b/base/extras.wad/sbardef.lmp @@ -911,12 +911,13 @@ "widget": { "x": 2, - "y": 152, + "y": 8, "alignment": 16, "tranmap": null, "translation": null, "type": 0, "font": "Digits", + "vertical": true, "conditions": [ { @@ -931,7 +932,7 @@ "widget": { "x": 2, - "y": 144, + "y": 40, "alignment": 16, "tranmap": null, "translation": null, @@ -942,10 +943,6 @@ { "condition": 19, "param": 3 - }, - { - "condition": 20, - "param": 0 } ], "children": null @@ -954,22 +951,18 @@ { "widget": { - "x": 2, - "y": 152, - "alignment": 16, + "x": 318, + "y": 8, + "alignment": 34, "tranmap": null, "translation": null, - "type": 1, + "type": 2, "font": "Digits", "conditions": [ { "condition": 19, - "param": 3 - }, - { - "condition": 21, - "param": 0 + "param": 4 } ], "children": null @@ -978,14 +971,21 @@ { "widget": { - "x": 318, + "x": 256, "y": 8, - "alignment": 34, + "alignment": 32, "tranmap": null, "translation": null, "type": 2, "font": "Digits", - "conditions": null, + "vertical": true, + "conditions": + [ + { + "condition": 19, + "param": 3 + } + ], "children": null } }, @@ -1752,12 +1752,13 @@ "widget": { "x": 2, - "y": 147, + "y": 8, "alignment": 16, "tranmap": null, "translation": null, "type": 0, "font": "Digits", + "vertical": true, "conditions": [ { @@ -1772,7 +1773,7 @@ "widget": { "x": 2, - "y": 139, + "y": 40, "alignment": 16, "tranmap": null, "translation": null, @@ -1783,10 +1784,6 @@ { "condition": 19, "param": 3 - }, - { - "condition": 20, - "param": 0 } ], "children": null @@ -1795,22 +1792,18 @@ { "widget": { - "x": 2, - "y": 147, - "alignment": 16, + "x": 318, + "y": 8, + "alignment": 34, "tranmap": null, "translation": null, - "type": 1, + "type": 2, "font": "Digits", "conditions": [ { "condition": 19, - "param": 3 - }, - { - "condition": 21, - "param": 0 + "param": 4 } ], "children": null @@ -1819,14 +1812,21 @@ { "widget": { - "x": 318, + "x": 256, "y": 8, - "alignment": 34, + "alignment": 32, "tranmap": null, "translation": null, "type": 2, "font": "Digits", - "conditions": null, + "vertical": true, + "conditions": + [ + { + "condition": 19, + "param": 3 + } + ], "children": null } }, @@ -2795,12 +2795,13 @@ "widget": { "x": 2, - "y": 152, + "y": 8, "alignment": 16, "tranmap": null, "translation": null, "type": 0, "font": "Digits", + "vertical": true, "conditions": [ { @@ -2815,7 +2816,7 @@ "widget": { "x": 2, - "y": 144, + "y": 40, "alignment": 16, "tranmap": null, "translation": null, @@ -2826,10 +2827,6 @@ { "condition": 19, "param": 3 - }, - { - "condition": 20, - "param": 0 } ], "children": null @@ -2838,22 +2835,18 @@ { "widget": { - "x": 2, - "y": 152, - "alignment": 16, + "x": 318, + "y": 8, + "alignment": 34, "tranmap": null, "translation": null, - "type": 1, + "type": 2, "font": "Digits", "conditions": [ { "condition": 19, - "param": 3 - }, - { - "condition": 21, - "param": 0 + "param": 4 } ], "children": null @@ -2862,14 +2855,21 @@ { "widget": { - "x": 318, + "x": 256, "y": 8, - "alignment": 34, + "alignment": 32, "tranmap": null, "translation": null, "type": 2, "font": "Digits", - "conditions": null, + "vertical": true, + "conditions": + [ + { + "condition": 19, + "param": 3 + } + ], "children": null } }, @@ -3085,12 +3085,13 @@ "widget": { "x": 2, - "y": 184, + "y": 8, "alignment": 16, "tranmap": null, "translation": null, "type": 0, "font": "Digits", + "vertical": true, "conditions": [ { @@ -3105,7 +3106,7 @@ "widget": { "x": 2, - "y": 176, + "y": 40, "alignment": 16, "tranmap": null, "translation": null, @@ -3116,10 +3117,6 @@ { "condition": 19, "param": 3 - }, - { - "condition": 20, - "param": 0 } ], "children": null @@ -3128,22 +3125,18 @@ { "widget": { - "x": 2, - "y": 184, - "alignment": 16, + "x": 318, + "y": 8, + "alignment": 34, "tranmap": null, "translation": null, - "type": 1, + "type": 2, "font": "Digits", "conditions": [ { "condition": 19, - "param": 3 - }, - { - "condition": 21, - "param": 0 + "param": 4 } ], "children": null @@ -3152,14 +3145,21 @@ { "widget": { - "x": 318, + "x": 256, "y": 8, - "alignment": 34, + "alignment": 32, "tranmap": null, "translation": null, "type": 2, "font": "Digits", - "conditions": null, + "vertical": true, + "conditions": + [ + { + "condition": 19, + "param": 3 + } + ], "children": null } }, diff --git a/base/id1.wad/sbardef.lmp b/base/id1.wad/sbardef.lmp index a54bdaab1..710029553 100644 --- a/base/id1.wad/sbardef.lmp +++ b/base/id1.wad/sbardef.lmp @@ -911,12 +911,13 @@ "widget": { "x": 2, - "y": 152, + "y": 8, "alignment": 16, "tranmap": null, "translation": null, "type": 0, "font": "Digits", + "vertical": true, "conditions": [ { @@ -931,7 +932,7 @@ "widget": { "x": 2, - "y": 144, + "y": 40, "alignment": 16, "tranmap": null, "translation": null, @@ -942,10 +943,6 @@ { "condition": 19, "param": 3 - }, - { - "condition": 20, - "param": 0 } ], "children": null @@ -954,22 +951,18 @@ { "widget": { - "x": 2, - "y": 152, - "alignment": 16, + "x": 318, + "y": 8, + "alignment": 34, "tranmap": null, "translation": null, - "type": 1, + "type": 2, "font": "Digits", "conditions": [ { "condition": 19, - "param": 3 - }, - { - "condition": 21, - "param": 0 + "param": 4 } ], "children": null @@ -978,14 +971,21 @@ { "widget": { - "x": 318, + "x": 256, "y": 8, - "alignment": 34, + "alignment": 32, "tranmap": null, "translation": null, "type": 2, "font": "Digits", - "conditions": null, + "vertical": true, + "conditions": + [ + { + "condition": 19, + "param": 3 + } + ], "children": null } }, @@ -1752,12 +1752,13 @@ "widget": { "x": 2, - "y": 147, + "y": 8, "alignment": 16, "tranmap": null, "translation": null, "type": 0, "font": "Digits", + "vertical": true, "conditions": [ { @@ -1772,7 +1773,7 @@ "widget": { "x": 2, - "y": 139, + "y": 40, "alignment": 16, "tranmap": null, "translation": null, @@ -1783,10 +1784,6 @@ { "condition": 19, "param": 3 - }, - { - "condition": 20, - "param": 0 } ], "children": null @@ -1795,22 +1792,18 @@ { "widget": { - "x": 2, - "y": 147, - "alignment": 16, + "x": 318, + "y": 8, + "alignment": 34, "tranmap": null, "translation": null, - "type": 1, + "type": 2, "font": "Digits", "conditions": [ { "condition": 19, - "param": 3 - }, - { - "condition": 21, - "param": 0 + "param": 4 } ], "children": null @@ -1819,14 +1812,21 @@ { "widget": { - "x": 318, + "x": 256, "y": 8, - "alignment": 34, + "alignment": 32, "tranmap": null, "translation": null, "type": 2, "font": "Digits", - "conditions": null, + "vertical": true, + "conditions": + [ + { + "condition": 19, + "param": 3 + } + ], "children": null } }, @@ -2795,12 +2795,13 @@ "widget": { "x": 2, - "y": 152, + "y": 8, "alignment": 16, "tranmap": null, "translation": null, "type": 0, "font": "Digits", + "vertical": true, "conditions": [ { @@ -2815,7 +2816,7 @@ "widget": { "x": 2, - "y": 144, + "y": 40, "alignment": 16, "tranmap": null, "translation": null, @@ -2826,10 +2827,6 @@ { "condition": 19, "param": 3 - }, - { - "condition": 20, - "param": 0 } ], "children": null @@ -2838,22 +2835,18 @@ { "widget": { - "x": 2, - "y": 152, - "alignment": 16, + "x": 318, + "y": 8, + "alignment": 34, "tranmap": null, "translation": null, - "type": 1, + "type": 2, "font": "Digits", "conditions": [ { "condition": 19, - "param": 3 - }, - { - "condition": 21, - "param": 0 + "param": 4 } ], "children": null @@ -2862,14 +2855,21 @@ { "widget": { - "x": 318, + "x": 256, "y": 8, - "alignment": 34, + "alignment": 32, "tranmap": null, "translation": null, "type": 2, "font": "Digits", - "conditions": null, + "vertical": true, + "conditions": + [ + { + "condition": 19, + "param": 3 + } + ], "children": null } }, @@ -3085,12 +3085,13 @@ "widget": { "x": 2, - "y": 184, + "y": 8, "alignment": 16, "tranmap": null, "translation": null, "type": 0, "font": "Digits", + "vertical": true, "conditions": [ { @@ -3105,7 +3106,7 @@ "widget": { "x": 2, - "y": 176, + "y": 40, "alignment": 16, "tranmap": null, "translation": null, @@ -3116,10 +3117,6 @@ { "condition": 19, "param": 3 - }, - { - "condition": 20, - "param": 0 } ], "children": null @@ -3128,22 +3125,18 @@ { "widget": { - "x": 2, - "y": 184, - "alignment": 16, + "x": 318, + "y": 8, + "alignment": 34, "tranmap": null, "translation": null, - "type": 1, + "type": 2, "font": "Digits", "conditions": [ { "condition": 19, - "param": 3 - }, - { - "condition": 21, - "param": 0 + "param": 4 } ], "children": null @@ -3152,14 +3145,21 @@ { "widget": { - "x": 318, + "x": 256, "y": 8, - "alignment": 34, + "alignment": 32, "tranmap": null, "translation": null, "type": 2, "font": "Digits", - "conditions": null, + "vertical": true, + "conditions": + [ + { + "condition": 19, + "param": 3 + } + ], "children": null } }, diff --git a/src/st_sbardef.c b/src/st_sbardef.c index 99eed9ff7..30cbe3688 100644 --- a/src/st_sbardef.c +++ b/src/st_sbardef.c @@ -216,6 +216,16 @@ static boolean ParseSbarElemType(json_t *json, sbarelementtype_t type, widget->duration = JS_GetNumberValue(json, "duration") * TICRATE; break; + case sbw_monsec: + case sbw_coord: + { + json_t *vertical = JS_GetObject(json, "vertical"); + if (JS_IsBoolean(vertical)) + { + widget->vertical = JS_GetBoolean(vertical); + } + } + break; default: break; } @@ -519,6 +529,7 @@ sbardef_t *ST_ParseSbarDef(void) json = JS_Open("SBHUDDEF", "hud", (version_t){1, 0, 0}); if (json == NULL) { + free(out); return NULL; } diff --git a/src/st_sbardef.h b/src/st_sbardef.h index b96e0d481..54f4500df 100644 --- a/src/st_sbardef.h +++ b/src/st_sbardef.h @@ -204,6 +204,8 @@ typedef struct sbe_widget_s int duration; int duration_left; + + boolean vertical; } sbe_widget_t; struct sbarelem_s diff --git a/src/st_widgets.c b/src/st_widgets.c index 0b4a0b8f7..fd91ebdf6 100644 --- a/src/st_widgets.c +++ b/src/st_widgets.c @@ -717,15 +717,31 @@ static void UpdateCoord(sbe_widget_t *widget, player_t *player) // killough 10/98: allow coordinates to display non-following pointer AM_Coordinates(player->mo, &x, &y, &z); - static char string[80]; - - // jff 2/16/98 output new coord display - M_snprintf(string, sizeof(string), - "\x1b%cX " GRAY_S "%d \x1b%cY " GRAY_S "%d \x1b%cZ " GRAY_S "%d", - '0' + hudcolor_xyco, x >> FRACBITS, '0' + hudcolor_xyco, - y >> FRACBITS, '0' + hudcolor_xyco, z >> FRACBITS); - - ST_AddLine(widget, string); + if (!widget->vertical) + { + static char string[80]; + // jff 2/16/98 output new coord display + M_snprintf(string, sizeof(string), + "\x1b%cX " GRAY_S "%d \x1b%cY " GRAY_S "%d \x1b%cZ " GRAY_S "%d", + '0' + hudcolor_xyco, x >> FRACBITS, '0' + hudcolor_xyco, + y >> FRACBITS, '0' + hudcolor_xyco, z >> FRACBITS); + ST_AddLine(widget, string); + } + else + { + static char string1[16]; + M_snprintf(string1, sizeof(string1), "\x1b%cX " GRAY_S "%d", + '0' + hudcolor_xyco, x >> FRACBITS); + ST_AddLine(widget, string1); + static char string2[16]; + M_snprintf(string2, sizeof(string2), "\x1b%cY " GRAY_S "%d", + '0' + hudcolor_xyco, y >> FRACBITS); + ST_AddLine(widget, string2); + static char string3[16]; + M_snprintf(string3, sizeof(string3), "\x1b%cZ " GRAY_S "%d", + '0' + hudcolor_xyco, z >> FRACBITS); + ST_AddLine(widget, string3); + } } typedef enum @@ -788,8 +804,6 @@ static void UpdateMonSec(sbe_widget_t *widget) ForceDoomFont(widget); - static char string[120]; - const int cr_blue = (widget->font == stcfnt) ? CR_BLUE2 : CR_BLUE1; int fullkillcount = 0; @@ -829,13 +843,28 @@ static void UpdateMonSec(sbe_widget_t *widget) StatsFormatFunc(item_str, sizeof(item_str), fullitemcount, totalitems); StatsFormatFunc(secret_str, sizeof(secret_str), fullsecretcount, totalsecret); - M_snprintf(string, sizeof(string), - RED_S "K \x1b%c%s " RED_S "I \x1b%c%s " RED_S "S \x1b%c%s", - killcolor, kill_str, - itemcolor, item_str, - secretcolor, secret_str); - - ST_AddLine(widget, string); + if (!widget->vertical) + { + static char string[80]; + M_snprintf(string, sizeof(string), + RED_S "K \x1b%c%s " RED_S "I \x1b%c%s " RED_S "S \x1b%c%s", + killcolor, kill_str, + itemcolor, item_str, + secretcolor, secret_str); + ST_AddLine(widget, string); + } + else + { + static char string1[16]; + M_snprintf(string1, sizeof(string1), RED_S "K \x1b%c%s", killcolor, kill_str); + ST_AddLine(widget, string1); + static char string2[16]; + M_snprintf(string2, sizeof(string2), RED_S "I \x1b%c%s", itemcolor, item_str); + ST_AddLine(widget, string2); + static char string3[16]; + M_snprintf(string3, sizeof(string3), RED_S "S \x1b%c%s", secretcolor, secret_str); + ST_AddLine(widget, string3); + } } static void UpdateDM(sbe_widget_t *widget) @@ -1228,7 +1257,7 @@ void ST_BindHUDVariables(void) M_BindBool("hud_time_use", &hud_time_use, NULL, false, ss_stat, wad_no, "Show split time when pressing the use-button"); M_BindNum("hud_widget_font", &hud_widget_font, NULL, - HUD_WIDGET_OFF, HUD_WIDGET_OFF, HUD_WIDGET_ALWAYS, + HUD_WIDGET_AUTOMAP, HUD_WIDGET_OFF, HUD_WIDGET_ALWAYS, ss_stat, wad_no, "Use standard Doom font for widgets (1 = On automap; 2 = On HUD; 3 " "= Always)");