From dd8964da99a2d2ace31fb0ed4f68b689d495c8b2 Mon Sep 17 00:00:00 2001 From: Bodillium Date: Wed, 22 Oct 2014 21:54:37 +1100 Subject: [PATCH 01/57] Begin reworking files and directories section First attempt at LaTeX and Git! --- manual/opencs/files_and_directories.tex | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/manual/opencs/files_and_directories.tex b/manual/opencs/files_and_directories.tex index fc9ae878a..39d918b46 100644 --- a/manual/opencs/files_and_directories.tex +++ b/manual/opencs/files_and_directories.tex @@ -1,22 +1,23 @@ \section{Files and Directories} \subsection{Introduction} -This section of the manual covers usage of files and directories by the OpenCS. Files and directories are file system concepts, -and you are probably already familiar with it. We won't try to explain this concepts, we will just focus on \OCS. +This section of the manual describes the directories and file types used by OpenCS. A file is a resource for storing data, identified by its +filename extension (e.g. .exe, .jpg, .txt), whereas a directory is a folder or file system structure in which these files are stored. You +are most likely already familiar with these concepts. \subsection{Used terms} %TODO \subsection{Basics} \paragraph{Directories} -OpenMW and \OCS{} uses multiple directories on file systems. First of, there is a \textbf{user directory} that holds configuration -files and few different folders. The location of the user directory is hard coded for each supported operating system. +OpenMW and \OCS{} store their files in multiple directories. Firstly, there is the \textbf{user directory} that holds configuration +files and several other folders. The location of the user directory is hard coded for each supported operating system. %TODO list paths. -In addition to this single hard coded directory, both \OMW{} and \OCS{} need a~place to seek for actual data files of the game: -textures, models, sounds and files that store records of objects in game; dialogues and so one -- so called content files. We support -multiple such paths (we call it \textbf{data paths}) as specified in the configuration. Usually one data path points to the directory -where original \MW{} is either installed or unpacked. You are free to specify as many data paths as you would like, -however, there is one special data path that, as described later, is used to store newly created content files. +In addition to the user directory, both \OMW{} and \OCS{} need a place to store the game’s actual data files: for example, the +textures, models, sounds and records of in-game objects. We support multiple paths to these files (termed \textbf{data paths}), +as specified in the configuration. Usually, one data path points to the directory where \MW{} is installed, however, you are +free to specify as many data paths as you would like. In addition, one particular data path, as described below, is used to store +newly created content files. \paragraph{Content files} \BS{} \MW{} engine is using two types of files: ESM (master) and ESP (plugin). The distinction between those From f70ddb5e980b543e146d4d95662a0d09f0bff400 Mon Sep 17 00:00:00 2001 From: Bodillium Date: Thu, 23 Oct 2014 15:46:43 +1100 Subject: [PATCH 02/57] Finish reworking files and directories section --- manual/opencs/files_and_directories.tex | 135 ++++++++++++------------ 1 file changed, 65 insertions(+), 70 deletions(-) diff --git a/manual/opencs/files_and_directories.tex b/manual/opencs/files_and_directories.tex index 39d918b46..21774093e 100644 --- a/manual/opencs/files_and_directories.tex +++ b/manual/opencs/files_and_directories.tex @@ -13,109 +13,104 @@ OpenMW and \OCS{} store their files in multiple directories. Firstly, there is t files and several other folders. The location of the user directory is hard coded for each supported operating system. %TODO list paths. -In addition to the user directory, both \OMW{} and \OCS{} need a place to store the game’s actual data files: for example, the -textures, models, sounds and records of in-game objects. We support multiple paths to these files (termed \textbf{data paths}), -as specified in the configuration. Usually, one data path points to the directory where \MW{} is installed, however, you are -free to specify as many data paths as you would like. In addition, one particular data path, as described below, is used to store +In addition to the user directory, both \OMW{} and \OCS{} need a place to store the game’s actual data files: for example, the +textures, models, sounds and records of in-game objects. We support multiple paths to these files (termed \textbf{data paths}), +as specified in the configuration. Usually, one data path points to the directory where \MW{} is installed, however, you are +free to specify as many data paths as you would like. In addition, one particular data path, as described below, is used to store newly created content files. \paragraph{Content files} -\BS{} \MW{} engine is using two types of files: ESM (master) and ESP (plugin). The distinction between those -is not clear, and often confusing. You would expect the ESM (master) file is used to specify one master, that is modified by the ESPs plugins, -and indeed: this is the basic idea. However, original expansions also were made as ESM files, even though they essentially could be -described as a really large plugins, and therefore rather use ESP files. There were technical reasons behind this decision -- somewhat valid -in the case of original engine, but clearly it's better to create a system that can be used is more sensible way. \OMW{} achieves -this with our own content file types. +\BS{} \MW{} engine uses two file types: ESM (master) and ESP (plugin). The distinction between the two is often confusing. +You would expect that the ESM (master) file is used to specify a single master which is modified by the ESP files (plugins), and indeed: +this is the basic idea. However, the original expansions are also ESM files, even though they can be described as a really large plugins. +There were technical reasons behind this decision -- somewhat valid in the case of original engine, but a more logical file system is +much preferable. \OMW{} achieves this through the creation of our own types of content file. -We support both ESM and ESP files, but in order to make use of new features of OpenMW one should consider using new file types designed -with our engine in mind: game files and addon files together called ``content files``. +We support both ESM and ESP files, but, in order to make use of \OMW{}'s new features, one should consider using new file types designed +with our engine in mind: game files and addon files, collectively termed \textbf{content files}. \subparagraph{OpenMW content files} -Game and Addon files are concept somewhat similar to the old ESM/ESP, only in the way it should be from the very beginning. Nothing easier -to describe. If you want to make new game using \OMW{} as engine (so called ``total conversion'') you should create a game file. -If you want to create a addon for existing game file -- simply create addon file. Nothing else matters: The only distinction you should -consider is if your project is about changing other game, or creating a new one. Simple as that. +The distinction between game and addon files is similar to that between ESM and ESP, however their relationship to each other is +strictly defined -– the former are always master files, and the latter are always plugins. If you want to make a new game using the \OMW{} +engine (i.e. a ``total conversion''), you should create a game file. If you want to create an addon for an existing game file, simply +create an addon file. Nothing else matters: the only distinction you should consider is whether your project involves changing another game, +or creating a new one. Simple as that. -Other simple thing about content files are extensions. We are using .omwaddon for addon files and .omwgame for game files. +Furthermore, our content files’ extensions are .omwaddon for addon files and .omwgame for game files. %TODO describe what content files contains. and what not. \subparagraph{\MW{} content files} -Using our content files is recommended solution for projects that are intended to used with \OMW{} engine. However some players -wish to use original \MW{} engine, even with it large flaws and lacking features\footnote{If this is actually wrong, we are very -successful project. Yay!}. Also, since 2002 thousands of ESP/ESM files were created, some with really outstanding content. -Because of this \OCS{} simply has no other choice but support ESP/ESM files. However, if you decided to choose ESP/ESM file instead -using our own content file types you are most likely aim at the original engine compatibility. This subject is covered in the very -last section of this manual. %not finished TODO add the said section. Most likely when more features are present. +Using our content files is the recommended solution for projects that employ the \OMW{} engine. However, some players will wish to use +the original \MW{} engine, despite its large flaws and lacking features\footnote{If this is wrong, we are a very successful project. Yay!}. +In addition, since 2002 thousands of ESP/ESM files have been created, some with truly outstanding content. Because of this, \OCS{} is +committed to supporting ESP/ESM files. If you do decide to use ESP/ESM files rather than our own content files, you are most likely aiming +for original engine compatibility. This subject is covered in the very last section of the manual. +%not finished TODO add the said section. Most likely when more features are present. -The actual creation of new files is described in the next chapter. Here we are gonna focus only on details that you need to know -in order to create your first \OCS{} file while full understanding your needs. For now let's jut remember that content files -are created inside the user directory, in the the \textbf{data} subfolder (that is the one special data directory mentioned earlier). +The actual creation of new files is described in the next chapter. Here we are going to focus only on the essential information needed +to create your first \OCS{} file. For now, let's jut remember that content files are stored in the user directory, in the \textbf{data} subfolder (the particular data directory mentioned above). \subparagraph{Dependencies} -Since addon is supposed to change the game it is logical that it also depends on the said game. It simply can not work otherwise. -Just think about it: your modification is changing prize of the iron sword. But what if there is no iron sword in game? That is right: -we get nonsense. What you want to do is to tie your addon to the files you are changing. Those can be either game files (expansion island -for a game) or other addon files (house on the said island). It is a good idea to be dependent only on files that are really changed -in your addon obviously, but sadly there is no other way to achieve this than knowing what you want to do. Again, please remember that -this section of the manual does not cover creating the content files -- it is only theoretical introduction to the subject. For now just -keep in mind that dependencies exist, and is up to you what to decide if your content file should depend on other content file. +Since addons aim to modify an existing game, it is logical that they also depend on the said game: otherwise they will not function. +For example, your modification changes the price of iron swords. But what if there are no iron swords in the game? That is right: +it is nonsense. Therefore, it is necessary to make your addon a dependency of other content files. These can be either game files +(e.g. an entirely new island), or other addon files (e.g. a house on the island). It is a good idea for addons to depend only on the +content files they modify, but this is up to the end user to determine. -Game files are not intend to have any dependencies for a very simple reasons: player is using only one game file (excluding original -and dirty {ESP/ESM} system) at the time and therefore no game file can depend on other game file, and since game file makes the base -for addon files -- it can not depend on addon files. +Game files do not depend on any other content files, as they act as master files. A player can only use one game file at a time +(although this does not apply to the original and dirty ESP/ESM system). %\subparagraph{Loading order} %TODO \paragraph{Project files} -Project files act as containers for data not used by the \OMW{} game engine itself, but still useful for OpenCS. The shining example -of this data category are without doubt record filters (described in the later section of the manual you are reading currently). -As a mod author you probably do not need and/or want to distribute project files at all, they are meant to be used only by you. +Project files contain data not used by the \OMW{} game engine but which are still needed by OpenCS. Good examples of this data type +are the record filters (described below). As a mod author, you probably do not need and/or want to distribute project files at all, +as they are meant to be used only by you. -As you would imagine, project file makes sense only in combination with actual content files. In fact, each time you start to work -on new content file and project file was not found, it will be created. -Project files extension is, to not surprise ``.project''. The whole name of the project file is the whole name of the content file -with appended extensions. For instance swords.omwaddon file is associated with swords.omwaddon.project file. +Since project files govern how content files are used in OpenCS, they are always used in conjunction with your specific project. +In fact, each time work commences on a new content file without a corresponding project file, a new project file will be created. + +Project file extension is ``.project''. The name of the project file is the whole name of the content file with appended extensions. +For instance, a content file named swords.omwaddon is associated with the project file swords.omwaddon.project. %TODO where are they stored. -Project files are stored inside the user directory, in the \textbf{projects} subfolder. This is the path location for both freshly -created project files, and a place where \OCS{} looks for already existing files. +Project files are stored inside the user directory, in the \textbf{projects} subfolder. This is both the location of newly created +project files, and the place where \OCS{} looks for already existing files. -\paragraph{Resources files} +\paragraph{Resource files} %textures, sounds, whatever -Unless we are talking about the fully text based game, like Zork or Rogue, you are expecting that a video game is using some media files: -models with textures, pictures acting as icons, sounds and everything else. Since content files, no matter if it is ESP, ESM or new \OMW{} -file type do not contain any of those, it is clear that they have to be deliver with a different file. It is also clear that this, -let's call it ``resources file``, have to be supported by the engine. Without code handling those files, it is nothing more than -a mathematical abstraction -- something, that lacks meaning for human beings\footnote{Unless we call programmers a human beings.}. -Therefore this section must cover ways to add resources files to your content file, and point out what is supported. We are going -to do just that. Later, you will learn how to make use of those files in your content. +The vast majority of modern video games use what we shall term \textbf{resource files}: models, textures, icons, sounds and so on. +ESPs, ESMs and \OMW{} content files do not contain these files, merely instructions on how they are used. It follows that the \OMW{} +engine must be capable of supporting these resource files in order for them to function. Therefore this section cover ways to add +resource files to your content file, and outlines which formats are supported. Later, you will learn how to make use of these files +in your content. \subparagraph{Audio} -OpenMW is using {FFmpeg} for audio playback, and so we support every audio type that is supported by this library. This makes a huge list. -Below is only small portion of supported file types. +OpenMW utilises {FFmpeg} for audio playback, so we support every audio type supported by this library. This is a huge list. +Below is only a small sample of supported file types. \begin{description} - \item mp3 ({MPEG}-1 {Part 3 Layer 3}) popular audio file format and \textit{de facto} standard for storing audio. Used by the \MW{} game. - \item ogg open source, multimedia container file using high quality vorbis audio codec. Recommended. + \item mp3 ({MPEG}-1 {Part 3 Layer 3}) A popular audio file format and the \textit{de facto} standard for storing audio. Used by + the \MW{} game. + \item ogg Open source, multimedia container file which uses the high quality vorbis audio codec. Recommended. \end{description} \subparagraph{Video} -As in the case of audio files, we are using {FFmepg} to decode video files. The list of supported files is long, we will cover -only the most significant. +As in the case of audio files, we use {FFmpeg} to decode video files. The list of supported files is long -– only the most +significant will be covered. \begin{description} - \item bik videos used by original \MW{} game. - \item mp4 multimedia container which use more advanced codecs ({MPEG-4 Parts 2,3,10}) with a better audio and video compression rate, - but also requiring more {CPU} intensive decoding -- this makes it probably less suited for storing sounds in computer games, but good for videos. - \item webm is a new, shiny and open source video format with excellent compression. It needs quite a lot of processing power to be decoded, + \item bik Format used by the original \MW{} game. + \item mp4 Multimedia container which use more advanced codecs ({MPEG-4 Parts 2,3,10}) with a better audio and video compression rate, + but which require more {CPU} intensive decoding -- this probably makes it less suited for storing sounds in computer games, but good for videos. + \item webm A new, shiny and open source video format with excellent compression. It needs quite a lot of processing power to be decoded, but since game logic is not running during cut scenes we can recommend it for use with \OMW. - \item ogv alternative, open source container using theora codec for video and vorbis for audio. + \item ogv An alternative, open source container using theora codec for video and vorbis for audio. \end{description} \subparagraph{Textures and images} -Original \MW{} game uses {DDS} and {TGA} files for all kind of two dimensional images and textures alike. In addition, engine supported BMP -files for some reason ({BMP} is a terrible format for a video game). We also support extended set of image files -- including {JPEG} and {PNG}. -JPEG and PNG files can be useful in some cases, for instance JPEG file is a valid option for skybox texture and PNG can useful for masks. -However please, keep in mind that JPEG can grow into large sizes quickly and are not the best option with {DirectX} rendering backend. You probabbly still want -to use {DDS} files for textures. - +\MW{} uses {DDS} and {TGA} files for all kinds of two dimensional images and textures. In addition, the original engine supported BMP +files (although {BMP} is a terrible format for a video game). We also support an extended set of image files -- including {JPEG} and {PNG}. +JPEG and PNG files can be useful in some cases. For instance, a JPEG file is a valid option for a skybox texture and PNG can useful for masks. +However, keep in mind that a JPEG can grow large quickly and so are not the best option with a {DirectX} rendering backend. DDS files +are therefore recommended for textures. %\subparagraph{Meshes} %TODO once we will support something more than just nifs \ No newline at end of file From 20aa89e785a5e61f80057584b3aebddcee11f187 Mon Sep 17 00:00:00 2001 From: Bodillium Date: Thu, 23 Oct 2014 23:32:24 +1100 Subject: [PATCH 03/57] Minor tweaks to files and directories --- manual/opencs/files_and_directories.tex | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/manual/opencs/files_and_directories.tex b/manual/opencs/files_and_directories.tex index 21774093e..1b07fe267 100644 --- a/manual/opencs/files_and_directories.tex +++ b/manual/opencs/files_and_directories.tex @@ -22,8 +22,8 @@ newly created content files. \paragraph{Content files} \BS{} \MW{} engine uses two file types: ESM (master) and ESP (plugin). The distinction between the two is often confusing. You would expect that the ESM (master) file is used to specify a single master which is modified by the ESP files (plugins), and indeed: -this is the basic idea. However, the original expansions are also ESM files, even though they can be described as a really large plugins. -There were technical reasons behind this decision -- somewhat valid in the case of original engine, but a more logical file system is +this is the basic idea. However, the original expansions are also ESM files, even though they can be described as very large plugins. +There were technical reasons behind this decision -- somewhat valid in the case of the original engine, but a more logical file system is much preferable. \OMW{} achieves this through the creation of our own types of content file. We support both ESM and ESP files, but, in order to make use of \OMW{}'s new features, one should consider using new file types designed @@ -48,7 +48,8 @@ for original engine compatibility. This subject is covered in the very last sect %not finished TODO add the said section. Most likely when more features are present. The actual creation of new files is described in the next chapter. Here we are going to focus only on the essential information needed -to create your first \OCS{} file. For now, let's jut remember that content files are stored in the user directory, in the \textbf{data} subfolder (the particular data directory mentioned above). +to create your first \OCS{} file. For now, let's jut remember that content files are stored in the user directory, in the \textbf{data} +subfolder (the particular data directory mentioned above). \subparagraph{Dependencies} Since addons aim to modify an existing game, it is logical that they also depend on the said game: otherwise they will not function. @@ -67,9 +68,9 @@ are the record filters (described below). As a mod author, you probably do not n as they are meant to be used only by you. Since project files govern how content files are used in OpenCS, they are always used in conjunction with your specific project. -In fact, each time work commences on a new content file without a corresponding project file, a new project file will be created. +In fact, each time work commences on a content file that does not have a corresponding project file, a new project file will be created. -Project file extension is ``.project''. The name of the project file is the whole name of the content file with appended extensions. +The project file extension is ``.project''. The name of the project file is the whole name of the content file with appended extensions. For instance, a content file named swords.omwaddon is associated with the project file swords.omwaddon.project. %TODO where are they stored. @@ -80,7 +81,7 @@ project files, and the place where \OCS{} looks for already existing files. %textures, sounds, whatever The vast majority of modern video games use what we shall term \textbf{resource files}: models, textures, icons, sounds and so on. ESPs, ESMs and \OMW{} content files do not contain these files, merely instructions on how they are used. It follows that the \OMW{} -engine must be capable of supporting these resource files in order for them to function. Therefore this section cover ways to add +engine must be capable of supporting these resource files in order for them to function. Therefore this section covers ways to add resource files to your content file, and outlines which formats are supported. Later, you will learn how to make use of these files in your content. @@ -101,7 +102,8 @@ significant will be covered. \begin{description} \item bik Format used by the original \MW{} game. \item mp4 Multimedia container which use more advanced codecs ({MPEG-4 Parts 2,3,10}) with a better audio and video compression rate, - but which require more {CPU} intensive decoding -- this probably makes it less suited for storing sounds in computer games, but good for videos. + but which require more {CPU} intensive decoding -- this probably makes it less suited for storing sounds in computer games, but + good for videos. \item webm A new, shiny and open source video format with excellent compression. It needs quite a lot of processing power to be decoded, but since game logic is not running during cut scenes we can recommend it for use with \OMW. \item ogv An alternative, open source container using theora codec for video and vorbis for audio. From b0c4be231622666eab9253c6e5700e5157559c9c Mon Sep 17 00:00:00 2001 From: dteviot Date: Mon, 4 May 2015 14:52:47 +1200 Subject: [PATCH 04/57] Multi-select + context menu. (Fixes #2480) Content selector, added multi-select + context menu to allow check/uncheck the multi-selected items. --- .../contentselector/view/contentselector.cpp | 40 +++++++++++++++++++ .../contentselector/view/contentselector.hpp | 6 +++ files/ui/contentselector.ui | 2 +- 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/components/contentselector/view/contentselector.cpp b/components/contentselector/view/contentselector.cpp index e3093d568..2fae8e74b 100644 --- a/components/contentselector/view/contentselector.cpp +++ b/components/contentselector/view/contentselector.cpp @@ -57,6 +57,17 @@ void ContentSelectorView::ContentSelector::buildAddonView() connect(ui.addonView, SIGNAL(activated(const QModelIndex&)), this, SLOT(slotAddonTableItemActivated(const QModelIndex&))); connect(mContentModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), this, SIGNAL(signalAddonDataChanged(QModelIndex,QModelIndex))); + buildContextMenu(); +} + +void ContentSelectorView::ContentSelector::buildContextMenu() +{ + ui.addonView->setContextMenuPolicy(Qt::CustomContextMenu); + connect(ui.addonView, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(slotShowContextMenu(const QPoint&))); + + mContextMenu = new QMenu(ui.addonView); + mContextMenu->addAction(tr("&Check Selected"), this, SLOT(slotCheckMultiSelectedItems())); + mContextMenu->addAction(tr("&Uncheck Selected"), this, SLOT(slotUncheckMultiSelectedItems())); } void ContentSelectorView::ContentSelector::setProfileContent(const QStringList &fileList) @@ -196,3 +207,32 @@ void ContentSelectorView::ContentSelector::slotAddonTableItemActivated(const QMo mContentModel->setData(sourceIndex, checkState, Qt::CheckStateRole); } + +void ContentSelectorView::ContentSelector::slotShowContextMenu(const QPoint& pos) +{ + QPoint globalPos = ui.addonView->viewport()->mapToGlobal(pos); + mContextMenu->exec(globalPos); +} + +void ContentSelectorView::ContentSelector::setCheckStateForMultiSelectedItems(bool checked) +{ + Qt::CheckState checkState = checked ? Qt::Checked : Qt::Unchecked; + foreach(const QModelIndex& index, ui.addonView->selectionModel()->selectedIndexes()) + { + QModelIndex sourceIndex = mAddonProxyModel->mapToSource(index); + if (mContentModel->data(sourceIndex, Qt::CheckStateRole).toInt() != checkState) + { + mContentModel->setData(sourceIndex, checkState, Qt::CheckStateRole); + } + } +} + +void ContentSelectorView::ContentSelector::slotUncheckMultiSelectedItems() +{ + setCheckStateForMultiSelectedItems(false); +} + +void ContentSelectorView::ContentSelector::slotCheckMultiSelectedItems() +{ + setCheckStateForMultiSelectedItems(true); +} diff --git a/components/contentselector/view/contentselector.hpp b/components/contentselector/view/contentselector.hpp index 2507cf6ad..e455807c9 100644 --- a/components/contentselector/view/contentselector.hpp +++ b/components/contentselector/view/contentselector.hpp @@ -14,6 +14,7 @@ namespace ContentSelectorView { Q_OBJECT + QMenu *mContextMenu; QStringList mFilePaths; protected: @@ -51,7 +52,9 @@ namespace ContentSelectorView void buildContentModel(); void buildGameFileView(); void buildAddonView(); + void buildContextMenu(); void setGameFileSelected(int index, bool selected); + void setCheckStateForMultiSelectedItems(bool checked); signals: void signalCurrentGamefileIndexChanged (int); @@ -62,6 +65,9 @@ namespace ContentSelectorView void slotCurrentGameFileIndexChanged(int index); void slotAddonTableItemActivated(const QModelIndex& index); + void slotShowContextMenu(const QPoint& pos); + void slotCheckMultiSelectedItems(); + void slotUncheckMultiSelectedItems(); }; } diff --git a/files/ui/contentselector.ui b/files/ui/contentselector.ui index b9b5ba5a0..7832239b5 100644 --- a/files/ui/contentselector.ui +++ b/files/ui/contentselector.ui @@ -72,7 +72,7 @@ true - QAbstractItemView::SingleSelection + QAbstractItemView::ExtendedSelection QAbstractItemView::SelectRows From 27751db99afae9368fc29fabbe0bbedb980c3ace Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 4 May 2015 16:23:33 +0200 Subject: [PATCH 05/57] Use btScaledBvhTriangleMeshShape, bump required bullet version to 2.83 --- components/nifbullet/bulletnifloader.cpp | 4 +-- libs/openengine/bullet/physic.cpp | 32 +++++++++++++++++------- libs/openengine/bullet/physic.hpp | 3 +++ 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/components/nifbullet/bulletnifloader.cpp b/components/nifbullet/bulletnifloader.cpp index 93c9797b2..3207af0fe 100644 --- a/components/nifbullet/bulletnifloader.cpp +++ b/components/nifbullet/bulletnifloader.cpp @@ -123,7 +123,7 @@ void ManualBulletShapeLoader::loadResource(Ogre::Resource *resource) mCompoundShape = NULL; mStaticMesh = NULL; - Nif::NIFFilePtr pnif (Nif::Cache::getInstance().load(mResourceName.substr(0, mResourceName.length()-7))); + Nif::NIFFilePtr pnif (Nif::Cache::getInstance().load(mResourceName)); Nif::NIFFile & nif = *pnif.get (); if (nif.numRoots() < 1) { @@ -134,7 +134,7 @@ void ManualBulletShapeLoader::loadResource(Ogre::Resource *resource) // Have to load controlled nodes from the .kf // FIXME: the .kf has to be loaded both for rendering and physics, ideally it should be opened once and then reused mControlledNodes.clear(); - std::string kfname = mResourceName.substr(0, mResourceName.length()-7); + std::string kfname = mResourceName; Misc::StringUtils::toLower(kfname); if(kfname.size() > 4 && kfname.compare(kfname.size()-4, 4, ".nif") == 0) kfname.replace(kfname.size()-4, 4, ".kf"); diff --git a/libs/openengine/bullet/physic.cpp b/libs/openengine/bullet/physic.cpp index 013ef1003..76dbc224c 100644 --- a/libs/openengine/bullet/physic.cpp +++ b/libs/openengine/bullet/physic.cpp @@ -457,8 +457,7 @@ namespace Physic float scale, const Ogre::Vector3 &position, const Ogre::Quaternion &rotation, Ogre::Vector3* scaledBoxTranslation, Ogre::Quaternion* boxRotation, bool raycasting, bool placeable) { - std::string sid = (boost::format("%07.3f") % scale).str(); - std::string outputstring = mesh + sid; + std::string outputstring = mesh; //get the shape from the .nif mShapeLoader->load(outputstring,"General"); @@ -477,20 +476,35 @@ namespace Physic btCollisionShape* collisionShape = raycasting ? shape->mRaycastingShape : shape->mCollisionShape; - // If this is an animated compound shape, we must duplicate it so we can animate - // multiple instances independently. - if (!raycasting && !shape->mAnimatedShapes.empty()) - collisionShape = duplicateCollisionShape(collisionShape); - if (raycasting && !shape->mAnimatedRaycastingShapes.empty()) - collisionShape = duplicateCollisionShape(collisionShape); +// TODO: check this from cmake? +#if BT_BULLET_VERSION < 283 +#error "Bullet version 2.83 or later required" +#endif - collisionShape->setLocalScaling( btVector3(scale,scale,scale)); + bool needDelete = false; + if (btBvhTriangleMeshShape* triangleShape = dynamic_cast(shape->mCollisionShape)) + { + btScaledBvhTriangleMeshShape* scaled = new btScaledBvhTriangleMeshShape(triangleShape, btVector3(scale,scale,scale)); + collisionShape = scaled; + needDelete = true; + } + else + { + // If this is an animated compound shape, we must duplicate it so we can animate + // multiple instances independently. + if (!raycasting && !shape->mAnimatedShapes.empty()) + collisionShape = duplicateCollisionShape(collisionShape); + if (raycasting && !shape->mAnimatedRaycastingShapes.empty()) + collisionShape = duplicateCollisionShape(collisionShape); + } //create the real body btRigidBody::btRigidBodyConstructionInfo CI = btRigidBody::btRigidBodyConstructionInfo (0,0, collisionShape); RigidBody* body = new RigidBody(CI,name); body->mPlaceable = placeable; + if (needDelete) + body->mCollisionShape.reset(collisionShape); if (!raycasting && !shape->mAnimatedShapes.empty()) { diff --git a/libs/openengine/bullet/physic.hpp b/libs/openengine/bullet/physic.hpp index 7784e8941..7b0906694 100644 --- a/libs/openengine/bullet/physic.hpp +++ b/libs/openengine/bullet/physic.hpp @@ -63,6 +63,9 @@ namespace Physic virtual ~RigidBody(); std::string mName; + // May be empty if the collision shape is a shared resource + std::auto_ptr mCollisionShape; + // Hack: placeable objects (that can be picked up by the player) have different collision behaviour. // This variable needs to be passed to BulletNifLoader. bool mPlaceable; From 1c334a01ced6b05da2e5da54c09c026927be7386 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Mon, 4 May 2015 19:04:06 +0200 Subject: [PATCH 06/57] one more referenceable that escaped the change into object --- apps/opencs/model/world/columns.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/opencs/model/world/columns.cpp b/apps/opencs/model/world/columns.cpp index 3172e72e4..9076aa096 100644 --- a/apps/opencs/model/world/columns.cpp +++ b/apps/opencs/model/world/columns.cpp @@ -172,7 +172,7 @@ namespace CSMWorld { ColumnId_Rank, "Rank" }, { ColumnId_Gender, "Gender" }, { ColumnId_PcRank, "PC Rank" }, - { ColumnId_ReferenceableId, "Referenceable ID" }, + { ColumnId_ReferenceableId, "Object ID" }, { ColumnId_ContainerContent, "Content" }, { ColumnId_ItemCount, "Count" }, From 9f6bc1b3a9b141030b4450a7999d6637882741ce Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Mon, 4 May 2015 19:06:02 +0200 Subject: [PATCH 07/57] increased version number --- CMakeLists.txt | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 07fffd577..7c19c57eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,8 +19,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/) message(STATUS "Configuring OpenMW...") set(OPENMW_VERSION_MAJOR 0) -set(OPENMW_VERSION_MINOR 35) -set(OPENMW_VERSION_RELEASE 1) +set(OPENMW_VERSION_MINOR 36) +set(OPENMW_VERSION_RELEASE 0) set(OPENMW_VERSION_COMMITHASH "") set(OPENMW_VERSION_TAGHASH "") diff --git a/README.md b/README.md index 811eb8763..f62800e1f 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ OpenMW OpenMW is an attempt at recreating the engine for the popular role-playing game Morrowind by Bethesda Softworks. You need to own and install the original game for OpenMW to work. -* Version: 0.35.1 +* Version: 0.36.0 * License: GPL (see docs/license/GPL3.txt for more information) * Website: http://www.openmw.org * IRC: #openmw on irc.freenode.net From e9ef9eedae94cee61d71f951fa740eb83953c178 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 5 May 2015 10:51:48 +0200 Subject: [PATCH 08/57] updated changelog --- CHANGELOG.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1766aa21d..15464b1d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,42 @@ +0.36.0 +------ + + Bug #923: Editor: Operations-Multithreading is broken + Bug #1317: Erene Llenim in Seyda Neen does not walk around + Bug #1621: "Error Detecting Morrowind Installation" in the default directory + Bug #2216: Creating a clone of the player stops you moving. + Bug #2387: Casting bound weapon spell doesn't switch to "ready weapon" mode + Bug #2407: Default to (0, 0) when "unknown cell" is encountered. + Bug #2411: enchanted item charges don't update/refresh if spell list window is pinned open + Bug #2428: Editor: cloning / creating new container class results in invalid omwaddon file - openmw-0.35 + Bug #2429: Editor - cloning omits some values or sets different values than the original has + Bug #2430: NPC with negative fatigue don't fall (LGNPC Vivec, Foreign Quarter v2.21) + Bug #2432: Error on startup with Uvirith's Legacy enabled + Bug #2435: Editor: changed entries in the objects window are not shown as such + Bug #2437: Editor: changing an entry of a container/NPC/clothing/ingredient/globals will not be saved in the omwaddon file + Bug #2447: Editor doesn't save terrain information + Bug #2451: Editor not listing files with accented characters + Bug #2453: Chargen: sex, race and hair sliders not initialized properly + Bug #2459: Minor terrain clipping through statics due to difference in triangle alignment + Bug #2461: Invisible sound mark has collision in Sandus Ancestral Tomb + Bug #2465: tainted gold stack + Bug #2475: cumulative stacks of 100 point fortify skill speechcraft boosts do not apply correctly + Bug #2498: Editor: crash when issuing undo command after the table subview is closed + Bug #2500: Editor: object table - can't undo delete record + Feature #139: Editor: Global Search & Replace + Feature #1219: Editor: Add dialogue mode only columns + Feature #2024: Hotkey for hand to hand (i.e. unequip any weapon) + Feature #2119: "Always Sneak" key bind + Feature #2262: Editor: Handle moved instances + Feature #2425: Editor: Add start script table + Feature #2426: Editor: start script record verifier + Feature #2480: Launcher: Multiselect entries in the Data Files list + Feature #2505: Editor: optionally show a line number column in the script editor + Feature #2512: Editor: Offer use of monospace fonts in the script editor as an option + Feature #2514: Editor: focus on ID input field on clone/add + Task #2460: OS X: Use Application Support directory as user data path + Task #2516: Editor: Change References / Referenceables terminology + 0.35.1 ------ From 60fffec3452c68ef2675a7c573af0436c051a6d4 Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 5 May 2015 16:08:01 +0200 Subject: [PATCH 09/57] Collision fix --- libs/openengine/bullet/physic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/openengine/bullet/physic.cpp b/libs/openengine/bullet/physic.cpp index 22312e3bc..17d4aeab5 100644 --- a/libs/openengine/bullet/physic.cpp +++ b/libs/openengine/bullet/physic.cpp @@ -480,7 +480,7 @@ namespace Physic #endif bool needDelete = false; - if (btBvhTriangleMeshShape* triangleShape = dynamic_cast(shape->mCollisionShape)) + if (btBvhTriangleMeshShape* triangleShape = dynamic_cast(collisionShape)) { btScaledBvhTriangleMeshShape* scaled = new btScaledBvhTriangleMeshShape(triangleShape, btVector3(scale,scale,scale)); collisionShape = scaled; From 0c461f4424a0912af405530878d559ebd376c3b8 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Sat, 9 May 2015 21:21:16 +1000 Subject: [PATCH 10/57] Add TopicInfos special conditions table. --- apps/opencs/model/world/columnbase.cpp | 3 + apps/opencs/model/world/columnbase.hpp | 3 + apps/opencs/model/world/columns.cpp | 21 + apps/opencs/model/world/columns.hpp | 7 +- apps/opencs/model/world/data.cpp | 13 + .../model/world/nestedcoladapterimp.cpp | 413 ++++++++++++++++++ .../model/world/nestedcoladapterimp.hpp | 25 ++ apps/opencs/view/doc/viewmanager.cpp | 4 +- 8 files changed, 487 insertions(+), 2 deletions(-) diff --git a/apps/opencs/model/world/columnbase.cpp b/apps/opencs/model/world/columnbase.cpp index 659954f48..cf125aa63 100644 --- a/apps/opencs/model/world/columnbase.cpp +++ b/apps/opencs/model/world/columnbase.cpp @@ -81,6 +81,9 @@ bool CSMWorld::ColumnBase::isId (Display display) Display_PartRefType, Display_AiPackageType, Display_YesNo, + Display_InfoCondFunc, + Display_InfoCondVar, + Display_InfoCondComp, Display_None }; diff --git a/apps/opencs/model/world/columnbase.hpp b/apps/opencs/model/world/columnbase.hpp index 71c22a9f0..2d2513774 100644 --- a/apps/opencs/model/world/columnbase.hpp +++ b/apps/opencs/model/world/columnbase.hpp @@ -116,6 +116,9 @@ namespace CSMWorld Display_PartRefType, Display_AiPackageType, Display_YesNo, + Display_InfoCondFunc, + Display_InfoCondVar, + Display_InfoCondComp, //top level columns that nest other columns Display_NestedHeader diff --git a/apps/opencs/model/world/columns.cpp b/apps/opencs/model/world/columns.cpp index 9076aa096..89ee6258b 100644 --- a/apps/opencs/model/world/columns.cpp +++ b/apps/opencs/model/world/columns.cpp @@ -274,6 +274,11 @@ namespace CSMWorld { ColumnId_SkillImpact, "Skills" }, { ColumnId_InfoList, "Info List" }, + { ColumnId_InfoCondition, "Info Conditions" }, + { ColumnId_InfoCondFunc, "Function" }, + { ColumnId_InfoCondVar, "Func/Variable" }, + { ColumnId_InfoCondComp, "Comp" }, + { ColumnId_InfoCondValue, "Value" }, { ColumnId_OriginalCell, "Original Cell" }, { ColumnId_UseValue1, "Use value 1" }, @@ -502,6 +507,18 @@ namespace "No", "Yes", 0 }; + static const char *sInfoCondFunc[] = + { + " ", "Function", "Global", "Local", "Journal", + "Item", "Dead", "Not ID", "Not Faction", "Not Class", + "Not Race", "Not Cell", "Not Local", 0 + }; + + static const char *sInfoCondComp[] = + { + "!=", "<", "<=", "=", ">", ">=", 0 + }; + const char **getEnumNames (CSMWorld::Columns::ColumnId column) { switch (column) @@ -530,6 +547,10 @@ namespace case CSMWorld::Columns::ColumnId_PartRefType: return sPartRefType; case CSMWorld::Columns::ColumnId_AiPackageType: return sAiPackageType; case CSMWorld::Columns::ColumnId_AiWanderRepeat: return sAiWanderRepeat; + case CSMWorld::Columns::ColumnId_InfoCondFunc: return sInfoCondFunc; + // FIXME: don't have dynamic value enum delegate, use Display_String for now + //case CSMWorld::Columns::ColumnId_InfoCond: return sInfoCond; + case CSMWorld::Columns::ColumnId_InfoCondComp: return sInfoCondComp; default: return 0; } diff --git a/apps/opencs/model/world/columns.hpp b/apps/opencs/model/world/columns.hpp index b87f6c53d..f971f3fd8 100644 --- a/apps/opencs/model/world/columns.hpp +++ b/apps/opencs/model/world/columns.hpp @@ -264,8 +264,13 @@ namespace CSMWorld ColumnId_SkillImpact = 240, // impact from magic effects ColumnId_InfoList = 241, + ColumnId_InfoCondition = 242, + ColumnId_InfoCondFunc = 243, + ColumnId_InfoCondVar = 244, + ColumnId_InfoCondComp = 245, + ColumnId_InfoCondValue = 246, - ColumnId_OriginalCell = 242, + ColumnId_OriginalCell = 247, // Allocated to a separate value range, so we don't get a collision should we ever need // to extend the number of use values. diff --git a/apps/opencs/model/world/data.cpp b/apps/opencs/model/world/data.cpp index fc4532fb0..e2fab0a25 100644 --- a/apps/opencs/model/world/data.cpp +++ b/apps/opencs/model/world/data.cpp @@ -242,6 +242,19 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc mTopicInfos.addAdapter (std::make_pair(&mTopicInfos.getColumn(index), new InfoListAdapter ())); mTopicInfos.getNestableColumn(index)->addColumn( new NestedChildColumn (Columns::ColumnId_ScriptText, ColumnBase::Display_ScriptLines)); + // Special conditions + mTopicInfos.addColumn (new NestedParentColumn (Columns::ColumnId_InfoCondition)); + index = mTopicInfos.getColumns()-1; + mTopicInfos.addAdapter (std::make_pair(&mTopicInfos.getColumn(index), new InfoConditionAdapter ())); + mTopicInfos.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_InfoCondFunc, ColumnBase::Display_InfoCondFunc)); + // FIXME: don't have dynamic value enum delegate, use Display_String for now + mTopicInfos.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_InfoCondVar, ColumnBase::Display_String)); + mTopicInfos.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_InfoCondComp, ColumnBase::Display_InfoCondComp)); + mTopicInfos.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_Value, ColumnBase::Display_Var)); mJournalInfos.addColumn (new StringIdColumn (true)); mJournalInfos.addColumn (new RecordStateColumn); diff --git a/apps/opencs/model/world/nestedcoladapterimp.cpp b/apps/opencs/model/world/nestedcoladapterimp.cpp index d29155a47..9cd1a0a3b 100644 --- a/apps/opencs/model/world/nestedcoladapterimp.cpp +++ b/apps/opencs/model/world/nestedcoladapterimp.cpp @@ -528,4 +528,417 @@ namespace CSMWorld { return 1; // fixed at size 1 } + + // ESM::DialInfo::SelectStruct.mSelectRule + // 012345... + // ^^^ ^^ + // ||| || + // ||| |+------------- condition variable string + // ||| +-------------- comparison type, ['0'..'5']; e.g. !=, <, >=, etc + // ||+---------------- function index (encoded, where function == '1') + // |+----------------- function, ['1'..'C']; e.g. Global, Local, Not ID, etc + // +------------------ unknown + // + InfoConditionAdapter::InfoConditionAdapter () {} + + void InfoConditionAdapter::addRow(Record& record, int position) const + { + Info info = record.get(); + + std::vector& conditions = info.mSelects; + + // blank row + ESM::DialInfo::SelectStruct condStruct; + condStruct.mSelectRule = "00000"; + condStruct.mValue = ESM::Variant(); + + conditions.insert(conditions.begin()+position, condStruct); + + record.setModified (info); + } + + void InfoConditionAdapter::removeRow(Record& record, int rowToRemove) const + { + Info info = record.get(); + + std::vector& conditions = info.mSelects; + + if (rowToRemove < 0 || rowToRemove >= static_cast (conditions.size())) + throw std::runtime_error ("index out of range"); + + conditions.erase(conditions.begin()+rowToRemove); + + record.setModified (info); + } + + void InfoConditionAdapter::setTable(Record& record, + const NestedTableWrapperBase& nestedTable) const + { + Info info = record.get(); + + info.mSelects = + static_cast >&>(nestedTable).mNestedTable; + + record.setModified (info); + } + + NestedTableWrapperBase* InfoConditionAdapter::table(const Record& record) const + { + // deleted by dtor of NestedTableStoring + return new NestedTableWrapper >(record.get().mSelects); + } + + // See the mappings in MWDialogue::SelectWrapper::getArgument + // from ESM::Attribute, ESM::Skill and MWMechanics::CreatureStats (for AI) + static const std::map sEncToInfoFunc = + { + { "00", "Rank Low" }, + { "01", "Rank High" }, + { "02", "Rank Requirement" }, + { "03", "Reputation" }, + { "04", "Health Percent" }, + { "05", "PC Reputation" }, + { "06", "PC Level" }, + { "07", "PC Health Percent" }, + { "08", "PC Magicka" }, // dynamic stat + { "09", "PC Fatigue" }, // dynamic stat + { "10", "PC Strength" }, // attrib + { "11", "PC Block" }, + { "12", "PC Armoror" }, + { "13", "PC Medium Armor" }, + { "14", "PC Heavy Armor" }, + { "15", "PC Blunt Weapon" }, + { "16", "PC Long Blade" }, + { "17", "PC Axe" }, + { "18", "PC Spear" }, + { "19", "PC Athletics" }, + { "20", "PC Enchant" }, + { "21", "PC Destruction" }, + { "22", "PC Alteration" }, + { "23", "PC Illusion" }, + { "24", "PC Conjuration" }, + { "25", "PC Mysticism" }, + { "26", "PC Restoration" }, + { "27", "PC Alchemy" }, + { "28", "PC Unarmored" }, + { "29", "PC Security" }, + { "30", "PC Sneak" }, + { "31", "PC Acrobatics" }, + { "32", "PC Light Armor" }, + { "33", "PC Short Blade" }, + { "34", "PC Marksman" }, + { "35", "PC Merchantile" }, + { "36", "PC Speechcraft" }, + { "37", "PC Hand To Hand" }, + { "38", "PC Sex" }, + { "39", "PC Expelled" }, + { "40", "PC Common Disease" }, + { "41", "PC Blight Disease" }, + { "42", "PC Clothing Modifier" }, + { "43", "PC Crime Level" }, + { "44", "Same Sex" }, + { "45", "Same Race" }, + { "46", "Same Faction" }, + { "47", "Faction Rank Difference" }, + { "48", "Detected" }, + { "49", "Alarmed" }, + { "50", "Choice" }, + { "51", "PC Intelligence" }, // attrib + { "52", "PC Willpower" }, // attrib + { "53", "PC Agility" }, // attrib + { "54", "PC Speed" }, // attrib + { "55", "PC Endurance" }, // attrib + { "56", "PC Personality" }, // attrib + { "57", "PC Luck" }, // attrib + { "58", "PC Corpus" }, + { "59", "Weather" }, + { "60", "PC Vampire" }, + { "61", "Level" }, + { "62", "Attacked" }, + { "63", "Talked To PC" }, + { "64", "PC Health" }, // dynamic stat + { "65", "Creature Target" }, + { "66", "Friend Hit" }, + { "67", "Fight" }, // AI + { "68", "Hello" }, // AI + { "69", "Alarm" }, // AI + { "70", "Flee" }, // AI + { "71", "Should Attack" }, + { "72", "Werewolf" }, + { "73", "PC Werewolf Kills" } + }; + + QVariant InfoConditionAdapter::getData(const Record& record, + int subRowIndex, int subColIndex) const + { + Info info = record.get(); + + std::vector& conditions = info.mSelects; + + if (subRowIndex < 0 || subRowIndex >= static_cast (conditions.size())) + throw std::runtime_error ("index out of range"); + + switch (subColIndex) + { + case 0: + { + char condType = conditions[subRowIndex].mSelectRule[1]; + switch (condType) + { + case '1': return 1; // Function + case '2': return 2; // Global + case '3': return 3; // Local + case '4': return 4; // Journal + case '5': return 5; // Item + case '6': return 6; // Dead + case '7': return 7; // Not ID + case '8': return 8; // Not Factio + case '9': return 9; // Not Class + case 'A': return 10; // Not Race + case 'B': return 11; // Not Cell + case 'C': return 12; // Not Local + default: return QVariant(); // TODO: log an error? + } + } + case 1: + { + if (conditions[subRowIndex].mSelectRule[1] == '1') + { + // throws an exception if the encoding is not found + return sEncToInfoFunc.at(conditions[subRowIndex].mSelectRule.substr(2, 2)).c_str(); + } + else + return QString(conditions[subRowIndex].mSelectRule.substr(5).c_str()); + } + case 2: + { + char compType = conditions[subRowIndex].mSelectRule[4]; + switch (compType) + { + case '0': return 3; // = + case '1': return 0; // != + case '2': return 4; // > + case '3': return 5; // >= + case '4': return 1; // < + case '5': return 2; // <= + default: return QVariant(); // TODO: log an error? + } + } + case 3: + { + switch (conditions[subRowIndex].mValue.getType()) + { + case ESM::VT_String: + { + return QString::fromUtf8 (conditions[subRowIndex].mValue.getString().c_str()); + } + case ESM::VT_Int: + case ESM::VT_Short: + case ESM::VT_Long: + { + return conditions[subRowIndex].mValue.getInteger(); + } + case ESM::VT_Float: + { + return conditions[subRowIndex].mValue.getFloat(); + } + default: return QVariant(); + } + } + default: throw std::runtime_error("Info condition subcolumn index out of range"); + } + } + + static const std::map sInfoFuncToEnc = + { + { "Alarm", "69" }, // AI + { "Alarmed", "49" }, + { "Attacked", "62" }, + { "Choice", "50" }, + { "Creature Target", "65" }, + { "Detected", "48" }, + { "Faction Rank Difference", "47" }, + { "Fight", "67" }, // AI + { "Flee", "70" }, // AI + { "Friend Hit", "66" }, + { "Health Percent", "04" }, + { "Hello", "68" }, // AI + { "Level", "61" }, + { "PC Acrobatics", "31" }, + { "PC Agility", "53" }, // attrib + { "PC Alchemy", "27" }, + { "PC Alteration", "22" }, + { "PC Armoror", "12" }, + { "PC Athletics", "19" }, + { "PC Axe", "17" }, + { "PC Blight Disease", "41" }, + { "PC Block", "11" }, + { "PC Blunt Weapon", "15" }, + { "PC Clothing Modifier", "42" }, + { "PC Common Disease", "40" }, + { "PC Conjuration", "24" }, + { "PC Corpus", "58" }, + { "PC Crime Level", "43" }, + { "PC Destruction", "21" }, + { "PC Enchant", "20" }, + { "PC Endurance", "55" }, // attrib + { "PC Expelled", "39" }, + { "PC Fatigue", "09" }, // dynamic stat + { "PC Hand To Hand", "37" }, + { "PC Health", "64" }, // dynamic stat + { "PC Health Percent", "07" }, + { "PC Heavy Armor", "14" }, + { "PC Illusion", "23" }, + { "PC Intelligence", "51" }, // attrib + { "PC Level", "06" }, + { "PC Light Armor", "32" }, + { "PC Long Blade", "16" }, + { "PC Luck", "57" }, // attrib + { "PC Magicka", "08" }, // dynamic stat + { "PC Marksman", "34" }, + { "PC Medium Armor", "13" }, + { "PC Merchantile", "35" }, + { "PC Mysticism", "25" }, + { "PC Personality", "56" }, // attrib + { "PC Reputation", "05" }, + { "PC Restoration", "26" }, + { "PC Security", "29" }, + { "PC Sex", "38" }, + { "PC Short Blade", "33" }, + { "PC Sneak", "30" }, + { "PC Spear", "18" }, + { "PC Speechcraft", "36" }, + { "PC Speed", "54" }, // attrib + { "PC Strength", "10" }, // attrib + { "PC Unarmored", "28" }, + { "PC Vampire", "60" }, + { "PC Werewolf Kills", "73" }, + { "PC Willpower", "52" }, // attrib + { "Rank Requirement", "02" }, + { "Rank High", "01" }, + { "Rank Low", "00" }, + { "Reputation", "03" }, + { "Same Faction", "46" }, + { "Same Race", "45" }, + { "Same Sex", "44" }, + { "Should Attack", "71" }, + { "Talked To PC", "63" }, + { "Weather", "59" }, + { "Werewolf", "72" } + }; + + void InfoConditionAdapter::setData(Record& record, + const QVariant& value, int subRowIndex, int subColIndex) const + { + Info info = record.get(); + + std::vector& conditions = info.mSelects; + + if (subRowIndex < 0 || subRowIndex >= static_cast (conditions.size())) + throw std::runtime_error ("index out of range"); + + switch (subColIndex) + { + case 0: + { + // See sInfoCondFunc in columns.cpp for the enum values + switch (value.toInt()) + { + // FIXME: when these change the values of the other columns need to change + // correspondingly (and automatically) + case 1: conditions[subRowIndex].mSelectRule[1] = '1'; break; // Function + case 2: conditions[subRowIndex].mSelectRule[1] = '2'; break; // Global + case 3: conditions[subRowIndex].mSelectRule[1] = '3'; break; // Local + case 4: conditions[subRowIndex].mSelectRule[1] = '4'; break; // Journal + case 5: conditions[subRowIndex].mSelectRule[1] = '5'; break; // Item + case 6: conditions[subRowIndex].mSelectRule[1] = '6'; break; // Dead + case 7: conditions[subRowIndex].mSelectRule[1] = '7'; break; // Not ID + case 8: conditions[subRowIndex].mSelectRule[1] = '8'; break; // Not Faction + case 9: conditions[subRowIndex].mSelectRule[1] = '9'; break; // Not Class + case 10: conditions[subRowIndex].mSelectRule[1] = 'A'; break; // Not Race + case 11: conditions[subRowIndex].mSelectRule[1] = 'B'; break; // Not Cell + case 12: conditions[subRowIndex].mSelectRule[1] = 'C'; break; // Not Local + default: return; // return without saving + } + break; + } + case 1: + { + if (conditions[subRowIndex].mSelectRule[1] == '1') + { + // throws an exception if the function is not found + const std::map::const_iterator it = sInfoFuncToEnc.find( + value.toString().toUtf8().constData()); + if (it != sInfoFuncToEnc.end()) + { + std::string rule = conditions[subRowIndex].mSelectRule.substr(0, 2); + rule.append(it->second); + rule.append(std::string(1, conditions[subRowIndex].mSelectRule[4])); + conditions[subRowIndex].mSelectRule = rule.append(value.toString().toUtf8().constData()); + } + else + return; // return without saving; TODO: maybe log an error here + } + else + { + // FIXME: validate the string values before saving, based on the current function + std::string rule = conditions[subRowIndex].mSelectRule.substr(0, 5); + conditions[subRowIndex].mSelectRule = rule.append(value.toString().toUtf8().constData()); + } + break; + } + case 2: + { + // See sInfoCondComp in columns.cpp for the enum values + switch (value.toInt()) + { + case 0: conditions[subRowIndex].mSelectRule[4] = '1'; break; // != + case 1: conditions[subRowIndex].mSelectRule[4] = '4'; break; // < + case 2: conditions[subRowIndex].mSelectRule[4] = '5'; break; // <= + case 3: conditions[subRowIndex].mSelectRule[4] = '0'; break; // = + case 4: conditions[subRowIndex].mSelectRule[4] = '2'; break; // > + case 5: conditions[subRowIndex].mSelectRule[4] = '3'; break; // >= + default: return; // return without saving + } + break; + } + case 3: + { + switch (conditions[subRowIndex].mValue.getType()) + { + case ESM::VT_String: + { + conditions[subRowIndex].mValue.setString (value.toString().toUtf8().constData()); + break; + } + case ESM::VT_Int: + case ESM::VT_Short: + case ESM::VT_Long: + { + conditions[subRowIndex].mValue.setInteger (value.toInt()); + break; + } + case ESM::VT_Float: + { + conditions[subRowIndex].mValue.setFloat (value.toFloat()); + break; + } + default: break; + } + } + default: throw std::runtime_error("Info condition subcolumn index out of range"); + } + + record.setModified (info); + } + + int InfoConditionAdapter::getColumnsCount(const Record& record) const + { + return 4; + } + + int InfoConditionAdapter::getRowsCount(const Record& record) const + { + return static_cast(record.get().mSelects.size()); + } } diff --git a/apps/opencs/model/world/nestedcoladapterimp.hpp b/apps/opencs/model/world/nestedcoladapterimp.hpp index 96dcd943d..ea2037eb8 100644 --- a/apps/opencs/model/world/nestedcoladapterimp.hpp +++ b/apps/opencs/model/world/nestedcoladapterimp.hpp @@ -412,6 +412,31 @@ namespace CSMWorld virtual int getRowsCount(const Record& record) const; }; + + class InfoConditionAdapter : public NestedColumnAdapter + { + public: + InfoConditionAdapter (); + + virtual void addRow(Record& record, int position) const; + + virtual void removeRow(Record& record, int rowToRemove) const; + + virtual void setTable(Record& record, + const NestedTableWrapperBase& nestedTable) const; + + virtual NestedTableWrapperBase* table(const Record& record) const; + + virtual QVariant getData(const Record& record, + int subRowIndex, int subColIndex) const; + + virtual void setData(Record& record, + const QVariant& value, int subRowIndex, int subColIndex) const; + + virtual int getColumnsCount(const Record& record) const; + + virtual int getRowsCount(const Record& record) const; + }; } #endif // CSM_WOLRD_NESTEDCOLADAPTERIMP_H diff --git a/apps/opencs/view/doc/viewmanager.cpp b/apps/opencs/view/doc/viewmanager.cpp index 5908c67a1..6362f9659 100644 --- a/apps/opencs/view/doc/viewmanager.cpp +++ b/apps/opencs/view/doc/viewmanager.cpp @@ -90,7 +90,9 @@ CSVDoc::ViewManager::ViewManager (CSMDoc::DocumentManager& documentManager) { CSMWorld::ColumnBase::Display_EffectId, CSMWorld::Columns::ColumnId_EffectId, false }, { CSMWorld::ColumnBase::Display_PartRefType, CSMWorld::Columns::ColumnId_PartRefType, false }, { CSMWorld::ColumnBase::Display_AiPackageType, CSMWorld::Columns::ColumnId_AiPackageType, false }, - { CSMWorld::ColumnBase::Display_YesNo, CSMWorld::Columns::ColumnId_AiWanderRepeat, false } + { CSMWorld::ColumnBase::Display_YesNo, CSMWorld::Columns::ColumnId_AiWanderRepeat, false }, + { CSMWorld::ColumnBase::Display_InfoCondFunc, CSMWorld::Columns::ColumnId_InfoCondFunc, false }, + { CSMWorld::ColumnBase::Display_InfoCondComp, CSMWorld::Columns::ColumnId_InfoCondComp, false } }; for (std::size_t i=0; i Date: Sun, 10 May 2015 05:55:50 +1000 Subject: [PATCH 11/57] For compiling with osx - try using a different syntax for initializing the static maps. --- .../model/world/nestedcoladapterimp.cpp | 296 +++++++++--------- 1 file changed, 148 insertions(+), 148 deletions(-) diff --git a/apps/opencs/model/world/nestedcoladapterimp.cpp b/apps/opencs/model/world/nestedcoladapterimp.cpp index 9cd1a0a3b..debb7ca2f 100644 --- a/apps/opencs/model/world/nestedcoladapterimp.cpp +++ b/apps/opencs/model/world/nestedcoladapterimp.cpp @@ -592,80 +592,80 @@ namespace CSMWorld // from ESM::Attribute, ESM::Skill and MWMechanics::CreatureStats (for AI) static const std::map sEncToInfoFunc = { - { "00", "Rank Low" }, - { "01", "Rank High" }, - { "02", "Rank Requirement" }, - { "03", "Reputation" }, - { "04", "Health Percent" }, - { "05", "PC Reputation" }, - { "06", "PC Level" }, - { "07", "PC Health Percent" }, - { "08", "PC Magicka" }, // dynamic stat - { "09", "PC Fatigue" }, // dynamic stat - { "10", "PC Strength" }, // attrib - { "11", "PC Block" }, - { "12", "PC Armoror" }, - { "13", "PC Medium Armor" }, - { "14", "PC Heavy Armor" }, - { "15", "PC Blunt Weapon" }, - { "16", "PC Long Blade" }, - { "17", "PC Axe" }, - { "18", "PC Spear" }, - { "19", "PC Athletics" }, - { "20", "PC Enchant" }, - { "21", "PC Destruction" }, - { "22", "PC Alteration" }, - { "23", "PC Illusion" }, - { "24", "PC Conjuration" }, - { "25", "PC Mysticism" }, - { "26", "PC Restoration" }, - { "27", "PC Alchemy" }, - { "28", "PC Unarmored" }, - { "29", "PC Security" }, - { "30", "PC Sneak" }, - { "31", "PC Acrobatics" }, - { "32", "PC Light Armor" }, - { "33", "PC Short Blade" }, - { "34", "PC Marksman" }, - { "35", "PC Merchantile" }, - { "36", "PC Speechcraft" }, - { "37", "PC Hand To Hand" }, - { "38", "PC Sex" }, - { "39", "PC Expelled" }, - { "40", "PC Common Disease" }, - { "41", "PC Blight Disease" }, - { "42", "PC Clothing Modifier" }, - { "43", "PC Crime Level" }, - { "44", "Same Sex" }, - { "45", "Same Race" }, - { "46", "Same Faction" }, - { "47", "Faction Rank Difference" }, - { "48", "Detected" }, - { "49", "Alarmed" }, - { "50", "Choice" }, - { "51", "PC Intelligence" }, // attrib - { "52", "PC Willpower" }, // attrib - { "53", "PC Agility" }, // attrib - { "54", "PC Speed" }, // attrib - { "55", "PC Endurance" }, // attrib - { "56", "PC Personality" }, // attrib - { "57", "PC Luck" }, // attrib - { "58", "PC Corpus" }, - { "59", "Weather" }, - { "60", "PC Vampire" }, - { "61", "Level" }, - { "62", "Attacked" }, - { "63", "Talked To PC" }, - { "64", "PC Health" }, // dynamic stat - { "65", "Creature Target" }, - { "66", "Friend Hit" }, - { "67", "Fight" }, // AI - { "68", "Hello" }, // AI - { "69", "Alarm" }, // AI - { "70", "Flee" }, // AI - { "71", "Should Attack" }, - { "72", "Werewolf" }, - { "73", "PC Werewolf Kills" } + std::make_pair( "00", "Rank Low" ), + std::make_pair( "01", "Rank High" ), + std::make_pair( "02", "Rank Requirement" ), + std::make_pair( "03", "Reputation" ), + std::make_pair( "04", "Health Percent" ), + std::make_pair( "05", "PC Reputation" ), + std::make_pair( "06", "PC Level" ), + std::make_pair( "07", "PC Health Percent" ), + std::make_pair( "08", "PC Magicka" ), // dynamic stat + std::make_pair( "09", "PC Fatigue" ), // dynamic stat + std::make_pair( "10", "PC Strength" ), // attrib + std::make_pair( "11", "PC Block" ), + std::make_pair( "12", "PC Armoror" ), + std::make_pair( "13", "PC Medium Armor" ), + std::make_pair( "14", "PC Heavy Armor" ), + std::make_pair( "15", "PC Blunt Weapon" ), + std::make_pair( "16", "PC Long Blade" ), + std::make_pair( "17", "PC Axe" ), + std::make_pair( "18", "PC Spear" ), + std::make_pair( "19", "PC Athletics" ), + std::make_pair( "20", "PC Enchant" ), + std::make_pair( "21", "PC Destruction" ), + std::make_pair( "22", "PC Alteration" ), + std::make_pair( "23", "PC Illusion" ), + std::make_pair( "24", "PC Conjuration" ), + std::make_pair( "25", "PC Mysticism" ), + std::make_pair( "26", "PC Restoration" ), + std::make_pair( "27", "PC Alchemy" ), + std::make_pair( "28", "PC Unarmored" ), + std::make_pair( "29", "PC Security" ), + std::make_pair( "30", "PC Sneak" ), + std::make_pair( "31", "PC Acrobatics" ), + std::make_pair( "32", "PC Light Armor" ), + std::make_pair( "33", "PC Short Blade" ), + std::make_pair( "34", "PC Marksman" ), + std::make_pair( "35", "PC Merchantile" ), + std::make_pair( "36", "PC Speechcraft" ), + std::make_pair( "37", "PC Hand To Hand" ), + std::make_pair( "38", "PC Sex" ), + std::make_pair( "39", "PC Expelled" ), + std::make_pair( "40", "PC Common Disease" ), + std::make_pair( "41", "PC Blight Disease" ), + std::make_pair( "42", "PC Clothing Modifier" ), + std::make_pair( "43", "PC Crime Level" ), + std::make_pair( "44", "Same Sex" ), + std::make_pair( "45", "Same Race" ), + std::make_pair( "46", "Same Faction" ), + std::make_pair( "47", "Faction Rank Difference" ), + std::make_pair( "48", "Detected" ), + std::make_pair( "49", "Alarmed" ), + std::make_pair( "50", "Choice" ), + std::make_pair( "51", "PC Intelligence" ), // attrib + std::make_pair( "52", "PC Willpower" ), // attrib + std::make_pair( "53", "PC Agility" ), // attrib + std::make_pair( "54", "PC Speed" ), // attrib + std::make_pair( "55", "PC Endurance" ), // attrib + std::make_pair( "56", "PC Personality" ), // attrib + std::make_pair( "57", "PC Luck" ), // attrib + std::make_pair( "58", "PC Corpus" ), + std::make_pair( "59", "Weather" ), + std::make_pair( "60", "PC Vampire" ), + std::make_pair( "61", "Level" ), + std::make_pair( "62", "Attacked" ), + std::make_pair( "63", "Talked To PC" ), + std::make_pair( "64", "PC Health" ), // dynamic stat + std::make_pair( "65", "Creature Target" ), + std::make_pair( "66", "Friend Hit" ), + std::make_pair( "67", "Fight" ), // AI + std::make_pair( "68", "Hello" ), // AI + std::make_pair( "69", "Alarm" ), // AI + std::make_pair( "70", "Flee" ), // AI + std::make_pair( "71", "Should Attack" ), + std::make_pair( "72", "Werewolf" ), + std::make_pair( "73", "PC Werewolf Kills" ) }; QVariant InfoConditionAdapter::getData(const Record& record, @@ -751,80 +751,80 @@ namespace CSMWorld static const std::map sInfoFuncToEnc = { - { "Alarm", "69" }, // AI - { "Alarmed", "49" }, - { "Attacked", "62" }, - { "Choice", "50" }, - { "Creature Target", "65" }, - { "Detected", "48" }, - { "Faction Rank Difference", "47" }, - { "Fight", "67" }, // AI - { "Flee", "70" }, // AI - { "Friend Hit", "66" }, - { "Health Percent", "04" }, - { "Hello", "68" }, // AI - { "Level", "61" }, - { "PC Acrobatics", "31" }, - { "PC Agility", "53" }, // attrib - { "PC Alchemy", "27" }, - { "PC Alteration", "22" }, - { "PC Armoror", "12" }, - { "PC Athletics", "19" }, - { "PC Axe", "17" }, - { "PC Blight Disease", "41" }, - { "PC Block", "11" }, - { "PC Blunt Weapon", "15" }, - { "PC Clothing Modifier", "42" }, - { "PC Common Disease", "40" }, - { "PC Conjuration", "24" }, - { "PC Corpus", "58" }, - { "PC Crime Level", "43" }, - { "PC Destruction", "21" }, - { "PC Enchant", "20" }, - { "PC Endurance", "55" }, // attrib - { "PC Expelled", "39" }, - { "PC Fatigue", "09" }, // dynamic stat - { "PC Hand To Hand", "37" }, - { "PC Health", "64" }, // dynamic stat - { "PC Health Percent", "07" }, - { "PC Heavy Armor", "14" }, - { "PC Illusion", "23" }, - { "PC Intelligence", "51" }, // attrib - { "PC Level", "06" }, - { "PC Light Armor", "32" }, - { "PC Long Blade", "16" }, - { "PC Luck", "57" }, // attrib - { "PC Magicka", "08" }, // dynamic stat - { "PC Marksman", "34" }, - { "PC Medium Armor", "13" }, - { "PC Merchantile", "35" }, - { "PC Mysticism", "25" }, - { "PC Personality", "56" }, // attrib - { "PC Reputation", "05" }, - { "PC Restoration", "26" }, - { "PC Security", "29" }, - { "PC Sex", "38" }, - { "PC Short Blade", "33" }, - { "PC Sneak", "30" }, - { "PC Spear", "18" }, - { "PC Speechcraft", "36" }, - { "PC Speed", "54" }, // attrib - { "PC Strength", "10" }, // attrib - { "PC Unarmored", "28" }, - { "PC Vampire", "60" }, - { "PC Werewolf Kills", "73" }, - { "PC Willpower", "52" }, // attrib - { "Rank Requirement", "02" }, - { "Rank High", "01" }, - { "Rank Low", "00" }, - { "Reputation", "03" }, - { "Same Faction", "46" }, - { "Same Race", "45" }, - { "Same Sex", "44" }, - { "Should Attack", "71" }, - { "Talked To PC", "63" }, - { "Weather", "59" }, - { "Werewolf", "72" } + std::make_pair( "Alarm", "69" ), // AI + std::make_pair( "Alarmed", "49" ), + std::make_pair( "Attacked", "62" ), + std::make_pair( "Choice", "50" ), + std::make_pair( "Creature Target", "65" ), + std::make_pair( "Detected", "48" ), + std::make_pair( "Faction Rank Difference", "47" ), + std::make_pair( "Fight", "67" ), // AI + std::make_pair( "Flee", "70" ), // AI + std::make_pair( "Friend Hit", "66" ), + std::make_pair( "Health Percent", "04" ), + std::make_pair( "Hello", "68" ), // AI + std::make_pair( "Level", "61" ), + std::make_pair( "PC Acrobatics", "31" ), + std::make_pair( "PC Agility", "53" ), // attrib + std::make_pair( "PC Alchemy", "27" ), + std::make_pair( "PC Alteration", "22" ), + std::make_pair( "PC Armoror", "12" ), + std::make_pair( "PC Athletics", "19" ), + std::make_pair( "PC Axe", "17" ), + std::make_pair( "PC Blight Disease", "41" ), + std::make_pair( "PC Block", "11" ), + std::make_pair( "PC Blunt Weapon", "15" ), + std::make_pair( "PC Clothing Modifier", "42" ), + std::make_pair( "PC Common Disease", "40" ), + std::make_pair( "PC Conjuration", "24" ), + std::make_pair( "PC Corpus", "58" ), + std::make_pair( "PC Crime Level", "43" ), + std::make_pair( "PC Destruction", "21" ), + std::make_pair( "PC Enchant", "20" ), + std::make_pair( "PC Endurance", "55" ), // attrib + std::make_pair( "PC Expelled", "39" ), + std::make_pair( "PC Fatigue", "09" ), // dynamic stat + std::make_pair( "PC Hand To Hand", "37" ), + std::make_pair( "PC Health", "64" ), // dynamic stat + std::make_pair( "PC Health Percent", "07" ), + std::make_pair( "PC Heavy Armor", "14" ), + std::make_pair( "PC Illusion", "23" ), + std::make_pair( "PC Intelligence", "51" ), // attrib + std::make_pair( "PC Level", "06" ), + std::make_pair( "PC Light Armor", "32" ), + std::make_pair( "PC Long Blade", "16" ), + std::make_pair( "PC Luck", "57" ), // attrib + std::make_pair( "PC Magicka", "08" ), // dynamic stat + std::make_pair( "PC Marksman", "34" ), + std::make_pair( "PC Medium Armor", "13" ), + std::make_pair( "PC Merchantile", "35" ), + std::make_pair( "PC Mysticism", "25" ), + std::make_pair( "PC Personality", "56" ), // attrib + std::make_pair( "PC Reputation", "05" ), + std::make_pair( "PC Restoration", "26" ), + std::make_pair( "PC Security", "29" ), + std::make_pair( "PC Sex", "38" ), + std::make_pair( "PC Short Blade", "33" ), + std::make_pair( "PC Sneak", "30" ), + std::make_pair( "PC Spear", "18" ), + std::make_pair( "PC Speechcraft", "36" ), + std::make_pair( "PC Speed", "54" ), // attrib + std::make_pair( "PC Strength", "10" ), // attrib + std::make_pair( "PC Unarmored", "28" ), + std::make_pair( "PC Vampire", "60" ), + std::make_pair( "PC Werewolf Kills", "73" ), + std::make_pair( "PC Willpower", "52" ), // attrib + std::make_pair( "Rank Requirement", "02" ), + std::make_pair( "Rank High", "01" ), + std::make_pair( "Rank Low", "00" ), + std::make_pair( "Reputation", "03" ), + std::make_pair( "Same Faction", "46" ), + std::make_pair( "Same Race", "45" ), + std::make_pair( "Same Sex", "44" ), + std::make_pair( "Should Attack", "71" ), + std::make_pair( "Talked To PC", "63" ), + std::make_pair( "Weather", "59" ), + std::make_pair( "Werewolf", "72" ) }; void InfoConditionAdapter::setData(Record& record, From d6ecc64168bf164d7157abe4b8deaf3336fd3d8f Mon Sep 17 00:00:00 2001 From: cc9cii Date: Sun, 10 May 2015 06:17:57 +1000 Subject: [PATCH 12/57] Aggregate types can't be static - osx compiler appears to be more strict. --- .../model/world/nestedcoladapterimp.cpp | 300 +++++++++--------- 1 file changed, 150 insertions(+), 150 deletions(-) diff --git a/apps/opencs/model/world/nestedcoladapterimp.cpp b/apps/opencs/model/world/nestedcoladapterimp.cpp index debb7ca2f..f1088829e 100644 --- a/apps/opencs/model/world/nestedcoladapterimp.cpp +++ b/apps/opencs/model/world/nestedcoladapterimp.cpp @@ -590,82 +590,82 @@ namespace CSMWorld // See the mappings in MWDialogue::SelectWrapper::getArgument // from ESM::Attribute, ESM::Skill and MWMechanics::CreatureStats (for AI) - static const std::map sEncToInfoFunc = + const std::map sEncToInfoFunc = { - std::make_pair( "00", "Rank Low" ), - std::make_pair( "01", "Rank High" ), - std::make_pair( "02", "Rank Requirement" ), - std::make_pair( "03", "Reputation" ), - std::make_pair( "04", "Health Percent" ), - std::make_pair( "05", "PC Reputation" ), - std::make_pair( "06", "PC Level" ), - std::make_pair( "07", "PC Health Percent" ), - std::make_pair( "08", "PC Magicka" ), // dynamic stat - std::make_pair( "09", "PC Fatigue" ), // dynamic stat - std::make_pair( "10", "PC Strength" ), // attrib - std::make_pair( "11", "PC Block" ), - std::make_pair( "12", "PC Armoror" ), - std::make_pair( "13", "PC Medium Armor" ), - std::make_pair( "14", "PC Heavy Armor" ), - std::make_pair( "15", "PC Blunt Weapon" ), - std::make_pair( "16", "PC Long Blade" ), - std::make_pair( "17", "PC Axe" ), - std::make_pair( "18", "PC Spear" ), - std::make_pair( "19", "PC Athletics" ), - std::make_pair( "20", "PC Enchant" ), - std::make_pair( "21", "PC Destruction" ), - std::make_pair( "22", "PC Alteration" ), - std::make_pair( "23", "PC Illusion" ), - std::make_pair( "24", "PC Conjuration" ), - std::make_pair( "25", "PC Mysticism" ), - std::make_pair( "26", "PC Restoration" ), - std::make_pair( "27", "PC Alchemy" ), - std::make_pair( "28", "PC Unarmored" ), - std::make_pair( "29", "PC Security" ), - std::make_pair( "30", "PC Sneak" ), - std::make_pair( "31", "PC Acrobatics" ), - std::make_pair( "32", "PC Light Armor" ), - std::make_pair( "33", "PC Short Blade" ), - std::make_pair( "34", "PC Marksman" ), - std::make_pair( "35", "PC Merchantile" ), - std::make_pair( "36", "PC Speechcraft" ), - std::make_pair( "37", "PC Hand To Hand" ), - std::make_pair( "38", "PC Sex" ), - std::make_pair( "39", "PC Expelled" ), - std::make_pair( "40", "PC Common Disease" ), - std::make_pair( "41", "PC Blight Disease" ), - std::make_pair( "42", "PC Clothing Modifier" ), - std::make_pair( "43", "PC Crime Level" ), - std::make_pair( "44", "Same Sex" ), - std::make_pair( "45", "Same Race" ), - std::make_pair( "46", "Same Faction" ), - std::make_pair( "47", "Faction Rank Difference" ), - std::make_pair( "48", "Detected" ), - std::make_pair( "49", "Alarmed" ), - std::make_pair( "50", "Choice" ), - std::make_pair( "51", "PC Intelligence" ), // attrib - std::make_pair( "52", "PC Willpower" ), // attrib - std::make_pair( "53", "PC Agility" ), // attrib - std::make_pair( "54", "PC Speed" ), // attrib - std::make_pair( "55", "PC Endurance" ), // attrib - std::make_pair( "56", "PC Personality" ), // attrib - std::make_pair( "57", "PC Luck" ), // attrib - std::make_pair( "58", "PC Corpus" ), - std::make_pair( "59", "Weather" ), - std::make_pair( "60", "PC Vampire" ), - std::make_pair( "61", "Level" ), - std::make_pair( "62", "Attacked" ), - std::make_pair( "63", "Talked To PC" ), - std::make_pair( "64", "PC Health" ), // dynamic stat - std::make_pair( "65", "Creature Target" ), - std::make_pair( "66", "Friend Hit" ), - std::make_pair( "67", "Fight" ), // AI - std::make_pair( "68", "Hello" ), // AI - std::make_pair( "69", "Alarm" ), // AI - std::make_pair( "70", "Flee" ), // AI - std::make_pair( "71", "Should Attack" ), - std::make_pair( "72", "Werewolf" ), - std::make_pair( "73", "PC Werewolf Kills" ) + { "00", "Rank Low" }, + { "01", "Rank High" }, + { "02", "Rank Requirement" }, + { "03", "Reputation" }, + { "04", "Health Percent" }, + { "05", "PC Reputation" }, + { "06", "PC Level" }, + { "07", "PC Health Percent" }, + { "08", "PC Magicka" }, // dynamic stat + { "09", "PC Fatigue" }, // dynamic stat + { "10", "PC Strength" }, // attrib + { "11", "PC Block" }, + { "12", "PC Armoror" }, + { "13", "PC Medium Armor" }, + { "14", "PC Heavy Armor" }, + { "15", "PC Blunt Weapon" }, + { "16", "PC Long Blade" }, + { "17", "PC Axe" }, + { "18", "PC Spear" }, + { "19", "PC Athletics" }, + { "20", "PC Enchant" }, + { "21", "PC Destruction" }, + { "22", "PC Alteration" }, + { "23", "PC Illusion" }, + { "24", "PC Conjuration" }, + { "25", "PC Mysticism" }, + { "26", "PC Restoration" }, + { "27", "PC Alchemy" }, + { "28", "PC Unarmored" }, + { "29", "PC Security" }, + { "30", "PC Sneak" }, + { "31", "PC Acrobatics" }, + { "32", "PC Light Armor" }, + { "33", "PC Short Blade" }, + { "34", "PC Marksman" }, + { "35", "PC Merchantile" }, + { "36", "PC Speechcraft" }, + { "37", "PC Hand To Hand" }, + { "38", "PC Sex" }, + { "39", "PC Expelled" }, + { "40", "PC Common Disease" }, + { "41", "PC Blight Disease" }, + { "42", "PC Clothing Modifier" }, + { "43", "PC Crime Level" }, + { "44", "Same Sex" }, + { "45", "Same Race" }, + { "46", "Same Faction" }, + { "47", "Faction Rank Difference" }, + { "48", "Detected" }, + { "49", "Alarmed" }, + { "50", "Choice" }, + { "51", "PC Intelligence" }, // attrib + { "52", "PC Willpower" }, // attrib + { "53", "PC Agility" }, // attrib + { "54", "PC Speed" }, // attrib + { "55", "PC Endurance" }, // attrib + { "56", "PC Personality" }, // attrib + { "57", "PC Luck" }, // attrib + { "58", "PC Corpus" }, + { "59", "Weather" }, + { "60", "PC Vampire" }, + { "61", "Level" }, + { "62", "Attacked" }, + { "63", "Talked To PC" }, + { "64", "PC Health" }, // dynamic stat + { "65", "Creature Target" }, + { "66", "Friend Hit" }, + { "67", "Fight" }, // AI + { "68", "Hello" }, // AI + { "69", "Alarm" }, // AI + { "70", "Flee" }, // AI + { "71", "Should Attack" }, + { "72", "Werewolf" }, + { "73", "PC Werewolf Kills" } }; QVariant InfoConditionAdapter::getData(const Record& record, @@ -749,82 +749,82 @@ namespace CSMWorld } } - static const std::map sInfoFuncToEnc = + const std::map sInfoFuncToEnc = { - std::make_pair( "Alarm", "69" ), // AI - std::make_pair( "Alarmed", "49" ), - std::make_pair( "Attacked", "62" ), - std::make_pair( "Choice", "50" ), - std::make_pair( "Creature Target", "65" ), - std::make_pair( "Detected", "48" ), - std::make_pair( "Faction Rank Difference", "47" ), - std::make_pair( "Fight", "67" ), // AI - std::make_pair( "Flee", "70" ), // AI - std::make_pair( "Friend Hit", "66" ), - std::make_pair( "Health Percent", "04" ), - std::make_pair( "Hello", "68" ), // AI - std::make_pair( "Level", "61" ), - std::make_pair( "PC Acrobatics", "31" ), - std::make_pair( "PC Agility", "53" ), // attrib - std::make_pair( "PC Alchemy", "27" ), - std::make_pair( "PC Alteration", "22" ), - std::make_pair( "PC Armoror", "12" ), - std::make_pair( "PC Athletics", "19" ), - std::make_pair( "PC Axe", "17" ), - std::make_pair( "PC Blight Disease", "41" ), - std::make_pair( "PC Block", "11" ), - std::make_pair( "PC Blunt Weapon", "15" ), - std::make_pair( "PC Clothing Modifier", "42" ), - std::make_pair( "PC Common Disease", "40" ), - std::make_pair( "PC Conjuration", "24" ), - std::make_pair( "PC Corpus", "58" ), - std::make_pair( "PC Crime Level", "43" ), - std::make_pair( "PC Destruction", "21" ), - std::make_pair( "PC Enchant", "20" ), - std::make_pair( "PC Endurance", "55" ), // attrib - std::make_pair( "PC Expelled", "39" ), - std::make_pair( "PC Fatigue", "09" ), // dynamic stat - std::make_pair( "PC Hand To Hand", "37" ), - std::make_pair( "PC Health", "64" ), // dynamic stat - std::make_pair( "PC Health Percent", "07" ), - std::make_pair( "PC Heavy Armor", "14" ), - std::make_pair( "PC Illusion", "23" ), - std::make_pair( "PC Intelligence", "51" ), // attrib - std::make_pair( "PC Level", "06" ), - std::make_pair( "PC Light Armor", "32" ), - std::make_pair( "PC Long Blade", "16" ), - std::make_pair( "PC Luck", "57" ), // attrib - std::make_pair( "PC Magicka", "08" ), // dynamic stat - std::make_pair( "PC Marksman", "34" ), - std::make_pair( "PC Medium Armor", "13" ), - std::make_pair( "PC Merchantile", "35" ), - std::make_pair( "PC Mysticism", "25" ), - std::make_pair( "PC Personality", "56" ), // attrib - std::make_pair( "PC Reputation", "05" ), - std::make_pair( "PC Restoration", "26" ), - std::make_pair( "PC Security", "29" ), - std::make_pair( "PC Sex", "38" ), - std::make_pair( "PC Short Blade", "33" ), - std::make_pair( "PC Sneak", "30" ), - std::make_pair( "PC Spear", "18" ), - std::make_pair( "PC Speechcraft", "36" ), - std::make_pair( "PC Speed", "54" ), // attrib - std::make_pair( "PC Strength", "10" ), // attrib - std::make_pair( "PC Unarmored", "28" ), - std::make_pair( "PC Vampire", "60" ), - std::make_pair( "PC Werewolf Kills", "73" ), - std::make_pair( "PC Willpower", "52" ), // attrib - std::make_pair( "Rank Requirement", "02" ), - std::make_pair( "Rank High", "01" ), - std::make_pair( "Rank Low", "00" ), - std::make_pair( "Reputation", "03" ), - std::make_pair( "Same Faction", "46" ), - std::make_pair( "Same Race", "45" ), - std::make_pair( "Same Sex", "44" ), - std::make_pair( "Should Attack", "71" ), - std::make_pair( "Talked To PC", "63" ), - std::make_pair( "Weather", "59" ), - std::make_pair( "Werewolf", "72" ) + { "Alarm", "69" }, // AI + { "Alarmed", "49" }, + { "Attacked", "62" }, + { "Choice", "50" }, + { "Creature Target", "65" }, + { "Detected", "48" }, + { "Faction Rank Difference", "47" }, + { "Fight", "67" }, // AI + { "Flee", "70" }, // AI + { "Friend Hit", "66" }, + { "Health Percent", "04" }, + { "Hello", "68" }, // AI + { "Level", "61" }, + { "PC Acrobatics", "31" }, + { "PC Agility", "53" }, // attrib + { "PC Alchemy", "27" }, + { "PC Alteration", "22" }, + { "PC Armoror", "12" }, + { "PC Athletics", "19" }, + { "PC Axe", "17" }, + { "PC Blight Disease", "41" }, + { "PC Block", "11" }, + { "PC Blunt Weapon", "15" }, + { "PC Clothing Modifier", "42" }, + { "PC Common Disease", "40" }, + { "PC Conjuration", "24" }, + { "PC Corpus", "58" }, + { "PC Crime Level", "43" }, + { "PC Destruction", "21" }, + { "PC Enchant", "20" }, + { "PC Endurance", "55" }, // attrib + { "PC Expelled", "39" }, + { "PC Fatigue", "09" }, // dynamic stat + { "PC Hand To Hand", "37" }, + { "PC Health", "64" }, // dynamic stat + { "PC Health Percent", "07" }, + { "PC Heavy Armor", "14" }, + { "PC Illusion", "23" }, + { "PC Intelligence", "51" }, // attrib + { "PC Level", "06" }, + { "PC Light Armor", "32" }, + { "PC Long Blade", "16" }, + { "PC Luck", "57" }, // attrib + { "PC Magicka", "08" }, // dynamic stat + { "PC Marksman", "34" }, + { "PC Medium Armor", "13" }, + { "PC Merchantile", "35" }, + { "PC Mysticism", "25" }, + { "PC Personality", "56" }, // attrib + { "PC Reputation", "05" }, + { "PC Restoration", "26" }, + { "PC Security", "29" }, + { "PC Sex", "38" }, + { "PC Short Blade", "33" }, + { "PC Sneak", "30" }, + { "PC Spear", "18" }, + { "PC Speechcraft", "36" }, + { "PC Speed", "54" }, // attrib + { "PC Strength", "10" }, // attrib + { "PC Unarmored", "28" }, + { "PC Vampire", "60" }, + { "PC Werewolf Kills", "73" }, + { "PC Willpower", "52" }, // attrib + { "Rank Requirement", "02" }, + { "Rank High", "01" }, + { "Rank Low", "00" }, + { "Reputation", "03" }, + { "Same Faction", "46" }, + { "Same Race", "45" }, + { "Same Sex", "44" }, + { "Should Attack", "71" }, + { "Talked To PC", "63" }, + { "Weather", "59" }, + { "Werewolf", "72" } }; void InfoConditionAdapter::setData(Record& record, From 5fb269336f3d7e78588141a0d21bba15b55db76e Mon Sep 17 00:00:00 2001 From: cc9cii Date: Sun, 10 May 2015 07:02:08 +1000 Subject: [PATCH 13/57] Don't use initializer list --- .../model/world/nestedcoladapterimp.cpp | 312 +++++++++--------- 1 file changed, 159 insertions(+), 153 deletions(-) diff --git a/apps/opencs/model/world/nestedcoladapterimp.cpp b/apps/opencs/model/world/nestedcoladapterimp.cpp index f1088829e..8ee4af2f8 100644 --- a/apps/opencs/model/world/nestedcoladapterimp.cpp +++ b/apps/opencs/model/world/nestedcoladapterimp.cpp @@ -590,83 +590,86 @@ namespace CSMWorld // See the mappings in MWDialogue::SelectWrapper::getArgument // from ESM::Attribute, ESM::Skill and MWMechanics::CreatureStats (for AI) - const std::map sEncToInfoFunc = + static std::map populateEncToInfoFunc() { - { "00", "Rank Low" }, - { "01", "Rank High" }, - { "02", "Rank Requirement" }, - { "03", "Reputation" }, - { "04", "Health Percent" }, - { "05", "PC Reputation" }, - { "06", "PC Level" }, - { "07", "PC Health Percent" }, - { "08", "PC Magicka" }, // dynamic stat - { "09", "PC Fatigue" }, // dynamic stat - { "10", "PC Strength" }, // attrib - { "11", "PC Block" }, - { "12", "PC Armoror" }, - { "13", "PC Medium Armor" }, - { "14", "PC Heavy Armor" }, - { "15", "PC Blunt Weapon" }, - { "16", "PC Long Blade" }, - { "17", "PC Axe" }, - { "18", "PC Spear" }, - { "19", "PC Athletics" }, - { "20", "PC Enchant" }, - { "21", "PC Destruction" }, - { "22", "PC Alteration" }, - { "23", "PC Illusion" }, - { "24", "PC Conjuration" }, - { "25", "PC Mysticism" }, - { "26", "PC Restoration" }, - { "27", "PC Alchemy" }, - { "28", "PC Unarmored" }, - { "29", "PC Security" }, - { "30", "PC Sneak" }, - { "31", "PC Acrobatics" }, - { "32", "PC Light Armor" }, - { "33", "PC Short Blade" }, - { "34", "PC Marksman" }, - { "35", "PC Merchantile" }, - { "36", "PC Speechcraft" }, - { "37", "PC Hand To Hand" }, - { "38", "PC Sex" }, - { "39", "PC Expelled" }, - { "40", "PC Common Disease" }, - { "41", "PC Blight Disease" }, - { "42", "PC Clothing Modifier" }, - { "43", "PC Crime Level" }, - { "44", "Same Sex" }, - { "45", "Same Race" }, - { "46", "Same Faction" }, - { "47", "Faction Rank Difference" }, - { "48", "Detected" }, - { "49", "Alarmed" }, - { "50", "Choice" }, - { "51", "PC Intelligence" }, // attrib - { "52", "PC Willpower" }, // attrib - { "53", "PC Agility" }, // attrib - { "54", "PC Speed" }, // attrib - { "55", "PC Endurance" }, // attrib - { "56", "PC Personality" }, // attrib - { "57", "PC Luck" }, // attrib - { "58", "PC Corpus" }, - { "59", "Weather" }, - { "60", "PC Vampire" }, - { "61", "Level" }, - { "62", "Attacked" }, - { "63", "Talked To PC" }, - { "64", "PC Health" }, // dynamic stat - { "65", "Creature Target" }, - { "66", "Friend Hit" }, - { "67", "Fight" }, // AI - { "68", "Hello" }, // AI - { "69", "Alarm" }, // AI - { "70", "Flee" }, // AI - { "71", "Should Attack" }, - { "72", "Werewolf" }, - { "73", "PC Werewolf Kills" } - }; + std::map funcMap; + funcMap["00"] = "Rank Low"; + funcMap["01"] = "Rank High"; + funcMap["02"] = "Rank Requirement"; + funcMap["03"] = "Reputation"; + funcMap["04"] = "Health Percent"; + funcMap["05"] = "PC Reputation"; + funcMap["06"] = "PC Level"; + funcMap["07"] = "PC Health Percent"; + funcMap["08"] = "PC Magicka"; + funcMap["09"] = "PC Fatigue"; + funcMap["10"] = "PC Strength"; + funcMap["11"] = "PC Block"; + funcMap["12"] = "PC Armoror"; + funcMap["13"] = "PC Medium Armor"; + funcMap["14"] = "PC Heavy Armor"; + funcMap["15"] = "PC Blunt Weapon"; + funcMap["16"] = "PC Long Blade"; + funcMap["17"] = "PC Axe"; + funcMap["18"] = "PC Spear"; + funcMap["19"] = "PC Athletics"; + funcMap["20"] = "PC Enchant"; + funcMap["21"] = "PC Destruction"; + funcMap["22"] = "PC Alteration"; + funcMap["23"] = "PC Illusion"; + funcMap["24"] = "PC Conjuration"; + funcMap["25"] = "PC Mysticism"; + funcMap["26"] = "PC Restoration"; + funcMap["27"] = "PC Alchemy"; + funcMap["28"] = "PC Unarmored"; + funcMap["29"] = "PC Security"; + funcMap["30"] = "PC Sneak"; + funcMap["31"] = "PC Acrobatics"; + funcMap["32"] = "PC Light Armor"; + funcMap["33"] = "PC Short Blade"; + funcMap["34"] = "PC Marksman"; + funcMap["35"] = "PC Merchantile"; + funcMap["36"] = "PC Speechcraft"; + funcMap["37"] = "PC Hand To Hand"; + funcMap["38"] = "PC Sex"; + funcMap["39"] = "PC Expelled"; + funcMap["40"] = "PC Common Disease"; + funcMap["41"] = "PC Blight Disease"; + funcMap["42"] = "PC Clothing Modifier"; + funcMap["43"] = "PC Crime Level"; + funcMap["44"] = "Same Sex"; + funcMap["45"] = "Same Race"; + funcMap["46"] = "Same Faction"; + funcMap["47"] = "Faction Rank Difference"; + funcMap["48"] = "Detected"; + funcMap["49"] = "Alarmed"; + funcMap["50"] = "Choice"; + funcMap["51"] = "PC Intelligence"; + funcMap["52"] = "PC Willpower"; + funcMap["53"] = "PC Agility"; + funcMap["54"] = "PC Speed"; + funcMap["55"] = "PC Endurance"; + funcMap["56"] = "PC Personality"; + funcMap["57"] = "PC Luck"; + funcMap["58"] = "PC Corpus"; + funcMap["59"] = "Weather"; + funcMap["60"] = "PC Vampire"; + funcMap["61"] = "Level"; + funcMap["62"] = "Attacked"; + funcMap["63"] = "Talked To PC"; + funcMap["64"] = "PC Health"; + funcMap["65"] = "Creature Target"; + funcMap["66"] = "Friend Hit"; + funcMap["67"] = "Fight"; + funcMap["68"] = "Hello"; + funcMap["69"] = "Alarm"; + funcMap["70"] = "Flee"; + funcMap["71"] = "Should Attack"; + funcMap["72"] = "Werewolf"; + funcMap["73"] = "PC Werewolf Kills"; + return funcMap; + } + static const std::map sEncToInfoFunc = populateEncToInfoFunc(); QVariant InfoConditionAdapter::getData(const Record& record, int subRowIndex, int subColIndex) const @@ -749,83 +752,86 @@ namespace CSMWorld } } - const std::map sInfoFuncToEnc = + static std::map populateInfoFuncToEnc() { - { "Alarm", "69" }, // AI - { "Alarmed", "49" }, - { "Attacked", "62" }, - { "Choice", "50" }, - { "Creature Target", "65" }, - { "Detected", "48" }, - { "Faction Rank Difference", "47" }, - { "Fight", "67" }, // AI - { "Flee", "70" }, // AI - { "Friend Hit", "66" }, - { "Health Percent", "04" }, - { "Hello", "68" }, // AI - { "Level", "61" }, - { "PC Acrobatics", "31" }, - { "PC Agility", "53" }, // attrib - { "PC Alchemy", "27" }, - { "PC Alteration", "22" }, - { "PC Armoror", "12" }, - { "PC Athletics", "19" }, - { "PC Axe", "17" }, - { "PC Blight Disease", "41" }, - { "PC Block", "11" }, - { "PC Blunt Weapon", "15" }, - { "PC Clothing Modifier", "42" }, - { "PC Common Disease", "40" }, - { "PC Conjuration", "24" }, - { "PC Corpus", "58" }, - { "PC Crime Level", "43" }, - { "PC Destruction", "21" }, - { "PC Enchant", "20" }, - { "PC Endurance", "55" }, // attrib - { "PC Expelled", "39" }, - { "PC Fatigue", "09" }, // dynamic stat - { "PC Hand To Hand", "37" }, - { "PC Health", "64" }, // dynamic stat - { "PC Health Percent", "07" }, - { "PC Heavy Armor", "14" }, - { "PC Illusion", "23" }, - { "PC Intelligence", "51" }, // attrib - { "PC Level", "06" }, - { "PC Light Armor", "32" }, - { "PC Long Blade", "16" }, - { "PC Luck", "57" }, // attrib - { "PC Magicka", "08" }, // dynamic stat - { "PC Marksman", "34" }, - { "PC Medium Armor", "13" }, - { "PC Merchantile", "35" }, - { "PC Mysticism", "25" }, - { "PC Personality", "56" }, // attrib - { "PC Reputation", "05" }, - { "PC Restoration", "26" }, - { "PC Security", "29" }, - { "PC Sex", "38" }, - { "PC Short Blade", "33" }, - { "PC Sneak", "30" }, - { "PC Spear", "18" }, - { "PC Speechcraft", "36" }, - { "PC Speed", "54" }, // attrib - { "PC Strength", "10" }, // attrib - { "PC Unarmored", "28" }, - { "PC Vampire", "60" }, - { "PC Werewolf Kills", "73" }, - { "PC Willpower", "52" }, // attrib - { "Rank Requirement", "02" }, - { "Rank High", "01" }, - { "Rank Low", "00" }, - { "Reputation", "03" }, - { "Same Faction", "46" }, - { "Same Race", "45" }, - { "Same Sex", "44" }, - { "Should Attack", "71" }, - { "Talked To PC", "63" }, - { "Weather", "59" }, - { "Werewolf", "72" } - }; + std::map encMap; + encMap["Alarm"] = "69"; // AI + encMap["Alarmed"] = "49"; + encMap["Attacked"] = "62"; + encMap["Choice"] = "50"; + encMap["Creature Target"] = "65"; + encMap["Detected"] = "48"; + encMap["Faction Rank Difference"] ="47"; + encMap["Fight"] = "67"; // AI + encMap["Flee"] = "70"; // AI + encMap["Friend Hit"] = "66"; + encMap["Health Percent"] = "04"; + encMap["Hello"] = "68"; // AI + encMap["Level"] = "61"; + encMap["PC Acrobatics"] = "31"; + encMap["PC Agility"] = "53"; // attrib + encMap["PC Alchemy"] = "27"; + encMap["PC Alteration"] = "22"; + encMap["PC Armoror"] = "12"; + encMap["PC Athletics"] = "19"; + encMap["PC Axe"] = "17"; + encMap["PC Blight Disease"] = "41"; + encMap["PC Block"] = "11"; + encMap["PC Blunt Weapon"] = "15"; + encMap["PC Clothing Modifier"] = "42"; + encMap["PC Common Disease"] = "40"; + encMap["PC Conjuration"] = "24"; + encMap["PC Corpus"] = "58"; + encMap["PC Crime Level"] = "43"; + encMap["PC Destruction"] = "21"; + encMap["PC Enchant"] = "20"; + encMap["PC Endurance"] = "55"; // attrib + encMap["PC Expelled"] = "39"; + encMap["PC Fatigue"] = "09"; // dynamic stat + encMap["PC Hand To Hand"] = "37"; + encMap["PC Health"] = "64"; // dynamic stat + encMap["PC Health Percent"] = "07"; + encMap["PC Heavy Armor"] = "14"; + encMap["PC Illusion"] = "23"; + encMap["PC Intelligence"] = "51"; // attrib + encMap["PC Level"] = "06"; + encMap["PC Light Armor"] = "32"; + encMap["PC Long Blade"] = "16"; + encMap["PC Luck"] = "57"; // attrib + encMap["PC Magicka"] = "08"; // dynamic stat + encMap["PC Marksman"] = "34"; + encMap["PC Medium Armor"] = "13"; + encMap["PC Merchantile"] = "35"; + encMap["PC Mysticism"] = "25"; + encMap["PC Personality"] = "56"; // attrib + encMap["PC Reputation"] = "05"; + encMap["PC Restoration"] = "26"; + encMap["PC Security"] = "29"; + encMap["PC Sex"] = "38"; + encMap["PC Short Blade"] = "33"; + encMap["PC Sneak"] = "30"; + encMap["PC Spear"] = "18"; + encMap["PC Speechcraft"] = "36"; + encMap["PC Speed"] = "54"; // attrib + encMap["PC Strength"] = "10"; // attrib + encMap["PC Unarmored"] = "28"; + encMap["PC Vampire"] = "60"; + encMap["PC Werewolf Kills"] = "73"; + encMap["PC Willpower"] = "52"; // attrib + encMap["Rank Requirement"] = "02"; + encMap["Rank High"] = "01"; + encMap["Rank Low"] = "00"; + encMap["Reputation"] = "03"; + encMap["Same Faction"] = "46"; + encMap["Same Race"] = "45"; + encMap["Same Sex"] = "44"; + encMap["Should Attack"] = "71"; + encMap["Talked To PC"] = "63"; + encMap["Weather"] = "59"; + encMap["Werewolf"] = "72"; + return encMap; + } + static const std::map sInfoFuncToEnc = populateInfoFuncToEnc(); void InfoConditionAdapter::setData(Record& record, const QVariant& value, int subRowIndex, int subColIndex) const @@ -867,7 +873,7 @@ namespace CSMWorld if (conditions[subRowIndex].mSelectRule[1] == '1') { // throws an exception if the function is not found - const std::map::const_iterator it = sInfoFuncToEnc.find( + const std::map::const_iterator it = sInfoFuncToEnc.find( value.toString().toUtf8().constData()); if (it != sInfoFuncToEnc.end()) { From 587efcfe9db6f2fa6194971368b256cd006c1b49 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Sun, 10 May 2015 07:49:18 +1000 Subject: [PATCH 14/57] Use better initial value type. Fix exception while saving values. --- apps/opencs/model/world/nestedcoladapterimp.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/opencs/model/world/nestedcoladapterimp.cpp b/apps/opencs/model/world/nestedcoladapterimp.cpp index 8ee4af2f8..8c62fb59b 100644 --- a/apps/opencs/model/world/nestedcoladapterimp.cpp +++ b/apps/opencs/model/world/nestedcoladapterimp.cpp @@ -551,6 +551,7 @@ namespace CSMWorld ESM::DialInfo::SelectStruct condStruct; condStruct.mSelectRule = "00000"; condStruct.mValue = ESM::Variant(); + condStruct.mValue.setType(ESM::VT_Int); // default to ints conditions.insert(conditions.begin()+position, condStruct); @@ -688,6 +689,7 @@ namespace CSMWorld char condType = conditions[subRowIndex].mSelectRule[1]; switch (condType) { + case '0': return 0; // blank space case '1': return 1; // Function case '2': return 2; // Global case '3': return 3; // Local @@ -931,6 +933,7 @@ namespace CSMWorld } default: break; } + break; } default: throw std::runtime_error("Info condition subcolumn index out of range"); } From ab21c0551c6f5c3ccb63f6f2670a5f39c2c4294a Mon Sep 17 00:00:00 2001 From: cc9cii Date: Sun, 10 May 2015 13:34:45 +1000 Subject: [PATCH 15/57] Provide a default encoding when changing to "Function". --- apps/opencs/model/world/nestedcoladapterimp.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/opencs/model/world/nestedcoladapterimp.cpp b/apps/opencs/model/world/nestedcoladapterimp.cpp index 8c62fb59b..4c720ba24 100644 --- a/apps/opencs/model/world/nestedcoladapterimp.cpp +++ b/apps/opencs/model/world/nestedcoladapterimp.cpp @@ -854,7 +854,14 @@ namespace CSMWorld { // FIXME: when these change the values of the other columns need to change // correspondingly (and automatically) - case 1: conditions[subRowIndex].mSelectRule[1] = '1'; break; // Function + case 1: + { + conditions[subRowIndex].mSelectRule[1] = '1'; // Function + // default to "Rank Low" + conditions[subRowIndex].mSelectRule[2] = '0'; + conditions[subRowIndex].mSelectRule[3] = '0'; + break; + } case 2: conditions[subRowIndex].mSelectRule[1] = '2'; break; // Global case 3: conditions[subRowIndex].mSelectRule[1] = '3'; break; // Local case 4: conditions[subRowIndex].mSelectRule[1] = '4'; break; // Journal @@ -874,7 +881,6 @@ namespace CSMWorld { if (conditions[subRowIndex].mSelectRule[1] == '1') { - // throws an exception if the function is not found const std::map::const_iterator it = sInfoFuncToEnc.find( value.toString().toUtf8().constData()); if (it != sInfoFuncToEnc.end()) From 8e35ad54bd280a7a540624b1ce6c6267c79ee007 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sun, 10 May 2015 11:17:52 +0200 Subject: [PATCH 16/57] temporarily remove the test for bullet version --- libs/openengine/bullet/physic.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/openengine/bullet/physic.cpp b/libs/openengine/bullet/physic.cpp index 22312e3bc..c0da03651 100644 --- a/libs/openengine/bullet/physic.cpp +++ b/libs/openengine/bullet/physic.cpp @@ -475,9 +475,9 @@ namespace Physic btCollisionShape* collisionShape = raycasting ? shape->mRaycastingShape : shape->mCollisionShape; // TODO: check this from cmake? -#if BT_BULLET_VERSION < 283 -#error "Bullet version 2.83 or later required" -#endif +//#if BT_BULLET_VERSION < 283 +//#error "Bullet version 2.83 or later required" +//#endif bool needDelete = false; if (btBvhTriangleMeshShape* triangleShape = dynamic_cast(shape->mCollisionShape)) From 2b84598e852694650d2fbe8886e7fea31131c793 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Sun, 10 May 2015 20:52:29 +1000 Subject: [PATCH 17/57] Remove duplicated but reversed map. --- .../model/world/nestedcoladapterimp.cpp | 102 +++--------------- 1 file changed, 13 insertions(+), 89 deletions(-) diff --git a/apps/opencs/model/world/nestedcoladapterimp.cpp b/apps/opencs/model/world/nestedcoladapterimp.cpp index 4c720ba24..a0d764576 100644 --- a/apps/opencs/model/world/nestedcoladapterimp.cpp +++ b/apps/opencs/model/world/nestedcoladapterimp.cpp @@ -754,87 +754,6 @@ namespace CSMWorld } } - static std::map populateInfoFuncToEnc() - { - std::map encMap; - encMap["Alarm"] = "69"; // AI - encMap["Alarmed"] = "49"; - encMap["Attacked"] = "62"; - encMap["Choice"] = "50"; - encMap["Creature Target"] = "65"; - encMap["Detected"] = "48"; - encMap["Faction Rank Difference"] ="47"; - encMap["Fight"] = "67"; // AI - encMap["Flee"] = "70"; // AI - encMap["Friend Hit"] = "66"; - encMap["Health Percent"] = "04"; - encMap["Hello"] = "68"; // AI - encMap["Level"] = "61"; - encMap["PC Acrobatics"] = "31"; - encMap["PC Agility"] = "53"; // attrib - encMap["PC Alchemy"] = "27"; - encMap["PC Alteration"] = "22"; - encMap["PC Armoror"] = "12"; - encMap["PC Athletics"] = "19"; - encMap["PC Axe"] = "17"; - encMap["PC Blight Disease"] = "41"; - encMap["PC Block"] = "11"; - encMap["PC Blunt Weapon"] = "15"; - encMap["PC Clothing Modifier"] = "42"; - encMap["PC Common Disease"] = "40"; - encMap["PC Conjuration"] = "24"; - encMap["PC Corpus"] = "58"; - encMap["PC Crime Level"] = "43"; - encMap["PC Destruction"] = "21"; - encMap["PC Enchant"] = "20"; - encMap["PC Endurance"] = "55"; // attrib - encMap["PC Expelled"] = "39"; - encMap["PC Fatigue"] = "09"; // dynamic stat - encMap["PC Hand To Hand"] = "37"; - encMap["PC Health"] = "64"; // dynamic stat - encMap["PC Health Percent"] = "07"; - encMap["PC Heavy Armor"] = "14"; - encMap["PC Illusion"] = "23"; - encMap["PC Intelligence"] = "51"; // attrib - encMap["PC Level"] = "06"; - encMap["PC Light Armor"] = "32"; - encMap["PC Long Blade"] = "16"; - encMap["PC Luck"] = "57"; // attrib - encMap["PC Magicka"] = "08"; // dynamic stat - encMap["PC Marksman"] = "34"; - encMap["PC Medium Armor"] = "13"; - encMap["PC Merchantile"] = "35"; - encMap["PC Mysticism"] = "25"; - encMap["PC Personality"] = "56"; // attrib - encMap["PC Reputation"] = "05"; - encMap["PC Restoration"] = "26"; - encMap["PC Security"] = "29"; - encMap["PC Sex"] = "38"; - encMap["PC Short Blade"] = "33"; - encMap["PC Sneak"] = "30"; - encMap["PC Spear"] = "18"; - encMap["PC Speechcraft"] = "36"; - encMap["PC Speed"] = "54"; // attrib - encMap["PC Strength"] = "10"; // attrib - encMap["PC Unarmored"] = "28"; - encMap["PC Vampire"] = "60"; - encMap["PC Werewolf Kills"] = "73"; - encMap["PC Willpower"] = "52"; // attrib - encMap["Rank Requirement"] = "02"; - encMap["Rank High"] = "01"; - encMap["Rank Low"] = "00"; - encMap["Reputation"] = "03"; - encMap["Same Faction"] = "46"; - encMap["Same Race"] = "45"; - encMap["Same Sex"] = "44"; - encMap["Should Attack"] = "71"; - encMap["Talked To PC"] = "63"; - encMap["Weather"] = "59"; - encMap["Werewolf"] = "72"; - return encMap; - } - static const std::map sInfoFuncToEnc = populateInfoFuncToEnc(); - void InfoConditionAdapter::setData(Record& record, const QVariant& value, int subRowIndex, int subColIndex) const { @@ -881,16 +800,21 @@ namespace CSMWorld { if (conditions[subRowIndex].mSelectRule[1] == '1') { - const std::map::const_iterator it = sInfoFuncToEnc.find( - value.toString().toUtf8().constData()); - if (it != sInfoFuncToEnc.end()) + std::map::const_iterator it = sEncToInfoFunc.begin(); + for (;it != sEncToInfoFunc.end(); ++it) { - std::string rule = conditions[subRowIndex].mSelectRule.substr(0, 2); - rule.append(it->second); - rule.append(std::string(1, conditions[subRowIndex].mSelectRule[4])); - conditions[subRowIndex].mSelectRule = rule.append(value.toString().toUtf8().constData()); + if (it->second == value.toString().toUtf8().constData()) + { + std::string rule = conditions[subRowIndex].mSelectRule.substr(0, 2); + rule.append(it->first); + // leave old values for undo (NOTE: may not be vanilla's behaviour) + rule.append(conditions[subRowIndex].mSelectRule.substr(4)); + conditions[subRowIndex].mSelectRule = rule; + break; + } } - else + + if (it == sEncToInfoFunc.end()) return; // return without saving; TODO: maybe log an error here } else From e4ffb985a153b1b4cc3a1c6c44ce4ba27d7b7170 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sun, 10 May 2015 13:32:01 +0200 Subject: [PATCH 18/57] Revert "Collision fix" This reverts commit 60fffec3452c68ef2675a7c573af0436c051a6d4. --- libs/openengine/bullet/physic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/openengine/bullet/physic.cpp b/libs/openengine/bullet/physic.cpp index cf7dea1db..c0da03651 100644 --- a/libs/openengine/bullet/physic.cpp +++ b/libs/openengine/bullet/physic.cpp @@ -480,7 +480,7 @@ namespace Physic //#endif bool needDelete = false; - if (btBvhTriangleMeshShape* triangleShape = dynamic_cast(collisionShape)) + if (btBvhTriangleMeshShape* triangleShape = dynamic_cast(shape->mCollisionShape)) { btScaledBvhTriangleMeshShape* scaled = new btScaledBvhTriangleMeshShape(triangleShape, btVector3(scale,scale,scale)); collisionShape = scaled; From 107bf818e726827ee57856462c04a4403ed13f17 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sun, 10 May 2015 13:35:21 +0200 Subject: [PATCH 19/57] Revert "Use btScaledBvhTriangleMeshShape, bump required bullet version to 2.83" This reverts commit 27751db99afae9368fc29fabbe0bbedb980c3ace. Conflicts: libs/openengine/bullet/physic.cpp --- components/nifbullet/bulletnifloader.cpp | 4 +-- libs/openengine/bullet/physic.cpp | 32 +++++++----------------- libs/openengine/bullet/physic.hpp | 3 --- 3 files changed, 11 insertions(+), 28 deletions(-) diff --git a/components/nifbullet/bulletnifloader.cpp b/components/nifbullet/bulletnifloader.cpp index 3207af0fe..93c9797b2 100644 --- a/components/nifbullet/bulletnifloader.cpp +++ b/components/nifbullet/bulletnifloader.cpp @@ -123,7 +123,7 @@ void ManualBulletShapeLoader::loadResource(Ogre::Resource *resource) mCompoundShape = NULL; mStaticMesh = NULL; - Nif::NIFFilePtr pnif (Nif::Cache::getInstance().load(mResourceName)); + Nif::NIFFilePtr pnif (Nif::Cache::getInstance().load(mResourceName.substr(0, mResourceName.length()-7))); Nif::NIFFile & nif = *pnif.get (); if (nif.numRoots() < 1) { @@ -134,7 +134,7 @@ void ManualBulletShapeLoader::loadResource(Ogre::Resource *resource) // Have to load controlled nodes from the .kf // FIXME: the .kf has to be loaded both for rendering and physics, ideally it should be opened once and then reused mControlledNodes.clear(); - std::string kfname = mResourceName; + std::string kfname = mResourceName.substr(0, mResourceName.length()-7); Misc::StringUtils::toLower(kfname); if(kfname.size() > 4 && kfname.compare(kfname.size()-4, 4, ".nif") == 0) kfname.replace(kfname.size()-4, 4, ".kf"); diff --git a/libs/openengine/bullet/physic.cpp b/libs/openengine/bullet/physic.cpp index c0da03651..15be7665a 100644 --- a/libs/openengine/bullet/physic.cpp +++ b/libs/openengine/bullet/physic.cpp @@ -455,7 +455,8 @@ namespace Physic float scale, const Ogre::Vector3 &position, const Ogre::Quaternion &rotation, Ogre::Vector3* scaledBoxTranslation, Ogre::Quaternion* boxRotation, bool raycasting, bool placeable) { - std::string outputstring = mesh; + std::string sid = (boost::format("%07.3f") % scale).str(); + std::string outputstring = mesh + sid; //get the shape from the .nif mShapeLoader->load(outputstring,"General"); @@ -474,35 +475,20 @@ namespace Physic btCollisionShape* collisionShape = raycasting ? shape->mRaycastingShape : shape->mCollisionShape; -// TODO: check this from cmake? -//#if BT_BULLET_VERSION < 283 -//#error "Bullet version 2.83 or later required" -//#endif + // If this is an animated compound shape, we must duplicate it so we can animate + // multiple instances independently. + if (!raycasting && !shape->mAnimatedShapes.empty()) + collisionShape = duplicateCollisionShape(collisionShape); + if (raycasting && !shape->mAnimatedRaycastingShapes.empty()) + collisionShape = duplicateCollisionShape(collisionShape); - bool needDelete = false; - if (btBvhTriangleMeshShape* triangleShape = dynamic_cast(shape->mCollisionShape)) - { - btScaledBvhTriangleMeshShape* scaled = new btScaledBvhTriangleMeshShape(triangleShape, btVector3(scale,scale,scale)); - collisionShape = scaled; - needDelete = true; - } - else - { - // If this is an animated compound shape, we must duplicate it so we can animate - // multiple instances independently. - if (!raycasting && !shape->mAnimatedShapes.empty()) - collisionShape = duplicateCollisionShape(collisionShape); - if (raycasting && !shape->mAnimatedRaycastingShapes.empty()) - collisionShape = duplicateCollisionShape(collisionShape); - } + collisionShape->setLocalScaling( btVector3(scale,scale,scale)); //create the real body btRigidBody::btRigidBodyConstructionInfo CI = btRigidBody::btRigidBodyConstructionInfo (0,0, collisionShape); RigidBody* body = new RigidBody(CI,name); body->mPlaceable = placeable; - if (needDelete) - body->mCollisionShape.reset(collisionShape); if (!raycasting && !shape->mAnimatedShapes.empty()) { diff --git a/libs/openengine/bullet/physic.hpp b/libs/openengine/bullet/physic.hpp index 7b0906694..7784e8941 100644 --- a/libs/openengine/bullet/physic.hpp +++ b/libs/openengine/bullet/physic.hpp @@ -63,9 +63,6 @@ namespace Physic virtual ~RigidBody(); std::string mName; - // May be empty if the collision shape is a shared resource - std::auto_ptr mCollisionShape; - // Hack: placeable objects (that can be picked up by the player) have different collision behaviour. // This variable needs to be passed to BulletNifLoader. bool mPlaceable; From ca53457a1c572851491fe8d6e1238ee5bd608ae5 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 6 May 2015 01:46:34 +0200 Subject: [PATCH 20/57] Correct the map icons used for detect spells (Fixes #2519) --- apps/openmw/mwgui/mapwindow.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/apps/openmw/mwgui/mapwindow.cpp b/apps/openmw/mwgui/mapwindow.cpp index 02e8ffdfe..269b43a71 100644 --- a/apps/openmw/mwgui/mapwindow.cpp +++ b/apps/openmw/mwgui/mapwindow.cpp @@ -468,21 +468,17 @@ namespace MWGui return; std::string markerTexture; - MyGUI::Colour markerColour; if (type == MWBase::World::Detect_Creature) { - markerTexture = "textures\\menu_map_dcreature.dds"; - markerColour = MyGUI::Colour(1,0,0,1); + markerTexture = "textures\\detect_animal_icon.dds"; } if (type == MWBase::World::Detect_Key) { - markerTexture = "textures\\menu_map_dkey.dds"; - markerColour = MyGUI::Colour(0,1,0,1); + markerTexture = "textures\\detect_key_icon.dds"; } if (type == MWBase::World::Detect_Enchantment) { - markerTexture = "textures\\menu_map_dmagic.dds"; - markerColour = MyGUI::Colour(0,0,1,1); + markerTexture = "textures\\detect_enchantment_icon.dds"; } int counter = 0; @@ -499,7 +495,7 @@ namespace MWGui widgetCoord, MyGUI::Align::Default); markerWidget->setDepth(Local_MarkerAboveFogLayer); markerWidget->setImageTexture(markerTexture); - markerWidget->setColour(markerColour); + markerWidget->setImageCoord(MyGUI::IntCoord(0,0,8,8)); markerWidget->setNeedMouseFocus(false); mMagicMarkerWidgets.push_back(markerWidget); } From 033719ccd70db35d3d67d4d707bb2de3c4c184b4 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 6 May 2015 02:11:35 +0200 Subject: [PATCH 21/57] Correct the icon used for custom map markers --- apps/openmw/mwgui/mapwindow.cpp | 12 ++++++------ files/mygui/openmw_resources.xml | 9 +++++++++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/apps/openmw/mwgui/mapwindow.cpp b/apps/openmw/mwgui/mapwindow.cpp index 269b43a71..9adfeffe8 100644 --- a/apps/openmw/mwgui/mapwindow.cpp +++ b/apps/openmw/mwgui/mapwindow.cpp @@ -300,17 +300,17 @@ namespace MWGui MarkerUserData markerPos; MyGUI::IntPoint widgetPos = getMarkerPosition(marker.mWorldX, marker.mWorldY, markerPos); - MyGUI::IntCoord widgetCoord(widgetPos.left - 4, - widgetPos.top - 4, - 8, 8); - MarkerWidget* markerWidget = mLocalMap->createWidget("MarkerButton", + MyGUI::IntCoord widgetCoord(widgetPos.left - 8, + widgetPos.top - 8, + 16, 16); + MarkerWidget* markerWidget = mLocalMap->createWidget("CustomMarkerButton", widgetCoord, MyGUI::Align::Default); markerWidget->setDepth(Local_MarkerAboveFogLayer); markerWidget->setUserString("ToolTipType", "Layout"); markerWidget->setUserString("ToolTipLayout", "TextToolTipOneLine"); markerWidget->setUserString("Caption_TextOneLine", MyGUI::TextIterator::toTagsString(marker.mNote)); - markerWidget->setNormalColour(MyGUI::Colour(1.0f, 0.3f, 0.3f)); - markerWidget->setHoverColour(MyGUI::Colour(1.0f, 0.5f, 0.5f)); + markerWidget->setNormalColour(MyGUI::Colour(0.6f, 0.6f, 0.6f)); + markerWidget->setHoverColour(MyGUI::Colour(1.0f, 1.0f, 1.0f)); markerWidget->setUserData(marker); markerWidget->setNeedMouseFocus(true); customMarkerCreated(markerWidget); diff --git a/files/mygui/openmw_resources.xml b/files/mygui/openmw_resources.xml index 423281a62..305cb0c0d 100644 --- a/files/mygui/openmw_resources.xml +++ b/files/mygui/openmw_resources.xml @@ -31,6 +31,15 @@ + + + + + + + + + From b312f50b1f609355011fc89763df6aeeec0ab8cf Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 6 May 2015 02:12:55 +0200 Subject: [PATCH 22/57] Fix regression with detect spells detecting deleted objects (Fixes #2518) --- apps/openmw/mwworld/worldimp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 013386f8f..0f8110624 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -2956,7 +2956,7 @@ namespace MWWorld Ogre::Vector3(mDetector.getRefData().getPosition().pos)) >= mSquaredDist) return true; - if (!ptr.getRefData().isEnabled()) + if (!ptr.getRefData().isEnabled() || ptr.getRefData().isDeleted()) return true; // Consider references inside containers as well (except if we are looking for a Creature, they cannot be in containers) From eef8f717973d69f1242db16db4517156d37f1d77 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 7 May 2015 16:46:59 +0200 Subject: [PATCH 23/57] Add a comment --- apps/openmw/mwworld/cellstore.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/openmw/mwworld/cellstore.hpp b/apps/openmw/mwworld/cellstore.hpp index d7036d6b1..672b6046b 100644 --- a/apps/openmw/mwworld/cellstore.hpp +++ b/apps/openmw/mwworld/cellstore.hpp @@ -120,6 +120,7 @@ namespace MWWorld /// Call functor (ref) for each reference. functor must return a bool. Returning /// false will abort the iteration. + /// \attention This function also lists deleted (count 0) objects! /// \return Iteration completed? /// /// \note Creatures and NPCs are handled last. From 3b8b217888469c839c53ca4945deaeb88ac4d6bf Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 8 May 2015 02:22:39 +0200 Subject: [PATCH 24/57] Fix no punishment for stealing when taking an item with the inventory opened --- apps/openmw/mwgui/inventorywindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index 80b246e84..9aa8a8ea1 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -594,6 +594,8 @@ namespace MWGui MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr(); MWBase::Environment::get().getWorld()->breakInvisibility(player); + MWBase::Environment::get().getMechanicsManager()->itemTaken(player, object, MWWorld::Ptr(), count); + // add to player inventory // can't use ActionTake here because we need an MWWorld::Ptr to the newly inserted object MWWorld::Ptr newObject = *player.getClass().getContainerStore (player).add (object, object.getRefData().getCount(), player); @@ -612,8 +614,6 @@ namespace MWGui throw std::runtime_error("Added item not found"); mDragAndDrop->startDrag(i, mSortModel, mTradeModel, mItemView, count); - MWBase::Environment::get().getMechanicsManager()->itemTaken(player, newObject, MWWorld::Ptr(), count); - MWBase::Environment::get().getWindowManager()->updateSpellWindow(); } From ac88326909d80223815a84743578a0c2adcbb583 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 8 May 2015 23:57:23 +0200 Subject: [PATCH 25/57] Exit out of choice when no responses are found (Fixes #2525) --- apps/openmw/mwdialogue/dialoguemanagerimp.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/openmw/mwdialogue/dialoguemanagerimp.cpp b/apps/openmw/mwdialogue/dialoguemanagerimp.cpp index b928738dd..0b9fd65d2 100644 --- a/apps/openmw/mwdialogue/dialoguemanagerimp.cpp +++ b/apps/openmw/mwdialogue/dialoguemanagerimp.cpp @@ -485,6 +485,12 @@ namespace MWDialogue executeScript (info->mResultScript); } + else + { + mChoice = -1; + mIsInChoice = false; + MWBase::Environment::get().getWindowManager()->getDialogueWindow()->clearChoices(); + } } } From 9d86e5b02803550d7406a6cff53d6e12534d3a16 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 10 May 2015 13:04:50 +0200 Subject: [PATCH 26/57] GetSpellEffects returns true for active abilities (Fixes #2530) --- apps/openmw/mwmechanics/spells.cpp | 14 ++++++++++++++ apps/openmw/mwmechanics/spells.hpp | 3 +++ apps/openmw/mwscript/miscextensions.cpp | 3 ++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/spells.cpp b/apps/openmw/mwmechanics/spells.cpp index 04225b43e..b1829964b 100644 --- a/apps/openmw/mwmechanics/spells.cpp +++ b/apps/openmw/mwmechanics/spells.cpp @@ -143,6 +143,20 @@ namespace MWMechanics return mSelectedSpell; } + bool Spells::isSpellActive(const std::string &id) const + { + TContainer::const_iterator found = mSpells.find(id); + if (found != mSpells.end()) + { + const ESM::Spell *spell = + MWBase::Environment::get().getWorld()->getStore().get().find (id); + + return (spell->mData.mType==ESM::Spell::ST_Ability || spell->mData.mType==ESM::Spell::ST_Blight || + spell->mData.mType==ESM::Spell::ST_Disease || spell->mData.mType==ESM::Spell::ST_Curse); + } + return false; + } + bool Spells::hasCommonDisease() const { for (TIterator iter = mSpells.begin(); iter!=mSpells.end(); ++iter) diff --git a/apps/openmw/mwmechanics/spells.hpp b/apps/openmw/mwmechanics/spells.hpp index 064b2c1e5..6b4149939 100644 --- a/apps/openmw/mwmechanics/spells.hpp +++ b/apps/openmw/mwmechanics/spells.hpp @@ -98,6 +98,9 @@ namespace MWMechanics const std::string getSelectedSpell() const; ///< May return an empty string. + bool isSpellActive(const std::string& id) const; + ///< Are we under the effects of the given spell ID? + bool hasCommonDisease() const; bool hasBlightDisease() const; diff --git a/apps/openmw/mwscript/miscextensions.cpp b/apps/openmw/mwscript/miscextensions.cpp index 29f586a65..38106340a 100644 --- a/apps/openmw/mwscript/miscextensions.cpp +++ b/apps/openmw/mwscript/miscextensions.cpp @@ -595,7 +595,8 @@ namespace MWScript std::string id = runtime.getStringLiteral(runtime[0].mInteger); runtime.pop(); - runtime.push(ptr.getClass().getCreatureStats(ptr).getActiveSpells().isSpellActive(id)); + const MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats(ptr); + runtime.push(stats.getActiveSpells().isSpellActive(id) || stats.getSpells().isSpellActive(id)); } }; From c819180aa1299422f42f94b82cc58d48f6c76a6c Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 10 May 2015 13:09:22 +0200 Subject: [PATCH 27/57] Minor cleanup --- apps/openmw/mwgui/spellbuyingwindow.cpp | 8 +------- apps/openmw/mwscript/statsextensions.cpp | 10 ++-------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/apps/openmw/mwgui/spellbuyingwindow.cpp b/apps/openmw/mwgui/spellbuyingwindow.cpp index 57b02940e..76a1d51e5 100644 --- a/apps/openmw/mwgui/spellbuyingwindow.cpp +++ b/apps/openmw/mwgui/spellbuyingwindow.cpp @@ -127,13 +127,7 @@ namespace MWGui bool SpellBuyingWindow::playerHasSpell(const std::string &id) { MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr(); - MWMechanics::Spells& playerSpells = player.getClass().getCreatureStats (player).getSpells(); - for (MWMechanics::Spells::TIterator it = playerSpells.begin(); it != playerSpells.end(); ++it) - { - if (Misc::StringUtils::ciEqual(id, it->first)) - return true; - } - return false; + return player.getClass().getCreatureStats(player).getSpells().hasSpell(id); } void SpellBuyingWindow::onSpellButtonClick(MyGUI::Widget* _sender) diff --git a/apps/openmw/mwscript/statsextensions.cpp b/apps/openmw/mwscript/statsextensions.cpp index d825b085e..80f46e457 100644 --- a/apps/openmw/mwscript/statsextensions.cpp +++ b/apps/openmw/mwscript/statsextensions.cpp @@ -515,14 +515,8 @@ namespace MWScript Interpreter::Type_Integer value = 0; - for (MWMechanics::Spells::TIterator iter ( - ptr.getClass().getCreatureStats (ptr).getSpells().begin()); - iter!=ptr.getClass().getCreatureStats (ptr).getSpells().end(); ++iter) - if (iter->first==id) - { - value = 1; - break; - } + if (ptr.getClass().getCreatureStats(ptr).getSpells().hasSpell(id)) + value = 1; runtime.push (value); } From 97c35da441f1de47aeb523cb3f1594b6195caf91 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 10 May 2015 15:34:07 +0200 Subject: [PATCH 28/57] Change exterior water level to z=-1 (Fixes #1405) --- apps/openmw/mwworld/scene.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index 8d689240b..f5a9b8960 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -256,12 +256,13 @@ namespace MWWorld insertCell (*cell, true, loadingListener); mRendering.cellAdded (cell); - bool waterEnabled = cell->getCell()->hasWater(); + bool waterEnabled = cell->getCell()->hasWater() || cell->isExterior(); mRendering.setWaterEnabled(waterEnabled); + float waterLevel = cell->isExterior() ? -1.f : cell->getWaterLevel(); if (waterEnabled) { - mPhysics->enableWater(cell->getWaterLevel()); - mRendering.setWaterHeight(cell->getWaterLevel()); + mPhysics->enableWater(waterLevel); + mRendering.setWaterHeight(waterLevel); } else mPhysics->disableWater(); From 58a2ad663cee7de5e9f419af80485c97ca890c63 Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 11 May 2015 16:24:52 +0200 Subject: [PATCH 29/57] Fix regression of sleep interruption chance --- apps/openmw/mwgui/waitdialog.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/waitdialog.cpp b/apps/openmw/mwgui/waitdialog.cpp index f74b06891..94905dd9e 100644 --- a/apps/openmw/mwgui/waitdialog.cpp +++ b/apps/openmw/mwgui/waitdialog.cpp @@ -155,8 +155,9 @@ namespace MWGui if (!region->mSleepList.empty()) { // figure out if player will be woken while sleeping + int x = OEngine::Misc::Rng::rollDice(hoursToWait); float fSleepRandMod = world->getStore().get().find("fSleepRandMod")->getFloat(); - if (OEngine::Misc::Rng::rollProbability() > fSleepRandMod) + if (x > fSleepRandMod * hoursToWait) { float fSleepRestMod = world->getStore().get().find("fSleepRestMod")->getFloat(); mInterruptAt = hoursToWait - int(fSleepRestMod * hoursToWait); From 5abeab21edb1854955bb0865b3cf6d22b2d48a38 Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 11 May 2015 16:55:09 +0200 Subject: [PATCH 30/57] Various integer/floating point roll adjustments based on wiki --- apps/openmw/mwclass/creature.cpp | 2 +- apps/openmw/mwclass/npc.cpp | 2 +- apps/openmw/mwgui/pickpocketitemmodel.cpp | 2 +- apps/openmw/mwmechanics/combat.cpp | 2 +- apps/openmw/mwmechanics/mechanicsmanagerimp.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwclass/creature.cpp b/apps/openmw/mwclass/creature.cpp index 8404b9523..192bdf2ce 100644 --- a/apps/openmw/mwclass/creature.cpp +++ b/apps/openmw/mwclass/creature.cpp @@ -251,7 +251,7 @@ namespace MWClass float hitchance = MWMechanics::getHitChance(ptr, victim, ref->mBase->mData.mCombat); - if(OEngine::Misc::Rng::rollProbability() >= hitchance/100.0f) + if(OEngine::Misc::Rng::roll0to99() >= hitchance) { victim.getClass().onHit(victim, 0.0f, false, MWWorld::Ptr(), ptr, false); MWMechanics::reduceWeaponCondition(0.f, false, weapon, ptr); diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index 1d58dc87e..3ca57aca8 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -515,7 +515,7 @@ namespace MWClass float hitchance = MWMechanics::getHitChance(ptr, victim, ptr.getClass().getSkill(ptr, weapskill)); - if (OEngine::Misc::Rng::rollProbability() >= hitchance / 100.0f) + if (OEngine::Misc::Rng::roll0to99() >= hitchance) { othercls.onHit(victim, 0.0f, false, weapon, ptr, false); MWMechanics::reduceWeaponCondition(0.f, false, weapon, ptr); diff --git a/apps/openmw/mwgui/pickpocketitemmodel.cpp b/apps/openmw/mwgui/pickpocketitemmodel.cpp index bc7c5528e..b8ac20f99 100644 --- a/apps/openmw/mwgui/pickpocketitemmodel.cpp +++ b/apps/openmw/mwgui/pickpocketitemmodel.cpp @@ -20,7 +20,7 @@ namespace MWGui { for (size_t i = 0; igetItemCount(); ++i) { - if (chance <= OEngine::Misc::Rng::roll0to99()) + if (OEngine::Misc::Rng::roll0to99() > chance) mHiddenItems.push_back(mSourceModel->getItem(i)); } } diff --git a/apps/openmw/mwmechanics/combat.cpp b/apps/openmw/mwmechanics/combat.cpp index c5fc34507..045f0108c 100644 --- a/apps/openmw/mwmechanics/combat.cpp +++ b/apps/openmw/mwmechanics/combat.cpp @@ -187,7 +187,7 @@ namespace MWMechanics int skillValue = attacker.getClass().getSkill(attacker, weapon.getClass().getEquipmentSkill(weapon)); - if (OEngine::Misc::Rng::rollProbability() >= getHitChance(attacker, victim, skillValue) / 100.0f) + if (OEngine::Misc::Rng::roll0to99() >= getHitChance(attacker, victim, skillValue)) { victim.getClass().onHit(victim, 0.0f, false, projectile, attacker, false); MWMechanics::reduceWeaponCondition(0.f, false, weapon, attacker); diff --git a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp index da8d49db0..c829154e2 100644 --- a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp +++ b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp @@ -737,7 +737,7 @@ namespace MWMechanics float x = 0; float y = 0; - float roll = OEngine::Misc::Rng::rollClosedProbability() * 100; + int roll = OEngine::Misc::Rng::roll0to99(); if (type == PT_Admire) { From 538e550b2b2b9f0d71a7adca8d4e89912b3a1d70 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Wed, 13 May 2015 10:30:44 +1000 Subject: [PATCH 31/57] Fix for Bug #2543. Spells magic effect id typo. --- apps/opencs/model/world/nestedcoladapterimp.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/opencs/model/world/nestedcoladapterimp.hpp b/apps/opencs/model/world/nestedcoladapterimp.hpp index ea2037eb8..776a908ba 100644 --- a/apps/opencs/model/world/nestedcoladapterimp.hpp +++ b/apps/opencs/model/world/nestedcoladapterimp.hpp @@ -311,7 +311,7 @@ namespace CSMWorld case 0: { if (effect.mEffectID >=0 && effect.mEffectID < ESM::MagicEffect::Length) - return effect.mRange; + return effect.mEffectID; else throw std::runtime_error("Magic effects ID unexpected value"); } From 7f12fc47706076545505c9c0f80c7b6ed3cad531 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Wed, 13 May 2015 13:39:04 +1000 Subject: [PATCH 32/57] Fix for Bug #2544. Add a default mNpdtType to ESM::Npc::blank(). --- components/esm/loadnpc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esm/loadnpc.cpp b/components/esm/loadnpc.cpp index 751c7f252..44d298785 100644 --- a/components/esm/loadnpc.cpp +++ b/components/esm/loadnpc.cpp @@ -143,7 +143,7 @@ namespace ESM void NPC::blank() { - mNpdtType = 0; + mNpdtType = NPC_DEFAULT; mNpdt52.mLevel = 0; mNpdt52.mStrength = mNpdt52.mIntelligence = mNpdt52.mWillpower = mNpdt52.mAgility = mNpdt52.mSpeed = mNpdt52.mEndurance = mNpdt52.mPersonality = mNpdt52.mLuck = 0; From 5cf50227b4e0a1318606df0c5e56c7f41a5dd9fd Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Wed, 13 May 2015 19:53:50 +0200 Subject: [PATCH 33/57] updated changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15464b1d7..3219edd9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ Bug #923: Editor: Operations-Multithreading is broken Bug #1317: Erene Llenim in Seyda Neen does not walk around + Bug #1405: Water rendering glitch near Seyda Neen lighthouse Bug #1621: "Error Detecting Morrowind Installation" in the default directory Bug #2216: Creating a clone of the player stops you moving. Bug #2387: Casting bound weapon spell doesn't switch to "ready weapon" mode @@ -23,6 +24,10 @@ Bug #2475: cumulative stacks of 100 point fortify skill speechcraft boosts do not apply correctly Bug #2498: Editor: crash when issuing undo command after the table subview is closed Bug #2500: Editor: object table - can't undo delete record + Bug #2518: OpenMW detect spell returns false positives + Bug #2521: NPCs don't react to stealing when inventory menu is open. + Bug #2525: Can't click on red dialogue choice [rise of house telvanni][60fffec] + Bug #2530: GetSpellEffects not working as in vanilla Feature #139: Editor: Global Search & Replace Feature #1219: Editor: Add dialogue mode only columns Feature #2024: Hotkey for hand to hand (i.e. unequip any weapon) @@ -34,6 +39,7 @@ Feature #2505: Editor: optionally show a line number column in the script editor Feature #2512: Editor: Offer use of monospace fonts in the script editor as an option Feature #2514: Editor: focus on ID input field on clone/add + Feature #2519: it is not possible to change icons that appear on the map after casting the Detect spells Task #2460: OS X: Use Application Support directory as user data path Task #2516: Editor: Change References / Referenceables terminology From c9d519f36c62611a768936018fe185a011a4d6a0 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 14 May 2015 14:48:29 +0200 Subject: [PATCH 34/57] focus search input field when opening search subview (Fixes #2534) --- apps/opencs/view/tools/searchbox.cpp | 7 +++++++ apps/opencs/view/tools/searchbox.hpp | 2 ++ apps/opencs/view/tools/searchsubview.cpp | 8 +++++++- apps/opencs/view/tools/searchsubview.hpp | 4 ++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/apps/opencs/view/tools/searchbox.cpp b/apps/opencs/view/tools/searchbox.cpp index ca5520787..1307c1aab 100644 --- a/apps/opencs/view/tools/searchbox.cpp +++ b/apps/opencs/view/tools/searchbox.cpp @@ -153,6 +153,11 @@ void CSVTools::SearchBox::setEditLock (bool locked) mReplace.setEnabled (!locked); } +void CSVTools::SearchBox::focus() +{ + mInput.currentWidget()->setFocus(); +} + void CSVTools::SearchBox::modeSelected (int index) { switch (index) @@ -172,6 +177,8 @@ void CSVTools::SearchBox::modeSelected (int index) break; } + mInput.currentWidget()->setFocus(); + updateSearchButton(); } diff --git a/apps/opencs/view/tools/searchbox.hpp b/apps/opencs/view/tools/searchbox.hpp index 433c09693..fe56966d1 100644 --- a/apps/opencs/view/tools/searchbox.hpp +++ b/apps/opencs/view/tools/searchbox.hpp @@ -49,6 +49,8 @@ namespace CSVTools void setEditLock (bool locked); + void focus(); + private slots: void modeSelected (int index); diff --git a/apps/opencs/view/tools/searchsubview.cpp b/apps/opencs/view/tools/searchsubview.cpp index 32c26ee96..dc670af40 100644 --- a/apps/opencs/view/tools/searchsubview.cpp +++ b/apps/opencs/view/tools/searchsubview.cpp @@ -60,6 +60,12 @@ void CSVTools::SearchSubView::replace (bool selection) } } +void CSVTools::SearchSubView::showEvent (QShowEvent *event) +{ + CSVDoc::SubView::showEvent (event); + mSearchBox.focus(); +} + CSVTools::SearchSubView::SearchSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document) : CSVDoc::SubView (id), mDocument (document), mLocked (false) { @@ -83,7 +89,7 @@ CSVTools::SearchSubView::SearchSubView (const CSMWorld::UniversalId& id, CSMDoc: SIGNAL (focusId (const CSMWorld::UniversalId&, const std::string&))); connect (mTable, SIGNAL (replaceRequest()), this, SLOT (replaceRequest())); - + connect (&document, SIGNAL (stateChanged (int, CSMDoc::Document *)), this, SLOT (stateChanged (int, CSMDoc::Document *))); diff --git a/apps/opencs/view/tools/searchsubview.hpp b/apps/opencs/view/tools/searchsubview.hpp index 6dedd6ef2..2e96b98b5 100644 --- a/apps/opencs/view/tools/searchsubview.hpp +++ b/apps/opencs/view/tools/searchsubview.hpp @@ -32,6 +32,10 @@ namespace CSVTools private: void replace (bool selection); + + protected: + + void showEvent (QShowEvent *event); public: From f92d801fafa64ea3cabd78886a3d6dae2760b5af Mon Sep 17 00:00:00 2001 From: cc9cii Date: Fri, 15 May 2015 12:32:29 +1000 Subject: [PATCH 35/57] Jump to the added/cloned record (or undeleted record in case of undo). Should resolve Feature #2541. Controlled by radio buttons on user preferences settings. --- apps/opencs/model/settings/usersettings.cpp | 8 +++ apps/opencs/view/world/table.cpp | 54 +++++++++++++++++++-- apps/opencs/view/world/table.hpp | 4 ++ 3 files changed, 63 insertions(+), 3 deletions(-) diff --git a/apps/opencs/model/settings/usersettings.cpp b/apps/opencs/model/settings/usersettings.cpp index 9e00b7d1a..41ce593b7 100644 --- a/apps/opencs/model/settings/usersettings.cpp +++ b/apps/opencs/model/settings/usersettings.cpp @@ -206,6 +206,14 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() shiftCtrlDoubleClick->setDeclaredValues (values); shiftCtrlDoubleClick->setDefaultValue (editRecordAndClose); shiftCtrlDoubleClick->setToolTip ("Action on shift control double click in table:

" + toolTip); + + QString defaultValue = "Jump and Select"; + QStringList jumpValues = QStringList() << defaultValue << "Jump Only" << "No Jump"; + + Setting *jumpToAdded = createSetting (Type_RadioButton, "jump-to-added", + "Jump to the added or cloned record."); + jumpToAdded->setDefaultValue (defaultValue); + jumpToAdded->setDeclaredValues (jumpValues); } declareSection ("search", "Search & Replace"); diff --git a/apps/opencs/view/world/table.cpp b/apps/opencs/view/world/table.cpp index 5a650f98a..44150bbc6 100644 --- a/apps/opencs/view/world/table.cpp +++ b/apps/opencs/view/world/table.cpp @@ -21,6 +21,7 @@ #include "../../model/world/tablemimedata.hpp" #include "../../model/world/tablemimedata.hpp" #include "../../model/world/commanddispatcher.hpp" +#include "../../model/settings/usersettings.hpp" #include "recordstatusdelegate.hpp" #include "util.hpp" @@ -255,6 +256,24 @@ CSVWorld::Table::Table (const CSMWorld::UniversalId& id, : mCreateAction (0), mCloneAction(0), mRecordStatusDisplay (0), DragRecordTable(document) { + CSMSettings::UserSettings &settings = CSMSettings::UserSettings::instance(); + QString jumpSetting = settings.settingValue ("table-input/jump-to-added"); + if (jumpSetting.isEmpty() || jumpSetting == "Jump and Select") // default + { + mJumpToAddedRecord = true; + mUnselectAfterJump = false; + } + else if(jumpSetting == "Jump Only") + { + mJumpToAddedRecord = true; + mUnselectAfterJump = true; + } + else + { + mJumpToAddedRecord = false; + mUnselectAfterJump = false; + } + mModel = &dynamic_cast (*mDocument.getData().getTableModel (id)); mProxyModel = new CSMWorld::IdTableProxyModel (this); @@ -346,7 +365,7 @@ CSVWorld::Table::Table (const CSMWorld::UniversalId& id, addAction (mExtendedRevertAction); connect (mProxyModel, SIGNAL (rowsInserted (const QModelIndex&, int, int)), - this, SLOT (tableSizeUpdate())); + this, SLOT (rowsInsertedEvent(const QModelIndex&, int, int))); /// \note This signal could instead be connected to a slot that filters out changes not affecting /// the records status column (for permanence reasons) @@ -517,9 +536,27 @@ void CSVWorld::Table::previewRecord() } } -void CSVWorld::Table::updateUserSetting - (const QString &name, const QStringList &list) +void CSVWorld::Table::updateUserSetting (const QString &name, const QStringList &list) { + if (name=="table-input/jump-to-added") + { + if(list.isEmpty() || list.at(0) == "Jump and Select") // default + { + mJumpToAddedRecord = true; + mUnselectAfterJump = false; + } + else if(list.at(0) == "Jump Only") + { + mJumpToAddedRecord = true; + mUnselectAfterJump = true; + } + else // No Jump + { + mJumpToAddedRecord = false; + mUnselectAfterJump = false; + } + } + if (name=="records/type-format" || name=="records/status-format") { int columns = mModel->columnCount(); @@ -700,3 +737,14 @@ std::vector< CSMWorld::UniversalId > CSVWorld::Table::getDraggedRecords() const return idToDrag; } +void CSVWorld::Table::rowsInsertedEvent(const QModelIndex& parent, int start, int end) +{ + tableSizeUpdate(); + if(mJumpToAddedRecord) + { + selectRow(end); + + if(mUnselectAfterJump) + clearSelection(); + } +} diff --git a/apps/opencs/view/world/table.hpp b/apps/opencs/view/world/table.hpp index 75161b8b6..becb21f65 100644 --- a/apps/opencs/view/world/table.hpp +++ b/apps/opencs/view/world/table.hpp @@ -67,6 +67,8 @@ namespace CSVWorld CSMWorld::CommandDispatcher *mDispatcher; CSMWorld::UniversalId mEditCellId; std::map mDoubleClickActions; + bool mJumpToAddedRecord; + bool mUnselectAfterJump; private: @@ -139,6 +141,8 @@ namespace CSVWorld void recordFilterChanged (boost::shared_ptr filter); void updateUserSetting (const QString &name, const QStringList &list); + + void rowsInsertedEvent(const QModelIndex& parent, int start, int end); }; } From 28617c8beb8cf3353033b2d946d6f2bd93c3a561 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Fri, 15 May 2015 12:33:31 +1000 Subject: [PATCH 36/57] Update table size status for removed rows. --- apps/opencs/view/world/table.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/opencs/view/world/table.cpp b/apps/opencs/view/world/table.cpp index 44150bbc6..86daf8af7 100644 --- a/apps/opencs/view/world/table.cpp +++ b/apps/opencs/view/world/table.cpp @@ -364,6 +364,9 @@ CSVWorld::Table::Table (const CSMWorld::UniversalId& id, connect (mExtendedRevertAction, SIGNAL (triggered()), mDispatcher, SLOT (executeExtendedRevert())); addAction (mExtendedRevertAction); + connect (mProxyModel, SIGNAL (rowsRemoved (const QModelIndex&, int, int)), + this, SLOT (tableSizeUpdate())); + connect (mProxyModel, SIGNAL (rowsInserted (const QModelIndex&, int, int)), this, SLOT (rowsInsertedEvent(const QModelIndex&, int, int))); From 27000fb36b8a2ffdfb4d57087b5751cb1e7526b0 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Fri, 15 May 2015 14:09:35 +0200 Subject: [PATCH 37/57] don't reject single precision float values in value filters (Fixes #2533) --- apps/opencs/model/filter/valuenode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/opencs/model/filter/valuenode.cpp b/apps/opencs/model/filter/valuenode.cpp index 72cf5896b..6fdae3e1b 100644 --- a/apps/opencs/model/filter/valuenode.cpp +++ b/apps/opencs/model/filter/valuenode.cpp @@ -27,7 +27,7 @@ bool CSMFilter::ValueNode::test (const CSMWorld::IdTableBase& table, int row, QVariant data = table.data (index); if (data.type()!=QVariant::Double && data.type()!=QVariant::Bool && data.type()!=QVariant::Int && - data.type()!=QVariant::UInt) + data.type()!=QVariant::UInt && data.type()!=static_cast (QMetaType::Float)) return false; double value = data.toDouble(); From 60a835c16d0ae58e1fed8fe933dad752c4e03a5d Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sat, 16 May 2015 10:18:11 +0200 Subject: [PATCH 38/57] stop script editor from eating undo/redo shortcuts (Fixes #2506) --- apps/opencs/view/world/scriptedit.cpp | 13 +++++++++++++ apps/opencs/view/world/scriptedit.hpp | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/apps/opencs/view/world/scriptedit.cpp b/apps/opencs/view/world/scriptedit.cpp index b4f4234f1..2e05fa110 100644 --- a/apps/opencs/view/world/scriptedit.cpp +++ b/apps/opencs/view/world/scriptedit.cpp @@ -25,6 +25,19 @@ CSVWorld::ScriptEdit::ChangeLock::~ChangeLock() --mEdit.mChangeLocked; } +bool CSVWorld::ScriptEdit::event (QEvent *event) +{ + // ignore undo and redo shortcuts + if (event->type()==QEvent::ShortcutOverride) + { + QKeyEvent *keyEvent = static_cast (event); + + if (keyEvent->matches (QKeySequence::Undo) || keyEvent->matches (QKeySequence::Redo)) + return true; + } + + return QPlainTextEdit::event (event); +} CSVWorld::ScriptEdit::ScriptEdit (const CSMDoc::Document& document, ScriptHighlighter::Mode mode, QWidget* parent) diff --git a/apps/opencs/view/world/scriptedit.hpp b/apps/opencs/view/world/scriptedit.hpp index a19cee486..fb577e60e 100644 --- a/apps/opencs/view/world/scriptedit.hpp +++ b/apps/opencs/view/world/scriptedit.hpp @@ -53,6 +53,10 @@ namespace CSVWorld QFont mDefaultFont; QFont mMonoFont; + protected: + + bool event (QEvent *event); + public: ScriptEdit (const CSMDoc::Document& document, ScriptHighlighter::Mode mode, From 7d321e0fb7faba64cbb5f11dea2ea8dbf70bdb27 Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Sat, 16 May 2015 13:18:04 +0300 Subject: [PATCH 39/57] Fix #2557 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don’t show main dialog right away if wizard is selected. --- apps/launcher/main.cpp | 6 ++++-- apps/launcher/maindialog.cpp | 10 +++++----- apps/launcher/maindialog.hpp | 8 +++++++- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/apps/launcher/main.cpp b/apps/launcher/main.cpp index 11ea56869..ba0686110 100644 --- a/apps/launcher/main.cpp +++ b/apps/launcher/main.cpp @@ -59,14 +59,16 @@ int main(int argc, char *argv[]) Launcher::MainDialog mainWin; - if (!mainWin.showFirstRunDialog()) + Launcher::FirstRunDialogResult result = mainWin.showFirstRunDialog(); + if (result == Launcher::FirstRunDialogResultFailure) return 0; // if (!mainWin.setup()) { // return 0; // } - mainWin.show(); + if (result == Launcher::FirstRunDialogResultContinue) + mainWin.show(); int returnValue = app.exec(); SDL_Quit(); diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index 00e6a9aa2..fd36993bf 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -148,10 +148,10 @@ void Launcher::MainDialog::createPages() } -bool Launcher::MainDialog::showFirstRunDialog() +Launcher::FirstRunDialogResult Launcher::MainDialog::showFirstRunDialog() { if (!setupLauncherSettings()) - return false; + return FirstRunDialogResultFailure; if (mLauncherSettings.value(QString("General/firstrun"), QString("true")) == QLatin1String("true")) { @@ -176,14 +176,14 @@ bool Launcher::MainDialog::showFirstRunDialog() if (msgBox.clickedButton() == wizardButton) { if (!mWizardInvoker->startProcess(QLatin1String("openmw-wizard"), false)) { - return false; + return FirstRunDialogResultFailure; } else { - return true; + return FirstRunDialogResultWizard; } } } - return setup(); + return setup() ? FirstRunDialogResultContinue : FirstRunDialogResultFailure; } bool Launcher::MainDialog::setup() diff --git a/apps/launcher/maindialog.hpp b/apps/launcher/maindialog.hpp index 0708f7002..4c21dbaf4 100644 --- a/apps/launcher/maindialog.hpp +++ b/apps/launcher/maindialog.hpp @@ -31,6 +31,12 @@ namespace Launcher class UnshieldThread; class SettingsPage; + typedef enum { + FirstRunDialogResultFailure, + FirstRunDialogResultContinue, + FirstRunDialogResultWizard + } FirstRunDialogResult; + #ifndef WIN32 bool expansions(Launcher::UnshieldThread& cd); #endif @@ -44,7 +50,7 @@ namespace Launcher ~MainDialog(); bool setup(); - bool showFirstRunDialog(); + FirstRunDialogResult showFirstRunDialog(); bool reloadSettings(); bool writeSettings(); From 1b41f6c4c54bbb8f46393bb8f57fcdf00ef820f5 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 16 May 2015 12:29:26 +0200 Subject: [PATCH 40/57] Sleep interruption fix --- apps/openmw/mwgui/waitdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/waitdialog.cpp b/apps/openmw/mwgui/waitdialog.cpp index 94905dd9e..28e3be591 100644 --- a/apps/openmw/mwgui/waitdialog.cpp +++ b/apps/openmw/mwgui/waitdialog.cpp @@ -157,7 +157,7 @@ namespace MWGui // figure out if player will be woken while sleeping int x = OEngine::Misc::Rng::rollDice(hoursToWait); float fSleepRandMod = world->getStore().get().find("fSleepRandMod")->getFloat(); - if (x > fSleepRandMod * hoursToWait) + if (x < fSleepRandMod * hoursToWait) { float fSleepRestMod = world->getStore().get().find("fSleepRestMod")->getFloat(); mInterruptAt = hoursToWait - int(fSleepRestMod * hoursToWait); From 34f106749a3b302f00f9c0172e1a5911dca4c6df Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sun, 17 May 2015 10:38:15 +0200 Subject: [PATCH 41/57] removed a redundant typedef --- apps/launcher/maindialog.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/launcher/maindialog.hpp b/apps/launcher/maindialog.hpp index 4c21dbaf4..c90309990 100644 --- a/apps/launcher/maindialog.hpp +++ b/apps/launcher/maindialog.hpp @@ -31,11 +31,12 @@ namespace Launcher class UnshieldThread; class SettingsPage; - typedef enum { + enum FirstRunDialogResult + { FirstRunDialogResultFailure, FirstRunDialogResultContinue, FirstRunDialogResultWizard - } FirstRunDialogResult; + }; #ifndef WIN32 bool expansions(Launcher::UnshieldThread& cd); From b9856162b33ff4f0d1a1d46d68b64373496b29ba Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sun, 17 May 2015 10:38:54 +0200 Subject: [PATCH 42/57] updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3219edd9a..466c2ef25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ Bug #2521: NPCs don't react to stealing when inventory menu is open. Bug #2525: Can't click on red dialogue choice [rise of house telvanni][60fffec] Bug #2530: GetSpellEffects not working as in vanilla + Bug #2557: Crash on first launch after choosing "Run installation wizard" Feature #139: Editor: Global Search & Replace Feature #1219: Editor: Add dialogue mode only columns Feature #2024: Hotkey for hand to hand (i.e. unequip any weapon) From e9ca02216201fdb64e1dcd59a6a385d8a4c067d5 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Sun, 17 May 2015 20:45:13 +1000 Subject: [PATCH 43/57] Add an optional horizontal scrollbar to the main view window. Should resolve Feature #2549. - TableSubviews and DialogueSubviews now provide size hints - Option to stop the growth of the window at the screen boundary for multi-monitor setup with different resolution. - Three options: Grow Only: No change to current, except the use of size hints Scrollbar Only: Simple addition of a scrollbar, the view window does not grow Grow then Scroll: Window grows as per current behaviour. The scrollbar appears once it cannot grow any further. --- apps/opencs/model/settings/usersettings.cpp | 14 ++ apps/opencs/view/doc/subview.cpp | 16 +++ apps/opencs/view/doc/subview.hpp | 13 ++ apps/opencs/view/doc/view.cpp | 145 +++++++++++++++++++- apps/opencs/view/doc/view.hpp | 5 + apps/opencs/view/world/dialoguesubview.cpp | 12 +- apps/opencs/view/world/tablesubview.cpp | 12 +- 7 files changed, 213 insertions(+), 4 deletions(-) diff --git a/apps/opencs/model/settings/usersettings.cpp b/apps/opencs/model/settings/usersettings.cpp index 41ce593b7..bd31b6e38 100644 --- a/apps/opencs/model/settings/usersettings.cpp +++ b/apps/opencs/model/settings/usersettings.cpp @@ -143,6 +143,20 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() minWidth->setDefaultValue (325); minWidth->setRange (50, 10000); minWidth->setToolTip ("Minimum width of subviews."); + + QString defaultScroll = "Scrollbar Only"; + QStringList scrollValues = QStringList() << defaultScroll << "Grow Only" << "Grow then Scroll"; + + Setting *mainwinScroll = createSetting (Type_RadioButton, "mainwindow-scrollbar", + "Add a horizontal scrollbar to the main view window."); + mainwinScroll->setDefaultValue (defaultScroll); + mainwinScroll->setDeclaredValues (scrollValues); + + Setting *grow = createSetting (Type_CheckBox, "grow-limit", "Grow Limit Screen"); + grow->setDefaultValue ("false"); + grow->setToolTip ("When \"Grow then Scroll\" option is selected, the window size grows to" + " the width of the virtual desktop. \nIf this option is selected the the window growth" + "is limited to the current screen."); } declareSection ("records", "Records"); diff --git a/apps/opencs/view/doc/subview.cpp b/apps/opencs/view/doc/subview.cpp index df1e7ee49..09128d919 100644 --- a/apps/opencs/view/doc/subview.cpp +++ b/apps/opencs/view/doc/subview.cpp @@ -43,3 +43,19 @@ void CSVDoc::SubView::closeRequest() { emit closeRequest (this); } + +CSVDoc::SizeHintWidget::SizeHintWidget(QWidget *parent) : QWidget(parent) +{} + +CSVDoc::SizeHintWidget::~SizeHintWidget() +{} + +QSize CSVDoc::SizeHintWidget::sizeHint() const +{ + return mSize; +} + +void CSVDoc::SizeHintWidget::setSizeHint(const QSize &size) +{ + mSize = size; +} diff --git a/apps/opencs/view/doc/subview.hpp b/apps/opencs/view/doc/subview.hpp index a8aa3cda1..f327107c2 100644 --- a/apps/opencs/view/doc/subview.hpp +++ b/apps/opencs/view/doc/subview.hpp @@ -8,6 +8,7 @@ #include "subviewfactory.hpp" #include +#include class QUndoStack; @@ -70,6 +71,18 @@ namespace CSVDoc void closeRequest(); }; + + class SizeHintWidget : public QWidget + { + QSize mSize; + + public: + SizeHintWidget(QWidget *parent = 0); + ~SizeHintWidget(); + + virtual QSize sizeHint() const; + void setSizeHint(const QSize &size); + }; } #endif diff --git a/apps/opencs/view/doc/view.cpp b/apps/opencs/view/doc/view.cpp index 5636fff94..16b96ed4d 100644 --- a/apps/opencs/view/doc/view.cpp +++ b/apps/opencs/view/doc/view.cpp @@ -9,6 +9,10 @@ #include #include #include +#include +#include +#include +#include #include "../../model/doc/document.hpp" #include "../../model/settings/usersettings.hpp" @@ -16,6 +20,7 @@ #include "../../model/world/idtable.hpp" #include "../world/subviews.hpp" +#include "../world/tablesubview.hpp" #include "../tools/subviews.hpp" @@ -334,8 +339,15 @@ void CSVDoc::View::updateTitle() void CSVDoc::View::updateSubViewIndicies(SubView *view) { if(view && mSubViews.contains(view)) + { mSubViews.removeOne(view); + // adjust (reduce) the scroll area (even floating), except when it is "Scrollbar Only" + CSMSettings::UserSettings &settings = CSMSettings::UserSettings::instance(); + if(settings.settingValue ("window/mainwindow-scrollbar") == "Grow then Scroll") + updateScrollbar(); + } + CSMSettings::UserSettings &userSettings = CSMSettings::UserSettings::instance(); bool hideTitle = userSettings.setting ("window/hide-subview", QString ("false"))=="true" && @@ -381,7 +393,7 @@ void CSVDoc::View::updateActions() CSVDoc::View::View (ViewManager& viewManager, CSMDoc::Document *document, int totalViews) : mViewManager (viewManager), mDocument (document), mViewIndex (totalViews-1), - mViewTotal (totalViews) + mViewTotal (totalViews), mScroll(0), mScrollbarOnly(false) { int width = CSMSettings::UserSettings::instance().settingValue ("window/default-width").toInt(); @@ -400,7 +412,18 @@ CSVDoc::View::View (ViewManager& viewManager, CSMDoc::Document *document, int to mSubViewWindow.setDockOptions (QMainWindow::AllowNestedDocks); - setCentralWidget (&mSubViewWindow); + CSMSettings::UserSettings &settings = CSMSettings::UserSettings::instance(); + if(settings.settingValue ("window/mainwindow-scrollbar") == "Grow Only") + { + setCentralWidget (&mSubViewWindow); + } + else + { + mScroll = new QScrollArea(this); + mScroll->setWidgetResizable(true); + mScroll->setWidget(&mSubViewWindow); + setCentralWidget(mScroll); + } mOperations = new Operations; addDockWidget (Qt::BottomDockWidgetArea, mOperations); @@ -527,6 +550,59 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin view->setStatusBar (mShowStatusBar->isChecked()); + // Work out how to deal with additional subviews + // + // Policy for "Grow then Scroll": + // + // - Increase the horizontal width of the mainwindow until it becomes greater than or equal + // to the screen (monitor) width. + // - Move the mainwindow position sideways if necessary to fit within the screen. + // - Any more additions increases the size of the mSubViewWindow (horizontal scrollbar + // should become visible) + // - Move the scroll bar to the newly added subview + // + CSMSettings::UserSettings &settings = CSMSettings::UserSettings::instance(); + QString mainwinScroll = settings.settingValue ("window/mainwindow-scrollbar"); + if (mainwinScroll.isEmpty() || mainwinScroll == "Scrollbar Only") + mScrollbarOnly = true; + else if(mainwinScroll == "Grow Only") + mScrollbarOnly = false; + else + mScrollbarOnly = false; + + QDesktopWidget *dw = QApplication::desktop(); + QRect rect; + if(settings.settingValue ("window/grow-limit") == "true") + rect = dw->screenGeometry(this); + else + rect = dw->screenGeometry(dw->screen(dw->screenNumber(this))); + + if (!mScrollbarOnly && mScroll && mSubViews.size() > 1) + { + int newWidth = width()+minWidth; + int frameWidth = frameGeometry().width() - width(); + if (newWidth+frameWidth <= rect.width()) + { + resize(newWidth, height()); + // WARNING: below code assumes that new subviews are added to the right + if (x() > rect.width()-(newWidth+frameWidth)) + move(rect.width()-(newWidth+frameWidth), y()); // shift left to stay within the screen + } + else + { + // full width + resize(rect.width()-frameWidth, height()); + mSubViewWindow.setMinimumWidth(mSubViewWindow.width()+minWidth); + move(0, y()); + } + + // Make the new subview visible, setFocus() or raise() don't seem to work + // On Ubuntu the scrollbar does not go right to the end, even if using + // mScroll->horizontalScrollBar()->setValue(mScroll->horizontalScrollBar()->maximum()); + if (mSubViewWindow.width() > rect.width()) + mScroll->horizontalScrollBar()->setValue(mSubViewWindow.width()); + } + mSubViewWindow.addDockWidget (Qt::TopDockWidgetArea, view); updateSubViewIndicies(); @@ -774,6 +850,48 @@ void CSVDoc::View::updateUserSetting (const QString &name, const QStringList &li { subView->updateUserSetting (name, list); } + + if (name=="window/mainwindow-scrollbar") + { + if(list.at(0) != "Grow Only") + { + if (mScroll) + { + if (list.at(0).isEmpty() || list.at(0) == "Scrollbar Only") + { + mScrollbarOnly = true; + mSubViewWindow.setMinimumWidth(0); + } + else + { + if(!mScrollbarOnly) + return; + + mScrollbarOnly = false; + updateScrollbar(); + } + } + else + { + mScroll = new QScrollArea(this); + mScroll->setWidgetResizable(true); + mScroll->setWidget(&mSubViewWindow); + setCentralWidget(mScroll); + } + } + else + { + if (mScroll) + { + mScroll->takeWidget(); + setCentralWidget (&mSubViewWindow); + mScroll->deleteLater(); + mScroll = 0; + } + else + return; + } + } } void CSVDoc::View::toggleShowStatusBar (bool show) @@ -815,3 +933,26 @@ void CSVDoc::View::closeRequest (SubView *subView) else if (mViewManager.closeRequest (this)) mViewManager.removeDocAndView (mDocument); } + +void CSVDoc::View::updateScrollbar() +{ + QRect rect; + QWidget *topLevel = QApplication::topLevelAt(pos()); + if (topLevel) + rect = topLevel->rect(); + else + rect = this->rect(); + + int newWidth = 0; + for (int i = 0; i < mSubViews.size(); ++i) + { + newWidth += mSubViews[i]->width(); + } + + int frameWidth = frameGeometry().width() - width(); + + if ((newWidth+frameWidth) >= rect.width()) + mSubViewWindow.setMinimumWidth(newWidth); + else + mSubViewWindow.setMinimumWidth(0); +} diff --git a/apps/opencs/view/doc/view.hpp b/apps/opencs/view/doc/view.hpp index 32d7159c2..1d44cb7f5 100644 --- a/apps/opencs/view/doc/view.hpp +++ b/apps/opencs/view/doc/view.hpp @@ -10,6 +10,7 @@ class QAction; class QDockWidget; +class QScrollArea; namespace CSMDoc { @@ -47,6 +48,8 @@ namespace CSVDoc SubViewFactoryManager mSubViewFactory; QMainWindow mSubViewWindow; GlobalDebugProfileMenu *mGlobalDebugProfileMenu; + QScrollArea *mScroll; + bool mScrollbarOnly; // not implemented @@ -87,6 +90,8 @@ namespace CSVDoc /// User preference function void resizeViewHeight (int height); + void updateScrollbar(); + public: View (ViewManager& viewManager, CSMDoc::Document *document, int totalViews); diff --git a/apps/opencs/view/world/dialoguesubview.cpp b/apps/opencs/view/world/dialoguesubview.cpp index 0d0e82dbf..ccab576fa 100644 --- a/apps/opencs/view/world/dialoguesubview.cpp +++ b/apps/opencs/view/world/dialoguesubview.cpp @@ -20,6 +20,8 @@ #include #include #include +#include +#include #include "../../model/world/nestedtableproxymodel.hpp" #include "../../model/world/columnbase.hpp" @@ -581,7 +583,15 @@ CSVWorld::DialogueSubView::DialogueSubView (const CSMWorld::UniversalId& id, CSM changeCurrentId(id.getId()); - QWidget *mainWidget = new QWidget(this); + //QWidget *mainWidget = new QWidget(this); + CSVDoc::SizeHintWidget *mainWidget = new CSVDoc::SizeHintWidget; + + const QRect rect = QApplication::desktop()->screenGeometry(this); + int frameHeight = 40; // set a reasonable default + QWidget *topLevel = QApplication::topLevelAt(pos()); + if (topLevel) + frameHeight = topLevel->frameGeometry().height() - topLevel->height(); + mainWidget->setSizeHint(QSize(400, rect.height()-frameHeight)); // FIXME: 400 QHBoxLayout *buttonsLayout = new QHBoxLayout; QToolButton* prevButton = new QToolButton(mainWidget); diff --git a/apps/opencs/view/world/tablesubview.cpp b/apps/opencs/view/world/tablesubview.cpp index 729b6b8d7..dde04fb3f 100644 --- a/apps/opencs/view/world/tablesubview.cpp +++ b/apps/opencs/view/world/tablesubview.cpp @@ -3,6 +3,9 @@ #include #include +#include +#include +#include #include "../../model/doc/document.hpp" #include "../../model/world/tablemimedata.hpp" @@ -30,11 +33,18 @@ CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::D layout->insertWidget (0, mFilterBox); - QWidget *widget = new QWidget; + CSVDoc::SizeHintWidget *widget = new CSVDoc::SizeHintWidget; widget->setLayout (layout); setWidget (widget); + // prefer height of the screen and full width of the table + const QRect rect = QApplication::desktop()->screenGeometry(this); + int frameHeight = 40; // set a reasonable default + QWidget *topLevel = QApplication::topLevelAt(pos()); + if (topLevel) + frameHeight = topLevel->frameGeometry().height() - topLevel->height(); + widget->setSizeHint(QSize(mTable->horizontalHeader()->length(), rect.height()-frameHeight)); connect (mTable, SIGNAL (editRequest (const CSMWorld::UniversalId&, const std::string&)), this, SLOT (editRequest (const CSMWorld::UniversalId&, const std::string&))); From 93c3bb37167a2887f2c5d07c2265a1bf63fb650b Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sun, 17 May 2015 14:27:17 +0200 Subject: [PATCH 44/57] fixed subview-closing related crash (Fixes #2564) --- apps/opencs/view/doc/view.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/opencs/view/doc/view.cpp b/apps/opencs/view/doc/view.cpp index 5636fff94..e10f85c64 100644 --- a/apps/opencs/view/doc/view.cpp +++ b/apps/opencs/view/doc/view.cpp @@ -811,7 +811,10 @@ void CSVDoc::View::closeRequest (SubView *subView) if (mSubViews.size()>1 || mViewTotal<=1 || userSettings.setting ("window/hide-subview", QString ("false"))!="true") + { subView->deleteLater(); + mSubViews.removeOne (subView); + } else if (mViewManager.closeRequest (this)) mViewManager.removeDocAndView (mDocument); } From 7b207a795468c7f9603655722f33a54a2476de52 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sun, 17 May 2015 14:31:53 +0200 Subject: [PATCH 45/57] added shortcut for closing subviews (Fixes #2558) --- apps/opencs/view/doc/subview.cpp | 18 ++++++++++++++++++ apps/opencs/view/doc/subview.hpp | 2 ++ 2 files changed, 20 insertions(+) diff --git a/apps/opencs/view/doc/subview.cpp b/apps/opencs/view/doc/subview.cpp index df1e7ee49..f4f0c6afe 100644 --- a/apps/opencs/view/doc/subview.cpp +++ b/apps/opencs/view/doc/subview.cpp @@ -2,6 +2,24 @@ #include "view.hpp" +#include +#include +#include + +bool CSVDoc::SubView::event (QEvent *event) +{ + if (event->type()==QEvent::ShortcutOverride) + { + QKeyEvent *keyEvent = static_cast (event); + + if (keyEvent->key()==Qt::Key_W && keyEvent->modifiers()==(Qt::ShiftModifier | Qt::ControlModifier)) + emit closeRequest(); + return true; + } + + return QDockWidget::event (event); +} + CSVDoc::SubView::SubView (const CSMWorld::UniversalId& id) : mUniversalId (id) { diff --git a/apps/opencs/view/doc/subview.hpp b/apps/opencs/view/doc/subview.hpp index a8aa3cda1..b323f9ed9 100644 --- a/apps/opencs/view/doc/subview.hpp +++ b/apps/opencs/view/doc/subview.hpp @@ -34,6 +34,8 @@ namespace CSVDoc void setUniversalId(const CSMWorld::UniversalId& id); + bool event (QEvent *event); + public: SubView (const CSMWorld::UniversalId& id); From 8bcfac1ea3779ad3ac18b2dfedecb291f5c98418 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 17 May 2015 16:25:13 +0200 Subject: [PATCH 46/57] Fix adjustPosition not always working correctly (Fixes #2563) moveObject was returning an incorrect Ptr for cell movements. --- apps/openmw/mwbase/world.hpp | 4 +- .../mwscript/transformationextensions.cpp | 7 ++-- apps/openmw/mwworld/worldimp.cpp | 37 +++++++++---------- apps/openmw/mwworld/worldimp.hpp | 4 +- 4 files changed, 25 insertions(+), 27 deletions(-) diff --git a/apps/openmw/mwbase/world.hpp b/apps/openmw/mwbase/world.hpp index 9e6c6d9bf..c110e94d6 100644 --- a/apps/openmw/mwbase/world.hpp +++ b/apps/openmw/mwbase/world.hpp @@ -286,8 +286,8 @@ namespace MWBase virtual MWWorld::Ptr moveObject (const MWWorld::Ptr& ptr, float x, float y, float z) = 0; ///< @return an updated Ptr in case the Ptr's cell changes - virtual void - moveObject(const MWWorld::Ptr &ptr, MWWorld::CellStore* newCell, float x, float y, float z) = 0; + virtual MWWorld::Ptr moveObject(const MWWorld::Ptr &ptr, MWWorld::CellStore* newCell, float x, float y, float z) = 0; + ///< @return an updated Ptr virtual void scaleObject (const MWWorld::Ptr& ptr, float scale) = 0; diff --git a/apps/openmw/mwscript/transformationextensions.cpp b/apps/openmw/mwscript/transformationextensions.cpp index f87983ce8..414ef7fb7 100644 --- a/apps/openmw/mwscript/transformationextensions.cpp +++ b/apps/openmw/mwscript/transformationextensions.cpp @@ -370,18 +370,17 @@ namespace MWScript // another morrowind oddity: player will be moved to the exterior cell at this location, // non-player actors will move within the cell they are in. - MWWorld::Ptr updated; if (ptr == MWBase::Environment::get().getWorld()->getPlayerPtr()) { MWWorld::CellStore* cell = MWBase::Environment::get().getWorld()->getExterior(cx,cy); MWBase::Environment::get().getWorld()->moveObject(ptr,cell,x,y,z); - updated = MWWorld::Ptr(ptr.getBase(), cell); + ptr = MWWorld::Ptr(ptr.getBase(), cell); } else { - updated = MWBase::Environment::get().getWorld()->moveObject(ptr, x, y, z); + ptr = MWBase::Environment::get().getWorld()->moveObject(ptr, x, y, z); } - dynamic_cast(runtime.getContext()).updatePtr(updated); + dynamic_cast(runtime.getContext()).updatePtr(ptr); float ax = Ogre::Radian(ptr.getRefData().getPosition().rot[0]).valueDegrees(); float ay = Ogre::Radian(ptr.getRefData().getPosition().rot[1]).valueDegrees(); diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 0f8110624..bb0402c4e 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1108,7 +1108,7 @@ namespace MWWorld } } - void World::moveObject(const Ptr &ptr, CellStore* newCell, float x, float y, float z) + MWWorld::Ptr World::moveObject(const Ptr &ptr, CellStore* newCell, float x, float y, float z) { ESM::Position pos = ptr.getRefData().getPosition(); @@ -1123,6 +1123,7 @@ namespace MWWorld CellStore *currCell = ptr.isInCell() ? ptr.getCell() : NULL; // currCell == NULL should only happen for player, during initial startup bool isPlayer = ptr == mPlayer->getPlayer(); bool haveToMove = isPlayer || (currCell && mWorldScene->isCellActive(*currCell)); + MWWorld::Ptr newPtr = ptr; if (currCell != newCell) { @@ -1140,6 +1141,7 @@ namespace MWWorld mWorldScene->changeToExteriorCell(pos, false); } addContainerScripts (getPlayerPtr(), newCell); + newPtr = getPlayerPtr(); } else { @@ -1147,7 +1149,7 @@ namespace MWWorld bool newCellActive = mWorldScene->isCellActive(*newCell); if (!currCellActive && newCellActive) { - MWWorld::Ptr newPtr = ptr.getClass().copyToCell(ptr, *newCell, pos); + newPtr = ptr.getClass().copyToCell(ptr, *newCell, pos); mWorldScene->addObjectToScene(newPtr); std::string script = newPtr.getClass().getScript(newPtr); @@ -1163,23 +1165,21 @@ namespace MWWorld removeContainerScripts (ptr); haveToMove = false; - MWWorld::Ptr newPtr = ptr.getClass() - .copyToCell(ptr, *newCell); + newPtr = ptr.getClass().copyToCell(ptr, *newCell); newPtr.getRefData().setBaseNode(0); } else if (!currCellActive && !newCellActive) - ptr.getClass().copyToCell(ptr, *newCell); + newPtr = ptr.getClass().copyToCell(ptr, *newCell); else // both cells active { - MWWorld::Ptr copy = - ptr.getClass().copyToCell(ptr, *newCell, pos); + newPtr = ptr.getClass().copyToCell(ptr, *newCell, pos); - mRendering->updateObjectCell(ptr, copy); + mRendering->updateObjectCell(ptr, newPtr); ptr.getRefData().setBaseNode(NULL); - MWBase::Environment::get().getSoundManager()->updatePtr (ptr, copy); + MWBase::Environment::get().getSoundManager()->updatePtr (ptr, newPtr); MWBase::MechanicsManager *mechMgr = MWBase::Environment::get().getMechanicsManager(); - mechMgr->updateCell(ptr, copy); + mechMgr->updateCell(ptr, newPtr); std::string script = ptr.getClass().getScript(ptr); @@ -1187,22 +1187,23 @@ namespace MWWorld { mLocalScripts.remove(ptr); removeContainerScripts (ptr); - mLocalScripts.add(script, copy); - addContainerScripts (copy, newCell); + mLocalScripts.add(script, newPtr); + addContainerScripts (newPtr, newCell); } } ptr.getRefData().setCount(0); } } - if (haveToMove && ptr.getRefData().getBaseNode()) + if (haveToMove && newPtr.getRefData().getBaseNode()) { - mRendering->moveObject(ptr, vec); - mPhysics->moveObject (ptr); + mRendering->moveObject(newPtr, vec); + mPhysics->moveObject (newPtr); } if (isPlayer) { mWorldScene->playerMoved (vec); } + return newPtr; } MWWorld::Ptr World::moveObjectImp(const Ptr& ptr, float x, float y, float z) @@ -1216,11 +1217,7 @@ namespace MWWorld cell = getExterior(cellX, cellY); } - moveObject(ptr, cell, x, y, z); - - MWWorld::Ptr updated = ptr; - updated.mCell = cell; - return updated; + return moveObject(ptr, cell, x, y, z); } MWWorld::Ptr World::moveObject (const Ptr& ptr, float x, float y, float z) diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index 63d6506de..bf25c20bb 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -348,7 +348,9 @@ namespace MWWorld virtual MWWorld::Ptr moveObject (const Ptr& ptr, float x, float y, float z); ///< @return an updated Ptr in case the Ptr's cell changes - virtual void moveObject (const Ptr& ptr, CellStore* newCell, float x, float y, float z); + + virtual MWWorld::Ptr moveObject (const Ptr& ptr, CellStore* newCell, float x, float y, float z); + ///< @return an updated Ptr virtual void scaleObject (const Ptr& ptr, float scale); From cfcfb173205bb1148b7b40f20b3eb75eb6791295 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Mon, 18 May 2015 07:12:02 +1000 Subject: [PATCH 47/57] Updates to optional horizontal scrollbar. - move SizeHintWidget out to separate files - remove redundant logic in view.cpp - remove sizehint from dialogue subview - add tooltip hints in user preferences --- apps/opencs/CMakeLists.txt | 2 +- apps/opencs/model/settings/usersettings.cpp | 4 ++++ apps/opencs/view/doc/sizehint.cpp | 17 ++++++++++++++++ apps/opencs/view/doc/sizehint.hpp | 22 +++++++++++++++++++++ apps/opencs/view/doc/subview.cpp | 16 --------------- apps/opencs/view/doc/subview.hpp | 13 ------------ apps/opencs/view/doc/view.cpp | 7 +------ apps/opencs/view/world/dialoguesubview.cpp | 12 +---------- apps/opencs/view/world/tablesubview.cpp | 1 + 9 files changed, 47 insertions(+), 47 deletions(-) create mode 100644 apps/opencs/view/doc/sizehint.cpp create mode 100644 apps/opencs/view/doc/sizehint.hpp diff --git a/apps/opencs/CMakeLists.txt b/apps/opencs/CMakeLists.txt index 9fb80324e..438f3c694 100644 --- a/apps/opencs/CMakeLists.txt +++ b/apps/opencs/CMakeLists.txt @@ -46,7 +46,7 @@ opencs_units_noqt (model/tools opencs_units (view/doc viewmanager view operations operation subview startup filedialog newgame - filewidget adjusterwidget loader globaldebugprofilemenu runlogsubview + filewidget adjusterwidget loader globaldebugprofilemenu runlogsubview sizehint ) diff --git a/apps/opencs/model/settings/usersettings.cpp b/apps/opencs/model/settings/usersettings.cpp index bd31b6e38..ea002c5ed 100644 --- a/apps/opencs/model/settings/usersettings.cpp +++ b/apps/opencs/model/settings/usersettings.cpp @@ -151,6 +151,10 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() "Add a horizontal scrollbar to the main view window."); mainwinScroll->setDefaultValue (defaultScroll); mainwinScroll->setDeclaredValues (scrollValues); + mainwinScroll->setToolTip ("Scrollbar Only: Simple addition of scrollbars, the view window does not grow" + " automatically.\n" + "Grow Only: Original Editor behaviour. The view window grows as subviews are added. No scrollbars.\n" + "Grow then Scroll: The view window grows. The scrollbar appears once it cannot grow any further."); Setting *grow = createSetting (Type_CheckBox, "grow-limit", "Grow Limit Screen"); grow->setDefaultValue ("false"); diff --git a/apps/opencs/view/doc/sizehint.cpp b/apps/opencs/view/doc/sizehint.cpp new file mode 100644 index 000000000..038bd9e4d --- /dev/null +++ b/apps/opencs/view/doc/sizehint.cpp @@ -0,0 +1,17 @@ +#include "sizehint.hpp" + +CSVDoc::SizeHintWidget::SizeHintWidget(QWidget *parent) : QWidget(parent) +{} + +CSVDoc::SizeHintWidget::~SizeHintWidget() +{} + +QSize CSVDoc::SizeHintWidget::sizeHint() const +{ + return mSize; +} + +void CSVDoc::SizeHintWidget::setSizeHint(const QSize &size) +{ + mSize = size; +} diff --git a/apps/opencs/view/doc/sizehint.hpp b/apps/opencs/view/doc/sizehint.hpp new file mode 100644 index 000000000..cf5a02580 --- /dev/null +++ b/apps/opencs/view/doc/sizehint.hpp @@ -0,0 +1,22 @@ +#ifndef CSV_DOC_SIZEHINT_H +#define CSV_DOC_SIZEHINT_H + +#include +#include + +namespace CSVDoc +{ + class SizeHintWidget : public QWidget + { + QSize mSize; + + public: + SizeHintWidget(QWidget *parent = 0); + ~SizeHintWidget(); + + virtual QSize sizeHint() const; + void setSizeHint(const QSize &size); + }; +} + +#endif // CSV_DOC_SIZEHINT_H diff --git a/apps/opencs/view/doc/subview.cpp b/apps/opencs/view/doc/subview.cpp index 09128d919..df1e7ee49 100644 --- a/apps/opencs/view/doc/subview.cpp +++ b/apps/opencs/view/doc/subview.cpp @@ -43,19 +43,3 @@ void CSVDoc::SubView::closeRequest() { emit closeRequest (this); } - -CSVDoc::SizeHintWidget::SizeHintWidget(QWidget *parent) : QWidget(parent) -{} - -CSVDoc::SizeHintWidget::~SizeHintWidget() -{} - -QSize CSVDoc::SizeHintWidget::sizeHint() const -{ - return mSize; -} - -void CSVDoc::SizeHintWidget::setSizeHint(const QSize &size) -{ - mSize = size; -} diff --git a/apps/opencs/view/doc/subview.hpp b/apps/opencs/view/doc/subview.hpp index f327107c2..a8aa3cda1 100644 --- a/apps/opencs/view/doc/subview.hpp +++ b/apps/opencs/view/doc/subview.hpp @@ -8,7 +8,6 @@ #include "subviewfactory.hpp" #include -#include class QUndoStack; @@ -71,18 +70,6 @@ namespace CSVDoc void closeRequest(); }; - - class SizeHintWidget : public QWidget - { - QSize mSize; - - public: - SizeHintWidget(QWidget *parent = 0); - ~SizeHintWidget(); - - virtual QSize sizeHint() const; - void setSizeHint(const QSize &size); - }; } #endif diff --git a/apps/opencs/view/doc/view.cpp b/apps/opencs/view/doc/view.cpp index 16b96ed4d..47810a115 100644 --- a/apps/opencs/view/doc/view.cpp +++ b/apps/opencs/view/doc/view.cpp @@ -563,12 +563,7 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin // CSMSettings::UserSettings &settings = CSMSettings::UserSettings::instance(); QString mainwinScroll = settings.settingValue ("window/mainwindow-scrollbar"); - if (mainwinScroll.isEmpty() || mainwinScroll == "Scrollbar Only") - mScrollbarOnly = true; - else if(mainwinScroll == "Grow Only") - mScrollbarOnly = false; - else - mScrollbarOnly = false; + mScrollbarOnly = mainwinScroll.isEmpty() || mainwinScroll == "Scrollbar Only"; QDesktopWidget *dw = QApplication::desktop(); QRect rect; diff --git a/apps/opencs/view/world/dialoguesubview.cpp b/apps/opencs/view/world/dialoguesubview.cpp index ccab576fa..0d0e82dbf 100644 --- a/apps/opencs/view/world/dialoguesubview.cpp +++ b/apps/opencs/view/world/dialoguesubview.cpp @@ -20,8 +20,6 @@ #include #include #include -#include -#include #include "../../model/world/nestedtableproxymodel.hpp" #include "../../model/world/columnbase.hpp" @@ -583,15 +581,7 @@ CSVWorld::DialogueSubView::DialogueSubView (const CSMWorld::UniversalId& id, CSM changeCurrentId(id.getId()); - //QWidget *mainWidget = new QWidget(this); - CSVDoc::SizeHintWidget *mainWidget = new CSVDoc::SizeHintWidget; - - const QRect rect = QApplication::desktop()->screenGeometry(this); - int frameHeight = 40; // set a reasonable default - QWidget *topLevel = QApplication::topLevelAt(pos()); - if (topLevel) - frameHeight = topLevel->frameGeometry().height() - topLevel->height(); - mainWidget->setSizeHint(QSize(400, rect.height()-frameHeight)); // FIXME: 400 + QWidget *mainWidget = new QWidget(this); QHBoxLayout *buttonsLayout = new QHBoxLayout; QToolButton* prevButton = new QToolButton(mainWidget); diff --git a/apps/opencs/view/world/tablesubview.cpp b/apps/opencs/view/world/tablesubview.cpp index dde04fb3f..af0b64447 100644 --- a/apps/opencs/view/world/tablesubview.cpp +++ b/apps/opencs/view/world/tablesubview.cpp @@ -10,6 +10,7 @@ #include "../../model/doc/document.hpp" #include "../../model/world/tablemimedata.hpp" +#include "../doc/sizehint.hpp" #include "../filter/filterbox.hpp" #include "table.hpp" #include "tablebottombox.hpp" From 196be7283d07cb371d699fdb1f9d4b19c6841774 Mon Sep 17 00:00:00 2001 From: Stanislav Bas Date: Tue, 19 May 2015 21:39:17 +0300 Subject: [PATCH 48/57] Reset an activated reference after activation's exectution (Fix #1738) --- apps/openmw/mwscript/interpretercontext.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/openmw/mwscript/interpretercontext.cpp b/apps/openmw/mwscript/interpretercontext.cpp index a8c04aa4b..df675aebb 100644 --- a/apps/openmw/mwscript/interpretercontext.cpp +++ b/apps/openmw/mwscript/interpretercontext.cpp @@ -505,7 +505,10 @@ namespace MWScript boost::shared_ptr action = (ptr.getClass().activate(ptr, actor)); action->execute (actor); if (mActivated == ptr) + { mActivationHandled = true; + mActivated = MWWorld::Ptr(); + } } float InterpreterContext::getSecondsPassed() const From ca7829032eac7e43e0edb58cf4d27137433f0aee Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Wed, 20 May 2015 11:45:16 +0200 Subject: [PATCH 49/57] updated credits file --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 0cd961c61..4fef9233a 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -98,6 +98,7 @@ Programmers Sebastian Wick (swick) Sergey Shambir sir_herrbatka + smbas Stefan Galowicz (bogglez) Stanislav Bobrov (Jiub) Sylvain Thesnieres (Garvek) From 8f8fdedcde09552f79114357d78ed3bda2f2eba7 Mon Sep 17 00:00:00 2001 From: Nicola Bodill Date: Thu, 21 May 2015 14:20:35 +1000 Subject: [PATCH 50/57] Some more edits Responding to sirherrbatka's feedback. --- manual/opencs/files_and_directories.tex | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/manual/opencs/files_and_directories.tex b/manual/opencs/files_and_directories.tex index 1b07fe267..55d3011b4 100644 --- a/manual/opencs/files_and_directories.tex +++ b/manual/opencs/files_and_directories.tex @@ -1,8 +1,8 @@ \section{Files and Directories} \subsection{Introduction} -This section of the manual describes the directories and file types used by OpenCS. A file is a resource for storing data, identified by its -filename extension (e.g. .exe, .jpg, .txt), whereas a directory is a folder or file system structure in which these files are stored. You -are most likely already familiar with these concepts. +This section of the manual describes the directories and file types used by OpenCS. A file is a resource for storing data (e.g. .exe, .jpg, .txt), +whereas a directory is a folder or file system structure which points to these files (or other directories). You are most likely already familiar +with these concepts. \subsection{Used terms} %TODO @@ -15,7 +15,7 @@ files and several other folders. The location of the user directory is hard code %TODO list paths. In addition to the user directory, both \OMW{} and \OCS{} need a place to store the game’s actual data files: for example, the textures, models, sounds and records of in-game objects. We support multiple paths to these files (termed \textbf{data paths}), -as specified in the configuration. Usually, one data path points to the directory where \MW{} is installed, however, you are +as specified in the configuration. Usually, one data path points to the directory where \MW{} is installed; however, you are free to specify as many data paths as you would like. In addition, one particular data path, as described below, is used to store newly created content files. @@ -23,7 +23,7 @@ newly created content files. \BS{} \MW{} engine uses two file types: ESM (master) and ESP (plugin). The distinction between the two is often confusing. You would expect that the ESM (master) file is used to specify a single master which is modified by the ESP files (plugins), and indeed: this is the basic idea. However, the original expansions are also ESM files, even though they can be described as very large plugins. -There were technical reasons behind this decision -- somewhat valid in the case of the original engine, but a more logical file system is +There were technical reasons behind this decision -- somewhat valid in the case of the original engine -- but a more logical file system is much preferable. \OMW{} achieves this through the creation of our own types of content file. We support both ESM and ESP files, but, in order to make use of \OMW{}'s new features, one should consider using new file types designed @@ -42,9 +42,9 @@ Furthermore, our content files’ extensions are .omwaddon for addon files and . \subparagraph{\MW{} content files} Using our content files is the recommended solution for projects that employ the \OMW{} engine. However, some players will wish to use the original \MW{} engine, despite its large flaws and lacking features\footnote{If this is wrong, we are a very successful project. Yay!}. -In addition, since 2002 thousands of ESP/ESM files have been created, some with truly outstanding content. Because of this, \OCS{} is -committed to supporting ESP/ESM files. If you do decide to use ESP/ESM files rather than our own content files, you are most likely aiming -for original engine compatibility. This subject is covered in the very last section of the manual. +In addition, since 2002, thousands of ESP/ESM files have been created, some with truly outstanding content. Because of this, \OCS{} +will support ESP/ESM files, although this will impose limitations on the user. If you do decide to use ESP/ESM files rather than our own content +files, you are most likely aiming for original engine compatibility. This subject is covered in the very last section of the manual. %not finished TODO add the said section. Most likely when more features are present. The actual creation of new files is described in the next chapter. Here we are going to focus only on the essential information needed From 9767910f0615e8c5f68502798f1aae0a55bc420b Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 21 May 2015 17:51:20 +0200 Subject: [PATCH 51/57] updated credits file --- AUTHORS.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/AUTHORS.md b/AUTHORS.md index 4fef9233a..fb83a1a91 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -110,6 +110,12 @@ Programmers Vincent Heuken vocollapse +Manual +------ + + Bodillium + sir_herrbatka + Packagers --------- From d27b92e9f1b093798cbe2404ed0b998c8f3b750f Mon Sep 17 00:00:00 2001 From: Stanislav Bas Date: Fri, 22 May 2015 00:57:47 +0300 Subject: [PATCH 52/57] Avoid gaps between local indexes in RefIdData after removal of records (Fix #2545) --- apps/opencs/model/world/refiddata.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/opencs/model/world/refiddata.cpp b/apps/opencs/model/world/refiddata.cpp index f67ab2152..7f5c25f36 100644 --- a/apps/opencs/model/world/refiddata.cpp +++ b/apps/opencs/model/world/refiddata.cpp @@ -176,7 +176,6 @@ void CSMWorld::RefIdData::erase (const LocalIndex& index, int count) { std::map::iterator iter = mRecordContainers.find (index.second); - if (iter==mRecordContainers.end()) throw std::logic_error ("invalid local index type"); @@ -189,6 +188,20 @@ void CSMWorld::RefIdData::erase (const LocalIndex& index, int count) mIndex.erase (result); } + // Adjust the local indexes to avoid gaps between them after removal of records + int recordIndex = index.first + count; + int recordCount = iter->second->getSize(); + while (recordIndex < recordCount) + { + std::map::iterator recordIndexFound = + mIndex.find(Misc::StringUtils::lowerCase(iter->second->getId(recordIndex))); + if (recordIndexFound != mIndex.end()) + { + recordIndexFound->second.first -= count; + } + ++recordIndex; + } + iter->second->erase (index.first, count); } From 396fba7fa9891dad8c11dd4877278467cd9e19b8 Mon Sep 17 00:00:00 2001 From: Rohit Nirmal Date: Thu, 30 Apr 2015 19:24:27 -0500 Subject: [PATCH 53/57] Silence -Wreorder warnings, and remove -Wno-reorder. --- CMakeLists.txt | 2 +- apps/launcher/graphicspage.cpp | 4 +-- apps/launcher/settingspage.cpp | 4 +-- apps/opencs/editor.cpp | 4 +-- apps/opencs/model/doc/document.cpp | 3 +- apps/opencs/model/filter/valuenode.cpp | 2 +- apps/opencs/model/settings/connector.cpp | 2 +- .../opencs/model/tools/referenceablecheck.cpp | 2 +- apps/opencs/model/tools/tools.cpp | 4 +-- apps/opencs/model/world/columnbase.cpp | 2 +- apps/opencs/model/world/commanddispatcher.cpp | 2 +- apps/opencs/model/world/commands.cpp | 18 +++++----- apps/opencs/model/world/refidadapterimp.cpp | 2 +- apps/opencs/view/doc/filedialog.cpp | 2 +- apps/opencs/view/render/cell.cpp | 2 +- apps/opencs/view/render/mousestate.cpp | 10 +++--- apps/opencs/view/render/textoverlay.cpp | 4 +-- apps/opencs/view/render/worldspacewidget.cpp | 2 +- apps/opencs/view/settings/booleanview.cpp | 2 +- apps/opencs/view/settings/dialog.cpp | 2 +- apps/opencs/view/settings/frame.cpp | 4 +-- apps/opencs/view/settings/listview.cpp | 2 +- apps/opencs/view/settings/page.cpp | 2 +- apps/opencs/view/settings/spinbox.cpp | 2 +- apps/opencs/view/settings/view.cpp | 6 ++-- apps/opencs/view/world/dialoguesubview.cpp | 10 +++--- apps/opencs/view/world/dragrecordtable.cpp | 2 +- apps/opencs/view/world/genericcreator.cpp | 4 +-- apps/opencs/view/world/scenesubview.cpp | 2 +- apps/opencs/view/world/scriptedit.cpp | 9 ++--- apps/opencs/view/world/table.cpp | 4 +-- apps/openmw/mwbase/environment.cpp | 4 +-- apps/openmw/mwdialogue/dialoguemanagerimp.cpp | 13 ++++--- apps/openmw/mwgui/alchemywindow.cpp | 4 +-- apps/openmw/mwgui/bookpage.cpp | 16 ++++----- apps/openmw/mwgui/bookwindow.cpp | 2 +- apps/openmw/mwgui/companionwindow.cpp | 6 ++-- apps/openmw/mwgui/container.cpp | 6 ++-- apps/openmw/mwgui/dialogue.cpp | 4 +-- apps/openmw/mwgui/draganddrop.cpp | 6 ++-- apps/openmw/mwgui/inventorywindow.cpp | 16 ++++----- apps/openmw/mwgui/itemmodel.cpp | 12 +++---- apps/openmw/mwgui/jailscreen.cpp | 4 +-- apps/openmw/mwgui/journalbooks.cpp | 6 ++-- apps/openmw/mwgui/journalviewmodel.cpp | 2 +- apps/openmw/mwgui/loadingscreen.cpp | 6 ++-- apps/openmw/mwgui/mapwindow.cpp | 22 ++++++------ apps/openmw/mwgui/messagebox.cpp | 6 ++-- apps/openmw/mwgui/sortfilteritemmodel.cpp | 2 +- apps/openmw/mwgui/spellbuyingwindow.cpp | 2 +- apps/openmw/mwgui/spellcreationdialog.cpp | 6 ++-- apps/openmw/mwgui/tooltips.cpp | 6 ++-- apps/openmw/mwgui/waitdialog.cpp | 2 +- apps/openmw/mwgui/windowbase.cpp | 2 +- apps/openmw/mwmechanics/aiavoiddoor.cpp | 2 +- apps/openmw/mwmechanics/aicombat.cpp | 6 ++-- apps/openmw/mwmechanics/aiescort.cpp | 7 ++-- apps/openmw/mwmechanics/aifollow.cpp | 12 +++---- apps/openmw/mwmechanics/aiwander.cpp | 2 +- apps/openmw/mwmechanics/character.cpp | 2 +- apps/openmw/mwmechanics/creaturestats.cpp | 16 ++++----- apps/openmw/mwmechanics/npcstats.cpp | 6 ++-- apps/openmw/mwmechanics/obstacle.cpp | 2 +- apps/openmw/mwmechanics/pathgrid.cpp | 4 +-- apps/openmw/mwrender/globalmap.cpp | 5 +-- apps/openmw/mwrender/water.cpp | 6 ++-- apps/openmw/mwsound/soundmanagerimp.cpp | 6 ++-- apps/openmw/mwworld/action.cpp | 2 +- apps/openmw/mwworld/esmloader.cpp | 2 +- apps/openmw/mwworld/inventorystore.cpp | 8 ++--- apps/openmw/mwworld/physicssystem.cpp | 2 +- apps/openmw/mwworld/player.cpp | 2 +- apps/openmw/mwworld/refdata.cpp | 18 +++++----- apps/openmw/mwworld/weather.cpp | 9 +++-- apps/openmw/mwworld/worldimp.cpp | 14 ++++---- components/compiler/lineparser.cpp | 4 +-- components/interpreter/runtime.cpp | 2 +- .../ogre-ffmpeg-videoplayer/audiodecoder.cpp | 14 ++++---- extern/ogre-ffmpeg-videoplayer/videostate.cpp | 8 +++-- extern/oics/ICSControl.cpp | 4 +-- extern/oics/ICSInputControlSystem.cpp | 36 +++++++++---------- extern/sdl4ogre/sdlinputwrapper.cpp | 36 +++++++++---------- extern/shiny/Main/Factory.cpp | 12 +++---- extern/shiny/Main/MaterialInstance.cpp | 6 ++-- extern/shiny/Main/Platform.cpp | 4 +-- extern/shiny/Main/ShaderSet.cpp | 2 +- 86 files changed, 270 insertions(+), 268 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c19c57eb..1fefc673e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -351,7 +351,7 @@ endif() # CXX Compiler settings if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -Wno-reorder -std=c++98 -pedantic -Wno-long-long") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -std=c++98 -pedantic -Wno-long-long") if (CMAKE_CXX_COMPILER_ID STREQUAL Clang AND NOT APPLE) execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE CLANG_VERSION) diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index cdb51348c..5176d7fa0 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -36,13 +36,13 @@ QString getAspect(int x, int y) } Launcher::GraphicsPage::GraphicsPage(Files::ConfigurationManager &cfg, GraphicsSettings &graphicsSetting, QWidget *parent) - : mOgre(NULL) + : QWidget(parent) + , mOgre(NULL) , mSelectedRenderSystem(NULL) , mOpenGLRenderSystem(NULL) , mDirect3DRenderSystem(NULL) , mCfgMgr(cfg) , mGraphicsSettings(graphicsSetting) - , QWidget(parent) { setObjectName ("GraphicsPage"); setupUi(this); diff --git a/apps/launcher/settingspage.cpp b/apps/launcher/settingspage.cpp index 34b4b41a9..843b51391 100644 --- a/apps/launcher/settingspage.cpp +++ b/apps/launcher/settingspage.cpp @@ -18,10 +18,10 @@ using namespace Process; Launcher::SettingsPage::SettingsPage(Files::ConfigurationManager &cfg, Config::GameSettings &gameSettings, Config::LauncherSettings &launcherSettings, MainDialog *parent) - : mCfgMgr(cfg) + : QWidget(parent) + , mCfgMgr(cfg) , mGameSettings(gameSettings) , mLauncherSettings(launcherSettings) - , QWidget(parent) , mMain(parent) { setupUi(this); diff --git a/apps/opencs/editor.cpp b/apps/opencs/editor.cpp index 1d31c8396..53a9e9e83 100644 --- a/apps/opencs/editor.cpp +++ b/apps/opencs/editor.cpp @@ -23,8 +23,8 @@ CS::Editor::Editor (OgreInit::OgreInit& ogreInit) : mUserSettings (mCfgMgr), mOverlaySystem (0), mDocumentManager (mCfgMgr), - mViewManager (mDocumentManager), - mIpcServerName ("org.openmw.OpenCS"), mServer(NULL), mClientSocket(NULL), mPid(""), mLock() + mViewManager (mDocumentManager), mPid(""), + mLock(), mIpcServerName ("org.openmw.OpenCS"), mServer(NULL), mClientSocket(NULL) { std::pair > config = readConfig(); diff --git a/apps/opencs/model/doc/document.cpp b/apps/opencs/model/doc/document.cpp index 31d0aaccd..a73201ec0 100644 --- a/apps/opencs/model/doc/document.cpp +++ b/apps/opencs/model/doc/document.cpp @@ -2251,11 +2251,12 @@ CSMDoc::Document::Document (const Files::ConfigurationManager& configuration, ToUTF8::FromType encoding, const CSMWorld::ResourcesManager& resourcesManager, const std::vector& blacklistedScripts) : mSavePath (savePath), mContentFiles (files), mNew (new_), mData (encoding, resourcesManager), - mTools (*this), mResDir(resDir), + mTools (*this), mProjectPath ((configuration.getUserDataPath() / "projects") / (savePath.filename().string() + ".project")), mSavingOperation (*this, mProjectPath, encoding), mSaving (&mSavingOperation), + mResDir(resDir), mRunner (mProjectPath), mPhysics(boost::shared_ptr()) { if (mContentFiles.empty()) diff --git a/apps/opencs/model/filter/valuenode.cpp b/apps/opencs/model/filter/valuenode.cpp index 6fdae3e1b..6fdb5cb02 100644 --- a/apps/opencs/model/filter/valuenode.cpp +++ b/apps/opencs/model/filter/valuenode.cpp @@ -9,7 +9,7 @@ CSMFilter::ValueNode::ValueNode (int columnId, Type lowerType, Type upperType, double lower, double upper) -: mColumnId (columnId), mLowerType (lowerType), mUpperType (upperType), mLower (lower), mUpper (upper){} +: mColumnId (columnId), mLower (lower), mUpper (upper), mLowerType (lowerType), mUpperType (upperType){} bool CSMFilter::ValueNode::test (const CSMWorld::IdTableBase& table, int row, const std::map& columns) const diff --git a/apps/opencs/model/settings/connector.cpp b/apps/opencs/model/settings/connector.cpp index 5e1d64544..3cf21123c 100644 --- a/apps/opencs/model/settings/connector.cpp +++ b/apps/opencs/model/settings/connector.cpp @@ -4,7 +4,7 @@ CSMSettings::Connector::Connector(CSVSettings::View *master, QObject *parent) - : mMasterView (master), QObject(parent) + : QObject(parent), mMasterView (master) {} void CSMSettings::Connector::addSlaveView (CSVSettings::View *view, diff --git a/apps/opencs/model/tools/referenceablecheck.cpp b/apps/opencs/model/tools/referenceablecheck.cpp index 5190aacd5..c0991a330 100644 --- a/apps/opencs/model/tools/referenceablecheck.cpp +++ b/apps/opencs/model/tools/referenceablecheck.cpp @@ -11,8 +11,8 @@ CSMTools::ReferenceableCheckStage::ReferenceableCheckStage( const CSMWorld::IdCollection& faction) : mReferencables(referenceable), - mClasses(classes), mRaces(races), + mClasses(classes), mFactions(faction), mPlayerPresent(false) { diff --git a/apps/opencs/model/tools/tools.cpp b/apps/opencs/model/tools/tools.cpp index 970a8ac4f..99e462b1d 100644 --- a/apps/opencs/model/tools/tools.cpp +++ b/apps/opencs/model/tools/tools.cpp @@ -103,8 +103,8 @@ CSMDoc::OperationHolder *CSMTools::Tools::getVerifier() } CSMTools::Tools::Tools (CSMDoc::Document& document) -: mDocument (document), mData (document.getData()), mVerifierOperation (0), mNextReportNumber (0), - mSearchOperation (0) +: mDocument (document), mData (document.getData()), mVerifierOperation (0), + mSearchOperation (0), mNextReportNumber (0) { // index 0: load error log mReports.insert (std::make_pair (mNextReportNumber++, new ReportModel)); diff --git a/apps/opencs/model/world/columnbase.cpp b/apps/opencs/model/world/columnbase.cpp index cf125aa63..53987b23c 100644 --- a/apps/opencs/model/world/columnbase.cpp +++ b/apps/opencs/model/world/columnbase.cpp @@ -3,7 +3,7 @@ #include "columns.hpp" CSMWorld::ColumnBase::ColumnBase (int columnId, Display displayType, int flags) - : mColumnId (columnId), mDisplayType (displayType), mFlags (flags) + : mColumnId (columnId), mFlags (flags), mDisplayType (displayType) {} CSMWorld::ColumnBase::~ColumnBase() {} diff --git a/apps/opencs/model/world/commanddispatcher.cpp b/apps/opencs/model/world/commanddispatcher.cpp index 2d3262487..b9d5bd7fe 100644 --- a/apps/opencs/model/world/commanddispatcher.cpp +++ b/apps/opencs/model/world/commanddispatcher.cpp @@ -83,7 +83,7 @@ std::vector CSMWorld::CommandDispatcher::getRevertableRecords() con CSMWorld::CommandDispatcher::CommandDispatcher (CSMDoc::Document& document, const CSMWorld::UniversalId& id, QObject *parent) -: QObject (parent), mDocument (document), mId (id), mLocked (false) +: QObject (parent), mLocked (false), mDocument (document), mId (id) {} void CSMWorld::CommandDispatcher::setEditLock (bool locked) diff --git a/apps/opencs/model/world/commands.cpp b/apps/opencs/model/world/commands.cpp index 9a0401081..fbb4de756 100644 --- a/apps/opencs/model/world/commands.cpp +++ b/apps/opencs/model/world/commands.cpp @@ -235,12 +235,12 @@ CSMWorld::DeleteNestedCommand::DeleteNestedCommand (IdTree& model, int nestedRow, int parentColumn, QUndoCommand* parent) : - mId(id), - mModel(model), - mParentColumn(parentColumn), QUndoCommand(parent), - mNestedRow(nestedRow), - NestedTableStoring(model, id, parentColumn) + NestedTableStoring(model, id, parentColumn), + mModel(model), + mId(id), + mParentColumn(parentColumn), + mNestedRow(nestedRow) { std::string title = model.headerData(parentColumn, Qt::Horizontal, Qt::DisplayRole).toString().toUtf8().constData(); @@ -263,12 +263,12 @@ void CSMWorld::DeleteNestedCommand::undo() } CSMWorld::AddNestedCommand::AddNestedCommand(IdTree& model, const std::string& id, int nestedRow, int parentColumn, QUndoCommand* parent) - : mModel(model), + : QUndoCommand(parent), + NestedTableStoring(model, id, parentColumn), + mModel(model), mId(id), mNewRow(nestedRow), - mParentColumn(parentColumn), - QUndoCommand(parent), - NestedTableStoring(model, id, parentColumn) + mParentColumn(parentColumn) { std::string title = model.headerData(parentColumn, Qt::Horizontal, Qt::DisplayRole).toString().toUtf8().constData(); diff --git a/apps/opencs/model/world/refidadapterimp.cpp b/apps/opencs/model/world/refidadapterimp.cpp index 98c1b6f0f..c784e14ce 100644 --- a/apps/opencs/model/world/refidadapterimp.cpp +++ b/apps/opencs/model/world/refidadapterimp.cpp @@ -13,7 +13,7 @@ CSMWorld::PotionColumns::PotionColumns (const InventoryColumns& columns) CSMWorld::PotionRefIdAdapter::PotionRefIdAdapter (const PotionColumns& columns, const RefIdColumn *autoCalc) : InventoryRefIdAdapter (UniversalId::Type_Potion, columns), - mAutoCalc (autoCalc), mColumns(columns) + mColumns(columns), mAutoCalc (autoCalc) {} QVariant CSMWorld::PotionRefIdAdapter::getData (const RefIdColumn *column, const RefIdData& data, diff --git a/apps/opencs/view/doc/filedialog.cpp b/apps/opencs/view/doc/filedialog.cpp index 1b3196112..eeec81109 100644 --- a/apps/opencs/view/doc/filedialog.cpp +++ b/apps/opencs/view/doc/filedialog.cpp @@ -18,7 +18,7 @@ #include "adjusterwidget.hpp" CSVDoc::FileDialog::FileDialog(QWidget *parent) : - QDialog(parent), mSelector (0), mFileWidget (0), mAdjusterWidget (0), mDialogBuilt(false), mAction(ContentAction_Undefined) + QDialog(parent), mSelector (0), mAction(ContentAction_Undefined), mFileWidget (0), mAdjusterWidget (0), mDialogBuilt(false) { ui.setupUi (this); resize(400, 400); diff --git a/apps/opencs/view/render/cell.cpp b/apps/opencs/view/render/cell.cpp index a030ea11f..99658e1c8 100644 --- a/apps/opencs/view/render/cell.cpp +++ b/apps/opencs/view/render/cell.cpp @@ -55,7 +55,7 @@ bool CSVRender::Cell::addObjects (int start, int end) CSVRender::Cell::Cell (CSMWorld::Data& data, Ogre::SceneManager *sceneManager, const std::string& id, boost::shared_ptr physics, const Ogre::Vector3& origin) -: mData (data), mId (Misc::StringUtils::lowerCase (id)), mSceneMgr(sceneManager), mPhysics(physics), mX(0), mY(0) +: mData (data), mId (Misc::StringUtils::lowerCase (id)), mPhysics(physics), mSceneMgr(sceneManager), mX(0), mY(0) { mCellNode = sceneManager->getRootSceneNode()->createChildSceneNode(); mCellNode->setPosition (origin); diff --git a/apps/opencs/view/render/mousestate.cpp b/apps/opencs/view/render/mousestate.cpp index a94f4f8ab..206820194 100644 --- a/apps/opencs/view/render/mousestate.cpp +++ b/apps/opencs/view/render/mousestate.cpp @@ -56,11 +56,11 @@ namespace CSVRender // MouseState::MouseState(WorldspaceWidget *parent) - : mParent(parent), mPhysics(parent->mDocument.getPhysics()), mSceneManager(parent->getSceneManager()) - , mCurrentObj(""), mMouseState(Mouse_Default), mOldPos(0,0), mMouseEventTimer(0), mPlane(0) - , mGrabbedSceneNode(""), mOrigObjPos(Ogre::Vector3()), mOrigMousePos(Ogre::Vector3()) - , mCurrentMousePos(Ogre::Vector3()), mOffset(0.0f) - , mColIndexPosX(0), mColIndexPosY(0), mColIndexPosZ(0), mIdTableModel(0) + : mMouseState(Mouse_Default), mParent(parent), mPhysics(parent->mDocument.getPhysics()) + , mSceneManager(parent->getSceneManager()), mOldPos(0,0), mCurrentObj(""), mGrabbedSceneNode("") + , mMouseEventTimer(0), mPlane(0), mOrigObjPos(Ogre::Vector3()), mOrigMousePos(Ogre::Vector3()) + , mCurrentMousePos(Ogre::Vector3()), mOffset(0.0f), mIdTableModel(0), mColIndexPosX(0) + , mColIndexPosY(0), mColIndexPosZ(0) { const CSMWorld::RefCollection& references = mParent->mDocument.getData().getReferences(); diff --git a/apps/opencs/view/render/textoverlay.cpp b/apps/opencs/view/render/textoverlay.cpp index 656ea959c..c41d5f318 100644 --- a/apps/opencs/view/render/textoverlay.cpp +++ b/apps/opencs/view/render/textoverlay.cpp @@ -27,8 +27,8 @@ namespace CSVRender // http://www.ogre3d.org/tikiwiki/Creating+dynamic+textures // http://www.ogre3d.org/tikiwiki/ManualObject TextOverlay::TextOverlay(const Ogre::MovableObject* obj, const Ogre::Camera* camera, const Ogre::String& id) - : mOverlay(0), mCaption(""), mDesc(""), mEnabled(true), mCamera(camera), mObj(obj), mId(id) - , mOnScreen(false) , mInstance(0), mFontHeight(16) // FIXME: make font height configurable + : mOverlay(0), mCaption(""), mDesc(""), mObj(obj), mCamera(camera), mFontHeight(16), mId(id) + , mEnabled(true), mOnScreen(false), mInstance(0) // FIXME: make font height configurable { if(id == "" || !camera || !obj) throw std::runtime_error("TextOverlay could not be created."); diff --git a/apps/opencs/view/render/worldspacewidget.cpp b/apps/opencs/view/render/worldspacewidget.cpp index e3e5ce50e..e88814818 100644 --- a/apps/opencs/view/render/worldspacewidget.cpp +++ b/apps/opencs/view/render/worldspacewidget.cpp @@ -22,7 +22,7 @@ #include "editmode.hpp" CSVRender::WorldspaceWidget::WorldspaceWidget (CSMDoc::Document& document, QWidget* parent) -: SceneWidget (parent), mDocument(document), mSceneElements(0), mRun(0), mPhysics(boost::shared_ptr()), mMouse(0), +: SceneWidget (parent), mSceneElements(0), mRun(0), mDocument(document), mPhysics(boost::shared_ptr()), mMouse(0), mInteractionMask (0) { setAcceptDrops(true); diff --git a/apps/opencs/view/settings/booleanview.cpp b/apps/opencs/view/settings/booleanview.cpp index 29f9775af..8c759cabb 100644 --- a/apps/opencs/view/settings/booleanview.cpp +++ b/apps/opencs/view/settings/booleanview.cpp @@ -12,7 +12,7 @@ CSVSettings::BooleanView::BooleanView (CSMSettings::Setting *setting, Page *parent) - : mType(setting->type()), View (setting, parent) + : View (setting, parent), mType(setting->type()) { foreach (const QString &value, setting->declaredValues()) { diff --git a/apps/opencs/view/settings/dialog.cpp b/apps/opencs/view/settings/dialog.cpp index 0b1231266..e8832e2bc 100644 --- a/apps/opencs/view/settings/dialog.cpp +++ b/apps/opencs/view/settings/dialog.cpp @@ -23,7 +23,7 @@ #include CSVSettings::Dialog::Dialog(QMainWindow *parent) - : mStackedWidget (0), mDebugMode (false), SettingWindow (parent) + : SettingWindow (parent), mStackedWidget (0), mDebugMode (false) { setWindowTitle(QString::fromUtf8 ("User Settings")); diff --git a/apps/opencs/view/settings/frame.cpp b/apps/opencs/view/settings/frame.cpp index 32e094274..454d3fefa 100644 --- a/apps/opencs/view/settings/frame.cpp +++ b/apps/opencs/view/settings/frame.cpp @@ -7,8 +7,8 @@ const QString CSVSettings::Frame::sInvisibleBoxStyle = CSVSettings::Frame::Frame (bool isVisible, const QString &title, QWidget *parent) - : mIsHorizontal (true), mLayout (new SettingLayout()), - QGroupBox (title, parent) + : QGroupBox (title, parent), mIsHorizontal (true), + mLayout (new SettingLayout()) { setFlat (true); mVisibleBoxStyle = styleSheet(); diff --git a/apps/opencs/view/settings/listview.cpp b/apps/opencs/view/settings/listview.cpp index 36cdbb0ae..0876b3982 100644 --- a/apps/opencs/view/settings/listview.cpp +++ b/apps/opencs/view/settings/listview.cpp @@ -7,7 +7,7 @@ CSVSettings::ListView::ListView(CSMSettings::Setting *setting, Page *parent) - : mComboBox (0), mAbstractItemView (0), View(setting, parent) + : View(setting, parent), mAbstractItemView (0), mComboBox (0) { QWidget *widget = buildWidget(setting->isMultiLine(), setting->widgetWidth()); diff --git a/apps/opencs/view/settings/page.cpp b/apps/opencs/view/settings/page.cpp index e846840b8..c009cdd7a 100644 --- a/apps/opencs/view/settings/page.cpp +++ b/apps/opencs/view/settings/page.cpp @@ -19,7 +19,7 @@ QMap CSVSettings::Page::Page (const QString &pageName, QList settingList, SettingWindow *parent, const QString& label) -: mParent(parent), mIsEditorPage (false), Frame(false, "", parent), mLabel (label) +: Frame(false, "", parent), mParent(parent), mIsEditorPage (false), mLabel (label) { setObjectName (pageName); diff --git a/apps/opencs/view/settings/spinbox.cpp b/apps/opencs/view/settings/spinbox.cpp index c70fc36d1..043107bb7 100644 --- a/apps/opencs/view/settings/spinbox.cpp +++ b/apps/opencs/view/settings/spinbox.cpp @@ -3,7 +3,7 @@ #include CSVSettings::SpinBox::SpinBox(QWidget *parent) - : mValueList(QStringList()), QSpinBox(parent) + : QSpinBox(parent), mValueList(QStringList()) { setRange (0, 0); } diff --git a/apps/opencs/view/settings/view.cpp b/apps/opencs/view/settings/view.cpp index 39c7f89b2..21cf55fdd 100644 --- a/apps/opencs/view/settings/view.cpp +++ b/apps/opencs/view/settings/view.cpp @@ -12,12 +12,12 @@ CSVSettings::View::View(CSMSettings::Setting *setting, Page *parent) - : mDataModel(0), mParentPage (parent), + : Frame(true, setting->getLabel(), parent), + mParentPage (parent), mDataModel(0), mHasFixedValues (!setting->declaredValues().isEmpty()), mIsMultiValue (setting->isMultiValue()), mViewKey (setting->page() + '/' + setting->name()), - mSerializable (setting->serializable()), - Frame(true, setting->getLabel(), parent) + mSerializable (setting->serializable()) { if (!setting->getToolTip().isEmpty()) setToolTip (setting->getToolTip()); diff --git a/apps/opencs/view/world/dialoguesubview.cpp b/apps/opencs/view/world/dialoguesubview.cpp index 0d0e82dbf..647accd4c 100644 --- a/apps/opencs/view/world/dialoguesubview.cpp +++ b/apps/opencs/view/world/dialoguesubview.cpp @@ -356,15 +356,15 @@ CSVWorld::EditWidget::~EditWidget() CSVWorld::EditWidget::EditWidget(QWidget *parent, int row, CSMWorld::IdTable* table, CSMWorld::CommandDispatcher& commandDispatcher, CSMDoc::Document& document, bool createAndDelete) : -mDispatcher(this, table, commandDispatcher, document), -mNestedTableDispatcher(NULL), QScrollArea(parent), mWidgetMapper(NULL), mNestedTableMapper(NULL), +mDispatcher(this, table, commandDispatcher, document), +mNestedTableDispatcher(NULL), mMainWidget(NULL), +mTable(table), mCommandDispatcher (commandDispatcher), -mDocument (document), -mTable(table) +mDocument (document) { remake (row); @@ -571,8 +571,8 @@ CSVWorld::DialogueSubView::DialogueSubView (const CSMWorld::UniversalId& id, CSM SubView (id), mEditWidget(0), mMainLayout(NULL), - mUndoStack(document.getUndoStack()), mTable(dynamic_cast(document.getData().getTableModel(id))), + mUndoStack(document.getUndoStack()), mLocked(false), mDocument(document), mCommandDispatcher (document, CSMWorld::UniversalId::getParentType (id.getType())) diff --git a/apps/opencs/view/world/dragrecordtable.cpp b/apps/opencs/view/world/dragrecordtable.cpp index f45c45809..7032fee6d 100644 --- a/apps/opencs/view/world/dragrecordtable.cpp +++ b/apps/opencs/view/world/dragrecordtable.cpp @@ -17,8 +17,8 @@ void CSVWorld::DragRecordTable::startDragFromTable (const CSVWorld::DragRecordTa } CSVWorld::DragRecordTable::DragRecordTable (CSMDoc::Document& document, QWidget* parent) : -mDocument(document), QTableView(parent), +mDocument(document), mEditLock(false) {} diff --git a/apps/opencs/view/world/genericcreator.cpp b/apps/opencs/view/world/genericcreator.cpp index 4269679bf..a123e127f 100644 --- a/apps/opencs/view/world/genericcreator.cpp +++ b/apps/opencs/view/world/genericcreator.cpp @@ -129,9 +129,9 @@ void CSVWorld::GenericCreator::addScope (const QString& name, CSMWorld::Scope sc CSVWorld::GenericCreator::GenericCreator (CSMWorld::Data& data, QUndoStack& undoStack, const CSMWorld::UniversalId& id, bool relaxedIdRules) -: mData (data), mUndoStack (undoStack), mListId (id), mLocked (false), mCloneMode (false), +: mData (data), mUndoStack (undoStack), mListId (id), mLocked (false), mClonedType (CSMWorld::UniversalId::Type_None), mScopes (CSMWorld::Scope_Content), mScope (0), - mScopeLabel (0) + mScopeLabel (0), mCloneMode (false) { mLayout = new QHBoxLayout; mLayout->setContentsMargins (0, 0, 0, 0); diff --git a/apps/opencs/view/world/scenesubview.cpp b/apps/opencs/view/world/scenesubview.cpp index 3fdf2f6e5..aa2161259 100644 --- a/apps/opencs/view/world/scenesubview.cpp +++ b/apps/opencs/view/world/scenesubview.cpp @@ -27,7 +27,7 @@ #include "creator.hpp" CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document) -: SubView (id), mLayout(new QHBoxLayout), mDocument(document), mScene(NULL), mToolbar(NULL) +: SubView (id), mScene(NULL), mLayout(new QHBoxLayout), mDocument(document), mToolbar(NULL) { QVBoxLayout *layout = new QVBoxLayout; diff --git a/apps/opencs/view/world/scriptedit.cpp b/apps/opencs/view/world/scriptedit.cpp index 2e05fa110..2f0d82ae1 100644 --- a/apps/opencs/view/world/scriptedit.cpp +++ b/apps/opencs/view/world/scriptedit.cpp @@ -42,13 +42,14 @@ bool CSVWorld::ScriptEdit::event (QEvent *event) CSVWorld::ScriptEdit::ScriptEdit (const CSMDoc::Document& document, ScriptHighlighter::Mode mode, QWidget* parent) : QPlainTextEdit (parent), - mDocument (document), - mWhiteListQoutes("^[a-z|_]{1}[a-z|0-9|_]{0,}$", Qt::CaseInsensitive), mChangeLocked (0), - mLineNumberArea(0), mShowLineNum(false), + mLineNumberArea(0), mDefaultFont(font()), - mMonoFont(QFont("Monospace")) + mMonoFont(QFont("Monospace")), + mDocument (document), + mWhiteListQoutes("^[a-z|_]{1}[a-z|0-9|_]{0,}$", Qt::CaseInsensitive) + { // setAcceptRichText (false); setLineWrapMode (QPlainTextEdit::NoWrap); diff --git a/apps/opencs/view/world/table.cpp b/apps/opencs/view/world/table.cpp index 86daf8af7..b8972edbe 100644 --- a/apps/opencs/view/world/table.cpp +++ b/apps/opencs/view/world/table.cpp @@ -253,8 +253,8 @@ void CSVWorld::Table::mouseDoubleClickEvent (QMouseEvent *event) CSVWorld::Table::Table (const CSMWorld::UniversalId& id, bool createAndDelete, bool sorting, CSMDoc::Document& document) -: mCreateAction (0), mCloneAction(0), mRecordStatusDisplay (0), - DragRecordTable(document) +: DragRecordTable(document), mCreateAction (0), + mCloneAction(0),mRecordStatusDisplay (0) { CSMSettings::UserSettings &settings = CSMSettings::UserSettings::instance(); QString jumpSetting = settings.settingValue ("table-input/jump-to-added"); diff --git a/apps/openmw/mwbase/environment.cpp b/apps/openmw/mwbase/environment.cpp index 3bc15746e..a90eec5bf 100644 --- a/apps/openmw/mwbase/environment.cpp +++ b/apps/openmw/mwbase/environment.cpp @@ -17,8 +17,8 @@ MWBase::Environment *MWBase::Environment::sThis = 0; MWBase::Environment::Environment() : mWorld (0), mSoundManager (0), mScriptManager (0), mWindowManager (0), - mMechanicsManager (0), mDialogueManager (0), mJournal (0), mInputManager (0), mFrameDuration (0), - mStateManager (0) + mMechanicsManager (0), mDialogueManager (0), mJournal (0), mInputManager (0), mStateManager (0), + mFrameDuration (0) { assert (!sThis); sThis = this; diff --git a/apps/openmw/mwdialogue/dialoguemanagerimp.cpp b/apps/openmw/mwdialogue/dialoguemanagerimp.cpp index 0b9fd65d2..1785575fc 100644 --- a/apps/openmw/mwdialogue/dialoguemanagerimp.cpp +++ b/apps/openmw/mwdialogue/dialoguemanagerimp.cpp @@ -48,12 +48,15 @@ namespace MWDialogue { DialogueManager::DialogueManager (const Compiler::Extensions& extensions, bool scriptVerbose, Translation::Storage& translationDataStorage) : - mCompilerContext (MWScript::CompilerContext::Type_Dialogue), - mErrorStream(std::cout.rdbuf()),mErrorHandler(mErrorStream) - , mTemporaryDispositionChange(0.f) - , mPermanentDispositionChange(0.f), mScriptVerbose (scriptVerbose) - , mTranslationDataStorage(translationDataStorage) + mTranslationDataStorage(translationDataStorage) + , mCompilerContext (MWScript::CompilerContext::Type_Dialogue) + , mErrorStream(std::cout.rdbuf()) + , mErrorHandler(mErrorStream) , mTalkedTo(false) + , mTemporaryDispositionChange(0.f) + , mPermanentDispositionChange(0.f) + , mScriptVerbose (scriptVerbose) + { mChoice = -1; mIsInChoice = false; diff --git a/apps/openmw/mwgui/alchemywindow.cpp b/apps/openmw/mwgui/alchemywindow.cpp index b28e4de09..a54744370 100644 --- a/apps/openmw/mwgui/alchemywindow.cpp +++ b/apps/openmw/mwgui/alchemywindow.cpp @@ -26,10 +26,10 @@ namespace MWGui { AlchemyWindow::AlchemyWindow() : WindowBase("openmw_alchemy_window.layout") - , mApparatus (4) - , mIngredients (4) , mSortModel(NULL) , mAlchemy(new MWMechanics::Alchemy()) + , mApparatus (4) + , mIngredients (4) { getWidget(mCreateButton, "CreateButton"); getWidget(mCancelButton, "CancelButton"); diff --git a/apps/openmw/mwgui/bookpage.cpp b/apps/openmw/mwgui/bookpage.cpp index 962e594ae..cfb49ebff 100644 --- a/apps/openmw/mwgui/bookpage.cpp +++ b/apps/openmw/mwgui/bookpage.cpp @@ -228,8 +228,8 @@ struct TypesetBookImpl::Typesetter : BookTypesetter Typesetter (size_t width, size_t height) : mPageWidth (width), mPageHeight(height), mSection (NULL), mLine (NULL), mRun (NULL), - mCurrentAlignment (AlignLeft), - mCurrentContent (NULL) + mCurrentContent (NULL), + mCurrentAlignment (AlignLeft) { mBook = boost::make_shared (); } @@ -697,10 +697,10 @@ namespace GlyphStream (MyGUI::IFont* font, float left, float top, float Z, MyGUI::Vertex* vertices, RenderXform const & renderXform) : - mZ(Z), mOrigin (left, top), - mFont (font), mVertices (vertices), - mRenderXform (renderXform), - mC(0) + mZ(Z), + mC(0), mFont (font), mOrigin (left, top), + mVertices (vertices), + mRenderXform (renderXform) { mVertexColourType = MyGUI::RenderManager::getInstance().getVertexFormat(); } @@ -801,10 +801,10 @@ protected: TextFormat (MyGUI::IFont* id, PageDisplay * display) : mFont (id), + mCountVertex (0), mTexture (NULL), mRenderItem (NULL), - mDisplay (display), - mCountVertex (0) + mDisplay (display) { } diff --git a/apps/openmw/mwgui/bookwindow.cpp b/apps/openmw/mwgui/bookwindow.cpp index 55a9b6191..6863994b8 100644 --- a/apps/openmw/mwgui/bookwindow.cpp +++ b/apps/openmw/mwgui/bookwindow.cpp @@ -18,9 +18,9 @@ namespace MWGui BookWindow::BookWindow () : WindowBase("openmw_book.layout") + , mCurrentPage(0) , mTakeButtonShow(true) , mTakeButtonAllowed(true) - , mCurrentPage(0) { getWidget(mCloseButton, "CloseButton"); mCloseButton->eventMouseButtonClick += MyGUI::newDelegate(this, &BookWindow::onCloseButtonClicked); diff --git a/apps/openmw/mwgui/companionwindow.cpp b/apps/openmw/mwgui/companionwindow.cpp index fe47437ca..4433f9ef8 100644 --- a/apps/openmw/mwgui/companionwindow.cpp +++ b/apps/openmw/mwgui/companionwindow.cpp @@ -37,11 +37,11 @@ namespace MWGui CompanionWindow::CompanionWindow(DragAndDrop *dragAndDrop, MessageBoxManager* manager) : WindowBase("openmw_companion_window.layout") + , mSortModel(NULL) + , mModel(NULL) + , mSelectedItem(-1) , mDragAndDrop(dragAndDrop) , mMessageBoxManager(manager) - , mSelectedItem(-1) - , mModel(NULL) - , mSortModel(NULL) { getWidget(mCloseButton, "CloseButton"); getWidget(mProfitLabel, "ProfitLabel"); diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index 579730f42..1317e1e25 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -33,10 +33,10 @@ namespace MWGui ContainerWindow::ContainerWindow(DragAndDrop* dragAndDrop) : WindowBase("openmw_container_window.layout") , mDragAndDrop(dragAndDrop) - , mSelectedItem(-1) - , mModel(NULL) - , mSortModel(NULL) , mPickpocketDetected(false) + , mSortModel(NULL) + , mModel(NULL) + , mSelectedItem(-1) { getWidget(mDisposeCorpseButton, "DisposeCorpseButton"); getWidget(mTakeButton, "TakeButton"); diff --git a/apps/openmw/mwgui/dialogue.cpp b/apps/openmw/mwgui/dialogue.cpp index 1b07522f3..692cea952 100644 --- a/apps/openmw/mwgui/dialogue.cpp +++ b/apps/openmw/mwgui/dialogue.cpp @@ -248,10 +248,10 @@ namespace MWGui DialogueWindow::DialogueWindow() : WindowBase("openmw_dialogue_window.layout") - , mPersuasionDialog() - , mEnabled(false) , mServices(0) + , mEnabled(false) , mGoodbye(false) + , mPersuasionDialog() { // Centre dialog center(); diff --git a/apps/openmw/mwgui/draganddrop.cpp b/apps/openmw/mwgui/draganddrop.cpp index fcb381b95..55aeb969c 100644 --- a/apps/openmw/mwgui/draganddrop.cpp +++ b/apps/openmw/mwgui/draganddrop.cpp @@ -20,12 +20,12 @@ namespace MWGui DragAndDrop::DragAndDrop() - : mDraggedWidget(NULL) - , mDraggedCount(0) + : mIsOnDragAndDrop(false) + , mDraggedWidget(NULL) , mSourceModel(NULL) , mSourceView(NULL) , mSourceSortModel(NULL) - , mIsOnDragAndDrop(false) + , mDraggedCount(0) { } diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index 9aa8a8ea1..af24f3f79 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -50,17 +50,17 @@ namespace MWGui InventoryWindow::InventoryWindow(DragAndDrop* dragAndDrop) : WindowPinnableBase("openmw_inventory_window.layout") - , mTrading(false) + , mDragAndDrop(dragAndDrop) + , mPreviewDirty(true) + , mPreviewResize(true) + , mSelectedItem(-1) + , mSortModel(NULL) + , mTradeModel(NULL) + , mGuiMode(GM_Inventory) , mLastXSize(0) , mLastYSize(0) , mPreview(new MWRender::InventoryPreview(MWBase::Environment::get().getWorld ()->getPlayerPtr())) - , mPreviewDirty(true) - , mPreviewResize(true) - , mDragAndDrop(dragAndDrop) - , mSortModel(NULL) - , mTradeModel(NULL) - , mSelectedItem(-1) - , mGuiMode(GM_Inventory) + , mTrading(false) { mMainWidget->castType()->eventWindowChangeCoord += MyGUI::newDelegate(this, &InventoryWindow::onWindowResize); diff --git a/apps/openmw/mwgui/itemmodel.cpp b/apps/openmw/mwgui/itemmodel.cpp index 8224fd55b..9fce6e84d 100644 --- a/apps/openmw/mwgui/itemmodel.cpp +++ b/apps/openmw/mwgui/itemmodel.cpp @@ -14,10 +14,10 @@ namespace MWGui { ItemStack::ItemStack(const MWWorld::Ptr &base, ItemModel *creator, size_t count) - : mCreator(creator) - , mCount(count) + : mType(Type_Normal) , mFlags(0) - , mType(Type_Normal) + , mCreator(creator) + , mCount(count) , mBase(base) { if (base.getClass().getEnchantment(base) != "") @@ -59,10 +59,10 @@ namespace MWGui } ItemStack::ItemStack() - : mCreator(NULL) - , mCount(0) + : mType(Type_Normal) , mFlags(0) - , mType(Type_Normal) + , mCreator(NULL) + , mCount(0) { } diff --git a/apps/openmw/mwgui/jailscreen.cpp b/apps/openmw/mwgui/jailscreen.cpp index 5c0a6ec5f..936da2d8e 100644 --- a/apps/openmw/mwgui/jailscreen.cpp +++ b/apps/openmw/mwgui/jailscreen.cpp @@ -19,9 +19,9 @@ namespace MWGui { JailScreen::JailScreen() : WindowBase("openmw_jail_screen.layout"), - mTimeAdvancer(0.01f), mDays(1), - mFadeTimeRemaining(0) + mFadeTimeRemaining(0), + mTimeAdvancer(0.01f) { getWidget(mProgressBar, "ProgressBar"); diff --git a/apps/openmw/mwgui/journalbooks.cpp b/apps/openmw/mwgui/journalbooks.cpp index 34a852562..f84fb517b 100644 --- a/apps/openmw/mwgui/journalbooks.cpp +++ b/apps/openmw/mwgui/journalbooks.cpp @@ -68,8 +68,8 @@ namespace AddJournalEntry (MWGui::BookTypesetter::Ptr typesetter, MWGui::BookTypesetter::Style* body_style, MWGui::BookTypesetter::Style* header_style, bool add_header) : AddEntry (typesetter, body_style), - mHeaderStyle (header_style), - mAddHeader (add_header) + mAddHeader (add_header), + mHeaderStyle (header_style) { } @@ -94,7 +94,7 @@ namespace AddTopicEntry (MWGui::BookTypesetter::Ptr typesetter, MWGui::BookTypesetter::Style* body_style, MWGui::BookTypesetter::Style* header_style, intptr_t contentId) : - AddEntry (typesetter, body_style), mHeaderStyle (header_style), mContentId (contentId) + AddEntry (typesetter, body_style), mContentId (contentId), mHeaderStyle (header_style) { } diff --git a/apps/openmw/mwgui/journalviewmodel.cpp b/apps/openmw/mwgui/journalviewmodel.cpp index 9a47070c2..d05257e46 100644 --- a/apps/openmw/mwgui/journalviewmodel.cpp +++ b/apps/openmw/mwgui/journalviewmodel.cpp @@ -92,7 +92,7 @@ struct JournalViewModelImpl : JournalViewModel JournalViewModelImpl const * mModel; BaseEntry (JournalViewModelImpl const * model, iterator_t itr) : - mModel (model), itr (itr), loaded (false) + itr (itr), mModel (model), loaded (false) {} virtual ~BaseEntry () {} diff --git a/apps/openmw/mwgui/loadingscreen.cpp b/apps/openmw/mwgui/loadingscreen.cpp index 3204c6548..db7b32018 100644 --- a/apps/openmw/mwgui/loadingscreen.cpp +++ b/apps/openmw/mwgui/loadingscreen.cpp @@ -32,11 +32,11 @@ namespace MWGui { LoadingScreen::LoadingScreen(Ogre::SceneManager* sceneMgr, Ogre::RenderWindow* rw) - : mSceneMgr(sceneMgr) + : WindowBase("openmw_loading_screen.layout") + , mSceneMgr(sceneMgr) , mWindow(rw) - , WindowBase("openmw_loading_screen.layout") - , mLastRenderTime(0) , mLastWallpaperChangeTime(0) + , mLastRenderTime(0) , mProgress(0) , mVSyncWasEnabled(false) { diff --git a/apps/openmw/mwgui/mapwindow.cpp b/apps/openmw/mwgui/mapwindow.cpp index 9adfeffe8..c59432796 100644 --- a/apps/openmw/mwgui/mapwindow.cpp +++ b/apps/openmw/mwgui/mapwindow.cpp @@ -144,16 +144,16 @@ namespace MWGui : mCurX(0) , mCurY(0) , mInterior(false) - , mFogOfWar(true) , mLocalMap(NULL) + , mCompass(NULL) , mPrefix() , mChanged(true) + , mFogOfWar(true) + , mMapWidgetSize(0) + , mCustomMarkers(markers) + , mMarkerUpdateTimer(0.0f) , mLastDirectionX(0.0f) , mLastDirectionY(0.0f) - , mCompass(NULL) - , mMarkerUpdateTimer(0.0f) - , mCustomMarkers(markers) - , mMapWidgetSize(0) { mCustomMarkers.eventMarkersChanged += MyGUI::newDelegate(this, &LocalMapBase::updateCustomMarkers); } @@ -550,16 +550,16 @@ namespace MWGui MapWindow::MapWindow(CustomMarkerCollection &customMarkers, DragAndDrop* drag, const std::string& cacheDir) : WindowPinnableBase("openmw_map_window.layout") - , NoDrop(drag, mMainWidget) , LocalMapBase(customMarkers) - , mGlobal(false) + , NoDrop(drag, mMainWidget) , mGlobalMap(0) - , mGlobalMapRender(0) - , mEditNoteDialog() - , mEventBoxGlobal(NULL) - , mEventBoxLocal(NULL) , mGlobalMapImage(NULL) , mGlobalMapOverlay(NULL) + , mGlobal(false) + , mEventBoxGlobal(NULL) + , mEventBoxLocal(NULL) + , mGlobalMapRender(0) + , mEditNoteDialog() { static bool registered = false; if (!registered) diff --git a/apps/openmw/mwgui/messagebox.cpp b/apps/openmw/mwgui/messagebox.cpp index b7c67e68b..6e81ed626 100644 --- a/apps/openmw/mwgui/messagebox.cpp +++ b/apps/openmw/mwgui/messagebox.cpp @@ -161,10 +161,10 @@ namespace MWGui MessageBox::MessageBox(MessageBoxManager& parMessageBoxManager, const std::string& message) : Layout("openmw_messagebox.layout") - , mMessageBoxManager(parMessageBoxManager) - , mMessage(message) , mCurrentTime(0) , mMaxTime(0) + , mMessageBoxManager(parMessageBoxManager) + , mMessage(message) { // defines mBottomPadding = 48; @@ -195,8 +195,8 @@ namespace MWGui InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxManager, const std::string& message, const std::vector& buttons) : WindowModal("openmw_interactive_messagebox.layout") , mMessageBoxManager(parMessageBoxManager) + , mTextButtonPadding(0) , mButtonPressed(-1) - , mTextButtonPadding(0) { WindowModal::open(); diff --git a/apps/openmw/mwgui/sortfilteritemmodel.cpp b/apps/openmw/mwgui/sortfilteritemmodel.cpp index 6c164df88..183ab07ff 100644 --- a/apps/openmw/mwgui/sortfilteritemmodel.cpp +++ b/apps/openmw/mwgui/sortfilteritemmodel.cpp @@ -70,9 +70,9 @@ namespace MWGui SortFilterItemModel::SortFilterItemModel(ItemModel *sourceModel) : mCategory(Category_All) + , mFilter(0) , mShowEquipped(true) , mSortByType(true) - , mFilter(0) { mSourceModel = sourceModel; } diff --git a/apps/openmw/mwgui/spellbuyingwindow.cpp b/apps/openmw/mwgui/spellbuyingwindow.cpp index 76a1d51e5..ae7b7588a 100644 --- a/apps/openmw/mwgui/spellbuyingwindow.cpp +++ b/apps/openmw/mwgui/spellbuyingwindow.cpp @@ -23,8 +23,8 @@ namespace MWGui SpellBuyingWindow::SpellBuyingWindow() : WindowBase("openmw_spell_buying_window.layout") - , mCurrentY(0) , mLastPos(0) + , mCurrentY(0) { setCoord(0, 0, 450, 300); diff --git a/apps/openmw/mwgui/spellcreationdialog.cpp b/apps/openmw/mwgui/spellcreationdialog.cpp index c744d3ed6..1c670838f 100644 --- a/apps/openmw/mwgui/spellcreationdialog.cpp +++ b/apps/openmw/mwgui/spellcreationdialog.cpp @@ -483,15 +483,15 @@ namespace MWGui EffectEditorBase::EffectEditorBase(Type type) - : mAddEffectDialog() - , mAvailableEffectsList(NULL) + : mAvailableEffectsList(NULL) , mUsedEffectsView(NULL) + , mAddEffectDialog() , mSelectAttributeDialog(NULL) , mSelectSkillDialog(NULL) , mSelectedEffect(0) , mSelectedKnownEffectId(0) - , mType(type) , mConstantEffect(false) + , mType(type) { mAddEffectDialog.eventEffectAdded += MyGUI::newDelegate(this, &EffectEditorBase::onEffectAdded); mAddEffectDialog.eventEffectModified += MyGUI::newDelegate(this, &EffectEditorBase::onEffectModified); diff --git a/apps/openmw/mwgui/tooltips.cpp b/apps/openmw/mwgui/tooltips.cpp index 4e83c25db..34896c0bd 100644 --- a/apps/openmw/mwgui/tooltips.cpp +++ b/apps/openmw/mwgui/tooltips.cpp @@ -30,15 +30,15 @@ namespace MWGui ToolTips::ToolTips() : Layout("openmw_tooltips.layout") - , mFullHelp(false) - , mEnabled(true) , mFocusToolTipX(0.0) , mFocusToolTipY(0.0) + , mHorizontalScrollIndex(0) , mDelay(0.0) , mRemainingDelay(0.0) , mLastMouseX(0) , mLastMouseY(0) - , mHorizontalScrollIndex(0) + , mEnabled(true) + , mFullHelp(false) { getWidget(mDynamicToolTipBox, "DynamicToolTipBox"); diff --git a/apps/openmw/mwgui/waitdialog.cpp b/apps/openmw/mwgui/waitdialog.cpp index 28e3be591..ed261e7eb 100644 --- a/apps/openmw/mwgui/waitdialog.cpp +++ b/apps/openmw/mwgui/waitdialog.cpp @@ -50,13 +50,13 @@ namespace MWGui WaitDialog::WaitDialog() : WindowBase("openmw_wait_dialog.layout") - , mProgressBar() , mTimeAdvancer(0.05f) , mSleeping(false) , mHours(1) , mManualHours(1) , mFadeTimeRemaining(0) , mInterruptAt(-1) + , mProgressBar() { getWidget(mDateTimeText, "DateTimeText"); getWidget(mRestText, "RestText"); diff --git a/apps/openmw/mwgui/windowbase.cpp b/apps/openmw/mwgui/windowbase.cpp index 8fdcf6b20..899f8a5e8 100644 --- a/apps/openmw/mwgui/windowbase.cpp +++ b/apps/openmw/mwgui/windowbase.cpp @@ -78,7 +78,7 @@ void WindowModal::close() } NoDrop::NoDrop(DragAndDrop *drag, MyGUI::Widget *widget) - : mDrag(drag), mWidget(widget), mTransparent(false) + : mWidget(widget), mDrag(drag), mTransparent(false) { if (!mWidget) throw std::runtime_error("NoDrop needs a non-NULL widget!"); diff --git a/apps/openmw/mwmechanics/aiavoiddoor.cpp b/apps/openmw/mwmechanics/aiavoiddoor.cpp index a73d955c5..fccace55c 100644 --- a/apps/openmw/mwmechanics/aiavoiddoor.cpp +++ b/apps/openmw/mwmechanics/aiavoiddoor.cpp @@ -13,7 +13,7 @@ #include "steering.hpp" MWMechanics::AiAvoidDoor::AiAvoidDoor(const MWWorld::Ptr& doorPtr) -: AiPackage(), mDoorPtr(doorPtr), mDuration(1), mAdjAngle(0) +: AiPackage(), mDuration(1), mDoorPtr(doorPtr), mAdjAngle(0) { } diff --git a/apps/openmw/mwmechanics/aicombat.cpp b/apps/openmw/mwmechanics/aicombat.cpp index 2f68087e5..649f259d9 100644 --- a/apps/openmw/mwmechanics/aicombat.cpp +++ b/apps/openmw/mwmechanics/aicombat.cpp @@ -111,17 +111,17 @@ namespace MWMechanics mTimerAttack(0), mTimerReact(0), mTimerCombatMove(0), + mReadyToAttack(false), mAttack(false), mFollowTarget(false), mCombatMove(false), - mReadyToAttack(false), - mForceNoShortcut(false), + mLastTargetPos(0,0,0), mCell(NULL), mCurrentAction(), mActionCooldown(0), mStrength(), mMinMaxAttackDurationInitialised(false), - mLastTargetPos(0,0,0), + mForceNoShortcut(false), mLastActorPos(0,0,0), mMovement(){} }; diff --git a/apps/openmw/mwmechanics/aiescort.cpp b/apps/openmw/mwmechanics/aiescort.cpp index 91bf7c9b0..f9ebefe13 100644 --- a/apps/openmw/mwmechanics/aiescort.cpp +++ b/apps/openmw/mwmechanics/aiescort.cpp @@ -49,12 +49,11 @@ namespace MWMechanics } AiEscort::AiEscort(const ESM::AiSequence::AiEscort *escort) - : mActorId(escort->mTargetId), mX(escort->mData.mX), mY(escort->mData.mY), mZ(escort->mData.mZ) + : mActorId(escort->mTargetId), mCellId(escort->mCellId), mX(escort->mData.mX), mY(escort->mData.mY), mZ(escort->mData.mZ) + , mMaxDist(450) + , mRemainingDuration(escort->mRemainingDuration) , mCellX(std::numeric_limits::max()) , mCellY(std::numeric_limits::max()) - , mCellId(escort->mCellId) - , mRemainingDuration(escort->mRemainingDuration) - , mMaxDist(450) { } diff --git a/apps/openmw/mwmechanics/aifollow.cpp b/apps/openmw/mwmechanics/aifollow.cpp index 161f4bb90..ddfc14581 100644 --- a/apps/openmw/mwmechanics/aifollow.cpp +++ b/apps/openmw/mwmechanics/aifollow.cpp @@ -32,27 +32,27 @@ int AiFollow::mFollowIndexCounter = 0; AiFollow::AiFollow(const std::string &actorId,float duration, float x, float y, float z) : mAlwaysFollow(false), mCommanded(false), mRemainingDuration(duration), mX(x), mY(y), mZ(z) -, mActorRefId(actorId), mCellId(""), mActorId(-1), mFollowIndex(mFollowIndexCounter++), mActive(false) +, mActorRefId(actorId), mActorId(-1), mCellId(""), mActive(false), mFollowIndex(mFollowIndexCounter++) { } AiFollow::AiFollow(const std::string &actorId,const std::string &cellId,float duration, float x, float y, float z) : mAlwaysFollow(false), mCommanded(false), mRemainingDuration(duration), mX(x), mY(y), mZ(z) -, mActorRefId(actorId), mCellId(cellId), mActorId(-1), mFollowIndex(mFollowIndexCounter++), mActive(false) +, mActorRefId(actorId), mActorId(-1), mCellId(cellId), mActive(false), mFollowIndex(mFollowIndexCounter++) { } AiFollow::AiFollow(const std::string &actorId, bool commanded) : mAlwaysFollow(true), mCommanded(commanded), mRemainingDuration(0), mX(0), mY(0), mZ(0) -, mActorRefId(actorId), mCellId(""), mActorId(-1), mFollowIndex(mFollowIndexCounter++), mActive(false) +, mActorRefId(actorId), mActorId(-1), mCellId(""), mActive(false), mFollowIndex(mFollowIndexCounter++) { } AiFollow::AiFollow(const ESM::AiSequence::AiFollow *follow) - : mAlwaysFollow(follow->mAlwaysFollow), mRemainingDuration(follow->mRemainingDuration) + : mAlwaysFollow(follow->mAlwaysFollow), mCommanded(follow->mCommanded), mRemainingDuration(follow->mRemainingDuration) , mX(follow->mData.mX), mY(follow->mData.mY), mZ(follow->mData.mZ) - , mActorRefId(follow->mTargetId), mActorId(-1), mCellId(follow->mCellId) - , mCommanded(follow->mCommanded), mFollowIndex(mFollowIndexCounter++), mActive(follow->mActive) + , mActorRefId(follow->mTargetId), mActorId(-1) + , mCellId(follow->mCellId), mActive(follow->mActive), mFollowIndex(mFollowIndexCounter++) { } diff --git a/apps/openmw/mwmechanics/aiwander.cpp b/apps/openmw/mwmechanics/aiwander.cpp index 560e756ce..076636974 100644 --- a/apps/openmw/mwmechanics/aiwander.cpp +++ b/apps/openmw/mwmechanics/aiwander.cpp @@ -786,10 +786,10 @@ namespace MWMechanics AiWander::AiWander (const ESM::AiSequence::AiWander* wander) : mDistance(wander->mData.mDistance) , mDuration(wander->mData.mDuration) - , mStartTime(MWWorld::TimeStamp(wander->mStartTime)) , mTimeOfDay(wander->mData.mTimeOfDay) , mRepeat(wander->mData.mShouldRepeat != 0) , mStoredInitialActorPosition(wander->mStoredInitialActorPosition) + , mStartTime(MWWorld::TimeStamp(wander->mStartTime)) { if (mStoredInitialActorPosition) mInitialActorPosition = wander->mInitialActorPosition; diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index ffde59aee..399b51151 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -642,8 +642,8 @@ CharacterController::CharacterController(const MWWorld::Ptr &ptr, MWRender::Anim , mJumpState(JumpState_None) , mWeaponType(WeapType_None) , mSkipAnim(false) - , mSecondsOfRunning(0) , mSecondsOfSwimming(0) + , mSecondsOfRunning(0) , mTurnAnimationThreshold(0) { if(!mAnimation) diff --git a/apps/openmw/mwmechanics/creaturestats.cpp b/apps/openmw/mwmechanics/creaturestats.cpp index 4c338e23f..308e72027 100644 --- a/apps/openmw/mwmechanics/creaturestats.cpp +++ b/apps/openmw/mwmechanics/creaturestats.cpp @@ -15,16 +15,12 @@ namespace MWMechanics int CreatureStats::sActorId = 0; CreatureStats::CreatureStats() - : mLevel (0), mDead (false), mDied (false), mMurdered(false), mFriendlyHits (0), - mTalkedTo (false), mAlarmed (false), - mAttacked (false), - mAttackingOrSpell(false), - mIsWerewolf(false), - mFallHeight(0), mRecalcMagicka(false), mKnockdown(false), mKnockdownOneFrame(false), - mKnockdownOverOneFrame(false), mHitRecovery(false), mBlock(false), - mMovementFlags(0), mDrawState (DrawState_Nothing), mAttackStrength(0.f), - mLastRestock(0,0), mGoldPool(0), mActorId(-1), - mDeathAnimation(0) + : mDrawState (DrawState_Nothing), mDead (false), mDied (false), mMurdered(false), mFriendlyHits (0), + mTalkedTo (false), mAlarmed (false), mAttacked (false), mAttackingOrSpell(false), + mKnockdown(false), mKnockdownOneFrame(false), mKnockdownOverOneFrame(false), + mHitRecovery(false), mBlock(false), mMovementFlags(0), mAttackStrength(0.f), + mFallHeight(0), mRecalcMagicka(false), mLastRestock(0,0), mGoldPool(0), mActorId(-1), + mDeathAnimation(0), mIsWerewolf(false), mLevel (0) { for (int i=0; i<4; ++i) mAiSettings[i] = 0; diff --git a/apps/openmw/mwmechanics/npcstats.cpp b/apps/openmw/mwmechanics/npcstats.cpp index 7f468f6d4..94819e626 100644 --- a/apps/openmw/mwmechanics/npcstats.cpp +++ b/apps/openmw/mwmechanics/npcstats.cpp @@ -25,12 +25,12 @@ #include "../mwbase/soundmanager.hpp" MWMechanics::NpcStats::NpcStats() - : mBounty (0) -, mLevelProgress(0) -, mDisposition(0) + : mDisposition (0) , mReputation(0) , mCrimeId(-1) +, mBounty(0) , mWerewolfKills (0) +, mLevelProgress(0) , mTimeToStartDrowning(20.0) { mSkillIncreases.resize (ESM::Attribute::Length, 0); diff --git a/apps/openmw/mwmechanics/obstacle.cpp b/apps/openmw/mwmechanics/obstacle.cpp index 6bf81e861..7cfa6fcd5 100644 --- a/apps/openmw/mwmechanics/obstacle.cpp +++ b/apps/openmw/mwmechanics/obstacle.cpp @@ -63,10 +63,10 @@ namespace MWMechanics ObstacleCheck::ObstacleCheck(): mPrevX(0) // to see if the moved since last time , mPrevY(0) - , mDistSameSpot(-1) // avoid calculating it each time , mWalkState(State_Norm) , mStuckDuration(0) , mEvadeDuration(0) + , mDistSameSpot(-1) // avoid calculating it each time { } diff --git a/apps/openmw/mwmechanics/pathgrid.cpp b/apps/openmw/mwmechanics/pathgrid.cpp index c1e094bb1..4e9bc8904 100644 --- a/apps/openmw/mwmechanics/pathgrid.cpp +++ b/apps/openmw/mwmechanics/pathgrid.cpp @@ -51,12 +51,12 @@ namespace MWMechanics { PathgridGraph::PathgridGraph() : mCell(NULL) - , mIsGraphConstructed(false) , mPathgrid(NULL) + , mIsExterior(0) , mGraph(0) + , mIsGraphConstructed(false) , mSCCId(0) , mSCCIndex(0) - , mIsExterior(0) { } diff --git a/apps/openmw/mwrender/globalmap.cpp b/apps/openmw/mwrender/globalmap.cpp index 95d4429d6..90cf27049 100644 --- a/apps/openmw/mwrender/globalmap.cpp +++ b/apps/openmw/mwrender/globalmap.cpp @@ -25,10 +25,11 @@ namespace MWRender GlobalMap::GlobalMap(const std::string &cacheDir) : mCacheDir(cacheDir) - , mMinX(0), mMaxX(0) - , mMinY(0), mMaxY(0) , mWidth(0) , mHeight(0) + , mMinX(0), mMaxX(0) + , mMinY(0), mMaxY(0) + { mCellSize = Settings::Manager::getInt("global map cell size", "Map"); } diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index a16b156ae..f2175ced5 100644 --- a/apps/openmw/mwrender/water.cpp +++ b/apps/openmw/mwrender/water.cpp @@ -186,10 +186,10 @@ void PlaneReflection::setVisibilityMask (int flags) Water::Water (Ogre::Camera *camera, RenderingManager* rend, const MWWorld::Fallback* fallback) : mCamera (camera), mSceneMgr (camera->getSceneManager()), - mIsUnderwater(false), mVisibilityFlags(0), - mActive(1), mToggled(1), + mIsUnderwater(false), mActive(1), + mToggled(1), mWaterTimer(0.f), mRendering(rend), - mWaterTimer(0.f), + mVisibilityFlags(0), mReflection(NULL), mRefraction(NULL), mSimulation(NULL), diff --git a/apps/openmw/mwsound/soundmanagerimp.cpp b/apps/openmw/mwsound/soundmanagerimp.cpp index 06c40dd8e..c7fb9ea50 100644 --- a/apps/openmw/mwsound/soundmanagerimp.cpp +++ b/apps/openmw/mwsound/soundmanagerimp.cpp @@ -33,13 +33,13 @@ namespace MWSound , mMasterVolume(1.0f) , mSFXVolume(1.0f) , mMusicVolume(1.0f) - , mFootstepsVolume(1.0f) , mVoiceVolume(1.0f) - , mPausedSoundTypes(0) + , mFootstepsVolume(1.0f) + , mListenerUnderwater(false) , mListenerPos(0,0,0) , mListenerDir(1,0,0) , mListenerUp(0,0,1) - , mListenerUnderwater(false) + , mPausedSoundTypes(0) { if(!useSound) return; diff --git a/apps/openmw/mwworld/action.cpp b/apps/openmw/mwworld/action.cpp index 1c360fd4d..5e1fb41a6 100644 --- a/apps/openmw/mwworld/action.cpp +++ b/apps/openmw/mwworld/action.cpp @@ -11,7 +11,7 @@ const MWWorld::Ptr& MWWorld::Action::getTarget() const return mTarget; } -MWWorld::Action::Action (bool keepSound, const Ptr& target) : mKeepSound (keepSound), mTarget (target), mSoundOffset(0) +MWWorld::Action::Action (bool keepSound, const Ptr& target) : mKeepSound (keepSound), mSoundOffset(0), mTarget (target) {} MWWorld::Action::~Action() {} diff --git a/apps/openmw/mwworld/esmloader.cpp b/apps/openmw/mwworld/esmloader.cpp index 13a786d00..b12d646e7 100644 --- a/apps/openmw/mwworld/esmloader.cpp +++ b/apps/openmw/mwworld/esmloader.cpp @@ -9,8 +9,8 @@ namespace MWWorld EsmLoader::EsmLoader(MWWorld::ESMStore& store, std::vector& readers, ToUTF8::Utf8Encoder* encoder, Loading::Listener& listener) : ContentLoader(listener) - , mStore(store) , mEsm(readers) + , mStore(store) , mEncoder(encoder) { } diff --git a/apps/openmw/mwworld/inventorystore.cpp b/apps/openmw/mwworld/inventorystore.cpp index 2de3abc75..a2e445d58 100644 --- a/apps/openmw/mwworld/inventorystore.cpp +++ b/apps/openmw/mwworld/inventorystore.cpp @@ -96,10 +96,10 @@ void MWWorld::InventoryStore::readEquipmentState(const MWWorld::ContainerStoreIt } MWWorld::InventoryStore::InventoryStore() - : mSelectedEnchantItem(end()) + : mListener(NULL) , mUpdatesEnabled (true) , mFirstAutoEquip(true) - , mListener(NULL) + , mSelectedEnchantItem(end()) , mRechargingItemsUpToDate(false) { initSlots (mSlots); @@ -107,12 +107,12 @@ MWWorld::InventoryStore::InventoryStore() MWWorld::InventoryStore::InventoryStore (const InventoryStore& store) : ContainerStore (store) - , mSelectedEnchantItem(end()) , mMagicEffects(store.mMagicEffects) - , mFirstAutoEquip(store.mFirstAutoEquip) , mListener(store.mListener) , mUpdatesEnabled(store.mUpdatesEnabled) + , mFirstAutoEquip(store.mFirstAutoEquip) , mPermanentMagicEffectMagnitudes(store.mPermanentMagicEffectMagnitudes) + , mSelectedEnchantItem(end()) , mRechargingItemsUpToDate(false) { copySlots (store); diff --git a/apps/openmw/mwworld/physicssystem.cpp b/apps/openmw/mwworld/physicssystem.cpp index d31ae520b..bec4c6db3 100644 --- a/apps/openmw/mwworld/physicssystem.cpp +++ b/apps/openmw/mwworld/physicssystem.cpp @@ -499,7 +499,7 @@ namespace MWWorld PhysicsSystem::PhysicsSystem(OEngine::Render::OgreRenderer &_rend) : - mRender(_rend), mEngine(0), mTimeAccum(0.0f), mWaterEnabled(false), mWaterHeight(0) + mRender(_rend), mEngine(0), mTimeAccum(0.0f), mWaterHeight(0), mWaterEnabled(false) { // Create physics. shapeLoader is deleted by the physic engine NifBullet::ManualBulletShapeLoader* shapeLoader = new NifBullet::ManualBulletShapeLoader(); diff --git a/apps/openmw/mwworld/player.cpp b/apps/openmw/mwworld/player.cpp index 58718074e..0b81532e1 100644 --- a/apps/openmw/mwworld/player.cpp +++ b/apps/openmw/mwworld/player.cpp @@ -32,10 +32,10 @@ namespace MWWorld Player::Player (const ESM::NPC *player, const MWBase::World& world) : mCellStore(0), mLastKnownExteriorPosition(0,0,0), + mMarkedCell(NULL), mAutoMove(false), mForwardBackward(0), mTeleported(false), - mMarkedCell(NULL), mCurrentCrimeId(-1), mPaidCrimeId(-1) { diff --git a/apps/openmw/mwworld/refdata.cpp b/apps/openmw/mwworld/refdata.cpp index 14a315a81..ae985f857 100644 --- a/apps/openmw/mwworld/refdata.cpp +++ b/apps/openmw/mwworld/refdata.cpp @@ -37,7 +37,7 @@ namespace MWWorld } RefData::RefData() - : mBaseNode(0), mHasLocals (false), mEnabled (true), mCount (1), mCustomData (0), mChanged(false), mDeleted(false) + : mBaseNode(0), mDeleted(false), mHasLocals (false), mEnabled (true), mCount (1), mCustomData (0), mChanged(false) { for (int i=0; i<3; ++i) { @@ -48,10 +48,10 @@ namespace MWWorld } RefData::RefData (const ESM::CellRef& cellRef) - : mBaseNode(0), mHasLocals (false), mEnabled (true), mCount (1), mPosition (cellRef.mPos), + : mBaseNode(0), mDeleted(false), mHasLocals (false), mEnabled (true), + mCount (1), mPosition (cellRef.mPos), mCustomData (0), - mChanged(false), // Loading from ESM/ESP files -> assume unchanged - mDeleted(false) + mChanged(false) // Loading from ESM/ESP files -> assume unchanged { mLocalRotation.rot[0]=0; mLocalRotation.rot[1]=0; @@ -59,10 +59,12 @@ namespace MWWorld } RefData::RefData (const ESM::ObjectState& objectState) - : mBaseNode (0), mHasLocals (false), mEnabled (objectState.mEnabled != 0), - mCount (objectState.mCount), mPosition (objectState.mPosition), mCustomData (0), - mChanged(true), // Loading from a savegame -> assume changed - mDeleted(false) + : mBaseNode (0), mDeleted(false), mHasLocals (false), + mEnabled (objectState.mEnabled != 0), + mCount (objectState.mCount), + mPosition (objectState.mPosition), + mCustomData (0), + mChanged(true) // Loading from a savegame -> assume changed { for (int i=0; i<3; ++i) mLocalRotation.rot[i] = objectState.mLocalRotation[i]; diff --git a/apps/openmw/mwworld/weather.cpp b/apps/openmw/mwworld/weather.cpp index a9ca8e72b..41ed7c20d 100644 --- a/apps/openmw/mwworld/weather.cpp +++ b/apps/openmw/mwworld/weather.cpp @@ -114,11 +114,10 @@ float WeatherManager::calculateAngleFade (const std::string& moonName, float ang } WeatherManager::WeatherManager(MWRender::RenderingManager* rendering,MWWorld::Fallback* fallback) : - mHour(14), mCurrentWeather("clear"), mNextWeather(""), mFirstUpdate(true), - mWeatherUpdateTime(0), mThunderFlash(0), mThunderChance(0), - mThunderChanceNeeded(50), mThunderSoundDelay(0), mRemainingTransitionTime(0), - mTimePassed(0), mFallback(fallback), mWindSpeed(0.f), mRendering(rendering), mIsStorm(false), - mStormDirection(0,1,0) + mHour(14), mWindSpeed(0.f), mIsStorm(false), mStormDirection(0,1,0), mFallback(fallback), + mRendering(rendering), mCurrentWeather("clear"), mNextWeather(""), mFirstUpdate(true), + mRemainingTransitionTime(0), mThunderFlash(0), mThunderChance(0), mThunderChanceNeeded(50), + mTimePassed(0), mWeatherUpdateTime(0), mThunderSoundDelay(0) { //Globals mThunderSoundID0 = mFallback->getFallbackString("Weather_Thunderstorm_Thunder_Sound_ID_0"); diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index bb0402c4e..b1bac2f4b 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -147,14 +147,12 @@ namespace MWWorld const boost::filesystem::path& resDir, const boost::filesystem::path& cacheDir, ToUTF8::Utf8Encoder* encoder, const std::map& fallbackMap, int activationDistanceOverride, const std::string& startCell, const std::string& startupScript) - : mPlayer (0), mLocalScripts (mStore), + : mFallback(fallbackMap), mPlayer (0), mLocalScripts (mStore), mSky (true), mCells (mStore, mEsm), - mActivationDistanceOverride (activationDistanceOverride), - mFallback(fallbackMap), mTeleportEnabled(true), mLevitationEnabled(true), - mGodMode(false), mContentFiles (contentFiles), - mGoToJail(false), mDaysInPrison(0), - mStartCell (startCell), mStartupScript(startupScript), - mScriptsEnabled(true) + mGodMode(false), mScriptsEnabled(true), mContentFiles (contentFiles), + mActivationDistanceOverride (activationDistanceOverride), mStartupScript(startupScript), + mStartCell (startCell), mTeleportEnabled(true), + mLevitationEnabled(true), mGoToJail(false), mDaysInPrison(0) { mPhysics = new PhysicsSystem(renderer); mPhysEngine = mPhysics->getEngine(); @@ -2939,7 +2937,7 @@ namespace MWWorld struct AddDetectedReference { AddDetectedReference(std::vector& out, Ptr detector, World::DetectionType type, float squaredDist) - : mOut(out), mDetector(detector), mType(type), mSquaredDist(squaredDist) + : mOut(out), mDetector(detector), mSquaredDist(squaredDist), mType(type) { } diff --git a/components/compiler/lineparser.cpp b/components/compiler/lineparser.cpp index 88b5f5ddb..a71672916 100644 --- a/components/compiler/lineparser.cpp +++ b/components/compiler/lineparser.cpp @@ -56,8 +56,8 @@ namespace Compiler LineParser::LineParser (ErrorHandler& errorHandler, const Context& context, Locals& locals, Literals& literals, std::vector& code, bool allowExpression) : Parser (errorHandler, context), mLocals (locals), mLiterals (literals), mCode (code), - mState (BeginState), mExprParser (errorHandler, context, locals, literals), - mAllowExpression (allowExpression), mButtons(0), mType(0), mReferenceMember(false) + mState (BeginState), mReferenceMember(false), mButtons(0), mType(0), + mExprParser (errorHandler, context, locals, literals), mAllowExpression (allowExpression) {} bool LineParser::parseInt (int value, const TokenLoc& loc, Scanner& scanner) diff --git a/components/interpreter/runtime.cpp b/components/interpreter/runtime.cpp index c71aef95c..dc3da07a8 100644 --- a/components/interpreter/runtime.cpp +++ b/components/interpreter/runtime.cpp @@ -7,7 +7,7 @@ namespace Interpreter { - Runtime::Runtime() : mContext (0), mCode (0), mPC (0), mCodeSize(0) {} + Runtime::Runtime() : mContext (0), mCode (0), mCodeSize(0), mPC (0) {} int Runtime::getPC() const { diff --git a/extern/ogre-ffmpeg-videoplayer/audiodecoder.cpp b/extern/ogre-ffmpeg-videoplayer/audiodecoder.cpp index 1a56802da..77e6b4b6c 100644 --- a/extern/ogre-ffmpeg-videoplayer/audiodecoder.cpp +++ b/extern/ogre-ffmpeg-videoplayer/audiodecoder.cpp @@ -60,21 +60,21 @@ struct AudioResampler MovieAudioDecoder::MovieAudioDecoder(VideoState* videoState) : mVideoState(videoState) , mAVStream(*videoState->audio_st) - , mFrame(av_frame_alloc()) + , mOutputSampleFormat(AV_SAMPLE_FMT_NONE) + , mOutputChannelLayout(0) + , mOutputSampleRate(0) , mFramePos(0) , mFrameSize(0) , mAudioClock(0.0) + , mDataBuf(NULL) + , mFrameData(NULL) + , mDataBufLen(0) + , mFrame(av_frame_alloc()) , mAudioDiffAccum(0.0) , mAudioDiffAvgCoef(exp(log(0.01 / AUDIO_DIFF_AVG_NB))) /* Correct audio only if larger error than this */ , mAudioDiffThreshold(2.0 * 0.050/* 50 ms */) , mAudioDiffAvgCount(0) - , mOutputSampleFormat(AV_SAMPLE_FMT_NONE) - , mOutputSampleRate(0) - , mOutputChannelLayout(0) - , mDataBuf(NULL) - , mFrameData(NULL) - , mDataBufLen(0) { mAudioResampler.reset(new AudioResampler()); } diff --git a/extern/ogre-ffmpeg-videoplayer/videostate.cpp b/extern/ogre-ffmpeg-videoplayer/videostate.cpp index 66c7c2ad5..877906f6d 100644 --- a/extern/ogre-ffmpeg-videoplayer/videostate.cpp +++ b/extern/ogre-ffmpeg-videoplayer/videostate.cpp @@ -59,16 +59,18 @@ namespace Video { VideoState::VideoState() - : format_ctx(NULL), av_sync_type(AV_SYNC_DEFAULT) + : mAudioFactory(NULL) + , format_ctx(NULL) + , av_sync_type(AV_SYNC_DEFAULT) , audio_st(NULL) , video_st(NULL), frame_last_pts(0.0) , video_clock(0.0), sws_context(NULL), rgbaFrame(NULL), pictq_size(0) , pictq_rindex(0), pictq_windex(0) - , mQuit(false), mPaused(false) - , mAudioFactory(NULL) , mSeekRequested(false) , mSeekPos(0) , mVideoEnded(false) + , mPaused(false) + , mQuit(false) { mFlushPktData = flush_pkt.data; diff --git a/extern/oics/ICSControl.cpp b/extern/oics/ICSControl.cpp index 974d69f08..1e9679d1f 100644 --- a/extern/oics/ICSControl.cpp +++ b/extern/oics/ICSControl.cpp @@ -32,9 +32,9 @@ namespace ICS { Control::Control(const std::string& name, bool autoChangeDirectionOnLimitsAfterStop, bool autoReverseToInitialValue , float initialValue, float stepSize, float stepsPerSeconds, bool axisBindable) - : mName(name) - , mValue(initialValue) + : mValue(initialValue) , mInitialValue(initialValue) + , mName(name) , mStepSize(stepSize) , mStepsPerSeconds(stepsPerSeconds) , mAutoReverseToInitialValue(autoReverseToInitialValue) diff --git a/extern/oics/ICSInputControlSystem.cpp b/extern/oics/ICSInputControlSystem.cpp index 2599c5761..a8aedfd2e 100644 --- a/extern/oics/ICSInputControlSystem.cpp +++ b/extern/oics/ICSInputControlSystem.cpp @@ -32,13 +32,13 @@ namespace ICS , DetectingBindingListener* detectingBindingListener , InputControlSystemLog* log, size_t channelCount) : mFileName(file) + , mLog(log) , mDetectingBindingListener(detectingBindingListener) , mDetectingBindingControl(NULL) - , mLog(log) - , mXmouseAxisBinded(false), mYmouseAxisBinded(false) - , mClientHeight(1) - , mClientWidth(1) , mDetectingBindingDirection(Control::STOP) + , mXmouseAxisBinded(false), mYmouseAxisBinded(false) + , mClientWidth(1) + , mClientHeight(1) { ICS_LOG(" - Creating InputControlSystem - "); @@ -539,10 +539,10 @@ namespace ICS } binder.SetAttribute( "direction", "DECREASE" ); control.InsertEndChild(binder); - } - JoystickIDList::const_iterator it = mJoystickIDList.begin(); - while(it!=mJoystickIDList.end()) - { + } + JoystickIDList::const_iterator it = mJoystickIDList.begin(); + while(it!=mJoystickIDList.end()) + { int deviceID = *it; if(getJoystickAxisBinding(*o, deviceID, Control/*::ControlChangingDirection*/::INCREASE) != /*NamedAxis::*/UNASSIGNED) @@ -552,8 +552,8 @@ namespace ICS binder.SetAttribute( "axis", ToString( getJoystickAxisBinding(*o, deviceID, Control/*::ControlChangingDirection*/::INCREASE)).c_str() ); - binder.SetAttribute( "direction", "INCREASE" ); - + binder.SetAttribute( "direction", "INCREASE" ); + binder.SetAttribute( "deviceId", deviceID ); //completely useless, but required for backwards compatability control.InsertEndChild(binder); @@ -567,8 +567,8 @@ namespace ICS binder.SetAttribute( "axis", ToString( getJoystickAxisBinding(*o, deviceID, Control/*::ControlChangingDirection*/::DECREASE)).c_str() ); - binder.SetAttribute( "direction", "DECREASE" ); - + binder.SetAttribute( "direction", "DECREASE" ); + binder.SetAttribute( "deviceId", deviceID ); //completely useless, but required for backwards compatability control.InsertEndChild(binder); @@ -582,8 +582,8 @@ namespace ICS binder.SetAttribute( "button", ToString( getJoystickButtonBinding(*o, deviceID, Control/*::ControlChangingDirection*/::INCREASE)).c_str() ); - binder.SetAttribute( "direction", "INCREASE" ); - + binder.SetAttribute( "direction", "INCREASE" ); + binder.SetAttribute( "deviceId", deviceID ); //completely useless, but required for backwards compatability control.InsertEndChild(binder); @@ -597,13 +597,13 @@ namespace ICS binder.SetAttribute( "button", ToString( getJoystickButtonBinding(*o, deviceID, Control/*::ControlChangingDirection*/::DECREASE)).c_str() ); - binder.SetAttribute( "direction", "DECREASE" ); - + binder.SetAttribute( "direction", "DECREASE" ); + binder.SetAttribute( "deviceId", deviceID ); //completely useless, but required for backwards compatability control.InsertEndChild(binder); - } - it++; + } + it++; } diff --git a/extern/sdl4ogre/sdlinputwrapper.cpp b/extern/sdl4ogre/sdlinputwrapper.cpp index aaf669ff4..7e3536ab4 100644 --- a/extern/sdl4ogre/sdlinputwrapper.cpp +++ b/extern/sdl4ogre/sdlinputwrapper.cpp @@ -10,28 +10,28 @@ namespace SFO /// \brief General purpose wrapper for OGRE applications around SDL's event /// queue, mostly used for handling input-related events. InputWrapper::InputWrapper(SDL_Window* window, Ogre::RenderWindow* ogreWindow, bool grab) : - mSDLWindow(window), - mOgreWindow(ogreWindow), - mWarpCompensate(false), - mMouseRelative(false), - mGrabPointer(false), - mWrapPointer(false), - mMouseZ(0), - mMouseY(0), - mMouseX(0), - mMouseInWindow(true), - mConListener(NULL), - mKeyboardListener(NULL), mMouseListener(NULL), + mKeyboardListener(NULL), mWindowListener(NULL), - mWindowHasFocus(true), - mWantGrab(false), - mWantRelative(false), - mWantMouseVisible(false), - mAllowGrab(grab), + mConListener(NULL), mWarpX(0), mWarpY(0), - mFirstMouseMove(true) + mWarpCompensate(false), + mWrapPointer(false), + mAllowGrab(grab), + mWantMouseVisible(false), + mWantGrab(false), + mWantRelative(false), + mGrabPointer(false), + mMouseRelative(false), + mFirstMouseMove(true), + mMouseZ(0), + mMouseX(0), + mMouseY(0), + mWindowHasFocus(true), + mMouseInWindow(true), + mSDLWindow(window), + mOgreWindow(ogreWindow) { _setupOISKeys(); } diff --git a/extern/shiny/Main/Factory.cpp b/extern/shiny/Main/Factory.cpp index d7c4234cb..d0b86cbf9 100644 --- a/extern/shiny/Main/Factory.cpp +++ b/extern/shiny/Main/Factory.cpp @@ -29,17 +29,17 @@ namespace sh } Factory::Factory (Platform* platform) - : mPlatform(platform) - , mShadersEnabled(true) + : mShadersEnabled(true) , mShaderDebugOutputEnabled(false) - , mCurrentLanguage(Language_None) - , mListener(NULL) - , mCurrentConfiguration(NULL) - , mCurrentLodConfiguration(NULL) , mReadMicrocodeCache(false) , mWriteMicrocodeCache(false) , mReadSourceCache(false) , mWriteSourceCache(false) + , mCurrentConfiguration(NULL) + , mCurrentLodConfiguration(NULL) + , mCurrentLanguage(Language_None) + , mListener(NULL) + , mPlatform(platform) { assert (!sThis); sThis = this; diff --git a/extern/shiny/Main/MaterialInstance.cpp b/extern/shiny/Main/MaterialInstance.cpp index c69d13401..5d1a8e7f9 100644 --- a/extern/shiny/Main/MaterialInstance.cpp +++ b/extern/shiny/Main/MaterialInstance.cpp @@ -9,11 +9,11 @@ namespace sh { MaterialInstance::MaterialInstance (const std::string& name, Factory* f) - : mName(name) + : mFailedToCreate(false) + , mListener(NULL) + , mName(name) , mShadersEnabled(true) , mFactory(f) - , mListener(NULL) - , mFailedToCreate(false) { } diff --git a/extern/shiny/Main/Platform.cpp b/extern/shiny/Main/Platform.cpp index 3eb7f4ad3..f09956e0f 100644 --- a/extern/shiny/Main/Platform.cpp +++ b/extern/shiny/Main/Platform.cpp @@ -7,9 +7,9 @@ namespace sh { Platform::Platform (const std::string& basePath) - : mBasePath(basePath) - , mCacheFolder("./") + : mCacheFolder("./") , mFactory(NULL) + , mBasePath(basePath) { } diff --git a/extern/shiny/Main/ShaderSet.cpp b/extern/shiny/Main/ShaderSet.cpp index 8fb530d39..4e19948ad 100644 --- a/extern/shiny/Main/ShaderSet.cpp +++ b/extern/shiny/Main/ShaderSet.cpp @@ -15,9 +15,9 @@ namespace sh ShaderSet::ShaderSet (const std::string& type, const std::string& cgProfile, const std::string& hlslProfile, const std::string& sourceFile, const std::string& basePath, const std::string& name, PropertySetGet* globalSettingsPtr) : mBasePath(basePath) - , mName(name) , mCgProfile(cgProfile) , mHlslProfile(hlslProfile) + , mName(name) { if (type == "vertex") mType = GPT_Vertex; From a5183aefbe41a99dd1481249bb180f3314966c81 Mon Sep 17 00:00:00 2001 From: Stanislav Bas Date: Fri, 22 May 2015 23:53:25 +0300 Subject: [PATCH 54/57] Add record state tracking to the ModifyCommand (Fix #2555) --- apps/opencs/model/world/commands.cpp | 15 ++++++++++++++- apps/opencs/model/world/commands.hpp | 4 ++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/apps/opencs/model/world/commands.cpp b/apps/opencs/model/world/commands.cpp index 9a0401081..11cb91176 100644 --- a/apps/opencs/model/world/commands.cpp +++ b/apps/opencs/model/world/commands.cpp @@ -14,7 +14,7 @@ CSMWorld::ModifyCommand::ModifyCommand (QAbstractItemModel& model, const QModelIndex& index, const QVariant& new_, QUndoCommand* parent) -: QUndoCommand (parent), mModel (&model), mIndex (index), mNew (new_) +: QUndoCommand (parent), mModel (&model), mIndex (index), mNew (new_), mHasRecordState(false) { if (QAbstractProxyModel *proxy = dynamic_cast (&model)) { @@ -27,6 +27,15 @@ CSMWorld::ModifyCommand::ModifyCommand (QAbstractItemModel& model, const QModelI } else setText ("Modify " + mModel->headerData (mIndex.column(), Qt::Horizontal, Qt::DisplayRole).toString()); + + // Remember record state before the modification + if (CSMWorld::IdTable *table = dynamic_cast(mModel)) + { + mHasRecordState = true; + int stateColumnIndex = table->findColumnIndex(Columns::ColumnId_Modification); + mRecordStateIndex = table->index(mIndex.row(), stateColumnIndex); + mOldRecordState = static_cast(table->data(mRecordStateIndex).toInt()); + } } void CSMWorld::ModifyCommand::redo() @@ -38,6 +47,10 @@ void CSMWorld::ModifyCommand::redo() void CSMWorld::ModifyCommand::undo() { mModel->setData (mIndex, mOld); + if (mHasRecordState) + { + mModel->setData(mRecordStateIndex, mOldRecordState); + } } diff --git a/apps/opencs/model/world/commands.hpp b/apps/opencs/model/world/commands.hpp index f13376145..cdd398153 100644 --- a/apps/opencs/model/world/commands.hpp +++ b/apps/opencs/model/world/commands.hpp @@ -31,6 +31,10 @@ namespace CSMWorld QVariant mNew; QVariant mOld; + bool mHasRecordState; + QModelIndex mRecordStateIndex; + CSMWorld::RecordBase::State mOldRecordState; + public: ModifyCommand (QAbstractItemModel& model, const QModelIndex& index, const QVariant& new_, From 10ca6cf3796b3035d97b50d6ac092bc36ee21600 Mon Sep 17 00:00:00 2001 From: Cramal Date: Sat, 23 May 2015 14:39:16 +0900 Subject: [PATCH 55/57] debug latex code --- manual/opencs/tables.tex | 2 -- 1 file changed, 2 deletions(-) diff --git a/manual/opencs/tables.tex b/manual/opencs/tables.tex index b47d5f3d4..503489872 100644 --- a/manual/opencs/tables.tex +++ b/manual/opencs/tables.tex @@ -92,5 +92,3 @@ when you hover your reticle over the object. This is a library of all the items, triggers, containers, NPCs, etc. in the game. There are several kinds of Record Types. Depending on which type a record is, it will need specific information to function. For example, an NPC needs a value attached to its aggression level. A chest, of course, does not. All Record Types contain at least a model. How else would the player see them? Usually they also have a Name, which is what you see when you hover your reticle over the object. Please refer to the Record Types section for an overview of what each type of Referenceable does and what you can tell OpenCS about these objects. - -\end{description} From 45f6e3b39ef99b4be5ec33e9027e0e010cb79a48 Mon Sep 17 00:00:00 2001 From: Cramal Date: Sat, 23 May 2015 14:40:04 +0900 Subject: [PATCH 56/57] debug latex code --- manual/opencs/recordtypes.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manual/opencs/recordtypes.tex b/manual/opencs/recordtypes.tex index afe5a67e3..4dbfbe286 100644 --- a/manual/opencs/recordtypes.tex +++ b/manual/opencs/recordtypes.tex @@ -9,8 +9,8 @@ Let's go through all Record Types and discuss what you can tell OpenCS about the \item[Activator:] When the player enters the same cell as this object, a script is started. Often it also has a \textbf{Script} attached to it, though it not mandatory. These scripts are small bits of code written in a special scripting language that OpenCS can read and interpret. \item[Potion:] This is a potion that is not self-made. It has an \textbf{Icon} for your inventory, Aside from the self-explanatory \textbf{Weight} and \textbf{Coin Value}, it has an attribute called \textbf{Auto Calc} set to ``False''. This means that the effects of this potion are preconfigured. This does not happen when the player makes their own potion. \item[Apparatus:] This is a tool to make potions. Again there's an icon for your inventory as well as a weight and a coin value. It also has a \textbf{Quality} value attached to it: higher the number, the better the effect on your potions will be. The \textbf{Apparatus Type} describes if the item is a Calcinator, Retort, Alembir or Mortar & Pestal. Each has a different effect on the potion the player makes. For more information on this subject, please refer to the \href{http://www.uesp.net/wiki/Morrowind:Alchemy#Tools}{UESP page on Alchemy Tools}. - \item[Armor:] This type of item adds \textbf{Enchantment Points} to the mix. Every piece of clothing or armor has a ''pool'' of potential magicka that gets unlocked when you enchant it. Strong enchantments consume more magicka from this pool: the stronger the enchantment, the more Enchantment Points each cast will take up. For more information on this subject, please refer to the \href{Enchant page on UESP}{http://www.uesp.net/wiki/Morrowind:Enchant}. \textbf{Health} means the amount of hit points this piece of armor has. If it sustains enough damage, the armor will be destroyed. Finally, \textbf{Armor Value} tells the game how much points to add to the player character's Armor Rating. - \item[Book:] This includes scrolls and notes. For the game to make the distinction between books and scrolls, an extra property, \textbf{Scroll}, has been added. Under the \textbf{Skill} column a scroll or book can have an in-game skill listed. Reading this item will raise the player's level in that specific skill. For more information on this, please refer to the \href{Skill Books page on UESP}{http://www.uesp.net/wiki/Morrowind:Skill_Books}. + \item[Armor:] This type of item adds \textbf{Enchantment Points} to the mix. Every piece of clothing or armor has a ''pool'' of potential magicka that gets unlocked when you enchant it. Strong enchantments consume more magicka from this pool: the stronger the enchantment, the more Enchantment Points each cast will take up. For more information on this subject, please refer to the \href{http://www.uesp.net/wiki/Morrowind:Enchant}{Enchant page on UESP}. \textbf{Health} means the amount of hit points this piece of armor has. If it sustains enough damage, the armor will be destroyed. Finally, \textbf{Armor Value} tells the game how much points to add to the player character's Armor Rating. + \item[Book:] This includes scrolls and notes. For the game to make the distinction between books and scrolls, an extra property, \textbf{Scroll}, has been added. Under the \textbf{Skill} column a scroll or book can have an in-game skill listed. Reading this item will raise the player's level in that specific skill. For more information on this, please refer to the \href{http://www.uesp.net/wiki/Morrowind:Skill_Books}{Skill Books page on UESP}. \item[Clothing:] These items work just like Armors, but confer no protective properties. Rather than ``Armor Type'', these items have a ``Clothing Type''. \item[Container:] This is all the stuff that stores items, from chests to sacks to plants. Its \textbf{Capacity} shows how much stuff you can put in the container. You can compare it to the maximum allowed load a player character can carry (who will get over-encumbered and unable to move if he crosses this threshold). A container, however, will just refuse to take the item in question when it gets ''over-encumbered''. \textbf{Organic Container}s are containers such as plants. Containers that \textbf{Respawn} are not safe to store stuff in. After a certain amount of time they will reset to their default contents, meaning that everything in it is gone forever. \item[Creature:] These can be monsters, animals and the like. From 63c3d8df2e38dac647e6f50a4a1e5c0e14a2e4da Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sat, 23 May 2015 09:46:48 +0200 Subject: [PATCH 57/57] updated credits file --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index fb83a1a91..ce76c104e 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -114,6 +114,7 @@ Manual ------ Bodillium + Cramal sir_herrbatka Packagers