trackeditor: fix setting last tab when there in no last tab

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9342 30fe4595-0a0c-4342-8851-515496e4dcbd
This commit is contained in:
iobyte 2024-02-26 18:25:18 +00:00
parent f5b67929d0
commit 4b0770f172
6 changed files with 32 additions and 7 deletions

View File

@ -150,9 +150,14 @@ public class CameraProperties extends PropertyPanel
public void run()
{
int lastTab = getEditorFrame().getProject().getPropertiesEditorCameraTab();
if (lastTab == -1 && tabbedPane.getTabCount() > 0)
{
lastTab = 0;
}
if (lastTab < tabbedPane.getTabCount())
{
tabbedPane.setSelectedIndex(lastTab);
}
}
});
}

View File

@ -247,9 +247,14 @@ public class ObjectProperties extends PropertyPanel
public void run()
{
int lastTab = getEditorFrame().getProject().getPropertiesEditorObjectTab();
if (lastTab == -1 && tabbedPane.getTabCount() > 0)
{
lastTab = 0;
}
if (lastTab < tabbedPane.getTabCount())
{
tabbedPane.setSelectedIndex(lastTab);
}
}
});
}

View File

@ -234,10 +234,15 @@ public class SurfaceProperties extends PropertyPanel
{
public void run()
{
int lastTab = getEditorFrame().getProject().getPropertiesEditorSurfaceTab();
int lastTab = getEditorFrame().getProject().getPropertiesEditorSurfaceTab();
if (lastTab == -1 && tabbedPane.getTabCount() > 0)
{
lastTab = 0;
}
if (lastTab < tabbedPane.getTabCount())
{
tabbedPane.setSelectedIndex(lastTab);
}
}
});
}

View File

@ -478,9 +478,14 @@ public class TerrainProperties extends PropertyPanel
public void run()
{
int lastTab = getEditorFrame().getProject().getPropertiesEditorTerrainTab();
if (lastTab == -1 && tabbedPane.getTabCount() > 0)
{
lastTab = 0;
}
if (lastTab < tabbedPane.getTabCount())
{
tabbedPane.setSelectedIndex(lastTab);
}
}
});
}

View File

@ -155,9 +155,14 @@ public class TrackLightProperties extends PropertyPanel
public void run()
{
int lastTab = getEditorFrame().getProject().getPropertiesEditorLightTab();
if (lastTab == -1 && tabbedPane.getTabCount() > 0)
{
lastTab = 0;
}
if (lastTab < tabbedPane.getTabCount())
{
tabbedPane.setSelectedIndex(lastTab);
}
}
});
}

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.57";
public final String version = "1.4.58";
private String path;
private double imageScale = 1;