diff --git a/src/tools/trackeditor/gui/EditorFrame.java b/src/tools/trackeditor/gui/EditorFrame.java index 5f342bb9d..5d10c0f7e 100644 --- a/src/tools/trackeditor/gui/EditorFrame.java +++ b/src/tools/trackeditor/gui/EditorFrame.java @@ -936,6 +936,7 @@ public class EditorFrame extends JFrame getProject().setPropertiesEditorObjectTab(preferences.getInt("PropertiesEditorObjectTab", 0)); getProject().setPropertiesEditorCameraTab(preferences.getInt("PropertiesEditorCameraTab", 0)); getProject().setPropertiesEditorLightTab(preferences.getInt("PropertiesEditorLightTab", 0)); + getProject().setPropertiesEditorTerrainTab(preferences.getInt("PropertiesEditorTerrainTab", 0)); getProject().setDefaultSurfacesDialogX(preferences.getInt("DefaultSurfacesDialogX", 0)); getProject().setDefaultSurfacesDialogY(preferences.getInt("DefaultSurfacesDialogY", 0)); getProject().setDefaultObjectsDialogX(preferences.getInt("DefaultObjectsDialogX", 0)); @@ -3327,6 +3328,7 @@ public class EditorFrame extends JFrame preferences.putInt("PropertiesEditorObjectTab", getProject().getPropertiesEditorObjectTab()); preferences.putInt("PropertiesEditorCameraTab", getProject().getPropertiesEditorCameraTab()); preferences.putInt("PropertiesEditorLightTab", getProject().getPropertiesEditorLightTab()); + preferences.putInt("PropertiesEditorTerrainTab", getProject().getPropertiesEditorTerrainTab()); preferences.putInt("DefaultSurfacesDialogX", getProject().getDefaultSurfacesDialogX()); preferences.putInt("DefaultSurfacesDialogY", getProject().getDefaultSurfacesDialogY()); preferences.putInt("DefaultObjectsDialogX", getProject().getDefaultObjectsDialogX()); diff --git a/src/tools/trackeditor/gui/properties/TerrainProperties.java b/src/tools/trackeditor/gui/properties/TerrainProperties.java index 6c1c08225..7c10ee710 100644 --- a/src/tools/trackeditor/gui/properties/TerrainProperties.java +++ b/src/tools/trackeditor/gui/properties/TerrainProperties.java @@ -33,6 +33,7 @@ import javax.swing.JFileChooser; import javax.swing.JLabel; import javax.swing.JTabbedPane; import javax.swing.JTextField; +import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.filechooser.FileNameExtensionFilter; import gui.EditorFrame; @@ -472,6 +473,16 @@ public class TerrainProperties extends PropertyPanel tabbedPane.addTab("Objects", null, new GraphicObjectProperties(getEditorFrame())); tabbedPane.addTab("Object Maps", null, new ObjectMapProperties(getEditorFrame())); tabbedPane.addTab("Reliefs", null, new ReliefProperties(getEditorFrame())); + SwingUtilities.invokeLater( new Runnable() + { + public void run() + { + int lastTab = getEditorFrame().getProject().getPropertiesEditorTerrainTab(); + + if (lastTab < tabbedPane.getTabCount()) + tabbedPane.setSelectedIndex(lastTab); + } + }); } return tabbedPane; } @@ -606,5 +617,7 @@ public class TerrainProperties extends PropertyPanel Component component2 = tabbedPane.getComponentAt(2); ReliefProperties properties2 = (ReliefProperties)component2; properties2.exit(); + + getEditorFrame().getProject().setPropertiesEditorTerrainTab(this.tabbedPane.getSelectedIndex()); } } // @jve:decl-index=0:visual-constraint="10,10" diff --git a/src/tools/trackeditor/utils/Project.java b/src/tools/trackeditor/utils/Project.java index ef9e89066..c81d6ae11 100644 --- a/src/tools/trackeditor/utils/Project.java +++ b/src/tools/trackeditor/utils/Project.java @@ -53,6 +53,7 @@ public class Project private int propertiesEditorObjectTab = 0; private int propertiesEditorCameraTab = 0; private int propertiesEditorLightTab = 0; + private int propertiesEditorTerrainTab = 0; public Project() { @@ -325,4 +326,14 @@ public class Project { this.propertiesEditorLightTab = propertiesEditorLightTab; } + + public int getPropertiesEditorTerrainTab() + { + return propertiesEditorTerrainTab; + } + + public void setPropertiesEditorTerrainTab(int propertiesEditorTerrainTab) + { + this.propertiesEditorTerrainTab = propertiesEditorTerrainTab; + } } diff --git a/src/tools/trackeditor/utils/Properties.java b/src/tools/trackeditor/utils/Properties.java index 3b91ca154..a464e1709 100644 --- a/src/tools/trackeditor/utils/Properties.java +++ b/src/tools/trackeditor/utils/Properties.java @@ -34,7 +34,7 @@ public class Properties private static Properties instance = new Properties(); private Vector propertiesListeners = new Vector(); public final String title = "sd2-trackeditor"; - public final String version = "1.4.53"; + public final String version = "1.4.54"; private String path; private double imageScale = 1;