From a63c59b63625e2f29aa256cec57bf2bcd92808fc Mon Sep 17 00:00:00 2001 From: Thomas Wolf Date: Sun, 23 Jun 2024 21:51:53 +0200 Subject: [PATCH] names are now part of layers & get saved --- source/GM-TE/GMTEEditor.class.st | 30 +++++++++++++++--------------- source/GM-TE/GMTETileMap.class.st | 18 ------------------ 2 files changed, 15 insertions(+), 33 deletions(-) diff --git a/source/GM-TE/GMTEEditor.class.st b/source/GM-TE/GMTEEditor.class.st index 90274ab0..cced1454 100644 --- a/source/GM-TE/GMTEEditor.class.st +++ b/source/GM-TE/GMTEEditor.class.st @@ -61,13 +61,13 @@ GMTEEditor class >> getTileMapFromProjectName: aName withPath: aPath [ { #category : #constants, - #'squeak_changestamp' : 'TW 6/23/2024 19:59' + #'squeak_changestamp' : 'TW 6/23/2024 21:37' } GMTEEditor class >> getVisibilityIndicator: aBoolean [ aBoolean - ifTrue: [^ '(h)'] - ifFalse: [^ '(v)'] + ifTrue: [^ ' (v)'] + ifFalse: [^ ' (h)'] ] { @@ -147,7 +147,7 @@ GMTEEditor class >> tileMapMinPaddingSize [ { #category : #'menu button functions', - #'squeak_changestamp' : 'jj 6/23/2024 18:04' + #'squeak_changestamp' : 'TW 6/23/2024 21:37' } GMTEEditor >> addLayer [ "adds a new tileMap layer" @@ -157,9 +157,9 @@ GMTEEditor >> addLayer [ newLayerNumber := self layerCount + 1. self tileMap tileMatrixStack pushLayer. - self - storeLayerN: newLayerNumber; - selectOnlyLayer: newLayerNumber + self + selectOnlyLayer: newLayerNumber; + changed: #getLayerList ] { @@ -196,7 +196,7 @@ GMTEEditor >> backgroundTile: anObject [ { #category : #'layer button functions', - #'squeak_changestamp' : 'jj 6/22/2024 20:36' + #'squeak_changestamp' : 'TW 6/23/2024 21:46' } GMTEEditor >> blendSelectedLayers [ "fuses the selected layers into one layer" @@ -207,10 +207,10 @@ GMTEEditor >> blendSelectedLayers [ bakedLayer := self selectedLayers min. self tileMap blendLayers: self selectedLayers. self selectedLayers remove: bakedLayer. - self forgetLayers: self selectedLayers. self deselectAllLayers; - selectLayer: bakedLayer] + selectLayer: bakedLayer]. + self changed: #getLayerList ] { @@ -756,14 +756,14 @@ GMTEEditor >> getGridWidthAsString [ { #category : #'layer manipulation', - #'squeak_changestamp' : 'TW 6/23/2024 20:13' + #'squeak_changestamp' : 'TW 6/23/2024 21:50' } GMTEEditor >> getLayerList [ "returns the layer list" self tileMap ifNil: [^ OrderedCollection new]. - ^ self tileMap tileMatrixStack matrixLayers collect: [:aLayer | aLayer displayName, (GMTEEditor getVisibilityIndicator: aLayer visible)] + ^ self tileMap tileMatrixStack collectLayers: [:aLayer | aLayer displayName, (GMTEEditor getVisibilityIndicator: aLayer visible)] ] { @@ -1226,7 +1226,7 @@ GMTEEditor >> ratio: anObject [ { #category : #'layer button functions', - #'squeak_changestamp' : 'TW 6/23/2024 20:07' + #'squeak_changestamp' : 'TW 6/23/2024 21:50' } GMTEEditor >> renameLayer [ "renames the selected layer with a user chosen name" @@ -1236,9 +1236,9 @@ GMTEEditor >> renameLayer [ ifTrue: [ selectedLayer := self getSelectedLayer. newName := FillInTheBlankMorph - request: 'New Name:' initialAnswer: (self tileMap layerNameOf: selectedLayer). + request: 'New Name:' initialAnswer: (self tileMap tileMatrixStack layerNameOf: selectedLayer). (newName isNil or: newName isEmpty) - ifFalse: [self tileMap setLayerNameOf: selectedLayer to: newName]]. + ifFalse: [self tileMap tileMatrixStack setLayerNameOf: selectedLayer to: newName]]. self changed: #getLayerList diff --git a/source/GM-TE/GMTETileMap.class.st b/source/GM-TE/GMTETileMap.class.st index a485008d..62bea544 100644 --- a/source/GM-TE/GMTETileMap.class.st +++ b/source/GM-TE/GMTETileMap.class.st @@ -485,15 +485,6 @@ GMTETileMap >> initialize [ ] -{ - #category : #accessing, - #'squeak_changestamp' : 'TW 6/23/2024 20:01' -} -GMTETileMap >> layerNameOf: anIndex [ - - ^ self tileMatrixStack layerNameOf: anIndex -] - { #category : #'dev-api', #'squeak_changestamp' : 'Ivo Zilkenat 6/19/2024 22:53' @@ -726,15 +717,6 @@ GMTETileMap >> setDimensionsWidth: aWidth height: aHeigth padding: aPadding [ mapPadding: aPadding ] -{ - #category : #accessing, - #'squeak_changestamp' : 'TW 6/23/2024 20:03' -} -GMTETileMap >> setLayerNameOf: anIndex to: aString [ - - ^ self tileMatrixStack setLayerNameOf: anIndex to: aString -] - { #category : #'dev-api', #'squeak_changestamp' : 'Ivo Zilkenat 6/19/2024 23:11'