mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 02:49:55 +00:00
9d61d76e92
Adds a boolean setting to the user preferences. This setting is locally saved to all OpenMW-CS check stages. When a verification is done, the setting is updated on setup for each check stage. If set to true, the boolean value is then used to skip the verification process for every base record - minus some special cases where, e.g., counters are to be set first. Related issue: - Fixes #4466: Editor: Add option to ignore base records when running verifier (https://gitlab.com/OpenMW/openmw/issues/4466) Tests: The changes were successfully tested in OpenMW-CS by creating faulty "Base" and "Modified" records for every record type (if possible) and, then, running the verifier with and without the option respectively.
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
#include "soundcheck.hpp"
|
|
|
|
#include <sstream>
|
|
|
|
#include <components/esm/loadskil.hpp>
|
|
|
|
#include "../prefs/state.hpp"
|
|
|
|
#include "../world/universalid.hpp"
|
|
|
|
CSMTools::SoundCheckStage::SoundCheckStage (const CSMWorld::IdCollection<ESM::Sound>& sounds)
|
|
: mSounds (sounds)
|
|
{
|
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
|
}
|
|
|
|
int CSMTools::SoundCheckStage::setup()
|
|
{
|
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
|
|
|
return mSounds.getSize();
|
|
}
|
|
|
|
void CSMTools::SoundCheckStage::perform (int stage, CSMDoc::Messages& messages)
|
|
{
|
|
const CSMWorld::Record<ESM::Sound>& record = mSounds.getRecord (stage);
|
|
|
|
// Skip "Base" records (setting!) and "Deleted" records
|
|
if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted())
|
|
return;
|
|
|
|
const ESM::Sound& sound = record.get();
|
|
|
|
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Sound, sound.mId);
|
|
|
|
if (sound.mData.mMinRange>sound.mData.mMaxRange)
|
|
messages.push_back (std::make_pair (id, "Minimum range larger than maximum range"));
|
|
|
|
/// \todo check, if the sound file exists
|
|
}
|