Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67b61eceb8 | ||
|
|
df3650438b | ||
|
|
de85af4e2a | ||
|
|
b3722ed776 |
@@ -82,22 +82,9 @@
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<!-- Legacy Activities (to be removed) -->
|
||||
<!-- Legacy activities placeholder -->
|
||||
|
||||
<!-- End of game -->
|
||||
<activity
|
||||
android:name="com.example.boidelov3.Jeux"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.example.boidelov3.JeuxParametres"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.example.boidelov3.EndGameActivity"
|
||||
android:name=".EndGameActivity"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
|
||||
+118
-110
@@ -17,14 +17,14 @@
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"question": "si tu n'as pas ton véritable nom sur insta",
|
||||
"question": "Ceux/Celles qui n'ont pas leur véritable nom sur Insta",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"question": "si tu as des photos sur insta",
|
||||
"question": "Ceux/Celles qui ont des photos compromettantes sur Insta",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
@@ -45,7 +45,7 @@
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"question": "Toutes celles (ou ceux) qui ont du verni à ongles",
|
||||
"question": "Toutes celles (ou ceux) qui ont du vernis à ongles",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
@@ -80,7 +80,7 @@
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
"question": "<J1> à toi de juger : entre <J1> et <J2> qui stresse le plus pour un rien selon toi? Le perdant ",
|
||||
"question": "<J1>, à toi de juger : entre <J2> et <J3> qui stresse le plus pour un rien selon toi ? Le perdant ",
|
||||
"gorger": 5,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
@@ -101,12 +101,12 @@
|
||||
},
|
||||
{
|
||||
"id": 15,
|
||||
"question": "<J1>, donne le nombre d'habitant du/de la <variante> ( à 1 000 000 près) Si tu as faux tu bois, sinon tu ",
|
||||
"question": "<J1>, donne le nombre d'habitants du/de la <variante> (à 1 000 000 près). Si tu as faux, le joueur ",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": false,
|
||||
"variante": [
|
||||
"Tadjikistant",
|
||||
"Tadjikistan",
|
||||
"Monaco",
|
||||
"Belgique",
|
||||
"Suisse",
|
||||
@@ -126,12 +126,12 @@
|
||||
"id": 17,
|
||||
"question": "<J1> à qui appartient le slogan suivant? <variante>",
|
||||
"variante": [
|
||||
"Des pâtes oui mais des (panzani)",
|
||||
"Des pâtes oui, mais des Panzani ! (Panzani)",
|
||||
" Le plaisir pour les petites faims. (Kinder Bueno)",
|
||||
"Réveillez le lion qui est en vous. (Cereale lion)",
|
||||
"Réveillez le lion qui est en vous. (Céréales Lion)",
|
||||
"Parce que le monde bouge (CIC)",
|
||||
"Ça coule de source ! (Cristaline)",
|
||||
"Pensez différemment (apple)"
|
||||
"Pensez différemment (Apple)"
|
||||
],
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
@@ -139,14 +139,14 @@
|
||||
},
|
||||
{
|
||||
"id": 18,
|
||||
"question": "Celles et ceux qui ont eu un Windows phone",
|
||||
"question": "Celles et ceux qui ont eu un Windows Phone",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 19,
|
||||
"question": "<J1>, Boire un café fait baisser le taux d'alcool? Si tu as faux ",
|
||||
"question": "<J1>, Boire un café fait baisser le taux d'alcool ? Si tu as faux, ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
@@ -160,10 +160,10 @@
|
||||
},
|
||||
{
|
||||
"id": 21,
|
||||
"question": "Celui/Celle qui pèse le plus lourd",
|
||||
"question": "Celui/Celle qui pèse le plus <variante>",
|
||||
"variante": [
|
||||
"lourd",
|
||||
"leger"
|
||||
"léger"
|
||||
],
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
@@ -174,9 +174,9 @@
|
||||
"question": "Pour se décoincer, le/la plus <variante>",
|
||||
"variante": [
|
||||
"timide",
|
||||
"enervé ",
|
||||
"angoissé",
|
||||
"aigri"
|
||||
"énervé(e)",
|
||||
"angoissé(e)",
|
||||
"aigri(e)"
|
||||
],
|
||||
"gorger": 2,
|
||||
"distribution": false,
|
||||
@@ -188,7 +188,7 @@
|
||||
"gorger": 3,
|
||||
"variante": [
|
||||
"jeune",
|
||||
"vieille"
|
||||
"vieux/vieille"
|
||||
],
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
@@ -200,7 +200,7 @@
|
||||
"variante": [
|
||||
"L",
|
||||
"Scientifique",
|
||||
"Bac Professionel",
|
||||
"Bac Professionnel",
|
||||
"STMG"
|
||||
],
|
||||
"distribution": true,
|
||||
@@ -208,7 +208,7 @@
|
||||
},
|
||||
{
|
||||
"id": 25,
|
||||
"question": "Celles et ceux qui ont deja joué <variante> de maniere recurrente ",
|
||||
"question": "Celles et ceux qui ont déjà joué <variante> de manière récurrente ",
|
||||
"gorger": 3,
|
||||
"variante": [
|
||||
"du piano",
|
||||
@@ -229,7 +229,7 @@
|
||||
},
|
||||
{
|
||||
"id": 27,
|
||||
"question": "Celui ou celle a la meilleure place",
|
||||
"question": "Celui ou celle à la meilleure place",
|
||||
"gorger": 2,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
@@ -268,7 +268,7 @@
|
||||
},
|
||||
{
|
||||
"id": 32,
|
||||
"question": "La personne la plus maquillé ",
|
||||
"question": "La personne la plus maquillée ",
|
||||
"gorger": 2,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
@@ -282,7 +282,7 @@
|
||||
},
|
||||
{
|
||||
"id": 34,
|
||||
"question": "Celles et ceux qui boit de la <variante> actuellement",
|
||||
"question": "Celles et ceux qui boivent de la <variante> actuellement",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true,
|
||||
@@ -332,7 +332,7 @@
|
||||
},
|
||||
{
|
||||
"id": 38,
|
||||
"question": "Celui/celle avec le plus gros appetit sexuel",
|
||||
"question": "Celui/celle avec le plus gros appétit sexuel",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true,
|
||||
@@ -340,7 +340,7 @@
|
||||
},
|
||||
{
|
||||
"id": 39,
|
||||
"question": "Ceux/Celles qui fumes (VapeNation compris)",
|
||||
"question": "Ceux/Celles qui fument (vapoteurs compris)",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
@@ -378,7 +378,7 @@
|
||||
},
|
||||
{
|
||||
"id": 43,
|
||||
"question": "Le premier joueur à enlever un vêtements",
|
||||
"question": "Le premier joueur à enlever un vêtement",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
@@ -392,14 +392,14 @@
|
||||
},
|
||||
{
|
||||
"id": 45,
|
||||
"question": "Celui/Celle avec le plus de follow sur <variante>",
|
||||
"question": "Celui/Celle avec le plus d'abonnés sur <variante>",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true,
|
||||
"variante": [
|
||||
"instagram",
|
||||
"facebook",
|
||||
"tik-tok"
|
||||
"TikTok"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -426,7 +426,7 @@
|
||||
},
|
||||
{
|
||||
"id": 49,
|
||||
"question": "Celles et ceux qui ont déjà dépenser plus de 2000 euros en un achat",
|
||||
"question": "Celles et ceux qui ont déjà dépensé plus de 2000 euros en un achat",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
@@ -440,7 +440,7 @@
|
||||
},
|
||||
{
|
||||
"id": 51,
|
||||
"question": "Celles/Ceux qui rentre chez eux à la fin de la soirée",
|
||||
"question": "Celles/Ceux qui rentrent chez eux à la fin de la soirée",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
@@ -452,13 +452,13 @@
|
||||
"distribution": true,
|
||||
"recois": true,
|
||||
"variante": [
|
||||
"impaire",
|
||||
"paire"
|
||||
"impair",
|
||||
"pair"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 53,
|
||||
"question": "Si tu as un téléphone qui a un prix supérieur d'achat à 1000 euros, tu es riche donc en tant que personne généreuse",
|
||||
"question": "Si tu as un téléphone acheté plus de 1000 euros, tu es riche, donc en tant que personne généreuse",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": false
|
||||
@@ -473,7 +473,7 @@
|
||||
{
|
||||
"id": 55,
|
||||
"jeux": true,
|
||||
"question": "Le jeu du revolver: Chaque joueur a maintenant 7 balles, une balle correspondant à une gorgée. Les joueurs ont la capacité de tirer des balles à tout moment du jeu.",
|
||||
"question": "Le jeu du revolver: Chaque joueur a maintenant 7 balles, une balle correspond à une gorgée. Les joueurs ont la capacité de tirer des balles à tout moment du jeu.",
|
||||
"distribution": false,
|
||||
"recois": false
|
||||
},
|
||||
@@ -487,14 +487,14 @@
|
||||
{
|
||||
"id": 57,
|
||||
"jeux": true,
|
||||
"question": "<J1> est le vieu/vieille briscard ! Interdiction de montrer tes dents pendant <manche> manches",
|
||||
"question": "<J1> est un vieux/une vieille briscard(e) ! Interdiction de montrer tes dents pendant <manches> manches",
|
||||
"manches": true,
|
||||
"arret": "Tu peux arreter de cacher tes belles dents"
|
||||
"arret": "Tu peux arrêter de cacher tes belles dents"
|
||||
},
|
||||
{
|
||||
"id": 58,
|
||||
"jeux": true,
|
||||
"question": "<J1> et <J2> liser le premier SMS qui s'affiche quand on tape <variante> dans la barre de recherche. le plus marrant",
|
||||
"question": "<J1> et <J2>, lisez le premier SMS qui s'affiche quand on tape <variante> dans la barre de recherche. le plus marrant",
|
||||
"gorger": 3,
|
||||
"variante": [
|
||||
"désolé",
|
||||
@@ -509,7 +509,7 @@
|
||||
{
|
||||
"id": 59,
|
||||
"jeux": true,
|
||||
"question": "A tour de role, vous avez exactement 3 secondes pour donner un mot en rapport avec le mots dit precedemment.<J1> tu commences en choissisant un mot. Le perdant",
|
||||
"question": "À tour de rôle, vous avez exactement 3 secondes pour donner un mot en rapport avec le mot dit précédemment. <J1>, tu commences en choisissant un mot. Le perdant",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
@@ -525,7 +525,7 @@
|
||||
{
|
||||
"id": 61,
|
||||
"jeux": true,
|
||||
"question": "<J1> defie <J2> au chifoumi ! Le perdant",
|
||||
"question": "<J1> défie <J2> au chifoumi ! Le perdant",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
@@ -539,7 +539,7 @@
|
||||
"futur"
|
||||
],
|
||||
"manches": true,
|
||||
"arret": "Tu est revenu dans le present",
|
||||
"arret": "Tu es revenu dans le présent",
|
||||
"distribution": false,
|
||||
"recois": false,
|
||||
"caliente": false
|
||||
@@ -551,7 +551,7 @@
|
||||
{
|
||||
"id": 64,
|
||||
"jeux": true,
|
||||
"question": "<J1> et <J2> ferment leurs yeux ! Ils/Elles doivent deviner la couleur des yeux de l'autre. ",
|
||||
"question": "<J1> et <J2> ferment leurs yeux ! Ils/Elles doivent deviner la couleur des yeux de l'autre. Le perdant ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
@@ -559,27 +559,27 @@
|
||||
{
|
||||
"id": 65,
|
||||
"jeux": true,
|
||||
"question": "<J1> est manchot ! Il/Elle ne peut plus utiliser ses doigts durant <manches> manches . Si il/elle s'en sert, il/elle devra boire autant de gorgées qu'il/elle a utilisé de doigts",
|
||||
"question": "<J1> est manchot ! Il/Elle ne peut plus utiliser ses doigts durant <manches> manches . S'il/elle s'en sert, il/elle devra boire autant de gorgées qu'il/elle a utilisé de doigts",
|
||||
"distribution": false,
|
||||
"arret": "Tu n'es plus manchot",
|
||||
"recois": true
|
||||
"recois": false
|
||||
},
|
||||
{
|
||||
"id": 66,
|
||||
"jeux": true,
|
||||
"question": "<J1> et <J2> , si vous êtes ensemble dans la vraie vie, vous pouvez distribuer 2 gorgées , autrement buvez-les"
|
||||
"question": "<J1> et <J2>, si vous êtes ensemble dans la vraie vie, vous pouvez distribuer 2 gorgées , autrement buvez-les"
|
||||
},
|
||||
{
|
||||
"id": 67,
|
||||
"jeux": true,
|
||||
"question": "<J1> a la tourette ! A chaque fois que tu bois une gorgée, tu dois CRIER une insulte. C'est un stade avancé, ça dure <manches> manches",
|
||||
"question": "<J1> a la Tourette ! A chaque fois que tu bois une gorgée, tu dois CRIER une insulte. C'est un stade avancé, ça dure <manches> manches",
|
||||
"manches": true,
|
||||
"arret": "Tu n'as plus tourette."
|
||||
"arret": "Tu n'as plus la Tourette."
|
||||
},
|
||||
{
|
||||
"id": 68,
|
||||
"jeux": true,
|
||||
"question": "<J1>, donne la couleur préférée de <J2> si tu te trompes",
|
||||
"question": "<J1>, donne la couleur préférée de <J2>. En cas d'erreur, <J1>",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
@@ -587,19 +587,20 @@
|
||||
{
|
||||
"id": 69,
|
||||
"jeux": true,
|
||||
"question": "<J1> à l'oeil de serpent ! Dès qu'un joueur te regarde dans les yeux, il/elle boit. Si tu es arrivé à faire boire personne avant <manches> manches, tu ",
|
||||
"question": "<J1> a l'œil de serpent ! Dès qu'un joueur te regarde dans les yeux, il/elle boit. Si tu n'as réussi à faire boire personne avant <manches> manches, le serpent ",
|
||||
"gorger": 4,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
"recois": true,
|
||||
"arret": "Tu n'as plus l'œil de serpent !"
|
||||
},
|
||||
{
|
||||
"id": 70,
|
||||
"jeux": true,
|
||||
"question": "<J1> et <J2> se mesurent ! Le/la plus <variante>",
|
||||
"question": "<J1> et <J2> se mesurent ! Le/la plus <variante>",
|
||||
"gorger": 3,
|
||||
"variante": [
|
||||
"petit",
|
||||
"grand"
|
||||
"petit(e)",
|
||||
"grand(e)"
|
||||
],
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
@@ -612,12 +613,13 @@
|
||||
"C'est clair",
|
||||
"han",
|
||||
"quoicoubeh"
|
||||
]
|
||||
],
|
||||
"arret": "Tu peux enfin parler normalement !"
|
||||
},
|
||||
{
|
||||
"id": 72,
|
||||
"jeux": true,
|
||||
"question": "<J1> et <J2> se défient au 'je te tiens, tu me tiens', le premier qui rit sera dechiré, et ",
|
||||
"question": "<J1> et <J2> se défient au 'je te tiens, tu me tiens', le premier qui rit sera déchiré, et ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
@@ -627,7 +629,7 @@
|
||||
"jeux": true,
|
||||
"question": "<J1> et <J2> n'ont plus le droit d'utiliser leur téléphone pendant <manches> manches !",
|
||||
"manches": "true",
|
||||
"arret": "vous pouvez enfin utiliser vos téléphone bande de geek"
|
||||
"arret": "vous pouvez enfin utiliser vos téléphones, bande de geeks"
|
||||
},
|
||||
{
|
||||
"id": 74,
|
||||
@@ -645,7 +647,7 @@
|
||||
{
|
||||
"id": 75,
|
||||
"jeux": true,
|
||||
"question": "<J1>, Si on te dit Marco? ... Si tu as dis Polo ",
|
||||
"question": "<J1>, Si on te dit Marco? ... Si tu as dit Polo ",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
@@ -653,11 +655,11 @@
|
||||
{
|
||||
"id": 76,
|
||||
"jeux": true,
|
||||
"question": "<J1> est l'aigris pendant <manches> manches ! Dès que tu souris ou rigoles,",
|
||||
"question": "<J1> est l'aigri pendant <manches> manches ! Dès que tu souris ou rigoles,",
|
||||
"gorger": 1,
|
||||
"manches": true,
|
||||
"distribution": false,
|
||||
"arret": "Tu n'es plus aigris!",
|
||||
"arret": "Tu n'es plus aigri !",
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
@@ -689,9 +691,9 @@
|
||||
{
|
||||
"id": 81,
|
||||
"jeux": true,
|
||||
"question": "<J1> et <J2> sont lies, si l'un boit alors l'autre aussi, et ce pendant <manches> manches",
|
||||
"question": "<J1> et <J2> sont liés : si l'un boit alors l'autre aussi, et ce pendant <manches> manches",
|
||||
"manches": true,
|
||||
"arret": "Vous n'etes plus liés par le verre de l'amitié et plus.."
|
||||
"arret": "Vous n'êtes plus liés par le verre de l'amitié !"
|
||||
},
|
||||
{
|
||||
"id": 82,
|
||||
@@ -703,19 +705,18 @@
|
||||
"question": "<J1> doit choisir un mot que tout le monde devra dire à chaque fois qu'une personne boit. Pendant <manches> manches",
|
||||
"jeux": false,
|
||||
"manches": true,
|
||||
"arret": "Plus besoin de dire le mots avant de boire"
|
||||
"arret": "Plus besoin de dire le mot avant de boire"
|
||||
},
|
||||
{
|
||||
"id": 84,
|
||||
"question": "Quand l'heure affichera un multiple de 10 (22h, 22h10 ...) le premier à crier 'merde j'ai oublié mon chat'",
|
||||
"gorger": 3,
|
||||
"distribut": false,
|
||||
"manches": true,
|
||||
"arret": "Vous avez retrouver le chat!"
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 85,
|
||||
"question": "Plutôt ne plus avoir de mains ou de jambes? les perdants ",
|
||||
"question": "Plutôt ne plus avoir de mains ou de jambes ? Votez tous en même temps. La minorité ",
|
||||
"gorger": 3,
|
||||
"jeux": false,
|
||||
"distribution": false,
|
||||
@@ -745,7 +746,7 @@
|
||||
"filles",
|
||||
"garçons",
|
||||
"couples",
|
||||
"celibataires"
|
||||
"célibataires"
|
||||
],
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
@@ -784,21 +785,21 @@
|
||||
},
|
||||
{
|
||||
"id": 93,
|
||||
"question": "Plutôt jeux-videos ou livre ? Votez tous en même temps. La minorité ",
|
||||
"question": "Plutôt jeux vidéo ou livres ? Votez tous en même temps. La minorité ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 94,
|
||||
"question": "Plutôt anime ou jeux-videos ? Votez tous en même temps. La minorité ",
|
||||
"question": "Plutôt animés ou jeux vidéo ? Votez tous en même temps. La minorité ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 95,
|
||||
"question": "Elisez le plus <variante> d'entre vous, ce dernier ",
|
||||
"question": "Élisez le plus <variante> d'entre vous, ce dernier ",
|
||||
"variante": [
|
||||
"con",
|
||||
"intelligent",
|
||||
@@ -821,16 +822,16 @@
|
||||
"Christopher Nolan",
|
||||
"James Cameron",
|
||||
"Tim Burton",
|
||||
"Quentin tarantino",
|
||||
"Quentin Tarantino",
|
||||
"Steven Spielberg"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 97,
|
||||
"question": "Le premier qui donne un film avec ",
|
||||
"question": "Le premier qui donne un film avec <variante> ",
|
||||
"variante": [
|
||||
"Christian Clavier",
|
||||
"Morgan freeman",
|
||||
"Morgan Freeman",
|
||||
"Brad Pitt",
|
||||
"Jean Reno",
|
||||
"Marion Cotillard"
|
||||
@@ -847,7 +848,7 @@
|
||||
"recois": false,
|
||||
"variante": [
|
||||
"jeune",
|
||||
"vieille"
|
||||
"vieux/vieille"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -866,14 +867,14 @@
|
||||
},
|
||||
{
|
||||
"id": 101,
|
||||
"question": "Plutot vaincre le patrikaka ou la polution dans le monde? Votez tous en meme temps. La minorité ",
|
||||
"question": "Plutôt vaincre le patrikaka ou la pollution dans le monde ? Votez tous en même temps. La minorité ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 102,
|
||||
"question": "Jeu du LUTIN : Pendant <manches> manches. Vous devez enlever le lutin de votre verre pour pouvoir boire et le remettre ensuite sinon vous devait reboire",
|
||||
"question": "Jeu du LUTIN : Pendant <manches> manches. Vous devez enlever le lutin de votre verre pour pouvoir boire et le remettre ensuite sinon vous devez reboire",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": false,
|
||||
@@ -896,17 +897,17 @@
|
||||
},
|
||||
{
|
||||
"id": 104,
|
||||
"question": "Le premier joueur qui dévoile un de ses secrets et que personne ne sait ",
|
||||
"question": "Le premier joueur qui dévoile un de ses secrets et que personne ne connaissait : le perdant ",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": false
|
||||
},
|
||||
{
|
||||
"id": 105,
|
||||
"question": "Jeu des peaux! Triez vous du joueur le plus bronzé au joueur le moins bronzé. Le plus bronzé prend 1 gorgée, le second 2 gorgées, etc.",
|
||||
"question": "Jeu des peaux! Triez-vous : du joueur le plus bronzé au joueur le moins bronzé. Le plus bronzé prend 1 gorgée, le second 2 gorgées, etc.",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
"distribution": false,
|
||||
"recois": false
|
||||
},
|
||||
{
|
||||
"id": 106,
|
||||
@@ -919,11 +920,11 @@
|
||||
"id": 107,
|
||||
"question": "Il est désormais interdit de se tutoyer pendant <manches> manches",
|
||||
"manches": true,
|
||||
"arret": "Vous pouvez vous enfin vous tutoyer"
|
||||
"arret": "Vous pouvez enfin vous tutoyer"
|
||||
},
|
||||
{
|
||||
"id": 108,
|
||||
"question": "Vaccin contre le COVID19 : Le DR Raoul à dit que boire un cul sec avait les mêmes effets que le vaccin. Tout le monde bois sont verre cul sec"
|
||||
"question": "Vaccin contre le COVID19 : Le Dr Raoult a dit que boire un cul sec avait les mêmes effets que le vaccin. Tout le monde boit son verre cul sec"
|
||||
},
|
||||
{
|
||||
"id": 109,
|
||||
@@ -948,29 +949,28 @@
|
||||
{
|
||||
"id": 112,
|
||||
"question": "Le prochain qui parle de travail ou d'école doit boire un shot",
|
||||
"duree": true,
|
||||
"arret": "Fin de l'interdiction"
|
||||
"duree": true
|
||||
},
|
||||
{
|
||||
"id": 113,
|
||||
"question": "Karaoké improvisé : <J1> choisit une chanson pour <J2>",
|
||||
"question": "Karaoké improvisé : <J1> choisit une chanson, et c'est <J2> qui doit la chanter. <J2> ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 114,
|
||||
"question": "Qui serait le plus susceptible de survivre dans un film de survie ? Votez",
|
||||
"question": "Qui serait le plus susceptible de survivre dans un film de survie ? Votez, et le perdant ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 115,
|
||||
"question": "Défi cuisine : <J1> doit créer la combinaison d'alcool la plus bizarre avec les ingrédients présents, <J2> doit boire la mixture",
|
||||
"question": "Défi cuisine : <J1> doit créer la combinaison d'alcool la plus bizarre avec les ingrédients présents, et c'est <J2> qui doit la boire cul sec",
|
||||
"gorger": 2,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
"recois": false
|
||||
},
|
||||
{
|
||||
"id": 116,
|
||||
@@ -1051,14 +1051,14 @@
|
||||
},
|
||||
{
|
||||
"id": 127,
|
||||
"question": "Le/La plus drôle du groupe (vote à main levée, le perdant boit)",
|
||||
"question": "Le/La plus drôle du groupe (vote à main levée)",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 128,
|
||||
"question": "Le/La plus 'bête' cul du groupe",
|
||||
"question": "Le/La plus beau cul du groupe",
|
||||
"gorger": 4,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
@@ -1072,7 +1072,7 @@
|
||||
},
|
||||
{
|
||||
"id": 130,
|
||||
"question": "Le/La plus likely to rater sa vie",
|
||||
"question": "Le/La plus susceptible de rater sa vie",
|
||||
"gorger": 4,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
@@ -1146,7 +1146,7 @@
|
||||
},
|
||||
{
|
||||
"id": 139,
|
||||
"question": "Pause pip interdite pendant <manches> manches. 5 gorgées si tu vas aux toilettes !",
|
||||
"question": "Pause pipi interdite pendant <manches> manches. 5 gorgées si tu vas aux toilettes !",
|
||||
"gorger": 0,
|
||||
"arret": "Tu peux enfin aller aux toilettes !"
|
||||
},
|
||||
@@ -1190,49 +1190,57 @@
|
||||
"id": 146,
|
||||
"question": "<J1> et <J2> se regardent dans les yeux pendant 10 secondes sans rire. Le premier à rire boit 4 gorgées",
|
||||
"gorger": 0,
|
||||
"recois": true
|
||||
"recois": false,
|
||||
"distribution": false
|
||||
},
|
||||
{
|
||||
"id": 147,
|
||||
"question": "<J1> doit donner un compliment à <J2>. Si <J2> n'est pas satisfait : <J1> boit 3 gorgées",
|
||||
"gorger": 0,
|
||||
"recois": true
|
||||
"recois": false,
|
||||
"distribution": false
|
||||
},
|
||||
{
|
||||
"id": 148,
|
||||
"question": "<J1> à toi de choisir : qui de <J2> ou <J3> a le plus mauvais goût musical ? Le perdant boit 3 gorgées",
|
||||
"question": "<J1>, à toi de choisir : qui de <J2> ou <J3> a le plus mauvais goût musical ? Le perdant boit 3 gorgées",
|
||||
"gorger": 0,
|
||||
"recois": true
|
||||
"recois": false,
|
||||
"distribution": false
|
||||
},
|
||||
{
|
||||
"id": 149,
|
||||
"question": "<J1> doit deviner ce que <J2> a mangé aujourd'hui. 1 gorgée par mauvaise réponse, max 5",
|
||||
"gorger": 0,
|
||||
"recois": true
|
||||
"recois": false,
|
||||
"distribution": false
|
||||
},
|
||||
{
|
||||
"id": 150,
|
||||
"question": "<J1> et <J2> font un bras de fer. Le perdant boit 5 gorgées",
|
||||
"gorger": 0,
|
||||
"recois": true
|
||||
"recois": false,
|
||||
"distribution": false
|
||||
},
|
||||
{
|
||||
"id": 151,
|
||||
"question": "<J1> doit nommer une qualité de <J2>. Si <J2> n'est pas d'accord : 3 gorgées pour <J1>",
|
||||
"gorger": 0,
|
||||
"recois": true
|
||||
"recois": false,
|
||||
"distribution": false
|
||||
},
|
||||
{
|
||||
"id": 152,
|
||||
"question": "<J1> doit deviner la couleur des sous-vêtements de <J2>. 2 gorgées si faux",
|
||||
"gorger": 0,
|
||||
"recois": true
|
||||
"recois": false,
|
||||
"distribution": false
|
||||
},
|
||||
{
|
||||
"id": 153,
|
||||
"question": "<J1> doit mimer le métier de <J2>. Les autres doivent deviner en moins de 30 secondes ou <J1> boit 4 gorgées",
|
||||
"gorger": 0,
|
||||
"recois": true
|
||||
"recois": false,
|
||||
"distribution": false
|
||||
},
|
||||
{
|
||||
"id": 154,
|
||||
@@ -1286,7 +1294,7 @@
|
||||
},
|
||||
{
|
||||
"id": 158,
|
||||
"question": "Le/La plus 'influençant' du groupe (vote à main levée)",
|
||||
"question": "Le/La plus influenceur/euse du groupe (vote à main levée)",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
@@ -1302,7 +1310,8 @@
|
||||
"id": 160,
|
||||
"question": "<J1> doit dire 3 mots commençant par la même lettre que <J2> choisit. Si échec : 3 gorgées",
|
||||
"gorger": 0,
|
||||
"recois": true
|
||||
"recois": false,
|
||||
"distribution": false
|
||||
},
|
||||
{
|
||||
"id": 161,
|
||||
@@ -1313,7 +1322,7 @@
|
||||
},
|
||||
{
|
||||
"id": 162,
|
||||
"question": "Le/La plus 'branché' du groupe selon les autres",
|
||||
"question": "Le/La plus 'branché(e)' du groupe selon les autres",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
@@ -1382,7 +1391,8 @@
|
||||
"id": 171,
|
||||
"question": "<J1> doit faire rire <J2> en 30 secondes. Si échec : 5 gorgées",
|
||||
"gorger": 0,
|
||||
"recois": true
|
||||
"recois": false,
|
||||
"distribution": false
|
||||
},
|
||||
{
|
||||
"id": 172,
|
||||
@@ -1408,8 +1418,7 @@
|
||||
"une voiture",
|
||||
"un téléphone",
|
||||
"un avion"
|
||||
],
|
||||
"arret": "Fin du mime !"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 175,
|
||||
@@ -1435,8 +1444,7 @@
|
||||
"mèche",
|
||||
"alliance",
|
||||
"bracelet"
|
||||
],
|
||||
"arret": "Fin du jeu du NI !"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 178,
|
||||
@@ -1479,14 +1487,14 @@
|
||||
},
|
||||
{
|
||||
"id": 183,
|
||||
"question": "Ceux qui ont déjà fait un regretté post-soirée (message à un ex)",
|
||||
"question": "Ceux qui ont déjà envoyé un message à leur ex après une soirée",
|
||||
"gorger": 4,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 184,
|
||||
"question": "Le/La plus 'organisé' du groupe",
|
||||
"question": "Le/La plus 'organisé(e)' du groupe",
|
||||
"gorger": 2,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
@@ -1499,4 +1507,4 @@
|
||||
"recois": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,809 +0,0 @@
|
||||
{
|
||||
"version": "2",
|
||||
"questions": [
|
||||
{
|
||||
"id": 1,
|
||||
"question": "Celles/Ceux qui ont habité dans plus de 3 villes diferentes",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"question": "Ceux qui ont dansé aujourd'hui",
|
||||
"gorger": 1,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"question": "si tu n'as pas ton veritable nom sur insta",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"question": "si tu a des photos sur insta",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"question": "Les joueurs de Counter Strike ",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"question": "La dernière personne à avoir vomi en soirée ",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"question": "Toutes celles (ou ceux) qui ont du verni à ongles",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"question": "Tous les joueurs célibataires",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"question": "Tous ceux qui ont des lunettes",
|
||||
"gorger": 2,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"question": "Tous ceux qui ont déjà triché à un examen",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"question": "Le/La plus radin(e)",
|
||||
"gorger": 4,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"question": "<J1> a toi de juger : entre <J1> et <J2> qui stresse le plus pour un rien selon toi? Le perdant ",
|
||||
"gorger": 5,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
}, {
|
||||
"id": 12,
|
||||
"question": "Le mec qui a le plus gros ventre à bière ",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
"question": "Tous ceux qui se sont déjà fait exclure de cours",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 14,
|
||||
"question": "<J1>, donne le nombre d'habitant du/de la <variante> ( à 1 000 000 près) Si tu as faux tu bois, sinon tu ",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": false,
|
||||
"variante": ["Tadjikistant", "Monaco", "Belgique", "Suisse", "Allemagne", "Chine", "Inde"]
|
||||
},
|
||||
{
|
||||
"id": 15,
|
||||
"question": "Tous ceux qui ont des frères et soeurs",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 16,
|
||||
"question": "<J1> a qui appartient le slogan suivant? <variante>",
|
||||
"variante": ["Des pâtes oui mais des (panzani)"," Le plaisir pour les petites faims. (Kinder Bueno)","Réveillez le lion qui est en vous. (Cereale lion)","Parce que le monde bouge (CIC)","Ça coule de source ! (Cristaline)", "Pensez différemment (apple)" ],
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 17,
|
||||
"question": "Celles et ceux qui ont eu un Windows phone",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 18,
|
||||
"question": "<J1>, Boire un café fait baisser le taux d'alcool? Si tu as faux ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 19,
|
||||
"question": "Celles/Ceux qui se sont déjà battus",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 20,
|
||||
"question": "Celui/Celle qui pèse le plus lourd",
|
||||
"variante": ["lourd","leger"],
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": false
|
||||
},
|
||||
{
|
||||
"id": 21,
|
||||
"question": "Pour se décoincer, le/la plus <variante>",
|
||||
"variante": ["timide", "enervé ", "angoissé","aigri"],
|
||||
"gorger": 2,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 22,
|
||||
"question": "Le/La plus <variante>",
|
||||
"gorger": 3,
|
||||
"variante": ["jeune","vieille"],
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 23,
|
||||
"question": "Celles/Ceux qui ont fait des études <variante>",
|
||||
"gorger": 3,
|
||||
"variante": ["L","Scientifique", "Bac Professionel", "STMG"],
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 25,
|
||||
"question": "Celles et ceux qui ont deja joué <variante> de maniere recurrente ",
|
||||
"gorger": 3,
|
||||
"variante": ["du piano","de la guitare", "du saxophone", "de la batterie"],
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 26,
|
||||
"question": "Les gens qui se sont masturbés aujourd'hui",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true,
|
||||
"caliente": true
|
||||
},
|
||||
{
|
||||
"id": 27,
|
||||
"question": "Celui ou celle a la meilleure place",
|
||||
"gorger": 2,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 28,
|
||||
"question": "Celles et ceux qui n'ont jamais trompé leur partenaire",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 29,
|
||||
"question": "Celui/Celle avec les vêtements les plus beaux ",
|
||||
"gorger": 1,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 30,
|
||||
"question": "Celui/Celle qui a les cheveux les plus <variante> ",
|
||||
"gorger": 2,
|
||||
"variante": ["longs","courts"],
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 31,
|
||||
"question": "Les végans ",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 32,
|
||||
"question": "La personne la plus maquillé ",
|
||||
"gorger": 2,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
}, {
|
||||
"id": 33,
|
||||
"question": "Celles/Ceux qui ont déjà appelé leur partenaire par le prénom de leurs ex",
|
||||
"gorger": 4,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 34,
|
||||
"question": "Celles et ceux qui boit de la <variante> actuellement",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true,
|
||||
"variante": ["vodka", "rhum", "tequila", "whisky"]
|
||||
},
|
||||
{
|
||||
"id": 35,
|
||||
"question": "Les joueurs qui ont un <variante> dans leurs prénom",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true,
|
||||
"variante": ["a","e","i","o","u","y"]
|
||||
},
|
||||
{
|
||||
"id": 36,
|
||||
"question": "Le/La joueur/euse avec le plus gros cul",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 37,
|
||||
"question": "Celles/Ceux qui ont moins de <variante> ans",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true,
|
||||
"variante": ["21","22","23","24","25","26"]
|
||||
},
|
||||
{
|
||||
"id": 38,
|
||||
"question": "Celui/celle avec le plus gros appetit sexuel",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true,
|
||||
"caliente": true
|
||||
},
|
||||
{
|
||||
"id": 39,
|
||||
"question": "Ceux/Celles qui fumes (VapeNation compris)",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 40,
|
||||
"question": "Celles et ceux qui ont au moins un BAC +<variante>",
|
||||
"gorger": 1,
|
||||
"distribution": true,
|
||||
"recois": true,
|
||||
"variante": [0,1,2,3,4,5]
|
||||
},
|
||||
{
|
||||
"id": 41,
|
||||
"question": "Le premier joueur à se lever",
|
||||
"doubledistribution": true,
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 42,
|
||||
"question": "Ceux qui n'ont jamais eu l'occasion de faire un strip tease",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true,
|
||||
"caliente": true
|
||||
},
|
||||
{
|
||||
"id": 43,
|
||||
"question": "Le premier joueur à enlever un vêtements",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 44,
|
||||
"question": "Tous ceux qui ont déjà uriné dans une piscine ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 30,
|
||||
"question": "Celui/Celle avec le plus de follow sur <variante>",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true,
|
||||
"variante": ["instagram","facebook","tik-tok"]
|
||||
},
|
||||
{
|
||||
"id": 31,
|
||||
"question": "Celui/Celle avec le nom de famille le plus compliqué",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 32,
|
||||
"question": "Les joueurs qui n'ont pas encore distribué de gorgées",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
}, {
|
||||
"id": 33,
|
||||
"question": "Le premier joueur à donner l'heure",
|
||||
"doubledistribution": true,
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 34,
|
||||
"question": "Celles et ceux qui ont déjà dépenser plus de 2000 euros en un achat",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 35,
|
||||
"question": "La personne la moins courageuse",
|
||||
"gorger": 1,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 36,
|
||||
"question": "Celles/Ceux qui rentre chez eux à la fin de la soirée",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 37,
|
||||
"question": "Celles et ceux dont le jour d'anniversaire est un nombre <variante>",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true,
|
||||
"variante": ["impaire","paire"]
|
||||
},
|
||||
{
|
||||
"id": 38,
|
||||
"question": "Si tu as un téléphone qui a un prix supperieur d'achat a 1000Euros, tu est riche donc en tant que personne généreuse",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": false
|
||||
},
|
||||
{
|
||||
"id": 39,
|
||||
"question": "Tous ceux qui ont fait plus de 100km pour venir ici ",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": false
|
||||
},
|
||||
{
|
||||
"id": 40,
|
||||
"jeux": true,
|
||||
"question": "Le jeu du revolver: Chaque joueur a maintenant 7 balles, une balle correspondant à une gorgée. Les joueurs ont la capacité de tirer des balles à tout moment du jeu.",
|
||||
"distribution": false,
|
||||
"recois": false
|
||||
},
|
||||
{
|
||||
"id": 41,
|
||||
"question": "<J1>",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 42,
|
||||
"jeux": true,
|
||||
"question": "<J1> est le vieu/vieille briscard ! Interdiction de montrer tes dents pendant <manche> manches",
|
||||
"manche": true,
|
||||
"arret": "Tu peux arreter de cacher tes belles dents"
|
||||
|
||||
},
|
||||
{
|
||||
"id": 43,
|
||||
"jeux": true,
|
||||
"question": "<J1> et <J2> liser le premier SMS qui s'affiche quand on tape <variante> dans la barre de recherche. le plus marrant",
|
||||
"gorger": 3,
|
||||
"variante": ["désolé","caca","bourré","mine","nazi"],
|
||||
"distribution": true,
|
||||
"recois": false
|
||||
}, {
|
||||
"id": 44,
|
||||
"jeux": true,
|
||||
"question": "A tour de role, vous avez exactement 3 secondes pour donner un mot en rapport avec le mots dit precedemment.<J1> tu commences en choissisant un mot. Le perdant",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 45,
|
||||
"jeux": true,
|
||||
"question": "Le jeu du PIM PAM POUM. Le premier qui perd ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 46,
|
||||
"jeux": true,
|
||||
"question": "<J1> defie <J2> au chifoumi ! Le perdant",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 47,
|
||||
"jeux": true,
|
||||
"question": "<J1> est dans le <variante> ! Tu dois parler au <variante> pendant <manches> manches ",
|
||||
"variante": ["passé", "futur"],
|
||||
"manche": true,
|
||||
"arret": "Tu est revenu dans le present",
|
||||
"distribution": false,
|
||||
"recois": false,
|
||||
"caliente": false
|
||||
},
|
||||
{
|
||||
"id": 48,
|
||||
"question": "<J1> tu bois autant de gorgées que tu as d'années d'études après le BAC"
|
||||
},
|
||||
{
|
||||
"id": 49,
|
||||
"jeux": true,
|
||||
"question": "<J1> et <J2> ferment leurs yeux ! Ils/Elles doivent deviner la couleur des yeux de l'autre. ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 50,
|
||||
"jeux": true,
|
||||
"question": "<J1> est manchot ! Il/Elle ne peut plus utiliser ses doigts durant <manches> manches . Si il s'en sert, il/elle devra boire autant de gorgées qu'il/elle a utilisé de doigts",
|
||||
"distribution": false,
|
||||
"arret": "Tu n'es plus manchot",
|
||||
"recois": false
|
||||
},
|
||||
{
|
||||
"id": 51,
|
||||
"jeux": true,
|
||||
"question": "<J1> et <J2> , si vous êtes ensemble dans la vraie vie, vous pouvez distribuer 2 gorgées , autrement buvez-les"
|
||||
|
||||
},
|
||||
{
|
||||
"id": 52,
|
||||
"jeux": true,
|
||||
"question": "<J1> a la tourette ! A chaque fois que tu bois une gorgée, tu dois CRIER une insulte. C'est un stade avancé, ça dure <manches> manches",
|
||||
"manches": true,
|
||||
"arret": "Tu n'as plus tourette."
|
||||
|
||||
},
|
||||
{
|
||||
"id": 53,
|
||||
"jeux": true,
|
||||
"question": "<J1>, donne la couleur préférée de <J2> si tu te trompes",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 54,
|
||||
"jeux": true,
|
||||
"question": "<J1> à l'oeil de serpent ! Dès qu'un joueur te regarde dans les yeux, il/elle boit. Si tu es arrivé a faire boire personne avant <manches> manches, tu ",
|
||||
"gorger": 4,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
}, {
|
||||
"id": 55,
|
||||
"jeux": true,
|
||||
"question": "<J1> et <J2> se mesurent ! Le/la plus <variante>",
|
||||
"gorger": 3,
|
||||
"variante": ["petit","grand"],
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 56,
|
||||
"jeux": true,
|
||||
"question": "<J1> doit terminer toutes ses phrases par - <variante> pendant <manches> manches",
|
||||
"variante": ["C'est clair","han","quoicoubeh"]
|
||||
},
|
||||
{
|
||||
"id": 57,
|
||||
"jeux": true,
|
||||
"question": "<J1> et <J2> se défient au 'je te tiens, tu me tiens', le premier qui rit sera dechiré, et ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 58,
|
||||
"jeux": true,
|
||||
"question": "<J1> et <J2> n'ont plus le droit d'utiliser leur téléphone pendant <manches> manches !",
|
||||
"manches": "true"
|
||||
},
|
||||
{
|
||||
"id": 59,
|
||||
"jeux": true,
|
||||
"question": "<J1> et <J2> racontent une anecdote, celui/celle qui sort la plus <variante> ",
|
||||
"variante": ["banale","incroyable","marrante"],
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 60,
|
||||
"jeux": true,
|
||||
"question": "<J1>, Si on te dit Marco? ... Si tu as dis Polo ",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 61,
|
||||
"jeux": true,
|
||||
"question": "<J1> est l'aigris pendant <manches> manches ! Dès que tu souris ou rigoles,",
|
||||
"gorger": 1,
|
||||
"manches": true,
|
||||
"distribution": false,
|
||||
"arret": "Tu n'es plus aigris!",
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 62,
|
||||
"jeux": true,
|
||||
"question": "<J1> fait un geste, le suivant répète et en ajoute un. Le perdant ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 63,
|
||||
"question": "<J1>, <J2> et <J3> vont désigner quelqu'un qui doit terminer son verre",
|
||||
"jeux": true
|
||||
},
|
||||
{
|
||||
"id": 64,
|
||||
"question": "Récitez l'alphabet en énonçant une lettre à tour de rôle. Si <J1> finit son verre avant, cul sec pour tout le monde !",
|
||||
"jeux": true
|
||||
},
|
||||
{
|
||||
"id": 65,
|
||||
"question": "Si <J1> arrive a finir son verre en moins de 5 secondes, il/elle ",
|
||||
"gorger": 6,
|
||||
"distribution": true,
|
||||
"recois": false,
|
||||
"jeux": true
|
||||
},
|
||||
{
|
||||
"id": 66,
|
||||
"jeux": true,
|
||||
"question": "<J1> et <J2> sont lies, si l'un boit alors l'autre aussi, et ce pendant <manches> manches",
|
||||
"manches": true
|
||||
},
|
||||
{
|
||||
"id": 67,
|
||||
"question": "<J1> dit un mot, la personne suivante le répète et en ajoute un nouveau, ainsi de suite jusqu'a ce que quelqu'un se trompe. Le perdant boit autant de gorgées qu'il y a eu de personne avant lui",
|
||||
"jeux": true
|
||||
},
|
||||
{
|
||||
"id": 68,
|
||||
"question": "<J1> doit choisir un mot que tout le monde devra dire à chaque fois qu'une personne boit. Pendant <manches> manches",
|
||||
"jeux": false,
|
||||
"manches": true,
|
||||
"arret": "Plus besoin de dire le mots avant de boire"
|
||||
},
|
||||
{
|
||||
"id": 69,
|
||||
"question": "Quand l'heure affichera un multiple de 10 (22h, 22h10 ...) le premier a crier 'merde j'ai oublié mon chat'",
|
||||
"gorger": 3,
|
||||
"distribut":false,
|
||||
"manches": true,
|
||||
"arret": "Vous avez retrouver le chat!"
|
||||
},
|
||||
{
|
||||
"id": 70,
|
||||
"question": "Plutôt ne plus avoir de mains ou de jambes? les perdants ",
|
||||
"gorger": 3,
|
||||
"jeux": false,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 71,
|
||||
"question": "Vive la poésie ! Nos phrases doivent rimer sous peine d'une gorgée pendant <manches> manches",
|
||||
"manches": true,
|
||||
"arret": "Vous ne devez plus faire de rime."
|
||||
},
|
||||
{
|
||||
"id": 72,
|
||||
"question": "Choisissez le joueur le <variante> drôle d'entre vous, ce dernier ",
|
||||
"variante": ["moins", "plus"],
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 73,
|
||||
"question": "Les <variante>",
|
||||
"variante": ["filles","garçons","couples","celibataires"],
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 74,
|
||||
"jeux": true,
|
||||
"question": "Plutôt avoir un tapis volant, ou un frigo qui se remplit tout seul ? Votez tous en même temps. La minorité ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true,
|
||||
"manches": false
|
||||
},
|
||||
{
|
||||
"id": 75,
|
||||
"question": "Plutôt avoir du temps ou de l'argent ? Votez tous en même temps. La minorité ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
|
||||
},
|
||||
{
|
||||
"id": 76,
|
||||
"question": "Le premier joueur qui en embrasse un autre sur la bouche",
|
||||
"gorger": 5,
|
||||
"distribution": true,
|
||||
"recois": false,
|
||||
"caliente": true
|
||||
},
|
||||
{
|
||||
"id": 77,
|
||||
"question": "Plutôt série ou film ? Votez tous en même temps. La minorité ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 78,
|
||||
"question": "Plutôt jeux-videos ou livre ? Votez tous en même temps. La minorité ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
|
||||
{
|
||||
"id": 79,
|
||||
"question": "Plutôt anime ou jeux-videos ? Votez tous en même temps. La minorité ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 80,
|
||||
"question": "Elisez le plus <variante> d'entre vous, ce dernier ",
|
||||
"variante": ["con", "intelligent", "beau", "gentil","dragueur","timide"],
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 81,
|
||||
"question": "Le premier qui donne un film de <variante> ",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": false,
|
||||
"variante": ["Christopher Nolan","James Cameron","Tim Burton","Quentin tarantino","Steven Spielberg"]
|
||||
},
|
||||
{
|
||||
"id": 82,
|
||||
"question": "Le premier qui donne un film avec ",
|
||||
"variante": ["Christian Clavier","Morgan freeman","Brad Pitt", "Jean Reno","Marion Cotillard"],
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": false
|
||||
},
|
||||
{
|
||||
"id": 83,
|
||||
"question": "La première personne qui désigne le/la plus <variante> ",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": false,
|
||||
"variante": ["jeune", "vieille"]
|
||||
},
|
||||
{
|
||||
"id": 84,
|
||||
"question": "Plutôt avoir des connaissances illimitées ou diriger le monde ? Votez tous en même temps. La minorité",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 85,
|
||||
"question": "Plutôt n'avoir aucun ami ou ne plus pouvoir utiliser d'appareil électronique ? Votez tous en même temps. La minorité ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 86,
|
||||
"question": "Plutot vaincre le patrikaka ou la polution dans le monde? Votez tous en meme temps. La minorité ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 87,
|
||||
"question": "Jeu du LUTIN : Pendant <manches> manches. Vous devez enlever le lutin de votre verre pour pouvoir boire et le remettre ensuite sinon vous devait reboire",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": false,
|
||||
"manches": true,
|
||||
"arret": "Le Lutin est parti. Vous pouvez boire normalement"
|
||||
},
|
||||
{
|
||||
"id": 88,
|
||||
"question": "Le premier joueur à ramener un objet <variante> (pas de vêtements) ",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"variante": ["rouge","vert","bleu","jaune"],
|
||||
"recois": false,
|
||||
"manches": false
|
||||
},
|
||||
{
|
||||
"id": 89,
|
||||
"question": "Le premier joueur qui dévoile un de ses secrets et que personne ne sait ",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": false
|
||||
},
|
||||
{
|
||||
"id": 90,
|
||||
"question": "Jeu des peaux! Triez vous du joueur le plus bronzé au joueur le moins bronzé. Le plus bronzé prend 1 gorgée, le second 2 gorgées, etc.",
|
||||
"gorger": 3,
|
||||
"distribution": true,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 91,
|
||||
"question": "Plutôt avoir du pouvoir ou de la connaissance ? Votez tous en même temps. La minorité ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
},
|
||||
{
|
||||
"id": 92,
|
||||
"question": "Il est désormais interdit de se tutoyer pendant <manches> manches",
|
||||
"manches": true,
|
||||
"arret":"Vous pouvez vous tutoyer"
|
||||
|
||||
},
|
||||
{
|
||||
"id": 93,
|
||||
"question": "Vaccin contre le COVID19 : Le DR Raoul à dit que boire un cul sec avait les mêmes effets que le vaccin. Tout le monde bois sont verre cul sec"
|
||||
},
|
||||
{
|
||||
"id": 94,
|
||||
"question": "Faites un concours de clash : Rap contenders entre <J1> et <J2> le perdant ",
|
||||
"gorger": 3,
|
||||
"distribution": false,
|
||||
"recois": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
package com.example.boidelov3;
|
||||
|
||||
//public class ChatGPTTask extends AsyncTask<Void, Void, String> {
|
||||
//// private Jeux jeuxActivity;
|
||||
//// private String keyOpenai;
|
||||
////
|
||||
//// public ChatGPTTask(Jeux jeuxActivity, String keyOpenai) {
|
||||
//// this.jeuxActivity = jeuxActivity;
|
||||
//// this.keyOpenai = keyOpenai;
|
||||
//// }
|
||||
////
|
||||
////
|
||||
//// @Override
|
||||
//// protected String doInBackground(Void... voids) {
|
||||
//// String url = "https://api.openai.com/v1/chat/completions";
|
||||
//// String apiKey = keyOpenai;
|
||||
//// System.out.println("apiKey de ChatGPTTASK.java: " + apiKey);
|
||||
//// String model = "gpt-3.5-turbo";
|
||||
////
|
||||
//// String prompt = "Tu es une IA française qui génère des questions ainsi que la categories de la question. Voici des exemples :" +
|
||||
//// "Celles/Ceux qui ont habité dans plus de 3 villes diferentes';'La vie" +
|
||||
//// "Ceux qui ont dansé aujourd'hui' ; 'Soirée'" +
|
||||
//// "'Pour se décoincer, le/la plus timide' ; 'Caractère'" +
|
||||
//// "'Celles et ceux qui ont déjà dépenser plus de 2000 euros en un achat' ; 'Dépense'" +
|
||||
//// "'Le/La plus radin(e)' ; 'Caractère'";
|
||||
//
|
||||
//// try {
|
||||
//// URL obj = new URL(url);
|
||||
//// HttpURLConnection connection = (HttpURLConnection) obj.openConnection();
|
||||
//// connection.setRequestMethod("POST");
|
||||
//// connection.setRequestProperty("Authorization", "Bearer " + apiKey);
|
||||
//// connection.setRequestProperty("Content-Type", "application/json");
|
||||
////
|
||||
//// // The request body
|
||||
//// String body = "{\"model\": \"" + model + "\", \"messages\": [{\"role\": \"user\", \"content\": \"" + prompt + "\"}]}";
|
||||
//// System.out.println("body: " + body);
|
||||
//// connection.setDoOutput(true);
|
||||
//// OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream());
|
||||
//// writer.write(body);
|
||||
//// writer.flush();
|
||||
//// writer.close();
|
||||
////
|
||||
//// // Response from ChatGPT
|
||||
//// BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()));
|
||||
//// String line;
|
||||
////
|
||||
//// StringBuffer response = new StringBuffer();
|
||||
////
|
||||
//// while ((line = br.readLine()) != null) {
|
||||
//// response.append(line);
|
||||
//// }
|
||||
//// br.close();
|
||||
////
|
||||
//// // calls the method to extract the message.
|
||||
//// return extractMessageFromJSONResponse(response.toString());
|
||||
////
|
||||
//// } catch (IOException e) {
|
||||
//// System.out.println("Il y a eu une erreur" + e);
|
||||
//// throw new RuntimeException(e);
|
||||
////
|
||||
//// }
|
||||
//// }
|
||||
////
|
||||
//// public String extractMessageFromJSONResponse(String response) {
|
||||
//// int start = response.indexOf("content") + 11;
|
||||
//// int end = response.indexOf("\"", start);
|
||||
//// String extractedMessage = response.substring(start, end);
|
||||
//// System.out.println("extractedMessage: " + extractedMessage);
|
||||
//// return extractedMessage;
|
||||
//// }
|
||||
////
|
||||
//// @Override
|
||||
//// protected void onPostExecute(String result) {
|
||||
//// if (result != null) {
|
||||
//// // Handle the extracted message here
|
||||
//// jeuxActivity.handleExtractedMessage(result);
|
||||
//// } else {
|
||||
//// Toast.makeText(jeuxActivity.getApplicationContext(), "Échec de la communication avec l'API !", Toast.LENGTH_SHORT).show();
|
||||
//// jeuxActivity.navigateToJeuxParametres();
|
||||
//// }
|
||||
//// }
|
||||
//
|
||||
//
|
||||
// return url;
|
||||
// }}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,480 +0,0 @@
|
||||
package com.example.boidelov3;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
import android.widget.Button;
|
||||
import android.widget.CompoundButton;
|
||||
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
import android.widget.EditText;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.example.boidelov3.utils.ErrorHandler;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
|
||||
public class JeuxParametres extends AppCompatActivity {
|
||||
|
||||
private SeekBar seekBar1, seekBar2, seekBar3, seekBarDuration;
|
||||
private TextView textView1, textView2, textView5, textViewRatioGen, questionCountValue, gorgeesValue, durationValue;
|
||||
private SwitchMaterial checkBoxGPT;
|
||||
private Button buttonTestApi;
|
||||
private EditText editText, editTextKeyGPT;
|
||||
private AutoCompleteTextView autoCompleteProvider;
|
||||
private String keyGPT;
|
||||
private OpenAIService.AIProvider selectedProvider = OpenAIService.AIProvider.OPENAI;
|
||||
private int nbQuestions;
|
||||
|
||||
private List<String> toutlesjoueurs;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
toutlesjoueurs = getIntent().getStringArrayListExtra("EXTRA_LIST_JOUEUR");
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_jeux_parametres);
|
||||
|
||||
// Initialisation des vues
|
||||
seekBar1 = findViewById(R.id.seekBar1);
|
||||
seekBar2 = findViewById(R.id.seekBar2);
|
||||
seekBar3 = findViewById(R.id.seekBar3);
|
||||
seekBarDuration = findViewById(R.id.seekBarDuration);
|
||||
textView1 = findViewById(R.id.textView1);
|
||||
textView2 = findViewById(R.id.textView2);
|
||||
textView5 = findViewById(R.id.textView5);
|
||||
editTextKeyGPT = findViewById(R.id.editTextGPT);
|
||||
autoCompleteProvider = findViewById(R.id.autoCompleteProvider);
|
||||
buttonTestApi = findViewById(R.id.ButtonTestApi);
|
||||
textViewRatioGen = findViewById(R.id.textViewRatioGen);
|
||||
questionCountValue = findViewById(R.id.questionCountValue);
|
||||
gorgeesValue = findViewById(R.id.gorgeesValue);
|
||||
durationValue = findViewById(R.id.durationValue);
|
||||
|
||||
// Configuration du dropdown pour le provider IA
|
||||
String[] providers = new String[]{
|
||||
OpenAIService.AIProvider.OPENAI.getDisplayName(),
|
||||
OpenAIService.AIProvider.OPENROUTER.getDisplayName(),
|
||||
OpenAIService.AIProvider.ZAI.getDisplayName()
|
||||
};
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_dropdown_item_1line, providers);
|
||||
autoCompleteProvider.setAdapter(adapter);
|
||||
|
||||
// Charger le provider sauvegardé
|
||||
SharedPreferences providerPrefs = getSharedPreferences("MyPrefs", MODE_PRIVATE);
|
||||
String savedProvider = providerPrefs.getString("aiProvider", OpenAIService.AIProvider.OPENAI.getDisplayName());
|
||||
autoCompleteProvider.setText(savedProvider, false);
|
||||
|
||||
// Définir le provider sélectionné
|
||||
if (savedProvider.equals(OpenAIService.AIProvider.OPENROUTER.getDisplayName())) {
|
||||
selectedProvider = OpenAIService.AIProvider.OPENROUTER;
|
||||
} else if (savedProvider.equals(OpenAIService.AIProvider.ZAI.getDisplayName())) {
|
||||
selectedProvider = OpenAIService.AIProvider.ZAI;
|
||||
} else {
|
||||
selectedProvider = OpenAIService.AIProvider.OPENAI;
|
||||
}
|
||||
|
||||
// Listener pour le changement de provider
|
||||
autoCompleteProvider.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
String selected = (String) parent.getItemAtPosition(position);
|
||||
SharedPreferences.Editor editor = providerPrefs.edit();
|
||||
editor.putString("aiProvider", selected);
|
||||
editor.apply();
|
||||
|
||||
if (selected.equals(OpenAIService.AIProvider.OPENROUTER.getDisplayName())) {
|
||||
selectedProvider = OpenAIService.AIProvider.OPENROUTER;
|
||||
} else if (selected.equals(OpenAIService.AIProvider.ZAI.getDisplayName())) {
|
||||
selectedProvider = OpenAIService.AIProvider.ZAI;
|
||||
} else {
|
||||
selectedProvider = OpenAIService.AIProvider.OPENAI;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Initialiser les TextView avec les valeurs par défaut
|
||||
int initialQuestions = 50;
|
||||
int initialGorgees = 0;
|
||||
int initialRatio = 8;
|
||||
int initialDuration = 0; // 0 pour avoir 4-10 tours par défaut (MIN_DEFI_ROUNDS=4)
|
||||
|
||||
questionCountValue.setText(String.valueOf(initialQuestions));
|
||||
gorgeesValue.setText(String.valueOf(initialGorgees));
|
||||
durationValue.setText("0"); // Afficher 0 par défaut pour avoir 4-10 tours
|
||||
textView5.setText("Palier : Grosse merde");
|
||||
textViewRatioGen.setText("Ratio BDD/OPENAI : 1/" + initialRatio);
|
||||
|
||||
// Configuration de la seekBar1
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
seekBar1.setMin(20);
|
||||
}
|
||||
seekBar1.setMax(150);
|
||||
seekBar1.setProgress(50);
|
||||
|
||||
// Configuration de la seekBar2
|
||||
seekBar2.setMax(20);
|
||||
seekBar2.setProgress(0);
|
||||
|
||||
// Configuration de la seekBar3
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
seekBar2.setMin(0);
|
||||
seekBar3.setMin(1);
|
||||
}
|
||||
seekBar3.setMax(15);
|
||||
seekBar3.setProgress(8);
|
||||
|
||||
// Configuration de la seekBarDuration (permet valeurs négatives pour offset)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
seekBarDuration.setMin(-5); // Permet un offset négatif jusqu'à -5
|
||||
}
|
||||
seekBarDuration.setMax(15);
|
||||
seekBarDuration.setProgress(0); // Valeur par défaut à 0 pour avoir 4-10 tours (MIN_DEFI_ROUNDS=4)
|
||||
|
||||
// Configuration des listeners pour les seekBars
|
||||
seekBar1.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||
// Ajustement de la valeur au multiple de 10 le plus proche
|
||||
int adjustedProgress = Math.round(progress / 10) * 10;
|
||||
seekBar.setProgress(adjustedProgress);
|
||||
questionCountValue.setText(String.valueOf(adjustedProgress));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||
}
|
||||
});
|
||||
|
||||
seekBar2.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||
// Mise à jour du gorgeesValue en fonction de la valeur de la seekBar2
|
||||
gorgeesValue.setText(String.valueOf(progress));
|
||||
// Mise à jour du textView5 en fonction de la valeur de la seekBar2
|
||||
switch (progress) {
|
||||
case 0:
|
||||
textView5.setText("Palier : Grosse merde");
|
||||
break;
|
||||
case 2:
|
||||
textView5.setText("Palier : Petite merde");
|
||||
break;
|
||||
case 4:
|
||||
textView5.setText("Palier : Petit joueur");
|
||||
break;
|
||||
case 6:
|
||||
textView5.setText("Palier : Un p'tit verre ?!");
|
||||
break;
|
||||
case 8:
|
||||
textView5.setText("Palier : ça commence à aller");
|
||||
break;
|
||||
case 10:
|
||||
textView5.setText("Palier : Alcoolique");
|
||||
break;
|
||||
case 12:
|
||||
textView5.setText("Palier : COMA ETHYLIX");
|
||||
break;
|
||||
case 13:
|
||||
textView5.setText("Palier : APÉROOOOO !!");
|
||||
break;
|
||||
case 14:
|
||||
textView5.setText("Palier : LA J'SUIS BIENG");
|
||||
break;
|
||||
case 15:
|
||||
textView5.setText("Palier : J'VOIS PLUS RIENG");
|
||||
break;
|
||||
case 17:
|
||||
textView5.setText("Palier : J'AI PLUS DE VERRES");
|
||||
break;
|
||||
case 18 :
|
||||
textView5.setText("Palier : Soirée Murge");
|
||||
break;
|
||||
case 19:
|
||||
textView5.setText("Palier : Soirée Pétée");
|
||||
break;
|
||||
case 20:
|
||||
textView5.setText("Palier : L'ENDER DRAGON");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||
}
|
||||
});
|
||||
|
||||
// Configuration du checkBox // Q : IL sert à quoi ?
|
||||
// R : Il sert à activer/désactiver les vues en dessous
|
||||
|
||||
Button buttonTestApi = findViewById(R.id.ButtonTestApi);
|
||||
|
||||
checkBoxGPT = findViewById(R.id.checkBoxGPT);
|
||||
checkBoxGPT.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
// Activation/désactivation des vues en fonction de l'état du checkBox
|
||||
autoCompleteProvider.setEnabled(isChecked);
|
||||
// Pour le champ API key : on garde le layout activé pour le toggle password,
|
||||
// mais on désactive l'édition du texte
|
||||
editTextKeyGPT.setFocusable(isChecked);
|
||||
editTextKeyGPT.setFocusableInTouchMode(isChecked);
|
||||
editTextKeyGPT.setClickable(isChecked);
|
||||
editTextKeyGPT.setCursorVisible(isChecked);
|
||||
if (!isChecked) {
|
||||
editTextKeyGPT.clearFocus();
|
||||
}
|
||||
textViewRatioGen.setEnabled(isChecked);
|
||||
seekBar3.setEnabled(isChecked);
|
||||
buttonTestApi.setEnabled(isChecked);
|
||||
}
|
||||
});
|
||||
|
||||
// Configuration de la seekBar3
|
||||
seekBar3.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar3, int progress, boolean fromUser) {
|
||||
textViewRatioGen.setText("Ratio BDD/OPENAI : 1/" + progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartTrackingTouch(SeekBar seekBar3) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopTrackingTouch(SeekBar seekBar3) {
|
||||
}
|
||||
});
|
||||
|
||||
// Configuration de la seekBarDuration
|
||||
seekBarDuration.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||
// Afficher avec signe +/- pour bien voir l'offset, mais sans signe pour 0
|
||||
String displayValue;
|
||||
if (progress > 0) {
|
||||
displayValue = "+" + progress;
|
||||
} else {
|
||||
displayValue = String.valueOf(progress); // Affiche "0" ou "-X"
|
||||
}
|
||||
durationValue.setText(displayValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||
}
|
||||
});
|
||||
|
||||
// Partie OpenAI : enregistrement de la clé en dur.
|
||||
// Récupérer une instance des SharedPreferences
|
||||
SharedPreferences sharedPreferences = getSharedPreferences("MyPrefs", MODE_PRIVATE);
|
||||
final SharedPreferences.Editor editor = sharedPreferences.edit();
|
||||
// Récupérer l'EditText
|
||||
final EditText editText = findViewById(R.id.editTextGPT);
|
||||
// Récupérer la valeur enregistrée dans les SharedPreferences
|
||||
String apiKey = editText.getText().toString();
|
||||
|
||||
// Récupérer la valeur enregistrée dans les SharedPreferences
|
||||
String savedText = sharedPreferences.getString("savedText", "");
|
||||
editText.setText(savedText);
|
||||
|
||||
// Enregistrer le contenu de l'EditText lorsque l'utilisateur modifie le texte
|
||||
editText.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
// Enregistrer le texte dans les SharedPreferences
|
||||
editor.putString("savedText", editText.getText().toString());
|
||||
editor.apply();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void onClickButtonTestAPI(View view) {
|
||||
String apiKey = editTextKeyGPT.getText().toString();
|
||||
|
||||
if (apiKey == null || apiKey.isEmpty()) {
|
||||
Toast.makeText(this, "Veuillez entrer une clé API", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
// Créer un client OkHttpClient pour effectuer la requête
|
||||
OkHttpClient client = new OkHttpClient.Builder()
|
||||
.connectTimeout(10, java.util.concurrent.TimeUnit.SECONDS)
|
||||
.readTimeout(10, java.util.concurrent.TimeUnit.SECONDS)
|
||||
.build();
|
||||
|
||||
// Déterminer l'URL, le modèle et le format selon le provider sélectionné
|
||||
String testUrl;
|
||||
String testModel;
|
||||
String jsonBody;
|
||||
boolean isAnthropicFormat = (selectedProvider == OpenAIService.AIProvider.ZAI);
|
||||
|
||||
switch (selectedProvider) {
|
||||
case OPENROUTER:
|
||||
testUrl = "https://openrouter.ai/api/v1/chat/completions";
|
||||
testModel = "openai/gpt-3.5-turbo";
|
||||
// Format OpenAI
|
||||
jsonBody = "{\"model\":\"" + testModel + "\",\"messages\":[{\"role\":\"user\",\"content\":\"Test\"}],\"max_tokens\":5}";
|
||||
break;
|
||||
case ZAI:
|
||||
testUrl = "https://api.z.ai/v1/messages";
|
||||
testModel = "claude-3-5-sonnet";
|
||||
// Format Anthropic
|
||||
jsonBody = "{\"model\":\"" + testModel + "\",\"messages\":[{\"role\":\"user\",\"content\":\"Test\"}],\"max_tokens\":5}";
|
||||
break;
|
||||
case OPENAI:
|
||||
default:
|
||||
testUrl = "https://api.openai.com/v1/chat/completions";
|
||||
testModel = "gpt-3.5-turbo";
|
||||
jsonBody = "{\"model\":\"" + testModel + "\",\"messages\":[{\"role\":\"user\",\"content\":\"Test\"}],\"max_tokens\":5}";
|
||||
break;
|
||||
}
|
||||
|
||||
// Construire la requête
|
||||
Request.Builder requestBuilder = new Request.Builder()
|
||||
.url(testUrl)
|
||||
.addHeader("Content-Type", "application/json");
|
||||
|
||||
// Ajouter les headers selon le provider
|
||||
switch (selectedProvider) {
|
||||
case OPENAI:
|
||||
case OPENROUTER:
|
||||
requestBuilder.addHeader("Authorization", "Bearer " + apiKey);
|
||||
break;
|
||||
case ZAI:
|
||||
requestBuilder.addHeader("x-api-key", apiKey);
|
||||
requestBuilder.addHeader("anthropic-version", "2023-06-01");
|
||||
break;
|
||||
}
|
||||
|
||||
// Headers spécifiques pour OpenRouter
|
||||
if (selectedProvider == OpenAIService.AIProvider.OPENROUTER) {
|
||||
requestBuilder.addHeader("HTTP-Referer", "https://boidelo.app");
|
||||
requestBuilder.addHeader("X-Title", "Boidelo");
|
||||
}
|
||||
|
||||
Request request = requestBuilder
|
||||
.post(okhttp3.RequestBody.create(jsonBody, okhttp3.MediaType.get("application/json")))
|
||||
.build();
|
||||
|
||||
// Exécuter la requête de test
|
||||
client.newCall(request).enqueue(new Callback() {
|
||||
@Override
|
||||
public void onFailure(@NonNull Call call, IOException e) {
|
||||
String operation = "Test de connexion API " + selectedProvider.getDisplayName();
|
||||
String details = "Échec de connexion lors du test de l'API";
|
||||
ErrorHandler.logErrorOnly("JeuxParametres", operation + " - " + details, e);
|
||||
runOnUiThread(() -> {
|
||||
String userMessage = "Échec de connexion " + selectedProvider.getDisplayName() + " : " + e.getMessage();
|
||||
Toast.makeText(getApplicationContext(), userMessage, Toast.LENGTH_SHORT).show();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
if (response.isSuccessful()) {
|
||||
runOnUiThread(() -> {
|
||||
Toast.makeText(getApplicationContext(),
|
||||
"Connexion " + selectedProvider.getDisplayName() + " réussie !",
|
||||
Toast.LENGTH_SHORT).show();
|
||||
});
|
||||
} else {
|
||||
runOnUiThread(() -> {
|
||||
Toast.makeText(getApplicationContext(),
|
||||
"Erreur " + selectedProvider.getDisplayName() + " (HTTP " + response.code() + ")",
|
||||
Toast.LENGTH_SHORT).show();
|
||||
});
|
||||
}
|
||||
response.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void onClickButtonStart(View view) {
|
||||
// Récupérer les paramètres de la partie
|
||||
int nombreQuestions = seekBar1.getProgress();
|
||||
int ajoutGorgees = seekBar2.getProgress();
|
||||
int ratioBddOpenAI = seekBar3.getProgress();
|
||||
int durationDefis = seekBarDuration.getProgress();
|
||||
boolean openAI = checkBoxGPT.isChecked();
|
||||
|
||||
toutlesjoueurs = getIntent().getStringArrayListExtra("EXTRA_LIST_JOUEUR");
|
||||
// Récupérer les joueurs (vous devrez définir comment vous les récupérez)
|
||||
SharedPreferences sharedPreferences = getSharedPreferences("Joueurs", Context.MODE_PRIVATE);
|
||||
ArrayList<String> joueurs = new ArrayList<>();
|
||||
|
||||
for (int i = 1; i <= 3; i++) {
|
||||
String joueur = sharedPreferences.getString("J" + i, "");
|
||||
if (!joueur.isEmpty()) {
|
||||
joueurs.add(joueur);
|
||||
}
|
||||
}
|
||||
|
||||
// Récupérer les joueurs supplémentaires en utilisant une boucle
|
||||
int i = 4;
|
||||
String nomJoueur = sharedPreferences.getString("J" + i, "");
|
||||
while (!nomJoueur.isEmpty()) {
|
||||
joueurs.add(nomJoueur);
|
||||
i++;
|
||||
nomJoueur = sharedPreferences.getString("J" + i, "");
|
||||
}
|
||||
|
||||
// Créer une instance de la classe Jeux avec les paramètres récupérés
|
||||
Jeux jeux = new Jeux();
|
||||
|
||||
// Lancer l'activité Jeux avec les paramètres
|
||||
Intent intent = new Intent(this, Jeux.class);
|
||||
intent.putExtra("EXTRA_NOMBRE_QUESTIONS", nombreQuestions);
|
||||
intent.putExtra("EXTRA_AJOUT_GORGEE", ajoutGorgees);
|
||||
intent.putExtra("EXTRA_RATIO_OPENAI", ratioBddOpenAI);
|
||||
intent.putExtra("EXTRA_DURATION_DEFIS", durationDefis);
|
||||
intent.putExtra("EXTRA_OPENAI", openAI);
|
||||
final EditText editText = findViewById(R.id.editTextGPT);
|
||||
intent.putExtra("EXTRA_KEY_OPENAI", editText.getText().toString());
|
||||
intent.putExtra("EXTRA_AI_PROVIDER", selectedProvider.name());
|
||||
|
||||
toutlesjoueurs = getIntent().getStringArrayListExtra("EXTRA_LIST_JOUEUR");
|
||||
intent.putStringArrayListExtra("EXTRA_LIST_JOUEUR", (ArrayList<String>) toutlesjoueurs);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
@@ -1,339 +0,0 @@
|
||||
package com.example.boidelov3;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.InputType;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.google.android.material.textfield.TextInputEditText;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
String J1S, J2S, J3S;
|
||||
private int offset;
|
||||
private List<String> toutlesjoueurs;
|
||||
private TextInputEditText J1;
|
||||
private TextInputEditText J2;
|
||||
private TextInputEditText J3;
|
||||
private List<TextInputEditText> editTextList = new ArrayList<>();
|
||||
private List<View> playerRowList = new ArrayList<>(); // Liste des lignes de joueurs pour suppression
|
||||
private TextView playerCountText;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
// Récupérer le TextView du compteur
|
||||
playerCountText = findViewById(R.id.playerCountText);
|
||||
|
||||
// Initialiser les 3 champs statiques et ajouter les listeners
|
||||
J1 = findViewById(R.id.J1);
|
||||
J2 = findViewById(R.id.J2);
|
||||
J3 = findViewById(R.id.J3);
|
||||
|
||||
// Ajouter un TextWatcher à chaque champ pour mettre à jour le compteur
|
||||
TextWatcher playerCountWatcher = new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
updatePlayerCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {}
|
||||
};
|
||||
|
||||
if (J1 != null) J1.addTextChangedListener(playerCountWatcher);
|
||||
if (J2 != null) J2.addTextChangedListener(playerCountWatcher);
|
||||
if (J3 != null) J3.addTextChangedListener(playerCountWatcher);
|
||||
|
||||
// Mise à jour initiale
|
||||
updatePlayerCount();
|
||||
}
|
||||
|
||||
/**
|
||||
* Met à jour le compteur de joueurs en temps réel
|
||||
*/
|
||||
private void updatePlayerCount() {
|
||||
int count = 0;
|
||||
if (J1 != null && J1.getText() != null && !J1.getText().toString().isEmpty()) count++;
|
||||
if (J2 != null && J2.getText() != null && !J2.getText().toString().isEmpty()) count++;
|
||||
if (J3 != null && J3.getText() != null && !J3.getText().toString().isEmpty()) count++;
|
||||
|
||||
// Compter les champs dynamiques
|
||||
for (TextInputEditText edit : editTextList) {
|
||||
if (edit != null && edit.getText() != null && !edit.getText().toString().isEmpty()) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
if (playerCountText != null) {
|
||||
playerCountText.setText("Joueurs: " + count + " / min. 3");
|
||||
}
|
||||
}
|
||||
|
||||
public void onClickButton1(View view) {
|
||||
LinearLayout nameEntryLayout = findViewById(R.id.nameEntryLayout);
|
||||
|
||||
// Créer un conteneur pour la ligne de joueur (EditText + Bouton supprimer)
|
||||
FrameLayout playerRow = new FrameLayout(this);
|
||||
LinearLayout.LayoutParams rowParams = new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
);
|
||||
rowParams.setMargins(0, 0, 0, 12); // Marge identique aux champs statiques (12dp)
|
||||
playerRow.setLayoutParams(rowParams);
|
||||
|
||||
// Créer un nouveau TextInputLayout
|
||||
com.google.android.material.textfield.TextInputLayout textInputLayout = new com.google.android.material.textfield.TextInputLayout(this);
|
||||
FrameLayout.LayoutParams textInputParams = new FrameLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
);
|
||||
// Plus d'espace pour le bouton poubelle (68dp au lieu de 52dp)
|
||||
textInputParams.setMargins(0, 0, 68, 0);
|
||||
textInputLayout.setLayoutParams(textInputParams);
|
||||
textInputLayout.setBoxBackgroundMode(com.google.android.material.textfield.TextInputLayout.BOX_BACKGROUND_OUTLINE);
|
||||
textInputLayout.setHint("Nom");
|
||||
|
||||
// Appliquer exactement les mêmes styles que le XML
|
||||
// Créer un ColorStateList pour la bordure : grise par défaut, primaire quand focus
|
||||
int[][] states = new int[][] {
|
||||
new int[] { android.R.attr.state_focused},
|
||||
new int[] {}
|
||||
};
|
||||
int[] colors = new int[] {
|
||||
androidx.core.content.ContextCompat.getColor(this, R.color.primary),
|
||||
androidx.core.content.ContextCompat.getColor(this, android.R.color.darker_gray) // Bordure grise par défaut
|
||||
};
|
||||
android.content.res.ColorStateList strokeColorStateList = new android.content.res.ColorStateList(states, colors);
|
||||
textInputLayout.setBoxStrokeColorStateList(strokeColorStateList);
|
||||
textInputLayout.setBoxStrokeWidth(2); // Largeur de bordure comme dans le XML
|
||||
textInputLayout.setBoxBackgroundColor(androidx.core.content.ContextCompat.getColor(this, R.color.surface));
|
||||
textInputLayout.setDefaultHintTextColor(androidx.core.content.ContextCompat.getColorStateList(this, R.color.text_hint));
|
||||
textInputLayout.setEndIconMode(com.google.android.material.textfield.TextInputLayout.END_ICON_CLEAR_TEXT);
|
||||
|
||||
// Créer un nouveau TextInputEditText
|
||||
TextInputEditText newEditText = new TextInputEditText(this);
|
||||
newEditText.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
|
||||
newEditText.setInputType(InputType.TYPE_TEXT_FLAG_CAP_WORDS);
|
||||
newEditText.setMaxLines(1);
|
||||
newEditText.setTextSize(16);
|
||||
newEditText.setTextColor(androidx.core.content.ContextCompat.getColor(this, R.color.text_primary));
|
||||
newEditText.setHintTextColor(androidx.core.content.ContextCompat.getColor(this, R.color.text_hint));
|
||||
|
||||
// Ajouter un TextWatcher pour mettre à jour le compteur en temps réel
|
||||
newEditText.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
updatePlayerCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {}
|
||||
});
|
||||
|
||||
// Ajouter l'EditText au TextInputLayout
|
||||
textInputLayout.addView(newEditText);
|
||||
|
||||
// Créer le bouton de suppression - style élégant avec fond circulaire
|
||||
ImageButton deleteButton = new ImageButton(this);
|
||||
int dp40 = (int) (40 * getResources().getDisplayMetrics().density);
|
||||
FrameLayout.LayoutParams buttonParams = new FrameLayout.LayoutParams(dp40, dp40);
|
||||
buttonParams.setMargins(0, 0, 8, 0);
|
||||
buttonParams.gravity = android.view.Gravity.END | android.view.Gravity.CENTER_VERTICAL;
|
||||
deleteButton.setLayoutParams(buttonParams);
|
||||
|
||||
// Utiliser l'icône de poubelle Material (ic_menu_delete est une croix)
|
||||
deleteButton.setImageResource(android.R.drawable.ic_menu_delete);
|
||||
deleteButton.setColorFilter(androidx.core.content.ContextCompat.getColor(this, R.color.text_secondary));
|
||||
deleteButton.setScaleType(ImageButton.ScaleType.CENTER_INSIDE);
|
||||
|
||||
// Fond circulaire blanc avec bordure fine
|
||||
deleteButton.setBackgroundColor(androidx.core.content.ContextCompat.getColor(this, R.color.white));
|
||||
deleteButton.setPadding(8, 8, 8, 8);
|
||||
|
||||
// Arrondir le bouton en cercle via un OutlineProvider
|
||||
deleteButton.setOutlineProvider(new android.view.ViewOutlineProvider() {
|
||||
@Override
|
||||
public void getOutline(android.view.View view, android.graphics.Outline outline) {
|
||||
outline.setOval(0, 0, view.getWidth(), view.getHeight());
|
||||
}
|
||||
});
|
||||
deleteButton.setClipToOutline(true);
|
||||
|
||||
deleteButton.setContentDescription("Supprimer ce joueur");
|
||||
|
||||
// Configuration du bouton de suppression avec animation
|
||||
deleteButton.setOnClickListener(v -> removePlayerRow(playerRow, newEditText));
|
||||
|
||||
// Ajouter les éléments au conteneur
|
||||
playerRow.addView(textInputLayout);
|
||||
playerRow.addView(deleteButton);
|
||||
|
||||
// Ajouter à la liste et au layout avec animation
|
||||
editTextList.add(newEditText);
|
||||
playerRowList.add(playerRow);
|
||||
nameEntryLayout.addView(playerRow);
|
||||
|
||||
// Animation d'apparition
|
||||
BoideloAnimationUtils.popIn(playerRow, 300);
|
||||
BoideloAnimationUtils.triggerHapticFeedback(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Supprime une ligne de joueur avec animation
|
||||
*/
|
||||
private void removePlayerRow(View playerRow, TextInputEditText editText) {
|
||||
BoideloAnimationUtils.triggerHapticFeedback(this);
|
||||
|
||||
// Animation de suppression
|
||||
BoideloAnimationUtils.slideOutToRemove(playerRow, 300, () -> {
|
||||
// Retirer de la liste et du layout après l'animation
|
||||
editTextList.remove(editText);
|
||||
playerRowList.remove(playerRow);
|
||||
ViewGroup parent = (ViewGroup) playerRow.getParent();
|
||||
if (parent != null) {
|
||||
parent.removeView(playerRow);
|
||||
}
|
||||
// Mettre à jour le compteur après suppression
|
||||
updatePlayerCount();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void onClickButtonStart(View view) {
|
||||
// Récupérer les 3 premiers champs de saisie
|
||||
J1 = findViewById(R.id.J1);
|
||||
if (J1 != null && J1.getText() != null) {
|
||||
J1S = J1.getText().toString();
|
||||
} else {
|
||||
J1S = "";
|
||||
}
|
||||
|
||||
J2 = findViewById(R.id.J2);
|
||||
if (J2 != null && J2.getText() != null) {
|
||||
J2S = J2.getText().toString();
|
||||
} else {
|
||||
J2S = "";
|
||||
}
|
||||
|
||||
J3 = findViewById(R.id.J3);
|
||||
if (J3 != null && J3.getText() != null) {
|
||||
J3S = J3.getText().toString();
|
||||
} else {
|
||||
J3S = "";
|
||||
}
|
||||
|
||||
// Creation d'une liste avec tt les j et verif si elle est completé
|
||||
toutlesjoueurs = new ArrayList<>();
|
||||
if (!J1S.isEmpty()) {
|
||||
toutlesjoueurs.add(J1S);
|
||||
}
|
||||
if (!J2S.isEmpty()) {
|
||||
toutlesjoueurs.add(J2S);
|
||||
}
|
||||
if (!J3S.isEmpty()) {
|
||||
toutlesjoueurs.add(J3S);
|
||||
}
|
||||
|
||||
// Ajouter les champs dynamiques
|
||||
int nbnom = editTextList.size();
|
||||
for (int i = 0; i < nbnom; i++) {
|
||||
TextInputEditText editText = editTextList.get(i);
|
||||
if (editText != null && editText.getText() != null) {
|
||||
String nom = editText.getText().toString();
|
||||
if (!nom.isEmpty()) {
|
||||
toutlesjoueurs.add(nom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
openParametres();
|
||||
}
|
||||
|
||||
public void openParametres(){
|
||||
// Vérifier s'il y a des noms en double (insensible à la casse)
|
||||
List<String> nomsNormauxes = new ArrayList<>();
|
||||
for (String nom : toutlesjoueurs) {
|
||||
String nomNormalise = nom.trim().toLowerCase();
|
||||
if (nomsNormauxes.contains(nomNormalise)) {
|
||||
// Nom en double détecté
|
||||
Context context = getApplicationContext();
|
||||
CharSequence text = "Erreur : Le nom \"" + nom + "\" est utilisé plusieurs fois. Chaque joueur doit avoir un nom unique.";
|
||||
int duration = Toast.LENGTH_LONG;
|
||||
Toast toast = Toast.makeText(context, text, duration);
|
||||
toast.show();
|
||||
return; // Ne pas continuer
|
||||
}
|
||||
nomsNormauxes.add(nomNormalise);
|
||||
}
|
||||
|
||||
//enregistrement des joueurs dans les shared preferences Joueurs
|
||||
SharedPreferences sharedPreferences = getSharedPreferences("Joueurs", Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = sharedPreferences.edit();
|
||||
|
||||
editor.putString("J1", J1S != null ? J1S : "");
|
||||
editor.putString("J2", J2S != null ? J2S : "");
|
||||
editor.putString("J3", J3S != null ? J3S : "");
|
||||
|
||||
for (int i = 0; i < editTextList.size(); i++) {
|
||||
TextInputEditText editText = editTextList.get(i);
|
||||
if (editText != null && editText.getText() != null) {
|
||||
String nom = editText.getText().toString();
|
||||
editor.putString("J" + (i + 4), nom);
|
||||
}
|
||||
}
|
||||
|
||||
editor.apply();
|
||||
//Lancement de l'activité (Jeux_parametres)
|
||||
|
||||
Intent intent = new Intent(this, JeuxParametres.class);
|
||||
//Regarde si le pseudo est vide et envoie à l'activité jeux
|
||||
if (toutlesjoueurs.isEmpty()){
|
||||
Context context = getApplicationContext();
|
||||
CharSequence text = "Merci de rentrer des joueurs";
|
||||
int duration = Toast.LENGTH_SHORT;
|
||||
|
||||
Toast toast = Toast.makeText(context, text, duration);
|
||||
toast.show();
|
||||
}
|
||||
else {
|
||||
if (toutlesjoueurs.size() >= 3) {
|
||||
intent.putStringArrayListExtra("EXTRA_LIST_JOUEUR", (ArrayList<String>) toutlesjoueurs);
|
||||
intent.putExtra("EXTRA_OFFSET", offset);
|
||||
startActivity(intent);
|
||||
} else {
|
||||
Context context = getApplicationContext();
|
||||
CharSequence text = "La partie ne peut pas commencer avec moins de 3 joueurs";
|
||||
int duration = Toast.LENGTH_SHORT;
|
||||
Toast toast = Toast.makeText(context, text, duration);
|
||||
toast.show();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -98,6 +98,13 @@ public class QuestionRepository {
|
||||
return Result.success(selected);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne l'ensemble des IDs des questions déjà posées (toutes parties confondues).
|
||||
*/
|
||||
public Set<String> getAskedQuestionIds() {
|
||||
return new HashSet<>(prefs.getStringSet(KEY_ASKED_QUESTIONS, new HashSet<>()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Marque une question comme étant posée.
|
||||
*/
|
||||
|
||||
@@ -100,23 +100,25 @@ public class GameEngine {
|
||||
String result = questionText;
|
||||
int playerCount = 0;
|
||||
|
||||
if (hasJ1 && hasJ2 && hasJ3 && selectedPlayers.size() >= 3) {
|
||||
playerCount = 3;
|
||||
// Chaque balise est remplacée indépendamment : une question contenant
|
||||
// uniquement <J2> ou <J3> reste jouable (l'ordre J1, J2, J3 est conservé)
|
||||
if (hasJ1 && selectedPlayers.size() >= 1) {
|
||||
playerCount++;
|
||||
result = result.replace("<J1>", selectedPlayers.get(0));
|
||||
}
|
||||
if (hasJ2 && selectedPlayers.size() >= 2) {
|
||||
playerCount++;
|
||||
result = result.replace("<J2>", selectedPlayers.get(1));
|
||||
}
|
||||
if (hasJ3 && selectedPlayers.size() >= 3) {
|
||||
playerCount++;
|
||||
result = result.replace("<J3>", selectedPlayers.get(2));
|
||||
} else if (hasJ1 && hasJ2 && selectedPlayers.size() >= 2) {
|
||||
playerCount = 2;
|
||||
result = result.replace("<J1>", selectedPlayers.get(0));
|
||||
result = result.replace("<J2>", selectedPlayers.get(1));
|
||||
} else if (hasJ1 && selectedPlayers.size() >= 1) {
|
||||
playerCount = 1;
|
||||
result = result.replace("<J1>", selectedPlayers.get(0));
|
||||
}
|
||||
|
||||
return new PlayerReplaceResult(result, playerCount);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ajoute le texte des gorgées à la question.
|
||||
*/
|
||||
@@ -130,9 +132,11 @@ public class GameEngine {
|
||||
|
||||
int totalGorgees = question.getGorger() + addedGorgees;
|
||||
|
||||
// Accord du verbe selon le nombre de joueurs
|
||||
String boisVerb = (playerCount > 1) ? "boivent" : "boit";
|
||||
String distribueVerb = (playerCount > 1) ? "distribuent" : "distribue";
|
||||
// Accord du verbe selon le véritable sujet de la phrase
|
||||
boolean pluriel = isPluralSubject(questionText);
|
||||
String boisVerb = pluriel ? "boivent" : "boit";
|
||||
String distribueVerb = pluriel ? "distribuent" : "distribue";
|
||||
|
||||
|
||||
// Déterminer si boire ou distribuer
|
||||
if (question.isRecois() && question.isDistribution()) {
|
||||
@@ -152,6 +156,31 @@ public class GameEngine {
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Indique si le sujet de la question est pluriel, pour accorder le verbe
|
||||
* (boit/boivent, distribue/distribuent) ajouté en fin de question.
|
||||
*/
|
||||
private static boolean isPluralSubject(String questionText) {
|
||||
String t = questionText.trim().toLowerCase();
|
||||
if (t.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
// Sujet de groupe en tête de question : « Ceux qui… », « Les fans de… », « Tous ceux qui… »
|
||||
if (t.startsWith("ceux") || t.startsWith("celles") || t.startsWith("tous ") || t.startsWith("toutes ")
|
||||
|| t.startsWith("les ")) {
|
||||
return true;
|
||||
}
|
||||
// Sujet pluriel en toute fin de phrase, juste avant le verbe ajouté
|
||||
String[] finsPlurielles = {"perdants", "joueurs", "joueuses", "gens", "ceux", "celles", "eux", "elles",
|
||||
"abonnés", "abonnées", "végans", "célibataires", "filles", "garçons", "couples"};
|
||||
for (String fin : finsPlurielles) {
|
||||
if (t.endsWith(fin)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sélectionne n joueurs aléatoires uniques.
|
||||
*/
|
||||
|
||||
+79
-20
@@ -191,6 +191,24 @@ public class BoideloClassicGameActivity extends AppCompatActivity {
|
||||
if (result.isSuccess()) {
|
||||
Questions q = result.getData();
|
||||
questions = q != null && q.getQuestions() != null ? q.getQuestions() : new ArrayList<>();
|
||||
|
||||
// Exclure les questions déjà posées lors des parties précédentes,
|
||||
// pour qu'une question ne revienne pas tant que tout le stock n'a pas été épuisé
|
||||
java.util.Set<String> askedIds = questionRepository.getAskedQuestionIds();
|
||||
if (!askedIds.isEmpty()) {
|
||||
List<Question> unasked = new ArrayList<>();
|
||||
for (Question question : questions) {
|
||||
if (!askedIds.contains(String.valueOf(question.getId()))) {
|
||||
unasked.add(question);
|
||||
}
|
||||
}
|
||||
if (unasked.isEmpty()) {
|
||||
// Toutes les questions ont été posées : on repart sur le stock complet
|
||||
questionRepository.resetAskedQuestions();
|
||||
} else {
|
||||
questions = unasked;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
android.util.Log.e("BoideloClassicGame", "Erreur lors du chargement des questions: " + result.getError());
|
||||
questions = new ArrayList<>();
|
||||
@@ -407,10 +425,19 @@ public class BoideloClassicGameActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
askedQuestionIndices.add(questionIndex);
|
||||
// Persistance : la question ne reviendra plus lors des prochaines parties
|
||||
questionRepository.markQuestionAsAsked(question.getId());
|
||||
return question;
|
||||
}
|
||||
|
||||
// Si on ne trouve pas de question valide, retourner une question aléatoire
|
||||
// Si on ne trouve pas de question valide (toutes les restantes ont <manches>),
|
||||
// retourner une question non posée plutôt qu'une question au hasard
|
||||
if (!availableIndices.isEmpty()) {
|
||||
int fallbackIndex = availableIndices.get(random.nextInt(availableIndices.size()));
|
||||
askedQuestionIndices.add(fallbackIndex);
|
||||
questionRepository.markQuestionAsAsked(questions.get(fallbackIndex).getId());
|
||||
return questions.get(fallbackIndex);
|
||||
}
|
||||
return questions.get(random.nextInt(questions.size()));
|
||||
}
|
||||
|
||||
@@ -825,8 +852,10 @@ public class BoideloClassicGameActivity extends AppCompatActivity {
|
||||
question.setManchesRestantes(nbaleatoiremanches);
|
||||
|
||||
// Définir le message de fin de défi
|
||||
String stopMessage = "Fin de défi!\n" + questionText;
|
||||
question.setArretMessageManche(stopMessage);
|
||||
// Message de fin de défi : texte d'arrêt dédié s'il existe, sinon rappel de la consigne
|
||||
String arret = question.getArret();
|
||||
String stopMessage = "Fin de défi !\n" + (arret != null && !arret.trim().isEmpty() ? arret : questionText);
|
||||
|
||||
|
||||
questionsAvecManches.add(question);
|
||||
|
||||
@@ -873,24 +902,25 @@ public class BoideloClassicGameActivity extends AppCompatActivity {
|
||||
if (isJoueurs1 || isJoueurs2 || isJoueurs3) {
|
||||
List<String> aleatoirejoueurs = TroisJoueurAleatoire();
|
||||
|
||||
if (isJoueurs1 && isJoueurs2 && isJoueurs3 && aleatoirejoueurs.size() >= RANDOM_PLAYER_SELECTION_COUNT) {
|
||||
playerCount = 3;
|
||||
j1Name = aleatoirejoueurs.get(0);
|
||||
questionText = questionText.replace("<J1>", ErrorHandler.escapeHtml(j1Name));
|
||||
questionText = questionText.replace("<J2>", ErrorHandler.escapeHtml(aleatoirejoueurs.get(1)));
|
||||
questionText = questionText.replace("<J3>", ErrorHandler.escapeHtml(aleatoirejoueurs.get(2)));
|
||||
} else if (isJoueurs1 && isJoueurs2 && aleatoirejoueurs.size() >= TWO_PLAYERS) {
|
||||
playerCount = 2;
|
||||
j1Name = aleatoirejoueurs.get(0);
|
||||
questionText = questionText.replace("<J1>", ErrorHandler.escapeHtml(j1Name));
|
||||
questionText = questionText.replace("<J2>", ErrorHandler.escapeHtml(aleatoirejoueurs.get(1)));
|
||||
} else if (isJoueurs1 && aleatoirejoueurs.size() >= ONE_PLAYER) {
|
||||
playerCount = 1;
|
||||
// Chaque balise est remplacée indépendamment : une question contenant
|
||||
// uniquement <J2> ou <J3> reste jouable (l'ordre J1, J2, J3 est conservé)
|
||||
if (isJoueurs1 && aleatoirejoueurs.size() >= ONE_PLAYER) {
|
||||
playerCount++;
|
||||
j1Name = aleatoirejoueurs.get(0);
|
||||
questionText = questionText.replace("<J1>", ErrorHandler.escapeHtml(j1Name));
|
||||
}
|
||||
if (isJoueurs2 && aleatoirejoueurs.size() >= TWO_PLAYERS) {
|
||||
playerCount++;
|
||||
questionText = questionText.replace("<J2>", ErrorHandler.escapeHtml(aleatoirejoueurs.get(1)));
|
||||
}
|
||||
if (isJoueurs3 && aleatoirejoueurs.size() >= RANDOM_PLAYER_SELECTION_COUNT) {
|
||||
playerCount++;
|
||||
questionText = questionText.replace("<J3>", ErrorHandler.escapeHtml(aleatoirejoueurs.get(2)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return new PlayerSelectionResult(questionText, j1Name, playerCount);
|
||||
}
|
||||
|
||||
@@ -949,15 +979,19 @@ public class BoideloClassicGameActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
/**
|
||||
* Détermine l'action (boit/boivent ou distribue/distribuent) selon le nombre de joueurs
|
||||
/**
|
||||
* Détermine l'action (boit/boivent ou distribue/distribuent) selon le véritable
|
||||
* sujet de la phrase, pour un accord grammatical correct.
|
||||
*/
|
||||
private ActionChoiceResult determineActionChoice(Question question, String questionText, int playerCount) {
|
||||
boolean isBois = false;
|
||||
boolean isDistribue = false;
|
||||
|
||||
// Accord du verbe selon le nombre de joueurs
|
||||
String boisVerb = (playerCount > 1) ? "boivent" : "boit";
|
||||
String distribueVerb = (playerCount > 1) ? "distribuent" : "distribue";
|
||||
// Accord du verbe selon le sujet réel de la question
|
||||
boolean pluriel = isPluralSubject(questionText);
|
||||
String boisVerb = pluriel ? "boivent" : "boit";
|
||||
String distribueVerb = pluriel ? "distribuent" : "distribue";
|
||||
|
||||
|
||||
if (question.isRecois() && question.isDistribution()) {
|
||||
boolean rand = random.nextBoolean();
|
||||
@@ -979,6 +1013,31 @@ public class BoideloClassicGameActivity extends AppCompatActivity {
|
||||
return new ActionChoiceResult(questionText, isBois, isDistribue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indique si le sujet de la question est pluriel, pour accorder le verbe
|
||||
* (boit/boivent, distribue/distribuent) ajouté en fin de question.
|
||||
*/
|
||||
private boolean isPluralSubject(String questionText) {
|
||||
String t = questionText.trim().toLowerCase();
|
||||
if (t.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
// Sujet de groupe en tête de question : « Ceux qui… », « Les fans de… », « Tous ceux qui… »
|
||||
if (t.startsWith("ceux") || t.startsWith("celles") || t.startsWith("tous ") || t.startsWith("toutes ")
|
||||
|| t.startsWith("les ")) {
|
||||
return true;
|
||||
}
|
||||
// Sujet pluriel en toute fin de phrase, juste avant le verbe ajouté
|
||||
String[] finsPlurielles = {"perdants", "joueurs", "joueuses", "gens", "ceux", "celles", "eux", "elles",
|
||||
"abonnés", "abonnées", "végans", "célibataires", "filles", "garçons", "couples"};
|
||||
for (String fin : finsPlurielles) {
|
||||
if (t.endsWith(fin)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajoute le nombre de gorgées au texte de la question
|
||||
*/
|
||||
|
||||
@@ -51,6 +51,9 @@ public class Game89GameActivity extends AppCompatActivity {
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_game89_game);
|
||||
|
||||
// Garder l'écran allumé pendant la partie
|
||||
getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
|
||||
// Get intent data
|
||||
ArrayList<String> playerNames = getIntent().getStringArrayListExtra("PLAYERS");
|
||||
@@ -155,6 +158,9 @@ public class Game89GameActivity extends AppCompatActivity {
|
||||
challengeTitleTextView.setText(currentChallenge.getTitle());
|
||||
challengeDescriptionTextView.setText(currentChallenge.getDescription());
|
||||
|
||||
// Alerte sonore : le timer est terminé, un défi arrive
|
||||
com.example.boidelov3.utils.SoundManager.getInstance(this).playChallenge();
|
||||
|
||||
// Vibrate to alert players
|
||||
try {
|
||||
android.os.Vibrator vibrator = (android.os.Vibrator) getSystemService(android.content.Context.VIBRATOR_SERVICE);
|
||||
@@ -274,7 +280,7 @@ public class Game89GameActivity extends AppCompatActivity {
|
||||
int count = seekBar.getProgress() + 1; // 1-8
|
||||
players.get(playerIndex).addGorgees(count);
|
||||
Toast.makeText(this,
|
||||
players.get(playerIndex).getName() + " boit " + count + " gorgée(s)!",
|
||||
players.get(playerIndex).getName() + " boit " + count + " gorgée" + (count > 1 ? "s" : "") + " !",
|
||||
Toast.LENGTH_SHORT).show();
|
||||
});
|
||||
|
||||
@@ -288,10 +294,12 @@ public class Game89GameActivity extends AppCompatActivity {
|
||||
|
||||
StringBuilder stats = new StringBuilder();
|
||||
for (Game89Player player : players) {
|
||||
int total = player.getTotalGorgees();
|
||||
stats.append(player.getName())
|
||||
.append(": ")
|
||||
.append(player.getTotalGorgees())
|
||||
.append(" gorgée(s)\n\n");
|
||||
.append(total)
|
||||
.append(total > 1 ? " gorgées" : " gorgée")
|
||||
.append("\n\n");
|
||||
}
|
||||
|
||||
builder.setMessage(stats.toString());
|
||||
|
||||
@@ -29,6 +29,6 @@ public class Game89Player {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name + " (" + totalGorgees + " gorgées)";
|
||||
return name + " (" + totalGorgees + (totalGorgees > 1 ? " gorgées)" : " gorgée)");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,68 @@
|
||||
package com.example.boidelov3.rules;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.app.Activity;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.example.boidelov3.R;
|
||||
import com.google.android.material.appbar.MaterialToolbar;
|
||||
import com.google.android.material.button.MaterialButton;
|
||||
|
||||
/**
|
||||
* Règles détaillées d'un jeu, avec accès direct à sa configuration
|
||||
*/
|
||||
public class RuleDetailActivity extends AppCompatActivity {
|
||||
|
||||
public class RuleDetailActivity extends Activity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
// TODO: Implement rule detail screen
|
||||
setContentView(R.layout.activity_rule_detail);
|
||||
|
||||
MaterialToolbar toolbar = findViewById(R.id.toolbar);
|
||||
toolbar.setNavigationOnClickListener(v -> finish());
|
||||
|
||||
String gameId = getIntent().getStringExtra(RulesListActivity.EXTRA_GAME_ID);
|
||||
if (gameId == null) {
|
||||
gameId = RulesListActivity.GAME_CLASSIC;
|
||||
}
|
||||
|
||||
int iconRes = R.drawable.ic_boidelo_classic;
|
||||
int titleRes = R.string.boidelo_classic_title;
|
||||
int summaryRes = R.string.boidelo_classic_description;
|
||||
int detailRes = R.string.rules_classic_detail;
|
||||
Class<?> setupActivity = com.example.boidelov3.games.boideloclassic.BoideloClassicSetupActivity.class;
|
||||
|
||||
switch (gameId) {
|
||||
case RulesListActivity.GAME_89:
|
||||
iconRes = R.drawable.ic_game_89;
|
||||
titleRes = R.string.game_89_title;
|
||||
summaryRes = R.string.game_89_description;
|
||||
detailRes = R.string.rules_89_detail;
|
||||
setupActivity = com.example.boidelov3.games.game89.Game89SetupActivity.class;
|
||||
break;
|
||||
case RulesListActivity.GAME_PAPELITO:
|
||||
iconRes = R.drawable.ic_papelito;
|
||||
titleRes = R.string.rules_papelito_title;
|
||||
summaryRes = R.string.undercover_description;
|
||||
detailRes = R.string.rules_papelito_detail;
|
||||
setupActivity = com.example.boidelov3.games.papelito.PapelitoSetupActivity.class;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
toolbar.setTitle(getString(titleRes));
|
||||
((ImageView) findViewById(R.id.ruleIcon)).setImageResource(iconRes);
|
||||
((TextView) findViewById(R.id.ruleTitle)).setText(titleRes);
|
||||
((TextView) findViewById(R.id.ruleSummary)).setText(summaryRes);
|
||||
((TextView) findViewById(R.id.ruleText)).setText(detailRes);
|
||||
|
||||
MaterialButton playButton = findViewById(R.id.playButton);
|
||||
final Class<?> targetActivity = setupActivity;
|
||||
playButton.setOnClickListener(v ->
|
||||
startActivity(new Intent(this, targetActivity)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,43 @@
|
||||
package com.example.boidelov3.rules;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.app.Activity;
|
||||
|
||||
public class RulesListActivity extends Activity {
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.example.boidelov3.R;
|
||||
import com.google.android.material.appbar.MaterialToolbar;
|
||||
|
||||
/**
|
||||
* Liste des règles : une carte par jeu, ouvre le détail des règles
|
||||
*/
|
||||
public class RulesListActivity extends AppCompatActivity {
|
||||
|
||||
/** Identifiant du jeu dont on veut les règles */
|
||||
public static final String EXTRA_GAME_ID = "RULES_GAME_ID";
|
||||
public static final String GAME_CLASSIC = "classic";
|
||||
public static final String GAME_89 = "89";
|
||||
public static final String GAME_PAPELITO = "papelito";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
// TODO: Implement rules list screen
|
||||
setContentView(R.layout.activity_rules_list);
|
||||
|
||||
MaterialToolbar toolbar = findViewById(R.id.toolbar);
|
||||
toolbar.setNavigationOnClickListener(v -> finish());
|
||||
|
||||
findViewById(R.id.cardClassic).setOnClickListener(v -> openRules(GAME_CLASSIC));
|
||||
findViewById(R.id.card89).setOnClickListener(v -> openRules(GAME_89));
|
||||
findViewById(R.id.cardPapelito).setOnClickListener(v -> openRules(GAME_PAPELITO));
|
||||
}
|
||||
|
||||
/**
|
||||
* Ouvre l'écran de règles détaillées du jeu choisi
|
||||
*/
|
||||
private void openRules(String gameId) {
|
||||
Intent intent = new Intent(this, RuleDetailActivity.class);
|
||||
intent.putExtra(EXTRA_GAME_ID, gameId);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,6 +115,68 @@ public class SoundGenerator {
|
||||
}).start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Carillon convivial - annonce la fin d'un timer (nouveau défi)
|
||||
* Notes sinusoïdales do-mi-sol avec décroissance douce, timbre de cloche
|
||||
*/
|
||||
public synchronized void playChallenge() {
|
||||
if (isMuted || toneGenerator == null) return;
|
||||
new Thread(() -> {
|
||||
android.media.AudioTrack track = null;
|
||||
try {
|
||||
final int sampleRate = 44100;
|
||||
final double[] frequencies = {523.25, 659.25, 783.99}; // Do5, Mi5, Sol5
|
||||
final double noteDuration = 0.45; // durée de résonance d'une note (s)
|
||||
final double noteSpacing = 0.15; // décalage entre les notes (s)
|
||||
int totalSamples = (int) ((noteSpacing * 2 + noteDuration) * sampleRate);
|
||||
|
||||
short[] pcm = new short[totalSamples];
|
||||
for (int n = 0; n < frequencies.length; n++) {
|
||||
double freq = frequencies[n];
|
||||
int start = (int) (noteSpacing * n * sampleRate);
|
||||
int length = (int) (noteDuration * sampleRate);
|
||||
for (int i = 0; i < length && start + i < totalSamples; i++) {
|
||||
double t = (double) i / sampleRate;
|
||||
// Attaque rapide + décroissance exponentielle = timbre de cloche
|
||||
double envelope = Math.min(1.0, t / 0.01) * Math.exp(-t * 5.5);
|
||||
// Légère harmonique pour enrichir le timbre
|
||||
double sample = 0.75 * Math.sin(2 * Math.PI * freq * t)
|
||||
+ 0.25 * Math.sin(2 * Math.PI * freq * 2.0 * t);
|
||||
double value = pcm[start + i] / 32768.0 + sample * envelope * 0.55;
|
||||
pcm[start + i] = (short) (Math.max(-1.0, Math.min(1.0, value)) * Short.MAX_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
track = new android.media.AudioTrack.Builder()
|
||||
.setAudioAttributes(new android.media.AudioAttributes.Builder()
|
||||
.setUsage(android.media.AudioAttributes.USAGE_MEDIA)
|
||||
.setContentType(android.media.AudioAttributes.CONTENT_TYPE_MUSIC)
|
||||
.build())
|
||||
.setAudioFormat(new android.media.AudioFormat.Builder()
|
||||
.setEncoding(android.media.AudioFormat.ENCODING_PCM_16BIT)
|
||||
.setSampleRate(sampleRate)
|
||||
.setChannelMask(android.media.AudioFormat.CHANNEL_OUT_MONO)
|
||||
.build())
|
||||
.setTransferMode(android.media.AudioTrack.MODE_STREAM)
|
||||
.setBufferSizeInBytes(sampleRate)
|
||||
.build();
|
||||
track.play();
|
||||
track.write(pcm, 0, totalSamples);
|
||||
Thread.sleep((long) ((noteSpacing * 2 + noteDuration + 0.15) * 1000));
|
||||
} catch (Exception e) {
|
||||
Log.e("SoundGenerator", "Erreur lors de la lecture du carillon", e);
|
||||
} finally {
|
||||
if (track != null) {
|
||||
try {
|
||||
track.stop();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
track.release();
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Activer/Désactiver le son
|
||||
*/
|
||||
|
||||
@@ -64,6 +64,15 @@ public class SoundManager {
|
||||
soundGenerator.playFin();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Joue un carillon convivial (fin de timer / nouveau défi)
|
||||
*/
|
||||
public void playChallenge() {
|
||||
if (soundGenerator != null) {
|
||||
soundGenerator.playChallenge();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Active ou désactive le son
|
||||
|
||||
@@ -1,187 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/rootLayout"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".Jeux">
|
||||
|
||||
<!-- Progress Bar -->
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="8dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:max="100"
|
||||
android:progress="0"
|
||||
android:progressTint="@color/accent"
|
||||
android:progressBackgroundTint="@color/surface_variant"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- Progress Text -->
|
||||
<TextView
|
||||
android:id="@+id/progressText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="Question 1 / 50"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/progressBar" />
|
||||
|
||||
<!-- Question Type Indicator -->
|
||||
<LinearLayout
|
||||
android:id="@+id/questionIndicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/progressText">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/indicatorIcon"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:src="@drawable/ic_player_one"
|
||||
app:tint="@color/text_secondary" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/indicatorText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="1 joueur"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Main Question Container -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/questionCard"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
app:cardBackgroundColor="@color/card_background"
|
||||
app:cardCornerRadius="20dp"
|
||||
app:cardElevation="8dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/buttonContainer"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/questionIndicator">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="536dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="24dp">
|
||||
|
||||
<!-- Manche Question Text (petit) -->
|
||||
<TextView
|
||||
android:id="@+id/mancheCounter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/bg_card"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:text="Manches: 5"
|
||||
android:textColor="@color/primary"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
<TextView
|
||||
android:id="@+id/mancheQuestionText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:gravity="center"
|
||||
android:text="Défi en cours"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="italic"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<!-- Question Text -->
|
||||
<TextView
|
||||
android:id="@+id/textView1"
|
||||
style="@style/BoideloQuestionText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="Question"
|
||||
android:textSize="26sp"/>
|
||||
|
||||
<!-- Manche Counter (if applicable) -->
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<!-- Button Container -->
|
||||
<LinearLayout
|
||||
android:id="@+id/buttonContainer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<!-- Skip Button -->
|
||||
|
||||
<!-- Next Button -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/skipButton"
|
||||
style="@style/BoideloButton"
|
||||
android:layout_width="229dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_weight="1"
|
||||
android:onClick="onSkipClick"
|
||||
android:text="Abandonner le défi"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/error"
|
||||
app:backgroundTint="@color/surface_variant"
|
||||
app:cornerRadius="28dp"/>
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button"
|
||||
style="@style/BoideloButton.Primary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_weight="2"
|
||||
android:onClick="OnClickButton1"
|
||||
android:text="Suivant"
|
||||
android:textSize="18sp"
|
||||
app:cornerRadius="28dp"
|
||||
app:icon="@android:drawable/ic_media_play"
|
||||
app:iconGravity="textEnd"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,397 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/surface"
|
||||
tools:context=".JeuxParametres">
|
||||
|
||||
<!-- App Bar -->
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark"/>
|
||||
|
||||
<!-- Main Content -->
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<!-- Title -->
|
||||
<TextView
|
||||
android:id="@+id/Titre"
|
||||
style="@style/BoideloTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="@string/param_tres_du_jeu" />
|
||||
|
||||
<!-- Game Settings Card -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:cardBackgroundColor="@color/card_background"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="4dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<!-- Number of Questions -->
|
||||
<TextView
|
||||
style="@style/BoideloSubtitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="Paramètres de partie"
|
||||
app:drawableStartCompat="@android:drawable/ic_menu_edit"
|
||||
app:drawableTint="@color/primary"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="Nombre de questions"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/questionCountValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_card"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:text="50"
|
||||
android:textColor="@color/primary"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/seekBar1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:progressTint="@color/accent"
|
||||
android:thumbTint="@color/accent"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Drink Addition -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="Ajout de gorgées"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gorgeesValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_card"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:text="0"
|
||||
android:textColor="@color/accent"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/seekBar2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:progressTint="@color/accent"
|
||||
android:thumbTint="@color/accent"/>
|
||||
|
||||
<!-- Palier Indicator -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
app:cardBackgroundColor="@color/surface_variant"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:padding="12dp"
|
||||
android:text="Palier : Grosse merde"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Duration of Challenges -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewDuration"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="Durée des défis"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/durationValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_card"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:text="0"
|
||||
android:textColor="@color/primary"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/seekBarDuration"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:progressTint="@color/accent"
|
||||
android:thumbTint="@color/accent"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<!-- OpenAI Settings Card -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/openaiCard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:cardBackgroundColor="@color/card_background"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="4dp"
|
||||
app:strokeColor="@color/surface_variant"
|
||||
app:strokeWidth="1dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:src="@android:drawable/ic_menu_edit"
|
||||
app:tint="@color/primary" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView3"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/openai"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/checkBoxGPT"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Provider Selection -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInputLayoutProvider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:enabled="false"
|
||||
android:hint="Fournisseur IA"
|
||||
app:boxBackgroundColor="@color/surface"
|
||||
app:boxStrokeColor="@color/primary"
|
||||
app:hintTextColor="@color/text_hint"
|
||||
style="@style/Widget.Material3.TextInputLayout.OutlinedBox.ExposedDropdownMenu">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/autoCompleteProvider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"
|
||||
android:text="OpenAI" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<!-- API Key Input -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInputLayoutApiKey"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:hint="Clé API"
|
||||
app:boxBackgroundColor="@color/surface"
|
||||
app:boxStrokeColor="@color/primary"
|
||||
app:endIconMode="password_toggle"
|
||||
app:hintTextColor="@color/text_hint"
|
||||
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/editTextGPT"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textPassword"
|
||||
android:maxLines="1" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<!-- Ratio SeekBar -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewRatioGen"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:enabled="false"
|
||||
android:text="Ratio BDD/OPENAI : 1/8"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/seekBar3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="false"
|
||||
android:progressTint="@color/accent"
|
||||
android:thumbTint="@color/accent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Test API Button -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/ButtonTestApi"
|
||||
style="@style/BoideloButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="false"
|
||||
android:onClick="onClickButtonTestAPI"
|
||||
android:text="@string/test_de_connectivit_openai"
|
||||
app:backgroundTint="@color/surface_variant"
|
||||
app:icon="@android:drawable/ic_menu_info_details"
|
||||
app:iconGravity="textStart" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<!-- Bottom Spacer -->
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<!-- Floating Action Button -->
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
android:id="@+id/Go2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="16dp"
|
||||
android:onClick="onClickButtonStart"
|
||||
android:text="@string/commencer_a_vous_mettre_une_mine"
|
||||
android:textColor="@color/text_primary"
|
||||
app:backgroundTint="@color/accent"
|
||||
app:icon="@android:drawable/ic_media_play"
|
||||
app:iconTint="@color/text_primary" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@@ -1,218 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/surface"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<!-- App Bar -->
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark"/>
|
||||
|
||||
<!-- Main Content -->
|
||||
|
||||
<!-- Floating Action Button -->
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<!-- Title -->
|
||||
<TextView
|
||||
android:id="@+id/Titre"
|
||||
style="@style/BoideloTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="@string/bienvenue"/>
|
||||
|
||||
<!-- Player Count Indicator -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:cardBackgroundColor="@color/accent"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="2dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:padding="12dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:src="@drawable/ic_player_three"
|
||||
app:tint="@color/white"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/playerCountText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Joueurs: 0 / min. 3"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<!-- Players Input Card -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:cardBackgroundColor="@color/white"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="4dp"
|
||||
app:strokeColor="@color/surface_variant"
|
||||
app:strokeWidth="1dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/background"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
style="@style/BoideloCaption"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/laisse_vide_si_il_y_a_pas_assez_de_joueur"/>
|
||||
|
||||
<!-- Default Player Inputs -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInputLayoutJ1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:hint="@string/nom"
|
||||
app:boxBackgroundColor="@color/surface"
|
||||
app:boxStrokeColor="@color/primary"
|
||||
app:boxStrokeWidth="2dp"
|
||||
app:endIconMode="clear_text"
|
||||
app:errorEnabled="false"
|
||||
app:hintTextColor="@color/text_hint"
|
||||
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/J1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textPersonName"
|
||||
android:maxLines="1"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInputLayoutJ2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:hint="@string/nom"
|
||||
app:boxBackgroundColor="@color/surface"
|
||||
app:boxStrokeColor="@color/primary"
|
||||
app:boxStrokeWidth="2dp"
|
||||
app:endIconMode="clear_text"
|
||||
app:hintTextColor="@color/text_hint"
|
||||
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/J2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textPersonName"
|
||||
android:maxLines="1"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInputLayoutJ3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:hint="@string/nom"
|
||||
app:boxBackgroundColor="@color/surface"
|
||||
app:boxStrokeColor="@color/primary"
|
||||
app:boxStrokeWidth="2dp"
|
||||
app:endIconMode="clear_text"
|
||||
app:hintTextColor="@color/text_hint"
|
||||
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/J3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textPersonName"
|
||||
android:maxLines="1"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<!-- Dynamic Player Input Container -->
|
||||
<LinearLayout
|
||||
android:id="@+id/nameEntryLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"/>
|
||||
|
||||
<!-- Add Player Button -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/Validation"
|
||||
style="@style/BoideloButton.Secondary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:onClick="onClickButton1"
|
||||
android:text="@string/c_ok"
|
||||
app:icon="@android:drawable/ic_input_add"
|
||||
app:iconGravity="textStart"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<!-- Bottom Spacer for FAB -->
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
android:id="@+id/Go"
|
||||
android:layout_width="172dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="16dp"
|
||||
android:onClick="onClickButtonStart"
|
||||
android:text="@string/go"
|
||||
android:textColor="@color/text_primary"
|
||||
app:backgroundTint="@color/accent"
|
||||
app:icon="@android:drawable/ic_media_play"
|
||||
app:iconTint="@color/text_primary"/>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/background"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".rules.RuleDetailActivity">
|
||||
|
||||
<!-- App Bar -->
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@color/primary"
|
||||
android:navigationIcon="@android:drawable/ic_menu_revert"
|
||||
app:title="@string/rules_list_title"
|
||||
app:titleTextColor="@color/text_on_primary"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<!-- Main Content -->
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="24dp">
|
||||
|
||||
<!-- Icône du jeu -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="88dp"
|
||||
android:layout_height="88dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="16dp"
|
||||
app:cardBackgroundColor="@color/accent"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ruleIcon"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@string/rules_list_title"
|
||||
android:src="@drawable/ic_boidelo_classic"
|
||||
app:tint="@color/text_primary" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<!-- Titre du jeu -->
|
||||
<TextView
|
||||
android:id="@+id/ruleTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="Boidelo Classic" />
|
||||
|
||||
<!-- Résumé en une ligne -->
|
||||
<TextView
|
||||
android:id="@+id/ruleSummary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/text_hint"
|
||||
android:textSize="14sp"
|
||||
tools:text="Le jeu original de questions et défis" />
|
||||
|
||||
<!-- Séparateur -->
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:background="@color/card_stroke" />
|
||||
|
||||
<!-- Règles détaillées -->
|
||||
<TextView
|
||||
android:id="@+id/ruleText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:lineSpacingExtra="4dp"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="16sp"
|
||||
tools:text="Comment jouer..." />
|
||||
|
||||
<!-- Bouton Jouer -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/playButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="32dp"
|
||||
android:padding="14dp"
|
||||
android:text="@string/play_now"
|
||||
android:textColor="@color/text_on_primary"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:backgroundTint="@color/primary"
|
||||
app:cornerRadius="12dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@@ -0,0 +1,321 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/background"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".rules.RulesListActivity">
|
||||
|
||||
<!-- App Bar -->
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@color/primary"
|
||||
android:navigationIcon="@android:drawable/ic_menu_revert"
|
||||
app:title="@string/rules_list_title"
|
||||
app:titleTextColor="@color/text_on_primary"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<!-- Main Content -->
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<!-- Title -->
|
||||
<TextView
|
||||
style="@style/BoideloTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/rules_list_title" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/rules_list_subtitle"
|
||||
android:textColor="@color/text_hint"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<!-- Boidelo Classic -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cardClassic"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
app:cardBackgroundColor="@color/card_background"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="2dp"
|
||||
app:strokeColor="@color/card_stroke"
|
||||
app:strokeWidth="1dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:cardBackgroundColor="@color/accent"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@string/boidelo_classic_title"
|
||||
android:src="@drawable/ic_boidelo_classic"
|
||||
app:tint="@color/text_primary" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/boidelo_classic_title"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:text="@string/boidelo_classic_description"
|
||||
android:textColor="@color/text_hint"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="8dp"
|
||||
app:cardBackgroundColor="@color/primary"
|
||||
app:cardCornerRadius="20dp"
|
||||
app:cardElevation="2dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@string/rules_list_title"
|
||||
android:src="@android:drawable/ic_media_play"
|
||||
app:tint="@color/text_on_primary" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<!-- 89++ -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/card89"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
app:cardBackgroundColor="@color/card_background"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="2dp"
|
||||
app:strokeColor="@color/card_stroke"
|
||||
app:strokeWidth="1dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:cardBackgroundColor="@color/accent"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@string/game_89_title"
|
||||
android:src="@drawable/ic_game_89"
|
||||
app:tint="@color/text_primary" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/game_89_title"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:text="@string/game_89_description"
|
||||
android:textColor="@color/text_hint"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="8dp"
|
||||
app:cardBackgroundColor="@color/primary"
|
||||
app:cardCornerRadius="20dp"
|
||||
app:cardElevation="2dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@string/rules_list_title"
|
||||
android:src="@android:drawable/ic_media_play"
|
||||
app:tint="@color/text_on_primary" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<!-- Papelito -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cardPapelito"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
app:cardBackgroundColor="@color/card_background"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="2dp"
|
||||
app:strokeColor="@color/card_stroke"
|
||||
app:strokeWidth="1dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:cardBackgroundColor="@color/accent"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@string/rules_papelito_title"
|
||||
android:src="@drawable/ic_papelito"
|
||||
app:tint="@color/text_primary" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/rules_papelito_title"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:text="@string/undercover_description"
|
||||
android:textColor="@color/text_hint"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="8dp"
|
||||
app:cardBackgroundColor="@color/primary"
|
||||
app:cardCornerRadius="20dp"
|
||||
app:cardElevation="2dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@string/rules_list_title"
|
||||
android:src="@android:drawable/ic_media_play"
|
||||
app:tint="@color/text_on_primary" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@@ -77,4 +77,12 @@
|
||||
|
||||
<!-- Legacy strings (to be removed after refactor) -->
|
||||
<string name="test_de_connectivit_openai">Tester la connexion</string>
|
||||
<!-- Rules Section -->
|
||||
<string name="rules_list_title">Règles des jeux</string>
|
||||
<string name="rules_list_subtitle">Choisissez un jeu pour découvrir ses règles</string>
|
||||
<string name="play_now">Jouer maintenant</string>
|
||||
<string name="rules_papelito_title">Papelito (Undercover)</string>
|
||||
<string name="rules_classic_detail">Comment jouer ?\n\n1. Ajoutez au moins 3 joueurs, puis choisissez le nombre de questions et le nombre de gorgées.\n\n2. À chaque manche, l\'application pose une question du type « Ceux/Celles qui… » : tous les joueurs concernés boivent le nombre de gorgées affiché.\n\n3. Certaines questions permettent au joueur désigné de distribuer ses gorgées aux autres.\n\nLes défis à manches\n\nCertaines questions imposent une contrainte qui dure plusieurs manches (parler au passé, interdiction de rire…). La contrainte reste affichée en haut de l\'écran : celui qui ne la respecte pas boit !\n\nLe bouton « Passer » abandonne le défi en cours et enchaîne sur la question suivante.\n\nBon à savoir\n\n• Une question déjà posée ne revient pas tant que le stock n\'est pas épuisé.\n• Activez l\'option IA dans les paramètres pour générer des questions inédites (OpenAI, OpenRouter, Z.AI).\n• En fin de partie, l\'application affiche les statistiques de la soirée.</string>
|
||||
<string name="rules_89_detail">Le principe\n\n89++ se joue avec de vraies cartes (32 ou 52). L\'application sert d\'arbitre : elle gère le timer des défis et le compteur de gorgées.\n\nLes joueurs posent chacun leur tour une carte en annonçant le total cumulé à voix haute. Le joueur qui atteint ou dépasse 89 a perdu !\n\nValeurs spéciales\n\n• Valet : -10\n• Dame : change le sens du jeu\n• Roi : le joueur choisit la valeur\n\nLes gorgées\n\nÀ chaque dizaine atteinte (10, 20, 30…), distribuez autant de gorgées que la valeur de la dizaine. Attention, 70 = double : 14 gorgées à distribuer !\n\nLes défis\n\nUn compte à rebours s\'affiche en haut de l\'écran. Quand il se termine, un carillon retentit et un défi aléatoire apparaît : réalisez-le, puis touchez le défi pour relancer le compte à rebours.\n\nLe bouton « Enregistrer des gorgées » suit ce que boit chaque joueur, et les statistiques sont consultables à tout moment.</string>
|
||||
<string name="rules_papelito_detail">Le principe\n\nChaque joueur reçoit un mot secret… sauf les undercovers, qui reçoivent un mot légèrement différent du même univers.\n\nDéroulement d\'un tour\n\n1. Révélation : passez le téléphone, chaque joueur découvre son mot en privé.\n\n2. Discussion : à tour de rôle, chacun décrit son mot en une phrase, sans le dire. Les undercovers doivent improviser sans se faire repérer !\n\n3. Vote : chaque joueur vivant vote pour éliminer le plus suspect.\n\nFin de partie\n\n• Si tous les undercovers sont éliminés, les civils gagnent.\n• Si les undercovers résistent jusqu\'à la fin, ils gagnent !\n\nLes deux mots sont révélés à la fin de la partie.\n\nPersonnalisation\n\nDans la configuration, choisissez le nombre d\'undercovers et la durée de la discussion.</string>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user