-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes: * Fixed some world generation themes (Desert, Tundra and Hell), the others are still temporarily broken :(. * Added support for the Standard Galactic Alphabet. * The book "AlAzif" was renamed "Grimoire", its sprite was updated, and now its content is a poem written in the Standard Galactic Alphabet. * Ambient sounds, such as those produced by mobs, are now played non-asynchronously, to avoid over-saturation. * Beds now display a message directly instead of showing how much time is left before you can sleep. * The Assembler was completely removed. * Now the Air Wizard flashes a certain color when it is preparing an attack, and when it is in an advanced phase (as happened in very old versions of Minicraft Plus) * Completely removed the other types of Bossbars and the other types of death messages to avoid too many redundancies in the code. * The player's swimming animation is now slower when swimming in Lava. * The burn mechanic has been temporarily removed and will be rewritten in a better way. * Heart particles were removed. * The blindness potion was removed, but not the effect completely :). * Removed vertical sync option. * Updated Splashes.json and some translations. * Particles are now no longer loaded when loading a world, this should avoid the small lag spike that occurs when starting the world. Bug fixes: - Fixed the Air Wizard sprite changing when it changes phase - Fixed a bug in the video options that asked to restart even if nothing had been changed
- Loading branch information
Showing
76 changed files
with
898 additions
and
920 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
173 changes: 89 additions & 84 deletions
173
...main/java/minicraft/core/CrashReport.java → .../java/minicraft/core/io/CrashHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,89 @@ | ||
package minicraft.core; | ||
|
||
import java.awt.Color; | ||
import java.awt.Dimension; | ||
import java.awt.Font; | ||
import java.awt.Image; | ||
import java.awt.image.BufferedImage; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
import javax.imageio.ImageIO; | ||
import javax.swing.ImageIcon; | ||
import javax.swing.JLabel; | ||
import javax.swing.JPanel; | ||
import javax.swing.JScrollPane; | ||
import javax.swing.JTextArea; | ||
import javax.swing.UIManager; | ||
import javax.swing.UnsupportedLookAndFeelException; | ||
|
||
public class CrashReport extends JPanel { | ||
private static final long serialVersionUID = 1L; | ||
|
||
private JTextArea crashTextArea; | ||
private JScrollPane crashScrollPane; | ||
private JLabel crashIconLabel; | ||
|
||
// TODO: Add a crash log save, save all into a txt file | ||
|
||
public CrashReport(String crash) { | ||
// Crash log Structure | ||
crashTextArea = new JTextArea(5, 5); | ||
crashIconLabel = new JLabel(); | ||
|
||
Image icon = null; | ||
try ( | ||
InputStream is = Game.class.getResourceAsStream("/resources/title.png")) { | ||
BufferedImage titleIcon = ImageIO.read(is); | ||
icon = titleIcon.getScaledInstance(258 + 16, 60 + 8, Image.SCALE_REPLICATE); | ||
crashIconLabel.setIcon(new ImageIcon(icon)); | ||
} catch (IOException exception) { | ||
exception.printStackTrace(); | ||
} | ||
|
||
crashTextArea.setForeground(Color.BLACK); | ||
crashTextArea.setBackground(Color.WHITE); | ||
|
||
// Crash message | ||
crashTextArea.setText(crash); | ||
crashTextArea.setEditable(false); | ||
crashTextArea.setFont(new Font("Consolas", Font.PLAIN, 12)); | ||
|
||
// All white, is better | ||
UIManager.put("OptionPane.background", Color.white); | ||
UIManager.put("Panel.background", Color.white); | ||
try { | ||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); | ||
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException exception) { | ||
exception.printStackTrace(); | ||
} | ||
|
||
// Adjust size and set layout | ||
setPreferredSize(new Dimension(Renderer.getWindowSize())); | ||
setLayout(null); | ||
|
||
// Add components to parent widget | ||
crashScrollPane = new JScrollPane(crashTextArea); | ||
crashTextArea.select(0, 0); // Reset the scroll bars position | ||
add(crashScrollPane); | ||
add(crashIconLabel); | ||
|
||
// Set component bounds (only needed by absolute positioning) | ||
crashScrollPane.setBounds(69, 100, 732, 380); | ||
crashIconLabel.setBounds((Renderer.getWindowSize().width / 2) - (icon.getWidth(Initializer.frame) / 2), 25, 258 + 16, 60 + 8); | ||
setBackground(new Color(46, 53, 69)); | ||
} | ||
|
||
/** | ||
* Manually launched crash! | ||
*/ | ||
public static void crashMePlease() { | ||
throw new NullPointerException("Manually initiated crash! :D"); | ||
} | ||
|
||
} | ||
package minicraft.core.io; | ||
|
||
import java.awt.Color; | ||
import java.awt.Dimension; | ||
import java.awt.Font; | ||
import java.awt.Image; | ||
import java.awt.image.BufferedImage; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
import javax.imageio.ImageIO; | ||
import javax.swing.ImageIcon; | ||
import javax.swing.JLabel; | ||
import javax.swing.JPanel; | ||
import javax.swing.JScrollPane; | ||
import javax.swing.JTextArea; | ||
import javax.swing.UIManager; | ||
import javax.swing.UnsupportedLookAndFeelException; | ||
|
||
import minicraft.core.Game; | ||
import minicraft.core.Initializer; | ||
import minicraft.core.Renderer; | ||
|
||
public class CrashHandler extends JPanel { | ||
private static final long serialVersionUID = 1L; | ||
|
||
private JTextArea crashTextArea; | ||
private JScrollPane crashScrollPane; | ||
private JLabel crashIconLabel; | ||
|
||
// TODO: Add a crash log save, save all into a txt file | ||
|
||
public CrashHandler(String crash) { | ||
// Crash log Structure | ||
crashTextArea = new JTextArea(5, 5); | ||
crashIconLabel = new JLabel(); | ||
|
||
Image icon = null; | ||
|
||
try ( | ||
InputStream is = Game.class.getResourceAsStream("/resources/title.png")) { | ||
BufferedImage titleIcon = ImageIO.read(is); | ||
icon = titleIcon.getScaledInstance(258 + 16, 60 + 8, Image.SCALE_REPLICATE); | ||
crashIconLabel.setIcon(new ImageIcon(icon)); | ||
} catch (IOException exception) { | ||
exception.printStackTrace(); | ||
} | ||
|
||
crashTextArea.setForeground(Color.BLACK); | ||
crashTextArea.setBackground(Color.WHITE); | ||
|
||
// Crash message | ||
crashTextArea.setText(crash); | ||
crashTextArea.setEditable(false); | ||
crashTextArea.setFont(new Font("Consolas", Font.PLAIN, 12)); | ||
|
||
// All white, is better | ||
UIManager.put("OptionPane.background", Color.white); | ||
UIManager.put("Panel.background", Color.white); | ||
try { | ||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); | ||
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException exception) { | ||
exception.printStackTrace(); | ||
} | ||
|
||
// Adjust size and set layout | ||
setPreferredSize(new Dimension(Renderer.getWindowSize())); | ||
setLayout(null); | ||
|
||
// Add components to parent widget | ||
crashScrollPane = new JScrollPane(crashTextArea); | ||
crashTextArea.select(0, 0); // Reset the scroll bars position | ||
add(crashScrollPane); | ||
add(crashIconLabel); | ||
|
||
// Set component bounds (only needed by absolute positioning) | ||
crashScrollPane.setBounds(69, 100, 732, 380); | ||
crashIconLabel.setBounds((Renderer.getWindowSize().width / 2) - (icon.getWidth(Initializer.frame) / 2), 25, 258 + 16, 60 + 8); | ||
setBackground(new Color(46, 53, 69)); | ||
} | ||
|
||
/** | ||
* Manually launched crash! | ||
*/ | ||
public static void crashMePlease() { | ||
throw new NullPointerException("Manually initiated crash! :D"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.