2 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
3 changed files with 39 additions and 18 deletions

No files matched your search

@@ -73,6 +73,8 @@ public class LocalForecast extends Thread {
JSONArray alertData = JSONResponse.getJSONArray("alerts");
StringBuilder fullText = new StringBuilder();
fullText.setLength(0);
for (int i = 0; i < alertData.length(); i++) {
if (utl.isHeadline(alertData.getJSONObject(i).getString("eventDescription"))) {
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;
} catch (Exception e) {
@@ -74,7 +74,7 @@ public class Main {
static JTextField mainLocName;
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");
if (userDir != null && !userDir.isEmpty()) {
@@ -365,13 +365,6 @@ public class SlidesRunner extends Scene {
}
if (Window.slidesSecFrameCount % slideLength == 0) {
if (ending && !bulletinActive) {
System.exit(0);
audioManager.close();
//glfwSetWindowShouldClose(Window.getGLFWWindow(), true);
//Main.settingsWindow.setVisible(true);
}
travelForecastActive = false;
travelDataInit = false;
slideInit = false;
@@ -397,6 +390,14 @@ public class SlidesRunner extends Scene {
round = 0;
}
}
if (ending && !bulletinActive) {
System.exit(0);
audioManager.close();
//glfwSetWindowShouldClose(Window.getGLFWWindow(), true);
//Main.settingsWindow.setVisible(true);
}
slideChooser();
if (travelForecastActive) {
if (Window.secFrameCount % 2 == 0) travelOffset--;
@@ -751,7 +752,7 @@ public class SlidesRunner extends Scene {
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++) {
if (lfData.bulletin.get(i).equals("*NEWLINE*")) {
lfbMainLines.add("*" + utl.cjust(sb.toString(), 30, " ") + "*");
@@ -771,7 +772,7 @@ public class SlidesRunner extends Scene {
lfbMainLines.add("*" + utl.cjust(sb.toString(), 30, " ") + "*");
sb.setLength(0);
} else {
lfbMainLines.add(utl.ljust("", 32, " "));
lfbMainLines.add("NOTHING");
}
sb.setLength(0);
@@ -818,15 +819,25 @@ public class SlidesRunner extends Scene {
sb.setLength(0);
int linesPassed = 0;
if (lfbMainLines.get(0) == " " || forecastOneLines.size() > 7) {
for (int i = 0; i <= lfbMainLines.size()-1; i++) {
lfMainLines.add(lfbMainLines.get(i));
linesPassed++;
}
} else {
if (lfbMainLines.get(0).equals("NOTHING") && forecastOneLines.size() < 8) {
lfMainLines.add(utl.ljust("", 32, " "));
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++) {
lfMainLines.add(forecastOneLines.get(i));
linesPassed++;
@@ -835,6 +846,8 @@ public class SlidesRunner extends Scene {
lfMainLines.add(utl.ljust("", 32, " "));
linesPassed++;
}
//next screen
lfMainLines.add(utl.ljust("", 32, " "));
linesPassed++;
for (int i = 0; i <= forecastTwoLines.size()-1; i++) {