Commit 8aa6c9dc authored by Huot Mathieu's avatar Huot Mathieu

fixed when game leaves, play-term in makefile

parent 85a784cf
...@@ -103,4 +103,4 @@ play: ...@@ -103,4 +103,4 @@ play:
cd bin/; java -cp $(LIB)*:. graphics.guiSkeleton.Igniter_Main & cd bin/; java -cp $(LIB)*:. graphics.guiSkeleton.Igniter_Main &
play-term: play-term:
cd bin/; java -cp $(LIB)*:. graphics.termSkeleton.Igniter_Main_Term & cd bin/; java -cp $(LIB)*:. graphics.termSkeleton.Igniter_Main_Term
...@@ -39,7 +39,6 @@ public class GraphicsMaster extends GraphicsMasterAbstraction { ...@@ -39,7 +39,6 @@ public class GraphicsMaster extends GraphicsMasterAbstraction {
private MainFrame mainFrame; private MainFrame mainFrame;
private GraphicsMaster() { private GraphicsMaster() {
super.mainFrame=mainFrame;
mapGUIStatesToGUIPanel.put(GUIStates.UNINITIALISED, new UnitialisedGUIPanel(this)); mapGUIStatesToGUIPanel.put(GUIStates.UNINITIALISED, new UnitialisedGUIPanel(this));
mapGUIStatesToGUIPanel.put(GUIStates.MAIN_MENU, new MainMenuPanel(this)); mapGUIStatesToGUIPanel.put(GUIStates.MAIN_MENU, new MainMenuPanel(this));
mapGUIStatesToGUIPanel.put(GUIStates.GAME_PANEL, new GamePanel(this)); mapGUIStatesToGUIPanel.put(GUIStates.GAME_PANEL, new GamePanel(this));
......
package graphics.ingame_input_listener; package graphics.ingame_input_listener;
import logging.Logging;
import assets.UsedForLoadingSprites; import assets.UsedForLoadingSprites;
import logging.Logging;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.io.*; import java.io.BufferedReader;
import java.lang.reflect.Array; import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL; import java.net.URL;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
...@@ -103,13 +103,12 @@ public class InputConfiguration { ...@@ -103,13 +103,12 @@ public class InputConfiguration {
*/ */
public static void UpdateConfigurationWhenGameLeaves(){ public static void UpdateConfigurationWhenGameLeaves(){
//List<String> configurationText=new ArrayList<>();
int numberOfInput=9; int numberOfInput=9;
int LineToWrite=0; int LineToWrite=0;
//2*numberOfInput because there are terminal and graphical versions //2*numberOfInput because there are terminal and graphical versions
String[] configurationText = new String[2*numberOfInput]; String[] configurationText = new String[2*numberOfInput];
Charset utf8 = StandardCharsets.UTF_8; Charset utf8 = StandardCharsets.UTF_8;
//Updating Configuration text w.r.t current inputs before leaving the game //Updating Configuration text w.r.t current inputs before leaving the game
//First graphical version inputs //First graphical version inputs
configurationText[LineToWrite]=GetFormalInputString(Input.UP_ARROW); configurationText[LineToWrite]=GetFormalInputString(Input.UP_ARROW);
...@@ -148,6 +147,7 @@ public class InputConfiguration { ...@@ -148,6 +147,7 @@ public class InputConfiguration {
configurationText[LineToWrite]=String.valueOf(Character.toChars(ability3_terminal)); configurationText[LineToWrite]=String.valueOf(Character.toChars(ability3_terminal));
LineToWrite++; LineToWrite++;
configurationText[LineToWrite]=String.valueOf(Character.toChars(escape_terminal)); configurationText[LineToWrite]=String.valueOf(Character.toChars(escape_terminal));
//Finally converting the array configurationText to a big string which is to replace configuration.txt //Finally converting the array configurationText to a big string which is to replace configuration.txt
List<String> lines = Arrays.asList(configurationText); List<String> lines = Arrays.asList(configurationText);
try{ try{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment