[squeak-dev] The Trunk: EToys-kfr.397.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Jun 22 18:40:33 UTC 2020


Karl Ramberg uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-kfr.397.mcz

==================== Summary ====================

Name: EToys-kfr.397
Author: kfr
Time: 22 June 2020, 8:40:19.467476 pm
UUID: 2463ba1d-f257-2544-8422-43d46a0f96b7
Ancestors: EToys-mt.396

Fix for score in SameGame that would underflow 0. Line breaks for help text is broken, make workaround.

=============== Diff against EToys-mt.396 ===============

Item was changed:
  ----- Method: SameGame>>help: (in category 'actions') -----
  help: helpState
  
  	helpState
+ 		ifTrue: [helpText := self helpText.
+ 			"Text layout is broken, so add text and apply #spaceFill to make line breaks work"
+ 			self addMorphBack: helpText.
+ 			helpText textMorph hResizing: #spaceFill]
- 		ifTrue: [self addMorphBack: self helpText]
  		ifFalse: [helpText delete]!

Item was changed:
  ----- Method: SameGame>>selection (in category 'actions') -----
  selection
  	"a selection was made on the board; get its count and update the displays"
  
  	| count score |
  	count := self board selectionCount.
  	count = 0 
  		ifTrue: 
  			[score := scoreDisplay value + (selectionDisplay value - 2) squared.
  			board findSelection ifNil: 
  					[count := board tilesRemaining.
  					score := count = 0 
  						ifTrue: [score + (5 * board rows * board columns)]
+ 						ifFalse: [score - count max:0].
- 						ifFalse: [score - count].
  					scoreDisplay flash: true].
  			scoreDisplay value: score].
  	selectionDisplay value: count!



More information about the Squeak-dev mailing list