@@ -113,7 +113,7 @@ GMTEEditorTileMap >> model: anObject [
113113
114114{
115115 #category : #' event handling' ,
116- #' squeak_changestamp' : ' Valentin Teutschbein 7/9/2024 09:26 '
116+ #' squeak_changestamp' : ' Valentin Teutschbein 7/9/2024 21:46 '
117117}
118118GMTEEditorTileMap >> mouseDown: anEvent [
119119 " Implements placement of tiles"
@@ -125,14 +125,14 @@ GMTEEditorTileMap >> mouseDown: anEvent [
125125 selectedIndex := self tileIndexFromPosition: anEvent position.
126126 self model brush firstMatrixIndex: selectedIndex.
127127 selectedCoordinates := self model brush executeWithMatrixIndex: selectedIndex andLayer: (self tileMatrixStack layer: activeLayer).
128- self updateTiles: selectedCoordinates inLayer: activeLayer FromEvent: anEvent.
128+ " self updateTiles: selectedCoordinates inLayer: activeLayer FromEvent: anEvent."
129129
130130 ^ true
131131]
132132
133133{
134134 #category : #' event handling' ,
135- #' squeak_changestamp' : ' Valentin Teutschbein 7/6 /2024 15:22 '
135+ #' squeak_changestamp' : ' Valentin Teutschbein 7/9 /2024 22:02 '
136136}
137137GMTEEditorTileMap >> mouseMove: anEvent [
138138 " Implements highlighting of tiles when hovering"
@@ -142,7 +142,7 @@ GMTEEditorTileMap >> mouseMove: anEvent [
142142
143143 activeLayer := self model selectedLayers anyOne.
144144 selectedCoordinates := self model brush executeWithMatrixIndex: (self tileIndexFromPosition: anEvent position) andLayer: (self tileMatrixStack layer: activeLayer).
145-
145+ (anEvent redButtonPressed or : [anEvent yellowButtonPressed]) ifFalse: [ self model brush resetOutputSet].
146146 self tileSelectionSet clearAllHighlightings.
147147
148148 selectedCoordinates ifNil: [
@@ -151,18 +151,21 @@ GMTEEditorTileMap >> mouseMove: anEvent [
151151 (selectedCoordinates select: [:c | (self tileMatrixStack layer: activeLayer) inBounds: c]) do: [:c |
152152 hoveredTileHighlighting := self highlightingTileFromIndex: c.
153153 hoveredTileHighlighting ifNotNil: [self tileSelectionSet highlightTile: hoveredTileHighlighting]].
154-
155- self updateTiles: selectedCoordinates inLayer: activeLayer FromEvent: anEvent.
156154]
157155
158156{
159157 #category : #' event handling' ,
160- #' squeak_changestamp' : ' Valentin Teutschbein 7/9/2024 09:04 '
158+ #' squeak_changestamp' : ' Valentin Teutschbein 7/9/2024 21:58 '
161159}
162160GMTEEditorTileMap >> mouseUp: anEvent [
163161
162+ | indicesToAdd activeLayer |
164163 (self previousTileStates size > 0 ) ifTrue: [self saveTileEditChanges].
165164 self model brush firstMatrixIndex: nil .
165+ indicesToAdd := self model brush outputSet.
166+ activeLayer := self model selectedLayers anyOne.
167+ self updateTiles: (indicesToAdd asCollection) inLayer: activeLayer FromEvent: anEvent.
168+ self model brush resetOutputSet.
166169]
167170
168171{
@@ -320,15 +323,14 @@ GMTEEditorTileMap >> updateTileSprite: aTile [
320323
321324{
322325 #category : #updating ,
323- #' squeak_changestamp' : ' Valentin Teutschbein 7/6 /2024 12:00 '
326+ #' squeak_changestamp' : ' Valentin Teutschbein 7/9 /2024 22:07 '
324327}
325328GMTEEditorTileMap >> updateTiles: aCoordinateCollection inLayer: aLayer FromEvent: anEvent [
326329 " Add currently selected tile (model) to editable matrix stack at mouse position"
327330 | tile |
328-
329- (self tileIndexFromPosition: anEvent position) ifNil: [^ nil ].
330331 self flag: ' saveNewImage confict with alex fix?' .
331- (anEvent redButtonPressed and : [self model selectedTile notNil])
332+ (self tileIndexFromPosition: anEvent position) ifNil: [^ nil ].
333+ (anEvent redButtonChanged and : [self model selectedTile notNil])
332334 ifTrue: [
333335 aCoordinateCollection do: [:c |
334336 self savePreviousImageFromMatrixCoordinate: c inLayer: aLayer.
@@ -340,7 +342,7 @@ GMTEEditorTileMap >> updateTiles: aCoordinateCollection inLayer: aLayer FromEven
340342 self saveNewImageFromPosition: tile position inLayer: aLayer]
341343 ].
342344 self model savedSinceModified: false ].
343- (anEvent yellowButtonPressed )
345+ (anEvent yellowButtonChanged )
344346 ifTrue: [
345347 aCoordinateCollection do: [:c |
346348 | tilePos |
0 commit comments