3 Commits
Author SHA1 Message Date
JoeMolinelli 6c608360d1 Add files via upload 2026-07-21 23:11:08 -04:00
JoeMolinelli bca69d3ab1 Delete src/main/java directory 2026-07-21 23:10:51 -04:00
JoeMolinelli e7d0ea4268 Update README.md 2026-07-20 18:46:56 -04:00
4 changed files with 40 additions and 19 deletions

No files matched your search

+1 -1
View File
@@ -22,7 +22,7 @@ Either of the following methods can be used:
------------ ------------
## Installation Instructions (EXE): ## Installation Instructions (EXE): NOT IN USE RIGHT NOW
1. Download and run the [latest release](https://github.com/MistWeatherMedia/WeatherSTAR-3000-Java/releases) .exe installer file 1. Download and run the [latest release](https://github.com/MistWeatherMedia/WeatherSTAR-3000-Java/releases) .exe installer file
2. Locate the installed program and run it. 2. Locate the installed program and run it.
3. Locate an api.weather.com API key and configure your settings, then run! 3. Locate an api.weather.com API key and configure your settings, then run!
@@ -73,6 +73,8 @@ public class LocalForecast extends Thread {
JSONArray alertData = JSONResponse.getJSONArray("alerts"); JSONArray alertData = JSONResponse.getJSONArray("alerts");
StringBuilder fullText = new StringBuilder(); StringBuilder fullText = new StringBuilder();
fullText.setLength(0);
for (int i = 0; i < alertData.length(); i++) { for (int i = 0; i < alertData.length(); i++) {
if (utl.isHeadline(alertData.getJSONObject(i).getString("eventDescription"))) { if (utl.isHeadline(alertData.getJSONObject(i).getString("eventDescription"))) {
if (!fullText.isEmpty()) {fullText.append(" *NEWLINE* ");} if (!fullText.isEmpty()) {fullText.append(" *NEWLINE* ");}
@@ -80,9 +82,15 @@ public class LocalForecast extends Thread {
} }
} }
String[] splitwords = fullText.toString().split("\\s+"); words.clear();
words.addAll(Arrays.asList(splitwords)); if (!fullText.isEmpty()) {
String[] splitwords = fullText.toString().split("\\s+");
words.addAll(Arrays.asList(splitwords));
} else {
words.add("NOBULLETIN");
}
return words; return words;
} catch (Exception e) { } catch (Exception e) {
@@ -74,7 +74,7 @@ public class Main {
static JTextField mainLocName; static JTextField mainLocName;
public static void main(String[] args) throws InterruptedException { public static void main(String[] args) throws InterruptedException {
System.out.println("WeatherSTAR 3000 Simulator Version 1.2.3"); System.out.println("WeatherSTAR 3000 Simulator Version 1.3.1");
String userDir = System.getProperty("user.dir"); String userDir = System.getProperty("user.dir");
if (userDir != null && !userDir.isEmpty()) { if (userDir != null && !userDir.isEmpty()) {
@@ -365,13 +365,6 @@ public class SlidesRunner extends Scene {
} }
if (Window.slidesSecFrameCount % slideLength == 0) { if (Window.slidesSecFrameCount % slideLength == 0) {
if (ending && !bulletinActive) {
System.exit(0);
audioManager.close();
//glfwSetWindowShouldClose(Window.getGLFWWindow(), true);
//Main.settingsWindow.setVisible(true);
}
travelForecastActive = false; travelForecastActive = false;
travelDataInit = false; travelDataInit = false;
slideInit = false; slideInit = false;
@@ -397,6 +390,14 @@ public class SlidesRunner extends Scene {
round = 0; round = 0;
} }
} }
if (ending && !bulletinActive) {
System.exit(0);
audioManager.close();
//glfwSetWindowShouldClose(Window.getGLFWWindow(), true);
//Main.settingsWindow.setVisible(true);
}
slideChooser(); slideChooser();
if (travelForecastActive) { if (travelForecastActive) {
if (Window.secFrameCount % 2 == 0) travelOffset--; if (Window.secFrameCount % 2 == 0) travelOffset--;
@@ -751,7 +752,7 @@ public class SlidesRunner extends Scene {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
if (lfData.bulletin.get(0) == "NOBULLETIN") { if (!lfData.bulletin.get(0).equals("NOBULLETIN")) {
for (int i = 0; i <= lfData.bulletin.size()-1; i++) { for (int i = 0; i <= lfData.bulletin.size()-1; i++) {
if (lfData.bulletin.get(i).equals("*NEWLINE*")) { if (lfData.bulletin.get(i).equals("*NEWLINE*")) {
lfbMainLines.add("*" + utl.cjust(sb.toString(), 30, " ") + "*"); lfbMainLines.add("*" + utl.cjust(sb.toString(), 30, " ") + "*");
@@ -771,7 +772,7 @@ public class SlidesRunner extends Scene {
lfbMainLines.add("*" + utl.cjust(sb.toString(), 30, " ") + "*"); lfbMainLines.add("*" + utl.cjust(sb.toString(), 30, " ") + "*");
sb.setLength(0); sb.setLength(0);
} else { } else {
lfbMainLines.add(utl.ljust("", 32, " ")); lfbMainLines.add("NOTHING");
} }
sb.setLength(0); sb.setLength(0);
@@ -818,15 +819,25 @@ public class SlidesRunner extends Scene {
sb.setLength(0); sb.setLength(0);
int linesPassed = 0; int linesPassed = 0;
if (lfbMainLines.get(0) == " " || forecastOneLines.size() > 7) {
for (int i = 0; i <= lfbMainLines.size()-1; i++) { if (lfbMainLines.get(0).equals("NOTHING") && forecastOneLines.size() < 8) {
lfMainLines.add(lfbMainLines.get(i));
linesPassed++;
}
} else {
lfMainLines.add(utl.ljust("", 32, " ")); lfMainLines.add(utl.ljust("", 32, " "));
linesPassed++; linesPassed++;
} else {
if (!lfbMainLines.get(0).equals("NOTHING")) {
for (int i = 0; i <= lfbMainLines.size()-1; i++) {
lfMainLines.add(lfbMainLines.get(i));
linesPassed++;
}
}
if (forecastOneLines.size() < 7 - linesPassed) {
lfMainLines.add(utl.ljust("", 32, " "));
linesPassed++;
}
} }
//then add first forecast
for (int i = 0; i <= forecastOneLines.size()-1; i++) { for (int i = 0; i <= forecastOneLines.size()-1; i++) {
lfMainLines.add(forecastOneLines.get(i)); lfMainLines.add(forecastOneLines.get(i));
linesPassed++; linesPassed++;
@@ -835,6 +846,8 @@ public class SlidesRunner extends Scene {
lfMainLines.add(utl.ljust("", 32, " ")); lfMainLines.add(utl.ljust("", 32, " "));
linesPassed++; linesPassed++;
} }
//next screen
lfMainLines.add(utl.ljust("", 32, " ")); lfMainLines.add(utl.ljust("", 32, " "));
linesPassed++; linesPassed++;
for (int i = 0; i <= forecastTwoLines.size()-1; i++) { for (int i = 0; i <= forecastTwoLines.size()-1; i++) {