2012-08-11 10:02:51 +00:00
|
|
|
#ifndef GAME_MWDIALOG_JOURNAL_H
|
2011-04-04 09:16:56 +00:00
|
|
|
#define GAME_MWDIALOG_JOURNAL_H
|
|
|
|
|
2012-08-09 10:56:03 +00:00
|
|
|
#include "../mwbase/journal.hpp"
|
2011-04-19 09:02:22 +00:00
|
|
|
|
2011-04-26 18:08:37 +00:00
|
|
|
#include "quest.hpp"
|
2011-04-04 09:23:15 +00:00
|
|
|
|
2011-04-04 09:16:56 +00:00
|
|
|
namespace MWDialogue
|
|
|
|
{
|
2011-04-26 18:08:37 +00:00
|
|
|
/// \brief The player's journal
|
2012-08-09 10:56:03 +00:00
|
|
|
class Journal : public MWBase::Journal
|
2011-04-04 09:16:56 +00:00
|
|
|
{
|
2011-04-22 09:16:39 +00:00
|
|
|
TEntryContainer mJournal;
|
2011-04-26 18:08:37 +00:00
|
|
|
TQuestContainer mQuests;
|
2011-04-26 18:48:36 +00:00
|
|
|
TTopicContainer mTopics;
|
2011-04-26 18:08:37 +00:00
|
|
|
|
2013-12-03 13:28:46 +00:00
|
|
|
private:
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 11:17:09 +00:00
|
|
|
Topic& getTopic(const ESM::RefId& id);
|
2011-04-04 09:16:56 +00:00
|
|
|
|
2023-02-17 18:20:29 +00:00
|
|
|
bool isThere(const ESM::RefId& topicId, const ESM::RefId& infoId = ESM::RefId()) const;
|
2013-12-03 13:28:46 +00:00
|
|
|
|
2013-12-03 13:39:54 +00:00
|
|
|
public:
|
|
|
|
Journal();
|
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void clear() override;
|
2011-04-04 09:16:56 +00:00
|
|
|
|
2023-06-30 23:30:25 +00:00
|
|
|
Quest* getQuestOrNull(const ESM::RefId& id) override;
|
2023-06-13 02:35:00 +00:00
|
|
|
///< Gets a pointer to the requested quest. Will return nullptr if the quest has not been started.
|
|
|
|
|
2023-06-30 23:30:25 +00:00
|
|
|
Quest& getOrStartQuest(const ESM::RefId& id) override;
|
|
|
|
///< Gets the quest requested. Attempts to create it and inserts it in quests if it is not yet started.
|
2023-06-13 02:35:00 +00:00
|
|
|
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 11:17:09 +00:00
|
|
|
void addEntry(const ESM::RefId& id, int index, const MWWorld::Ptr& actor) override;
|
2012-04-23 13:27:03 +00:00
|
|
|
///< Add a journal entry.
|
2016-01-11 22:07:01 +00:00
|
|
|
/// @param actor Used as context for replacing of escape sequences (%name, etc).
|
2011-04-04 09:23:15 +00:00
|
|
|
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 11:17:09 +00:00
|
|
|
void setJournalIndex(const ESM::RefId& id, int index) override;
|
2011-04-04 09:23:15 +00:00
|
|
|
///< Set the journal index without adding an entry.
|
2013-05-15 15:54:18 +00:00
|
|
|
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 11:17:09 +00:00
|
|
|
int getJournalIndex(const ESM::RefId& id) const override;
|
2011-04-04 09:23:15 +00:00
|
|
|
///< Get the journal index.
|
|
|
|
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 11:17:09 +00:00
|
|
|
void addTopic(const ESM::RefId& topicId, const ESM::RefId& infoId, const MWWorld::Ptr& actor) override;
|
2011-04-04 09:23:15 +00:00
|
|
|
/// \note topicId must be lowercase
|
|
|
|
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 11:17:09 +00:00
|
|
|
void removeLastAddedTopicResponse(const ESM::RefId& topicId, std::string_view actorName) override;
|
2011-04-04 09:23:15 +00:00
|
|
|
///< Removes the last topic response added for the given topicId and actor name.
|
2014-06-10 14:36:22 +00:00
|
|
|
/// \note topicId must be lowercase
|
2011-04-19 09:02:22 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
TEntryIter begin() const override;
|
|
|
|
///< Iterator pointing to the begin of the main journal.
|
2022-09-22 18:26:05 +00:00
|
|
|
///
|
2014-06-10 14:36:22 +00:00
|
|
|
/// \note Iterators to main journal entries will never become invalid.
|
|
|
|
|
2022-08-16 19:15:03 +00:00
|
|
|
TEntryIter end() const override;
|
2014-06-10 14:36:22 +00:00
|
|
|
///< Iterator pointing past the end of the main journal.
|
2011-04-26 18:48:36 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
TQuestIter questBegin() const override;
|
2011-04-19 09:02:22 +00:00
|
|
|
///< Iterator pointing to the first quest (sorted by topic ID)
|
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
TQuestIter questEnd() const override;
|
2011-04-19 09:02:22 +00:00
|
|
|
///< Iterator pointing past the last quest.
|
2011-04-26 18:08:37 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
TTopicIter topicBegin() const override;
|
2011-04-26 18:08:37 +00:00
|
|
|
///< Iterator pointing to the first topic (sorted by topic ID)
|
2022-09-22 18:26:05 +00:00
|
|
|
///
|
2011-04-26 18:08:37 +00:00
|
|
|
/// \note The topic ID is identical with the user-visible topic string.
|
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
TTopicIter topicEnd() const override;
|
2011-04-26 18:08:37 +00:00
|
|
|
///< Iterator pointing past the last topic.
|
2011-04-26 18:48:36 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
int countSavedGameRecords() const override;
|
2011-04-26 18:48:36 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void write(ESM::ESMWriter& writer, Loading::Listener& progress) const override;
|
2013-12-03 13:28:46 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void readRecord(ESM::ESMReader& reader, uint32_t type) override;
|
2011-04-04 09:16:56 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|