added possiblity to build jar file and override shutdown behavior when closing via alt-f4 or the close button of the window
This commit is contained in:
		@@ -26,3 +26,14 @@ implementation project(":mdga:model")
 | 
				
			|||||||
    mainClass = 'pp.mdga.client.MdgaApp'
 | 
					    mainClass = 'pp.mdga.client.MdgaApp'
 | 
				
			||||||
    applicationName = 'MDGA'
 | 
					    applicationName = 'MDGA'
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					tasks.register('fatJar', Jar) {
 | 
				
			||||||
 | 
					    duplicatesStrategy = DuplicatesStrategy.EXCLUDE
 | 
				
			||||||
 | 
					    manifest {
 | 
				
			||||||
 | 
					        attributes 'Main-Class': 'pp.mdga.client.MdgaApp'
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    from {
 | 
				
			||||||
 | 
					        configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    with jar
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -88,7 +88,7 @@ public class MdgaApp extends SimpleApplication {
 | 
				
			|||||||
    private final TimerManager timerManager = new TimerManager();
 | 
					    private final TimerManager timerManager = new TimerManager();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static final int DEBUG_MULTIPLIER = 0;
 | 
					    public static final int DEBUG_MULTIPLIER = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Constructs a new MdgaApp instance.
 | 
					     * Constructs a new MdgaApp instance.
 | 
				
			||||||
@@ -403,5 +403,14 @@ public TimerManager getTimerManager() {
 | 
				
			|||||||
    public CeremonyView getCeremonyView() {
 | 
					    public CeremonyView getCeremonyView() {
 | 
				
			||||||
        return ceremonyView;
 | 
					        return ceremonyView;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public void destroy() {
 | 
				
			||||||
 | 
					        afterGameCleanup();
 | 
				
			||||||
 | 
					        if (executor != null) {
 | 
				
			||||||
 | 
					            executor.shutdown();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        super.destroy();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user