From 9e94794e47615435c3108725bfe870bce7482f67 Mon Sep 17 00:00:00 2001 From: coderkun Date: Sat, 22 Mar 2014 14:38:14 +0100 Subject: [PATCH] show next Quests for Quests also on Prolog if Quest is solved --- controllers/QuestsController.inc | 23 +++++++++++++------- locale/de_DE/LC_MESSAGES/The Legend of Z.mo | Bin 2615 -> 2720 bytes locale/de_DE/LC_MESSAGES/The Legend of Z.po | 20 ++++++++++------- views/html/quests/quest.tpl | 17 ++++++++------- 4 files changed, 36 insertions(+), 24 deletions(-) diff --git a/controllers/QuestsController.inc b/controllers/QuestsController.inc index 184cef93..ca8622f7 100644 --- a/controllers/QuestsController.inc +++ b/controllers/QuestsController.inc @@ -122,12 +122,19 @@ $questtexttypes = $this->Questtexts->getQuesttexttypes(); $questtexttypes = array_map(function($t) { return $t['url']; }, $questtexttypes); $questtextCount = $this->Questtexts->getQuesttextsCountForQuest($quest['id'], $questtexttypeUrl); - if($questtextCount > 0 && in_array($questtexttypeUrl, $questtexttypes)) + if(/*$questtextCount > 0 && */in_array($questtexttypeUrl, $questtexttypes)) { $questtextPos = max(intval($questtextPos), 1); - $questtext = $this->Questtexts->getQuesttextByUrl($quest['id'], $questtexttypeUrl, $questtextPos); - $questtext['count'] = $questtextCount; - $questtext['sidequests'] = $this->Quests->getSidequestsForQuesttext($questtext['id']); + try { + $questtext = $this->Questtexts->getQuesttextByUrl($quest['id'], $questtexttypeUrl, $questtextPos); + $questtext['count'] = $questtextCount; + $questtext['sidequests'] = $this->Quests->getSidequestsForQuesttext($questtext['id']); + } + catch(\nre\exceptions\IdNotFoundException $e) { + if(!($questtexttypeUrl == 'Prolog' || $questtexttypeUrl == 'Epilog' && $questtextPos == 1)) { + throw $e; + } + } } // Quest status @@ -166,10 +173,13 @@ $task = $this->renderTask($questtype['classname'], $seminary, $questgroup, $quest, $character); } + // Has Character solved quest? + $solved = $this->Quests->hasCharacterSolvedQuest($quest['id'], $character['id']); + // Next Quest/Questgroup $nextQuests = null; $nextQuestgroup = null; - if($questtexttypeUrl == 'Epilog') + if($questtexttypeUrl == 'Epilog' || $solved) { if($quest['is_mainquest']) { @@ -191,9 +201,6 @@ } } - // Has Character solved quest? - $solved = $this->Quests->hasCharacterSolvedQuest($quest['id'], $character['id']); - // Pass data to view $this->set('seminary', $seminary); diff --git a/locale/de_DE/LC_MESSAGES/The Legend of Z.mo b/locale/de_DE/LC_MESSAGES/The Legend of Z.mo index 0f2ca49e2ddf1e2fa39b5aa5a2aabd4b70abb0a1..b612a21739e55e3deb8c3bba452f3d7ea3a6415c 100644 GIT binary patch delta 1160 zcmdlkvOu){o)F7a1_lNOeFg>w83qQ1DU1vZ&I}9;Jj@_b1_lWh1_l8J1_ntM1_p5k z1_mt_1_mw$1_mb<1_ogU1_oai1_pix28Ki^UC6?~z|FwG&Typ zRt5$R1_lOUC@sSZu|Sm-qFx)yH-gd@tPl^_v4T8Z&%ofx%D`a2z`#(+3i0VGRt5$Z z1_p-RtPBhi3=9khpc-#N#qUEcdIA-H%L?(?XQ+jLp)?B{B!sxxAP$j-(rRoFdvw_t z7+C5V7#QrJ63%Q8pLnq`FwAFUUS`f#MR%Wl&&XU{KxsmU#`Mcw%w3LUCzwa%ypLT4_#Br9yFj zPFZTo5rLm(^IMGQ@> z3=Av`3=ET@8fHNG^H?DkEryD(VTJf;6D!1Fd!Y1TR!GR4g7WV{>8DWh-$2d#3lgsf z1t}ZEU`{p$hWU&P3_@%Whiqbp1o>fhh>LHtGcbrSFfcr0XJC+EU|{&o4hdQj4h9B6 z1_lNt4oC=^a6qEOkptq8Kn{olQ#l~!=0L@3IT#q~L2)yY0}^NRIUqr`8cJ`3YTOPr za32T6A?G+482A_%7;bVv9R32T{v%ZVcPRZ2O0#l8%;n)^U@&B0U=ZSDV6b9fU~u7N zs0SymdQJugb_NE92~dSII3Whl--~bd;;#!IU5*5r03=HxN z3=GN)3=CpWc{v71@PpET1_LBWLB0m%3Xl?Lj%83{U|>)H2{14)$TBc6=t9}5P+A8> tJ7**oB_@|_R$y7kIQbUqPIf~DBV#L5)5){g6k+VmhuFlKCo^)*2LQ1xQ?~#B diff --git a/locale/de_DE/LC_MESSAGES/The Legend of Z.po b/locale/de_DE/LC_MESSAGES/The Legend of Z.po index 57f560a6..390e7ef1 100644 --- a/locale/de_DE/LC_MESSAGES/The Legend of Z.po +++ b/locale/de_DE/LC_MESSAGES/The Legend of Z.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: The Legend of Z\n" -"POT-Creation-Date: 2014-03-21 23:55+0100\n" -"PO-Revision-Date: 2014-03-21 23:55+0100\n" +"POT-Creation-Date: 2014-03-22 14:37+0100\n" +"PO-Revision-Date: 2014-03-22 14:37+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: de_DE\n" @@ -129,18 +129,22 @@ msgid "unsolved" msgstr "ungelöst" #: ../../../views/html/quests/quest.tpl:60 +msgid "Task" +msgstr "Aufgabe" + +#: ../../../views/html/quests/quest.tpl:68 +msgid "Task successfully solved" +msgstr "Du hast die Aufgabe erfolgreich gelöst" + +#: ../../../views/html/quests/quest.tpl:69 msgid "Go on" msgstr "Hier geht es weiter" -#: ../../../views/html/quests/quest.tpl:65 -#: ../../../views/html/quests/quest.tpl:67 +#: ../../../views/html/quests/quest.tpl:74 +#: ../../../views/html/quests/quest.tpl:76 msgid "Quest" msgstr "Quest" -#: ../../../views/html/quests/quest.tpl:81 -msgid "Task" -msgstr "Aufgabe" - #: ../../../views/html/quests/submission.tpl:11 #, php-format msgid "Submission of %s" diff --git a/views/html/quests/quest.tpl b/views/html/quests/quest.tpl index bd88ff3a..45e6cdc3 100644 --- a/views/html/quests/quest.tpl +++ b/views/html/quests/quest.tpl @@ -55,8 +55,17 @@ + +
+

+

+ +
+ +
+

0) : ?>
    @@ -75,11 +84,3 @@
- - -
-

-

- -
-