added game panel classes to show items only before or after BD hatching
authorHolger Schemel <holger.schemel@virtion.de>
Sat, 4 Jan 2025 16:33:11 +0000 (17:33 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Sat, 4 Jan 2025 16:47:59 +0000 (17:47 +0100)
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

index 27bc34bdeb66dc170565e54c61dad3f7a419a357..d924477a7a58ee8dcb518140531731587aa707cc 100644 (file)
@@ -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;