feat: ajout des handicaps et des objectifs. préparation des récompenses.

This commit is contained in:
Nicolas Hordé 2016-02-17 23:53:50 +01:00
parent 0839f78d2f
commit 6af02b7d9c
5 changed files with 296 additions and 28 deletions

View File

@ -1,24 +1,37 @@
package fr.evolving.UI; package fr.evolving.UI;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.BitmapFont;
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.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import fr.evolving.assets.AssetLoader; import fr.evolving.assets.AssetLoader;
import fr.evolving.automata.Worlds;
public class Objectives extends Actor { public class Objectives extends Actor {
public ShapeRenderer shaperenderer; private ShapeRenderer shaperenderer;
public int[] Victory; public int[] Victory;
BitmapFont font; BitmapFont font;
BitmapFont font2; BitmapFont font2;
public final int size=48;
private TextureRegion Next,Add;
Worlds worlds;
public Objectives() { public Objectives(Worlds worlds) {
this.worlds=worlds;
shaperenderer = new ShapeRenderer(); shaperenderer = new ShapeRenderer();
font = AssetLoader.Skin_level.getFont("Vademecum-18"); font = AssetLoader.Skin_level.getFont("Vademecum-18");
font2 = AssetLoader.Skin_level.getFont("OpenDyslexicAlta-28"); font2 = AssetLoader.Skin_level.getFont("OpenDyslexicAlta-28");
Next = AssetLoader.Skin_level.getAtlas().findRegion("Button-Next-icon");
Add = AssetLoader.Skin_level.getAtlas().findRegion("Button-Add-icon");
this.setHeight(68);
this.setWidth(6*size);
} }
public void setVictory(int[] Victory) { public void setVictory(int[] Victory) {
@ -30,28 +43,35 @@ public class Objectives extends Actor {
shaperenderer.setProjectionMatrix(batch.getProjectionMatrix()); shaperenderer.setProjectionMatrix(batch.getProjectionMatrix());
int element = 0; int element = 0;
int type = 0; int type = 0;
boolean flag =false;
for (int vict : Victory) { for (int vict : Victory) {
if (vict != 0) { if (vict != 0) {
batch.end(); batch.end();
shaperenderer.begin(ShapeType.Filled); shaperenderer.begin(ShapeType.Filled);
shaperenderer.setColor(AssetLoader.Typecolors[type]); shaperenderer.setColor(AssetLoader.Typecolors[type]);
shaperenderer.rect(this.getX() + element * 48, this.getY(), 48, shaperenderer.rect(this.getX() + element * size, this.getY(), size, 68);
68);
shaperenderer.end(); shaperenderer.end();
shaperenderer.begin(ShapeType.Line); shaperenderer.begin(ShapeType.Line);
shaperenderer.setColor(1, 1, 1, 1); shaperenderer.setColor(1, 1, 1, 1);
shaperenderer.rect(this.getX() + element * 48, this.getY(), 48, shaperenderer.rect(this.getX() + element * size, this.getY(), size, 68);
68);
shaperenderer.end(); shaperenderer.end();
batch.begin(); batch.begin();
font.draw(batch, AssetLoader.Typenames[type], this.getX() font.draw(batch, AssetLoader.Typenames[type], this.getX()+ element * size + 2, this.getY() + 69);
+ element * 48 + 2, this.getY() + 69); if (vict>0)
font2.draw(batch, String.valueOf(vict), this.getX() + element font2.draw(batch, String.valueOf(vict), this.getX() + element * size + 11, this.getY() + 35);
* 48 + 11, this.getY() + 35); else
{
font2.draw(batch, "??", this.getX() + element * size + 11, this.getY() + 35);
flag=true;
}
element += 1; element += 1;
} }
type += 1; type += 1;
} }
if (flag)
batch.draw(Next, this.getX() + element * size+11, this.getY()+15);
else if (worlds.isDebug() && element<5)
batch.draw(Add, this.getX() + element * size+11, this.getY()+15);
} }
} }

View File

@ -29,6 +29,8 @@ public class Cell implements Serializable,Cloneable {
public Object clone() { public Object clone() {
Cell result = new Cell(); Cell result = new Cell();
result.Locked=this.Locked;
result.Free=this.Free;
result.Copper=this.Copper; result.Copper=this.Copper;
result.Fiber=this.Fiber; result.Fiber=this.Fiber;
if (this.Transmuter!=null) if (this.Transmuter!=null)

View File

@ -88,15 +88,15 @@ public class LevelRenderer {
if (LevelScreen.selected != null) { if (LevelScreen.selected != null) {
font.draw(batcher2, LevelScreen.selected.level.Name, 15, 165); font.draw(batcher2, LevelScreen.selected.level.Name, 15, 165);
if (LevelScreen.selected.level.Tech > 0) if (LevelScreen.selected.level.Tech > 0 || LevelScreen.worlds.isDebug())
font.draw(batcher2, this.reward, 1215, font.draw(batcher2, this.reward, 1215,
AssetLoader.height - 15); AssetLoader.height - 15);
if (LevelScreen.selected.level.Cout_orig > 0) { if (LevelScreen.selected.level.Cout_orig > 0 || LevelScreen.worlds.isDebug()) {
font.draw(batcher2, this.ressource, 1215, 145); font.draw(batcher2, this.ressource, 1215, 145);
font.draw(batcher2, this.goal, 1215, 295); font.draw(batcher2, this.goal, 1215, 295);
} }
if (LevelScreen.selected.level.aWorld > 0) if (LevelScreen.selected.level.aWorld > 0 || LevelScreen.worlds.isDebug())
font.draw(batcher2, this.handicap, 1215, 605); font.draw(batcher2, this.handicap, 1215, 605);
//font.draw(batcher2, "", 1215, 145); //font.draw(batcher2, "", 1215, 145);
} }
@ -108,13 +108,13 @@ public class LevelRenderer {
shapeRenderer.setColor(0.5f, 0.5f, 0.5f, 0.5f); shapeRenderer.setColor(0.5f, 0.5f, 0.5f, 0.5f);
if (LevelScreen.selected != null) { if (LevelScreen.selected != null) {
shapeRenderer.rect(10, 10, 1190, 165); shapeRenderer.rect(10, 10, 1190, 165);
if (LevelScreen.selected.level.Cout_orig > 0) { if (LevelScreen.selected.level.Cout_orig > 0 || LevelScreen.worlds.isDebug()) {
shapeRenderer.rect(1210, 10, 250, 140); shapeRenderer.rect(1210, 10, 250, 140);
shapeRenderer.rect(1210, 160, 250, 140); shapeRenderer.rect(1210, 160, 250, 140);
} }
if (LevelScreen.selected.level.aWorld > 0) if (LevelScreen.selected.level.aWorld > 0 || LevelScreen.worlds.isDebug())
shapeRenderer.rect(1210, 310, 250, 300); shapeRenderer.rect(1210, 310, 250, 300);
if (LevelScreen.selected.level.Tech > 0) if (LevelScreen.selected.level.Tech > 0 || LevelScreen.worlds.isDebug())
shapeRenderer.rect(1210, 620, 250, AssetLoader.height - 630); shapeRenderer.rect(1210, 620, 250, AssetLoader.height - 630);
} }
if (!LevelScreen.MenuSolo.isVisible()) if (!LevelScreen.MenuSolo.isVisible())

View File

@ -258,7 +258,7 @@ public class GameScreen implements Screen {
cout.setPosition(1445, AssetLoader.height - 74); cout.setPosition(1445, AssetLoader.height - 74);
research = new IconValue(Icon.research,worlds, AssetLoader.Skin_level); research = new IconValue(Icon.research,worlds, AssetLoader.Skin_level);
research.setPosition(1545, AssetLoader.height - 74); research.setPosition(1545, AssetLoader.height - 74);
objectives = new Objectives(); objectives = new Objectives(worlds);
objectives.setVictory(level.Victory); objectives.setVictory(level.Victory);
objectives.setPosition(890, AssetLoader.height - 95); objectives.setPosition(890, AssetLoader.height - 95);
objectives.setVisible(level.Cout>0); objectives.setVisible(level.Cout>0);

View File

@ -46,9 +46,9 @@ public class LevelScreen implements Screen {
private Stage stage; private Stage stage;
private Table table; private Table table;
private WarnDialog dialog; private WarnDialog dialog;
private ImageButton Previous, Next, Exit, logosmall, databaseSave; private ImageButton Previous, Next, Exit, logosmall, databaseSave, adder, signer;
public Image MenuSolo, MenuMulti, MenuScenario; public Image MenuSolo, MenuMulti, MenuScenario;
private ImageTextButton cout, tech, cycle, temp, rayon, nrj; private ImageTextButton cout, tech, cycle, temp, rayon, nrj, up_cycle, up_temp, up_rayon, up_nrj, research, up;
private TextButton buttonConnect, buttonPlay, buttonStat, buttonSave, private TextButton buttonConnect, buttonPlay, buttonStat, buttonSave,
buttonApply, buttonPlaythis; buttonApply, buttonPlaythis;
private ServerList Statdata, Userdata, Gamedata; private ServerList Statdata, Userdata, Gamedata;
@ -58,6 +58,7 @@ public class LevelScreen implements Screen {
public Worlds worlds; public Worlds worlds;
private Objectives Victory; private Objectives Victory;
public ButtonLevel selected; public ButtonLevel selected;
public int addervalue;
public void play() { public void play() {
@ -71,8 +72,12 @@ public class LevelScreen implements Screen {
public void menu() { public void menu() {
selected = null; selected = null;
logosmall.setChecked(false);
worlds.DesactivateDebug();
cout.setVisible(false); cout.setVisible(false);
databaseSave.setVisible(false); databaseSave.setVisible(false);
signer.setVisible(false);
adder.setVisible(false);
tech.setVisible(false); tech.setVisible(false);
cycle.setVisible(false); cycle.setVisible(false);
temp.setVisible(false); temp.setVisible(false);
@ -147,8 +152,11 @@ public class LevelScreen implements Screen {
} }
public void level() { public void level() {
if (worlds.isDebug()) if (worlds.isDebug()) {
databaseSave.setVisible(true); databaseSave.setVisible(true);
adder.setVisible(true);
signer.setVisible(true);
}
Exit.setPosition(1110, AssetLoader.height - Exit.getHeight() - 5); Exit.setPosition(1110, AssetLoader.height - Exit.getHeight() - 5);
MenuSolo.setVisible(false); MenuSolo.setVisible(false);
MenuMulti.setVisible(false); MenuMulti.setVisible(false);
@ -253,6 +261,7 @@ public class LevelScreen implements Screen {
public LevelScreen(Worlds aworlds) { public LevelScreen(Worlds aworlds) {
this.worlds = aworlds; this.worlds = aworlds;
addervalue=1;
worlds.addListener(new ChangeListener() { worlds.addListener(new ChangeListener() {
@Override @Override
public void changed(ChangeEvent event, Actor actor) { public void changed(ChangeEvent event, Actor actor) {
@ -363,6 +372,7 @@ public class LevelScreen implements Screen {
logosmall.setChecked(worlds.isDebug()); logosmall.setChecked(worlds.isDebug());
logosmall.addListener(new ClickListener() { logosmall.addListener(new ClickListener() {
public void clicked(InputEvent event, float x, float y) { public void clicked(InputEvent event, float x, float y) {
if (!MenuSolo.isVisible())
if (logosmall.isChecked()) { if (logosmall.isChecked()) {
if (buttonLevels != null) if (buttonLevels != null)
for (int j = 0; j < 10; j++) { for (int j = 0; j < 10; j++) {
@ -372,6 +382,9 @@ public class LevelScreen implements Screen {
worlds.ActivateDebug(); worlds.ActivateDebug();
Next.setVisible(!worlds.isRealLastWorld()); Next.setVisible(!worlds.isRealLastWorld());
databaseSave.setVisible(true); databaseSave.setVisible(true);
adder.setVisible(true);
signer.setVisible(true);
showlevel(selected);
} }
else { else {
if (buttonLevels != null) if (buttonLevels != null)
@ -383,7 +396,11 @@ public class LevelScreen implements Screen {
worlds.updateUnlockLevels(); worlds.updateUnlockLevels();
worlds.setMaxWorldLevel(); worlds.setMaxWorldLevel();
databaseSave.setVisible(false); databaseSave.setVisible(false);
adder.setVisible(false);
signer.setVisible(false);
} }
else
logosmall.setChecked(false);
} }
}); });
TextDescriptive = new TextArea("Descriptif", AssetLoader.Skin_level, TextDescriptive = new TextArea("Descriptif", AssetLoader.Skin_level,
@ -509,6 +526,47 @@ public class LevelScreen implements Screen {
+ String.valueOf(worlds.getMaxWorlds())); + String.valueOf(worlds.getMaxWorlds()));
} }
}); });
signer = new ImageButton(AssetLoader.Skin_level, "add");
signer.setPosition(1660, 40);
signer.setVisible(false);
signer.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
String whereis=signer.getStyle().up.toString();
ImageButton.ImageButtonStyle imagebuttonstyle;
if (whereis.equals("add")) {
imagebuttonstyle=AssetLoader.Skin_level.get("sub", ImageButton.ImageButtonStyle.class);
addervalue=-Math.abs(addervalue);
}
else
{
imagebuttonstyle=AssetLoader.Skin_level.get("add", ImageButton.ImageButtonStyle.class);
addervalue=Math.abs(addervalue);
}
signer.setStyle(imagebuttonstyle);
}
});
adder = new ImageButton(AssetLoader.Skin_level, "add1");
adder.setPosition(1720, 40);
adder.setVisible(false);
adder.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
String whereis=adder.getStyle().up.toString();
if (whereis.equals("add1"))
addervalue=(int)(10*Math.signum(addervalue));
else if (whereis.equals("add10"))
addervalue=(int)(100*Math.signum(addervalue));
else if (whereis.equals("add100"))
addervalue=(int)(1000*Math.signum(addervalue));
else if (whereis.equals("add1000"))
addervalue=(int)(10000*Math.signum(addervalue));
else
addervalue=1;
ImageButton.ImageButtonStyle imagebuttonstyle=AssetLoader.Skin_level.get("add"+String.valueOf(Math.abs(addervalue)), ImageButton.ImageButtonStyle.class);
adder.setStyle(imagebuttonstyle);
}
});
databaseSave = new ImageButton(AssetLoader.Skin_level, "database-save"); databaseSave = new ImageButton(AssetLoader.Skin_level, "database-save");
databaseSave.setPosition(1820, 40); databaseSave.setPosition(1820, 40);
databaseSave.setVisible(false); databaseSave.setVisible(false);
@ -520,20 +578,200 @@ public class LevelScreen implements Screen {
}); });
cout = new ImageTextButton("5", AssetLoader.Skin_level, "cout"); cout = new ImageTextButton("5", AssetLoader.Skin_level, "cout");
cout.setPosition(1250, 48); cout.setPosition(1250, 48);
cout.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
if (worlds.isDebug()) {
selected.level.Cout_orig+=addervalue;
selected.level.Cout_orig=Math.max(0, Math.min(100000,selected.level.Cout_orig));
cout.setText(String.valueOf(selected.level.Cout_orig));
}
}
});
tech = new ImageTextButton("10", AssetLoader.Skin_level, "tech"); tech = new ImageTextButton("10", AssetLoader.Skin_level, "tech");
tech.setPosition(1365, 48); tech.setPosition(1365, 48);
tech.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
if (worlds.isDebug()) {
selected.level.Tech+=addervalue;
selected.level.Tech=Math.max(-1, Math.min(12,selected.level.Tech));
tech.setText(String.valueOf(selected.level.Tech));
}
}
});
temp = new ImageTextButton("10", AssetLoader.Skin_level, "temp"); temp = new ImageTextButton("10", AssetLoader.Skin_level, "temp");
temp.setPosition(1365, 360); temp.setPosition(1365, 360);
temp.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
if (worlds.isDebug()) {
selected.level.Maxtemp+=addervalue;
selected.level.Maxtemp=Math.max(0, Math.min(100000,selected.level.Maxtemp));
temp.setText(String.valueOf(selected.level.Maxtemp));
}
}
});
cycle = new ImageTextButton("10", AssetLoader.Skin_level, "cycle"); cycle = new ImageTextButton("10", AssetLoader.Skin_level, "cycle");
cycle.setPosition(1250, 360); cycle.setPosition(1250, 360);
cycle.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
if (worlds.isDebug()) {
selected.level.Maxcycle+=addervalue;
selected.level.Maxcycle=Math.max(0, Math.min(100000,selected.level.Maxcycle));
cycle.setText(String.valueOf(selected.level.Maxcycle));
}
}
});
nrj = new ImageTextButton("10", AssetLoader.Skin_level, "nrj"); nrj = new ImageTextButton("10", AssetLoader.Skin_level, "nrj");
nrj.setPosition(1365, 490); nrj.setPosition(1365, 490);
nrj.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
if (worlds.isDebug()) {
selected.level.Maxnrj+=addervalue;
selected.level.Maxnrj=Math.max(0, Math.min(100000,selected.level.Maxnrj));
nrj.setText(String.valueOf(selected.level.Maxnrj));
}
}
});
rayon = new ImageTextButton("10", AssetLoader.Skin_level, "rayon"); rayon = new ImageTextButton("10", AssetLoader.Skin_level, "rayon");
rayon.setPosition(1250, 490); rayon.setPosition(1250, 490);
rayon.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
if (worlds.isDebug()) {
selected.level.Maxrayon+=addervalue;
selected.level.Maxrayon=Math.max(0, Math.min(100000,selected.level.Maxrayon));
rayon.setText(String.valueOf(selected.level.Maxrayon));
}
}
});
up_cycle = new ImageTextButton("10", AssetLoader.Skin_level, "up_cycle");
up_cycle.setPosition(1250, AssetLoader.height-250);
up_cycle.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
if (worlds.isDebug()) {
}
}
});
up_nrj = new ImageTextButton("10", AssetLoader.Skin_level, "up_nrj");
up_nrj.setPosition(1365, AssetLoader.height-120);
up_nrj.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
if (worlds.isDebug()) {
}
}
});
up_rayon = new ImageTextButton("10", AssetLoader.Skin_level, "up_rayon");
up_rayon.setPosition(1250, AssetLoader.height-120);
up_rayon.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
if (worlds.isDebug()) {
}
}
});
up_temp = new ImageTextButton("10", AssetLoader.Skin_level, "up_temp");
up_temp.setPosition(1365, AssetLoader.height-250);
up_temp.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
if (worlds.isDebug()) {
}
}
});
up = new ImageTextButton("10", AssetLoader.Skin_level, "up");
up.setPosition(1250, AssetLoader.height-380);
up.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
if (worlds.isDebug()) {
}
}
});
research = new ImageTextButton("10", AssetLoader.Skin_level, "research");
research.setPosition(1365, AssetLoader.height-380);
research.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
if (worlds.isDebug()) {
}
}
});
Gdx.app.debug("wirechem-LevelScreen", "Conditions de victoire."); Gdx.app.debug("wirechem-LevelScreen", "Conditions de victoire.");
Victory = new Objectives(); Victory = new Objectives(worlds);
Victory.setVictory(new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }); Victory.setVictory(new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 });
Victory.setPosition(1216, 185); Victory.setPosition(1216, 185);
Victory.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
if (worlds.isDebug()) {
int clicked=(int) (x/Victory.size+1);
int initialclicked=clicked;
Gdx.app.debug("wirechem-objectives","Element cliqué:"+clicked);
boolean flag=false;
for(int i=0;i<Victory.Victory.length;i++) {
if (Victory.Victory[i]>0 || Victory.Victory[i]<0) {
clicked--;
if (clicked<=0) {
if (Victory.Victory[i]<0)
Victory.Victory[i]++;
clicked=i;
flag=true;
break;
}
}
}
if (flag==true) {
Victory.Victory[clicked]+=addervalue;
if (clicked<=6)
Victory.Victory[clicked]=Math.max(0, Math.min(10,Victory.Victory[clicked]));
else if (clicked==7)
Victory.Victory[clicked]=Math.max(0, Math.min(2,Victory.Victory[clicked]));
else if (clicked==8)
Victory.Victory[clicked]=Math.max(0, Math.min(8,Victory.Victory[clicked]));
else if (clicked==9)
Victory.Victory[clicked]=Math.max(0, Math.min(8,Victory.Victory[clicked]));
else
Victory.Victory[clicked]=Math.max(0, Math.min(25,Victory.Victory[clicked]));
}
else
{
for(int i=0;i<Victory.Victory.length;i++)
{
if (Victory.Victory[i]<0)
{
flag=true;
Victory.Victory[i]=0;
continue;
}
if (flag && Victory.Victory[i]==0)
{
Victory.Victory[i]=-1;
return;
}
}
if (!flag && initialclicked<=5)
for(int i=0;i<Victory.Victory.length;i++)
if (Victory.Victory[i]==0) {
Victory.Victory[i]=-1;
break;
}
}
}
}
});
String url = "http://evolving.fr/servers/list.xml"; String url = "http://evolving.fr/servers/list.xml";
Statdata = new ServerList(url, Base.datatype.statdata, Statdata = new ServerList(url, Base.datatype.statdata,
AssetLoader.Skin_ui); AssetLoader.Skin_ui);
@ -617,6 +855,14 @@ public class LevelScreen implements Screen {
stage.addActor(Worlddata); stage.addActor(Worlddata);
stage.addActor(Worlddatalabel); stage.addActor(Worlddatalabel);
stage.addActor(databaseSave); stage.addActor(databaseSave);
stage.addActor(adder);
stage.addActor(signer);
stage.addActor(up);
stage.addActor(up_nrj);
stage.addActor(up_cycle);
stage.addActor(up_temp);
stage.addActor(up_rayon);
stage.addActor(research);
Gdx.input.setInputProcessor(stage); Gdx.input.setInputProcessor(stage);
Gdx.app.debug("wirechem-LevelScreen", "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.setLooping(true);
@ -645,37 +891,37 @@ public class LevelScreen implements Screen {
return; return;
Gdx.app.debug("wirechem-LevelScreen", "Reading button " + button.level.Name); Gdx.app.debug("wirechem-LevelScreen", "Reading button " + button.level.Name);
TextDescriptive.setText(button.level.Description); TextDescriptive.setText(button.level.Description);
if (button.level.Maxcycle < 99999 && button.level.Maxcycle > 0) { if (button.level.Maxcycle < 99999 && button.level.Maxcycle > 0 || worlds.isDebug()) {
cycle.setText(String.valueOf(button.level.Maxcycle)); cycle.setText(String.valueOf(button.level.Maxcycle));
cycle.setVisible(true); cycle.setVisible(true);
} else } else
cycle.setVisible(false); cycle.setVisible(false);
if (button.level.Maxtemp < 99999 && button.level.Maxtemp > 0) { if (button.level.Maxtemp < 99999 && button.level.Maxtemp > 0 || worlds.isDebug()) {
temp.setText(String.valueOf(button.level.Maxtemp)); temp.setText(String.valueOf(button.level.Maxtemp));
temp.setVisible(true); temp.setVisible(true);
} else } else
temp.setVisible(false); temp.setVisible(false);
if (button.level.Maxnrj < 99999 && button.level.Maxnrj > 0) { if (button.level.Maxnrj < 99999 && button.level.Maxnrj > 0 || worlds.isDebug()) {
nrj.setText(String.valueOf(button.level.Maxnrj)); nrj.setText(String.valueOf(button.level.Maxnrj));
nrj.setVisible(true); nrj.setVisible(true);
} else } else
nrj.setVisible(false); nrj.setVisible(false);
if (button.level.Maxrayon < 99999 && button.level.Maxrayon > 0) { if (button.level.Maxrayon < 99999 && button.level.Maxrayon > 0 || worlds.isDebug()) {
rayon.setText(String.valueOf(button.level.Maxrayon)); rayon.setText(String.valueOf(button.level.Maxrayon));
rayon.setVisible(true); rayon.setVisible(true);
} else } else
rayon.setVisible(false); rayon.setVisible(false);
if (button.level.Cout_orig > 0) { if (button.level.Cout_orig > 0 || worlds.isDebug()) {
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);
if (button.level.Tech >= 1) { if (button.level.Tech >= 1 || worlds.isDebug()) {
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);
Victory.setVisible(button.level.Cout_orig > 0); Victory.setVisible(button.level.Cout_orig > 0 || worlds.isDebug());
Victory.setVictory(button.level.Victory_orig); Victory.setVictory(button.level.Victory_orig);
if (selected != null) if (selected != null)
selected.setChecked(false); selected.setChecked(false);