From 16cfe335490f2d527dfef069f40ffe951a55b8c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Fri, 5 Feb 2016 11:08:36 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20gestion=20de=20l'argent,=20blocage=20en?= =?UTF-8?q?=20mode=20"normal"=20mode=20"debogue"=20possibilit=C3=A9=20de?= =?UTF-8?q?=20debloquer=20arbitrairement=20un=20monde?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/fr/evolving/automata/Worlds.java | 4 ++ core/src/fr/evolving/screens/GameScreen.java | 54 ++++++++++++++------ 2 files changed, 41 insertions(+), 17 deletions(-) diff --git a/core/src/fr/evolving/automata/Worlds.java b/core/src/fr/evolving/automata/Worlds.java index e9bdb1d..5c1d978 100644 --- a/core/src/fr/evolving/automata/Worlds.java +++ b/core/src/fr/evolving/automata/Worlds.java @@ -257,6 +257,10 @@ public class Worlds extends Actor { return -1; } + public void unLockLevel() { + AssetLoader.Datahandler.user().setLevelunlock(0, usedlevel.id); + } + public void set(String campaign) { Gdx.app.log("*****", "Définition de la compagne "+campaign); Preference.prefs.putString("world", campaign); diff --git a/core/src/fr/evolving/screens/GameScreen.java b/core/src/fr/evolving/screens/GameScreen.java index 699763e..6a4af57 100644 --- a/core/src/fr/evolving/screens/GameScreen.java +++ b/core/src/fr/evolving/screens/GameScreen.java @@ -205,7 +205,9 @@ public class GameScreen implements Screen { this.worlds = aworlds; this.worlds.prepareLevel(false); this.level=worlds.getInformations(); - if (level.Tech<1) + if (worlds.isDebug()) + tocreate = new String[] { "run", "stop", "speed", "separator", "move#", "zoomp#","zoomm#", "infos#", "separator", "raz", "save", "levels", "tree", "exits", "separator", "screen", "sound", "tuto", "grid", "settings", "separator", "stat","separator","unlocked" }; + else if (level.Tech<1) tocreate = new String[] { "run", "stop", "speed", "separator", "move#", "zoomp#","zoomm#", "separator", "levels", "exits", "separator", "screen", "sound", "settings" }; else if (level.aWorld<1) tocreate = new String[] { "run", "stop", "speed", "separator", "move#", "zoomp#","zoomm#", "infos#", "separator", "raz", "save", "levels", "exits", "separator", "screen", "sound", "grid", "settings" }; @@ -231,7 +233,7 @@ public class GameScreen implements Screen { processors = new Array(); stage = new Stage(AssetLoader.viewport); stage_info = new Stage(AssetLoader.viewport); - //stage_tooltip = new Stage(AssetLoader.viewport); + stage_tooltip = new Stage(AssetLoader.viewport); oldx = 0; oldy = 0; unroll = false; @@ -250,6 +252,7 @@ public class GameScreen implements Screen { nrj.setPosition(610, AssetLoader.height - 74); tech = new IconValue(Icon.tech,worlds, AssetLoader.Skin_level); tech.setPosition(1345, AssetLoader.height - 74); + tech.addListener(new Tooltip(tooltip,AssetLoader.Tooltipmanager)); cout = new IconValue(Icon.cout,worlds, AssetLoader.Skin_level); cout.setPosition(1445, AssetLoader.height - 74); research = new IconValue(Icon.research,worlds, AssetLoader.Skin_level); @@ -265,8 +268,7 @@ public class GameScreen implements Screen { public void clicked(InputEvent event, float x, float y) { Gdx.app.debug(getClass().getSimpleName(),"Remise à zéro du monde"); worlds.prepareLevel(true); - map.redraw(); - buttonlevel.setChecked(false); + prepare(); } }); Gdx.app.debug(getClass().getSimpleName(), @@ -378,6 +380,7 @@ public class GameScreen implements Screen { map.setSelected(getselected()); } }); + prepare(); } public String getselected() { @@ -391,8 +394,9 @@ public class GameScreen implements Screen { } - public void map_transmuter(float realx, float realy, int x, int y, boolean alone, - int button, calling call) { + public void map_transmuter(float realx, float realy, int x, int y, boolean alone,int button, calling call) { + if (!worlds.isDebug() && level.Cout0 || worlds.getInformations().Tech>=1 ) { stage.addActor(vertibar); @@ -684,7 +703,7 @@ public class GameScreen implements Screen { stage.addActor(cout); stage.addActor(research); gesturedetector=new GestureDetector(map); - //processors.add(stage_tooltip); + processors.add(stage_tooltip); processors.add(stage_info); processors.add(stage); processors.add(map); @@ -783,6 +802,10 @@ public class GameScreen implements Screen { AssetLoader.language = AssetLoader.french; } } else if (caller == "stat") { + } else if (caller == "unlocked") { + level.Locked=false; + buttonlevel.setDisabled(false); + worlds.unLockLevel(); } } @@ -874,13 +897,10 @@ public class GameScreen implements Screen { selSaved = new List(AssetLoader.Skin_ui); selSaved.addListener(new ClickListener() { public void clicked(InputEvent event, float x, float y) { - if (this.getTapCount() > 1) + if (this.getTapCount() > 1) { worlds.ReadGrid(selSaved.getSelectedIndex()); - level.Cout_copperfiber=level.Grid.tiling_copper(); - level.Cout_transmuter=level.Grid.tiling_transmuter(); - map.redraw(); - map.tempclear(); - hideInfo(); + prepare(); + } } }); ScrollPane scroll = new ScrollPane(selSaved);