feat: ajout et modification des insufleurs début de gestion du drap and drop multimonde ajout des flèches en mode édition de lien
This commit is contained in:
parent
087a914e8e
commit
9cdfefee80
|
@ -8,6 +8,7 @@ import com.badlogic.gdx.utils.ObjectMap.Values;
|
||||||
import com.badlogic.gdx.utils.OrderedMap;
|
import com.badlogic.gdx.utils.OrderedMap;
|
||||||
|
|
||||||
import fr.evolving.assets.AssetLoader;
|
import fr.evolving.assets.AssetLoader;
|
||||||
|
import fr.evolving.automata.Transmuter.CaseType;
|
||||||
import fr.evolving.automata.Transmuter.Class;
|
import fr.evolving.automata.Transmuter.Class;
|
||||||
|
|
||||||
public class Insufler100 extends Transmuter {
|
public class Insufler100 extends Transmuter {
|
||||||
|
@ -68,25 +69,25 @@ public class Insufler100 extends Transmuter {
|
||||||
this.Activable = false;
|
this.Activable = false;
|
||||||
this.ActivationLevel = 0;
|
this.ActivationLevel = 0;
|
||||||
this.Tilestype = new OrderedMap<Vector2, CaseType>();
|
this.Tilestype = new OrderedMap<Vector2, CaseType>();
|
||||||
this.Tilestype.put(new Vector2(-1, 1), CaseType.Cuivre);
|
this.Tilestype.put(new Vector2(-1, 1), CaseType.Rien);
|
||||||
this.Tilestype.put(new Vector2(0, 1), CaseType.Cuivre);
|
this.Tilestype.put(new Vector2(0, 1), CaseType.Cuivre);
|
||||||
this.Tilestype.put(new Vector2(1, 1), CaseType.Rien);
|
this.Tilestype.put(new Vector2(1, 1), CaseType.Cuivre);
|
||||||
this.Tilestype.put(new Vector2(-1, 0), CaseType.Rien);
|
this.Tilestype.put(new Vector2(-1, 0), CaseType.Cuivre);
|
||||||
this.Tilestype.put(new Vector2(0, 0), CaseType.Cuivre);
|
this.Tilestype.put(new Vector2(0, 0), CaseType.Cuivre);
|
||||||
this.Tilestype.put(new Vector2(1, 0), CaseType.Cuivre);
|
this.Tilestype.put(new Vector2(1, 0), CaseType.Rien);
|
||||||
this.Tilestype.put(new Vector2(-1, -1), CaseType.Cuivre);
|
this.Tilestype.put(new Vector2(-1, -1), CaseType.Rien);
|
||||||
this.Tilestype.put(new Vector2(0, -1), CaseType.Cuivre);
|
this.Tilestype.put(new Vector2(0, -1), CaseType.Cuivre);
|
||||||
this.Tilestype.put(new Vector2(1, -1), CaseType.Rien);
|
this.Tilestype.put(new Vector2(1, -1), CaseType.Cuivre);
|
||||||
this.Tilesid = new OrderedMap<Vector2, Integer>();
|
this.Tilesid = new OrderedMap<Vector2, Integer>();
|
||||||
this.Tilesid.put(new Vector2(-1, 1), 120);
|
this.Tilesid.put(new Vector2(-1, 1), 125);
|
||||||
this.Tilesid.put(new Vector2(0,1), 121);
|
this.Tilesid.put(new Vector2(0,1), 141);
|
||||||
this.Tilesid.put(new Vector2(1, 1), 122);
|
this.Tilesid.put(new Vector2(1, 1), 142);
|
||||||
this.Tilesid.put(new Vector2(-1, 0), 123);
|
this.Tilesid.put(new Vector2(-1, 0), 128);
|
||||||
this.Tilesid.put(new Vector2(0, 0), 124);
|
this.Tilesid.put(new Vector2(0, 0), 143);
|
||||||
this.Tilesid.put(new Vector2(1, 0), 125);
|
this.Tilesid.put(new Vector2(1, 0), 130);
|
||||||
this.Tilesid.put(new Vector2(-1, -1), 126);
|
this.Tilesid.put(new Vector2(-1, -1), 131);
|
||||||
this.Tilesid.put(new Vector2(0, -1), 127);
|
this.Tilesid.put(new Vector2(0, -1), 144);
|
||||||
this.Tilesid.put(new Vector2(1, -1), 128);
|
this.Tilesid.put(new Vector2(1, -1), 118);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
|
|
@ -69,25 +69,25 @@ public class Insufler33 extends Transmuter {
|
||||||
this.Activable = false;
|
this.Activable = false;
|
||||||
this.ActivationLevel = 0;
|
this.ActivationLevel = 0;
|
||||||
this.Tilestype = new OrderedMap<Vector2, CaseType>();
|
this.Tilestype = new OrderedMap<Vector2, CaseType>();
|
||||||
this.Tilestype.put(new Vector2(-1, 1), CaseType.Cuivre_seul);
|
this.Tilestype.put(new Vector2(-1, 1), CaseType.Rien);
|
||||||
this.Tilestype.put(new Vector2(0, 1), CaseType.Cuivre_seul);
|
this.Tilestype.put(new Vector2(0, 1), CaseType.Cuivre_seul);
|
||||||
this.Tilestype.put(new Vector2(1, 1), CaseType.Rien);
|
this.Tilestype.put(new Vector2(1, 1), CaseType.Cuivre_seul);
|
||||||
this.Tilestype.put(new Vector2(-1, 0), CaseType.Rien);
|
this.Tilestype.put(new Vector2(-1, 0), CaseType.Cuivre_seul);
|
||||||
this.Tilestype.put(new Vector2(0, 0), CaseType.Cuivre_seul);
|
this.Tilestype.put(new Vector2(0, 0), CaseType.Cuivre_seul);
|
||||||
this.Tilestype.put(new Vector2(1, 0), CaseType.Cuivre_seul);
|
this.Tilestype.put(new Vector2(1, 0), CaseType.Rien);
|
||||||
this.Tilestype.put(new Vector2(-1, -1), CaseType.Cuivre_seul);
|
this.Tilestype.put(new Vector2(-1, -1), CaseType.Rien);
|
||||||
this.Tilestype.put(new Vector2(0, -1), CaseType.Cuivre_seul);
|
this.Tilestype.put(new Vector2(0, -1), CaseType.Cuivre_seul);
|
||||||
this.Tilestype.put(new Vector2(1, -1), CaseType.Rien);
|
this.Tilestype.put(new Vector2(1, -1), CaseType.Cuivre_seul);
|
||||||
this.Tilesid = new OrderedMap<Vector2, Integer>();
|
this.Tilesid = new OrderedMap<Vector2, Integer>();
|
||||||
this.Tilesid.put(new Vector2(-1, 1), 120);
|
this.Tilesid.put(new Vector2(-1, 1), 125);
|
||||||
this.Tilesid.put(new Vector2(0,1), 121);
|
this.Tilesid.put(new Vector2(0,1), 126);
|
||||||
this.Tilesid.put(new Vector2(1, 1), 122);
|
this.Tilesid.put(new Vector2(1, 1), 127);
|
||||||
this.Tilesid.put(new Vector2(-1, 0), 123);
|
this.Tilesid.put(new Vector2(-1, 0), 128);
|
||||||
this.Tilesid.put(new Vector2(0, 0), 129);
|
this.Tilesid.put(new Vector2(0, 0), 129);
|
||||||
this.Tilesid.put(new Vector2(1, 0), 125);
|
this.Tilesid.put(new Vector2(1, 0), 130);
|
||||||
this.Tilesid.put(new Vector2(-1, -1), 126);
|
this.Tilesid.put(new Vector2(-1, -1), 131);
|
||||||
this.Tilesid.put(new Vector2(0, -1), 127);
|
this.Tilesid.put(new Vector2(0, -1), 132);
|
||||||
this.Tilesid.put(new Vector2(1, -1), 128);
|
this.Tilesid.put(new Vector2(1, -1), 133);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
|
|
@ -69,25 +69,25 @@ public class Insufler50 extends Transmuter {
|
||||||
this.Activable = false;
|
this.Activable = false;
|
||||||
this.ActivationLevel = 0;
|
this.ActivationLevel = 0;
|
||||||
this.Tilestype = new OrderedMap<Vector2, CaseType>();
|
this.Tilestype = new OrderedMap<Vector2, CaseType>();
|
||||||
this.Tilestype.put(new Vector2(-1, 1), CaseType.Cuivre);
|
this.Tilestype.put(new Vector2(-1, 1), CaseType.Rien);
|
||||||
this.Tilestype.put(new Vector2(0, 1), CaseType.Cuivre);
|
this.Tilestype.put(new Vector2(0, 1), CaseType.Cuivre);
|
||||||
this.Tilestype.put(new Vector2(1, 1), CaseType.Rien);
|
this.Tilestype.put(new Vector2(1, 1), CaseType.Cuivre);
|
||||||
this.Tilestype.put(new Vector2(-1, 0), CaseType.Rien);
|
this.Tilestype.put(new Vector2(-1, 0), CaseType.Cuivre);
|
||||||
this.Tilestype.put(new Vector2(0, 0), CaseType.Cuivre);
|
this.Tilestype.put(new Vector2(0, 0), CaseType.Cuivre);
|
||||||
this.Tilestype.put(new Vector2(1, 0), CaseType.Cuivre);
|
this.Tilestype.put(new Vector2(1, 0), CaseType.Rien);
|
||||||
this.Tilestype.put(new Vector2(-1, -1), CaseType.Cuivre);
|
this.Tilestype.put(new Vector2(-1, -1), CaseType.Rien);
|
||||||
this.Tilestype.put(new Vector2(0, -1), CaseType.Cuivre);
|
this.Tilestype.put(new Vector2(0, -1), CaseType.Cuivre);
|
||||||
this.Tilestype.put(new Vector2(1, -1), CaseType.Rien);
|
this.Tilestype.put(new Vector2(1, -1), CaseType.Cuivre);
|
||||||
this.Tilesid = new OrderedMap<Vector2, Integer>();
|
this.Tilesid = new OrderedMap<Vector2, Integer>();
|
||||||
this.Tilesid.put(new Vector2(-1, 1), 120);
|
this.Tilesid.put(new Vector2(-1, 1), 125);
|
||||||
this.Tilesid.put(new Vector2(0,1), 121);
|
this.Tilesid.put(new Vector2(0,1), 137);
|
||||||
this.Tilesid.put(new Vector2(1, 1), 122);
|
this.Tilesid.put(new Vector2(1, 1), 138);
|
||||||
this.Tilesid.put(new Vector2(-1, 0), 123);
|
this.Tilesid.put(new Vector2(-1, 0), 128);
|
||||||
this.Tilesid.put(new Vector2(0, 0), 130);
|
this.Tilesid.put(new Vector2(0, 0), 139);
|
||||||
this.Tilesid.put(new Vector2(1, 0), 125);
|
this.Tilesid.put(new Vector2(1, 0), 130);
|
||||||
this.Tilesid.put(new Vector2(-1, -1), 126);
|
this.Tilesid.put(new Vector2(-1, -1), 131);
|
||||||
this.Tilesid.put(new Vector2(0, -1), 127);
|
this.Tilesid.put(new Vector2(0, -1), 140);
|
||||||
this.Tilesid.put(new Vector2(1, -1), 128);
|
this.Tilesid.put(new Vector2(1, -1), 138);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
|
|
@ -10,7 +10,6 @@ import fr.evolving.assets.InitWorlds;
|
||||||
import fr.evolving.assets.Preference;
|
import fr.evolving.assets.Preference;
|
||||||
|
|
||||||
public class Worlds extends Actor {
|
public class Worlds extends Actor {
|
||||||
private ChangeEvent event;
|
|
||||||
private Array<Level> levels;
|
private Array<Level> levels;
|
||||||
private String name;
|
private String name;
|
||||||
private int usedworld;
|
private int usedworld;
|
||||||
|
|
|
@ -121,7 +121,7 @@ public class PrefWindow extends Window {
|
||||||
Setrefresh = new CheckBox(AssetLoader.language.get("[WinOptions-gamescreen-refresh]"),AssetLoader.Skin_ui);
|
Setrefresh = new CheckBox(AssetLoader.language.get("[WinOptions-gamescreen-refresh]"),AssetLoader.Skin_ui);
|
||||||
table.add(Setrefresh).left();
|
table.add(Setrefresh).left();
|
||||||
table.row();
|
table.row();
|
||||||
table.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-language]"), AssetLoader.Skin_ui,"default-font", Color.WHITE)).left();
|
table.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-language]"), AssetLoader.Skin_ui,"medium", Color.WHITE)).left();
|
||||||
Setflag = new ImageButton(AssetLoader.Skin_level, "Setflag");
|
Setflag = new ImageButton(AssetLoader.Skin_level, "Setflag");
|
||||||
table.add(Setflag);
|
table.add(Setflag);
|
||||||
table.row();
|
table.row();
|
||||||
|
@ -139,7 +139,7 @@ public class PrefWindow extends Window {
|
||||||
SetVsynch = new CheckBox(AssetLoader.language.get("[WinOptions-gamescreen-sync]"),AssetLoader.Skin_ui);
|
SetVsynch = new CheckBox(AssetLoader.language.get("[WinOptions-gamescreen-sync]"),AssetLoader.Skin_ui);
|
||||||
table.add(SetVsynch).left();
|
table.add(SetVsynch).left();
|
||||||
Table tablev1 = new Table();
|
Table tablev1 = new Table();
|
||||||
tablev1.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-resolution]"), AssetLoader.Skin_ui, "default-font",Color.WHITE)).left().row();
|
tablev1.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-resolution]"), AssetLoader.Skin_ui, "medium",Color.WHITE)).left().row();
|
||||||
selResolution = new SelectBox<resolutions>(AssetLoader.Skin_ui);
|
selResolution = new SelectBox<resolutions>(AssetLoader.Skin_ui);
|
||||||
selResolution.setItems(resolutions.values());
|
selResolution.setItems(resolutions.values());
|
||||||
tablev1.add(selResolution).left().row();
|
tablev1.add(selResolution).left().row();
|
||||||
|
@ -149,7 +149,7 @@ public class PrefWindow extends Window {
|
||||||
SetFullscreen = new CheckBox(AssetLoader.language.get("[WinOptions-gamescreen-full]"), AssetLoader.Skin_ui);
|
SetFullscreen = new CheckBox(AssetLoader.language.get("[WinOptions-gamescreen-full]"), AssetLoader.Skin_ui);
|
||||||
table.add(SetFullscreen).left();
|
table.add(SetFullscreen).left();
|
||||||
Table tablev2 = new Table();
|
Table tablev2 = new Table();
|
||||||
tablev2.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-fill]"), AssetLoader.Skin_ui,"default-font", Color.WHITE)).left().row();
|
tablev2.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-fill]"), AssetLoader.Skin_ui,"medium", Color.WHITE)).left().row();
|
||||||
selAdaptscreen = new SelectBox<adaptation>(AssetLoader.Skin_ui);
|
selAdaptscreen = new SelectBox<adaptation>(AssetLoader.Skin_ui);
|
||||||
selAdaptscreen.setItems(adaptation.values());
|
selAdaptscreen.setItems(adaptation.values());
|
||||||
tablev2.add(selAdaptscreen).left().row();
|
tablev2.add(selAdaptscreen).left().row();
|
||||||
|
@ -157,7 +157,7 @@ public class PrefWindow extends Window {
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
Table tablev3 = new Table();
|
Table tablev3 = new Table();
|
||||||
tablev3.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-quality]"), AssetLoader.Skin_ui, "default-font", Color.WHITE)).left().row();
|
tablev3.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-quality]"), AssetLoader.Skin_ui, "medium", Color.WHITE)).left().row();
|
||||||
SetAnimation = new CheckBox(AssetLoader.language.get("[WinOptions-gamescreen-animation]"),AssetLoader.Skin_ui);
|
SetAnimation = new CheckBox(AssetLoader.language.get("[WinOptions-gamescreen-animation]"),AssetLoader.Skin_ui);
|
||||||
table.add(SetAnimation).left();
|
table.add(SetAnimation).left();
|
||||||
selTexturequal = new SelectBox<quality>(AssetLoader.Skin_ui);
|
selTexturequal = new SelectBox<quality>(AssetLoader.Skin_ui);
|
||||||
|
|
|
@ -71,27 +71,21 @@ public class Laser {
|
||||||
float y2 = yy2 + 20;
|
float y2 = yy2 + 20;
|
||||||
Laser.begin(ShapeType.Filled);
|
Laser.begin(ShapeType.Filled);
|
||||||
Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
|
Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
|
||||||
if (true) {
|
Vector2 vectorall = new Vector2(x2, y2).sub(new Vector2(x1, y1));
|
||||||
Vector2 vectorall = new Vector2(x2, y2).sub(new Vector2(x1, y1));
|
float length = vectorall.len();
|
||||||
float length = vectorall.len();
|
float size = 20;
|
||||||
float size = 20;
|
Vector2 vectoradd = vectorall.scl(size / length);
|
||||||
Vector2 vectoradd = vectorall.scl(size / length);
|
float adding = 0;
|
||||||
float adding = 0;
|
for (float i = 0; i < length / size-1; i += 1) {
|
||||||
for (float i = 2; i + 2 < length / size; i += 1) {
|
float width = (float) (maxwidth - Math.random() * 2);
|
||||||
float width = (float) (maxwidth - Math.random() * 2);
|
while (width >= 0) {
|
||||||
while (width >= 0) {
|
adding = (width * power / maxwidth);
|
||||||
adding = (width * power / maxwidth);
|
Color Acolor = colorsrc.cpy().lerp(colordst.cpy(),(i / (length / size)));
|
||||||
Color Acolor = colorsrc.cpy().lerp(colordst.cpy(),(i / (length / size)));
|
Laser.setColor(Acolor.add(adding, adding, adding, 0.5f));
|
||||||
Laser.setColor(Acolor.add(adding, adding, adding, 0.5f));
|
if (Math.random() > 0.4)
|
||||||
if (Math.random() > 0.4)
|
Laser.rectLine(x1 + i * vectoradd.x, y1 + i * vectoradd.y, x1 + (i + 1) * vectoradd.x, y1+ (i + 1) * vectoradd.y, width);
|
||||||
Laser.rectLine(x1 + i * vectoradd.x, y1 + i * vectoradd.y, x1 + (i + 1) * vectoradd.x, y1+ (i + 1) * vectoradd.y, width);
|
width = width - 1;
|
||||||
width = width - 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
Color Acolor = new Color(0.5f, 0.5f, 0.5f, 1f);
|
|
||||||
Laser.setColor(Acolor);
|
|
||||||
Laser.rectLine(x1, y1, x2, y2, 2);
|
|
||||||
}
|
}
|
||||||
Laser.end();
|
Laser.end();
|
||||||
Gdx.gl.glDisable(GL20.GL_BLEND);
|
Gdx.gl.glDisable(GL20.GL_BLEND);
|
||||||
|
|
|
@ -8,6 +8,7 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
|
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
|
||||||
import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType;
|
import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType;
|
||||||
|
import com.badlogic.gdx.math.Vector2;
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
|
||||||
import fr.evolving.UI.ButtonLevel;
|
import fr.evolving.UI.ButtonLevel;
|
||||||
|
@ -107,10 +108,19 @@ public class LevelRenderer {
|
||||||
if ((item.length == 2) && (button2.level.aWorld == item[0]) && (button2.level.aLevel == item[1]))
|
if ((item.length == 2) && (button2.level.aWorld == item[0]) && (button2.level.aLevel == item[1]))
|
||||||
if (!LevelScreen.worlds.isDebug())
|
if (!LevelScreen.worlds.isDebug())
|
||||||
Laser.draw(batcher,button1.level.X,button1.level.Y* AssetLoader.ratio,button2.level.X,button2.level.Y* AssetLoader.ratio,10,0.5f,!button2.level.Locked, button1.getLevelcolor(),button2.getLevelcolor());
|
Laser.draw(batcher,button1.level.X,button1.level.Y* AssetLoader.ratio,button2.level.X,button2.level.Y* AssetLoader.ratio,10,0.5f,!button2.level.Locked, button1.getLevelcolor(),button2.getLevelcolor());
|
||||||
else
|
else {
|
||||||
Laser.drawnotsoold(shapeRenderer,button1.level.X,button1.level.Y* AssetLoader.ratio,button2.level.X,button2.level.Y* AssetLoader.ratio,10,0.5f,!button2.level.Locked, button1.getLevelcolor(),button2.getLevelcolor());
|
Vector2 debut=new Vector2(button1.level.X,button1.level.Y* AssetLoader.ratio);
|
||||||
|
Vector2 fin=new Vector2(button2.level.X,button2.level.Y* AssetLoader.ratio);
|
||||||
}
|
Vector2 size=fin.cpy().sub(debut);
|
||||||
|
Vector2 newfin=size.cpy().limit(size.len()-40).add(debut);
|
||||||
|
Vector2 corps=fin.cpy().sub(debut).limit(45);
|
||||||
|
Vector2 fleche1=newfin.cpy().sub(corps.cpy().rotate(30));
|
||||||
|
Vector2 fleche2=newfin.cpy().sub(corps.cpy().rotate(-30));
|
||||||
|
Laser.drawnotsoold(shapeRenderer,debut.x,debut.y,fin.x,fin.y,10,0.5f,!button2.level.Locked, button1.getLevelcolor(),button2.getLevelcolor());
|
||||||
|
Laser.drawnotsoold(shapeRenderer,fleche2.x,fleche2.y,newfin.x,newfin.y,10,0.5f,!button2.level.Locked, button1.getLevelcolor(),button2.getLevelcolor());
|
||||||
|
Laser.drawnotsoold(shapeRenderer,fleche1.x,fleche1.y,newfin.x,newfin.y,10,0.5f,!button2.level.Locked, button1.getLevelcolor(),button2.getLevelcolor());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class LevelScreen implements Screen {
|
||||||
private TextButton buttonConnect, buttonPlay, buttonStat, buttonSave, buttonApply, buttonPlaythis;
|
private TextButton buttonConnect, buttonPlay, buttonStat, buttonSave, buttonApply, buttonPlaythis;
|
||||||
private ServerList Statdata, Userdata, Gamedata;
|
private ServerList Statdata, Userdata, Gamedata;
|
||||||
private Worldlist Worlddata;
|
private Worldlist Worlddata;
|
||||||
private Label Statdatalabel, Userdatalabel, Gamedatalabel, Worlddatalabel, rewardlabel, goallavel, ressourcelabel, handicaplabel;
|
private Label Statdatalabel, Userdatalabel, Gamedatalabel, Worlddatalabel, rewardlabel, goallabel, ressourcelabel, handicaplabel;
|
||||||
private TextField worldfield;
|
private TextField worldfield;
|
||||||
private TextArea TextDescriptive;
|
private TextArea TextDescriptive;
|
||||||
public Worlds worlds;
|
public Worlds worlds;
|
||||||
|
@ -81,7 +81,6 @@ public class LevelScreen implements Screen {
|
||||||
public int addervalue;
|
public int addervalue;
|
||||||
private ButtonGroup<Button> chooser, modifbar;
|
private ButtonGroup<Button> chooser, modifbar;
|
||||||
public Group group_init, group_stat, group_level, group_base, group_debug, group_choose, group_other;
|
public Group group_init, group_stat, group_level, group_base, group_debug, group_choose, group_other;
|
||||||
private ClickListener buttonLevelslistener;
|
|
||||||
private DragAndDrop dragAndDrop;
|
private DragAndDrop dragAndDrop;
|
||||||
|
|
||||||
public void play() {
|
public void play() {
|
||||||
|
@ -173,6 +172,8 @@ public class LevelScreen implements Screen {
|
||||||
if (buttonLevels!=null)
|
if (buttonLevels!=null)
|
||||||
for(ButtonLevel buttonlevel:buttonLevels)
|
for(ButtonLevel buttonlevel:buttonLevels)
|
||||||
AddDragDrop((Actor)buttonlevel);
|
AddDragDrop((Actor)buttonlevel);
|
||||||
|
AddDragDrop((Actor)Previous);
|
||||||
|
AddDragDrop((Actor)Next);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddDragDrop(final Actor actor) {
|
public void AddDragDrop(final Actor actor) {
|
||||||
|
@ -180,7 +181,7 @@ public class LevelScreen implements Screen {
|
||||||
dragAndDrop.addSource(new Source(actor) {
|
dragAndDrop.addSource(new Source(actor) {
|
||||||
public Payload dragStart (InputEvent event, float x, float y, int pointer) {
|
public Payload dragStart (InputEvent event, float x, float y, int pointer) {
|
||||||
Payload payload = new Payload();
|
Payload payload = new Payload();
|
||||||
payload.setObject(((ButtonLevel)event.getListenerActor()).level);
|
payload.setObject(((ButtonLevel)event.getListenerActor()).level.clone());
|
||||||
|
|
||||||
payload.setDragActor(new Label("Choose destination", AssetLoader.Skin_ui));
|
payload.setDragActor(new Label("Choose destination", AssetLoader.Skin_ui));
|
||||||
|
|
||||||
|
@ -197,6 +198,10 @@ public class LevelScreen implements Screen {
|
||||||
});
|
});
|
||||||
dragAndDrop.addTarget(new Target(actor) {
|
dragAndDrop.addTarget(new Target(actor) {
|
||||||
public boolean drag (Source source, Payload payload, float x, float y, int pointer) {
|
public boolean drag (Source source, Payload payload, float x, float y, int pointer) {
|
||||||
|
if (actor.getName()=="Previous" || actor.getName()=="Next"){
|
||||||
|
((ClickListener) actor.getListeners().peek()).clicked(null, 1980, 2002);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
Level levelsrc=(Level)payload.getObject();
|
Level levelsrc=(Level)payload.getObject();
|
||||||
Level leveldst=((ButtonLevel)actor).level;
|
Level leveldst=((ButtonLevel)actor).level;
|
||||||
Gdx.app.debug("wirechem-LevelScreen", "Verification d'un lien du niveau "+levelsrc.aWorld+","+levelsrc.aLevel+" vers "+leveldst.aWorld+","+leveldst.aLevel);
|
Gdx.app.debug("wirechem-LevelScreen", "Verification d'un lien du niveau "+levelsrc.aWorld+","+levelsrc.aLevel+" vers "+leveldst.aWorld+","+leveldst.aLevel);
|
||||||
|
@ -454,13 +459,13 @@ public class LevelScreen implements Screen {
|
||||||
//Group Level
|
//Group Level
|
||||||
//**********************************************************
|
//**********************************************************
|
||||||
Gdx.app.debug("wirechem-LevelScreen", "Création du groupe Level.");
|
Gdx.app.debug("wirechem-LevelScreen", "Création du groupe Level.");
|
||||||
rewardlabel = new Label(AssetLoader.language.get("[reward-levelscreen]"), AssetLoader.Skin_ui);
|
rewardlabel = new Label(AssetLoader.language.get("[reward-levelscreen]"), AssetLoader.Skin_ui, "variable");
|
||||||
rewardlabel.setPosition(1215, AssetLoader.height - 38);
|
rewardlabel.setPosition(1215, AssetLoader.height - 38);
|
||||||
goallavel = new Label(AssetLoader.language.get("[goal-levelscreen]"), AssetLoader.Skin_ui);
|
goallabel = new Label(AssetLoader.language.get("[goal-levelscreen]"), AssetLoader.Skin_ui, "variable");
|
||||||
goallavel.setPosition(1215, 272);
|
goallabel.setPosition(1215, 272);
|
||||||
ressourcelabel = new Label(AssetLoader.language.get("[ressource-levelscreen]"), AssetLoader.Skin_ui);
|
ressourcelabel = new Label(AssetLoader.language.get("[ressource-levelscreen]"), AssetLoader.Skin_ui, "variable");
|
||||||
ressourcelabel.setPosition(1215, 122);
|
ressourcelabel.setPosition(1215, 122);
|
||||||
handicaplabel = new Label(AssetLoader.language.get("[handicap-levelscreen]"), AssetLoader.Skin_ui);
|
handicaplabel = new Label(AssetLoader.language.get("[handicap-levelscreen]"), AssetLoader.Skin_ui, "variable");
|
||||||
handicaplabel.setPosition(1215, 582);
|
handicaplabel.setPosition(1215, 582);
|
||||||
worldfield = new TextField("", AssetLoader.Skin_ui,"transparent");
|
worldfield = new TextField("", AssetLoader.Skin_ui,"transparent");
|
||||||
worldfield.setPosition(15, 148);
|
worldfield.setPosition(15, 148);
|
||||||
|
@ -503,6 +508,7 @@ public class LevelScreen implements Screen {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Next = new ImageButton(AssetLoader.Skin_level, "Next");
|
Next = new ImageButton(AssetLoader.Skin_level, "Next");
|
||||||
|
Next.setName("Next");
|
||||||
Next.setPosition(1030, 185);
|
Next.setPosition(1030, 185);
|
||||||
Next.addListener(new ClickListener() {
|
Next.addListener(new ClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -516,6 +522,7 @@ public class LevelScreen implements Screen {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Previous = new ImageButton(AssetLoader.Skin_level, "Previous");
|
Previous = new ImageButton(AssetLoader.Skin_level, "Previous");
|
||||||
|
Previous.setName("Previous");
|
||||||
Previous.setPosition(1110, 185);
|
Previous.setPosition(1110, 185);
|
||||||
Previous.addListener(new ClickListener() {
|
Previous.addListener(new ClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -764,7 +771,7 @@ public class LevelScreen implements Screen {
|
||||||
group_level.addActor(research);
|
group_level.addActor(research);
|
||||||
group_level.addActor(Victory);
|
group_level.addActor(Victory);
|
||||||
group_level.addActor(rewardlabel);
|
group_level.addActor(rewardlabel);
|
||||||
group_level.addActor(goallavel);
|
group_level.addActor(goallabel);
|
||||||
group_level.addActor(ressourcelabel);
|
group_level.addActor(ressourcelabel);
|
||||||
group_level.addActor(handicaplabel);
|
group_level.addActor(handicaplabel);
|
||||||
group_level.addActor(worldfield);
|
group_level.addActor(worldfield);
|
||||||
|
@ -1263,15 +1270,29 @@ public class LevelScreen implements Screen {
|
||||||
Victory.setVictory(button.level.Victory_orig);
|
Victory.setVictory(button.level.Victory_orig);
|
||||||
button.setChecked(true);
|
button.setChecked(true);
|
||||||
buttonPlay.setVisible(true);
|
buttonPlay.setVisible(true);
|
||||||
|
worldfield.setVisible(true);
|
||||||
if (worlds.isDebug()) {
|
if (worlds.isDebug()) {
|
||||||
unlocked.setChecked(!button.level.Locked);
|
unlocked.setChecked(!button.level.Locked);
|
||||||
finisher.setChecked(button.level.Special);
|
finisher.setChecked(button.level.Special);
|
||||||
worldfield.setDisabled(false);
|
worldfield.setDisabled(false);
|
||||||
TextDescriptive.setDisabled(false);
|
TextDescriptive.setDisabled(false);
|
||||||
|
cycle_orig.setText(String.valueOf(button.level.Cycle_orig));
|
||||||
|
cycle_orig.setVisible(true);
|
||||||
|
temp_orig.setText(String.valueOf(button.level.Temp_orig));
|
||||||
|
temp_orig.setVisible(true);
|
||||||
|
nrj_orig.setText(String.valueOf(button.level.Nrj_orig));
|
||||||
|
nrj_orig.setVisible(true);
|
||||||
|
rayon_orig.setText(String.valueOf(button.level.Rayon_orig));
|
||||||
|
rayon_orig.setVisible(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
worldfield.setDisabled(true);
|
worldfield.setDisabled(true);
|
||||||
TextDescriptive.setDisabled(true);
|
TextDescriptive.setDisabled(true);
|
||||||
|
cycle_orig.setVisible(false);
|
||||||
|
temp_orig.setVisible(false);
|
||||||
|
nrj_orig.setVisible(false);
|
||||||
|
rayon_orig.setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1279,27 +1300,17 @@ public class LevelScreen implements Screen {
|
||||||
Gdx.app.debug("wirechem-LevelScreen", "Efface les informations");
|
Gdx.app.debug("wirechem-LevelScreen", "Efface les informations");
|
||||||
buttonPlay.setVisible(false);
|
buttonPlay.setVisible(false);
|
||||||
TextDescriptive.setVisible(false);
|
TextDescriptive.setVisible(false);
|
||||||
}
|
|
||||||
if (button!=null && worlds.isDebug()) {
|
|
||||||
cycle_orig.setText(String.valueOf(button.level.Cycle_orig));
|
|
||||||
cycle_orig.setVisible(true);
|
|
||||||
} else
|
|
||||||
cycle_orig.setVisible(false);
|
cycle_orig.setVisible(false);
|
||||||
if (button!=null && worlds.isDebug()) {
|
|
||||||
temp_orig.setText(String.valueOf(button.level.Temp_orig));
|
|
||||||
temp_orig.setVisible(true);
|
|
||||||
} else
|
|
||||||
temp_orig.setVisible(false);
|
temp_orig.setVisible(false);
|
||||||
if (button!=null && worlds.isDebug()) {
|
|
||||||
nrj_orig.setText(String.valueOf(button.level.Nrj_orig));
|
|
||||||
nrj_orig.setVisible(true);
|
|
||||||
} else
|
|
||||||
nrj_orig.setVisible(false);
|
nrj_orig.setVisible(false);
|
||||||
if (button!=null && worlds.isDebug()) {
|
|
||||||
rayon_orig.setText(String.valueOf(button.level.Rayon_orig));
|
|
||||||
rayon_orig.setVisible(true);
|
|
||||||
} else
|
|
||||||
rayon_orig.setVisible(false);
|
rayon_orig.setVisible(false);
|
||||||
|
buttonPlay.setVisible(false);
|
||||||
|
worldfield.setVisible(false);
|
||||||
|
}
|
||||||
|
if (button!=null && (worlds.isDebug() || button.level.aWorld>0)) {
|
||||||
|
handicaplabel.setVisible(true);
|
||||||
|
} else
|
||||||
|
handicaplabel.setVisible(false);
|
||||||
if (button!=null && (worlds.isDebug() || button.level.Maxcycle < 99999 && button.level.Maxcycle > 0)) {
|
if (button!=null && (worlds.isDebug() || button.level.Maxcycle < 99999 && button.level.Maxcycle > 0)) {
|
||||||
cycle.setText(String.valueOf(button.level.Maxcycle));
|
cycle.setText(String.valueOf(button.level.Maxcycle));
|
||||||
cycle.setVisible(true);
|
cycle.setVisible(true);
|
||||||
|
@ -1321,15 +1332,25 @@ public class LevelScreen implements Screen {
|
||||||
} else
|
} else
|
||||||
rayon.setVisible(false);
|
rayon.setVisible(false);
|
||||||
if (button!=null && (worlds.isDebug() || button.level.Cout_orig > 0)) {
|
if (button!=null && (worlds.isDebug() || button.level.Cout_orig > 0)) {
|
||||||
|
Victory.setVisible(true);
|
||||||
|
goallabel.setVisible(true);
|
||||||
|
ressourcelabel.setVisible(true);
|
||||||
cout.setText(String.valueOf(button.level.Cout_orig));
|
cout.setText(String.valueOf(button.level.Cout_orig));
|
||||||
cout.setVisible(true);
|
cout.setVisible(true);
|
||||||
} else
|
} else {
|
||||||
cout.setVisible(false);
|
cout.setVisible(false);
|
||||||
|
Victory.setVisible(false);
|
||||||
|
goallabel.setVisible(false);
|
||||||
|
ressourcelabel.setVisible(false);
|
||||||
|
}
|
||||||
if (button!=null && (worlds.isDebug() || button.level.Tech >= 1)) {
|
if (button!=null && (worlds.isDebug() || button.level.Tech >= 1)) {
|
||||||
|
rewardlabel.setVisible(true);
|
||||||
tech.setText(String.valueOf(button.level.Tech));
|
tech.setText(String.valueOf(button.level.Tech));
|
||||||
tech.setVisible(true);
|
tech.setVisible(true);
|
||||||
} else
|
} else {
|
||||||
tech.setVisible(false);
|
tech.setVisible(false);
|
||||||
|
rewardlabel.setVisible(false);
|
||||||
|
}
|
||||||
if (button!=null && (worlds.isDebug() || button.level.rewards[0] >= 1)) {
|
if (button!=null && (worlds.isDebug() || button.level.rewards[0] >= 1)) {
|
||||||
research.setText(String.valueOf(button.level.rewards[0]));
|
research.setText(String.valueOf(button.level.rewards[0]));
|
||||||
research.setVisible(true);
|
research.setVisible(true);
|
||||||
|
@ -1360,7 +1381,6 @@ public class LevelScreen implements Screen {
|
||||||
up.setVisible(true);
|
up.setVisible(true);
|
||||||
} else
|
} else
|
||||||
up.setVisible(false);
|
up.setVisible(false);
|
||||||
Victory.setVisible(button!=null && (worlds.isDebug() || button.level.Cout_orig > 0));
|
|
||||||
if (selected != null)
|
if (selected != null)
|
||||||
selected.setChecked(false);
|
selected.setChecked(false);
|
||||||
selected = button;
|
selected = button;
|
||||||
|
|
Loading…
Reference in New Issue