From: Holger Schemel Date: Sat, 4 Jan 2025 16:33:11 +0000 (+0100) Subject: added game panel classes to show items only before or after BD hatching X-Git-Tag: 4.4.0.1~56 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=280f83246ad456ae5aaf961478ce956397235ae8;p=rocksndiamonds.git 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.) --- 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;