From 2d8a6a7124cc922ae399aef4069e213bab855d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Thu, 14 Jan 2016 23:49:43 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20ajout=20du=20composant=20worldlist,=20af?= =?UTF-8?q?finage=20du=20syst=C3=A8me=20de=20gestion=20de=20base=20de=20do?= =?UTF-8?q?nn=C3=A9e,=20correction=20de=20nombreux=20bogues,=20ajout=20du?= =?UTF-8?q?=20menu=20principal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/build.gradle | 2 +- core/src/fr/evolving/UI/ServerList.java | 35 +++- core/src/fr/evolving/UI/Worldlist.java | 24 +++ core/src/fr/evolving/assets/AssetLoader.java | 12 +- core/src/fr/evolving/assets/Preference.java | 6 +- core/src/fr/evolving/database/Base.java | 4 + .../fr/evolving/database/DatabaseManager.java | 38 ++++- core/src/fr/evolving/database/LocalBase.java | 38 ++++- core/src/fr/evolving/database/SqlBase.java | 7 + .../fr/evolving/renderers/LevelRenderer.java | 6 +- core/src/fr/evolving/screens/LevelScreen.java | 159 ++++++++++++++++-- .../src/fr/evolving/screens/SplashScreen.java | 2 +- 12 files changed, 292 insertions(+), 41 deletions(-) create mode 100644 core/src/fr/evolving/UI/Worldlist.java diff --git a/core/build.gradle b/core/build.gradle index 03cd1be..42ff9fd 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -1,6 +1,6 @@ apply plugin: "java" -sourceCompatibility = 1.6 +sourceCompatibility = 1.7 [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' sourceSets.main.java.srcDirs = [ "src/" ] diff --git a/core/src/fr/evolving/UI/ServerList.java b/core/src/fr/evolving/UI/ServerList.java index b039266..e94b10d 100644 --- a/core/src/fr/evolving/UI/ServerList.java +++ b/core/src/fr/evolving/UI/ServerList.java @@ -16,6 +16,7 @@ import com.badlogic.gdx.utils.Base64Coder; import com.badlogic.gdx.utils.XmlReader; import com.badlogic.gdx.utils.XmlReader.Element; +import fr.evolving.assets.AssetLoader; import fr.evolving.database.Base; import fr.evolving.database.Base.datatype; import fr.evolving.database.LocalBase; @@ -25,6 +26,7 @@ public class ServerList extends List { HashMap parameters; String url; Base.datatype model; + Worldlist list; public ServerList(String url,Base.datatype model,Skin skin) { super(skin); @@ -32,15 +34,18 @@ public class ServerList extends List { this.model=model; parameters = new HashMap(); parameters.put("version", "last"); - Refresh(); } - public boolean getBackend(String base,datatype model) { - String[] realbase=base.split(":"); - if (realbase[0].contains("mysql")) - return SqlBase.isHandling(model); - else - return LocalBase.isHandling(model); + public String getUrl() { + return (String)this.getSelected(); + } + + public Base.datatype getModel() { + return model; + } + + public void setWorldlist(Worldlist list) { + this.list=list; } public void Refresh() { @@ -65,13 +70,25 @@ public class ServerList extends List { XmlReader.Element xml_element = xml.parse(Response); resultxml= xml_element.getChildrenByName("server"); for(Element child : resultxml) - if (getBackend(child.getText(),ServerList.this.model)) + if (AssetLoader.Datahandler.isBackend(ServerList.this.model,child.getText())) resultstring.add(child.getText()); + String old=AssetLoader.Datahandler.getOld(ServerList.this.model); + if (!resultstring.contains(old,false)) + resultstring.add(old); ServerList.this.setItems(resultstring); - + ServerList.this.setSelectedIndex(resultstring.indexOf(old, false)); + if (list!=null && ServerList.this.model==Base.datatype.gamedata) + list.Refresh(); } @Override public void failed(Throwable t) { + Array resultstring=new Array(); + String old=AssetLoader.Datahandler.getOld(ServerList.this.model); + resultstring.add(old); + ServerList.this.setItems(resultstring); + ServerList.this.setSelectedIndex(resultstring.indexOf(old, false)); + if (list!=null && ServerList.this.model==Base.datatype.gamedata) + list.Refresh(); } public void cancelled() { diff --git a/core/src/fr/evolving/UI/Worldlist.java b/core/src/fr/evolving/UI/Worldlist.java new file mode 100644 index 0000000..f5eab53 --- /dev/null +++ b/core/src/fr/evolving/UI/Worldlist.java @@ -0,0 +1,24 @@ +package fr.evolving.UI; + +import com.badlogic.gdx.scenes.scene2d.ui.List; +import com.badlogic.gdx.scenes.scene2d.ui.Skin; +import com.badlogic.gdx.utils.Array; + +import fr.evolving.assets.AssetLoader; +import fr.evolving.assets.Preference; + +public class Worldlist extends List { + + public Worldlist(Skin skin) { + super(skin); + // TODO Auto-generated constructor stub + } + + public void Refresh() { + Array worlds=AssetLoader.Datahandler.game().getworlds(); + String world=Preference.prefs.getString("world"); + if (!worlds.contains(world, false)) + worlds.add(world); + this.setItems(worlds); + } +} diff --git a/core/src/fr/evolving/assets/AssetLoader.java b/core/src/fr/evolving/assets/AssetLoader.java index a4074ee..d2efa6c 100644 --- a/core/src/fr/evolving/assets/AssetLoader.java +++ b/core/src/fr/evolving/assets/AssetLoader.java @@ -203,12 +203,16 @@ public class AssetLoader { Datahandler= new DatabaseManager(); Datahandler.RegisterBackend(LocalBase.class); Datahandler.RegisterBackend(SqlBase.class); - Datahandler.Attach(datatype.userdata, "local:test.db"); - Datahandler.Attach(datatype.statdata, "local:test.db"); - Datahandler.Attach(datatype.gamedata, "local:test.db"); - + Databasemanagerfrompref(); } + public static void Databasemanagerfrompref() { + Datahandler.CloseAll(); + Datahandler.Attach(datatype.userdata, Preference.prefs.getString("userdata")); + Datahandler.Attach(datatype.statdata, Preference.prefs.getString("statdata")); + Datahandler.Attach(datatype.gamedata, Preference.prefs.getString("gamedata")); + } + public static Transmuter getTransmuter(String Name) { for(Transmuter transmuter:allTransmuter) { if (transmuter.isTransmuter(Name)) diff --git a/core/src/fr/evolving/assets/Preference.java b/core/src/fr/evolving/assets/Preference.java index deb7bb4..db8c629 100644 --- a/core/src/fr/evolving/assets/Preference.java +++ b/core/src/fr/evolving/assets/Preference.java @@ -39,6 +39,9 @@ public class Preference { public static void defaults() { Vector2 maxres=getmaxresolution(); Gdx.app.log("Preferences","Preference par defaut avec resolution native :"+maxres.x+"x"+maxres.y); + Preference.prefs.putString("userdata", "local:test.db"); + Preference.prefs.putString("gamedata", "local:test.db"); + Preference.prefs.putString("statdata", "local:test.db"); Preference.prefs.putInteger("ResolutionX", (int)maxres.x); Preference.prefs.putInteger("ResolutionY", (int)maxres.y); Preference.prefs.putInteger("Resolution", 9); @@ -49,9 +52,10 @@ public class Preference { Preference.prefs.putBoolean("Refresh", false); Preference.prefs.putBoolean("Animation", true); Preference.prefs.putBoolean("Language", false); + Preference.prefs.putString("world", "test pour voir"); Preference.prefs.putFloat("Effect", 1.0f); Preference.prefs.putFloat("Music",0.75f); - Preference.prefs.putInteger("Adaptation", 1); + Preference.prefs.putInteger("Adaptation", 2); Preference.prefs.putInteger("Quality", 2); Preference.prefs.putInteger("log", Gdx.app.LOG_INFO); Preference.prefs.flush(); diff --git a/core/src/fr/evolving/database/Base.java b/core/src/fr/evolving/database/Base.java index a6aa36a..7f2bf1d 100644 --- a/core/src/fr/evolving/database/Base.java +++ b/core/src/fr/evolving/database/Base.java @@ -15,6 +15,10 @@ public abstract class Base { public Base() { } + public String getParam() { + return null; + } + //Gestion type Gamebase public Array getworlds() { diff --git a/core/src/fr/evolving/database/DatabaseManager.java b/core/src/fr/evolving/database/DatabaseManager.java index b1e8161..b6895f9 100644 --- a/core/src/fr/evolving/database/DatabaseManager.java +++ b/core/src/fr/evolving/database/DatabaseManager.java @@ -6,8 +6,13 @@ import com.badlogic.gdx.utils.Array; public class DatabaseManager { private static Base[] bases; + private static String[] old; private static Array> backends; + public Base getType(Base.datatype model) { + return bases[model.ordinal()]; + } + public Base user(){ return bases[Base.datatype.userdata.ordinal()]; } @@ -22,20 +27,29 @@ public class DatabaseManager { public DatabaseManager(){ bases=new Base[3]; + old=new String[3]; backends=new Array>(); } public void CloseAll() { - for(Base base:bases) - base.Close(); + for(int i=0;i<3;i++) + if (bases[i]!=null) { + bases[i].Close(); + bases[i]=null; + } + } + + public String getOld(Base.datatype model) { + return old[model.ordinal()]; } public boolean Attach(Base.datatype model, String Url) { - if (bases[model.ordinal()]!=null) + if (bases[model.ordinal()]!=null || model==null || Url==null) return false; Base backend=getBackend(model,Url); if (backend!=null) { bases[model.ordinal()]=backend; + old[model.ordinal()]=Url; return true; } else @@ -61,7 +75,23 @@ public class DatabaseManager { } } return null; - + } + + public boolean isBackend(Base.datatype model, String Url) { + String Type=Url.split(":")[0]; + for(Class classe:backends) { + Base back; + try { + back = (Base) classe.newInstance(); + if (back.getprefix().equals(Type)) + return true; + } catch (InstantiationException | IllegalAccessException + | IllegalArgumentException | SecurityException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + return false; } public void RegisterBackend(Class classe) { diff --git a/core/src/fr/evolving/database/LocalBase.java b/core/src/fr/evolving/database/LocalBase.java index 7751c65..86651a2 100644 --- a/core/src/fr/evolving/database/LocalBase.java +++ b/core/src/fr/evolving/database/LocalBase.java @@ -2,19 +2,26 @@ package fr.evolving.database; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import java.nio.channels.FileChannel; import java.nio.charset.Charset; import javax.xml.bind.DatatypeConverter; +import com.badlogic.gdx.Files.FileType; import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.sql.Database; import com.badlogic.gdx.sql.DatabaseCursor; import com.badlogic.gdx.sql.DatabaseFactory; import com.badlogic.gdx.sql.SQLiteGdxException; import com.badlogic.gdx.utils.Array; +import fr.evolving.assets.AssetLoader; import fr.evolving.automata.Grid; import fr.evolving.automata.Level; import fr.evolving.automata.Transmuter; @@ -24,16 +31,40 @@ public class LocalBase extends Base { private static Database dbHandler; private String databasename = "base.db"; private String creation; + private String param; //Contructeur de la base de donnée - public LocalBase(){ + + public String getParam() { + return this.param; + } + + public LocalBase() { } public LocalBase(datatype model,String param) { super(model,param); String[] params=param.split(":"); + this.param=param; if (params.length>1) databasename=params[1]; + switch(Gdx.app.getType()) { + case Android: + try { + FileChannel source = ((FileInputStream) Gdx.files.internal("bases/"+databasename).read()).getChannel(); + FileChannel destination = new FileOutputStream("/data/data/fr.evolving.game.android/databases/"+databasename).getChannel(); + destination.transferFrom(source, 0, source.size()); + source.close(); + destination.close(); + } catch (IOException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + case Desktop: + FileHandle newbase=Gdx.files.local(databasename); + if (!newbase.exists()) + Gdx.files.internal("bases/"+databasename).copyTo(newbase); + } if (dbHandler!=null) Gdx.app.log("Local", "Reprise de la base '"+databasename+"', table:"+model.toString()); else @@ -292,7 +323,10 @@ public class LocalBase extends Base { public void Close() { try { - dbHandler.closeDatabase(); + if (dbHandler!=null) { + dbHandler.closeDatabase(); + dbHandler=null; + } } catch (SQLiteGdxException e) { // TODO Auto-generated catch block e.printStackTrace(); diff --git a/core/src/fr/evolving/database/SqlBase.java b/core/src/fr/evolving/database/SqlBase.java index 2d49d91..472db2c 100644 --- a/core/src/fr/evolving/database/SqlBase.java +++ b/core/src/fr/evolving/database/SqlBase.java @@ -12,6 +12,13 @@ public class SqlBase extends Base{ super(model,param); } + public SqlBase() { + } + + public String getprefix() { + return "mysql"; + } + public static boolean isHandling(datatype base){ if (base==datatype.statdata) return false; diff --git a/core/src/fr/evolving/renderers/LevelRenderer.java b/core/src/fr/evolving/renderers/LevelRenderer.java index 0fe5134..084717a 100644 --- a/core/src/fr/evolving/renderers/LevelRenderer.java +++ b/core/src/fr/evolving/renderers/LevelRenderer.java @@ -68,7 +68,8 @@ public class LevelRenderer { public void render(float delta, float runTime) { Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); - font.setColor(AssetLoader.Levelcolors[LevelScreen.world]); + if (LevelScreen.world>=0) + font.setColor(AssetLoader.Levelcolors[LevelScreen.world]); batcher.begin(); batcher.setProjectionMatrix(AssetLoader.Camera.combined); batcher.setColor(0.25f,0.25f,0.25f,1f); @@ -113,7 +114,8 @@ public class LevelRenderer { if (LevelScreen.selected.level.Tech>0) shapeRenderer.rect(1210, 620,250, AssetLoader.height-630); } - shapeRenderer.rect(1470, 10, 440, AssetLoader.height-20); + if (!LevelScreen.MenuSolo.isVisible()) + shapeRenderer.rect(1470, 10, 440, AssetLoader.height-20); shapeRenderer.end(); if (LevelScreen.buttonLevels!=null) for (int i=0;i thelevels; private TextArea TextDescriptive; public int world; @@ -74,7 +77,29 @@ public class LevelScreen implements Screen { return max; } + public void play() { + //thelevels= InitWorlds.go(); + Gdx.app.debug(getClass().getSimpleName(),"Chargement des mondes depuis la base."); + try { + if (world<0) + world=0; + thelevels=AssetLoader.Datahandler.game().getworld(Preference.prefs.getString("world")); + loadWorld(world); + Previous.setVisible(true); + Next.setVisible(true); + buttonPlay.setVisible(true); + TextDescriptive.setVisible(true); + } + catch (Exception e) { + Previous.setVisible(false); + Next.setVisible(false); + buttonPlay.setVisible(false); + TextDescriptive.setVisible(false); + } + } + public void menu() { + selected=null; cout.setVisible(false); tech.setVisible(false); cycle.setVisible(false); @@ -83,10 +108,44 @@ public class LevelScreen implements Screen { nrj.setVisible(false); Previous.setVisible(false); Next.setVisible(false); - Exit.setVisible(false); + Victory.setVisible(false); + Exit.setPosition(1820,AssetLoader.height-100); buttonPlay.setVisible(false); TextDescriptive.setVisible(false); + MenuSolo.setVisible(true); + MenuMulti.setVisible(true); + MenuScenario.setVisible(true); + buttonConnect.setVisible(false); + buttonStat.setVisible(false); + Statdata.setVisible(false); + Userdata.setVisible(false); + Gamedata.setVisible(false); + Statdatalabel.setVisible(false); + Userdatalabel.setVisible(false); + Gamedatalabel.setVisible(false); + Worlddatalabel.setVisible(false); + buttonPlaythis.setVisible(false); + Worlddata.setVisible(false); + buttonSave.setVisible(false); + buttonApply.setVisible(false); + if (buttonLevels!=null) + for (int j=0;j<10;j++) + if (buttonLevels[j]!=null) { + buttonLevels[j].remove(); + buttonLevels[j]=null; + } + } + + public void level() { + Exit.setPosition(1110, AssetLoader.height-Exit.getHeight()-5); + MenuSolo.setVisible(false); + MenuMulti.setVisible(false); + MenuScenario.setVisible(false); + buttonConnect.setVisible(true); + buttonStat.setVisible(true); SetButtonStat(); + if (Preference.prefs.contains("world")) + play(); } public void SetButtonConnect() { @@ -98,6 +157,11 @@ public class LevelScreen implements Screen { Statdatalabel.setVisible(true); Userdatalabel.setVisible(true); Gamedatalabel.setVisible(true); + buttonSave.setVisible(true); + buttonApply.setVisible(true); + Worlddatalabel.setVisible(true); + Worlddata.setVisible(true); + buttonPlaythis.setVisible(true); } public void SetButtonStat() { @@ -108,7 +172,12 @@ public class LevelScreen implements Screen { Gamedata.setVisible(false); Statdatalabel.setVisible(false); Userdatalabel.setVisible(false); - Gamedatalabel.setVisible(false); + Gamedatalabel.setVisible(false); + buttonSave.setVisible(false); + buttonApply.setVisible(false); + Worlddatalabel.setVisible(false); + Worlddata.setVisible(false); + buttonPlaythis.setVisible(false); } public void loadWorld(int aworld) { @@ -117,6 +186,7 @@ public class LevelScreen implements Screen { for (int j=0;j<10;j++) { if (buttonLevels[j]!=null) { buttonLevels[j].remove(); + buttonLevels[j]=null; } } buttonLevels = null; @@ -176,11 +246,44 @@ public class LevelScreen implements Screen { } }; ScrollTimer.scheduleAtFixedRate(ScrollTask, 0, 30); + Gdx.app.debug(getClass().getSimpleName(),"Création du menu."); + MenuSolo=new ImageButton(AssetLoader.Skin_level,"MenuSolo"); + MenuSolo.setPosition((AssetLoader.width-MenuSolo.getWidth())/2, AssetLoader.height-550); + MenuSolo.addListener(new ClickListener() { + public void clicked(InputEvent event, float x, float y) { + level(); + } + }); + MenuMulti=new ImageButton(AssetLoader.Skin_level,"MenuMulti"); + MenuMulti.setPosition((AssetLoader.width-MenuMulti.getWidth())/2, AssetLoader.height-900); + MenuScenario=new ImageButton(AssetLoader.Skin_level,"MenuScenario"); + MenuScenario.setPosition((AssetLoader.width-MenuScenario.getWidth())/2, AssetLoader.height-1250); Gdx.app.debug(getClass().getSimpleName(),"Création des boutons."); logosmall=new ImageButton(AssetLoader.Skin_level,"logosmall"); logosmall.setPosition(20, AssetLoader.height-175+logosmall.getHeight()/2); TextDescriptive = new TextArea("Descriptif", AssetLoader.Skin_level,"Descriptif"); TextDescriptive.setBounds(15, 15, 1185, 100); + buttonApply = new TextButton("Appliquer", AssetLoader.Skin_ui); + buttonApply.setBounds(1680, 350, 190, 40); + buttonApply.addListener(new ClickListener() { + public void clicked(InputEvent event, float x, float y) { + menu(); + AssetLoader.Datahandler.CloseAll(); + AssetLoader.Datahandler.Attach(Userdata.getModel(),Userdata.getUrl()); + AssetLoader.Datahandler.Attach(Gamedata.getModel(),Gamedata.getUrl()); + AssetLoader.Datahandler.Attach(Statdata.getModel(),Statdata.getUrl()); + } + }); + buttonSave = new TextButton("Sauvegarder", AssetLoader.Skin_ui); + buttonSave.setBounds(1480, 350, 190, 40); + buttonSave.addListener(new ClickListener() { + public void clicked(InputEvent event, float x, float y) { + menu(); + Preference.prefs.putString("userdata", Userdata.getUrl()); + Preference.prefs.putString("gamedata", Gamedata.getUrl()); + Preference.prefs.putString("statdata", Statdata.getUrl()); + } + }); buttonConnect = new TextButton("Connexions", AssetLoader.Skin_ui); buttonConnect.setBounds(1480, AssetLoader.height-60, 190, 40); buttonConnect.addListener(new ClickListener() { @@ -205,6 +308,15 @@ public class LevelScreen implements Screen { SetButtonStat(); } }); + buttonPlaythis = new TextButton("Jouer ce monde", AssetLoader.Skin_ui); + buttonPlaythis.setBounds(1480, 50, 190, 40); + buttonPlaythis.addListener(new ClickListener() { + public void clicked(InputEvent event, float x, float y) { + Preference.prefs.putString("world", (String)Worlddata.getSelected()); + Preference.prefs.flush(); + play(); + } + }); Exit=new ImageButton(AssetLoader.Skin_level,"Exit"); Exit.setPosition(1110, AssetLoader.height-Exit.getHeight()-5); Exit.addListener(new ClickListener(){ @@ -256,24 +368,29 @@ public class LevelScreen implements Screen { String url="http://evolving.fr/servers/list.xml"; Statdata=new ServerList(url,Base.datatype.statdata,AssetLoader.Skin_ui); Statdatalabel=new Label("Stockage des statistiques:", AssetLoader.Skin_ui, "grey"); - Statdata.setBounds(1480, AssetLoader.height-300, 420, 200); + Statdata.setBounds(1480, AssetLoader.height-250, 420, 150); Statdatalabel.setPosition(1480, AssetLoader.height-100); Userdata=new ServerList(url,Base.datatype.userdata,AssetLoader.Skin_ui); Userdatalabel=new Label("Stockage des données du joueur:", AssetLoader.Skin_ui, "grey"); - Userdata.setBounds(1480, AssetLoader.height-600, 420, 200); - Userdatalabel.setPosition(1480, AssetLoader.height-400); + Userdata.setBounds(1480, AssetLoader.height-450, 420, 150); + Userdatalabel.setPosition(1480, AssetLoader.height-300); Gamedata=new ServerList(url,Base.datatype.gamedata,AssetLoader.Skin_ui); Gamedatalabel=new Label("Stockage des données du jeu:", AssetLoader.Skin_ui, "grey"); - Gamedata.setBounds(1480, AssetLoader.height-900, 420, 200); - Gamedatalabel.setPosition(1480, AssetLoader.height-700); + Gamedata.setBounds(1480, AssetLoader.height-650, 420, 150); + Gamedatalabel.setPosition(1480, AssetLoader.height-500); + Worlddata=new Worldlist(AssetLoader.Skin_ui); + Worlddatalabel=new Label("Mondes disponibles:", AssetLoader.Skin_ui, "grey"); + Worlddata.setBounds(1480, 100, 420, 200); + Worlddatalabel.setPosition(1480, 300); + Gamedata.setWorldlist(Worlddata); + Statdata.Refresh(); + Userdata.Refresh(); + Gamedata.Refresh(); Gdx.app.debug(getClass().getSimpleName(),"Affichage du menu."); - //menu(); - - //thelevels= InitWorlds.go(); - - Gdx.app.debug(getClass().getSimpleName(),"Chargement des mondes depuis la base."); - thelevels=AssetLoader.Datahandler.game().getworld("test pour voir"); - loadWorld(world); + if (aworld!=-1) + level(); + else + menu(); } @Override @@ -293,9 +410,15 @@ public class LevelScreen implements Screen { public void show() { Gdx.app.log("*****","Affichage du choix des mondes & niveaux."); table.setFillParent(true); + stage.addActor(MenuSolo); + stage.addActor(MenuMulti); + stage.addActor(MenuScenario); stage.addActor(TextDescriptive); + stage.addActor(buttonPlaythis); stage.addActor(Exit); stage.addActor(Next); + stage.addActor(buttonApply); + stage.addActor(buttonSave); stage.addActor(buttonPlay); stage.addActor(buttonConnect); stage.addActor(buttonStat); @@ -314,6 +437,8 @@ public class LevelScreen implements Screen { stage.addActor(Userdatalabel); stage.addActor(Gamedata); stage.addActor(Gamedatalabel); + stage.addActor(Worlddata); + stage.addActor(Worlddatalabel); Gdx.input.setInputProcessor(stage); Gdx.app.debug("AssetLoader","Début dans la bande son \'intro\'"); AssetLoader.intro.setLooping(true); diff --git a/core/src/fr/evolving/screens/SplashScreen.java b/core/src/fr/evolving/screens/SplashScreen.java index 4982531..374df69 100644 --- a/core/src/fr/evolving/screens/SplashScreen.java +++ b/core/src/fr/evolving/screens/SplashScreen.java @@ -46,7 +46,7 @@ public class SplashScreen implements Screen { }),Actions.run(new Runnable() { @Override public void run() { - ((Game)Gdx.app.getApplicationListener()).setScreen(new LevelScreen(0)); + ((Game)Gdx.app.getApplicationListener()).setScreen(new LevelScreen(-1)); } }))); }