Can now mark json/components with std::optional and then they can be null/false to disable them.

This commit is contained in:
Zed A. Shaw 2025-03-04 23:06:46 -05:00
parent 243b4c2663
commit 281a7f687a
4 changed files with 50 additions and 20 deletions

View file

@ -50,14 +50,14 @@ namespace gui {
void BossFightUI::configure_background() {
auto& boss = $world->get<components::BossFight>($boss_id);
$boss_has_stage = boss.stage != "none";
$boss_background = textures::get(boss.background);
$boss_background.sprite->setPosition({BOSS_VIEW_X, BOSS_VIEW_Y});
$status.world().set_the<Background>({$status.$parser});
if($boss_has_stage) {
$boss_stage = textures::get(boss.stage);
if(boss.stage) {
$boss_has_stage = true;
$boss_stage = textures::get(*boss.stage);
$boss_stage.sprite->setPosition({BOSS_VIEW_X, BOSS_VIEW_Y});
}
}