show next Quests for Quests also on Prolog if Quest is solved
This commit is contained in:
parent
e0c84033a5
commit
d2cca2002e
4 changed files with 36 additions and 24 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -55,8 +55,17 @@
|
|||
</section>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if(!is_null($task)) : ?>
|
||||
<section>
|
||||
<h1><?=_('Task')?></h1>
|
||||
<p><?=\hhu\z\Utils::t($quest['task'])?></p>
|
||||
<?=$task?>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if(!is_null($nextquests) || !is_null($nextquestgroup)) : ?>
|
||||
<section>
|
||||
<p><?=_('Task successfully solved')?></p>
|
||||
<h1><?=_('Go on') ?></h1>
|
||||
<?php if(count($nextquests) > 0) : ?>
|
||||
<ul>
|
||||
|
|
@ -75,11 +84,3 @@
|
|||
<?php endif ?>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if(!is_null($task)) : ?>
|
||||
<section>
|
||||
<h1><?=_('Task')?></h1>
|
||||
<p><?=\hhu\z\Utils::t($quest['task'])?></p>
|
||||
<?=$task?>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue