trackeditor: remember last terrain properties tab

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9337 30fe4595-0a0c-4342-8851-515496e4dcbd
This commit is contained in:
iobyte 2024-02-24 19:26:59 +00:00
parent 4c1487a974
commit a2680dea78
4 changed files with 27 additions and 1 deletions

View File

@ -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());

View File

@ -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"

View File

@ -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;
}
}

View File

@ -34,7 +34,7 @@ public class Properties
private static Properties instance = new Properties();
private Vector<ActionListener> propertiesListeners = new Vector<ActionListener>();
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;