trackeditor: replace showConfirmDialog with showOptionDialog
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@8984 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 2f5bc7f487f6277d721d84d3767a95f28839de61 Former-commit-id: e61308826926ffab74602a72956606d7b9b24bea
This commit is contained in:
parent
035c8f287b
commit
8c7947eab1
2 changed files with 21 additions and 8 deletions
|
@ -812,24 +812,36 @@ public class SegmentSideProperties extends JPanel implements SliderListener
|
||||||
case "no barrier":
|
case "no barrier":
|
||||||
if (parent.editorFrame.getInteractiveFixes())
|
if (parent.editorFrame.getInteractiveFixes())
|
||||||
{
|
{
|
||||||
// fix up bad values (height should be 0)
|
// fix up bad values (height should be 0)
|
||||||
if (getBarrierHeight(segment, side) != 0)
|
if (getBarrierHeight(segment, side) != 0)
|
||||||
{
|
{
|
||||||
if (JOptionPane.showConfirmDialog(null, "Found " + side.getName() + " barrier style \"no barrier\" with" +
|
String[] options = { "Set height to 0.0", "Ignore" };
|
||||||
getBarrierHeightText(segment, side) + getBarrierWidthText(segment, side) + getBarrierSurfaceText(segment, side) +
|
switch (JOptionPane.showOptionDialog(null, "Found " + side.getName() + " barrier style \"no barrier\" with" +
|
||||||
" ?\n\nShould be 0.0.", "Fix Barrier Height", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)
|
getBarrierHeightText(segment, side) + getBarrierWidthText(segment, side) + getBarrierSurfaceText(segment, side),
|
||||||
|
"Invalid Barrier Height", JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[1]))
|
||||||
{
|
{
|
||||||
|
case 0: // set height to 0
|
||||||
side.setBarrierHeight(0);
|
side.setBarrierHeight(0);
|
||||||
|
break;
|
||||||
|
case 1: // ignore
|
||||||
|
// nothing
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// fix up bad values (width should be 0)
|
// fix up bad values (width should be 0)
|
||||||
if (getBarrierWidth(segment, side) != 0)
|
if (getBarrierWidth(segment, side) != 0)
|
||||||
{
|
{
|
||||||
if (JOptionPane.showConfirmDialog(null, "Found " + side.getName() + " barrier style \"no barrier\" with " +
|
String[] options = { "Set width to 0.0", "Ignore" };
|
||||||
getBarrierWidthText(segment, side) + getBarrierHeightText(segment, side) + getBarrierSurfaceText(segment, side) +
|
switch (JOptionPane.showOptionDialog(null, "Found " + side.getName() + " barrier style \"no barrier\" with" +
|
||||||
" ?\n\nShould be 0.0.", "Fix Barrier Width", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)
|
getBarrierWidthText(segment, side) + getBarrierHeightText(segment, side) + getBarrierSurfaceText(segment, side),
|
||||||
|
"Invalid Barrier Width", JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[1]))
|
||||||
{
|
{
|
||||||
|
case 0: // set width to 0
|
||||||
side.setBarrierWidth(0);
|
side.setBarrierWidth(0);
|
||||||
|
break;
|
||||||
|
case 1: // ignore
|
||||||
|
// nothing
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -888,6 +900,7 @@ public class SegmentSideProperties extends JPanel implements SliderListener
|
||||||
side.setBarrierSurface(null);
|
side.setBarrierSurface(null);
|
||||||
side.setBarrierHeight(Double.NaN);
|
side.setBarrierHeight(Double.NaN);
|
||||||
side.setBarrierWidth(Double.NaN);
|
side.setBarrierWidth(Double.NaN);
|
||||||
|
side.setHasBarrier(false);
|
||||||
getBarrierSurfaceComboBox().setSelectedIndex(-1);
|
getBarrierSurfaceComboBox().setSelectedIndex(-1);
|
||||||
getBarrierHeightSlider().setValue(side.getBarrierHeight());
|
getBarrierHeightSlider().setValue(side.getBarrierHeight());
|
||||||
getBarrierHeightSlider().setEnabled(false);
|
getBarrierHeightSlider().setEnabled(false);
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class Properties
|
||||||
private static Properties instance = new Properties();
|
private static Properties instance = new Properties();
|
||||||
private Vector<ActionListener> propertiesListeners = new Vector<ActionListener>();
|
private Vector<ActionListener> propertiesListeners = new Vector<ActionListener>();
|
||||||
public final String title = "sd2-trackeditor";
|
public final String title = "sd2-trackeditor";
|
||||||
public final String version = "1.2.38";
|
public final String version = "1.2.39";
|
||||||
private String path;
|
private String path;
|
||||||
|
|
||||||
private double imageScale = 1;
|
private double imageScale = 1;
|
||||||
|
|
Loading…
Reference in a new issue