@@ -23,75 +23,77 @@ Class {
23
23
24
24
{
25
25
#category : #constants ,
26
- #' squeak_changestamp' : ' tw 7/12/2024 20:36 '
26
+ #' squeak_changestamp' : ' mcjj 7/12/2024 21:41 '
27
27
}
28
28
GMTEEditor class >> editorMinimumExtent [
29
- " minimum extent of the tile editor"
29
+ " Minimum extent of the tile editor"
30
30
31
31
^ RealEstateAgent scaleFactor * (700 @ 400 )
32
32
]
33
33
34
34
{
35
35
#category : #constants ,
36
- #' squeak_changestamp' : ' tw 7/12/2024 20:12 '
36
+ #' squeak_changestamp' : ' mcjj 7/12/2024 21:41 '
37
37
}
38
38
GMTEEditor class >> getInputFieldSize [
39
-
39
+ " Attribute input field width"
40
+
40
41
^ (TextStyle defaultFont approxWidthOfText: ' 1.00' asText)
41
42
]
42
43
43
44
{
44
45
#category : #fileHandling ,
45
- #' squeak_changestamp' : ' jj 6/23 /2024 14:08 '
46
+ #' squeak_changestamp' : ' mcjj 7/12 /2024 21:41 '
46
47
}
47
48
GMTEEditor class >> getTileMapFromFileBinary: aFileBinary [
48
- " creates a tileMap from a file binary"
49
+ " Creates a tileMap from a file binary"
49
50
50
51
^ GMTETileMap newFrom: (GMTEEditor privateGetEditorTileMapFromFileBinary: aFileBinary)
51
52
]
52
53
53
54
{
54
55
#category : #fileHandling ,
55
- #' squeak_changestamp' : ' jj 6/23 /2024 14:08 '
56
+ #' squeak_changestamp' : ' mcjj 7/12 /2024 21:43 '
56
57
}
57
58
GMTEEditor class >> getTileMapFromFilePath: aFilePath [
58
- " loads a tileMap from a local file path"
59
+ " Loads a tileMap from a local file path"
59
60
60
61
^ GMTETileMap newFrom: (GMTEEditor privateGetEditorTileMapFromFilePath: aFilePath)
61
62
]
62
63
63
64
{
64
65
#category : #fileHandling ,
65
- #' squeak_changestamp' : ' jj 6/23 /2024 14:09 '
66
+ #' squeak_changestamp' : ' mcjj 7/12 /2024 21:43 '
66
67
}
67
68
GMTEEditor class >> getTileMapFromProjectName: aName withPath: aPath [
68
- " loads a tileMap from the git asset browser"
69
+ " Loads a tileMap from the git asset browser"
69
70
70
71
^ GMTEEditor getTileMapFromFileBinary: ((GitAssetLoader for: aName) loadAsset: aPath)
71
72
]
72
73
73
74
{
74
75
#category : #constants ,
75
- #' squeak_changestamp' : ' TW 6/23 /2024 21:37 '
76
+ #' squeak_changestamp' : ' mcjj 7/12 /2024 21:44 '
76
77
}
77
78
GMTEEditor class >> getVisibilityIndicator: aBoolean [
78
-
79
+
79
80
aBoolean
80
81
ifTrue: [^ ' (v)' ]
81
82
ifFalse: [^ ' (h)' ]
82
83
]
83
84
84
85
{
85
- #category : #' as yet unclassified ' ,
86
- #' squeak_changestamp' : ' tw 7/12/2024 18:33 '
86
+ #category : #utility ,
87
+ #' squeak_changestamp' : ' mcjj 7/12/2024 21:47 '
87
88
}
88
89
GMTEEditor class >> hLayoutFrame: intI ofN: intN [
89
-
90
+ " Calculates the frame of equal sized specs"
91
+
90
92
^ self hLayoutFrame: intI ofN: intN vSymmetric: 0
91
93
]
92
94
93
95
{
94
- #category : #' as yet unclassified ' ,
96
+ #category : #utility ,
95
97
#' squeak_changestamp' : ' tw 7/11/2024 17:03'
96
98
}
97
99
GMTEEditor class >> hLayoutFrame: intI ofN: intN vSymmetric: aFloat [
@@ -100,18 +102,17 @@ GMTEEditor class >> hLayoutFrame: intI ofN: intN vSymmetric: aFloat [
100
102
]
101
103
102
104
{
103
- #category : #' as yet unclassified ' ,
104
- #' squeak_changestamp' : ' tw 7/11 /2024 17:05 '
105
+ #category : #utility ,
106
+ #' squeak_changestamp' : ' mcjj 7/12 /2024 21:45 '
105
107
}
106
108
GMTEEditor class >> hLayoutFrame: intI ofN: intN vUp: aFloat down: anotherFloat [
107
-
108
109
" useful for building buttons, maybe move this to instance? TODO FLAG"
109
110
110
111
^ LayoutFrame fractions: ((intI - 1 / intN @ aFloat) corner: (intI / intN @ (1 - anotherFloat)))
111
112
]
112
113
113
114
{
114
- #category : #' as yet unclassified ' ,
115
+ #category : #initialization ,
115
116
#' squeak_changestamp' : ' tw 7/12/2024 16:21'
116
117
}
117
118
GMTEEditor class >> initialize [
@@ -122,37 +123,40 @@ GMTEEditor class >> initialize [
122
123
123
124
{
124
125
#category : #constants ,
125
- #' squeak_changestamp' : ' TW 7/9 /2024 11:28 '
126
+ #' squeak_changestamp' : ' mcjj 7/12 /2024 21:48 '
126
127
}
127
128
GMTEEditor class >> maxBrushRadius [
128
-
129
+ " Maximum allowed radius for brushes"
130
+
129
131
^ 50
130
132
]
131
133
132
134
{
133
135
#category : #constants ,
134
- #' squeak_changestamp' : ' Ivo Zilkenat 7/9 /2024 11:31 '
136
+ #' squeak_changestamp' : ' mcjj 7/12 /2024 21:48 '
135
137
}
136
138
GMTEEditor class >> maxNumberOfCommands [
139
+ " Maximum amount of stored commands"
137
140
138
141
^ 50
139
142
]
140
143
141
144
{
142
145
#category : #constants ,
143
- #' squeak_changestamp' : ' TW 7/9 /2024 11:28 '
146
+ #' squeak_changestamp' : ' mcjj 7/12 /2024 21:49 '
144
147
}
145
148
GMTEEditor class >> minBrushRadius [
146
-
149
+ " Minimum allowed radius for brushes"
150
+
147
151
^ 0
148
152
]
149
153
150
154
{
151
155
#category : #fileHandling ,
152
- #' squeak_changestamp' : ' jj 6/23 /2024 14:09 '
156
+ #' squeak_changestamp' : ' mcjj 7/12 /2024 21:53 '
153
157
}
154
158
GMTEEditor class >> privateGetEditorTileMapFromFileBinary: aFileBinary [
155
- " loads a EditorTileMap from a file binary"
159
+ " Loads a EditorTileMap from a file binary"
156
160
157
161
|aFileStream tileMap |
158
162
aFileStream := (MultiByteBinaryOrTextStream with: aFileBinary) binary reset.
@@ -163,39 +167,41 @@ GMTEEditor class >> privateGetEditorTileMapFromFileBinary: aFileBinary [
163
167
164
168
{
165
169
#category : #fileHandling ,
166
- #' squeak_changestamp' : ' jj 6/23 /2024 14:07 '
170
+ #' squeak_changestamp' : ' mcjj 7/12 /2024 21:53 '
167
171
}
168
172
GMTEEditor class >> privateGetEditorTileMapFromFilePath: aFilePath [
169
- " loads a EditorTileMap from a local file path"
173
+ " Loads a EditorTileMap from a local file path"
170
174
171
175
^ GMTEEditor privateGetEditorTileMapFromFileBinary: (FileStream readOnlyFileNamed: aFilePath) binary contentsOfEntireFile
172
176
]
173
177
174
178
{
175
179
#category : #squeakutils ,
176
- #' squeak_changestamp' : ' tw 7/12/2024 16:20 '
180
+ #' squeak_changestamp' : ' mcjj 7/12/2024 21:53 '
177
181
}
178
182
GMTEEditor class >> register [
179
- " adds the tile editor to app menu"
183
+ " Adds the tile editor to app menu"
180
184
181
185
" Maybe call this on new?"
182
186
TheWorldMenu registerOpenCommand: {' TileMap Editor' . {self . #startup }}
183
187
]
184
188
185
189
{
186
190
#category : #constants ,
187
- #' squeak_changestamp' : ' TW 6/25 /2024 15:53 '
191
+ #' squeak_changestamp' : ' mcjj 7/12 /2024 21:54 '
188
192
}
189
193
GMTEEditor class >> singleLayerActionNames [
190
-
194
+ " Layer actions that only work for one selected layer"
195
+
191
196
^ {' buttonMoveLayerDown' . ' buttonMoveLayerUp' . ' buttonRenameLayer' }
192
197
]
193
198
194
199
{
195
200
#category : #startup ,
196
- #' squeak_changestamp' : ' Alex M 7/9 /2024 17:59 '
201
+ #' squeak_changestamp' : ' mcjj 7/12 /2024 21:57 '
197
202
}
198
203
GMTEEditor class >> startup [
204
+ " Opens the editor with a startup wizard"
199
205
200
206
(DialogWindow new
201
207
title: ' Wizard' ;
@@ -211,50 +217,50 @@ GMTEEditor class >> startup [
211
217
212
218
{
213
219
#category : #constants ,
214
- #' squeak_changestamp' : ' Alex M 7/9 /2024 17:33 '
220
+ #' squeak_changestamp' : ' mcjj 7/12 /2024 21:56 '
215
221
}
216
222
GMTEEditor class >> startupMinimumExtent [
217
- " minimum extent of the startup wizard"
223
+ " Minimum extent of the startup wizard"
218
224
219
225
^ 300 @200
220
226
]
221
227
222
228
{
223
229
#category : #constants ,
224
- #' squeak_changestamp' : ' jj 6/23 /2024 17:33 '
230
+ #' squeak_changestamp' : ' mcjj 7/12 /2024 21:57 '
225
231
}
226
232
GMTEEditor class >> tileMapMaxGridSize [
227
- " the maximum size of the tileMap per dimension"
233
+ " Maximum size of the tileMap per dimension"
228
234
229
235
^ 200
230
236
]
231
237
232
238
{
233
239
#category : #constants ,
234
- #' squeak_changestamp' : ' jj 6/23 /2024 17:35 '
240
+ #' squeak_changestamp' : ' mcjj 7/12 /2024 21:57 '
235
241
}
236
242
GMTEEditor class >> tileMapMaxPaddingSize [
237
- " the maximum size of the tileMap padding"
243
+ " Maximum size of the tileMap padding"
238
244
239
245
^ 0.9
240
246
]
241
247
242
248
{
243
249
#category : #constants ,
244
- #' squeak_changestamp' : ' jj 6/23 /2024 17:33 '
250
+ #' squeak_changestamp' : ' mcjj 7/12 /2024 21:57 '
245
251
}
246
252
GMTEEditor class >> tileMapMinGridSize [
247
- " the minimum size of the tileMap per dimension"
253
+ " Minimum size of the tileMap per dimension"
248
254
249
255
^ 0
250
256
]
251
257
252
258
{
253
259
#category : #constants ,
254
- #' squeak_changestamp' : ' jj 6/23 /2024 17:34 '
260
+ #' squeak_changestamp' : ' mcjj 7/12 /2024 21:57 '
255
261
}
256
262
GMTEEditor class >> tileMapMinPaddingSize [
257
- " the minimum size of the tileMap padding"
263
+ " Minimum size of the tileMap padding"
258
264
259
265
^ 0
260
266
]
@@ -269,27 +275,27 @@ GMTEEditor class >> toolBarVSpace [
269
275
]
270
276
271
277
{
272
- #category : #' as yet unclassified ' ,
273
- #' squeak_changestamp' : ' tw 7/12/2024 18:33 '
278
+ #category : #utility ,
279
+ #' squeak_changestamp' : ' mcjj 7/12/2024 21:58 '
274
280
}
275
281
GMTEEditor class >> vLayoutFrame: intI ofN: intN [
276
-
282
+ " Calculates the frame of equal sized specs"
283
+
277
284
^ self vLayoutFrame: intI ofN: intN hSymmetric: 0
278
285
]
279
286
280
287
{
281
- #category : #' as yet unclassified ' ,
282
- #' squeak_changestamp' : ' tw 7/12/2024 18:26 '
288
+ #category : #utility ,
289
+ #' squeak_changestamp' : ' mcjj 7/12/2024 21:58 '
283
290
}
284
291
GMTEEditor class >> vLayoutFrame: intI ofN: intN hLeft: aFloat right: anotherFloat [
285
-
286
292
" useful for building buttons, maybe move this to instance? TODO FLAG"
287
293
288
294
^ LayoutFrame fractions: ((aFloat @ (intI - 1 / intN)) corner: (1 - anotherFloat @ (intI / intN)))
289
295
]
290
296
291
297
{
292
- #category : #' as yet unclassified ' ,
298
+ #category : #utility ,
293
299
#' squeak_changestamp' : ' tw 7/12/2024 18:26'
294
300
}
295
301
GMTEEditor class >> vLayoutFrame: intI ofN: intN hSymmetric: aFloat [
@@ -1015,12 +1021,16 @@ GMTEEditor >> enableSingleLayerButtons [
1015
1021
1016
1022
{
1017
1023
#category : #' menu buttons' ,
1018
- #' squeak_changestamp' : ' tw 7/12/2024 23:10 '
1024
+ #' squeak_changestamp' : ' tw 7/12/2024 23:21 '
1019
1025
}
1020
1026
GMTEEditor >> exportAsImage [
1021
1027
" Exports the current tile map as a png"
1022
1028
1023
- self tileMap exportAsImage
1029
+ exportTilemap := self tileMap veryDeepCopy.
1030
+ exportTilemap
1031
+ hideHighlightingLayer;
1032
+ resetView;
1033
+ exportAsImage
1024
1034
]
1025
1035
1026
1036
{
0 commit comments