feat: ajout d'options pour la grille et d'une icone modification comportement de la grille ajout de multiples traductions

This commit is contained in:
Nicolas Hordé 2016-01-25 21:42:31 +01:00
parent e64c410598
commit 6fc66860ed
9 changed files with 132 additions and 91 deletions

View File

@ -4,6 +4,7 @@ import java.lang.reflect.InvocationTargetException;
import java.util.Timer;
import java.util.TimerTask;
import com.badlogic.gdx.Application;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.Batch;
@ -19,6 +20,7 @@ import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.ChangeEvent;
import com.badlogic.gdx.utils.reflect.Method;
import fr.evolving.assets.AssetLoader;
import fr.evolving.assets.Preference;
import fr.evolving.screens.GameScreen;
import fr.evolving.screens.GameScreen.calling;
@ -105,9 +107,10 @@ public class HorizBarre extends Actor {
}
});
}
Barre[15].setChecked(Gdx.graphics.isFullscreen());
Barre[16].setChecked(AssetLoader.intro.getVolume() > 0);
Barre[17].setChecked(AssetLoader.Tooltipmanager.enabled == true);
Barre[15].setChecked(Preference.prefs.getBoolean("Fullscreen"));
Barre[16].setChecked(Preference.prefs.getBoolean("Sound"));
Barre[17].setChecked(Preference.prefs.getBoolean("Tutorial"));
Barre[18].setChecked(Preference.prefs.getBoolean("Grid"));
table = new HorizontalGroup();
table.bottom().padLeft(5f).padBottom(8f).space(10f);
this.setTouchable(Touchable.enabled);

View File

@ -94,8 +94,7 @@ public class Menu extends Actor {
@Override
public void clicked(InputEvent event, float x, float y) {
Vector2 coords = screentoworld(x, y);
MapProperties tile = getMenubyTile((int) coords.x,
(int) coords.y);
MapProperties tile = getMenubyTile((int) coords.x,(int) coords.y);
if (tile != null && tile.containsKey("name")) {
selected_transmuter=null;
EraseSurtile();
@ -266,8 +265,8 @@ public class Menu extends Actor {
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(54));
/*if (i == 0)
cell.setTile(AssetLoader.tileSet.getTile(54));*/
layer.setCell(x, y, cell);
}
}
@ -356,7 +355,7 @@ public class Menu extends Actor {
public MapProperties getMenubyTile(int x, int y) {
Cell cell = ((TiledMapTileLayer) map[selpage][seltype].getLayers().get(0)).getCell(x, y);
if (cell != null)
if (cell != null && cell.getTile()!=null)
return cell.getTile().getProperties();
else
return null;

View File

@ -38,6 +38,7 @@ public class TouchMaptiles extends Actor implements GestureListener,InputProcess
private float viewwidth, viewheight, decx, decy;
private String selected;
private boolean mapexit;
private int clearsprite;
public TouchMaptiles(Level level, int sizex, int sizey) {
this.level = level;
@ -105,6 +106,15 @@ public class TouchMaptiles extends Actor implements GestureListener,InputProcess
this.selected=selected;
}
public void setClearsprite(int sprite) {
this.clearsprite=sprite;
}
public int getClearsprite() {
return this.clearsprite;
}
public Vector2 screentoworld(float x, float y) {
x = (int) ((x / AssetLoader.width * camera.viewportWidth) + decx);
y = (int) ((y / AssetLoader.height * camera.viewportHeight) + decy);
@ -141,7 +151,7 @@ public class TouchMaptiles extends Actor implements GestureListener,InputProcess
}
}
public void redraw(int tile) {
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,
@ -149,7 +159,7 @@ public class TouchMaptiles extends Actor implements GestureListener,InputProcess
((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(tile));
(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++) {

View File

@ -13,12 +13,12 @@ public class WarnDialog extends Dialog {
Label thelabel;
public WarnDialog(Skin skin) {
super("Informations", skin);
super(AssetLoader.language.get("[dialog-window]"), skin);
// TODO Auto-generated constructor stub
this.getContentTable()
.add(new ImageButton(AssetLoader.Skin_level, "Warnerbros"))
.left();
thelabel = new Label("MenuScenario", AssetLoader.Skin_level);
thelabel = new Label("", AssetLoader.Skin_level);
this.getContentTable().add(thelabel).right();
this.setModal(true);
this.button("Ok");

View File

@ -185,15 +185,7 @@ public class AssetLoader {
}
}
}
Gdx.app.debug("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"));
if (Preference.prefs.getBoolean("Language"))
language = french;
else
language = usa;
I18NBundle.setExceptionOnMissingKey(true);
Gdx.app.debug("AssetLoader", "Ajout des transmuters");
allTransmuter = new Array<Transmuter>();
allTransmuter.add(new Positiver(null));
@ -299,9 +291,18 @@ public class AssetLoader {
}
public static void load() {
Gdx.app.debug("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"));
if (Preference.prefs.getBoolean("Language"))
language = french;
else
language = usa;
I18NBundle.setExceptionOnMissingKey(true);
Gdx.app.debug("AssetLoader", "Réglage de la qualité des textures");
quality = GameScreen.quality.values()[Preference.prefs
.getInteger("Quality")].getQuality();
quality = GameScreen.quality.values()[Preference.prefs.getInteger("Quality")].getQuality();
Gdx.app.debug("AssetLoader", "Chargements des éléments minimalistes");
Texture_logo = new Texture(Gdx.files.internal("pictures/logo.png"),
quality == TextureFilter.MipMap);

View File

@ -50,6 +50,7 @@ public class Preference {
Preference.prefs.putBoolean("Refresh", false);
Preference.prefs.putBoolean("Animation", true);
Preference.prefs.putBoolean("Language", false);
Preference.prefs.putBoolean("Grid", false);
Preference.prefs.putString("world", "test pour voir");
Preference.prefs.putFloat("Effect", 1.0f);
Preference.prefs.putFloat("Music", 0.75f);

View File

@ -25,8 +25,17 @@ public class LevelRenderer {
Laser Laser;
public TextureRegion Texture_logobig;
BitmapFont font;
String reward,goal,ressource,handicap;
public LevelRenderer(LevelScreen LevelScreen) {
this.reward=AssetLoader.language.get("[reward-levelscreen]");
this.goal=AssetLoader.language.get("[goal-levelscreen]");
this.ressource=AssetLoader.language.get("[ressource-levelscreen]");
this.handicap=AssetLoader.language.get("[handicap-levelscreen]");
this.LevelScreen = LevelScreen;
this.scrollx = 0;
this.scrolly = 0;
@ -84,15 +93,15 @@ public class LevelRenderer {
if (LevelScreen.selected != null) {
font.draw(batcher2, LevelScreen.selected.level.Name, 15, 145);
if (LevelScreen.selected.level.Tech > 0)
font.draw(batcher2, "Recompenses", 1215,
font.draw(batcher2, this.reward, 1215,
AssetLoader.height - 15);
if (LevelScreen.selected.level.Cout > 0) {
font.draw(batcher2, "Ressources", 1215, 145);
font.draw(batcher2, "Objectifs", 1215, 295);
font.draw(batcher2, this.ressource, 1215, 145);
font.draw(batcher2, this.goal, 1215, 295);
}
if (LevelScreen.selected.level.aWorld > 0)
font.draw(batcher2, "Handicaps", 1215, 605);
font.draw(batcher2, this.handicap, 1215, 605);
font.draw(batcher2, "", 1215, 145);
}
batcher2.end();

View File

@ -79,7 +79,7 @@ public class GameScreen implements Screen {
public Level level;
private Window winOptions, winSave;
private CheckBox SetSound, SetVsynch, SetFullscreen, SetAnimation, Settuto,
Setdebog, Setrefresh;
Setdebog, Setgrid, Setrefresh;
private Slider SetEffectvolume, SetMusicvolume;
private TextButton Setcancel, Setsave;
private SelectBox<resolutions> selResolution;
@ -93,7 +93,7 @@ public class GameScreen implements Screen {
info_cout, info_tech, info_research, info_activation;
String[] tocreate = { "run", "stop", "speed", "separator", "move#", "zoomp#",
"zoomm#", "infos#", "separator", "raz", "save", "levels", "tree",
"exits", "separator", "screen", "sound", "tuto", "settings",
"exits", "separator", "screen", "sound", "tuto", "grid", "settings",
"separator", "stat" };
private ButtonLevel buttonlevel;
private Objectives objectives;
@ -111,8 +111,8 @@ public class GameScreen implements Screen {
};
public enum quality {
Bas("Bas", TextureFilter.Nearest), Moyen("Moyen", TextureFilter.MipMap), Eleve(
"Eleve", TextureFilter.Linear);
Bas(AssetLoader.language.get("[quality-gamescreen-low]"), TextureFilter.Nearest), Moyen(AssetLoader.language.get("[quality-gamescreen-medium]"), TextureFilter.MipMap), Eleve(
AssetLoader.language.get("[quality-gamescreen-high]"), TextureFilter.Linear);
private final String text;
private final TextureFilter aquality;
@ -132,7 +132,7 @@ public class GameScreen implements Screen {
};
public enum adaptation {
fit("Aspect conserve"), fill("Remplissage");
fit(AssetLoader.language.get("[adaptation-gamescreen-fit]")), fill(AssetLoader.language.get("[adaptation-gamescreen-fill]"));
private final String text;
private adaptation(final String text) {
@ -169,7 +169,7 @@ public class GameScreen implements Screen {
@Override
public String toString() {
if (full)
return text + " Fullscreen";
return text + " "+AssetLoader.language.get("[resolutions-gamescreen-fullscreen]");
else
return text;
}
@ -223,7 +223,7 @@ public class GameScreen implements Screen {
Gdx.app.debug("Barre", "Element changé");
hideInfo();
map.tempclear();
map.fillempty(60);
//map.fillempty(60);
menu.unSelect();
map.setSelected(getselected());
}
@ -280,7 +280,7 @@ public class GameScreen implements Screen {
GameScreen.this.level.Grid = GameScreen.this.level.Grid_orig;
level.Grid.tiling_copper();
level.Grid.tiling_transmuter();
map.redraw(53);
map.redraw();
buttonlevel.setChecked(false);
}
});
@ -335,8 +335,12 @@ public class GameScreen implements Screen {
dialog = new WarnDialog(AssetLoader.Skin_ui);
Gdx.app.debug(getClass().getSimpleName(), "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(53);
map.redraw();
Gdx.app.debug(getClass().getSimpleName(), "Création du menu");
nextpage=new ImageButton(AssetLoader.Skin_level,"extend");
@ -348,7 +352,7 @@ public class GameScreen implements Screen {
menu.NextPage();
Gdx.app.debug("menu", "Page suivante:"+menu.getPage());
map.tempclear();
map.fillempty(53);
//map.fillempty(53);
hideInfo();
nextpage.setDisabled(menu.isNextEmpty());
previouspage.setDisabled(menu.isPreviousEmpty());
@ -364,7 +368,7 @@ public class GameScreen implements Screen {
menu.PreviousPage();
Gdx.app.debug("menu", "Page précédente:"+menu.getPage());
map.tempclear();
map.fillempty(53);
//map.fillempty(53);
hideInfo();
nextpage.setDisabled(menu.isNextEmpty());
previouspage.setDisabled(menu.isPreviousEmpty());
@ -379,7 +383,7 @@ public class GameScreen implements Screen {
Gdx.app.debug("Menu", "Element changé");
hideInfo();
map.tempclear();
map.fillempty(60);
//map.fillempty(60);
if (menu.getTransmuter() != null)
showInfo(menu.getTransmuter());
else
@ -458,8 +462,8 @@ public class GameScreen implements Screen {
.clone();
if (alone)
level.Grid.tiling_transmuter();
map.redraw(60);
Gdx.input.vibrate(new long[] { 0, 400, 500, 400 }, -1);
map.redraw();
Gdx.input.vibrate(new long[] { 0, 200, 200, 200 }, -1);
}
}
@ -533,7 +537,7 @@ public class GameScreen implements Screen {
map_copper_eraser(0, 0, x, y, false, button, call);
}
level.Grid.tiling_copper();
map.redraw(60);
map.redraw();
}
public void map_all_eraser(float realx, float realy, int x, int y, boolean alone,
@ -556,7 +560,7 @@ public class GameScreen implements Screen {
}
if (alone) {
level.Grid.tiling_transmuter();
map.redraw(60);
map.redraw();
}
}
@ -566,7 +570,7 @@ public class GameScreen implements Screen {
level.Grid.GetXY(x, y).Fiber = 0;
if (alone) {
level.Grid.tiling_copper();
map.redraw(60);
map.redraw();
}
}
}
@ -578,7 +582,7 @@ public class GameScreen implements Screen {
+ 1;
if (alone) {
level.Grid.tiling_copper();
map.redraw(60);
map.redraw();
}
}
@ -588,7 +592,7 @@ public class GameScreen implements Screen {
level.Grid.GetXY(x, y).Fiber = 1;
if (alone) {
level.Grid.tiling_copper();
map.redraw(60);
map.redraw();
}
}
@ -598,7 +602,7 @@ public class GameScreen implements Screen {
level.Grid.GetXY(x, y).Copper = false;
if (alone) {
level.Grid.tiling_copper();
map.redraw(60);
map.redraw();
}
}
}
@ -609,7 +613,7 @@ public class GameScreen implements Screen {
level.Grid.GetXY(x, y).Copper = !level.Grid.GetXY(x, y).Copper;
if (alone) {
level.Grid.tiling_copper();
map.redraw(60);
map.redraw();
}
}
@ -619,7 +623,7 @@ public class GameScreen implements Screen {
level.Grid.GetXY(x, y).Copper = true;
if (alone) {
level.Grid.tiling_copper();
map.redraw(60);
map.redraw();
}
}
@ -696,7 +700,7 @@ public class GameScreen implements Screen {
}
public void preparebarre(String caller, int count) {
map.fillempty(53);
//map.fillempty(53);
map.tempclear();
menu.EraseSurtile();
hideInfo();
@ -764,6 +768,17 @@ public class GameScreen implements Screen {
Gdx.app.debug("Barre", "marche tuto.");
AssetLoader.Tooltipmanager.enabled = true;
}
} else if (caller=="grid") {
if (map.getClearsprite()==53)
{
map.fillempty(60);
map.setClearsprite(60);
}
else
{
map.fillempty(53);
map.setClearsprite(53);
}
} else if (caller == "settings") {
winOptions.setVisible(!winOptions.isVisible());
winSave.setVisible(false);
@ -784,7 +799,7 @@ public class GameScreen implements Screen {
public void preparemenu(int menuitem) {
map.tempclear();
map.fillempty(53);
//map.fillempty(53);
horizbar.unSelect();
menu.setPageType(0,menuitem);
nextpage.setDisabled(menu.isNextEmpty());
@ -855,7 +870,7 @@ public class GameScreen implements Screen {
}
public Table Createsaving() {
winSave = new Window("Saved grids", AssetLoader.Skin_ui);
winSave = new Window(AssetLoader.language.get("[winSave-gamescreen]"), AssetLoader.Skin_ui);
winSave.add(savingPanel()).row();
winSave.setColor(1, 1, 1, 0.8f);
winSave.setVisible(false);
@ -875,7 +890,9 @@ public class GameScreen implements Screen {
level.id, selSaved.getSelectedIndex());
level.Grid.tiling_copper();
level.Grid.tiling_transmuter();
map.redraw(53);
map.redraw();
map.tempclear();
hideInfo();
}
});
ScrollPane scroll = new ScrollPane(selSaved);
@ -891,7 +908,7 @@ public class GameScreen implements Screen {
}
public Table Createoption() {
winOptions = new Window("Options", AssetLoader.Skin_ui);
winOptions = new Window(AssetLoader.language.get("[winOptions-gamescreen]"), AssetLoader.Skin_ui);
winOptions.add(SettingsVideo()).row();
winOptions.add(SettingsAudio()).row();
winOptions.add(SettingsOther()).row();
@ -912,6 +929,7 @@ public class GameScreen implements Screen {
SetAnimation.setChecked(Preference.prefs.getBoolean("Animation"));
Setflag.setChecked(Preference.prefs.getBoolean("Language"));
SetEffectvolume.setValue(Preference.prefs.getFloat("Effect"));
Setgrid.setChecked(Preference.prefs.getBoolean("Grid"));
SetMusicvolume.setValue(Preference.prefs.getFloat("Music"));
selResolution.setSelectedIndex(Preference.prefs.getInteger("Resolution"));
selAdaptscreen.setSelectedIndex(Preference.prefs.getInteger("Adaptation"));
@ -925,6 +943,7 @@ public class GameScreen implements Screen {
Preference.prefs.putInteger("Resolution", selResolution.getSelectedIndex());
Preference.prefs.putBoolean("Fullscreen", SetFullscreen.isChecked());
Preference.prefs.putBoolean("Sound", SetSound.isChecked());
Preference.prefs.putBoolean("Grid", Setgrid.isChecked());
Preference.prefs.putBoolean("Tutorial", Settuto.isChecked());
Preference.prefs.putBoolean("VSync", SetVsynch.isChecked());
Preference.prefs.putBoolean("Refresh", Setrefresh.isChecked());
@ -944,20 +963,23 @@ public class GameScreen implements Screen {
private Table SettingsOther() {
Table table = new Table();
table.pad(10, 10, 0, 10);
table.add(new Label("Divers", AssetLoader.Skin_level, "Fluoxetine-25",Color.ORANGE)).colspan(3);
table.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-Game]"), AssetLoader.Skin_level, "Fluoxetine-25",Color.ORANGE)).colspan(3);
table.row();
table.columnDefaults(0).padRight(10);
table.columnDefaults(1).padRight(10);
Settuto = new CheckBox("Activation du tutoriel", AssetLoader.Skin_ui);
Settuto = new CheckBox(AssetLoader.language.get("[WinOptions-gamescreen-tuto]"), AssetLoader.Skin_ui);
table.add(Settuto).left();
table.row();
Setdebog = new CheckBox("Mode debugage", AssetLoader.Skin_ui);
Setdebog = new CheckBox(AssetLoader.language.get("[WinOptions-gamescreen-debug]"), AssetLoader.Skin_ui);
table.add(Setdebog).left();
table.row();
Setrefresh = new CheckBox("Afficher le rafraichissement",AssetLoader.Skin_ui);
Setgrid = new CheckBox(AssetLoader.language.get("[WinOptions-gamescreen-grid]"),AssetLoader.Skin_ui);
table.add(Setgrid).left();
table.row();
Setrefresh = new CheckBox(AssetLoader.language.get("[WinOptions-gamescreen-refresh]"),AssetLoader.Skin_ui);
table.add(Setrefresh).left();
table.row();
table.add(new Label("Choix de la langue", AssetLoader.Skin_ui,"default-font", Color.WHITE)).left();
table.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-language]"), AssetLoader.Skin_ui,"default-font", Color.WHITE)).left();
Setflag = new ImageButton(AssetLoader.Skin_level, "Setflag");
table.add(Setflag);
table.row();
@ -967,25 +989,25 @@ public class GameScreen implements Screen {
private Table SettingsVideo() {
Table table = new Table();
table.pad(10, 10, 0, 10);
table.add(new Label("Video",AssetLoader.Skin_level, "Fluoxetine-25",Color.ORANGE)).colspan(3);
table.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-Video]"),AssetLoader.Skin_level, "Fluoxetine-25",Color.ORANGE)).colspan(3);
table.row();
table.columnDefaults(0).padRight(10);
table.columnDefaults(1).padRight(10);
SetVsynch = new CheckBox("Synchronisation verticale",AssetLoader.Skin_ui);
SetVsynch = new CheckBox(AssetLoader.language.get("[WinOptions-gamescreen-sync]"),AssetLoader.Skin_ui);
table.add(SetVsynch).left();
Table tablev1 = new Table();
tablev1.add(new Label("Resolution:", AssetLoader.Skin_ui, "default-font",Color.WHITE)).left().row();
tablev1.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-resolution]"), AssetLoader.Skin_ui, "default-font",Color.WHITE)).left().row();
selResolution = new SelectBox<resolutions>(AssetLoader.Skin_ui);
selResolution.setItems(resolutions.values());
tablev1.add(selResolution).left().row();
table.add(tablev1).left();
table.row();
SetFullscreen = new CheckBox("Plein ecran", AssetLoader.Skin_ui);
SetFullscreen = new CheckBox(AssetLoader.language.get("[WinOptions-gamescreen-full]"), AssetLoader.Skin_ui);
table.add(SetFullscreen).left();
Table tablev2 = new Table();
tablev2.add(new Label("Remplissage de l'ecran:", AssetLoader.Skin_ui,"default-font", Color.WHITE)).left().row();
tablev2.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-fill]"), AssetLoader.Skin_ui,"default-font", Color.WHITE)).left().row();
selAdaptscreen = new SelectBox<adaptation>(AssetLoader.Skin_ui);
selAdaptscreen.setItems(adaptation.values());
tablev2.add(selAdaptscreen).left().row();
@ -993,8 +1015,8 @@ public class GameScreen implements Screen {
table.row();
Table tablev3 = new Table();
tablev3.add(new Label("Qualite des textures:", AssetLoader.Skin_ui, "default-font", Color.WHITE)).left().row();
SetAnimation = new CheckBox("Activer les animations",AssetLoader.Skin_ui);
tablev3.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-quality]"), AssetLoader.Skin_ui, "default-font", Color.WHITE)).left().row();
SetAnimation = new CheckBox(AssetLoader.language.get("[WinOptions-gamescreen-animation]"),AssetLoader.Skin_ui);
table.add(SetAnimation).left();
selTexturequal = new SelectBox<quality>(AssetLoader.Skin_ui);
selTexturequal.setItems(quality.values());
@ -1022,18 +1044,18 @@ public class GameScreen implements Screen {
private Table SettingsAudio() {
Table table = new Table();
table.pad(10, 10, 0, 10);
table.add(new Label("Audio", AssetLoader.Skin_level, "Fluoxetine-25", Color.ORANGE)).colspan(3);
table.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-Audio]"), AssetLoader.Skin_level, "Fluoxetine-25", Color.ORANGE)).colspan(3);
table.row();
table.columnDefaults(0).padRight(10);
table.columnDefaults(1).padRight(10);
SetSound = new CheckBox("Activation du son", AssetLoader.Skin_ui);
SetSound = new CheckBox(AssetLoader.language.get("[WinOptions-gamescreen-sound]"), AssetLoader.Skin_ui);
table.add(SetSound).left();
table.row();
table.add(new Label("Volume des effets", AssetLoader.Skin_ui));
table.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-effect]"), AssetLoader.Skin_ui));
SetEffectvolume = new Slider(0.0f, 1.0f, 0.1f, false,AssetLoader.Skin_ui);
table.add(SetEffectvolume).left();
table.row();
table.add(new Label("Volume de la musiques", AssetLoader.Skin_ui));
table.add(new Label(AssetLoader.language.get("[WinOptions-gamescreen-music]"), AssetLoader.Skin_ui));
SetMusicvolume = new Slider(0.0f, 1.0f, 0.1f, false,AssetLoader.Skin_ui);
table.add(SetMusicvolume).left();
table.row();
@ -1044,7 +1066,7 @@ public class GameScreen implements Screen {
winOptions.setVisible(false);
writepref();
dialog.Show(
"Veuillez redémmarrer pour que les préférences soient appliquées.",
AssetLoader.language.get("[dialog-gamescreen-preference]"),
stage);
}
@ -1055,7 +1077,7 @@ public class GameScreen implements Screen {
private Table SettingsButtons() {
Table table = new Table();
table.pad(10, 10, 0, 10);
Setsave = new TextButton("Save", AssetLoader.Skin_ui);
Setsave = new TextButton(AssetLoader.language.get("[WinOptions-gamescreen-save]"), AssetLoader.Skin_ui);
table.add(Setsave).padRight(30);
Setsave.addListener(new ChangeListener() {
@Override
@ -1063,7 +1085,7 @@ public class GameScreen implements Screen {
onSaveClicked();
}
});
Setcancel = new TextButton("Cancel", AssetLoader.Skin_ui);
Setcancel = new TextButton(AssetLoader.language.get("[WinOptions-gamescreen-cancel]"), AssetLoader.Skin_ui);
table.add(Setcancel);
Setcancel.addListener(new ChangeListener() {
@Override

View File

@ -354,7 +354,7 @@ public class LevelScreen implements Screen {
TextDescriptive = new TextArea("Descriptif", AssetLoader.Skin_level,
"Descriptif");
TextDescriptive.setBounds(15, 15, 1185, 100);
buttonApply = new TextButton("Appliquer", AssetLoader.Skin_ui);
buttonApply = new TextButton(AssetLoader.language.get("[buttonApply-levelscreen]"), AssetLoader.Skin_ui);
buttonApply.setBounds(1680, 350, 190, 40);
buttonApply.addListener(new ClickListener() {
public void clicked(InputEvent event, float x, float y) {
@ -367,8 +367,7 @@ public class LevelScreen implements Screen {
Gamedata.getUrl());
if (!AssetLoader.Datahandler.verifyall()) {
dialog.Show(
"Un problème est survenu lors du changement de base de donnée.",
stage);
AssetLoader.language.get("[dialog-levelscreen-errorloading]"),stage);
initlevel();
} else
menu();
@ -387,7 +386,7 @@ public class LevelScreen implements Screen {
Worlddata.Refresh();
}
});
buttonSave = new TextButton("Sauvegarder", AssetLoader.Skin_ui);
buttonSave = new TextButton(AssetLoader.language.get("[buttonSave-levelscreen]"), AssetLoader.Skin_ui);
buttonSave.setBounds(1480, 350, 190, 40);
buttonSave.addListener(new ClickListener() {
public void clicked(InputEvent event, float x, float y) {
@ -396,11 +395,10 @@ public class LevelScreen implements Screen {
Preference.prefs.putString("gamedata", Gamedata.getUrl());
Preference.prefs.putString("statdata", Statdata.getUrl());
dialog.Show(
"Vous devez redemarrer pour bénéfier des changements.",
stage);
AssetLoader.language.get("[dialog-levelscreen-savedatabase]"),stage);
}
});
buttonConnect = new TextButton("Connexions", AssetLoader.Skin_ui);
buttonConnect = new TextButton(AssetLoader.language.get("[buttonConnect-levelscreen]"), AssetLoader.Skin_ui);
buttonConnect.setBounds(1480, AssetLoader.height - 60, 190, 40);
buttonConnect.addListener(new ClickListener() {
public void clicked(InputEvent event, float x, float y) {
@ -408,7 +406,7 @@ public class LevelScreen implements Screen {
SetButtonConnect();
}
});
buttonPlay = new TextButton("Jouer", AssetLoader.Skin_ui);
buttonPlay = new TextButton(AssetLoader.language.get("[buttonPlay-levelscreen]"), AssetLoader.Skin_ui);
buttonPlay.setBounds(1040, 20, 150, 40);
buttonPlay.addListener(new ClickListener() {
@Override
@ -417,7 +415,7 @@ public class LevelScreen implements Screen {
.setScreen(new GameScreen(selected.level));
}
});
buttonStat = new TextButton("Statistiques", AssetLoader.Skin_ui);
buttonStat = new TextButton(AssetLoader.language.get("[buttonStat-levelscreen]"), AssetLoader.Skin_ui);
buttonStat.setBounds(1710, AssetLoader.height - 60, 190, 40);
buttonStat.addListener(new ClickListener() {
public void clicked(InputEvent event, float x, float y) {
@ -425,17 +423,15 @@ public class LevelScreen implements Screen {
SetButtonStat();
}
});
buttonPlaythis = new TextButton("Jouer ce monde", AssetLoader.Skin_ui);
buttonPlaythis = new TextButton(AssetLoader.language.get("[buttonPlaythis-levelscreen]"), AssetLoader.Skin_ui);
buttonPlaythis.setBounds(1480, 50, 190, 40);
buttonPlaythis.addListener(new ClickListener() {
public void clicked(InputEvent event, float x, float y) {
if (!AssetLoader.Datahandler.verifyall())
dialog.Show(
"Impossible de jouer sans bases de données correctement configurée, cliquer sur RAZ si vous ne savez pas revenir à une situation jouable.",
stage);
dialog.Show(AssetLoader.language.get("[dialog-levelscreen-errorlevels]"),stage);
else {
if (Worlddata.getSelected() == null)
dialog.Show("Aucun monde n'a été sélectionné", stage);
dialog.Show(AssetLoader.language.get("[dialog-levelscreen-errornoworld]"), stage);
else {
Preference.prefs.putString("world",
(String) Worlddata.getSelected());
@ -503,24 +499,24 @@ public class LevelScreen implements Screen {
String url = "http://evolving.fr/servers/list.xml";
Statdata = new ServerList(url, Base.datatype.statdata,
AssetLoader.Skin_ui);
Statdatalabel = new Label("Stockage des statistiques:",
Statdatalabel = new Label(AssetLoader.language.get("[Statdatalabel-levelscreen]"),
AssetLoader.Skin_ui, "grey");
Statdata.setBounds(1480, AssetLoader.height - 250, 420, 150);
Statdatalabel.setPosition(1480, AssetLoader.height - 100);
Userdata = new ServerList(url, Base.datatype.userdata,
AssetLoader.Skin_ui);
Userdatalabel = new Label("Stockage des données du joueur:",
Userdatalabel = new Label(AssetLoader.language.get("[Userdatalabel-levelscreen]"),
AssetLoader.Skin_ui, "grey");
Userdata.setBounds(1480, AssetLoader.height - 450, 420, 150);
Userdatalabel.setPosition(1480, AssetLoader.height - 300);
Gamedata = new ServerList(url, Base.datatype.gamedata,
AssetLoader.Skin_ui);
Gamedatalabel = new Label("Stockage des données du jeu:",
Gamedatalabel = new Label(AssetLoader.language.get("[Gamedatalabel-levelscreen]"),
AssetLoader.Skin_ui, "grey");
Gamedata.setBounds(1480, AssetLoader.height - 650, 420, 150);
Gamedatalabel.setPosition(1480, AssetLoader.height - 500);
Worlddata = new Worldlist(AssetLoader.Skin_ui);
Worlddatalabel = new Label("Mondes disponibles:", AssetLoader.Skin_ui,
Worlddatalabel = new Label(AssetLoader.language.get("[Worlddatalabel-levelscreen]"), AssetLoader.Skin_ui,
"grey");
Worlddata.setBounds(1480, 100, 420, 200);
Worlddatalabel.setPosition(1480, 300);