Fast forward to the last page in the journal when opening it

This commit is contained in:
scrawl 2013-05-04 16:06:48 +02:00
parent d16bb26a48
commit a33e6b9c35
2 changed files with 13 additions and 0 deletions

View file

@ -152,6 +152,9 @@ struct MWGui::JournalViewModelImpl : JournalViewModel
if (active_only && i->second.isFinished ()) if (active_only && i->second.isFinished ())
continue; continue;
/// \todo quest.getName() is broken? returns empty string
//const MWDialogue::Quest& quest = i->second;
visitor (reinterpret_cast <QuestId> (&i->second), toUtf8Span (i->first)); visitor (reinterpret_cast <QuestId> (&i->second), toUtf8Span (i->first));
} }
} }

View file

@ -163,6 +163,16 @@ namespace
journalBook = createJournalBook (); journalBook = createJournalBook ();
pushBook (journalBook, 0); pushBook (journalBook, 0);
// fast forward to the last page
if (!mStates.empty ())
{
unsigned int & page = mStates.top ().mPage;
page = mStates.top().mBook->pageCount()-1;
if (page%2)
--page;
}
updateShowingPages();
} }
void close() void close()