Skip to content

Commit a804472

Browse files
committed
Merge origin/tmm-dev into tmm-dev
2 parents 873a6ff + 9a0853a commit a804472

File tree

4 files changed

+93
-71
lines changed

4 files changed

+93
-71
lines changed

source/GM-TE/GMTEEditor.class.st

Lines changed: 63 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -23,75 +23,77 @@ Class {
2323

2424
{
2525
#category : #constants,
26-
#'squeak_changestamp' : 'tw 7/12/2024 20:36'
26+
#'squeak_changestamp' : 'mcjj 7/12/2024 21:41'
2727
}
2828
GMTEEditor class >> editorMinimumExtent [
29-
"minimum extent of the tile editor"
29+
"Minimum extent of the tile editor"
3030

3131
^ RealEstateAgent scaleFactor * (700 @ 400)
3232
]
3333

3434
{
3535
#category : #constants,
36-
#'squeak_changestamp' : 'tw 7/12/2024 20:12'
36+
#'squeak_changestamp' : 'mcjj 7/12/2024 21:41'
3737
}
3838
GMTEEditor class >> getInputFieldSize [
39-
39+
"Attribute input field width"
40+
4041
^ (TextStyle defaultFont approxWidthOfText: '1.00' asText)
4142
]
4243

4344
{
4445
#category : #fileHandling,
45-
#'squeak_changestamp' : 'jj 6/23/2024 14:08'
46+
#'squeak_changestamp' : 'mcjj 7/12/2024 21:41'
4647
}
4748
GMTEEditor class >> getTileMapFromFileBinary: aFileBinary [
48-
"creates a tileMap from a file binary"
49+
"Creates a tileMap from a file binary"
4950

5051
^ GMTETileMap newFrom: (GMTEEditor privateGetEditorTileMapFromFileBinary: aFileBinary)
5152
]
5253

5354
{
5455
#category : #fileHandling,
55-
#'squeak_changestamp' : 'jj 6/23/2024 14:08'
56+
#'squeak_changestamp' : 'mcjj 7/12/2024 21:43'
5657
}
5758
GMTEEditor class >> getTileMapFromFilePath: aFilePath [
58-
"loads a tileMap from a local file path"
59+
"Loads a tileMap from a local file path"
5960

6061
^ GMTETileMap newFrom: (GMTEEditor privateGetEditorTileMapFromFilePath: aFilePath)
6162
]
6263

6364
{
6465
#category : #fileHandling,
65-
#'squeak_changestamp' : 'jj 6/23/2024 14:09'
66+
#'squeak_changestamp' : 'mcjj 7/12/2024 21:43'
6667
}
6768
GMTEEditor class >> getTileMapFromProjectName: aName withPath: aPath [
68-
"loads a tileMap from the git asset browser"
69+
"Loads a tileMap from the git asset browser"
6970

7071
^ GMTEEditor getTileMapFromFileBinary: ((GitAssetLoader for: aName) loadAsset: aPath)
7172
]
7273

7374
{
7475
#category : #constants,
75-
#'squeak_changestamp' : 'TW 6/23/2024 21:37'
76+
#'squeak_changestamp' : 'mcjj 7/12/2024 21:44'
7677
}
7778
GMTEEditor class >> getVisibilityIndicator: aBoolean [
78-
79+
7980
aBoolean
8081
ifTrue: [^ ' (v)']
8182
ifFalse: [^ ' (h)']
8283
]
8384

8485
{
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'
8788
}
8889
GMTEEditor class >> hLayoutFrame: intI ofN: intN [
89-
90+
"Calculates the frame of equal sized specs"
91+
9092
^ self hLayoutFrame: intI ofN: intN vSymmetric: 0
9193
]
9294

9395
{
94-
#category : #'as yet unclassified',
96+
#category : #utility,
9597
#'squeak_changestamp' : 'tw 7/11/2024 17:03'
9698
}
9799
GMTEEditor class >> hLayoutFrame: intI ofN: intN vSymmetric: aFloat [
@@ -100,18 +102,17 @@ GMTEEditor class >> hLayoutFrame: intI ofN: intN vSymmetric: aFloat [
100102
]
101103

102104
{
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'
105107
}
106108
GMTEEditor class >> hLayoutFrame: intI ofN: intN vUp: aFloat down: anotherFloat [
107-
108109
"useful for building buttons, maybe move this to instance? TODO FLAG"
109110

110111
^ LayoutFrame fractions: ((intI - 1 / intN @ aFloat) corner: (intI / intN @ (1 - anotherFloat)))
111112
]
112113

113114
{
114-
#category : #'as yet unclassified',
115+
#category : #initialization,
115116
#'squeak_changestamp' : 'tw 7/12/2024 16:21'
116117
}
117118
GMTEEditor class >> initialize [
@@ -122,37 +123,40 @@ GMTEEditor class >> initialize [
122123

123124
{
124125
#category : #constants,
125-
#'squeak_changestamp' : 'TW 7/9/2024 11:28'
126+
#'squeak_changestamp' : 'mcjj 7/12/2024 21:48'
126127
}
127128
GMTEEditor class >> maxBrushRadius [
128-
129+
"Maximum allowed radius for brushes"
130+
129131
^ 50
130132
]
131133

132134
{
133135
#category : #constants,
134-
#'squeak_changestamp' : 'Ivo Zilkenat 7/9/2024 11:31'
136+
#'squeak_changestamp' : 'mcjj 7/12/2024 21:48'
135137
}
136138
GMTEEditor class >> maxNumberOfCommands [
139+
"Maximum amount of stored commands"
137140

138141
^ 50
139142
]
140143

141144
{
142145
#category : #constants,
143-
#'squeak_changestamp' : 'TW 7/9/2024 11:28'
146+
#'squeak_changestamp' : 'mcjj 7/12/2024 21:49'
144147
}
145148
GMTEEditor class >> minBrushRadius [
146-
149+
"Minimum allowed radius for brushes"
150+
147151
^ 0
148152
]
149153

150154
{
151155
#category : #fileHandling,
152-
#'squeak_changestamp' : 'jj 6/23/2024 14:09'
156+
#'squeak_changestamp' : 'mcjj 7/12/2024 21:53'
153157
}
154158
GMTEEditor class >> privateGetEditorTileMapFromFileBinary: aFileBinary [
155-
"loads a EditorTileMap from a file binary"
159+
"Loads a EditorTileMap from a file binary"
156160

157161
|aFileStream tileMap|
158162
aFileStream := (MultiByteBinaryOrTextStream with: aFileBinary) binary reset.
@@ -163,39 +167,41 @@ GMTEEditor class >> privateGetEditorTileMapFromFileBinary: aFileBinary [
163167

164168
{
165169
#category : #fileHandling,
166-
#'squeak_changestamp' : 'jj 6/23/2024 14:07'
170+
#'squeak_changestamp' : 'mcjj 7/12/2024 21:53'
167171
}
168172
GMTEEditor class >> privateGetEditorTileMapFromFilePath: aFilePath [
169-
"loads a EditorTileMap from a local file path"
173+
"Loads a EditorTileMap from a local file path"
170174

171175
^ GMTEEditor privateGetEditorTileMapFromFileBinary: (FileStream readOnlyFileNamed: aFilePath) binary contentsOfEntireFile
172176
]
173177

174178
{
175179
#category : #squeakutils,
176-
#'squeak_changestamp' : 'tw 7/12/2024 16:20'
180+
#'squeak_changestamp' : 'mcjj 7/12/2024 21:53'
177181
}
178182
GMTEEditor class >> register [
179-
"adds the tile editor to app menu"
183+
"Adds the tile editor to app menu"
180184

181185
"Maybe call this on new?"
182186
TheWorldMenu registerOpenCommand: {'TileMap Editor'. {self. #startup}}
183187
]
184188

185189
{
186190
#category : #constants,
187-
#'squeak_changestamp' : 'TW 6/25/2024 15:53'
191+
#'squeak_changestamp' : 'mcjj 7/12/2024 21:54'
188192
}
189193
GMTEEditor class >> singleLayerActionNames [
190-
194+
"Layer actions that only work for one selected layer"
195+
191196
^ {'buttonMoveLayerDown' . 'buttonMoveLayerUp' . 'buttonRenameLayer'}
192197
]
193198

194199
{
195200
#category : #startup,
196-
#'squeak_changestamp' : 'Alex M 7/9/2024 17:59'
201+
#'squeak_changestamp' : 'mcjj 7/12/2024 21:57'
197202
}
198203
GMTEEditor class >> startup [
204+
"Opens the editor with a startup wizard"
199205

200206
(DialogWindow new
201207
title: 'Wizard';
@@ -211,50 +217,50 @@ GMTEEditor class >> startup [
211217

212218
{
213219
#category : #constants,
214-
#'squeak_changestamp' : 'Alex M 7/9/2024 17:33'
220+
#'squeak_changestamp' : 'mcjj 7/12/2024 21:56'
215221
}
216222
GMTEEditor class >> startupMinimumExtent [
217-
"minimum extent of the startup wizard"
223+
"Minimum extent of the startup wizard"
218224

219225
^ 300@200
220226
]
221227

222228
{
223229
#category : #constants,
224-
#'squeak_changestamp' : 'jj 6/23/2024 17:33'
230+
#'squeak_changestamp' : 'mcjj 7/12/2024 21:57'
225231
}
226232
GMTEEditor class >> tileMapMaxGridSize [
227-
"the maximum size of the tileMap per dimension"
233+
"Maximum size of the tileMap per dimension"
228234

229235
^ 200
230236
]
231237

232238
{
233239
#category : #constants,
234-
#'squeak_changestamp' : 'jj 6/23/2024 17:35'
240+
#'squeak_changestamp' : 'mcjj 7/12/2024 21:57'
235241
}
236242
GMTEEditor class >> tileMapMaxPaddingSize [
237-
"the maximum size of the tileMap padding"
243+
"Maximum size of the tileMap padding"
238244

239245
^ 0.9
240246
]
241247

242248
{
243249
#category : #constants,
244-
#'squeak_changestamp' : 'jj 6/23/2024 17:33'
250+
#'squeak_changestamp' : 'mcjj 7/12/2024 21:57'
245251
}
246252
GMTEEditor class >> tileMapMinGridSize [
247-
"the minimum size of the tileMap per dimension"
253+
"Minimum size of the tileMap per dimension"
248254

249255
^ 0
250256
]
251257

252258
{
253259
#category : #constants,
254-
#'squeak_changestamp' : 'jj 6/23/2024 17:34'
260+
#'squeak_changestamp' : 'mcjj 7/12/2024 21:57'
255261
}
256262
GMTEEditor class >> tileMapMinPaddingSize [
257-
"the minimum size of the tileMap padding"
263+
"Minimum size of the tileMap padding"
258264

259265
^ 0
260266
]
@@ -269,27 +275,27 @@ GMTEEditor class >> toolBarVSpace [
269275
]
270276

271277
{
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'
274280
}
275281
GMTEEditor class >> vLayoutFrame: intI ofN: intN [
276-
282+
"Calculates the frame of equal sized specs"
283+
277284
^ self vLayoutFrame: intI ofN: intN hSymmetric: 0
278285
]
279286

280287
{
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'
283290
}
284291
GMTEEditor class >> vLayoutFrame: intI ofN: intN hLeft: aFloat right: anotherFloat [
285-
286292
"useful for building buttons, maybe move this to instance? TODO FLAG"
287293

288294
^ LayoutFrame fractions: ((aFloat @ (intI - 1 / intN)) corner: (1 - anotherFloat @ (intI / intN)))
289295
]
290296

291297
{
292-
#category : #'as yet unclassified',
298+
#category : #utility,
293299
#'squeak_changestamp' : 'tw 7/12/2024 18:26'
294300
}
295301
GMTEEditor class >> vLayoutFrame: intI ofN: intN hSymmetric: aFloat [
@@ -1015,12 +1021,16 @@ GMTEEditor >> enableSingleLayerButtons [
10151021

10161022
{
10171023
#category : #'menu buttons',
1018-
#'squeak_changestamp' : 'tw 7/12/2024 23:10'
1024+
#'squeak_changestamp' : 'tw 7/12/2024 23:21'
10191025
}
10201026
GMTEEditor >> exportAsImage [
10211027
"Exports the current tile map as a png"
10221028

1023-
self tileMap exportAsImage
1029+
exportTilemap := self tileMap veryDeepCopy.
1030+
exportTilemap
1031+
hideHighlightingLayer;
1032+
resetView;
1033+
exportAsImage
10241034
]
10251035

10261036
{

source/GM-TE/GMTETileContainer.class.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"
2-
It is not good code right now. Maybe find a nicer solution later
2+
Contains and manages layout for TileSelectors.
33
"
44
Class {
55
#name : #GMTETileContainer,
@@ -8,7 +8,7 @@ Class {
88
'parent'
99
],
1010
#category : #'GM-TE-UI',
11-
#'squeak_changestamp' : 'Alex M 5/21/2024 16:50'
11+
#'squeak_changestamp' : 'mcjj 7/12/2024 22:18'
1212
}
1313

1414
{

source/GM-TE/GMTETileMap.class.st

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ GMTETileMap class >> maxLayers [
5656

5757
{
5858
#category : #'instance creation',
59-
#'squeak_changestamp' : 'Ivo Zilkenat 7/12/2024 20:16'
59+
#'squeak_changestamp' : 'mcjj 7/12/2024 23:10'
6060
}
6161
GMTETileMap class >> newFromEditableTileMap: aMap [
6262

@@ -76,9 +76,11 @@ GMTETileMap class >> newFromEditableTileMap: aMap [
7676
abandon.
7777

7878
"Initially draw background tiles"
79-
newMap updateTilesBackground.
80-
newMap resetView.
81-
newMap hasStaticView: true.
79+
newMap
80+
updateTilesBackground;
81+
resetView;
82+
hasStaticView: true;
83+
reorderSubmorphsInLayers.
8284

8385
^ newMap
8486
]

0 commit comments

Comments
 (0)