diff --git a/src/dehacked.c b/src/dehacked.c index 09ada89e0..52b2785c3 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8732,6 +8732,9 @@ struct { {"TC_ALLWHITE",TC_ALLWHITE}, {"TC_RAINBOW",TC_RAINBOW}, {"TC_BLINK",TC_BLINK}, + + // Custom client features exposed to lua + {"FEATURE_INTERMISSIONHUD",1}, #endif {NULL,0} diff --git a/src/lua_hud.h b/src/lua_hud.h index 07ac577de..06ba0169b 100644 --- a/src/lua_hud.h +++ b/src/lua_hud.h @@ -43,5 +43,6 @@ boolean LUA_HudEnabled(enum hud option); void LUAh_GameHUD(player_t *stplyr, huddrawlist_h list); void LUAh_ScoresHUD(huddrawlist_h list); +void LUAh_IntermissionHUD(huddrawlist_h list); #endif // __LUA_HUD_H__ diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 854721b2a..f2eeae4c9 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -84,11 +84,13 @@ static const char *const patch_opt[] = { enum hudhook { hudhook_game = 0, - hudhook_scores + hudhook_scores = 1, + hudhook_intermission = 2, }; static const char *const hudhook_opt[] = { "game", "scores", + "intermission", NULL}; // alignment types for v.drawString @@ -987,7 +989,10 @@ int LUA_HudLib(lua_State *L) lua_rawseti(L, -2, 2); // HUD[2] = game rendering functions array lua_newtable(L); - lua_rawseti(L, -2, 3); // HUD[2] = scores rendering functions array + lua_rawseti(L, -2, 3); // HUD[3] = scores rendering functions array + + lua_newtable(L); + lua_rawseti(L, -2, 4); // HUD[4] = intermission rendering functions array lua_setfield(L, LUA_REGISTRYINDEX, "HUD"); luaL_newmetatable(L, META_HUDINFO); @@ -1132,4 +1137,37 @@ void LUAh_ScoresHUD(huddrawlist_h list) lua_setfield(gL, LUA_REGISTRYINDEX, "HUD_DRAW_LIST"); } +void LUAh_IntermissionHUD(huddrawlist_h list) +{ + if (!gL || !(hudAvailable & (1<