@@ -17,11 +17,11 @@ public LayerMenu(int width, int height, SpriteModel model) : base(width, height)
17
17
public void UpdateListing ( ) {
18
18
this . Children . Clear ( ) ;
19
19
var layers = model . sprite . layers ;
20
- int i = layers . Count - 1 ;
21
- foreach ( var l in ( ( IEnumerable < Layer > ) layers ) . Reverse ( ) ) {
20
+ int i = 0 ;
21
+ foreach ( var l in layers ) {
22
22
int index = i ;
23
23
int x = 0 ;
24
- int y = i ;
24
+ int y = layers . Count - i - 1 ;
25
25
this . Children . Add ( new ColorCellButton ( ( ) => l . visible ? Color . White : Color . Black ,
26
26
( ) => {
27
27
l . visible = ! l . visible ;
@@ -60,7 +60,9 @@ public void UpdateListing() {
60
60
61
61
string GetLabel ( ) => $ ">{ ( l . name . Length > 8 ? l . name . Remove ( 8 ) : l . name ) } ";
62
62
63
- var layerSettings = new LayerSettings ( l , ( ) => nameButton . text = GetLabel ( ) ) { Position = new Point ( 16 , index ) } ;
63
+ var layerSettings = new LayerSettings ( l , ( ) => nameButton . text = GetLabel ( ) ) {
64
+ Position = new Point ( 16 , index )
65
+ } ;
64
66
65
67
this . Children . Add ( new ColorCellButton ( ( ) => ! this . Children . Contains ( layerSettings ) ? Color . White : Color . Black ,
66
68
( ) => {
@@ -76,39 +78,34 @@ public void UpdateListing() {
76
78
77
79
nameButton = new ColorButton ( GetLabel ( ) ,
78
80
( ) => model . currentLayerIndex == index ? Color . Yellow : Color . White ,
79
- ( ) => model . currentLayerIndex = index ) {
80
- Position = new Point ( 4 , y )
81
- } ;
81
+ ( ) => model . currentLayerIndex = index
82
+ ) { Position = new Point ( 4 , y ) } ;
82
83
this . Children . Add ( nameButton ) ;
83
84
84
85
this . Children . Add ( new CellButton ( ( ) => index > 0 ,
85
86
( ) => {
87
+ //Change to use Edits
86
88
var below = layers [ index - 1 ] ;
87
89
below . Flatten ( l ) ;
88
90
layers . RemoveAt ( index ) ;
89
-
90
91
if ( model . currentLayerIndex == index ) {
91
92
model . currentLayerIndex -- ;
92
93
}
93
-
94
94
UpdateListing ( ) ;
95
95
} , '%' ) {
96
96
Position = new Point ( 13 , y )
97
97
} ) ;
98
-
99
98
this . Children . Add ( new CellButton ( ( ) => model . sprite . layers . Count > 1 ,
100
99
( ) => {
101
100
layers . RemoveAt ( index ) ;
102
-
103
101
if ( model . currentLayerIndex == index && index > 0 ) {
104
102
model . currentLayerIndex -- ;
105
103
}
106
-
107
104
UpdateListing ( ) ;
108
105
} , 'X' ) {
109
106
Position = new Point ( 15 , y )
110
107
} ) ;
111
- i -- ;
108
+ i ++ ;
112
109
}
113
110
}
114
111
public override bool ProcessMouse ( MouseScreenObjectState state ) {
0 commit comments