@@ -374,11 +374,11 @@ GMTEEditor >> associatedMorph [
374
374
375
375
{
376
376
#category : #accessing ,
377
- #' squeak_changestamp' : ' TW 6/25 /2024 15:55 '
377
+ #' squeak_changestamp' : ' mcjj 7/12 /2024 19:38 '
378
378
}
379
379
GMTEEditor >> associatedMorph: anObject [
380
380
381
- associatedMorph := anObject.
381
+ associatedMorph := anObject
382
382
]
383
383
384
384
{
@@ -450,11 +450,11 @@ GMTEEditor >> brushButtons [
450
450
451
451
{
452
452
#category : #accessing ,
453
- #' squeak_changestamp' : ' TW 7/9 /2024 18:19 '
453
+ #' squeak_changestamp' : ' mcjj 7/12 /2024 19:38 '
454
454
}
455
455
GMTEEditor >> brushButtons: anObject [
456
456
457
- brushButtons := anObject.
457
+ brushButtons := anObject
458
458
]
459
459
460
460
{
@@ -1065,12 +1065,15 @@ GMTEEditor >> exportAsImage [
1065
1065
1066
1066
{
1067
1067
#category : #' menu button functions' ,
1068
- #' squeak_changestamp' : ' jj 6/23 /2024 14:14 '
1068
+ #' squeak_changestamp' : ' Ivo Zilkenat 7/12 /2024 19:18 '
1069
1069
}
1070
1070
GMTEEditor >> exportAsMorph [
1071
1071
" saves the current tileMap as a .morph file, which allows for reimporting"
1072
1072
1073
- (self tileMap copy model: nil ) saveOnFile.
1073
+ ((self tileMap veryDeepCopy)
1074
+ model: nil ;
1075
+ resetView
1076
+ ) saveOnFile.
1074
1077
self savedSinceModified: true
1075
1078
]
1076
1079
@@ -1101,11 +1104,12 @@ GMTEEditor >> exportMenu [
1101
1104
1102
1105
{
1103
1106
#category : #' input handling' ,
1104
- #' squeak_changestamp' : ' mcjj 7/12/2024 17:12 '
1107
+ #' squeak_changestamp' : ' mcjj 7/12/2024 19:34 '
1105
1108
}
1106
1109
GMTEEditor >> filterEvent: aKeyboardEvent for: anObject [
1107
- | key |
1110
+ " handles keyboard shortcuts "
1108
1111
1112
+ | key |
1109
1113
aKeyboardEvent isKeystroke
1110
1114
ifFalse: [^ aKeyboardEvent].
1111
1115
@@ -1118,7 +1122,6 @@ GMTEEditor >> filterEvent: aKeyboardEvent for: anObject [
1118
1122
[$o] - > [self importFromTileset].
1119
1123
[$g] - > [self toggleGrid].
1120
1124
[$h] - > [self toggleBackgroundTiles].
1121
- [$r] - > [self rotateSelectedTile].
1122
1125
1123
1126
[$a] - > [self addLayer].
1124
1127
[$n] - > [self renameLayer].
@@ -1129,6 +1132,7 @@ GMTEEditor >> filterEvent: aKeyboardEvent for: anObject [
1129
1132
1130
1133
[$z] - > [self undo].
1131
1134
[$y] - > [self redo].
1135
+ [$r] - > [self rotateSelectedTile].
1132
1136
[$1 ] - > [self selectRadiusBrush].
1133
1137
[$2 ] - > [self selectLineBrush].
1134
1138
[$3 ] - > [self selectFillBrush].
@@ -1800,6 +1804,16 @@ GMTEEditor >> renameLayer [
1800
1804
1801
1805
]
1802
1806
1807
+ {
1808
+ #category : #tilemap ,
1809
+ #' squeak_changestamp' : ' Alex M 7/12/2024 19:51'
1810
+ }
1811
+ GMTEEditor >> rescaleGridDimensions: aPoint [
1812
+
1813
+ (self getGridWidth = aPoint x) ifFalse: [self rescaleGridWidth: aPoint x].
1814
+ (self getGridHeight = aPoint y) ifFalse: [self rescaleGridHeight: aPoint y].
1815
+ ]
1816
+
1803
1817
{
1804
1818
#category : #tilemap ,
1805
1819
#' squeak_changestamp' : ' Alex M 7/1/2024 21:04'
@@ -2072,38 +2086,37 @@ GMTEEditor >> setBrushRadiusFromText: aText [
2072
2086
2073
2087
{
2074
2088
#category : #tilemap ,
2075
- #' squeak_changestamp' : ' Alex M 7/1 /2024 21:06 '
2089
+ #' squeak_changestamp' : ' Alex M 7/12 /2024 20:03 '
2076
2090
}
2077
2091
GMTEEditor >> setGridHeight: aText [
2078
2092
" adjusts the grid height"
2079
2093
2080
- | oldHeight newHeight |
2081
- oldHeight := self getGridHeight.
2094
+ | oldSize newHeight |
2095
+ oldSize := self getGridWidth @ self getGridHeight.
2082
2096
newHeight := self parseGridSize: aText.
2083
2097
newHeight ifNotNil: [
2084
2098
self
2085
- rescaleGridHeight: newHeight;
2086
- addCommand: ( GMTETilemapSizeCommand prevValue: oldHeight newValue: newHeight method: # rescaleGridHeight: editor: self ) ].
2099
+ addCommand: ( GMTETilemapSizeCommand prevSize: oldSize newSize: oldSize x @ newHeight editor: self ) ;
2100
+ rescaleGridHeight: newHeight ].
2087
2101
^ true
2088
2102
2089
2103
2090
2104
]
2091
2105
2092
2106
{
2093
2107
#category : #tilemap ,
2094
- #' squeak_changestamp' : ' Alex M 7/1 /2024 21 :06'
2108
+ #' squeak_changestamp' : ' Alex M 7/12 /2024 20 :06'
2095
2109
}
2096
2110
GMTEEditor >> setGridWidth: aText [
2097
2111
" adjusts the grid width"
2098
- " TODO: Fix visual layer bug"
2099
2112
2100
- | oldWidth newWidth |
2101
- oldWidth := self getGridWidth.
2113
+ | oldSize newWidth |
2114
+ oldSize := self getGridWidth @ self getGridHeight .
2102
2115
newWidth := self parseGridSize: aText.
2103
- oldWidth ifNotNil: [
2116
+ newWidth ifNotNil: [
2104
2117
self
2105
- rescaleGridWidth: newWidth;
2106
- addCommand: ( GMTETilemapSizeCommand prevValue: oldWidth newValue: newWidth method: # rescaleGridWidth: editor: self ) ].
2118
+ addCommand: ( GMTETilemapSizeCommand prevSize: oldSize newSize: newWidth @ oldSize y editor: self ) ;
2119
+ rescaleGridWidth: newWidth ].
2107
2120
^ true
2108
2121
2109
2122
]
@@ -2298,7 +2311,7 @@ GMTEEditor >> trayViewer: anObject [
2298
2311
2299
2312
{
2300
2313
#category : #' command processing' ,
2301
- #' squeak_changestamp' : ' Alex M 7/10 /2024 14:17 '
2314
+ #' squeak_changestamp' : ' Alex M 7/12 /2024 19:52 '
2302
2315
}
2303
2316
GMTEEditor >> undo [
2304
2317
@@ -2307,10 +2320,8 @@ GMTEEditor >> undo [
2307
2320
ifTrue: [(self commands at: self currentCommand) undo.
2308
2321
self
2309
2322
savedSinceModified: false ;
2310
- currentCommand: self currentCommand - 1 .
2311
- ({GMTETilemapSizeCommand . GMTEDeleteLayersCommand } includes: (self commands at: self currentCommand + 1 ) class )
2312
- ifTrue: [self redoAllCommandsUntil: self currentCommand].
2313
- self savedSinceModified: false ]
2323
+ currentCommand: self currentCommand - 1 ;
2324
+ savedSinceModified: false ]
2314
2325
]
2315
2326
2316
2327
{
0 commit comments