Merge pull request #1777 from Alberth289346/leveledit-fixes

[rdy] Leveledit fixes
This commit is contained in:
Stephen E. Baker
2020-12-28 12:07:49 -05:00
committed by GitHub
4 changed files with 26 additions and 24 deletions

View File

@@ -14,7 +14,8 @@ to compile. An alternative is to issue the following commands while in this
folder: folder:
Compile: Compile:
javac -d bin -sourcepath src src/com/corsixth/leveledit/Main.java 1. javac -d bin -sourcepath src src/com/corsixth/leveledit/Main.java
2. Copy icon images (src/icon*.png) to bin directory (getting bin/icon*png files).
Run: Run:
java -cp bin com.corsixth.leveledit.Main java -cp bin com.corsixth.leveledit.Main
@@ -22,7 +23,6 @@ java -cp bin com.corsixth.leveledit.Main
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- Contact Details -- Contact Details
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
Homepage: http://th.corsix.org/ Homepage: https://github.com/CorsixTH/CorsixTH
Forum: http://forums.corsixth.com/
Mailing list: http://groups.google.com/group/corsix-th-dev Mailing list: http://groups.google.com/group/corsix-th-dev
IRC: #corsix-th on FreeNode IRC: #corsix-th on FreeNode

View File

@@ -53,7 +53,7 @@ public class Emergency {
JPanel emergencyPanel = new JPanel(); JPanel emergencyPanel = new JPanel();
JComboBox illnessCombo = new JComboBox(diseases); JComboBox<String> illnessCombo = new JComboBox<>(diseases);
JLabel minPatientsLabel = new JLabel("Patients min:"); JLabel minPatientsLabel = new JLabel("Patients min:");
JLabel maxPatientsLabel = new JLabel("Patients max:"); JLabel maxPatientsLabel = new JLabel("Patients max:");
JLabel startMonthLabel = new JLabel("Start month:"); JLabel startMonthLabel = new JLabel("Start month:");
@@ -66,5 +66,4 @@ public class Emergency {
JTextField endMonthTF = new JTextField(Integer.toString(endMonth), 2); JTextField endMonthTF = new JTextField(Integer.toString(endMonth), 2);
JTextField percWinTF = new JTextField(Integer.toString(percWin), 2); JTextField percWinTF = new JTextField(Integer.toString(percWin), 2);
JTextField bonusTF = new JTextField(Integer.toString(bonus), 5); JTextField bonusTF = new JTextField(Integer.toString(bonus), 5);
} }

View File

@@ -28,6 +28,7 @@ import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.net.URL;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -37,9 +38,9 @@ import javax.swing.JOptionPane;
/** /**
* Create menu and tabBar, set window size, location and on-exit-behaviour. * Create menu and tabBar, set window size, location and on-exit-behaviour.
* *
* @author Koanxd * @author Koanxd
* *
*/ */
public class Gui extends JFrame { public class Gui extends JFrame {
@@ -54,22 +55,24 @@ public class Gui extends JFrame {
FileChooser fileChooser = new FileChooser(this); FileChooser fileChooser = new FileChooser(this);
public Gui() { public Gui() {
List<Image> icons = new ArrayList<>(); String[] iconNames = {"icon256.png", "icon128.png", "icon64.png",
icons.add(Toolkit.getDefaultToolkit().getImage( "icon48.png", "icon32.png", "icon24.png", "icon16.png"};
ClassLoader.getSystemResource("icon256.png")));
icons.add(Toolkit.getDefaultToolkit().getImage( // Load icon files, and set them as application image.
ClassLoader.getSystemResource("icon128.png"))); List<Image> icons = new ArrayList<>(iconNames.length);
icons.add(Toolkit.getDefaultToolkit().getImage( Toolkit tk = Toolkit.getDefaultToolkit();
ClassLoader.getSystemResource("icon64.png"))); for (String fname: iconNames) {
icons.add(Toolkit.getDefaultToolkit().getImage( URL iconUrl = ClassLoader.getSystemResource(fname);
ClassLoader.getSystemResource("icon48.png"))); Image img = (iconUrl == null) ? null : tk.getImage(iconUrl);
icons.add(Toolkit.getDefaultToolkit().getImage( if (img == null) {
ClassLoader.getSystemResource("icon32.png"))); System.out.printf("Warning: Could not load resource \"%s\".\n", fname);
icons.add(Toolkit.getDefaultToolkit().getImage( } else {
ClassLoader.getSystemResource("icon24.png"))); icons.add(img);
icons.add(Toolkit.getDefaultToolkit().getImage( }
ClassLoader.getSystemResource("icon16.png"))); }
setIconImages(icons); if (!icons.isEmpty()) {
setIconImages(icons);
}
setTitle("CorsixTH Level Editor"); setTitle("CorsixTH Level Editor");

View File

@@ -41,7 +41,7 @@ public class StartStaff {
JPanel startStaffPanel = new JPanel(); JPanel startStaffPanel = new JPanel();
JComboBox staffMemberCombo = new JComboBox(staffChoice); JComboBox<String> staffMemberCombo = new JComboBox<>(staffChoice);
JCheckBox shrinkCB = new JCheckBox(); JCheckBox shrinkCB = new JCheckBox();
JCheckBox surgeonCB = new JCheckBox(); JCheckBox surgeonCB = new JCheckBox();
JCheckBox researcherCB = new JCheckBox(); JCheckBox researcherCB = new JCheckBox();