diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 12b894bf2..ed8e1b676 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -113,6 +113,7 @@ enum align { align_center, align_right, align_fixed, + align_fixedright, align_small, align_smallfixed, align_smallcenter, @@ -127,6 +128,7 @@ static const char *const align_opt[] = { "center", "right", "fixed", + "fixed-right", "small", "small-fixed", "small-center", @@ -737,6 +739,9 @@ static int libd_drawString(lua_State *L) case align_fixed: V_DrawStringAtFixed(x, y, flags, str); break; + case align_fixedright: + V_DrawRightAlignedStringAtFixed(x, y, flags, str); + break; // hu_font, 0.5x scale case align_small: V_DrawSmallString(x, y, flags, str); diff --git a/src/v_video.c b/src/v_video.c index 1e4217e4e..1b95d0145 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2524,6 +2524,12 @@ void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) } } +void V_DrawRightAlignedStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) +{ + x -= V_StringWidth(string, option)<