Can now mark json/components with std::optional and then they can be null/false to disable them.
This commit is contained in:
parent
243b4c2663
commit
281a7f687a
4 changed files with 50 additions and 20 deletions
|
@ -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});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue