fix: modification des appels à gdx.app.log/debogue/error afin de faire des filtres dans logcat.

This commit is contained in:
Nicolas Hordé 2016-02-10 21:40:19 +01:00
parent 16cfe33549
commit d5e88debd1
15 changed files with 211 additions and 190 deletions

View File

@ -51,7 +51,7 @@ public class HorizBarre extends Actor {
// TODO Auto-generated catch block
e.printStackTrace();
}
Gdx.app.debug(getClass().getSimpleName(), "Mise en place du timer de rotation.");
Gdx.app.debug("wirechem-HorizBarre", "Mise en place du timer de rotation.");
oneselection = AssetLoader.Atlas_level.findRegion("circle");
rotation=0;
RotateTimer = new Timer();
@ -66,8 +66,7 @@ public class HorizBarre extends Actor {
this.setBounds(0, 0, 1920, 80);
Barre = new ImageButton[tocreate.length];
int i = 0;
Gdx.app.debug(getClass().getSimpleName(), "Barre bas:" + Barre.length
+ " elements");
Gdx.app.debug("wirechem-HorizBarre", "Barre bas:" + Barre.length + " elements");
for (String item : tocreate) {
final String itemtocreate=item.replace("#", "");
Barre[i] = new ImageButton(AssetLoader.Skin_level, itemtocreate);
@ -90,8 +89,7 @@ public class HorizBarre extends Actor {
@Override
public void clicked(InputEvent event, float x, float y) {
String caller = event.getListenerActor().getName();
Gdx.app.debug("Barre", "Selection dans la Barre bas:"
+ caller);
Gdx.app.debug("wirechem-HorizBarre", "Selection dans la Barre bas:" + caller);
try {
method.invoke(((Game) Gdx.app.getApplicationListener()).getScreen(), caller, this.getTapCount());
} catch (IllegalAccessException e) {

View File

@ -29,7 +29,7 @@ public class IconValue extends ImageTextButton{
switch(this.icon) {
case tech:
this.setText(String.valueOf(worlds.getInformations().Tech));
this.setVisible(worlds.getInformations().Tech>=1);
this.setVisible(worlds.getInformations().Tech>=1 || worlds.isDebug());
break;
case cout:
worlds.getInformations().Cout=worlds.getInformations().Cout_orig-worlds.getInformations().Cout_copperfiber-worlds.getInformations().Cout_transmuter;
@ -40,35 +40,35 @@ public class IconValue extends ImageTextButton{
this.setColor(1f, 0.5f, 0.5f, 1f);
else
this.setColor(1f, 0, 0, 1f);
this.setVisible(worlds.getInformations().Cout_orig>0);
this.setVisible(worlds.getInformations().Cout_orig>0 || worlds.isDebug());
break;
case research:
this.setText(String.valueOf(worlds.ReadResearch()));
this.setVisible(worlds.ReadResearch()>0);
this.setVisible(worlds.ReadResearch()>0 || worlds.isDebug());
break;
case cycle:
this.setVisible(worlds.getWorld()>=1);
this.setVisible(worlds.getWorld()>=1 || worlds.isDebug());
if (showmaximum)
this.setText(String.valueOf(worlds.getInformations().Cycle)+"/"+String.valueOf(worlds.getInformations().Maxcycle));
else
this.setText(String.valueOf(worlds.getInformations().Cycle));
break;
case temp:
this.setVisible(worlds.getWorld()>=2);
this.setVisible(worlds.getWorld()>=2 || worlds.isDebug());
if (showmaximum)
this.setText(String.valueOf(worlds.getInformations().Temp)+"/"+String.valueOf(worlds.getInformations().Maxtemp));
else
this.setText(String.valueOf(worlds.getInformations().Temp));
break;
case rayon:
this.setVisible(worlds.getWorld()>=3);
this.setVisible(worlds.getWorld()>=3 || worlds.isDebug());
if (showmaximum)
this.setText(String.valueOf(worlds.getInformations().Rayon)+"/"+String.valueOf(worlds.getInformations().Maxrayon));
else
this.setText(String.valueOf(worlds.getInformations().Rayon));
break;
case nrj:
this.setVisible(worlds.getWorld()>=4);
this.setVisible(worlds.getWorld()>=4 || worlds.isDebug());
if (showmaximum)
this.setText(String.valueOf(worlds.getInformations().Nrj)+"/"+String.valueOf(worlds.getInformations().Maxnrj));
else

View File

@ -59,25 +59,25 @@ public class Menu extends Actor {
this.selpage=0;
this.seltype=0;
Gdx.app.debug(getClass().getSimpleName(), "Création du Tiledmap et Maprenderer");
Gdx.app.debug("wirechem-Menu", "Création du Tiledmap et Maprenderer");
map = new TiledMap[3][Transmuter.Class.values().length];
initialize();
MapRenderer = new OrthogonalTiledMapRenderer(map[selpage][seltype], 1 / (float) size);
Gdx.app.debug(getClass().getSimpleName(), "Caméra pour tilemap:"+ (tilesizex * size) + "x" + (tilesizey * size));
Gdx.app.debug("wirechem-Menu", "Caméra pour tilemap:"+ (tilesizex * size) + "x" + (tilesizey * size));
camera = new OrthographicCamera();
camera.setToOrtho(false, tilesizex * 32, tilesizex * 32 * AssetLoader.height / AssetLoader.width);
decx = -102f;
decy = -20f;
if (AssetLoader.ratio == 1.44f) decy -= 24;
Gdx.app.debug(getClass().getSimpleName(), "Décalage:" + decx + "x"+ decy);
Gdx.app.debug("wirechem-Menu", "Décalage:" + decx + "x"+ decy);
camera.translate(decx, decy);
Gdx.app.debug(getClass().getSimpleName(), "Ajout des éléments de menu");
Gdx.app.debug("wirechem-Menu", "Ajout des éléments de menu");
update();
Gdx.app.debug(getClass().getSimpleName(), "Mise en place du timer de rotation.");
Gdx.app.debug("wirechem-Menu", "Mise en place du timer de rotation.");
oneselection = AssetLoader.Atlas_level.findRegion("circle");
selected = new Actor();
rotation=0;
@ -90,7 +90,7 @@ public class Menu extends Actor {
};
RotateTimer.scheduleAtFixedRate(RotateTask, 0, 30);
Gdx.app.debug(getClass().getSimpleName(), "Ajout de l'évènements clicked");
Gdx.app.debug("wirechem-Menu", "Ajout de l'évènements clicked");
this.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
@ -111,14 +111,14 @@ public class Menu extends Actor {
if (selected_transmuter != null) {
selected.setName("transmuter");
setSurtile((int) coords.x,(int) coords.y, selected_transmuter);
Gdx.app.debug("menu", "Choix transmuter:"+ selected_transmuter.getName());
Gdx.app.debug("wirechem-Menu", "Choix transmuter:"+ selected_transmuter.getName());
}
}
else
selected.setName(tile.get("name").toString());
Vector2 coords2 = worldtoscreen((int) coords.x,
(int) coords.y);
Gdx.app.debug("menu","Coordonnées:" + x + "x" + y + " Menu:" + coords.x
Gdx.app.debug("wirechem-Menu","Coordonnées:" + x + "x" + y + " Menu:" + coords.x
+ "," + coords.y + " Ecran :" + coords2.x
+ "x" + coords2.y + " type:"
+ tile.get("type"));
@ -230,18 +230,18 @@ public class Menu extends Actor {
public void update() {
clearall();
if (worlds.getInformations().Cout>=0)
if (worlds.getInformations().Cout>=0 || worlds.isDebug())
{
this.setMenuTile(0, 7, 71, "copper_pen",0);
this.setMenuTile(1, 7, 72, "copper_brush",0);
this.setMenuTile(2, 7, 73, "copper_eraser",0);
this.setMenuTile(3, 3, 79, "cleaner",0);
}
if (worlds.getInformations().Tech>=0)
if (worlds.getInformations().Tech>=0 || worlds.isDebug())
{
this.setMenuTile(0, 5, 77, "transmuter_eraser",0);
}
if (worlds.getInformations().Tech>=2)
if (worlds.getInformations().Tech>=2 || worlds.isDebug())
{
this.setMenuTile(1, 5, 70, "blank",0);
this.setMenuTile(0, 6, 74, "fiber_pen",0);
@ -314,8 +314,7 @@ public class Menu extends Actor {
cell.setTile(AssetLoader.tileSet.getTile(tile));
cell.getTile().getProperties().put("name", title);
cell.setRotation(0);
Gdx.app.debug(getClass().getSimpleName(), "Tile find:" + tile
+ " coords" + x + "," + y);
Gdx.app.debug("wirechem-Menu", "Tile find:" + tile + " coords" + x + "," + y);
layer.getProperties().put("noempty", false);
}
}
@ -353,11 +352,9 @@ public class Menu extends Actor {
TiledMapTileLayer layer;
if (transmuter != null) {
int type=transmuter.getaClass().ordinal();
Gdx.app.debug(getClass().getSimpleName(), "Transmuter find:"
+ transmuter.getName() + " Angle:" + Angle + " coords"
+ x + "," + y+" page:"+page+" type:"+type);
Gdx.app.debug("wirechem-Menu", "Transmuter find:"+ transmuter.getName() + " Angle:" + Angle + " coords" + x + "," + y+" page:"+page+" type:"+type);
if (transmuter.getTechnology()<=worlds.getInformations().Tech || worlds.isDebug()) {
Gdx.app.debug(getClass().getSimpleName(), "Autorisé par le niveau");
Gdx.app.debug("wirechem-Menu", "Autorisé par le niveau");
if (!transmuter.isShowed() && transmuter.isUpgraded() && !worlds.isDebug())
layer = ((TiledMapTileLayer) map[page][type].getLayers().get(2));
else if (transmuter.isShowed() || worlds.isDebug())

View File

@ -9,6 +9,7 @@ import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.input.GestureDetector.GestureListener;
import com.badlogic.gdx.maps.MapLayer;
import com.badlogic.gdx.maps.MapLayers;
import com.badlogic.gdx.maps.tiled.TiledMap;
import com.badlogic.gdx.maps.tiled.TiledMapTileLayer;
@ -47,24 +48,33 @@ public class TouchMaptiles extends Actor implements GestureListener,InputProcess
this.mapexit=false;
map = new TiledMap();
map.getTileSets().addTileSet(AssetLoader.tileSet);
MapRenderer = new OrthogonalTiledMapRenderer(map, 1 / 128.0f);
this.setBounds(80, 0, AssetLoader.width, AssetLoader.height);
camera = new OrthographicCamera();
this.resize();
}
public void resize() {
MapLayers layers = map.getLayers();
int max=layers.getCount();
for(int i=0;i<max;i++)
if (layers.get(0)!=null)
layers.remove(0);
for (int i = 0; i < 5; i++) {
TiledMapTileLayer layer = new TiledMapTileLayer(level.Grid.sizeX,
level.Grid.sizeY, sizex, sizey);
TiledMapTileLayer layer = new TiledMapTileLayer(level.Grid.sizeX, level.Grid.sizeY, sizex, sizey);
for (int x = 0; x < layer.getWidth(); x++) {
for (int y = 0; y < layer.getHeight(); y++) {
Cell cell = new Cell();
if (i == 0)
cell.setTile(AssetLoader.tileSet.getTile(53));
cell.setTile(AssetLoader.tileSet.getTile(this.clearsprite));
layer.setCell(x, y, cell);
}
}
layers.add(layer);
}
layers.get(3).setOpacity(0.9f);
MapRenderer = new OrthogonalTiledMapRenderer(map, 1 / 128.0f);
camera = new OrthographicCamera();
initzoom();
this.redraw();
this.initzoom();
}
boolean event_coordination(float x, float y, int button, calling call,
@ -77,9 +87,7 @@ public class TouchMaptiles extends Actor implements GestureListener,InputProcess
if (level.Grid.GetXY(coords.x, coords.y) != null) {
mapexit = false;
if (call != calling.mouseover)
Gdx.app.debug("evenement", "mode:" + call + " outil:"
+ selected + " X: " + coords.x
+ " Y: " + coords.y + " button:" + button);
Gdx.app.debug("wirechem-Touchmaptiles", "mode:" + call + " outil:" + selected + " X: " + coords.x + " Y: " + coords.y + " button:" + button);
Method method;
try {
Class<?> base = Class.forName("fr.evolving.screens.GameScreen");
@ -116,14 +124,14 @@ public class TouchMaptiles extends Actor implements GestureListener,InputProcess
public Vector2 screentoworld(float x, float y) {
x = (int) ((x / AssetLoader.width * camera.viewportWidth) + decx);
y = (int) ((y / AssetLoader.height * camera.viewportHeight) + decy);
x = (int) ((x / this.getWidth() * camera.viewportWidth) + decx);
y = (int) ((y / this.getHeight() * camera.viewportHeight) + decy);
return new Vector2(x, y);
}
public Vector2 screentoworldsize(float x, float y) {
x = ((x / AssetLoader.width * camera.viewportWidth));
y = ((y / AssetLoader.height * camera.viewportHeight));
x = ((x / this.getWidth() * camera.viewportWidth));
y = ((y / this.getHeight() * camera.viewportHeight));
return new Vector2(x, y);
}
@ -154,12 +162,9 @@ public class TouchMaptiles extends Actor implements GestureListener,InputProcess
public void redraw() {
for (int x = 0; x < level.Grid.sizeX; x++)
for (int y = 0; y < level.Grid.sizeY; y++) {
((TiledMapTileLayer) map.getLayers().get(2)).getCell((int) x,
(int) y).setTile(null);
((TiledMapTileLayer) map.getLayers().get(1)).getCell((int) x,
(int) y).setTile(null);
((TiledMapTileLayer) map.getLayers().get(0)).getCell((int) x,
(int) y).setTile(AssetLoader.tileSet.getTile(this.clearsprite));
((TiledMapTileLayer) map.getLayers().get(2)).getCell((int) x,(int) y).setTile(null);
((TiledMapTileLayer) map.getLayers().get(1)).getCell((int) x,(int) y).setTile(null);
((TiledMapTileLayer) map.getLayers().get(0)).getCell((int) x,(int) y).setTile(AssetLoader.tileSet.getTile(this.clearsprite));
}
for (int x = 0; x < level.Grid.sizeX; x++)
for (int y = 0; y < level.Grid.sizeY; y++) {
@ -204,21 +209,20 @@ public class TouchMaptiles extends Actor implements GestureListener,InputProcess
}
public void initzoom() {
if ((level.Grid.sizeX / (float) level.Grid.sizeY) > (AssetLoader.width / AssetLoader.height)) {
if ((level.Grid.sizeX / (float) level.Grid.sizeY) > (this.getWidth() / this.getHeight())) {
viewwidth = level.Grid.sizeX;
viewheight = level.Grid.sizeX
/ ((float) AssetLoader.width / AssetLoader.height);
/ ((float) this.getWidth() / this.getHeight());
} else {
viewheight = level.Grid.sizeY;
viewwidth = level.Grid.sizeY
* ((float) AssetLoader.width / AssetLoader.height);
* ((float) this.getWidth() / this.getHeight());
}
Gdx.app.debug(getClass().getSimpleName(), "Caméra pour tilemap:"
+ viewwidth + "x" + viewheight);
Gdx.app.debug("wirechem-Touchmaptiles", "Caméra pour tilemap:" + viewwidth + "x" + viewheight);
camera.setToOrtho(false, viewwidth, viewheight);
decx = (level.Grid.sizeX - viewwidth) / 2.0f;
decy = (level.Grid.sizeY - viewheight) / 2.0f;
Gdx.app.debug(getClass().getSimpleName(), "Décalage:" + decx + "x" + decy);
Gdx.app.debug("wirechem-Touchmaptiles", "Décalage:" + decx + "x" + decy);
camera.translate(decx, decy);
}
@ -237,9 +241,7 @@ public class TouchMaptiles extends Actor implements GestureListener,InputProcess
viewheight *= factor;
camera.setToOrtho(false, viewwidth, viewheight);
camera.translate(decx, decy);
Gdx.app.debug(getClass().getSimpleName(), "Caméra pour tilemap:"
+ camera.viewportWidth + "x" + camera.viewportHeight + " zoom:"
+ factor);
Gdx.app.debug("wirechem-Touchmaptiles", "Caméra pour tilemap:" + camera.viewportWidth + "x" + camera.viewportHeight + " zoom:" + factor);
}
public float getDecx() {
@ -256,8 +258,7 @@ public class TouchMaptiles extends Actor implements GestureListener,InputProcess
decy = decy - dec.y;
camera.setToOrtho(false, viewwidth, viewheight);
camera.translate(decx, decy);
Gdx.app.debug(getClass().getSimpleName(), "Decalage:" + dec.x + "x"
+ dec.y + " newxy:" + decx + "x" + decy);
Gdx.app.debug("wirechem-Touchmaptiles", "Decalage:" + dec.x + "x" + dec.y + " newxy:" + decx + "x" + decy);
return;
}

View File

@ -32,7 +32,7 @@ public class VertiBarre extends Actor {
table.space(10f);
buttonGroup=new ButtonGroup<ImageTextButton>();
Barre = new ImageTextButton[Transmuter.Class.values().length];
Gdx.app.debug(getClass().getSimpleName(), "Menu:" + Barre.length+ " elements");
Gdx.app.debug("wirechem-VertiBarre", "Menu:" + Barre.length+ " elements");
for (int i = 0; i < Barre.length; i++)
{
if ((Transmuter.Class.values()[i]!=Transmuter.Class.Scenario && (worlds.getInformations().Tech>=0 || Transmuter.Class.values()[i]==Transmuter.Class.Structure)) || worlds.isDebug())
@ -45,7 +45,7 @@ public class VertiBarre extends Actor {
@Override
public void clicked(InputEvent event, float x, float y) {
int caller = Integer.parseInt(event.getListenerActor().getName());
Gdx.app.debug("Barre2", "Selection dans la Barre droite:"+ caller);
Gdx.app.debug("wirechem-VertiBarre", "Selection dans la Barre droite:"+ caller);
Method method;
try {
Class<?> base = Class.forName("fr.evolving.screens.GameScreen");

View File

@ -85,10 +85,9 @@ public class AssetLoader {
params.minFilter = quality;
params.magFilter = quality;
params.genMipMaps = (quality == TextureFilter.MipMap);
Gdx.app.debug("AssetLoader", "Initialisation du asset manager");
Gdx.app.debug("wirechem-AssetLoader", "Initialisation du asset manager");
manager = new AssetManager();
Gdx.app.debug("AssetLoader",
"Initialisation du chargement des éléments multimédia");
Gdx.app.debug("wirechem-AssetLoader", "Initialisation du chargement des éléments multimédia");
manager.load("textures/level.pack", TextureAtlas.class);
manager.load("textures/ui.pack", TextureAtlas.class);
manager.load("pictures/fond.png", Texture.class, params);
@ -101,9 +100,9 @@ public class AssetLoader {
}
public static void finishall() {
Gdx.app.debug("AssetLoader", "Attente fin chargement...");
Gdx.app.debug("wirechem-AssetLoader", "Attente fin chargement...");
manager.finishLoading();
Gdx.app.debug("AssetLoader", "Affectation des éléments multimédia");
Gdx.app.debug("wirechem-AssetLoader", "Affectation des éléments multimédia");
Atlas_level = manager.get("textures/level.pack");
intro = manager.get("musics/intro.mp3");
Texture_fond = manager.get("pictures/fond.png");
@ -114,7 +113,7 @@ public class AssetLoader {
Texture_fond2.setFilter(quality, quality);
Skin_level = manager.get("textures/level.json");
Skin_ui = manager.get("textures/ui.json");
Gdx.app.debug("AssetLoader", "Definition des constantes");
Gdx.app.debug("wirechem-AssetLoader", "Definition des constantes");
Levelcolors = new Color[5];
Levelcolors = new Color[] { AssetLoader.Skin_level.getColor("world0"),
AssetLoader.Skin_level.getColor("world1"),
@ -133,10 +132,10 @@ public class AssetLoader {
Typenames = new String[13];
Typenames = new String[] { "E-", "e-", "Ph", "e0", "E0", "e+", "E+",
"K", "L", "M", "N", "n", "p" };
Gdx.app.debug("AssetLoader", "Création des tiles...");
Gdx.app.debug("wirechem-AssetLoader", "Création des tiles...");
tileSet = new TiledMapTileSet();
Array<TextureAtlas.AtlasRegion> allregions = Atlas_level.getRegions();
Gdx.app.debug("AssetLoader", allregions.size + " régions disponibles");
Gdx.app.debug("wirechem-AssetLoader", allregions.size + " régions disponibles");
for (int i = 0; i < allregions.size; i++) {
allregions.get(i).getTexture().setFilter(quality, quality);
if (allregions.get(i).name.startsWith("sprite")) {
@ -146,7 +145,7 @@ public class AssetLoader {
if (name[0].contains("sprite")) {
int id = Integer.parseInt(name[1].split("#")[0]);
if (tileSet.getTile(1000 + id) == null) {
Gdx.app.debug("AssetLoader", "Animated Tiles N°:"
Gdx.app.debug("wirechem-AssetLoader", "Animated Tiles N°:"
+ String.valueOf(id + 1000));
int maxid = 0;
for (int j = 1; Atlas_level.findRegion("sprite-"
@ -163,8 +162,7 @@ public class AssetLoader {
+ id + "#" + j))));
AnimatedTiledMapTile atile = new AnimatedTiledMapTile(
0.15f, frameTiles);
Gdx.app.debug("AssetLoader",
"Taille:" + String.valueOf(frameTiles.size));
Gdx.app.debug("wirechem-AssetLoader","Taille:" + String.valueOf(frameTiles.size));
atile.setId(1000 + id);
atile.getProperties().put("type", type[1]);
tileSet.putTile(1000 + id, atile);
@ -178,15 +176,12 @@ public class AssetLoader {
atile.setId(allregions.get(i).index);
atile.getProperties().put("type", type[1]);
tileSet.putTile(allregions.get(i).index, atile);
Gdx.app.debug(
"AssetLoader",
"Type:" + type[1] + " Tiles N°:"
+ String.valueOf(allregions.get(i).index));
Gdx.app.debug("wirechem-AssetLoader","Type:" + type[1] + " Tiles N°:" + String.valueOf(allregions.get(i).index));
}
}
}
Gdx.app.debug("AssetLoader", "Ajout des transmuters");
Gdx.app.debug("wirechem-AssetLoader", "Ajout des transmuters");
allTransmuter = new Array<Transmuter>();
allTransmuter.add(new Positiver(null));
allTransmuter.add(new Positiver_I(null));
@ -209,18 +204,14 @@ public class AssetLoader {
Values<Integer> allTiles = transmuter.getTilesid().iterator();
while (allTiles.hasNext()) {
Integer atile = allTiles.next();
Gdx.app.debug("AssetLoader",
"Ajustement données Tiles N°:" + String.valueOf(atile)
+ " Nom:" + transmuter.getName());
AssetLoader.tileSet.getTile(atile).getProperties()
.put("transmuter", transmuter);
AssetLoader.tileSet.getTile(atile).getProperties()
.put("name", transmuter.getName());
Gdx.app.debug("wirechem-AssetLoader","Ajustement données Tiles N°:" + String.valueOf(atile) + " Nom:" + transmuter.getName());
AssetLoader.tileSet.getTile(atile).getProperties().put("transmuter", transmuter);
AssetLoader.tileSet.getTile(atile).getProperties().put("name", transmuter.getName());
}
}
Gdx.app.debug("AssetLoader", "Ajout de la gestion des tooltips");
Gdx.app.debug("wirechem-AssetLoader", "Ajout de la gestion des tooltips");
Tooltipmanager = new TooltipManager();
Gdx.app.debug("AssetLoader", "Mise en place de la base de donnée");
Gdx.app.debug("wirechem-AssetLoader", "Mise en place de la base de donnée");
Datahandler = new DatabaseManager();
Datahandler.RegisterBackend(LocalBase.class);
Datahandler.RegisterBackend(SqlBase.class);
@ -231,19 +222,19 @@ public class AssetLoader {
Datahandler.CloseAll();
if (Datahandler.Attach(datatype.userdata,
Preference.prefs.getString("userdata")))
Gdx.app.debug("AssetLoader", "Base user ok");
Gdx.app.debug("wirechem-AssetLoader", "Base user ok");
else
Gdx.app.debug("AssetLoader", "Base user erreur");
Gdx.app.debug("wirechem-AssetLoader", "Base user erreur");
if (Datahandler.Attach(datatype.statdata,
Preference.prefs.getString("statdata")))
Gdx.app.debug("AssetLoader", "Base stat ok");
Gdx.app.debug("wirechem-AssetLoader", "Base stat ok");
else
Gdx.app.debug("AssetLoader", "Base stat erreur");
Gdx.app.debug("wirechem-AssetLoader", "Base stat erreur");
if (Datahandler.Attach(datatype.gamedata,
Preference.prefs.getString("gamedata")))
Gdx.app.debug("AssetLoader", "Base jeu ok");
Gdx.app.debug("wirechem-AssetLoader", "Base jeu ok");
else
Gdx.app.debug("AssetLoader", "Base jeu erreur");
Gdx.app.debug("wirechem-AssetLoader", "Base jeu erreur");
}
public static Transmuter getTransmuter(String Name) {
@ -255,12 +246,12 @@ public class AssetLoader {
}
public static void init() {
Gdx.app.debug("AssetLoader",
Gdx.app.debug("wirechem-AssetLoader",
"Initialisation de la résolution virtuelle...");
int realWidth = Gdx.graphics.getWidth();
int realHeight = Gdx.graphics.getHeight();
float realRatio = realWidth / (float) realHeight;
Gdx.app.debug("AssetLoader", "Résolution de " + realWidth + "x"
Gdx.app.debug("wirechem-AssetLoader", "Résolution de " + realWidth + "x"
+ realHeight + " ratio de " + String.format("%.2f", realRatio)
+ ".");
ratio = 1;
@ -268,29 +259,29 @@ public class AssetLoader {
height = 1080;
if (Math.abs(16f / 9f - realRatio) > Math.abs(4f / 3f - realRatio)) {
ratio = 1.44f;
Gdx.app.debug("AssetLoader",
Gdx.app.debug("wirechem-AssetLoader",
"Ratio 4/3, résolution virtuelle : 1920x1440.");
height = 1440;
} else
Gdx.app.debug("AssetLoader",
Gdx.app.debug("wirechem-AssetLoader",
"Ratio 16/9, résolution virtuelle : 1920x1080.");
Camera = new OrthographicCamera(width, height);
Camera.position.set(width / 2, height / 2, 0);
Camera.update();
if (Preference.prefs.getInteger("Adaptation") == 1) {
viewport = new StretchViewport(width, height);
Gdx.app.debug("AssetLoader",
Gdx.app.debug("wirechem-AssetLoader",
"Adaptation d'écran maximale, 'Aspect-Ratio' non conservé.");
} else {
viewport = new FitViewport(width, height);
Gdx.app.debug("AssetLoader",
Gdx.app.debug("wirechem-AssetLoader",
"Adaptation d'écran totale, 'Aspect-Ratio' conservé.");
}
viewport.apply();
}
public static void load() {
Gdx.app.debug("AssetLoader", "Ajout de la gestion des locales");
Gdx.app.debug("wirechem-AssetLoader", "Ajout de la gestion des locales");
FileHandle baseFileHandle = Gdx.files.internal("i18n/messages/messages");
usa = I18NBundle.createBundle(baseFileHandle, new Locale("en"));
french = I18NBundle.createBundle(baseFileHandle, new Locale("fr"));
@ -300,9 +291,9 @@ public class AssetLoader {
language = usa;
I18NBundle.setExceptionOnMissingKey(true);
Gdx.app.debug("AssetLoader", "Réglage de la qualité des textures");
Gdx.app.debug("wirechem-AssetLoader", "Réglage de la qualité des textures");
quality = GameScreen.quality.values()[Preference.prefs.getInteger("Quality")].getQuality();
Gdx.app.debug("AssetLoader", "Chargements des éléments minimalistes");
Gdx.app.debug("wirechem-AssetLoader", "Chargements des éléments minimalistes");
Texture_logo = new Texture(Gdx.files.internal("pictures/logo.png"),
quality == TextureFilter.MipMap);
Texture_logo.setFilter(quality, quality);

View File

@ -34,9 +34,7 @@ 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);
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");

View File

@ -50,8 +50,7 @@ public class Grid implements Serializable,Cloneable {
for (int x = 0; x < this.sizeX; x++)
for (int y = 0; y < this.sizeY; y++) {
if (GetXY(x, y).Transmuter_calc > 0)
Gdx.app.debug("info", x + "," + y + ">"
+ GetXY(x, y).Transmuter_calc);
Gdx.app.debug("wirechem-Grid", x + "," + y + ">"+ GetXY(x, y).Transmuter_calc);
}
return result;
}
@ -277,5 +276,16 @@ public class Grid implements Serializable,Cloneable {
result.Cells[x][y] = (Cell)this.Cells[x][y].clone();
return result;
}
public Object clone(int newsizex,int newsizey) {
if (newsizex<3) newsizex=3;
if (newsizey<3) newsizey=3;
Grid result = new Grid(newsizex,newsizey);
for (int x = 0; x < newsizex; x++)
for (int y = 0; y < newsizey; y++)
if (x<this.sizeX && y<this.sizeY)
result.Cells[x][y] = (Cell)this.Cells[x][y].clone();
return result;
}
}

View File

@ -34,7 +34,7 @@ public class Worlds extends Actor {
research=-2;
usedlevel=null;
if (!AssetLoader.Datahandler.verifyall()) {
Gdx.app.debug(getClass().getSimpleName(),"Pilotes de bases de donnée défaillant.");
Gdx.app.debug("wirechem-Worlds","Pilotes de bases de donnée défaillant.");
state=State.databasefailed;
}
else
@ -155,27 +155,31 @@ public class Worlds extends Actor {
}
public void prepareLevel(boolean force) {
Gdx.app.debug(getClass().getSimpleName(),"Récupération des conditions initiales.");
Gdx.app.debug("wirechem-Worlds","Récupération des conditions initiales.");
usedlevel.Cout=usedlevel.Cout_orig;
usedlevel.Cycle=usedlevel.Cycle_orig;
usedlevel.Temp=usedlevel.Temp_orig;
usedlevel.Rayon=usedlevel.Rayon_orig;
usedlevel.Nrj=usedlevel.Nrj_orig;
usedlevel.Victory=usedlevel.Victory_orig.clone();
Gdx.app.debug(getClass().getSimpleName(),"Récupération des derniers niveaux.");
Gdx.app.debug("wirechem-Worlds","Récupération des derniers niveaux.");
ReadLastGrid();
if (usedlevel.Grid == null || force) {
Gdx.app.debug(getClass().getSimpleName(), "Copie monde original.");
Gdx.app.debug("wirechem-Worlds", "Copie monde original.");
usedlevel.Grid = (Grid)usedlevel.Grid_orig.clone();
} else {
Gdx.app.debug(getClass().getSimpleName(),"Récupération de la dernière grille.");
Gdx.app.debug("wirechem-Worlds","Récupération de la dernière grille.");
ReadLastGrid();
}
usedlevel.Grid.tiling_copper();
usedlevel.Grid.tiling_transmuter();
}
public void origLevel() {
usedlevel.Grid_orig = (Grid)usedlevel.Grid.clone();
}
public void setLevel(int alevel) {
if (state!=State.notloaded)
if (usedworld>=0) {
@ -262,14 +266,14 @@ public class Worlds extends Actor {
}
public void set(String campaign) {
Gdx.app.log("*****", "Définition de la compagne "+campaign);
Gdx.app.log("wirechem-Worlds", "***** Définition de la compagne "+campaign);
Preference.prefs.putString("world", campaign);
Preference.prefs.flush();
load(campaign);
}
public void load(String campaign) {
Gdx.app.log("*****", "Chargement de la compagne "+campaign);
Gdx.app.log("wirechem-Worlds", "***** Chargement de la compagne "+campaign);
levels=AssetLoader.Datahandler.game().getCampaign(campaign);
updateUnlockLevels();
name=campaign;
@ -280,7 +284,7 @@ public class Worlds extends Actor {
}
public void create(String campaign) {
Gdx.app.log("*****", "initialisation de la compagne "+campaign);
Gdx.app.log("wirechem-Worlds", "***** initialisation de la compagne "+campaign);
try {
levels=InitWorlds.go();
Preference.prefs.putString("world",campaign);
@ -299,7 +303,7 @@ public class Worlds extends Actor {
}
public void save(String campaign) {
Gdx.app.log("*****", "enregistrement de la compagne "+campaign);
Gdx.app.log("wirechem-Worlds", "***** enregistrement de la compagne "+campaign);
AssetLoader.Datahandler.game().setCampaign(levels,campaign);
}

View File

@ -44,29 +44,29 @@ public class LocalBase extends Base {
try {
FileHandle newbase = Gdx.files.absolute("/data/data/fr.evolving.game.android/databases/"+ databasename);
if (!newbase.exists()) {
Gdx.app.log("Base", "Copie de la base de donnee android");
Gdx.app.log("wirechem-LocalBase", "***** Copie de la base de donnee android");
Gdx.files.internal("bases/" + databasename).copyTo(newbase);
}
} catch (Exception e1) {
Gdx.app.error("Base", "Erreur de copie");
Gdx.app.error("wirechem-LocalBase", "Erreur de copie");
}
break;
case Desktop:
Gdx.app.log("Base", "Copie de la base de donnee desktop");
Gdx.app.log("wirechem-LocalBase", "***** Copie de la base de donnee desktop");
FileHandle newbase = Gdx.files.local(databasename);
try {
if (!newbase.exists())
Gdx.files.internal("bases/" + databasename).copyTo(newbase);
} catch (Exception e1) {
Gdx.app.error("Base", "Erreur de copie");
Gdx.app.error("wirechem-LocalBase", "Erreur de copie");
}
break;
}
if (dbHandler != null)
Gdx.app.log("Local", "Reprise de la base '" + databasename
Gdx.app.log("wirechem-LocalBase", "Reprise de la base '" + databasename
+ "', table:" + model.toString());
else {
Gdx.app.log("Local", "Utilisation de la base '" + databasename
Gdx.app.log("wirechem-LocalBase", "Utilisation de la base '" + databasename
+ "', table:" + model.toString());
dbHandler = DatabaseFactory.getNewDatabase(databasename, 1, null,
null);
@ -76,7 +76,7 @@ public class LocalBase extends Base {
dbHandler.openOrCreateDatabase();
} catch (SQLiteGdxException e) {
e.printStackTrace();
Gdx.app.log("Local", "Erreur à l'ouverture de la base");
Gdx.app.log("wirechem-LocalBase", "Erreur à l'ouverture de la base");
}
}
try {

View File

@ -12,8 +12,7 @@ public class main extends Game {
@Override
public void create() {
Preference.init();
Gdx.app.debug(getClass().getSimpleName(),
"Récupération de la résolution des préférences.");
Gdx.app.debug("wirechem-main","Récupération de la résolution des préférences.");
if (Preference.prefs.getInteger("ResolutionX") > 0
&& Preference.prefs.getInteger("ResolutionY") > 0) {
try {
@ -25,18 +24,15 @@ public class main extends Game {
Fullscreen);
Gdx.graphics.setVSync(VSync);
} catch (ClassCastException e) {
Gdx.app.error("****",
"Impossible d'appliquer les préférences graphiques");
Gdx.app.debug(getClass().getSimpleName(), e.getMessage());
Gdx.app.error("wirechem-main","***** Impossible d'appliquer les préférences graphiques");
Gdx.app.debug("wirechem-main", e.getMessage());
} finally {
Gdx.app.log("****",
"Changement de résolution selon préférences graphiques");
Gdx.app.log("wirechem-main","***** Changement de résolution selon préférences graphiques");
}
} else
Gdx.app.debug(getClass().getSimpleName(), "...Aucune préférence !");
Gdx.app.debug("wirechem-main", "...Aucune préférence !");
AssetLoader.init();
Gdx.app.debug(getClass().getSimpleName(),
"Creation de l'objet SplashScreen.");
Gdx.app.debug("wirechem-main", "Creation de l'objet SplashScreen.");
setScreen(new SplashScreen(this));
}

View File

@ -33,7 +33,7 @@ public class GameRenderer {
} else if (layer == 1) {
batcher.begin();
batcher.setColor(0.25f, 0.25f, 0.25f, 1f);
if (GameScreen.worlds.getInformations().Cout>0 || GameScreen.worlds.getInformations().Tech>=1 ) {
if (GameScreen.worlds.getInformations().Cout>0 || GameScreen.worlds.getInformations().Tech>=1 || GameScreen.worlds.isDebug()) {
batcher.draw(AssetLoader.Atlas_level.findRegion("barrehaut"), 0.0f, AssetLoader.height - 198.0f, 1920.0f, 200.0f);
batcher.draw(AssetLoader.Atlas_level.findRegion("barrecentre"), 1480f, AssetLoader.height - 785.0f, 590f, 530.0f);
}

View File

@ -65,6 +65,7 @@ import fr.evolving.UI.WarnDialog;
import fr.evolving.UI.IconValue.Icon;
import fr.evolving.assets.AssetLoader;
import fr.evolving.assets.Preference;
import fr.evolving.automata.Grid;
import fr.evolving.automata.Level;
import fr.evolving.automata.Neutraliser_II;
import fr.evolving.automata.Transmuter;
@ -201,24 +202,24 @@ public class GameScreen implements Screen {
// This is the constructor, not the class declaration
public GameScreen(Worlds aworlds) {
Gdx.app.debug(getClass().getSimpleName(),"Préparation du screen");
Gdx.app.debug("wirechem-GameScreen","Préparation du screen");
this.worlds = aworlds;
this.worlds.prepareLevel(false);
this.level=worlds.getInformations();
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" };
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","delrow","delcol","addrow","addcol","database" };
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" };
else
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" };
Gdx.app.debug(getClass().getSimpleName(),"Création des Barres verticales & horizontales.");
Gdx.app.debug("wirechem-GameScreen","Création des Barres verticales & horizontales.");
horizbar=new HorizBarre(tocreate,"preparebarre");
horizbar.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
Gdx.app.debug("Barre", "Element changé");
Gdx.app.debug("wirechem-GameScreen", "Barre | Element changé");
hideInfo();
map.tempclear();
menu.unSelect();
@ -226,7 +227,7 @@ public class GameScreen implements Screen {
}
});
vertibar=new VertiBarre(worlds);
Gdx.app.debug(getClass().getSimpleName(),"Création des elements primordiaux du screen (stage, renderer, table, level, world)");
Gdx.app.debug("wirechem-GameScreen","Création des elements primordiaux du screen (stage, renderer, table, level, world)");
fpsLabel = new Label("0 FPS", AssetLoader.Skin_level, "FPS");
fpsLabel.setPosition(AssetLoader.width - 75, AssetLoader.height - 220);
multiplexer = new InputMultiplexer();
@ -238,10 +239,10 @@ public class GameScreen implements Screen {
oldy = 0;
unroll = false;
Renderer = new GameRenderer(this);
Gdx.app.debug(getClass().getSimpleName(), "Création des barres");
Gdx.app.debug("wirechem-GameScreen", "Création des barres");
tooltip = new TextArea("tooltip:x\r\n tooltip:y",AssetLoader.Skin_level, "info_tooltip");
tooltip.setBounds(541, 27, 100, 50);
Gdx.app.debug(getClass().getSimpleName(),"Création de la barre de gestion du haut");
Gdx.app.debug("wirechem-GameScreen","Création de la barre de gestion du haut");
cycle = new IconValue(Icon.cycle,worlds, AssetLoader.Skin_level);
cycle.setPosition(10, AssetLoader.height - 74);
temp = new IconValue(Icon.temp,worlds, AssetLoader.Skin_level);
@ -266,13 +267,12 @@ public class GameScreen implements Screen {
buttonlevel.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
Gdx.app.debug(getClass().getSimpleName(),"Remise à zéro du monde");
Gdx.app.debug("wirechem-GameScreen","Remise à zéro du monde");
worlds.prepareLevel(true);
prepare();
}
});
Gdx.app.debug(getClass().getSimpleName(),
"Création de la barre d'information");
Gdx.app.debug("wirechem-GameScreen","Création de la barre d'information");
info_tech = new ImageTextButton("0", AssetLoader.Skin_level,"info_tech");
info_tech.setSize(48, 48);
info_tech.setPosition(1200, AssetLoader.height - 775);
@ -324,16 +324,15 @@ public class GameScreen implements Screen {
}
});
dialog = new WarnDialog(AssetLoader.Skin_ui);
Gdx.app.debug(getClass().getSimpleName(), "Création d'une tilemap");
Gdx.app.debug("wirechem-GameScreen", "Création d'une tilemap");
map = new TouchMaptiles(level, 128, 128);
if (Preference.prefs.getBoolean("Grid"))
map.setClearsprite(60);
else
map.setClearsprite(53);
map.setBounds(0, 0, AssetLoader.width, AssetLoader.height);
map.redraw();
Gdx.app.debug(getClass().getSimpleName(), "Création du menu");
Gdx.app.debug("wirechem-GameScreen", "Création du menu");
nextpage=new ImageButton(AssetLoader.Skin_level,"extend");
nextpage.setPosition(1850, AssetLoader.height - 370);
nextpage.addListener(new ClickListener() {
@ -341,7 +340,7 @@ public class GameScreen implements Screen {
public void clicked(InputEvent event, float x, float y) {
if (!nextpage.isDisabled()) {
menu.NextPage();
Gdx.app.debug("menu", "Page suivante:"+menu.getPage());
Gdx.app.debug("wirechem-GameScreen", "Menu | Page suivante:"+menu.getPage());
map.tempclear();
hideInfo();
nextpage.setDisabled(menu.isNextEmpty());
@ -356,7 +355,7 @@ public class GameScreen implements Screen {
public void clicked(InputEvent event, float x, float y) {
if (!previouspage.isDisabled()) {
menu.PreviousPage();
Gdx.app.debug("menu", "Page précédente:"+menu.getPage());
Gdx.app.debug("wirechem-GameScreen", "Menu | Page précédente:"+menu.getPage());
map.tempclear();
hideInfo();
nextpage.setDisabled(menu.isNextEmpty());
@ -369,7 +368,7 @@ public class GameScreen implements Screen {
menu.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
Gdx.app.debug("Menu", "Element changé");
Gdx.app.debug("wirechem-GameScreen", "Menu | Element changé");
hideInfo();
map.tempclear();
if (menu.getTransmuter() != null)
@ -460,18 +459,18 @@ public class GameScreen implements Screen {
public void map_infos(float realx, float realy, int x, int y, boolean alone,
int button, calling call) {
if (level.Grid.GetXY(x, y) != null) {
Gdx.app.debug("map", "Etat extension:" + unroll);
Gdx.app.debug("wirechem-GameScreen", "Etat extension:" + unroll);
if (level.Grid.GetXY(x, y).Copper)
Gdx.app.debug("map", "*** Présence de cuivre");
Gdx.app.debug("wirechem-GameScreen", "*** Présence de cuivre");
if (level.Grid.GetXY(x, y).Fiber > 0)
Gdx.app.debug("map", "*** Présence de fibre");
Gdx.app.debug("wirechem-GameScreen", "*** Présence de fibre");
if (level.Grid.GetXY(x, y).Transmuter_calc > 0) {
Gdx.app.debug("map", "transmuter deplacement vers origine:"
Gdx.app.debug("wirechem-GameScreen", "transmuter deplacement vers origine:"
+ level.Grid.GetXY(x, y).Transmuter_movex + ","
+ level.Grid.GetXY(x, y).Transmuter_movey + " coords:"
+ (x + level.Grid.GetXY(x, y).Transmuter_movex) + "x"
+ (y + level.Grid.GetXY(x, y).Transmuter_movey));
Gdx.app.debug("map",level.Grid.getTransmuter(
Gdx.app.debug("wirechem-GameScreen",level.Grid.getTransmuter(
x + level.Grid.GetXY(x, y).Transmuter_movex,
y + level.Grid.GetXY(x, y).Transmuter_movey)
.getInformations());
@ -503,7 +502,7 @@ public class GameScreen implements Screen {
int button, calling call) {
if (oldx != 0 && oldy != 0) {
map.setDec(realx - oldx, realy - oldy);
Gdx.app.debug("map", "Decalage absolue en pixel:" + (realx - oldx)+ "x" + (realy - oldy));
Gdx.app.debug("wirechem-GameScreen", "Decalage absolue en pixel:" + (realx - oldx)+ "x" + (realy - oldy));
}
oldx = realx;
oldy = realy;
@ -542,7 +541,7 @@ public class GameScreen implements Screen {
if (level.Grid.GetXY(x, y).Transmuter_calc != 0) {
level.Grid.GetXY(x + level.Grid.GetXY(x, y).Transmuter_movex, y
+ level.Grid.GetXY(x, y).Transmuter_movey).Transmuter = null;
Gdx.app.debug("map", "transmuter deplacement vers origine:"
Gdx.app.debug("wirechem-GameScreen", "transmuter deplacement vers origine:"
+ level.Grid.GetXY(x, y).Transmuter_movex + ","
+ level.Grid.GetXY(x, y).Transmuter_movey + " coords:"
+ (x + level.Grid.GetXY(x, y).Transmuter_movex) + "x"
@ -661,13 +660,12 @@ public class GameScreen implements Screen {
@Override
public void show() {
Gdx.app.debug(getClass().getSimpleName(),
"Création de la fenêtre d'option");
Gdx.app.debug("wirechem-GameScreen","Création de la fenêtre d'option");
Table Optiontable = Createoption();
stage.addActor(winOptions);
Table Savetable = Createsaving();
stage.addActor(winSave);
Gdx.app.log("*****", "Affichage du niveau.");
Gdx.app.log("wirechem-GameScreen", "***** Affichage du niveau.");
stage_info.addActor(info_tech);
stage_info.addActor(info_research);
stage_info.addActor(info_activation);
@ -685,13 +683,13 @@ public class GameScreen implements Screen {
stage_info.addActor(info_desc);
stage_tooltip.addActor(tooltip);
stage.addActor(horizbar);
if (worlds.getInformations().Cout>0 || worlds.getInformations().Tech>=1 ) {
if (worlds.getInformations().Cout>0 || worlds.getInformations().Tech>=1 || worlds.isDebug()) {
stage.addActor(vertibar);
stage.addActor(buttonlevel);
stage.addActor(menu);
stage.addActor(nextpage);
stage.addActor(previouspage);
}
stage.addActor(nextpage);
stage.addActor(previouspage);
stage.addActor(objectives);
stage.addActor(rayon);
stage.addActor(nrj);
@ -738,11 +736,11 @@ public class GameScreen implements Screen {
if (winSave.isVisible())
readsaved();
} else if (caller == "save") {
Gdx.app.debug("Barre", "Sauvegarde de la grille.");
Gdx.app.debug("wirechem-GameScreen", "Barre | Sauvegarde de la grille.");
worlds.SaveGrid();
readsaved();
} else if (caller == "levels") {
Gdx.app.debug("Barre", "Affichage des niveaux.");
Gdx.app.debug("wirechem-GameScreen", "Barre | Affichage des niveaux.");
exit();
((Game) Gdx.app.getApplicationListener()).setScreen(new LevelScreen(worlds));
} else if (caller == "tree") {
@ -752,28 +750,28 @@ public class GameScreen implements Screen {
} else if (caller == "screen") {
DisplayMode currentMode = Gdx.graphics.getDesktopDisplayMode();
if (Gdx.graphics.isFullscreen()) {
Gdx.app.debug("Barre", "vers fenetre.");
Gdx.app.debug("wirechem-GameScreen", "Barre | vers fenetre.");
Gdx.graphics.setDisplayMode(currentMode.width,
currentMode.height, false);
} else {
Gdx.app.debug("Barre", "vers plein ecran.");
Gdx.app.debug("wirechem-GameScreen", "Barre | vers plein ecran.");
Gdx.graphics.setDisplayMode(currentMode.width,
currentMode.height, true);
}
} else if (caller == "sound") {
if (AssetLoader.intro.getVolume() > 0) {
Gdx.app.debug("Barre", "arret son.");
Gdx.app.debug("wirechem-GameScreen", "Barre | arret son.");
AssetLoader.intro.setVolume(0f);
} else {
Gdx.app.debug("Barre", "marche son.");
Gdx.app.debug("wirechem-GameScreen", "Barre | marche son.");
AssetLoader.intro.setVolume(1f);
}
} else if (caller == "tuto") {
if (AssetLoader.Tooltipmanager.enabled) {
Gdx.app.debug("Barre", "arret tuto.");
Gdx.app.debug("wirechem-GameScreen", "Barre | arret tuto.");
AssetLoader.Tooltipmanager.enabled = false;
} else {
Gdx.app.debug("Barre", "marche tuto.");
Gdx.app.debug("wirechem-GameScreen", "Barre | marche tuto.");
AssetLoader.Tooltipmanager.enabled = true;
}
} else if (caller=="grid") {
@ -795,10 +793,10 @@ public class GameScreen implements Screen {
} else if (caller == "flag") {
if (AssetLoader.language.getLocale().getDisplayName()
.contains("français")) {
Gdx.app.debug("Barre", "Langue USA");
Gdx.app.debug("wirechem-GameScreen", "Barre | Langue USA");
AssetLoader.language = AssetLoader.usa;
} else {
Gdx.app.debug("Barre", "Langue FR");
Gdx.app.debug("wirechem-GameScreen", "Barre | Langue FR");
AssetLoader.language = AssetLoader.french;
}
} else if (caller == "stat") {
@ -806,6 +804,20 @@ public class GameScreen implements Screen {
level.Locked=false;
buttonlevel.setDisabled(false);
worlds.unLockLevel();
} else if (caller == "database") {
worlds.origLevel();
} else if (caller == "delrow") {
level.Grid=(Grid) level.Grid.clone(level.Grid.sizeX-1, level.Grid.sizeY);
map.resize();
} else if (caller == "delcol") {
level.Grid=(Grid) level.Grid.clone(level.Grid.sizeX, level.Grid.sizeY-1);
map.resize();
} else if (caller == "addrow") {
level.Grid=(Grid) level.Grid.clone(level.Grid.sizeX+1, level.Grid.sizeY);
map.resize();
} else if (caller == "addcol") {
level.Grid=(Grid) level.Grid.clone(level.Grid.sizeX, level.Grid.sizeY+1);
map.resize();
}
}

View File

@ -46,8 +46,7 @@ public class LevelScreen implements Screen {
private Stage stage;
private Table table;
private WarnDialog dialog;
private ImageButton Previous, Next, Exit;
public ImageButton logosmall;
private ImageButton Previous, Next, Exit, logosmall, databaseSave;
public Image MenuSolo, MenuMulti, MenuScenario;
private ImageTextButton cout, tech, cycle, temp, rayon, nrj;
private TextButton buttonConnect, buttonPlay, buttonStat, buttonSave,
@ -65,7 +64,7 @@ public class LevelScreen implements Screen {
if (worlds.getState()!=State.notloaded && worlds.getState()!=State.databasefailed) {
if (worlds.getWorld() < 0)
worlds.setMaxWorldLevel();
Gdx.app.debug(getClass().getSimpleName(),"Afficher derniere réalisation, monde :"+worlds.getWorld()+" niveau:"+worlds.getLevel());
Gdx.app.debug("wirechem-LevelScreen","Afficher derniere réalisation, monde :"+worlds.getWorld()+" niveau:"+worlds.getLevel());
worlds.Forcereload();
}
}
@ -73,6 +72,7 @@ public class LevelScreen implements Screen {
public void menu() {
selected = null;
cout.setVisible(false);
databaseSave.setVisible(false);
tech.setVisible(false);
cycle.setVisible(false);
temp.setVisible(false);
@ -147,6 +147,8 @@ public class LevelScreen implements Screen {
}
public void level() {
if (worlds.isDebug())
databaseSave.setVisible(true);
Exit.setPosition(1110, AssetLoader.height - Exit.getHeight() - 5);
MenuSolo.setVisible(false);
MenuMulti.setVisible(false);
@ -211,14 +213,14 @@ public class LevelScreen implements Screen {
level.Description=AssetLoader.language.get("[level"+(level.aWorld+1)+"/"+(level.aLevel+1)+"-desc]");
buttonLevels[i] = new ButtonLevel(level, AssetLoader.ratio, true);
if (worlds.isDebug()) buttonLevels[i].setDisabled(false);
Gdx.app.debug(getClass().getSimpleName(), "Ajout du niveau :"+ level.Name + "" + String.valueOf(level.aLevel));
Gdx.app.debug("wirechem-LevelScreen", "Ajout du niveau :"+ level.Name + "" + String.valueOf(level.aLevel));
buttonLevels[i++].addListener(new ClickListener() {
@Override
public void enter(InputEvent event, float x, float y,
int pointer, Actor fromActor) {
ButtonLevel abutton = (ButtonLevel) event
.getListenerActor();
Gdx.app.debug(event.getListenerActor().toString(),"Enter button ");
Gdx.app.debug("wirechem-LevelScreen","Enter button ");
if (!abutton.isChecked() && (!abutton.level.Locked || worlds.isDebug()))
showlevel(abutton);
}
@ -227,7 +229,7 @@ public class LevelScreen implements Screen {
int pointer, Actor fromActor) {
ButtonLevel abutton = (ButtonLevel) event
.getListenerActor();
Gdx.app.debug(event.getListenerActor().toString(),"Enter button ");
Gdx.app.debug("wirechem-LevelScreen","Enter button ");
if (!abutton.isChecked() && (!abutton.level.Locked || worlds.isDebug()))
showlevel(abutton);
}
@ -290,12 +292,12 @@ public class LevelScreen implements Screen {
}
}
});
Gdx.app.debug(getClass().getSimpleName(),"Création des elements primordiaux du screen (stage, renderer, table)");
Gdx.app.debug("wirechem-LevelScreen","Création des elements primordiaux du screen (stage, renderer, table)");
stage = new Stage(AssetLoader.viewport);
table = new Table();
Renderer = new LevelRenderer(this);
dialog = new WarnDialog(AssetLoader.Skin_ui);
Gdx.app.debug(getClass().getSimpleName(), "Mise en place du timer.");
Gdx.app.debug("wirechem-LevelScreen", "Mise en place du timer.");
ScrollTimer = new Timer();
ScrollTask = new TimerTask() {
@Override
@ -304,7 +306,7 @@ public class LevelScreen implements Screen {
}
};
ScrollTimer.scheduleAtFixedRate(ScrollTask, 0, 30);
Gdx.app.debug(getClass().getSimpleName(), "Création du menu.");
Gdx.app.debug("wirechem-LevelScreen", "Création du menu.");
MenuSolo = new Image(AssetLoader.Skin_level, "menu1");
MenuSolo.setOrigin(MenuSolo.getWidth() / 2, MenuSolo.getHeight() / 2);
MenuSolo.addListener(new ClickListener() {
@ -355,7 +357,7 @@ public class LevelScreen implements Screen {
})));
}
});
Gdx.app.debug(getClass().getSimpleName(), "Création des boutons.");
Gdx.app.debug("wirechem-LevelScreen", "Création des boutons.");
logosmall = new ImageButton(AssetLoader.Skin_level, "logosmall");
logosmall.setPosition(20,AssetLoader.height - 175 + logosmall.getHeight() / 2);
logosmall.setChecked(worlds.isDebug());
@ -369,6 +371,7 @@ public class LevelScreen implements Screen {
}
worlds.ActivateDebug();
Next.setVisible(!worlds.isRealLastWorld());
databaseSave.setVisible(true);
}
else {
if (buttonLevels != null)
@ -379,6 +382,7 @@ public class LevelScreen implements Screen {
worlds.DesactivateDebug();
worlds.updateUnlockLevels();
worlds.setMaxWorldLevel();
databaseSave.setVisible(false);
}
}
});
@ -489,7 +493,7 @@ public class LevelScreen implements Screen {
@Override
public void clicked(InputEvent event, float x, float y) {
worlds.NextWorld();
Gdx.app.debug(event.getListenerActor().toString(),
Gdx.app.debug("wirechem-LevelScreen",
"World:" + String.valueOf(worlds.getWorld()) + " Maxworld:"
+ String.valueOf(worlds.getMaxWorlds()));
}
@ -500,11 +504,20 @@ public class LevelScreen implements Screen {
@Override
public void clicked(InputEvent event, float x, float y) {
worlds.PreviousWorld();
Gdx.app.debug(event.getListenerActor().toString(),
Gdx.app.debug("wirechem-LevelScreen",
"World:" + String.valueOf(worlds.getWorld()) + " Maxworld:"
+ String.valueOf(worlds.getMaxWorlds()));
}
});
databaseSave = new ImageButton(AssetLoader.Skin_level, "database-save");
databaseSave.setPosition(1820, 40);
databaseSave.setVisible(false);
databaseSave.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
worlds.save(worlds.getName());
}
});
cout = new ImageTextButton("5", AssetLoader.Skin_level, "cout");
cout.setPosition(1250, 48);
tech = new ImageTextButton("10", AssetLoader.Skin_level, "tech");
@ -517,7 +530,7 @@ public class LevelScreen implements Screen {
nrj.setPosition(1365, 490);
rayon = new ImageTextButton("10", AssetLoader.Skin_level, "rayon");
rayon.setPosition(1250, 490);
Gdx.app.debug(getClass().getSimpleName(), "Conditions de victoire.");
Gdx.app.debug("wirechem-LevelScreen", "Conditions de victoire.");
Victory = new Objectives();
Victory.setVictory(new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 });
Victory.setPosition(1216, 185);
@ -549,7 +562,7 @@ public class LevelScreen implements Screen {
Statdata.Refresh();
Userdata.Refresh();
Gamedata.Refresh();
Gdx.app.debug(getClass().getSimpleName(), "Affichage du menu.");
Gdx.app.debug("wirechem-LevelScreen", "Affichage du menu.");
if (worlds.getWorld() != -1)
level();
else
@ -571,7 +584,7 @@ public class LevelScreen implements Screen {
@Override
public void show() {
Gdx.app.log("*****", "Affichage du choix des mondes & niveaux.");
Gdx.app.log("wirechem-LevelScreen", "***** Affichage du choix des mondes & niveaux.");
table.setFillParent(true);
stage.addActor(worlds);
stage.addActor(MenuSolo);
@ -603,8 +616,9 @@ public class LevelScreen implements Screen {
stage.addActor(Gamedatalabel);
stage.addActor(Worlddata);
stage.addActor(Worlddatalabel);
stage.addActor(databaseSave);
Gdx.input.setInputProcessor(stage);
Gdx.app.debug("AssetLoader", "Début dans la bande son \'intro\'");
Gdx.app.debug("wirechem-LevelScreen", "Début dans la bande son \'intro\'");
AssetLoader.intro.setLooping(true);
AssetLoader.intro.play();
}
@ -629,7 +643,7 @@ public class LevelScreen implements Screen {
public void showlevel(ButtonLevel button) {
if (button==null)
return;
Gdx.app.debug(getClass().getSimpleName(), "Reading button " + button.level.Name);
Gdx.app.debug("wirechem-LevelScreen", "Reading button " + button.level.Name);
TextDescriptive.setText(button.level.Description);
if (button.level.Maxcycle < 99999 && button.level.Maxcycle > 0) {
cycle.setText(String.valueOf(button.level.Maxcycle));

View File

@ -33,7 +33,7 @@ public class SplashScreen implements Screen {
@Override
public void show() {
Gdx.app.log("****", "Affichage du SplashScreen");
Gdx.app.log("wirechem-LevelScreen", "***** Affichage du SplashScreen");
scale = 2;
splashImage.setScale(scale);
splashImage.setPosition(