From 59de607850161a26863f92961d53caae7a2dabc8 Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Tue, 06 Aug 2019 21:37:03 -0400
Subject: [PATCH] Pin button.

---
 GroupEditor.java |  719 +++++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 594 insertions(+), 125 deletions(-)

diff --git a/GroupEditor.java b/GroupEditor.java
index ec26bdb..00a0f61 100644
--- a/GroupEditor.java
+++ b/GroupEditor.java
@@ -16,6 +16,7 @@
 //import buoy.widget.BFileChooser;
 
 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
+    Grafreed.iResourceCallBack,
         ObjectUI,
         Runnable,
         ActionListener,
@@ -23,6 +24,314 @@
         DragGestureListener, DragSourceListener, DropTargetListener,
         ItemListener // ListSelectionListener
 {
+
+    public void AddSkyboxButton(String f, String s, cGridBag row)
+    {
+        cButton skyboxButton;
+        final String path = "cubemaps/" + f + "-skyboxes/" + s;
+        row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
+        //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
+        skyboxButton.setToolTipText(s);
+        skyboxButton.addActionListener(new ActionListener()
+        {
+                @Override
+                public void actionPerformed(ActionEvent e)
+                {
+                    ChangeSkybox(path);
+                }
+        });
+    }
+
+    public void AddSkyboxTab0(JTabbedPane skyboxpanel)
+    {
+        cGridBag tab0 = new cGridBag().setVertical(true);
+        
+        tab0.setName("Urban");
+        skyboxpanel.add(tab0);
+
+        cGridBag row0 = new cGridBag();
+        cGridBag row1 = new cGridBag();
+        cGridBag row2 = new cGridBag();
+        cGridBag row3 = new cGridBag();
+        cGridBag row4 = new cGridBag();
+        cGridBag row5 = new cGridBag();
+        cGridBag row6 = new cGridBag();
+        
+        AddSkyboxButton("default", "rgb", row0);
+        //AddSkyboxButton("default", "cornell", row0);
+        AddSkyboxButton("penguins", "dust", row0);
+        AddSkyboxButton("penguins", "tropic", row0);
+        AddSkyboxButton("penguins", "yonder", row0);
+
+        AddSkyboxButton("default", "uffizi", row1);
+        AddSkyboxButton("bridge", "Bridge", row1);
+        AddSkyboxButton("bridge", "Bridge2", row1);
+        AddSkyboxButton("urban", "GamlaStan2", row1);
+        
+        AddSkyboxButton("urban", "Parliament", row2);
+        AddSkyboxButton("urban", "Roundabout", row2);
+        AddSkyboxButton("urban", "SaintLazarusChurch", row2);
+        AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
+        
+        AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
+        AddSkyboxButton("urban", "UnionSquare", row3);
+        AddSkyboxButton("urban", "Medborgarplatsen", row3);
+        AddSkyboxButton("park", "BerzeliiPark", row3);
+        
+        AddSkyboxButton("park", "Buddha", row4);
+        AddSkyboxButton("park", "CNTower2", row4);
+        AddSkyboxButton("park", "NiagaraFalls1", row4);
+        AddSkyboxButton("park", "NiagaraFalls3", row4);
+        
+        AddSkyboxButton("park", "Park", row5);
+        AddSkyboxButton("park", "Pond", row5);
+        AddSkyboxButton("park", "Skansen", row5);
+        AddSkyboxButton("park", "Skansen2", row5);
+        
+        AddSkyboxButton("park", "Skansen3", row6);
+        AddSkyboxButton("park", "Skansen4", row6);
+        AddSkyboxButton("park", "Skansen5", row6);
+        AddSkyboxButton("persson", "VancouverConventionCentre", row6);
+        
+        tab0.add(row0);
+        tab0.add(row1);
+        tab0.add(row2);
+        tab0.add(row3);
+        tab0.add(row4);
+        tab0.add(row5);
+        tab0.add(row6);
+        
+        for (int i=5; --i>=0;)
+        {
+            //oe.toolboxPanel.Return();
+            //tab0.add(new cGridBag());
+        }
+    }
+
+    public void AddSkyboxTab1(JTabbedPane skyboxpanel)
+    {
+        cGridBag tab0 = new cGridBag().setVertical(true);
+        
+        tab0.setName("Nature");
+        skyboxpanel.add(tab0);
+
+        cGridBag row0 = new cGridBag();
+        cGridBag row1 = new cGridBag();
+        cGridBag row2 = new cGridBag();
+        cGridBag row3 = new cGridBag();
+        cGridBag row4 = new cGridBag();
+        cGridBag row5 = new cGridBag();
+        cGridBag row6 = new cGridBag();
+        
+        AddSkyboxButton("beach", "HeartInTheSand", row0);
+        AddSkyboxButton("beach", "LarnacaBeach", row0);
+        AddSkyboxButton("beach", "PalmTrees", row0);
+        AddSkyboxButton("beach", "Tenerife", row0);
+        
+        AddSkyboxButton("beach", "Tenerife2", row1);
+        AddSkyboxButton("beach", "Tenerife3", row1);
+        AddSkyboxButton("field", "FishPond", row1);
+        AddSkyboxButton("field", "Footballfield", row1);
+
+        AddSkyboxButton("field", "Meadow", row2);
+        AddSkyboxButton("field", "Sorsele", row2);
+        AddSkyboxButton("field", "Sorsele2", row2);
+        AddSkyboxButton("field", "Sorsele3", row2);
+        
+        AddSkyboxButton("forest", "Brudslojan", row3);
+        AddSkyboxButton("forest", "Langholmen2", row3);
+        AddSkyboxButton("forest", "Plants", row3);
+        AddSkyboxButton("mountain", "Maskonaive", row3);
+        
+        AddSkyboxButton("mountain", "Maskonaive2", row4);
+        AddSkyboxButton("mountain", "Maskonaive3", row4);
+        AddSkyboxButton("mountain", "Teide", row4);
+        AddSkyboxButton("park", "Tantolunden4", row4);
+        
+        AddSkyboxButton("park", "Stairs", row5);
+        AddSkyboxButton("default", "skycube", row6);
+        AddSkyboxButton("rocky", "Langholmen", row5);
+        AddSkyboxButton("rocky", "Skinnarviksberget", row5);
+        
+        AddSkyboxButton("rocky", "Tantolunden6", row5);
+        AddSkyboxButton("default", "CloudyHills", row6);
+        AddSkyboxButton("daz", "Autumn", row6);
+        AddSkyboxButton("daz", "MountainTrail", row6);
+        /*
+Autumn
+Greenlands
+MountainTrail
+Oasis
+TheRock
+TopOfTheWorld
+Winter
+         */
+        
+        tab0.add(row0);
+        tab0.add(row1);
+        tab0.add(row2);
+        tab0.add(row3);
+        tab0.add(row4);
+        tab0.add(row5);
+        tab0.add(row6);
+        
+        for (int i=5; --i>=0;)
+        {
+            //oe.toolboxPanel.Return();
+            //tab0.add(new cGridBag());
+        }
+    }
+    
+    public void AddSkyboxTab2(JTabbedPane skyboxpanel)
+    {
+        cGridBag tab0 = new cGridBag().setVertical(true);
+        
+        tab0.setName("Night");
+        skyboxpanel.add(tab0);
+
+        cGridBag row0 = new cGridBag();
+        cGridBag row1 = new cGridBag();
+        cGridBag row2 = new cGridBag();
+        cGridBag row3 = new cGridBag();
+        cGridBag row4 = new cGridBag();
+        cGridBag row5 = new cGridBag();
+        cGridBag row6 = new cGridBag();
+        
+        AddSkyboxButton("night", "NightPath", row0);
+        AddSkyboxButton("night", "PondNight", row0);
+        AddSkyboxButton("night", "Powerlines", row0);
+        AddSkyboxButton("night", "SwedishRoyalCastle", row0);
+        
+        AddSkyboxButton("urban", "CNTower", row1);
+        AddSkyboxButton("bridge", "ArstaBridge", row1);
+        AddSkyboxButton("rocky", "Riddarfjarden", row1);
+        AddSkyboxButton("penguins", "sleepyhollow", row1);
+        
+        AddSkyboxButton("penguins", "kenon_star", row2);
+        AddSkyboxButton("persson", "corona", row2);
+        AddSkyboxButton("persson", "spaceskybox", row2);
+        AddSkyboxButton("indoors", "Vasa", row2);
+        
+        AddSkyboxButton("winter", "Backyard", row3);
+        AddSkyboxButton("winter", "Creek", row3);
+        AddSkyboxButton("winter", "FootballField3", row3);
+        AddSkyboxButton("winter", "Forest", row3);
+        
+        AddSkyboxButton("winter", "HornstullsStrand2", row4);
+        AddSkyboxButton("winter", "House", row4);
+        AddSkyboxButton("winter", "IceLake", row4);
+        AddSkyboxButton("winter", "IceRiver", row4);
+        
+        AddSkyboxButton("winter", "Park3", row5);
+        AddSkyboxButton("winter", "PondWinter", row5);
+        AddSkyboxButton("winter", "Tantolunden5", row5);
+        AddSkyboxButton("winter", "Vindelalven", row5);
+        
+        AddSkyboxButton("daz", "TheRock", row6);
+        AddSkyboxButton("daz", "TopOfTheWorld", row6);
+        AddSkyboxButton("daz", "Winter", row6);
+        AddSkyboxButton("mountain", "Ryfjallet", row6);
+        
+        tab0.add(row0);
+        tab0.add(row1);
+        tab0.add(row2);
+        tab0.add(row3);
+        tab0.add(row4);
+        tab0.add(row5);
+        tab0.add(row6);
+        
+        for (int i=5; --i>=0;)
+        {
+            //oe.toolboxPanel.Return();
+            //tab0.add(new cGridBag());
+        }
+    }
+
+    public void AddSkyboxTab3(JTabbedPane skyboxpanel)
+    {
+        cGridBag tab0 = new cGridBag().setVertical(true);
+        
+        tab0.setName("Others");
+        skyboxpanel.add(tab0);
+
+        cGridBag row0 = new cGridBag();
+        cGridBag row1 = new cGridBag();
+        cGridBag row2 = new cGridBag();
+        cGridBag row3 = new cGridBag();
+        cGridBag row4 = new cGridBag();
+        cGridBag row5 = new cGridBag();
+        cGridBag row6 = new cGridBag();
+        
+        AddSkyboxButton("mayhem", "afterrain", row0);
+        AddSkyboxButton("mayhem", "aqua4", row0);
+        AddSkyboxButton("mayhem", "aqua9", row0);
+        AddSkyboxButton("mayhem", "flame", row0);
+        
+        AddSkyboxButton("mayhem", "h2s", row1);
+        AddSkyboxButton("mayhem", "prehistoric", row1);
+        AddSkyboxButton("mayhem", "scorched", row1);
+        AddSkyboxButton("penguins", "desertdawn", row1);
+        
+        AddSkyboxButton("persson", "Citadella", row2);
+        AddSkyboxButton("persson", "Citadella2", row2);
+        AddSkyboxButton("persson", "clouds1", row2);
+        AddSkyboxButton("penguins", "wrath", row2);
+        
+        AddSkyboxButton("persson", "FishermansBastion", row3);
+        AddSkyboxButton("persson", "HeroesSquare", row3);
+        AddSkyboxButton("indoors", "DallasW", row3);
+        AddSkyboxButton("indoors", "MarriottMadisonWest", row3);
+        
+        AddSkyboxButton("persson", "LancellottiChapel", row4);
+        AddSkyboxButton("persson", "PereaBeach1", row4);
+        AddSkyboxButton("persson", "PereaBeach2", row4);
+        AddSkyboxButton("persson", "redeclipse", row4);
+        
+        AddSkyboxButton("daz", "Greenlands", row5);
+        AddSkyboxButton("daz", "Oasis", row5);
+        AddSkyboxButton("elyvisions", "arch3", row5);
+        AddSkyboxButton("elyvisions", "calm_sea", row5);
+        
+        AddSkyboxButton("elyvisions", "rainbow", row6);
+        AddSkyboxButton("elyvisions", "distant_sunset", row6);
+        AddSkyboxButton("elyvisions", "heaven", row6);
+        AddSkyboxButton("elyvisions", "hot", row6);
+        
+        tab0.add(row0);
+        tab0.add(row1);
+        tab0.add(row2);
+        tab0.add(row3);
+        tab0.add(row4);
+        tab0.add(row5);
+        tab0.add(row6);
+        
+        for (int i=5; --i>=0;)
+        {
+            //oe.toolboxPanel.Return();
+            //tab0.add(new cGridBag());
+        }
+    }
+        
+    public void CallBack(String[] path)
+    {
+        for (int i = 0; i < path.length; i++)
+        {
+            System.out.print(path[i] + "/");
+        }
+        
+        System.out.println();
+    }
+    
+    public void ChangeSkybox(String skybox)
+    {
+        //cameraView.envyoff = false;
+        group.skyboxname = skybox;
+        group.skyboxext = "jpg";
+        cameraView.repaint();
+
+        Grafreed.ParseResources("textures", this);
+    }
+    
     //ObjEditor objEditor;
 	public void closeUI2()
 	{
@@ -60,6 +369,12 @@
 		this.copy = this.group = group;
 		//selectees = this.group.selectees;
 		
+        if (copy.versionlist == null)
+        {
+            copy.versionlist = new Object3D[100];
+            copy.versionindex = -1;
+        }
+        
 		if(ui)
                     SetupUI(objEditor);
 	}
@@ -80,14 +395,22 @@
 		SetupViews(objEditor);
                 
                 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
+                
+        if (copy.versionlist == null)
+        {
+            copy.versionlist = new Object3D[100];
+            copy.versionindex = -1;
+            
+            Save(true);
+        }
 	}
 
     void CloneSelection(boolean supports)
     {
-        if (Globals.SAVEONMAKE)
+        if (Globals.REPLACEONMAKE)
             Save();
-        boolean keep = Globals.SAVEONMAKE;
-        Globals.SAVEONMAKE = false;
+        boolean keep = Globals.REPLACEONMAKE;
+        Globals.REPLACEONMAKE = false;
         //   Object3D keep = GrafreeD.clipboard;
            //Object3D obj;
            for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
@@ -98,7 +421,7 @@
                
                makeSomething(clone, i==group.selection.size()-1);
            }
-        Globals.SAVEONMAKE = keep;
+        Globals.REPLACEONMAKE = keep;
     }
 
     void CloneClipboard(boolean supports)
@@ -194,8 +517,8 @@
 //		pasteExpandItem = menu.add(new MenuItem("Paste expand"));
 //		pasteExpandItem.addActionListener(this);
 		menu.add("-");
-		clearItem = menu.add(new MenuItem("Clear"));
-		clearItem.addActionListener(this);
+		deleteItem = menu.add(new MenuItem("Delete"));
+		deleteItem.addActionListener(this);
                 
         if (Globals.ADVANCED)
         {
@@ -421,7 +744,7 @@
 		genNormalsMESHItem.addActionListener(this);
         if (Globals.ADVANCED)
         {
-		genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
+		genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
 		genNormalsMINEItem.addActionListener(this);
         }
 		stripifyItem = menu.add(new MenuItem("Stripify"));
@@ -514,10 +837,15 @@
 		attachBumpItem.addActionListener(this);
 		pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
 		pigmentBumpItem.addActionListener(this);
+                //embedTexturesItem
 		detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
 		detachPigmentItem.addActionListener(this);
 		detachBumpItem = menu.add(new MenuItem("Detach Bump"));
 		detachBumpItem.addActionListener(this);
+		embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
+		embedTexturesItem.addActionListener(this);
+		deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
+		deEmbedTexturesItem.addActionListener(this);
 		menu.add("-");
 		sortbysizeItem = menu.add(new MenuItem("Sort by size"));
 		sortbysizeItem.addActionListener(this);
@@ -544,6 +872,7 @@
 		buildToolsMenu(menu);
 	}
 	
+        
 	void SetupUI2(ObjEditor oe)
 	{
             // June 2019
@@ -588,7 +917,7 @@
          */
                 cGridBag copyOptionsPanel = new cGridBag();
                                         
-                copyOptionsPanel.preferredHeight = 1;
+                copyOptionsPanel.preferredHeight = 2;
                 
                 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
                 
@@ -615,29 +944,46 @@
                 restoreCameraButton.setToolTipText("Restore viewpoint");
 		restoreCameraButton.addActionListener(this);
                 
-		copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
-                undoButton.setToolTipText("Undo changes");
-		undoButton.addActionListener(this);
-                undoButton.setEnabled(false);
+		copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                saveVersionButton.setToolTipText("Duplicate current version");
+		saveVersionButton.addActionListener(this);
+                                                
+		copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                deleteVersionButton.setToolTipText("Delete current version");
+		deleteVersionButton.addActionListener(this);
+                                                
+		copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                previousVersionButton.setToolTipText("Previous version");
+		previousVersionButton.addActionListener(this);
+                previousVersionButton.setEnabled(false);
                 
-		copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
-                redoButton.setToolTipText("Redo changes");
-		redoButton.addActionListener(this);
-                redoButton.setEnabled(false);
+                cGridBag updown = new cGridBag().setVertical(true);
+		updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                restoreButton.setToolTipText("Undo (restore current version)");
+		restoreButton.addActionListener(this);
+                //restoreButton.setEnabled(false);
                 
-		copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
-                saveButton.setToolTipText("Save changes");
-		saveButton.addActionListener(this);
+		updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                replaceButton.setToolTipText("Save (replace current version)");
+		replaceButton.addActionListener(this);
+                //replaceButton.setEnabled(false);
                 
-                copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
+                copyOptionsPanel.add(updown);
+                
+		copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                nextVersionButton.setToolTipText("Next version");
+		nextVersionButton.addActionListener(this);
+                nextVersionButton.setEnabled(false);
+                
+                oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
                 liveCB.setToolTipText("Enable animation");
                                 liveCB.addItemListener(this);
 
-		copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+		oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 oneStepButton.setToolTipText("Animate one step forward");
 		oneStepButton.addActionListener(this);
                 
-                copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
+                oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
                 fastCB.setToolTipText("Fast mode");
                                 fastCB.addItemListener(this);
                                 
@@ -655,31 +1001,32 @@
                         oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                         snapobjectButton.addActionListener(this);
                         snapobjectButton.setToolTipText("Snap Object");
+                        
+		oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+		fourButton.addActionListener(this);
+                fourButton.setToolTipText("Show control panel only");
                 }
 
 		//oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
                 
-		oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
-                twoButton.setToolTipText("Show center view only");
+		oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                twoButton.setToolTipText("Show 3D view only");
 		twoButton.addActionListener(this);
                 this.fullscreenLayout = twoButton;
                 
-		oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
-		fourButton.addActionListener(this);
-                fourButton.setToolTipText("Show left panel only");
-		oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
-                sixButton.setToolTipText("2-column layout left");
-		sixButton.addActionListener(this);
-		oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
-                threeButton.setToolTipText("2-column layout right");
+		oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                threeButton.setToolTipText("Show controls and 3D view");
 		threeButton.addActionListener(this);
-		oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
-                sevenButton.setToolTipText("3-column layout");
-		sevenButton.addActionListener(this);
+		oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                sixButton.setToolTipText("Show 3D view and controls");
+		sixButton.addActionListener(this);
+//		oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+//                sevenButton.setToolTipText("3-column layout");
+//		sevenButton.addActionListener(this);
                 //
 
-		oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
-                rootButton.setToolTipText("Edit selection in new tab");
+		oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                rootButton.setToolTipText("Open selection in new tab");
 		rootButton.addActionListener(this);
 
                 oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
@@ -688,28 +1035,30 @@
 		//oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
 		//clearButton.addActionListener(this);
 
+                cGridBag row1 = new cGridBag();
+                
                 // INSERT
-                oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 gridButton.setToolTipText("Create grid");
                                 gridButton.addActionListener(this);
 
-                oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 boxButton.setToolTipText("Create box");
                                 boxButton.addActionListener(this);
 
-                oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 sphereButton.setToolTipText("Create sphere");
                                 sphereButton.addActionListener(this);
 
-                oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 coneButton.setToolTipText("Create cone");
                                 coneButton.addActionListener(this);
 
-                oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 torusButton.setToolTipText("Create torus");
                                 torusButton.addActionListener(this);
 
-                oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 superButton.setToolTipText("Create superellipsoid");
                                 superButton.addActionListener(this);
 
@@ -720,51 +1069,57 @@
                                     kleinButton.addActionListener(this);
                 }
                 
-                oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 particlesButton.setToolTipText("Create particle system");
                                particlesButton.addActionListener(this);
 
-                oe.toolboxPanel.Return();
+                oe.toolboxPanel.add(row1);
                 
-                oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                cGridBag row2 = new cGridBag();
+                
+                row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 groupButton.setToolTipText("Create group");
                                groupButton.addActionListener(this);
 
-                oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 compositeButton.setToolTipText("Create composite");
                                compositeButton.addActionListener(this);
 
-                oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 switchButton.setToolTipText("Create item switcher");
                                switchButton.addActionListener(this);
 
-                oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 loopButton.setToolTipText("Create loop");
                                loopButton.addActionListener(this);
 
-                oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 textureButton.setToolTipText("Create texture");
                                textureButton.addActionListener(this);
 
-                oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 overlayButton.setToolTipText("Create overlay");
                                overlayButton.addActionListener(this);
 
-                oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 lightButton.setToolTipText("Create light");
                                lightButton.addActionListener(this);
 
-                for (int i=6; --i>=0;)
-                {
-                oe.toolboxPanel.Return();
-                oe.toolboxPanel.add(new cGridBag());
-                oe.toolboxPanel.add(new cGridBag());
-                oe.toolboxPanel.add(new cGridBag());
-                oe.toolboxPanel.add(new cGridBag());
-                oe.toolboxPanel.add(new cGridBag());
-                oe.toolboxPanel.add(new cGridBag());
-                oe.toolboxPanel.add(new cGridBag());
-                }
+                oe.toolboxPanel.add(row2);
+                
+                // ENVYMAPS
+                cGridBag skyboxpane = new cGridBag();
+                skyboxpane.preferredHeight = 100;
+                
+                oe.skyboxPanel.add(skyboxpane);
+                
+                JTabbedPane skyboxpanel = new JTabbedPane();
+                skyboxpane.add(skyboxpanel);
+                
+                AddSkyboxTab0(skyboxpanel);
+                AddSkyboxTab1(skyboxpanel);
+                AddSkyboxTab2(skyboxpanel);
+                AddSkyboxTab3(skyboxpanel);
                 
                 // EDIT panel
 		editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
@@ -772,20 +1127,20 @@
 		editButton.addActionListener(this);
 
 		editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
-                uneditButton.setToolTipText("Remove selection controls");
+                uneditButton.setToolTipText("Unpin and remove selection controls");
 		uneditButton.addActionListener(this);
 
 		editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
                 allParamsButton.setToolTipText("Show all controle");
 		allParamsButton.addActionListener(this);
 
-		editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+		editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 clearPanelButton.setToolTipText("Clear edit panel");
 		clearPanelButton.addActionListener(this);
 
-		editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
-                unselectButton.setToolTipText("Unselect");
-		unselectButton.addActionListener(this);
+		//editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                //unselectButton.setToolTipText("Unselect");
+		//unselectButton.addActionListener(this);
 
 		editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 flashSelectionButton.setToolTipText("Highlight selection");
@@ -820,9 +1175,12 @@
 
                 oe.treePanel.add(copyOptionsPanel);
                 oe.treePanel.Return();
+        cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
+            versionSlider = (cNumberSlider)sliderPane.getComponent(1);
+            sliderPane.preferredHeight = 1;
                 
-//        mainPanel.setDividerLocation(0.5); //1.0);
-//        mainPanel.setResizeWeight(0.5);
+//        mainPanel.setDividerLocation(0.1); //1.0);
+        mainPanel.setResizeWeight(0.4);
         
 		//jList.addListSelectionListener(this);
 		oe.jTree.addTreeSelectionListener(this);
@@ -830,7 +1188,7 @@
 		//jTree.setEditable(true);
 		oe.jTree.setDragEnabled(true);
 		//jTree.setPreferredSize(new Dimension(10,10));
-		jSP.setPreferredSize(new Dimension(100,200));
+		//jSP.setPreferredSize(new Dimension(100,200));
 		
                 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
                 
@@ -842,7 +1200,7 @@
 		dgr.addDragGestureListener(this);
 		}catch(Exception e) {}
 		*/
-        radio.layout = sevenButton;
+        radio.layout = threeButton; // sixButton;
         oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
 	}
         
@@ -893,9 +1251,12 @@
                 smoothCB.setToolTipText("Snapping delay");
                                 smoothCB.addItemListener(this);
 
-                panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
-                slowCB.setToolTipText("Smooth interpolation");
-                                slowCB.addItemListener(this);
+//                panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
+//                slowCB.setToolTipText("Smooth interpolation");
+//                                slowCB.addItemListener(this);
+                panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints);
+                minshaderCB.setToolTipText("Minimal fast shader");
+                                minshaderCB.addItemListener(this);
                                 
 //        	constraints.gridy += 1;
 //                panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
@@ -945,9 +1306,9 @@
                 toggleSwitchCB.setToolTipText("Choose a single item");
                                 toggleSwitchCB.addItemListener(this);
                                 
-                panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
-                autosaveCB.setToolTipText("On structure change");
-                                autosaveCB.addItemListener(this);
+                panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
+                autokeepCB.setToolTipText("On structure change");
+                                autokeepCB.addItemListener(this);
 
                 panel.Return();
             if (Globals.ADVANCED)
@@ -984,7 +1345,7 @@
             }
             
             radioButton.SetObject(obj);
-            radioButton.layout = sevenButton;
+            radioButton.layout = threeButton; // sixButton;
             radioButton.SetCamera(cameraView.renderCamera, false);
             radioButton.addActionListener(this);
             radioPanel.add(radioButton);
@@ -1009,6 +1370,8 @@
         cCheckBox localCB;
         cCheckBox crowdCB;
         cCheckBox smoothCB;
+        cCheckBox minshaderCB;
+        
         cToggleButton fastCB;
         cCheckBox slowCB;
         cCheckBox boxCB;
@@ -1024,7 +1387,7 @@
         
         cCheckBox oeilCB;
         cCheckBox shadowCB;
-        cCheckBox autosaveCB;
+        cCheckBox autokeepCB;
         cCheckBox lookAtCB;
         
 //        static int COLOR = 1;
@@ -1079,6 +1442,12 @@
             {
                 cameraView.ToggleInertia();
         cameraView.repaint();
+            }
+            else if(e.getSource() == minshaderCB)
+            {
+                Globals.MINSHADER ^= true;
+                cameraView.programInitialized = false;
+                cameraView.repaint();
             }
             else if(e.getSource() == localCB)
             {
@@ -1136,9 +1505,9 @@
             {
                 Globals.FREEZEONMOVE ^= true;
             }
-            else if(e.getSource() == autosaveCB)
+            else if(e.getSource() == autokeepCB)
             {
-                Globals.SAVEONMAKE ^= true;
+                Globals.REPLACEONMAKE ^= true;
             }
             else if(e.getSource() == lookAtCB)
             {
@@ -1664,6 +2033,16 @@
             }
         }
     }
+
+    private void EditElement(Object3D elem, boolean newWindow)
+    {
+        //    if (!(elem instanceof Composite))
+        //        newWindow = false;
+            listUI.add(elem);
+            elem.openEditWindow(this, newWindow); //, false);
+            System.out.println("edit : " + elem);
+            elem.editWindow.refreshContents(true); // ? new
+    }
         
     /**
      * applyExample
@@ -2092,6 +2471,23 @@
 		{
 			makeSomething(new Light());
 		} else
+//		if (source == skybox1Button ||
+//                    source == skybox2Button ||
+//                    source == skybox3Button ||
+//                    source == skybox4Button ||
+//                    source == skybox5Button ||
+//                    source == skybox6Button ||
+//                    source == skybox7Button ||
+//                    source == skybox11Button ||
+//                    source == skybox12Button ||
+//                    source == skybox13Button ||
+//                    source == skybox14Button ||
+//                    source == skybox15Button ||
+//                    source == skybox16Button ||
+//                    source == skybox17Button)
+//		{
+//                    ChangeSkybox(source);
+//		} else
 		if (source == csgItem)
 		{
 			group(new CSG());
@@ -2177,7 +2573,7 @@
 		if (source == computeAOItem)
 		{
                     Globals.drawMode = CameraPane.OCCLUSION;
-                    Globals.theRenderer.repaint();
+                    cameraView.repaint();
 		} else
 		if (source == recompileItem)
 		{
@@ -2192,7 +2588,7 @@
 		if (source == invariantsItem)
 		{
                     System.out.println("Invariants:");
-                    Grafreed.grafreeD.universe.invariants();
+                    Grafreed.grafreed.universe.invariants();
 		} else
 		if (source == memoryItem)
 		{
@@ -2223,19 +2619,40 @@
 		{
 			ToggleFullScreen();
 		} else
-		if (source == undoButton)
+		if (source == previousVersionButton)
 		{
-			if (!Undo())
-                            java.awt.Toolkit.getDefaultToolkit().beep();
+                        // Go to previous version
+			//if (!Undo())
+                            //java.awt.Toolkit.getDefaultToolkit().beep();
+			PreviousVersion();
 		} else
-		if (source == redoButton)
+		if (source == restoreButton)
 		{
-			Redo();
+                        // Restore current version
+			Restore();
+        //restoreButton.setEnabled(false);
 		} else
-		if (source == saveButton)
+		if (source == replaceButton)
 		{
+                        // Overwrite current version
+			Replace();
+        //replaceButton.setEnabled(false);
+		} else
+		if (source == nextVersionButton)
+		{
+                        // Go to next version
+			NextVersion();
+		} else
+		if (source == saveVersionButton)
+		{
+                        // Save a new version
 			if (!Save(true))
                             java.awt.Toolkit.getDefaultToolkit().beep();
+		} else
+		if (source == deleteVersionButton)
+		{
+                        // Delete a new version
+                        DeleteVersion();
 		} else
 		if (source == oneStepButton)
 		{
@@ -2290,11 +2707,11 @@
 		} else
 		if (source == undoItem)
 		{
-			Undo();
+			PreviousVersion();
 		} else
 		if (source == redoItem)
 		{
-			Redo();
+			NextVersion();
 		} else
 		if (source == duplicateItem)
 		{
@@ -2615,7 +3032,7 @@
 		{
 			StepAll();
 		} else
-		if (source == clearItem) // || event.getSource() == clearButton)
+		if (source == deleteItem) // || event.getSource() == clearButton)
 		{
 			//int indices[] = jList.getSelectedIndices();
 			//for (int i = indices.length - 1; i >= 0; i--)
@@ -3097,7 +3514,7 @@
 			for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
 			{
 				obj = (Object3D)e.nextElement();
-                                obj.SetBumpTexture(null);
+                                obj.ResetBumpTexture();
 			}
 			
 			refreshContents();
@@ -3111,6 +3528,31 @@
                                 obj.SetBumpTexture(obj.GetPigmentTexture());
 			}
 			
+			refreshContents();
+		} else
+		if (source == embedTexturesItem)
+		{
+			Object3D obj;
+			for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
+			{
+				obj = (Object3D)e.nextElement();
+                                obj.EmbedTextures(true);
+			}
+			
+			refreshContents();
+		} else
+		if (source == deEmbedTexturesItem)
+		{
+			Object3D obj;
+			for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
+			{
+				obj = (Object3D)e.nextElement();
+                                obj.EmbedTextures(false);
+			}
+			
+                CameraPane.texturepigment.clear();
+                CameraPane.texturebump.clear();
+                
 			refreshContents();
 		} else
 		if (source == flashSelectionButton)
@@ -3214,8 +3656,8 @@
 //                    centralPanel.setVisible(true);
 //                    XYZPanel.setVisible(true);
                     bigThree.ClearUI();
+                    bigThree.add(scenePanel);
                     bigThree.add(centralPanel);
-                    bigThree.add(XYZPanel);
                     bigThree.FlushUI();
                     
                     cameraView.requestFocusInWindow();
@@ -3295,8 +3737,8 @@
 //                    centralPanel.setVisible(true);
 //                    XYZPanel.setVisible(false);
                     bigThree.ClearUI();
-                    bigThree.add(scenePanel);
                     bigThree.add(centralPanel);
+                    bigThree.add(scenePanel);
                     bigThree.FlushUI();
                     
                     cameraView.requestFocusInWindow();
@@ -3402,10 +3844,10 @@
 			{
 				Object3D child = (Object3D)e.nextElement();
                                 if(child.editWindow != null)
-                                    objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
                                 child.pinned = false;
 				child.CloseUI();
                                 listUI.remove(child);
+//                                    objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
                                 
                                 //child.editWindow = null; // ???????????
 			}
@@ -3424,6 +3866,7 @@
                         obj.CloseUI();
                     }
                     listUI.clear();
+                    SetPinStates(group.selection.size() > 0);
                     refreshContents(true);
 		} else
 		if (source == allParamsButton)
@@ -3479,6 +3922,9 @@
                     }
                     
                     copy = group;
+                    
+                    SetUndoStates();
+
                     //Globals.theRenderer.object = group;
                     if(!useclient)
                     {
@@ -3507,8 +3953,11 @@
                     radio.layout.doClick();
                     
                     ClearUnpinned();
-                    SetPinStates(group.selection.size() > 0);
-                    if (group.selection.size() == 1)
+                    
+                    //Grafreed.Assert(group != null);
+                    //Grafreed.Assert(group.selection != null);
+                    SetPinStates(group.selection == null || group.selection.size() > 0);
+                    if (group.selection == null || group.selection.size() == 1)
                         EditSelection(false);
                     keepparent = group.parent;
                     // PARENT = NULL or not???
@@ -3521,11 +3970,13 @@
                 } else if (event.getSource() == editCameraItem)
                 {
                     cameraView.ProtectCamera();
+                    cameraView.requestFocusInWindow();
                     cameraView.repaint();
                     return;
                 } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
                 {
                     cameraView.RevertCamera();
+                    cameraView.requestFocusInWindow();
                     cameraView.repaint();
                     return;
         //        } else if (event.getSource() == textureButton)
@@ -4102,7 +4553,7 @@
                             
                             try
                             {
-                                texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
+                                texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
                             }
                             catch (Exception e)
                             {
@@ -4579,6 +5030,12 @@
 	
 	void EditSelection(boolean newWindow)
 	{
+                if (group.selection == null)
+                {
+                     EditElement(group, newWindow); // ? new
+                     return;
+                }
+                
         //    aConstraints.gridy = 0;
 		for (int i=0; i<group.selection.size(); i++)
 		{
@@ -4589,12 +5046,7 @@
 			Object3D elem = (Object3D)group.selection.elementAt(i);
                         if(elem != group || !newWindow)
                         {
-                        //    if (!(elem instanceof Composite))
-                        //        newWindow = false;
-                            listUI.add(elem);
-                            elem.openEditWindow(this, newWindow); //, false);
-                            System.out.println("edit : " + elem);
-                            elem.editWindow.refreshContents(true); // ? new
+                            EditElement(elem, newWindow); // ? new
                         }
 		}
 	}
@@ -4657,9 +5109,7 @@
 		
 		freezemodel = false;
 	}
-	
-        boolean flashIt = true;
-        
+	        
 	public void valueChanged(TreeSelectionEvent e)
 	//public boolean handleEvent(Event event)
 	{
@@ -4732,13 +5182,15 @@
         {
             editButton.setEnabled(enabled);
             uneditButton.setEnabled(enabled);
-            unselectButton.setEnabled(enabled);
+            //unselectButton.setEnabled(enabled);
             flashSelectionButton.setEnabled(enabled);
+            
+            clearPanelButton.setEnabled(!listUI.isEmpty());
         }
 
         void refreshContents(boolean cp)
         {
-            if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
+            //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
             if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
             {
                 objEditor.ClearInfo(); // .GetMaterial());
@@ -4942,10 +5394,10 @@
 	
 	void paste(boolean expand)
 	{
-        if (Globals.SAVEONMAKE)
+        if (Globals.REPLACEONMAKE)
             Save();
-        boolean keep = Globals.SAVEONMAKE;
-        Globals.SAVEONMAKE = false;
+        boolean keep = Globals.REPLACEONMAKE;
+        Globals.REPLACEONMAKE = false;
 	//	if (GrafreeD.clipboard == null)
 	//		return;
 		boolean first = true;
@@ -5005,7 +5457,7 @@
                         Grafreed.clipboard.get(0).parent = keepparent;
 		}
 		
-        Globals.SAVEONMAKE = keep;
+        Globals.REPLACEONMAKE = keep;
 		ResetModel();
 		refreshContents();
 	}
@@ -5141,10 +5593,10 @@
         
 	void group(Object3D csg, boolean grab)
 	{
-        if (Globals.SAVEONMAKE)
+        if (Globals.REPLACEONMAKE)
             Save();
-        boolean keep = Globals.SAVEONMAKE;
-        Globals.SAVEONMAKE = false;
+        boolean keep = Globals.REPLACEONMAKE;
+        Globals.REPLACEONMAKE = false;
 		if (//false) // why??
                     !group.selection.isEmpty())
                 {
@@ -5258,15 +5710,15 @@
                 //node.add(csg);
 		//makeSomething(node);
 		makeSomething(csg);
-        Globals.SAVEONMAKE = keep;
+        Globals.REPLACEONMAKE = keep;
 	}
 	
         void Ungroup(Object3D g)
         {
-        if (Globals.SAVEONMAKE)
+        if (Globals.REPLACEONMAKE)
             Save();
-        boolean keep = Globals.SAVEONMAKE;
-        Globals.SAVEONMAKE = false;
+        boolean keep = Globals.REPLACEONMAKE;
+        Globals.REPLACEONMAKE = false;
             if (g instanceof HiddenObject)
             {
                 HiddenObject h = (HiddenObject) g;
@@ -5283,7 +5735,7 @@
                     objEditor.makeSomething(g.get(i), false);
                 }
             }
-        Globals.SAVEONMAKE = keep;
+        Globals.REPLACEONMAKE = keep;
         }
         
 	void ungroup()
@@ -5574,7 +6026,6 @@
 	
 	cButton restoreCameraButton;
         
-	cButton saveButton;
 	cButton oneStepButton;
         
         cButton groupButton;
@@ -5583,6 +6034,22 @@
         cButton switchButton;
         cButton loopButton;
         cButton textureButton;
+        
+        cButton skybox1Button;
+        cButton skybox2Button;
+        cButton skybox3Button;
+        cButton skybox4Button;
+        cButton skybox5Button;
+        cButton skybox6Button;
+        cButton skybox7Button;
+        
+        cButton skybox11Button;
+        cButton skybox12Button;
+        cButton skybox13Button;
+        cButton skybox14Button;
+        cButton skybox15Button;
+        cButton skybox16Button;
+        cButton skybox17Button;
         
         cButton gridButton;
         cButton boxButton;
@@ -5647,7 +6114,7 @@
 	private MenuItem pasteLinkItem;
 	private MenuItem pasteCloneItem;
 	private MenuItem pasteExpandItem;
-	private MenuItem clearItem;
+	private MenuItem deleteItem;
 	private MenuItem clearAllItem;
 	private MenuItem genUVItem;
 	private MenuItem genNormalsMESHItem;
@@ -5731,6 +6198,8 @@
 	private MenuItem attachBumpItem;
 	private MenuItem detachBumpItem;
 	private MenuItem pigmentBumpItem;
+	private MenuItem embedTexturesItem;
+	private MenuItem deEmbedTexturesItem;
 
 	private MenuItem particleItem;
 	private MenuItem ragdollItem;

--
Gitblit v1.6.2