phetsims / vegas

Reusable game components for PhET simulations.
MIT License
1 stars 4 forks source link

code review for new UI components #70

Closed pixelzoom closed 6 years ago

pixelzoom commented 6 years ago

Significant modifications and new code were involved in #59 and #66. This issue is to review that work.

Components to be reviewed:

The vegas demo was also heavily modified.

High priority, since there's an immediate need for this is games that being developed now (Equality Explorer, Area Model, Fractions, ...)

Assigning to @jonathanolson. If you don't have time, please consult with @ariel-phet. Link any related issues that you create to this issue.

pixelzoom commented 6 years ago

In case you were planning to dive right into this... Please hold off for a couple of hours, I'm making an API change.

pixelzoom commented 6 years ago

API changes completed. Status bars and LevelSelectionButton are now responsible for creating and managing their own score display. Feel free to proceed.

jonathanolson commented 6 years ago
jonathanolson commented 6 years ago
pixelzoom commented 6 years ago

Agreed, barHeight would be better as an option.

Fine with changing to new Rectangle( {. I tend to stick with new Rectangle(x,y,w,h,{ instead of using the pseudo-polymorphic constructors.

pixelzoom commented 6 years ago

Agreed, barHeight would be better as an option.

Btw... Note that barHeight is computed by the subtypes based on the UI components in the bar. If you want the client to be able to set (or use a default) barHeight, that's going to be a bunch of work.

About this on Slack, @jonathanolson said:

Ahh, never mind. I just don't want clients all specifying different heights.

jonathanolson commented 6 years ago
pixelzoom commented 6 years ago

What if subtypes had to implement an abstract layout( ...

I think that's worth doing.

jonathanolson commented 6 years ago
pixelzoom commented 6 years ago

InfiniteStatusBar handles the scoreDisplay resizing, but FiniteStatusBar doesn't handle that. I

Probably an oversight, I'll make it so.

jonathanolson commented 6 years ago

I don't see references for this.bar (at least initially). Is there something I'm missing?

pixelzoom commented 6 years ago

I don't see references for this.bar ...

Typo, should ben this.barNode.

jonathanolson commented 6 years ago
pixelzoom commented 6 years ago

Does FiniteStatusBar need a disposal of startOverButton? (The back button is being disposed on the infinite one).

Since the buttons are owned by the status bars, and not visible as part of the public API, neither button probably needs to be disposed.

jonathanolson commented 6 years ago
jonathanolson commented 6 years ago
jonathanolson commented 6 years ago

ScoreDisplayLabeledStars:

jonathanolson commented 6 years ago

From slack:

Jonathan Olson [10:03 AM] Understood. Looks like I'll be able to integrate bar usage in area-model now?

Chris Malley [10:03 AM] that might be a good thing to attempt as part of code review.

I'll plan to integrate into area-model (and make-a-ten?) as part of the review then. Main pass through the code complete.

pixelzoom commented 6 years ago

All issues that @jonathanolson identified (see above check box items) have been addressed. @jonathanolson do you want to take a peek? If all looks OK, feel free to close.

jonathanolson commented 6 years ago

Looks good. I'll be integrating things today.