Skip to content

Commit 9ede63d

Browse files
committed
Merge origin/tmm-dev into tmm-dev
2 parents d334bfc + 286fbf8 commit 9ede63d

File tree

1 file changed

+35
-16
lines changed

1 file changed

+35
-16
lines changed

source/GM-TE/GMTEEditorTileMap.class.st

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,11 @@ GMTEEditorTileMap >> mouseDown: anEvent [
131131

132132
{
133133
#category : #'event handling',
134-
#'squeak_changestamp' : 'Valentin Teutschbein 7/5/2024 16:21'
134+
#'squeak_changestamp' : 'Alex M 7/5/2024 21:29'
135135
}
136136
GMTEEditorTileMap >> mouseMove: anEvent [
137+
138+
self mouseDown: anEvent
137139
"Implements highlighting of tiles when hovering"
138140
"
139141
| hoveredTile hoveredTileHighlighting activeLayer |
@@ -179,11 +181,12 @@ GMTEEditorTileMap >> previousTileStates: anObject [
179181

180182
{
181183
#category : #initialization,
182-
#'squeak_changestamp' : 'Valentin Teutschbein 7/5/2024 17:19'
184+
#'squeak_changestamp' : 'Alex M 7/5/2024 21:30'
183185
}
184186
GMTEEditorTileMap >> radiusBrushFromCenter: aPos withRadius: aRadius [
185187

186188
|collection|
189+
aPos ifNil: [^nil].
187190
self flag: 'temporary only'.
188191
collection := OrderedCollection new.
189192
collection add: aPos.
@@ -231,17 +234,39 @@ GMTEEditorTileMap >> resetTileEditChanges [
231234

232235
{
233236
#category : #'command processing',
234-
#'squeak_changestamp' : 'Alex M 7/1/2024 16:01'
237+
#'squeak_changestamp' : 'Alex M 7/6/2024 01:31'
238+
}
239+
GMTEEditorTileMap >> saveNewImageFromCoordinate: aCoordinate inLayer: aLayer [
240+
| tile |
241+
242+
tile := self tileMatrixStack layer: aLayer at: aCoordinate y at: aCoordinate x.
243+
244+
tile
245+
ifNil: [self currentTileChanges at: {aCoordinate x. aCoordinate y. aLayer} put: nil]
246+
ifNotNil: [self currentTileChanges at: {aCoordinate x. aCoordinate y. aLayer} put: tile fullResolutionSprite]
247+
]
248+
249+
{
250+
#category : #'command processing',
251+
#'squeak_changestamp' : 'Alex M 7/6/2024 01:34'
235252
}
236253
GMTEEditorTileMap >> saveNewImageFromPosition: aPosition inLayer: aLayer [
237-
| coordinates tile |
238254

239-
coordinates := self tileIndexFromPosition: aPosition.
240-
tile := self tileMatrixStack layer: aLayer at: coordinates y at: coordinates x.
255+
self saveNewImageFromCoordinate: (self tileIndexFromPosition: aPosition) inLayer: aLayer
256+
]
257+
258+
{
259+
#category : #'command processing',
260+
#'squeak_changestamp' : 'Alex M 7/6/2024 01:54'
261+
}
262+
GMTEEditorTileMap >> savePreviousImageFromCoordinate: aCoordinate inLayer: aLayer [
263+
| tile |
264+
265+
tile := self tileMatrixStack layer: aLayer at: aCoordinate y at: aCoordinate x.
241266

242267
tile
243-
ifNil: [self currentTileChanges at: {coordinates x. coordinates y. aLayer} put: nil]
244-
ifNotNil: [self currentTileChanges at: {coordinates x. coordinates y. aLayer} put: tile fullResolutionSprite]
268+
ifNil: [self previousTileStates at: {aCoordinate x. aCoordinate y. aLayer} ifAbsentPut: nil]
269+
ifNotNil: [self previousTileStates at: {aCoordinate x. aCoordinate y. aLayer} ifAbsentPut: tile fullResolutionSprite]
245270
]
246271

247272
{
@@ -260,17 +285,11 @@ GMTEEditorTileMap >> savePreviousImageFromMatrixCoordinate: aCoordinate inLayer:
260285

261286
{
262287
#category : #'command processing',
263-
#'squeak_changestamp' : 'Valentin Teutschbein 7/6/2024 11:46'
288+
#'squeak_changestamp' : 'Valentin Teutschbein 7/6/2024 11:58'
264289
}
265290
GMTEEditorTileMap >> savePreviousImageFromPosition: aPosition inLayer: aLayer [
266-
| coordinates tile |
267291

268-
coordinates := self tileIndexFromPosition: aPosition.
269-
tile := self tileMatrixStack layer: aLayer at: coordinates y at: coordinates x.
270-
271-
tile
272-
ifNil: [self previousTileStates at: {coordinates x. coordinates y. aLayer} ifAbsentPut: nil]
273-
ifNotNil: [self previousTileStates at: {coordinates x. coordinates y. aLayer} ifAbsentPut: tile fullResolutionSprite]
292+
self savePreviousImageFromCoordinate: (self tileIndexFromPosition: aPosition) inLayer: aLayer
274293
]
275294

276295
{

0 commit comments

Comments
 (0)