From 280f83246ad456ae5aaf961478ce956397235ae8 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sat, 4 Jan 2025 17:33:11 +0100 Subject: [PATCH] added game panel classes to show items only before or after BD hatching Example: When using game panel definitions like game.panel.levelset_name.class: bd_pre_hatching or game.panel.score.class: bd_post_hatching the corresponding game panel items will only be displayed before or after the player was hatched in levels using the native BD game engine. (For levels not using the BD engine, items using "bd_pre_hatching" will never be displayed, while items using "bd_post_hatching" will always be displayed.) --- src/game.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/game.c b/src/game.c index 27bc34bd..d924477a 100644 --- a/src/game.c +++ b/src/game.c @@ -2787,6 +2787,14 @@ static void DisplayGameControlValues(void) !setup.prefer_extra_panel_items) continue; + if (pos->class == get_hash_from_string("bd_pre_hatching") && + (level.game_engine_type != GAME_ENGINE_TYPE_BD || game_bd.game->cave->hatched)) + continue; + + if (pos->class == get_hash_from_string("bd_post_hatching") && + (level.game_engine_type == GAME_ENGINE_TYPE_BD && !game_bd.game->cave->hatched)) + continue; + gpc->last_value = value; gpc->last_frame = frame; -- 2.34.1