From b40117449a2bd282fe5210f0d1fd775021a989ca Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Mon, 4 Apr 2011 11:23:15 +0200 Subject: [PATCH] added journal script interface --- apps/openmw/mwdialogue/journal.cpp | 18 +++++++++++++++++- apps/openmw/mwdialogue/journal.hpp | 11 +++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwdialogue/journal.cpp b/apps/openmw/mwdialogue/journal.cpp index 3b674a53e..031917c1c 100644 --- a/apps/openmw/mwdialogue/journal.cpp +++ b/apps/openmw/mwdialogue/journal.cpp @@ -1,10 +1,26 @@ #include "journal.hpp" + +#include namespace MWDialogue { - MWDialogue::Journal::Journal (MWWorld::Environment& environment) + Journal::Journal (MWWorld::Environment& environment) : mEnvironment (environment) {} + void Journal::addEntry (const std::string& id, int index) + { + std::cout << "journal: " << id << " at " << index << std::endl; + } + + void Journal::setJournalIndex (const std::string& id, int index) + { + std::cout << "journal (no entry): " << id << " at " << index << std::endl; + } + + int Journal::getJournalIndex (const std::string& id) const + { + return 0; + } } diff --git a/apps/openmw/mwdialogue/journal.hpp b/apps/openmw/mwdialogue/journal.hpp index 1988e230d..cd4814255 100644 --- a/apps/openmw/mwdialogue/journal.hpp +++ b/apps/openmw/mwdialogue/journal.hpp @@ -1,6 +1,8 @@ #ifndef GAME_MMDIALOG_JOURNAL_H #define GAME_MWDIALOG_JOURNAL_H +#include + namespace MWWorld { struct Environment; @@ -15,6 +17,15 @@ namespace MWDialogue public: Journal (MWWorld::Environment& environment); + + void addEntry (const std::string& id, int index); + ///< Add a journal entry. + + void setJournalIndex (const std::string& id, int index); + ///< Set the journal index without adding an entry. + + int getJournalIndex (const std::string& id) const; + ///< Get the journal index. }; }