trackeditor: remember default surfaces dialog last position

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@8363 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 41e7524b1164fbb9ae95ac2197d25037d4d6c5e8
Former-commit-id: 40ad3b2157eb70f2444b5f2b0ec825103ff619a4
This commit is contained in:
iobyte 2022-08-03 22:30:55 +00:00
parent 95d9b1addf
commit e8fc2c1148
2 changed files with 49 additions and 6 deletions

View file

@ -199,6 +199,8 @@ public class EditorFrame extends JFrame
private final static String SD_BIN_DIRECTORY = "BinDirectory";
private final static String SD_LIB_DIRECTORY = "LibDirectory";
private DefaultSurfacesDialog defaultSurfacesDialog = null;
public class NewProjectInfo
{
public String name;
@ -697,6 +699,8 @@ public class EditorFrame extends JFrame
getProject().setSegmentEditorY(preferences.getInt("SegmentEditorY", 0));
getProject().setPropertiesEditorX(preferences.getInt("PropertiesEditorX", 0));
getProject().setPropertiesEditorY(preferences.getInt("PropertiesEditorY", 0));
getProject().setDefaultSurfacesDialogX(preferences.getInt("DefaultSurfacesDialogX", 0));
getProject().setDefaultSurfacesDialogY(preferences.getInt("DefaultSurfacesDialogY", 0));
}
/**
@ -1014,8 +1018,11 @@ public class EditorFrame extends JFrame
private void defaultSurfacesDialog()
{
DefaultSurfacesDialog surfacesDialog = new DefaultSurfacesDialog(this);
surfacesDialog.setVisible(true);
if (defaultSurfacesDialog == null)
{
defaultSurfacesDialog = new DefaultSurfacesDialog(this);
defaultSurfacesDialog.setVisible(true);
}
}
/**
@ -2218,6 +2225,13 @@ public class EditorFrame extends JFrame
public void exit()
{
if (defaultSurfacesDialog != null)
{
getProject().setDefaultSurfacesDialogX(defaultSurfacesDialog.getX());
getProject().setDefaultSurfacesDialogY(defaultSurfacesDialog.getY());
defaultSurfacesDialog.setVisible(false);
}
getProject().setFrameX(this.getX());
getProject().setFrameY(this.getY());
@ -2229,6 +2243,8 @@ public class EditorFrame extends JFrame
preferences.putInt("SegmentEditorY", getProject().getSegmentEditorY());
preferences.putInt("PropertiesEditorX", getProject().getPropertiesEditorX());
preferences.putInt("PropertiesEditorY", getProject().getPropertiesEditorY());
preferences.putInt("DefaultSurfacesDialogX", getProject().getDefaultSurfacesDialogX());
preferences.putInt("DefaultSurfacesDialogY", getProject().getDefaultSurfacesDialogY());
System.exit(0);
}
@ -2305,4 +2321,9 @@ public class EditorFrame extends JFrame
}
return calculateDeltaButton;
}
public void clearDefaultSurfacesDialog()
{
defaultSurfacesDialog = null;
}
}

View file

@ -34,6 +34,8 @@ public class Project
private int segmentEditorY = 0;
private int propertiesEditorX = 0;
private int propertiesEditorY = 0;
private int defaultSurfacesDialogX = 0;
private int defaultSurfacesDialogY = 0;
public Project()
{
@ -116,4 +118,24 @@ public class Project
{
this.propertiesEditorY = propertiesEditorY;
}
public int getDefaultSurfacesDialogX()
{
return defaultSurfacesDialogX;
}
public void setDefaultSurfacesDialogX(int defaultSurfacesDialogX)
{
this.defaultSurfacesDialogX = defaultSurfacesDialogX;
}
public int getDefaultSurfacesDialogY()
{
return defaultSurfacesDialogY;
}
public void setDefaultSurfacesDialogY(int defaultSurfacesDialogY)
{
this.defaultSurfacesDialogY = defaultSurfacesDialogY;
}
}