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,13 +122,20 @@
|
||||||
$questtexttypes = $this->Questtexts->getQuesttexttypes();
|
$questtexttypes = $this->Questtexts->getQuesttexttypes();
|
||||||
$questtexttypes = array_map(function($t) { return $t['url']; }, $questtexttypes);
|
$questtexttypes = array_map(function($t) { return $t['url']; }, $questtexttypes);
|
||||||
$questtextCount = $this->Questtexts->getQuesttextsCountForQuest($quest['id'], $questtexttypeUrl);
|
$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);
|
$questtextPos = max(intval($questtextPos), 1);
|
||||||
|
try {
|
||||||
$questtext = $this->Questtexts->getQuesttextByUrl($quest['id'], $questtexttypeUrl, $questtextPos);
|
$questtext = $this->Questtexts->getQuesttextByUrl($quest['id'], $questtexttypeUrl, $questtextPos);
|
||||||
$questtext['count'] = $questtextCount;
|
$questtext['count'] = $questtextCount;
|
||||||
$questtext['sidequests'] = $this->Quests->getSidequestsForQuesttext($questtext['id']);
|
$questtext['sidequests'] = $this->Quests->getSidequestsForQuesttext($questtext['id']);
|
||||||
}
|
}
|
||||||
|
catch(\nre\exceptions\IdNotFoundException $e) {
|
||||||
|
if(!($questtexttypeUrl == 'Prolog' || $questtexttypeUrl == 'Epilog' && $questtextPos == 1)) {
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Quest status
|
// Quest status
|
||||||
$questStatus = $this->request->getGetParam('status');
|
$questStatus = $this->request->getGetParam('status');
|
||||||
|
|
@ -166,10 +173,13 @@
|
||||||
$task = $this->renderTask($questtype['classname'], $seminary, $questgroup, $quest, $character);
|
$task = $this->renderTask($questtype['classname'], $seminary, $questgroup, $quest, $character);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Has Character solved quest?
|
||||||
|
$solved = $this->Quests->hasCharacterSolvedQuest($quest['id'], $character['id']);
|
||||||
|
|
||||||
// Next Quest/Questgroup
|
// Next Quest/Questgroup
|
||||||
$nextQuests = null;
|
$nextQuests = null;
|
||||||
$nextQuestgroup = null;
|
$nextQuestgroup = null;
|
||||||
if($questtexttypeUrl == 'Epilog')
|
if($questtexttypeUrl == 'Epilog' || $solved)
|
||||||
{
|
{
|
||||||
if($quest['is_mainquest'])
|
if($quest['is_mainquest'])
|
||||||
{
|
{
|
||||||
|
|
@ -191,9 +201,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Has Character solved quest?
|
|
||||||
$solved = $this->Quests->hasCharacterSolvedQuest($quest['id'], $character['id']);
|
|
||||||
|
|
||||||
|
|
||||||
// Pass data to view
|
// Pass data to view
|
||||||
$this->set('seminary', $seminary);
|
$this->set('seminary', $seminary);
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1,8 +1,8 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: The Legend of Z\n"
|
"Project-Id-Version: The Legend of Z\n"
|
||||||
"POT-Creation-Date: 2014-03-21 23:55+0100\n"
|
"POT-Creation-Date: 2014-03-22 14:37+0100\n"
|
||||||
"PO-Revision-Date: 2014-03-21 23:55+0100\n"
|
"PO-Revision-Date: 2014-03-22 14:37+0100\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"Language: de_DE\n"
|
"Language: de_DE\n"
|
||||||
|
|
@ -129,18 +129,22 @@ msgid "unsolved"
|
||||||
msgstr "ungelöst"
|
msgstr "ungelöst"
|
||||||
|
|
||||||
#: ../../../views/html/quests/quest.tpl:60
|
#: ../../../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"
|
msgid "Go on"
|
||||||
msgstr "Hier geht es weiter"
|
msgstr "Hier geht es weiter"
|
||||||
|
|
||||||
#: ../../../views/html/quests/quest.tpl:65
|
#: ../../../views/html/quests/quest.tpl:74
|
||||||
#: ../../../views/html/quests/quest.tpl:67
|
#: ../../../views/html/quests/quest.tpl:76
|
||||||
msgid "Quest"
|
msgid "Quest"
|
||||||
msgstr "Quest"
|
msgstr "Quest"
|
||||||
|
|
||||||
#: ../../../views/html/quests/quest.tpl:81
|
|
||||||
msgid "Task"
|
|
||||||
msgstr "Aufgabe"
|
|
||||||
|
|
||||||
#: ../../../views/html/quests/submission.tpl:11
|
#: ../../../views/html/quests/submission.tpl:11
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "Submission of %s"
|
msgid "Submission of %s"
|
||||||
|
|
|
||||||
|
|
@ -55,8 +55,17 @@
|
||||||
</section>
|
</section>
|
||||||
<?php endif ?>
|
<?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)) : ?>
|
<?php if(!is_null($nextquests) || !is_null($nextquestgroup)) : ?>
|
||||||
<section>
|
<section>
|
||||||
|
<p><?=_('Task successfully solved')?></p>
|
||||||
<h1><?=_('Go on') ?></h1>
|
<h1><?=_('Go on') ?></h1>
|
||||||
<?php if(count($nextquests) > 0) : ?>
|
<?php if(count($nextquests) > 0) : ?>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
@ -75,11 +84,3 @@
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</section>
|
</section>
|
||||||
<?php endif ?>
|
<?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