Skip to content

Commit

Permalink
slight ui modifications; test for block menu
Browse files Browse the repository at this point in the history
  • Loading branch information
jal1604 committed Jun 23, 2024
1 parent 4acad5a commit b7b13e5
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 11 deletions.
8 changes: 8 additions & 0 deletions src/ComputationalArt/CAGame.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ Class {
#category : #ComputationalArt
}

{
#category : #'as yet unclassified',
#'squeak_changestamp' : 'JAL 6/23/2024 17:34'
}
CAGame >> activeCellType [
^activeCellType
]

{
#category : #'as yet unclassified',
#'squeak_changestamp' : 'Sars 6/16/2024 20:52'
Expand Down
14 changes: 4 additions & 10 deletions src/ComputationalArt/CAOverlay.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ CAOverlay >> game: aCAGame [

{
#category : #'as yet unclassified',
#'squeak_changestamp' : 'Sars 6/23/2024 16:48'
#'squeak_changestamp' : 'JAL 6/23/2024 17:19'
}
CAOverlay >> initialize [
| lastHeight menus |
Expand All @@ -39,16 +39,10 @@ CAOverlay >> initialize [
do: [:m |
m y: lastHeight.
m fitChildren;
padding: (Rectangle origin: 10 @ 10 corner: 10 @ 30).
padding: (Rectangle origin: 10 @ 10 corner: 10 @ 50).
lastHeight := lastHeight + m height.
self addMorph: m].
self fitChildren.
self
padding: (Rectangle origin: 10 @ 10 corner: 10 @ 10).
self
color: (Color
r: 0.5
g: 0.5
b: 0.5
alpha: 0.3)
self padding: (Rectangle origin: 10 @ 10 corner: 10 @ 10).
self color: (Color r: 0.5 g: 0.5 b: 0.5 alpha: 0.3)
]
2 changes: 1 addition & 1 deletion src/ComputationalArt/CAOverlayBlockMenu.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Class {

{
#category : #'as yet unclassified',
#'squeak_changestamp' : 'JAL 6/23/2024 15:03'
#'squeak_changestamp' : 'JAL 6/23/2024 17:30'
}
CAOverlayBlockMenu >> initialize [
| blockList |
Expand Down
49 changes: 49 additions & 0 deletions src/ComputationalArtTests/CAOverlayTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Class {
#name : #CAOverlayTest,
#superclass : #TestCase,
#instVars : [
'overlay',
'game'
],
#category : #ComputationalArtTests
}

{
#category : #'as yet unclassified',
#'squeak_changestamp' : 'JAL 6/23/2024 17:31'
}
CAOverlayTest >> expectedFailures [
^ {#testFillEmptyFail}
]

{
#category : #'as yet unclassified',
#'squeak_changestamp' : 'JAL 6/23/2024 17:48'
}
CAOverlayTest >> setUp [
game := CAGame new.
overlay := CAOverlay new.
overlay game: game.
]

{
#category : #'as yet unclassified',
#'squeak_changestamp' : 'JAL 6/23/2024 17:35'
}
CAOverlayTest >> tearDown [
game := nil.
overlay := nil.
]

{
#category : #'as yet unclassified',
#'squeak_changestamp' : 'JAL 6/23/2024 17:49'
}
CAOverlayTest >> testBlockMenu [
| list blocks |
blocks := CABlocks new.
list := (overlay submorphOfClass: CAOverlayBlockMenu) submorphOfClass: CAOverlayList.
list submorphsDo: [:s |
s click.
self assert: (blocks nameOf: (game activeCellType)) equals: s contents asLowercase].
]

0 comments on commit b7b13e5

Please sign in to comment.