Skip to content

Commit

Permalink
Disable the play/pause/step buttons when the sun doesn't shine, see #241
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Jan 10, 2023
1 parent 765cc42 commit bdfd4e0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/common/view/LayersModelTimeControlNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ class LayersModelTimeControlNode extends TimeControlNode {
}
}
} );

// This does not need to be disposed/unlinked since it persists for the life of the sim.
model.sunEnergySource.isShiningProperty.link( isSunShining => {
this.playPauseStepButtons.enabled = isSunShining;
} );
}
}

Expand Down

0 comments on commit bdfd4e0

Please sign in to comment.