diff --git a/.classpath b/.classpath index 61f3bb9..b2ff1d1 100644 --- a/.classpath +++ b/.classpath @@ -12,6 +12,7 @@ + diff --git a/src/main/java/galaxyoyo/unknown/client/main/Main.java b/src/main/java/galaxyoyo/unknown/client/main/Main.java index 0b00d1e..71b4917 100644 --- a/src/main/java/galaxyoyo/unknown/client/main/Main.java +++ b/src/main/java/galaxyoyo/unknown/client/main/Main.java @@ -1,8 +1,10 @@ /** - * + * @author galaxyoyo */ package galaxyoyo.unknown.client.main; +import galaxyoyo.unknown.frame.MainFrame; + import java.io.IOException; import joptsimple.OptionParser; @@ -17,8 +19,8 @@ import org.apache.logging.log4j.core.appender.FileAppender; import org.apache.logging.log4j.core.layout.PatternLayout; /** - * @author galaxyoyo * Class principale qui lance le jeu + * @author galaxyoyo * @see #main(String...) */ public class Main @@ -50,7 +52,9 @@ public class Main Logger LOGGER = (Logger) LogManager.getRootLogger(); ConsoleAppender console = ConsoleAppender.newBuilder().setLayout(PatternLayout.newBuilder().withPattern("[%d{dd/MM/yyyy}] [%d{HH:mm:ss}] [%t] [%c] [%p] %m%n").build()).setName("Console").build(); - FileAppender file = FileAppender.createAppender("Console.log", "false", "false", "File", "true", "true", "true", "8192", console.getLayout(), null, "false", "false", null); + FileAppender file = FileAppender.createAppender("Console.log", "false", "false", "File", "true", "true", "true", "8192", PatternLayout.newBuilder().withPattern("[%d{dd/MM/yyyy}] [%d{HH:mm:ss}] [%t] [%c] [%p] %m%n").build(), null, "false", "false", null); + console.start(); + file.start(); LOGGER.addAppender(console); LOGGER.addAppender(file); LOGGER.setLevel(Level.INFO); @@ -87,7 +91,7 @@ public class Main if (DEBUG) { - LOGGER.setLevel(Level.DEBUG); + LOGGER.setLevel(Level.ALL); } } @@ -96,11 +100,24 @@ public class Main launchEditMode(); return; } + + launchFrame(); } + /** + * Lance la fenêtre principale + * @see #main(String...) + * @see #launchEditMode() + */ + private static void launchFrame() + { + MainFrame.getInstance().setVisible(true); + } + /** * Permet de lancer l'éditeur de carte * @see #main(String...) + * @see #launchFrame() * @since 0.1-aplha */ private static void launchEditMode() diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml new file mode 100644 index 0000000..9a809f8 --- /dev/null +++ b/src/main/resources/log4j2.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file