-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed version
- Loading branch information
Showing
17 changed files
with
83 additions
and
41 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-25.7 MB
compiler/artifacts/Scandalous_Soundboard_jar/Scandalous-Soundboard.jar
Binary file not shown.
3 changes: 0 additions & 3 deletions
3
compiler/production/Scandalous-Soundboard.main/META-INF/MANIFEST.MF
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-2.64 KB
compiler/production/Scandalous-Soundboard.main/xhookman/soundboard/ModLauncher.class
Binary file not shown.
Binary file removed
BIN
-882 Bytes
compiler/production/Scandalous-Soundboard.main/xhookman/soundboard/Soundboard.class
Binary file not shown.
Binary file removed
BIN
-1 KB
...r/production/Scandalous-Soundboard.main/xhookman/soundboard/client/SoundboardClient.class
Binary file not shown.
Binary file removed
BIN
-3.01 KB
...iler/production/Scandalous-Soundboard.main/xhookman/soundboard/soundboard/Converter.class
Binary file not shown.
Binary file removed
BIN
-5.05 KB
...iler/production/Scandalous-Soundboard.main/xhookman/soundboard/soundboard/FilesUtil.class
Binary file not shown.
Binary file removed
BIN
-3.32 KB
...production/Scandalous-Soundboard.main/xhookman/soundboard/soundboard/SoundJsonUtils.class
Binary file not shown.
Binary file removed
BIN
-6.76 KB
...oduction/Scandalous-Soundboard.main/xhookman/soundboard/soundboard/SoundboardClient.class
Binary file not shown.
Binary file removed
BIN
-2.88 KB
.../production/Scandalous-Soundboard.main/xhookman/soundboard/soundboard/SoundboardGui.class
Binary file not shown.
Binary file removed
BIN
-6.41 KB
...oduction/Scandalous-Soundboard.main/xhookman/soundboard/soundboard/SoundboardServer.class
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package xhookman.soundboard; | ||
|
||
import javax.swing.*; | ||
import java.awt.*; | ||
import java.awt.event.ActionEvent; | ||
import java.io.File; | ||
|
||
import static xhookman.soundboard.soundboard.FilesUtil.getJarPath; | ||
import static xhookman.soundboard.soundboard.FilesUtil.getNewJarName; | ||
|
||
public class LogWindow { | ||
private final JFrame frame; | ||
private final JTextArea textArea; | ||
private final JButton button; | ||
|
||
public LogWindow(){ | ||
frame = new JFrame("Soundboard Updater"); | ||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | ||
textArea = new JTextArea(); | ||
button = new JButton("Ok"); | ||
frame.add(textArea, BorderLayout.CENTER); | ||
frame.pack(); | ||
frame.setLocationRelativeTo(null); | ||
frame.setVisible(true); | ||
textArea.setEditable(false); | ||
textArea.setText("Please wait while the mod is updating..."); | ||
button.addActionListener((ActionEvent e) -> { | ||
removeJar(); | ||
frame.dispose(); | ||
}); | ||
|
||
frame.addWindowListener(new java.awt.event.WindowAdapter() { | ||
@Override | ||
public void windowClosing(java.awt.event.WindowEvent windowEvent) { | ||
removeJar(); | ||
} | ||
}); | ||
} | ||
public void writeToLog(String text){ | ||
textArea.append("\n" + text); | ||
frame.pack(); | ||
} | ||
|
||
public void addOkButton(){ | ||
frame.add(button, BorderLayout.SOUTH); | ||
frame.pack(); | ||
} | ||
|
||
private static void removeJar(){ // The file is removed after 2 seconds | ||
try { | ||
String jarName = getJarPath().substring(getJarPath().lastIndexOf("/")+1); | ||
String command = "Start-Sleep -Seconds 2;Remove-Item -Path '"+ jarName + "' -Force;" + | ||
"Rename-Item " + getNewJarName() + " " + getJarPath().substring(getJarPath().lastIndexOf("/")+1); | ||
ProcessBuilder pb = new ProcessBuilder("powershell", "-Command", command); // Obliged because Windows 11 is trash and doing it with a cmd does not work | ||
pb.directory(new File(getJarPath()).getParentFile()); | ||
System.out.println("Deleting jar..."); | ||
pb.start(); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
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