Ajout de la boite de dialogue explicative du fonctionnement du jeux comme la suggere John
This commit is contained in:
parent
e48d32edb1
commit
c7b6721bd1
|
@ -6,4 +6,6 @@
|
||||||
<string name="textInfo"></string>
|
<string name="textInfo"></string>
|
||||||
<string name="version">0.1</string>
|
<string name="version">0.1</string>
|
||||||
<string name="server_down">Il y a actuellement un probleme avec le serveur. Veuillez re-essayer dans quelque minutes.</string>
|
<string name="server_down">Il y a actuellement un probleme avec le serveur. Veuillez re-essayer dans quelque minutes.</string>
|
||||||
|
<string name="basegame_title">Le principe du jeu</string>
|
||||||
|
<string name="basegame_explication">Choisissez l\'association qui lie le plus convenablement les mots apparaissant successivement au mot cible en haut de l\'écran. Optez pour la poubelle si aucune relation vous convient.</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -86,8 +86,36 @@ public class BaseGame extends Activity implements OnClickListener {
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
if (gameJson == null) game = (DownloadedBaseGame)network.getGames(1);
|
if (gameJson == null) game = (DownloadedBaseGame)network.getGames(1);
|
||||||
else game = gson.fromJson(gameJson, DownloadedBaseGame.class);
|
else game = gson.fromJson(gameJson, DownloadedBaseGame.class);
|
||||||
runMatch();
|
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
start();
|
Boolean first = sp.getBoolean(Constant.FIRST_TIME, true);
|
||||||
|
if (first) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
|
builder.setTitle(getString(R.string.basegame_title))
|
||||||
|
.setIcon(android.R.drawable.ic_dialog_info)
|
||||||
|
.setMessage(getString(R.string.basegame_explication))
|
||||||
|
.setCancelable(false)
|
||||||
|
.setNegativeButton("Fermez", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
dialog.cancel();
|
||||||
|
runMatch();
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setPositiveButton("Ne plus afficher", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
||||||
|
sp.edit().putBoolean(Constant.FIRST_TIME, false).commit();
|
||||||
|
dialog.cancel();
|
||||||
|
runMatch();
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
} else {
|
||||||
|
runMatch();
|
||||||
|
start();
|
||||||
|
}
|
||||||
} catch (PtiClicException e) {
|
} catch (PtiClicException e) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
builder.setTitle(getString(R.string.app_name))
|
builder.setTitle(getString(R.string.app_name))
|
||||||
|
|
|
@ -15,4 +15,7 @@ public class Constant {
|
||||||
// Constant pour les intents
|
// Constant pour les intents
|
||||||
public static final String SCORE_GAMEPLAYED = "SCORE_INTENT";
|
public static final String SCORE_GAMEPLAYED = "SCORE_INTENT";
|
||||||
public static final String SCORE_MODE = "SCORE_MODE";
|
public static final String SCORE_MODE = "SCORE_MODE";
|
||||||
|
|
||||||
|
// Constant pour BaseGame
|
||||||
|
public static final String FIRST_TIME = "FIRST_TIME";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user