Skip to content

Commit

Permalink
Merge origin/tmm-dev into tmm-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksander Morgensterns committed Jun 25, 2024
2 parents 2e7e591 + b176a15 commit 93ad0bf
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 45 deletions.
39 changes: 28 additions & 11 deletions source/GM-TE/GMTEEditor.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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:]
Expand All @@ -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 [

Expand All @@ -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 [

Expand Down Expand Up @@ -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
]

Expand Down Expand Up @@ -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:
Expand All @@ -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"
Expand Down Expand Up @@ -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'
Expand Down
6 changes: 0 additions & 6 deletions source/GM-Test.package/.squot-contents

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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" } }
Binary file modified testMapFile.morph
Binary file not shown.

0 comments on commit 93ad0bf

Please sign in to comment.