From 33970b36a708e22e79402c24bb62b6ccffe6fbf3 Mon Sep 17 00:00:00 2001 From: T'JAMPENS QUENTIN p2406187 Date: Thu, 19 Jun 2025 23:11:31 +0200 Subject: [PATCH 1/8] Add step title, number and add step btn --- mainwindow.ui | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/mainwindow.ui b/mainwindow.ui index 2f533da..019029d 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -292,6 +292,39 @@ QFrame::Shadow::Raised + + + + 0 + 10 + 781 + 45 + + + + + + + 1 + + + + + + + + + + ... + + + + :/data/images/data/images/add.png:/data/images/data/images/add.png + + + + + From ce6614e29de3ac9ac53606129ab4e9bcee393c50 Mon Sep 17 00:00:00 2001 From: T'JAMPENS QUENTIN p2406187 Date: Thu, 19 Jun 2025 23:14:25 +0200 Subject: [PATCH 2/8] Display step title --- mainwindow.cpp | 7 ++++++- path.cpp | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index b37664a..340d269 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,6 +1,7 @@ #include "mainwindow.h" #include "ui_mainwindow.h" #include "path.h" +#include "step.h" #include "Undo.h" #include #include @@ -84,6 +85,7 @@ void MainWindow::loadPath() file.close(); Path* p = new Path(&file); + QList steps = p->getStep(); currentPath = p; path.append(p); @@ -93,8 +95,11 @@ void MainWindow::loadPath() ui->lengthSpin->setValue(p->getLength()); ui->durationSpin->setValue(p->getDuration()); ui->imagePath->setText(p->getImage()); - loadImage(p->getImage()); + + if(!steps.isEmpty()) { + ui->stepTitle->setText(p->getStep().first().getTitle()); + } } void MainWindow::addNewPath() diff --git a/path.cpp b/path.cpp index 7a421f7..26a2558 100644 --- a/path.cpp +++ b/path.cpp @@ -75,7 +75,7 @@ Path::Path(QFile *file){ QJsonArray stepsArray = json["steps"].toArray(); for (const QJsonValue &stepValue : stepsArray) { QJsonObject stepObj = stepValue.toObject(); - //step.append(Step(stepObj)); + step.append(Step(stepObj)); } } From 4f508adbb9ebb0ca86ac12fdec7c38f4550408e5 Mon Sep 17 00:00:00 2001 From: T'JAMPENS QUENTIN p2406187 Date: Thu, 19 Jun 2025 23:22:19 +0200 Subject: [PATCH 3/8] Display path number --- mainwindow.cpp | 5 +++++ mainwindow.ui | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 340d269..582913c 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -100,6 +100,11 @@ void MainWindow::loadPath() if(!steps.isEmpty()) { ui->stepTitle->setText(p->getStep().first().getTitle()); } + + int pathCount = path.length(); + ui->pathNumber->setMaximum(pathCount); + ui->pathNumber->setSuffix("/" + QString::number(pathCount)); + ui->pathNumber->setValue(path.indexOf(currentPath)+1); } void MainWindow::addNewPath() diff --git a/mainwindow.ui b/mainwindow.ui index 019029d..3781e08 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -57,7 +57,7 @@ QFrame::Shadow::Raised - + 10 From 2126a66c96d23060cca1e3110928b3bddc8bc17a Mon Sep 17 00:00:00 2001 From: T'JAMPENS QUENTIN p2406187 Date: Thu, 19 Jun 2025 23:34:31 +0200 Subject: [PATCH 4/8] Add longitude and latitude --- mainwindow.ui | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/mainwindow.ui b/mainwindow.ui index 3781e08..759d4d5 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -325,6 +325,83 @@ + + + + 0 + 60 + 781 + 63 + + + + + + + + + + Latitude + + + Qt::AlignmentFlag::AlignCenter + + + + + + + 6 + + + + + + + + + + + + + Longitude + + + Qt::AlignmentFlag::AlignCenter + + + + + + + 6 + + + + + + + + + + + + + Response + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + + + + From aed27c2483c68856f98c5fde49487ec81da28171 Mon Sep 17 00:00:00 2001 From: T'JAMPENS QUENTIN p2406187 Date: Fri, 20 Jun 2025 09:16:07 +0200 Subject: [PATCH 5/8] Display coordinates --- mainwindow.cpp | 2 ++ mainwindow.ui | 9 +++++++++ step.cpp | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 582913c..867ab0e 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -99,6 +99,8 @@ void MainWindow::loadPath() if(!steps.isEmpty()) { ui->stepTitle->setText(p->getStep().first().getTitle()); + ui->LatitudeSpin->setValue(p->getStep().first().getLatitude()); + ui->longitudeSpin->setValue(p->getStep().first().getLongitude()); } int pathCount = path.length(); diff --git a/mainwindow.ui b/mainwindow.ui index 759d4d5..a380958 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -353,6 +353,9 @@ 6 + + 90.000000000000000 + @@ -376,6 +379,12 @@ 6 + + -180.000000000000000 + + + 180.000000000000000 + diff --git a/step.cpp b/step.cpp index 861f414..491ab22 100644 --- a/step.cpp +++ b/step.cpp @@ -41,7 +41,7 @@ Step::Step( QJsonObject &in) QString gps = in["GPS"].toString(); QStringList parts = gps.split(" ", Qt::SkipEmptyParts); - QChar latDir = parts[0][0]; // c'est le premier QChar du QString t'as capté + QChar latDir = parts[0][0]; int latDeg = parts[1].toInt(); float latMin = parts[2].toFloat(); setLatitude(latDeg, latMin, latDir); From c4bcb8f0b855bddb0325eaa52a4f7383815d7595 Mon Sep 17 00:00:00 2001 From: T'JAMPENS QUENTIN p2406187 Date: Fri, 20 Jun 2025 11:00:41 +0200 Subject: [PATCH 6/8] Add getters for dialog Lists --- step.cpp | 10 ++++++++++ step.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/step.cpp b/step.cpp index 491ab22..1398647 100644 --- a/step.cpp +++ b/step.cpp @@ -34,6 +34,16 @@ Step::Step() { } +QList Step::getPersonnage() const +{ + return personnage; +} + +QList Step::getTexte() const +{ + return texte; +} + Step::Step( QJsonObject &in) { title = in["title"].toString(); diff --git a/step.h b/step.h index 8d93c46..1607679 100644 --- a/step.h +++ b/step.h @@ -26,6 +26,8 @@ public: float getLatitude() const; float getLongitude() const; int getResponse() const; + QList getPersonnage() const; + QList getTexte() const; }; #endif // STEP_H From 55837df72e924b4c1322206c7b0d068d3a007e4b Mon Sep 17 00:00:00 2001 From: T'JAMPENS QUENTIN p2406187 Date: Fri, 20 Jun 2025 11:01:03 +0200 Subject: [PATCH 7/8] display dialog --- mainwindow.cpp | 12 +++++++++--- mainwindow.ui | 42 +++++++++++++++++++++++++++++++++++------- 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 867ab0e..224cb9a 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -98,9 +98,15 @@ void MainWindow::loadPath() loadImage(p->getImage()); if(!steps.isEmpty()) { - ui->stepTitle->setText(p->getStep().first().getTitle()); - ui->LatitudeSpin->setValue(p->getStep().first().getLatitude()); - ui->longitudeSpin->setValue(p->getStep().first().getLongitude()); + Step firstStep = p->getStep().first(); + ui->stepTitle->setText(firstStep.getTitle()); + ui->LatitudeSpin->setValue(firstStep.getLatitude()); + ui->longitudeSpin->setValue(firstStep.getLongitude()); + + for(int i = 0; i < firstStep.getTexte().length(); i++) { + QString q = firstStep.getPersonnage().at(i) + ": " + firstStep.getTexte().at(i); + ui->dialogEdit->appendPlainText(q); + } } int pathCount = path.length(); diff --git a/mainwindow.ui b/mainwindow.ui index a380958..9f5614c 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -7,9 +7,21 @@ 0 0 800 - 626 + 598 + + + 0 + 0 + + + + + 0 + 0 + + MainWindow @@ -285,14 +297,20 @@ - + + + + 0 + 0 + + QFrame::Shape::StyledPanel QFrame::Shadow::Raised - + 0 @@ -325,7 +343,7 @@ - + 0 @@ -336,7 +354,7 @@ - + @@ -362,7 +380,7 @@ - + @@ -391,7 +409,7 @@ - + @@ -411,6 +429,16 @@ + + + + 10 + 130 + 761 + 81 + + + From ace7763606ec823c2184d3ff6de3ea788df094c6 Mon Sep 17 00:00:00 2001 From: T'JAMPENS QUENTIN p2406187 Date: Fri, 20 Jun 2025 11:01:18 +0200 Subject: [PATCH 8/8] add new parcours --- data/parcours2.json | 80 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 data/parcours2.json diff --git a/data/parcours2.json b/data/parcours2.json new file mode 100644 index 0000000..6ed3056 --- /dev/null +++ b/data/parcours2.json @@ -0,0 +1,80 @@ +{ + "name": "Chemin des Saveurs", + "city": "Bourg en Bresse", + "departement": 1, + "difficulty": 3, + "duration": 3.8, + "length": 24.6, + "description": "Parcours gourmand et culturel entre ville et campagne, à la découverte des trésors cachés de Bourg en Bresse.", + "image": "data/parcours1.png", + "steps": [ + { + "numero": 1, + "title": "Départ au centre-ville", + "GPS": "N 46 12.321 E 5 13.245", + "indice": "Sous la grande horloge, cherchez la plaque dorée.", + "reponse": "Horloge", + "dialogue": [ + { + "personnage": "Clémentine", + "texte": "Bienvenue à tous, voici le centre historique !" + }, + { + "personnage": "Léo", + "texte": "Regardez cette magnifique horloge, elle date du XIXe siècle !" + } + ] + }, + { + "numero": 2, + "title": "Marché couvert", + "GPS": "N 46 12.500 E 5 13.800", + "indice": "Le nombre de colonnes à l'entrée principale vous donnera la solution.", + "reponse": 6, + "dialogue": [ + { + "personnage": "Aurélie", + "texte": "Ici, on trouve les meilleurs fromages de la région !" + }, + { + "personnage": "Sami", + "texte": "Combien de colonnes vois-tu à l'entrée ?" + } + ] + }, + { + "numero": 3, + "title": "Au bord de la Reyssouze", + "GPS": "N 46 12.900 E 5 13.900", + "indice": "Sous le vieux pont de pierre, cherchez une gravure effacée.", + "reponse": "1912", + "dialogue": [ + { + "personnage": "Juliette", + "texte": "La Reyssouze apporte de la fraîcheur en été." + }, + { + "personnage": "Marc", + "texte": "Regarde cette inscription ancienne sur la pierre, tu arrives à la lire ?" + } + ] + }, + { + "numero": 4, + "title": "Arrivée à l'abbaye", + "GPS": "N 46 13.024 E 5 14.160", + "indice": "L'année inscrite au-dessus du portail principal.", + "reponse": 1655, + "dialogue": [ + { + "personnage": "Claire", + "texte": "Voilà l'abbaye ! Admire l'architecture." + }, + { + "personnage": "Nathalie", + "texte": "C'est ici la dernière étape. Observez bien la date !" + } + ] + } + ] +}