diff --git a/source/GM-TE/GMTEEditableTileMap.class.st b/source/GM-TE/GMTEEditableTileMap.class.st index 8adcb84a..087cbcdc 100644 --- a/source/GM-TE/GMTEEditableTileMap.class.st +++ b/source/GM-TE/GMTEEditableTileMap.class.st @@ -68,7 +68,7 @@ GMTEEditableTileMap >> model: anObject [ { #category : #'event handling', - #'squeak_changestamp' : 'TW 5/22/2024 18:32' + #'squeak_changestamp' : 'TW 5/22/2024 23:40' } GMTEEditableTileMap >> mouseDown: anEvent [ "TODO: make this useful." @@ -76,13 +76,14 @@ GMTEEditableTileMap >> mouseDown: anEvent [ | clickedTile | clickedTile := self tileFromPosition: anEvent position. - clickedTile ifNotNil: [self updateTileSprite: clickedTile]. + (anEvent redButtonPressed) ifTrue: [clickedTile ifNotNil: [self updateTileSprite: clickedTile]]. + (anEvent yellowButtonPressed) ifTrue: [clickedTile ifNotNil: [clickedTile reset]]. ^ true. ] { #category : #'event handling', - #'squeak_changestamp' : 'Alex M 5/22/2024 19:57' + #'squeak_changestamp' : 'TW 5/22/2024 23:37' } GMTEEditableTileMap >> mouseMove: anEvent [ @@ -96,7 +97,17 @@ GMTEEditableTileMap >> mouseMove: anEvent [ self tileSelectionSet clearAllHighlightings. self tileSelectionSet highlightTile: hoveredTile. - (anEvent redButtonPressed) ifTrue: [hoveredTile ifNotNil: [self updateTileSprite: hoveredTile]] + (anEvent redButtonPressed) ifTrue: [hoveredTile ifNotNil: [self updateTileSprite: hoveredTile]]. + (anEvent yellowButtonPressed) ifTrue: [hoveredTile ifNotNil: [hoveredTile reset]] +] + +{ + #category : #'as yet unclassified', + #'squeak_changestamp' : 'TW 5/23/2024 00:08' +} +GMTEEditableTileMap >> resetAll [ + + self gridTileMatrix do: [:aTile | aTile reset] ] { diff --git a/source/GM-TE/GMTEEditor.class.st b/source/GM-TE/GMTEEditor.class.st index 359c6e46..a61b2eba 100644 --- a/source/GM-TE/GMTEEditor.class.st +++ b/source/GM-TE/GMTEEditor.class.st @@ -558,6 +558,15 @@ GMTEEditor >> open [ ^newMorph ] +{ + #category : #'button functions', + #'squeak_changestamp' : 'TW 5/23/2024 00:13' +} +GMTEEditor >> resetAll [ + + self tileMapMatrix resetAll +] + { #category : #accessing, #'squeak_changestamp' : 'TW 5/22/2024 16:12' diff --git a/source/GM-TE/GMTEImageMorph.class.st b/source/GM-TE/GMTEImageMorph.class.st index d396a457..e4bb29e3 100644 --- a/source/GM-TE/GMTEImageMorph.class.st +++ b/source/GM-TE/GMTEImageMorph.class.st @@ -39,6 +39,19 @@ GMTEImageMorph >> fullResolutionSprite: anObject [ fullResolutionSprite := anObject. ] +{ + #category : #'as yet unclassified', + #'squeak_changestamp' : 'TW 5/22/2024 23:32' +} +GMTEImageMorph >> setPlaceholderColor: aColor [ + + | placeholderForm | + placeholderForm := Form extent: self extent depth: 32. + placeholderForm fillColor: aColor. + self fullResolutionSprite: placeholderForm. + self image: placeholderForm. +] + { #category : #'as yet unclassified', #'squeak_changestamp' : 'TW 5/22/2024 17:16' diff --git a/source/GM-TE/GMTETile.class.st b/source/GM-TE/GMTETile.class.st index d8789902..50382dfb 100644 --- a/source/GM-TE/GMTETile.class.st +++ b/source/GM-TE/GMTETile.class.st @@ -6,12 +6,30 @@ Class { { #category : #'as yet unclassified', - #'squeak_changestamp' : 'Ivo Zilkenat 5/21/2024 20:08' + #'squeak_changestamp' : 'TW 5/22/2024 23:31' +} +GMTETile class >> placeHolderColor [ + + ^Color veryLightGray +] + +{ + #category : #'as yet unclassified', + #'squeak_changestamp' : 'TW 5/22/2024 23:32' } GMTETile class >> position: aPoint extent: anExtent [ "comment stating purpose of message" ^ self new - setPlaceholderWithExtent: anExtent color: Color veryLightGray; + setPlaceholderWithExtent: anExtent color: self placeHolderColor; position: aPoint ] + +{ + #category : #'as yet unclassified', + #'squeak_changestamp' : 'TW 5/22/2024 23:33' +} +GMTETile >> reset [ + + self setPlaceholderColor: GMTETile placeHolderColor +]