fix: correction d'autres bogues du mode édition
This commit is contained in:
parent
68cd234b35
commit
6fd09144ea
|
@ -396,8 +396,8 @@ public class Worlds extends Actor {
|
||||||
public void NextWorld() {
|
public void NextWorld() {
|
||||||
if (state!=State.notloaded)
|
if (state!=State.notloaded)
|
||||||
if (usedworld<getMaxWorlds()) {
|
if (usedworld<getMaxWorlds()) {
|
||||||
usedlevel=null;
|
|
||||||
usedworld++;
|
usedworld++;
|
||||||
|
usedlevel=getMaxUnlockLevel();
|
||||||
onchanged(null);
|
onchanged(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -405,8 +405,8 @@ public class Worlds extends Actor {
|
||||||
public void PreviousWorld() {
|
public void PreviousWorld() {
|
||||||
if (state!=State.notloaded)
|
if (state!=State.notloaded)
|
||||||
if (usedworld>0) {
|
if (usedworld>0) {
|
||||||
usedlevel=null;
|
|
||||||
usedworld--;
|
usedworld--;
|
||||||
|
usedlevel=getMaxUnlockLevel();
|
||||||
onchanged(null);
|
onchanged(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,6 +61,7 @@ public class LevelRenderer {
|
||||||
if (this.scrolly < 0)
|
if (this.scrolly < 0)
|
||||||
this.diry = 1;
|
this.diry = 1;
|
||||||
Laser.i += 0.3f;
|
Laser.i += 0.3f;
|
||||||
|
|
||||||
if (Laser.i > 10.0f) {
|
if (Laser.i > 10.0f) {
|
||||||
Laser.i = 0;
|
Laser.i = 0;
|
||||||
}
|
}
|
||||||
|
@ -90,15 +91,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 || LevelScreen.worlds.isDebug())
|
if (LevelScreen.selected.level.Tech > 0 && !LevelScreen.worlds.isDebug() || LevelScreen.modify.isChecked() && 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 || LevelScreen.worlds.isDebug()) {
|
if (LevelScreen.selected.level.Cout_orig > 0 && !LevelScreen.worlds.isDebug() || LevelScreen.modify.isChecked() && 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 || LevelScreen.worlds.isDebug())
|
if (LevelScreen.selected.level.aWorld > 0 && !LevelScreen.worlds.isDebug() || LevelScreen.modify.isChecked() && 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);
|
||||||
}
|
}
|
||||||
|
@ -110,13 +111,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 || LevelScreen.worlds.isDebug()) {
|
if (LevelScreen.selected.level.Cout_orig > 0 && !LevelScreen.worlds.isDebug() || LevelScreen.modify.isChecked() && 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 || LevelScreen.worlds.isDebug())
|
if (LevelScreen.selected.level.aWorld > 0 && !LevelScreen.worlds.isDebug() || LevelScreen.modify.isChecked() && LevelScreen.worlds.isDebug())
|
||||||
shapeRenderer.rect(1210, 310, 250, 300);
|
shapeRenderer.rect(1210, 310, 250, 300);
|
||||||
if (LevelScreen.selected.level.Tech > 0 || LevelScreen.worlds.isDebug())
|
if (LevelScreen.selected.level.Tech > 0 && !LevelScreen.worlds.isDebug() || LevelScreen.modify.isChecked() && LevelScreen.worlds.isDebug())
|
||||||
shapeRenderer.rect(1210, 620, 250, AssetLoader.height - 630);
|
shapeRenderer.rect(1210, 620, 250, AssetLoader.height - 630);
|
||||||
}
|
}
|
||||||
if (!LevelScreen.group_init.isVisible())
|
if (!LevelScreen.group_init.isVisible())
|
||||||
|
|
|
@ -61,8 +61,9 @@ public class LevelScreen implements Screen {
|
||||||
private Stage stage;
|
private Stage stage;
|
||||||
private Table table;
|
private Table table;
|
||||||
private WarningDialog dialog;
|
private WarningDialog dialog;
|
||||||
private ImageButton Previous, Next, Exit, logosmall, databaseSave, adder, signer, finisher, deletelinker, deletebutton, addbutton, unlocked, duplicate, moveit,modify, link;
|
private ImageButton Previous, Next, Exit, logosmall, databaseSave, adder, signer, finisher, deletelinker, deletebutton, addbutton, unlocked, duplicate, moveit,link;
|
||||||
public Image MenuSolo, MenuMulti, MenuScenario;
|
public ImageButton modify;
|
||||||
|
private Image MenuSolo, MenuMulti, MenuScenario;
|
||||||
private ImageTextButton cout, tech, cycle, temp, rayon, nrj, up_cycle, up_temp, up_rayon, up_nrj, research, up;
|
private ImageTextButton cout, tech, cycle, temp, rayon, nrj, up_cycle, up_temp, up_rayon, up_nrj, research, up;
|
||||||
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;
|
||||||
|
@ -74,17 +75,17 @@ public class LevelScreen implements Screen {
|
||||||
private VerticalGroup vertibar,vertibarmod;
|
private VerticalGroup vertibar,vertibarmod;
|
||||||
public ButtonLevel selected;
|
public ButtonLevel selected;
|
||||||
public int addervalue;
|
public int addervalue;
|
||||||
public 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;
|
||||||
public ClickListener buttonLevelslistener;
|
private ClickListener buttonLevelslistener;
|
||||||
public DragAndDrop dragAndDrop;
|
private DragAndDrop dragAndDrop;
|
||||||
|
|
||||||
public void play() {
|
public void play() {
|
||||||
if (worlds.getState()!=State.notloaded && worlds.getState()!=State.databasefailed) {
|
if (worlds.getState()!=State.notloaded && worlds.getState()!=State.databasefailed) {
|
||||||
if (worlds.getWorld() < 0)
|
|
||||||
worlds.setMaxWorldLevel();
|
|
||||||
Gdx.app.debug("wirechem-LevelScreen","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();
|
worlds.Forcereload();
|
||||||
|
if (worlds.getWorld() < 0)
|
||||||
|
worlds.setMaxWorldLevel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,7 +245,10 @@ public class LevelScreen implements Screen {
|
||||||
}
|
}
|
||||||
public void clicked(InputEvent event, float x, float y) {
|
public void clicked(InputEvent event, float x, float y) {
|
||||||
ButtonLevel abutton = (ButtonLevel) event.getListenerActor();
|
ButtonLevel abutton = (ButtonLevel) event.getListenerActor();
|
||||||
abutton.setChecked(false);
|
if (!worlds.isDebug() || modify.isChecked())
|
||||||
|
abutton.setChecked(true);
|
||||||
|
else
|
||||||
|
abutton.setChecked(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -309,6 +313,9 @@ public class LevelScreen implements Screen {
|
||||||
}
|
}
|
||||||
Gdx.app.debug("wirechem-LevelScreen", "Changement - rechargement des mondes");
|
Gdx.app.debug("wirechem-LevelScreen", "Changement - rechargement des mondes");
|
||||||
loadWorld();
|
loadWorld();
|
||||||
|
if (worlds.isDebug() && modify.isChecked())
|
||||||
|
selectone();
|
||||||
|
else if (!worlds.isDebug())
|
||||||
for (ButtonLevel button : buttonLevels)
|
for (ButtonLevel button : buttonLevels)
|
||||||
{
|
{
|
||||||
button.setChecked(false);
|
button.setChecked(false);
|
||||||
|
@ -318,6 +325,8 @@ public class LevelScreen implements Screen {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
selectnoone();
|
||||||
if (worlds.getLevelData()==null)
|
if (worlds.getLevelData()==null)
|
||||||
selected=buttonLevels.first();
|
selected=buttonLevels.first();
|
||||||
Previous.setVisible(!worlds.isFirstWorld());
|
Previous.setVisible(!worlds.isFirstWorld());
|
||||||
|
@ -982,7 +991,7 @@ public class LevelScreen implements Screen {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
signer = new ImageButton(AssetLoader.Skin_level, "add");
|
signer = new ImageButton(AssetLoader.Skin_level, "add");
|
||||||
signer.setPosition(1680, 40);
|
signer.setPosition(1660, 40);
|
||||||
signer.addListener(new ClickListener() {
|
signer.addListener(new ClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void clicked(InputEvent event, float x, float y) {
|
public void clicked(InputEvent event, float x, float y) {
|
||||||
|
@ -1054,6 +1063,7 @@ public class LevelScreen implements Screen {
|
||||||
modifbar.add(link);
|
modifbar.add(link);
|
||||||
modifbar.add(modify);
|
modifbar.add(modify);
|
||||||
modifbar.add(addbutton);
|
modifbar.add(addbutton);
|
||||||
|
moveit.setChecked(true);
|
||||||
|
|
||||||
|
|
||||||
group_debug=new Group();
|
group_debug=new Group();
|
||||||
|
@ -1120,21 +1130,8 @@ public class LevelScreen implements Screen {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void selectone() {
|
public void selectone() {
|
||||||
for(ButtonLevel button: buttonLevels)
|
if (buttonLevels.size>0)
|
||||||
if (button!=null) {
|
showlevel(buttonLevels.first());
|
||||||
showlevel(button);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void selectoneunlock() {
|
|
||||||
for(ButtonLevel button: buttonLevels)
|
|
||||||
if (button!=null && button.level.Locked==false) {
|
|
||||||
showlevel(button);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void selectnoone() {
|
public void selectnoone() {
|
||||||
|
@ -1154,10 +1151,14 @@ public class LevelScreen implements Screen {
|
||||||
TextDescriptive.setText(button.level.Description);
|
TextDescriptive.setText(button.level.Description);
|
||||||
Victory.setVictory(button.level.Victory_orig);
|
Victory.setVictory(button.level.Victory_orig);
|
||||||
button.setChecked(true);
|
button.setChecked(true);
|
||||||
buttonPlay.setVisible(false);
|
buttonPlay.setVisible(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
Gdx.app.debug("wirechem-LevelScreen", "Raz button information");
|
Gdx.app.debug("wirechem-LevelScreen", "Raz button information");
|
||||||
|
buttonPlay.setVisible(false);
|
||||||
|
TextDescriptive.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);
|
||||||
|
|
Loading…
Reference in New Issue