Skip to content

Commit

Permalink
Merge origin/tmm-dev into tmm-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksander Morgensterns committed May 22, 2024
2 parents 55e58ff + 2b8740c commit 8383719
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 6 deletions.
19 changes: 15 additions & 4 deletions source/GM-TE/GMTEEditableTileMap.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,22 @@ 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."

| 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 [

Expand All @@ -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]
]

{
Expand Down
9 changes: 9 additions & 0 deletions source/GM-TE/GMTEEditor.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
13 changes: 13 additions & 0 deletions source/GM-TE/GMTEImageMorph.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
22 changes: 20 additions & 2 deletions source/GM-TE/GMTETile.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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
]

0 comments on commit 8383719

Please sign in to comment.