Skip to content

Commit fe6f330

Browse files
committed
cleanup
1 parent 5f4cae9 commit fe6f330

File tree

4 files changed

+52
-12
lines changed

4 files changed

+52
-12
lines changed

src/main/java/lol/hyper/customlauncher/accounts/windows/MainWindow.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,15 @@ public MainWindow(InvasionTracker invasionTracker, FieldOfficeTracker fieldOffic
9494
// invasions button
9595
JButton invasionsButton = new JButton("Invasions");
9696
invasionsButton.addActionListener(
97-
e -> {
98-
invasionTracker.showWindow();
99-
});
97+
e -> invasionTracker.showWindow());
10098
invasionsButton.setAlignmentX(Component.CENTER_ALIGNMENT);
10199
invasionsButton.setMaximumSize(new Dimension(300, invasionsButton.getMinimumSize().height));
102100
panel.add(invasionsButton);
103101

104102
// field office button
105103
JButton fieldOfficesButton = new JButton("Field Offices");
106104
fieldOfficesButton.addActionListener(
107-
e -> {
108-
fieldOfficeTracker.showWindow();
109-
});
105+
e -> fieldOfficeTracker.showWindow());
110106
fieldOfficesButton.setAlignmentX(Component.CENTER_ALIGNMENT);
111107
fieldOfficesButton.setMaximumSize(
112108
new Dimension(300, fieldOfficesButton.getMinimumSize().height));

src/main/java/lol/hyper/customlauncher/fieldofficetracker/FieldOfficeTask.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ public void actionPerformed(ActionEvent e) {
3131
}
3232
JSONObject fieldOfficeJSON = fieldOfficeRoot.getJSONObject("fieldOffices");
3333

34-
fieldOfficeTracker.logger.info("Reading " + FIELD_OFFICE_URL + " for current field offices...");
34+
fieldOfficeTracker.logger.info(
35+
"Reading " + FIELD_OFFICE_URL + " for current field offices...");
3536

3637
// go through all the field offices from the API
3738
Iterator<String> keys = fieldOfficeJSON.keys();
@@ -59,7 +60,8 @@ public void actionPerformed(ActionEvent e) {
5960

6061
// we look at the current field office list and see if any of them
6162
// are not on the field office JSON (aka that field office is gone)
62-
Iterator<Map.Entry<Integer, FieldOffice>> it = fieldOfficeTracker.fieldOffices.entrySet().iterator();
63+
Iterator<Map.Entry<Integer, FieldOffice>> it =
64+
fieldOfficeTracker.fieldOffices.entrySet().iterator();
6365
while (it.hasNext()) {
6466
Map.Entry<Integer, FieldOffice> pair = it.next();
6567
String key = String.valueOf(pair.getKey());

src/main/java/lol/hyper/customlauncher/fieldofficetracker/FieldOfficeTracker.java

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,31 @@ public void showNotification(FieldOffice fieldOffice, boolean newFieldOffice) {
138138
}
139139
Notify notify;
140140
if (newFieldOffice) {
141-
notify = Notify.create().title("New Field Office!").text(zonesToStreets.get(fieldOffice.getArea()) + " - " + fieldOffice.getDifficulty() + " star").darkStyle().position(Pos.BOTTOM_RIGHT).hideAfter(5000).image(Main.icon);
141+
notify =
142+
Notify.create()
143+
.title("New Field Office!")
144+
.text(
145+
zonesToStreets.get(fieldOffice.getArea())
146+
+ " - "
147+
+ fieldOffice.getDifficulty()
148+
+ " star")
149+
.darkStyle()
150+
.position(Pos.BOTTOM_RIGHT)
151+
.hideAfter(5000)
152+
.image(Main.icon);
142153
} else {
143-
notify = Notify.create().title("Field Office Gone!").text(zonesToStreets.get(fieldOffice.getArea()) + " - " + fieldOffice.getDifficulty() + " star").darkStyle().position(Pos.BOTTOM_RIGHT).hideAfter(5000).image(Main.icon);
154+
notify =
155+
Notify.create()
156+
.title("Field Office Gone!")
157+
.text(
158+
zonesToStreets.get(fieldOffice.getArea())
159+
+ " - "
160+
+ fieldOffice.getDifficulty()
161+
+ " star")
162+
.darkStyle()
163+
.position(Pos.BOTTOM_RIGHT)
164+
.hideAfter(5000)
165+
.image(Main.icon);
144166
}
145167
notify.showInformation();
146168
}

src/main/java/lol/hyper/customlauncher/invasiontracker/InvasionTracker.java

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,29 @@ public void showNotification(Invasion invasion, boolean newInvasion) {
159159
}
160160
Notify notify;
161161
if (newInvasion) {
162-
notify = Notify.create().title("New Invasion!").text(invasion.getDistrict() + " - " + invasion.getCogType().replace("\u0003", "")).darkStyle().position(Pos.BOTTOM_RIGHT).hideAfter(5000).image(Main.icon);
162+
notify =
163+
Notify.create()
164+
.title("New Invasion!")
165+
.text(
166+
invasion.getDistrict()
167+
+ " - "
168+
+ invasion.getCogType().replace("\u0003", ""))
169+
.darkStyle()
170+
.position(Pos.BOTTOM_RIGHT)
171+
.hideAfter(5000)
172+
.image(Main.icon);
163173
} else {
164-
notify = Notify.create().title("Invasion Gone!").text(invasion.getDistrict() + " - " + invasion.getCogType().replace("\u0003", "")).darkStyle().position(Pos.BOTTOM_RIGHT).hideAfter(5000).image(Main.icon);
174+
notify =
175+
Notify.create()
176+
.title("Invasion Gone!")
177+
.text(
178+
invasion.getDistrict()
179+
+ " - "
180+
+ invasion.getCogType().replace("\u0003", ""))
181+
.darkStyle()
182+
.position(Pos.BOTTOM_RIGHT)
183+
.hideAfter(5000)
184+
.image(Main.icon);
165185
}
166186
notify.showInformation();
167187
}

0 commit comments

Comments
 (0)