diff --git a/src/f_finale.c b/src/f_finale.c index 29e7e83fa..4dd73aa02 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -34,6 +34,10 @@ #include "p_local.h" #include "p_setup.h" +#ifdef HAVE_BLUA +#include "lua_hud.h" +#endif + // Stage of animation: // 0 = text, 1 = art screen static INT32 finalecount; @@ -1524,7 +1528,11 @@ void F_TitleScreenDrawer(void) // rei|miru: use title pics? if (hidetitlepics) +#ifdef HAVE_BLUA + goto luahook; +#else return; +#endif V_DrawScaledPatch(30, 14, 0, ttwing); @@ -1562,6 +1570,11 @@ void F_TitleScreenDrawer(void) } V_DrawScaledPatch(48, 142, 0,ttbanner); + +#ifdef HAVE_BLUA +luahook: + LUAh_TitleHUD(); +#endif } // (no longer) De-Demo'd Title Screen diff --git a/src/lua_hud.h b/src/lua_hud.h index ba0a1d894..beaca7883 100644 --- a/src/lua_hud.h +++ b/src/lua_hud.h @@ -42,3 +42,4 @@ boolean LUA_HudEnabled(enum hud option); void LUAh_GameHUD(player_t *stplyr); void LUAh_ScoresHUD(void); +void LUAh_TitleHUD(void); diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 5b3cd46ce..f2a2be847 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -87,11 +87,13 @@ static const char *const patch_opt[] = { enum hudhook { hudhook_game = 0, - hudhook_scores + hudhook_scores, + hudhook_title }; static const char *const hudhook_opt[] = { "game", "scores", + "title", NULL}; // alignment types for v.drawString @@ -650,6 +652,9 @@ int LUA_HudLib(lua_State *L) lua_newtable(L); lua_rawseti(L, -2, 3); // HUD[2] = scores rendering functions array + + lua_newtable(L); + lua_rawseti(L, -2, 4); // HUD[3] = title rendering functions array lua_setfield(L, LUA_REGISTRYINDEX, "HUD"); luaL_newmetatable(L, META_HUDINFO); @@ -762,4 +767,29 @@ void LUAh_ScoresHUD(void) hud_running = false; } +void LUAh_TitleHUD(void) +{ + if (!gL || !(hudAvailable & (1<