66
77import net .fexcraft .app .fmt .FMTB ;
88import net .fexcraft .app .fmt .ui .editor .Editor ;
9+ import net .fexcraft .app .fmt .ui .generic .DialogBox ;
910import net .fexcraft .app .fmt .utils .GGR ;
1011import net .fexcraft .app .fmt .utils .TextureManager ;
1112import net .fexcraft .app .fmt .wrappers .PolygonWrapper ;
@@ -77,13 +78,16 @@ else if(mx >= x + width - 48 && mx < x + width - 28){
7778 trlist [j ].visible = !trlist [j ].visible ; return true ;
7879 }
7980 else if (mx >= x + width - 26 && mx < x + width - 6 ){
80- FMTB .MODEL .getCompound ().remove (trlist [j ].id ); return true ;
81+ String id = trlist [j ].id ;
82+ FMTB .showDialogbox ("Remove this group?" , id , "Yes" , "No!" , () -> {
83+ FMTB .MODEL .getCompound ().remove (id );
84+ }, DialogBox .NOTHING );
85+ return true ;
8186 }
8287 else {
8388 boolean bool = trlist [j ].selected ;
8489 if (!GGR .isShiftDown ()){ FMTB .MODEL .clearSelection (); }
85- trlist [j ].selected = !bool ;
86- FMTB .MODEL .updateFields ();
90+ trlist [j ].selected = !bool ; FMTB .MODEL .updateFields ();
8791 }
8892 return false ;
8993 }
@@ -97,13 +101,16 @@ else if(mx >= x + width - 52 && mx < x + width - 32){
97101 trlist [j ].get (l ).visible = !trlist [j ].get (l ).visible ; return true ;
98102 }
99103 else if (mx >= x + width - 30 && mx < x + width - 10 ){
100- trlist [j ].remove (l ); return true ;
104+ String id = trlist [j ].id ; PolygonWrapper poly = trlist [j ].get (l );
105+ FMTB .showDialogbox ("Remove this polygon?" , id + ":" + poly .name (), "Yes" , "No!" , () -> {
106+ FMTB .MODEL .getCompound ().get (id ).remove (poly );
107+ }, DialogBox .NOTHING );
108+ return true ;
101109 }
102110 else {
103111 boolean bool = trlist [j ].get (l ).selected ;
104112 if (!GGR .isShiftDown ()){ FMTB .MODEL .clearSelection (); }
105- trlist [j ].get (l ).selected = !bool ;
106- FMTB .MODEL .updateFields ();
113+ trlist [j ].get (l ).selected = !bool ; FMTB .MODEL .updateFields ();
107114 }
108115 return false ;
109116 }
0 commit comments