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


(cherry picked from commit bdfd4e0)
  • Loading branch information
samreid committed Jan 10, 2023
1 parent 3ee5a92 commit 870cca7
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 870cca7

Please sign in to comment.