diff --git a/source/GM-TE/GMTEEditor.class.st b/source/GM-TE/GMTEEditor.class.st index c3f9e4ac..b27a2f0a 100644 --- a/source/GM-TE/GMTEEditor.class.st +++ b/source/GM-TE/GMTEEditor.class.st @@ -664,7 +664,7 @@ GMTEEditor >> deselectAllLayers [ { #category : #accessing, - #'squeak_changestamp' : 'TW 6/25/2024 16:02' + #'squeak_changestamp' : 'TW 6/25/2024 17:50' } GMTEEditor >> deselectLayer: anIndex [ "deletes the layer with the provided index" @@ -674,7 +674,7 @@ GMTEEditor >> deselectLayer: anIndex [ (self selectedLayers includes: anIndex) ifTrue: [ self selectedLayers remove: anIndex. - self singleLayerSelected ifTrue: [self enableSingleLayerButtons]. + self updateButtonEnabled. self changed: #selectedLayers; changed: #layerAt:] @@ -695,7 +695,7 @@ GMTEEditor >> deselectTile [ { #category : #'as yet unclassified', - #'squeak_changestamp' : 'TW 6/25/2024 15:57' + #'squeak_changestamp' : 'TW 6/25/2024 17:51' } GMTEEditor >> disableSingleLayerButtons [ @@ -704,7 +704,7 @@ GMTEEditor >> disableSingleLayerButtons [ { #category : #'as yet unclassified', - #'squeak_changestamp' : 'TW 6/25/2024 15:57' + #'squeak_changestamp' : 'TW 6/25/2024 17:51' } GMTEEditor >> enableSingleLayerButtons [ @@ -951,18 +951,20 @@ GMTEEditor >> importMenu [ { #category : #initialization, - #'squeak_changestamp' : 'TW 6/25/2024 17:08' + #'squeak_changestamp' : 'TW 6/25/2024 17:51' } GMTEEditor >> initialize [ "starts the tile editor" super initialize. self - selectedLayers: {1}; + selectedLayers: Set new; + selectLayer: 1; morphBuilders: Dictionary new; open; ratio: 1; savedSinceModified: true; + updateButtonEnabled; changed: #getLayerList ] @@ -1375,15 +1377,13 @@ GMTEEditor >> selectAllLayers [ { #category : #accessing, - #'squeak_changestamp' : 'TW 6/25/2024 17:01' + #'squeak_changestamp' : 'TW 6/25/2024 17:50' } GMTEEditor >> selectLayer: anIndex [ "select the layer with anIndex" self selectedLayers add: anIndex. - self singleLayerSelected - ifTrue: [self enableSingleLayerButtons] - ifFalse: [self disableSingleLayerButtons]. + self updateButtonEnabled. self changed: #selectedLayers; changed: #layerAt: @@ -1405,7 +1405,7 @@ GMTEEditor >> selectOnlyLayer: anIndex [ { #category : #accessing, - #'squeak_changestamp' : 'Alex M 6/25/2024 18:26' + #'squeak_changestamp' : 'Alex M 6/25/2024 18:28' } GMTEEditor >> selectTile: anObject [ "selects a tile from the tile store" @@ -1692,6 +1692,23 @@ GMTEEditor >> unselectTile [ self trayViewer morph submorphs first visible: false ] +{ + #category : #'as yet unclassified', + #'squeak_changestamp' : 'TW 6/25/2024 17:51' +} +GMTEEditor >> updateButtonEnabled [ + + self associatedMorph ifNil: [^ nil]. + + self singleLayerSelected + ifTrue: [self enableSingleLayerButtons] + ifFalse: [self disableSingleLayerButtons]. + + (self layerAt: 1) + ifTrue: [(self associatedMorph submorphNamed: 'buttonDeleteLayers') enabled: false] + ifFalse: [(self associatedMorph submorphNamed: 'buttonDeleteLayers') enabled: true] +] + { #category : #building, #'squeak_changestamp' : 'jj 6/23/2024 13:45' diff --git a/source/GM-Test.package/.squot-contents b/source/GM-Test.package/.squot-contents deleted file mode 100644 index 4951feb4..00000000 --- a/source/GM-Test.package/.squot-contents +++ /dev/null @@ -1,6 +0,0 @@ -SquotTrackedObjectMetadata { - #objectClassName : #PackageInfo, - #id : UUID [ '381beefb7a10d142b4e88b766f3a1d55' ], - #objectsReplacedByNames : true, - #serializer : #SquotCypressCodeSerializer -} \ No newline at end of file diff --git a/source/GM-Test.package/GMTileEditorTest.class/instance/setUp.st b/source/GM-Test.package/GMTileEditorTest.class/instance/setUp.st deleted file mode 100644 index 0e1ee909..00000000 --- a/source/GM-Test.package/GMTileEditorTest.class/instance/setUp.st +++ /dev/null @@ -1,5 +0,0 @@ -helper -setUp - - self editor ifNil: [self editor: GMTEEditor new]. - self fileUUID: UUID new asString \ No newline at end of file diff --git a/source/GM-Test.package/GMTileEditorTest.class/instance/setup.st b/source/GM-Test.package/GMTileEditorTest.class/instance/setup.st deleted file mode 100644 index 0e1ee909..00000000 --- a/source/GM-Test.package/GMTileEditorTest.class/instance/setup.st +++ /dev/null @@ -1,5 +0,0 @@ -helper -setUp - - self editor ifNil: [self editor: GMTEEditor new]. - self fileUUID: UUID new asString \ No newline at end of file diff --git a/source/GM-Test.package/GMTileEditorTest.class/instance/testMoveLayerDown.st b/source/GM-Test.package/GMTileEditorTest.class/instance/testMoveLayerDown.st index 63d2544d..9a12437a 100644 --- a/source/GM-Test.package/GMTileEditorTest.class/instance/testMoveLayerDown.st +++ b/source/GM-Test.package/GMTileEditorTest.class/instance/testMoveLayerDown.st @@ -6,10 +6,10 @@ testMoveLayerDown tileMatrixStack:= self editor tileMap tileMatrixStack. self editor addLayer. layer1 := tileMatrixStack matrixLayers at: 1. - layerId1 := (tileMatrixStack matrixLayers at: 1) layerIdx. - layerId2 := (tileMatrixStack matrixLayers at: 2) layerIdx. + layerId1 := (tileMatrixStack matrixLayers at: 1) layerIndex. + layerId2 := (tileMatrixStack matrixLayers at: 2) layerIndex. self editor moveLayerDown. - self assert: (tileMatrixStack matrixLayers at: 1) layerIdx = layerId1. - self assert: (tileMatrixStack matrixLayers at: 2) layerIdx = layerId2. + self assert: (tileMatrixStack matrixLayers at: 1) layerIndex = layerId1. + self assert: (tileMatrixStack matrixLayers at: 2) layerIndex = layerId2. self assert: (tileMatrixStack matrixLayers at: 2) == layer1. self assert: ((tileMatrixStack matrixLayers at: 1) == layer1) not \ No newline at end of file diff --git a/source/GM-Test.package/GMTileEditorTest.class/instance/testMoveLayerUp.st b/source/GM-Test.package/GMTileEditorTest.class/instance/testMoveLayerUp.st index 1a5e7253..8106c92b 100644 --- a/source/GM-Test.package/GMTileEditorTest.class/instance/testMoveLayerUp.st +++ b/source/GM-Test.package/GMTileEditorTest.class/instance/testMoveLayerUp.st @@ -6,11 +6,11 @@ testMoveLayerUp tileMatrixStack:= self editor tileMap tileMatrixStack. self editor addLayer. layer1 := tileMatrixStack matrixLayers at: 1. - layerId1 := (tileMatrixStack matrixLayers at: 1) layerIdx. - layerId2 := (tileMatrixStack matrixLayers at: 2) layerIdx. + layerId1 := (tileMatrixStack matrixLayers at: 1) layerIndex. + layerId2 := (tileMatrixStack matrixLayers at: 2) layerIndex. self editor selectOnlyLayer: 1. self editor moveLayerUp. - self assert: (tileMatrixStack matrixLayers at: 1) layerIdx = layerId1. - self assert: (tileMatrixStack matrixLayers at: 2) layerIdx = layerId2. + self assert: (tileMatrixStack matrixLayers at: 1) layerIndex = layerId1. + self assert: (tileMatrixStack matrixLayers at: 2) layerIndex = layerId2. self assert: (tileMatrixStack matrixLayers at: 2) == layer1. self assert: ((tileMatrixStack matrixLayers at: 1) == layer1) not \ No newline at end of file diff --git a/source/GM-Test.package/GMTileEditorTest.class/instance/testSwapLayer.st b/source/GM-Test.package/GMTileEditorTest.class/instance/testSwapLayer.st index 75d6143b..9be03a1c 100644 --- a/source/GM-Test.package/GMTileEditorTest.class/instance/testSwapLayer.st +++ b/source/GM-Test.package/GMTileEditorTest.class/instance/testSwapLayer.st @@ -6,10 +6,10 @@ testSwapLayer TileMatrixStack:= self editor tileMap tileMatrixStack. self editor addLayer. layer1 := TileMatrixStack matrixLayers at: 1. - layerId1 := (TileMatrixStack matrixLayers at: 1) layerIdx. - layerId2 := (TileMatrixStack matrixLayers at: 2) layerIdx. + layerId1 := (TileMatrixStack matrixLayers at: 1) layerIndex. + layerId2 := (TileMatrixStack matrixLayers at: 2) layerIndex. TileMatrixStack swapLayer: 1 with: 2. - self assert: (TileMatrixStack matrixLayers at: 1) layerIdx = layerId1. - self assert: (TileMatrixStack matrixLayers at: 2) layerIdx = layerId2. + self assert: (TileMatrixStack matrixLayers at: 1) layerIndex = layerId1. + self assert: (TileMatrixStack matrixLayers at: 2) layerIndex = layerId2. self assert: (TileMatrixStack matrixLayers at: 2) == layer1. self assert: ((TileMatrixStack matrixLayers at: 1) == layer1) not \ No newline at end of file diff --git a/source/GM-Test.package/GMTileEditorTest.class/instance/testToggleVisualLayer.st b/source/GM-Test.package/GMTileEditorTest.class/instance/testToggleHighlightingLayer.st similarity index 100% rename from source/GM-Test.package/GMTileEditorTest.class/instance/testToggleVisualLayer.st rename to source/GM-Test.package/GMTileEditorTest.class/instance/testToggleHighlightingLayer.st diff --git a/source/GM-Test.package/GMTileEditorTest.class/methodProperties.json b/source/GM-Test.package/GMTileEditorTest.class/methodProperties.json index ee9b924a..d12db844 100644 --- a/source/GM-Test.package/GMTileEditorTest.class/methodProperties.json +++ b/source/GM-Test.package/GMTileEditorTest.class/methodProperties.json @@ -9,7 +9,7 @@ "fileUUID:" : "jj 6/22/2024 16:55", "loadTestMapFileToFileDirectory" : "JS 6/23/2024 18:18", "setUp" : "jj 6/23/2024 18:55", - "setup" : " 6/24/2024 10:17:32", + "setup" : "6/24/2024 10:17:32", "tearDown" : "jj 6/22/2024 20:24", "testAddLayerButton" : "JS 6/24/2024 00:19", "testDeleteLayer" : "jj 6/22/2024 20:25", @@ -18,12 +18,12 @@ "testExport" : "jj 6/23/2024 19:02", "testExportButton" : "jj 6/22/2024 20:28", "testImportButton" : "jj 6/22/2024 20:28", - "testMoveLayerDown" : "jj 6/22/2024 20:31", - "testMoveLayerUp" : "jj 6/22/2024 20:31", + "testMoveLayerDown" : "JS 6/25/2024 18:02", + "testMoveLayerUp" : "JS 6/25/2024 18:02", "testMultiDeleteLayer" : "jj 6/22/2024 20:31", "testMultiToggleLayerVisibility" : "jj 6/22/2024 20:34", "testRenameLayer" : "JS 6/24/2024 00:15", "testRescaleMap" : "jj 6/22/2024 20:32", - "testSwapLayer" : "jj 6/22/2024 20:33", - "testToggleLayerVisibility" : "jj 6/22/2024 20:34", - "testToggleHighlightingLayer" : "jj 6/22/2024 20:34" } } + "testSwapLayer" : "JS 6/25/2024 18:03", + "testToggleHighlightingLayer" : "jj 6/22/2024 20:34", + "testToggleLayerVisibility" : "jj 6/22/2024 20:34" } } diff --git a/testMapFile.morph b/testMapFile.morph index 9997ee99..14d6c90c 100644 Binary files a/testMapFile.morph and b/testMapFile.morph differ