File tree Expand file tree Collapse file tree
java/com/faforever/iceadapter Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,6 +143,7 @@ public static void close() {
143143 onFAShutdown ();//will close gameSession aswell
144144 GPGNetServer .close ();
145145 RPCService .close ();
146+ TrayIcon .close ();
146147
147148 System .exit (0 );
148149 }
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ public class Debug {
1919
2020 public static void init () {
2121 // Debugger window is started and set to debugFuture when either window is requested as the info window can be used to open the debug window
22+ // This is not used anymore as the debug window is started and hidden in case it is requested via the tray icon
2223 if (! ENABLE_DEBUG_WINDOW && ! ENABLE_INFO_WINDOW ) {
2324 debug .complete (new NoDebugger ());
2425 return ;
Original file line number Diff line number Diff line change @@ -76,6 +76,11 @@ public void start(Stage stage) {
7676
7777// new Thread(() -> Debug.debug.complete(this)).start();
7878 log .info ("Created debug window." );
79+
80+ //TODO: this is pretty hacky, replaces NoDebugger in case the context got just created from the tray icon
81+ if (Debug .debug .isDone ()) {
82+ Debug .debug = new CompletableFuture <>();
83+ }
7984 Debug .debug .complete (this );
8085
8186 if (Debug .ENABLE_INFO_WINDOW ) {
Original file line number Diff line number Diff line change @@ -59,10 +59,14 @@ public void init() {
5959 }
6060
6161 public void minimize () {
62+ Platform .setImplicitExit (false );
6263 Platform .runLater (this .stage ::hide );
6364 }
6465
6566 public void show () {
66- Platform .runLater (this .stage ::show );
67+ Platform .runLater (() -> {
68+ this .stage .show ();
69+ Platform .setImplicitExit (true );
70+ });
6771 }
6872}
Original file line number Diff line number Diff line change 11package com .faforever .iceadapter .util ;
22
3+ import com .faforever .iceadapter .debug .Debug ;
4+ import com .faforever .iceadapter .debug .DebugWindow ;
35import com .faforever .iceadapter .debug .InfoWindow ;
46import lombok .extern .slf4j .Slf4j ;
57
@@ -42,9 +44,14 @@ public void mouseClicked(MouseEvent mouseEvent) {
4244
4345 @ Override
4446 public void mousePressed (MouseEvent mouseEvent ) {
45- if (InfoWindow .INSTANCE != null ) {
46- InfoWindow .INSTANCE .show ();
47- }
47+ new Thread (() -> {
48+ if (InfoWindow .INSTANCE == null ) {
49+ Debug .ENABLE_INFO_WINDOW = true ;
50+ DebugWindow .launchApplication ();
51+ } else {
52+ InfoWindow .INSTANCE .show ();
53+ }
54+ }).start ();
4855 }
4956
5057 @ Override
@@ -60,14 +67,14 @@ public void mouseExited(MouseEvent mouseEvent) {
6067 }
6168 });
6269
63- showMessage ("ICE Adapter started" );
64-
6570 try {
6671 SystemTray .getSystemTray ().add (trayIcon );
6772 } catch (AWTException e ) {
6873 log .error ("Tray icon could not be added" , e );
6974 }
7075
76+ showMessage ("ICE Adapter started" );
77+
7178 log .info ("Created tray icon" );
7279 }
7380
Original file line number Diff line number Diff line change 2727 </padding >
2828 </HBox >
2929
30- <Label text =" FAForever is currently testing a new connectivity solution to reduce disconnects while in game ."
30+ <Label text =" This adapter establishes and monitors your connection to other players in game. Closing it will terminate all connections ."
3131 wrapText =" true" textAlignment =" CENTER" ></Label >
3232
3333
3737 </padding >
3838 </HBox >
3939
40- <Label text =" Please keep this window open while the game is in progress." styleClass =" bold-text" textAlignment =" CENTER" />
40+ <Label text =" Please keep it running while the game is in progress." styleClass =" bold-text"
41+ textAlignment =" CENTER" />
4142
4243 <HBox >
4344 <padding >
You can’t perform that action at this time.
0 commit comments