diff --git a/src/TombRaiderLinuxLauncher.cpp b/src/TombRaiderLinuxLauncher.cpp index f0cfa97..de91d9e 100644 --- a/src/TombRaiderLinuxLauncher.cpp +++ b/src/TombRaiderLinuxLauncher.cpp @@ -23,7 +23,9 @@ TombRaiderLinuxLauncher::TombRaiderLinuxLauncher(QWidget *parent) connect(ui->pushButtonLink, SIGNAL (clicked()), this, SLOT (linkClicked())); connect(ui->pushButtonDownload, SIGNAL (clicked()), this, SLOT (downloadClicked())); connect(ui->pushButtonInfo, SIGNAL (clicked()), this, SLOT (infoClicked())); + connect(ui->pushButtonWalkthrough, SIGNAL (clicked()), this, SLOT (walkthroughClicked())); connect(ui->infoBackButton, SIGNAL (clicked()), this, SLOT (backClicked())); + connect(ui->walkthroughBackButton, SIGNAL (clicked()), this, SLOT (backClicked())); connect(ui->setOptions, SIGNAL (clicked()), this, SLOT (setOptionsClicked())); connect(ui->listWidgetModds, SIGNAL(itemSelectionChanged()), this, SLOT(onListItemSelected())); @@ -366,15 +368,44 @@ void TombRaiderLinuxLauncher::infoClicked() if (retrievedIdentifier) { LevelData level = poolData.getData(retrievedIdentifier-1); - ui->infowebEngineView->setHtml(level.body); - ui->infowebEngineView->show(); + ui->infoWebEngineView->setHtml(level.body); + ui->infoWebEngineView->show(); ui->stackedWidget->setCurrentWidget(ui->stackedWidget->findChild("info")); + if(level.walkthrough != "") + { + ui->pushButtonWalkthrough->setEnabled(true); + } + else + { + ui->pushButtonWalkthrough->setEnabled(false); + } + } +} + +void TombRaiderLinuxLauncher::walkthroughClicked() +{ + QListWidgetItem *selectedItem = ui->listWidgetModds->currentItem(); + + int retrievedIdentifier = selectedItem->data(Qt::UserRole).toInt(); + if (retrievedIdentifier) + { + LevelData level = poolData.getData(retrievedIdentifier-1); + ui->walkthroughWebEngineView->setHtml(level.walkthrough); + ui->walkthroughWebEngineView->show(); + ui->stackedWidget->setCurrentWidget(ui->stackedWidget->findChild("walkthrough")); } } void TombRaiderLinuxLauncher::backClicked() { - ui->stackedWidget->setCurrentWidget(ui->stackedWidget->findChild("select")); + if(ui->stackedWidget->currentWidget() == ui->stackedWidget->findChild("info")) + { + ui->stackedWidget->setCurrentWidget(ui->stackedWidget->findChild("select")); + } + else if (ui->stackedWidget->currentWidget() == ui->stackedWidget->findChild("walkthrough")) + { + ui->stackedWidget->setCurrentWidget(ui->stackedWidget->findChild("select")); + } } /////////////////////////////////////////////////////////////////////////////////////////////////// TombRaiderLinuxLauncher::~TombRaiderLinuxLauncher() diff --git a/src/TombRaiderLinuxLauncher.h b/src/TombRaiderLinuxLauncher.h index 9a47b69..475467d 100644 --- a/src/TombRaiderLinuxLauncher.h +++ b/src/TombRaiderLinuxLauncher.h @@ -39,6 +39,10 @@ public slots: * */ void infoClicked(); + /** + * + */ + void walkthroughClicked(); /** * */ diff --git a/src/TombRaiderLinuxLauncher.ui b/src/TombRaiderLinuxLauncher.ui index 8ca0f78..c0979e7 100644 --- a/src/TombRaiderLinuxLauncher.ui +++ b/src/TombRaiderLinuxLauncher.ui @@ -46,7 +46,7 @@ - + 0 @@ -107,7 +107,7 @@ - + about:blank @@ -116,7 +116,7 @@ - + 0 @@ -144,7 +144,7 @@ - + 0 @@ -164,7 +164,7 @@ - + about:blank @@ -173,7 +173,7 @@ - + 0 @@ -188,7 +188,7 @@ - + 0 diff --git a/src/worker.h b/src/worker.h index cce6ecf..8134d2f 100644 --- a/src/worker.h +++ b/src/worker.h @@ -304,7 +304,14 @@ class Pool PictureData picture(query.value("Picture.name").toString(), query.value("Picture.data").toByteArray()); data.push_back( - LevelData(info, zip, picture, QString(""), QString(""), query.value("Level.body").toString(), QString("")) + LevelData( + info, + zip, + picture, // + QString(""), // replase with list of picurest + QString(""), // + query.value("Level.body").toString(), + query.value("Level.walkthrough").toString()) ); } } else {