Skip to content

Commit

Permalink
implemented jessicas import/export gui wishes
Browse files Browse the repository at this point in the history
  • Loading branch information
RedToxyl committed Jun 5, 2024
1 parent bc9232a commit 1928121
Showing 1 changed file with 70 additions and 22 deletions.
92 changes: 70 additions & 22 deletions source/GM-TE/GMTEEditor.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -231,42 +231,33 @@ GMTEEditor >> commandBar: anObject [

{
#category : #building,
#'squeak_changestamp' : 'JS 5/30/2024 16:03'
#'squeak_changestamp' : 'TW 6/5/2024 02:01'
}
GMTEEditor >> createCommandBarWithBuilder: aBuilder [
^aBuilder pluggablePanelSpec new
name: 'command bar';
model: self;
children: {aBuilder pluggableButtonSpec new
name: 'export';
label: 'Export';
model: self;
action: #exportAsMorph;
frame: (LayoutFrame fractions: (0 @ 0 corner: 0.2 @ 1) offsets: nil).
aBuilder pluggableButtonSpec new
name: 'saveAsImage';
label: 'Save As Image';
name: 'import';
label: 'Import ...';
model: self;
frame: (LayoutFrame fractions: (0.2 @ 0 corner: 0.4 @ 1) offsets: nil);
action: #exportAsImage.
frame: (LayoutFrame fractions: (0.0 @ 0 corner: 0.33 @ 1) offsets: nil);
action: #importMenu.

aBuilder pluggableButtonSpec new
name: 'import';
label: 'Import';
name: 'export';
label: 'Export as ...';
model: self;
frame: (LayoutFrame fractions: (0.4 @ 0 corner: 0.6 @ 1) offsets: nil);
action: #import.
action: #exportMenu;
frame: (LayoutFrame fractions: (0.33 @ 0 corner: 0.66 @ 1) offsets: nil).

aBuilder pluggableButtonSpec new
frame: (LayoutFrame fractions: (0.6 @ 0 corner: 0.8 @ 1) offsets: nil);
frame: (LayoutFrame fractions: (0.66 @ 0 corner: 1 @ 1) offsets: nil);
name: 'openInWorld';
label: 'Open in World';
model: self;
action: #openTileMapInWorld.
aBuilder pluggableButtonSpec new
name: 'Import Tilemap';
label: 'Import Tilemap';
model: self;
action: #importFromMorph;
frame: (LayoutFrame fractions: (0.8 @ 0 corner: 1 @ 1) offsets: nil)}
}
;

verticalResizing: #shrinkWrap;
Expand Down Expand Up @@ -437,6 +428,30 @@ GMTEEditor >> exportAsMorph [
self savedSinceModified: true
]

{
#category : #building,
#'squeak_changestamp' : 'TW 6/5/2024 02:02'
}
GMTEEditor >> exportMenu [

| aMenuSpec builder|
builder := ToolBuilder default.
aMenuSpec := builder pluggableMenuSpec new.

aMenuSpec
add: 'Tilemap'
target: self
selector: #exportAsMorph
argumentList: {};

add: 'PNG'
target: self
selector: #exportAsImage
argumentList: {}.

builder open: aMenuSpec
]

{
#category : #'as yet unclassified',
#'squeak_changestamp' : 'JS 6/4/2024 18:00'
Expand Down Expand Up @@ -515,6 +530,30 @@ GMTEEditor >> importFromMorph [
self changed: #getLayerList
]

{
#category : #building,
#'squeak_changestamp' : 'TW 6/5/2024 02:03'
}
GMTEEditor >> importMenu [

| aMenuSpec builder|
builder := ToolBuilder default.
aMenuSpec := builder pluggableMenuSpec new.

aMenuSpec
add: 'Tileset'
target: self
selector: #importFromMorph
argumentList: {};

add: 'Tilemap'
target: self
selector: #import
argumentList: {}.

builder open: aMenuSpec
]

{
#category : #initialisation,
#'squeak_changestamp' : 'Alex M 5/28/2024 15:24'
Expand Down Expand Up @@ -691,6 +730,15 @@ GMTEEditor >> resetAll [
self tileMapMatrix resetAll
]

{
#category : #'button functions',
#'squeak_changestamp' : 'TW 6/5/2024 02:04'
}
GMTEEditor >> resetCurrentLayer [

self tileMapMatrix resetLayer: self selectedLayer.
]

{
#category : #accessing,
#'squeak_changestamp' : 'TW 5/28/2024 10:42'
Expand Down

0 comments on commit 1928121

Please sign in to comment.