From d2cca2002e4ac744ad1be2b83f454dd4163c8cd0 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 zcmXxjPe_w-9LMqB+T5D1H2*ZUEgvhl)XZE_B4K}wAiIg=4c@8ae=2{)Ugh& zl1_Olh&qIj2O)$mor1bakR3X7$PU>dh^Y5x`|XS0y?%e5=l9oVwSBpx{JAyo&=A99 zjC|lTW&$IAeu&P1F)i4IQ5?WVJdbTSh0U0@-oPg6i`Kiii~3^><1=i)SID?!vuYdO zVT6wN)=#$moAn0<>HmdVz#r7}K}Oq&ZPplSf*=p?0>7n((hRKt(6iglg}xCQ$PXVSxF~xb2ug4LpfY zxQ1!egWI9n(Ff?%%467$Nz?*QqmKA8?!gS|WJ;*3xrJKDePl@U6gBQkEUV)U1r6{K zb$4HoO_=Z2pQsmqqXztkT1Ye7-i_Tzlj%pjmqI;1YCU7UX#1ydg#PI;=RZc_4h>q- zI67}9yYaVq%Mbz`R8##YXc+WOG zLQcLK`T+Dr#B0^+7owte)@s`h;8F63tq)>1sYNTgNPRU2$$nC?k7OD%Kt^=`ie7SW zwN$%XU58exQ#nNTkctGU9oIv8Tkt!(*U_@Zg=y5p5H8Q1f&r9xrB@#YFQ-I>Z#!&)fijGP!deyVaM*jq2JEC!?g sAGGvXYecHX>nWX+yy!7wCg=(5`-n6-zCSNaI zot<3IPl~YI?mI2t5kkHoHo+5p{%G z3qj(g|G*7YNp)(KT+QEDYvnql0a`QBS-RrX?j70xbolx3$csWI`Zko?j4hURWx5~q V_Vnc5#Ixtuh1Ga{Bo|8NPXVzlQ?~#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 @@
- - -
-

-

- -
-