@@ -131,9 +131,11 @@ GMTEEditorTileMap >> mouseDown: anEvent [
131
131
132
132
{
133
133
#category : #' event handling' ,
134
- #' squeak_changestamp' : ' Valentin Teutschbein 7/5/2024 16:21 '
134
+ #' squeak_changestamp' : ' Alex M 7/5/2024 21:29 '
135
135
}
136
136
GMTEEditorTileMap >> mouseMove: anEvent [
137
+
138
+ self mouseDown: anEvent
137
139
" Implements highlighting of tiles when hovering"
138
140
"
139
141
| hoveredTile hoveredTileHighlighting activeLayer |
@@ -179,11 +181,12 @@ GMTEEditorTileMap >> previousTileStates: anObject [
179
181
180
182
{
181
183
#category : #initialization ,
182
- #' squeak_changestamp' : ' Valentin Teutschbein 7/5/2024 17:19 '
184
+ #' squeak_changestamp' : ' Alex M 7/5/2024 21:30 '
183
185
}
184
186
GMTEEditorTileMap >> radiusBrushFromCenter: aPos withRadius: aRadius [
185
187
186
188
|collection |
189
+ aPos ifNil: [^ nil ].
187
190
self flag: ' temporary only' .
188
191
collection := OrderedCollection new .
189
192
collection add: aPos.
@@ -231,17 +234,39 @@ GMTEEditorTileMap >> resetTileEditChanges [
231
234
232
235
{
233
236
#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'
235
252
}
236
253
GMTEEditorTileMap >> saveNewImageFromPosition: aPosition inLayer: aLayer [
237
- | coordinates tile |
238
254
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.
241
266
242
267
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]
245
270
]
246
271
247
272
{
@@ -260,17 +285,11 @@ GMTEEditorTileMap >> savePreviousImageFromMatrixCoordinate: aCoordinate inLayer:
260
285
261
286
{
262
287
#category : #' command processing' ,
263
- #' squeak_changestamp' : ' Valentin Teutschbein 7/6/2024 11:46 '
288
+ #' squeak_changestamp' : ' Valentin Teutschbein 7/6/2024 11:58 '
264
289
}
265
290
GMTEEditorTileMap >> savePreviousImageFromPosition: aPosition inLayer: aLayer [
266
- | coordinates tile |
267
291
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
274
293
]
275
294
276
295
{
0 commit comments