mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-27 03:40:24 +00:00
Use settings values for Game settings
This commit is contained in:
parent
fb5e5335aa
commit
6e8dcc16c6
39 changed files with 124 additions and 215 deletions
|
@ -23,7 +23,7 @@
|
||||||
#include <components/resource/imagemanager.hpp>
|
#include <components/resource/imagemanager.hpp>
|
||||||
#include <components/resource/niffilemanager.hpp>
|
#include <components/resource/niffilemanager.hpp>
|
||||||
#include <components/resource/scenemanager.hpp>
|
#include <components/resource/scenemanager.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
#include <components/to_utf8/to_utf8.hpp>
|
#include <components/to_utf8/to_utf8.hpp>
|
||||||
#include <components/version/version.hpp>
|
#include <components/version/version.hpp>
|
||||||
#include <components/vfs/manager.hpp>
|
#include <components/vfs/manager.hpp>
|
||||||
|
@ -200,11 +200,10 @@ namespace NavMeshTool
|
||||||
|
|
||||||
Settings::Manager::load(config);
|
Settings::Manager::load(config);
|
||||||
|
|
||||||
const auto agentCollisionShape = DetourNavigator::toCollisionShapeType(
|
const DetourNavigator::AgentBounds agentBounds{
|
||||||
Settings::Manager::getInt("actor collision shape type", "Game"));
|
Settings::game().mActorCollisionShapeType,
|
||||||
const osg::Vec3f agentHalfExtents
|
Settings::game().mDefaultActorPathfindHalfExtents,
|
||||||
= Settings::Manager::getVector3("default actor pathfind half extents", "Game");
|
};
|
||||||
const DetourNavigator::AgentBounds agentBounds{ agentCollisionShape, agentHalfExtents };
|
|
||||||
const std::uint64_t maxDbFileSize = Settings::Manager::getUInt64("max navmeshdb file size", "Navigator");
|
const std::uint64_t maxDbFileSize = Settings::Manager::getUInt64("max navmeshdb file size", "Navigator");
|
||||||
const auto dbPath = Files::pathToUnicodeString(config.getUserDataPath() / "navmesh.db");
|
const auto dbPath = Files::pathToUnicodeString(config.getUserDataPath() / "navmesh.db");
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <components/esm3/containerstate.hpp>
|
#include <components/esm3/containerstate.hpp>
|
||||||
#include <components/esm3/loadcont.hpp>
|
#include <components/esm3/loadcont.hpp>
|
||||||
#include <components/esm3/loadsoun.hpp>
|
#include <components/esm3/loadsoun.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/soundmanager.hpp"
|
#include "../mwbase/soundmanager.hpp"
|
||||||
|
@ -61,7 +61,6 @@ namespace MWClass
|
||||||
|
|
||||||
Container::Container()
|
Container::Container()
|
||||||
: MWWorld::RegisteredClass<Container>(ESM::Container::sRecordId)
|
: MWWorld::RegisteredClass<Container>(ESM::Container::sRecordId)
|
||||||
, mHarvestEnabled(Settings::Manager::getBool("graphic herbalism", "Game"))
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +79,7 @@ namespace MWClass
|
||||||
|
|
||||||
bool Container::canBeHarvested(const MWWorld::ConstPtr& ptr) const
|
bool Container::canBeHarvested(const MWWorld::ConstPtr& ptr) const
|
||||||
{
|
{
|
||||||
if (!mHarvestEnabled)
|
if (!Settings::game().mGraphicHerbalism)
|
||||||
return false;
|
return false;
|
||||||
const MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(ptr);
|
const MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(ptr);
|
||||||
if (animation == nullptr)
|
if (animation == nullptr)
|
||||||
|
|
|
@ -31,8 +31,6 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
friend MWWorld::RegisteredClass<Container>;
|
friend MWWorld::RegisteredClass<Container>;
|
||||||
|
|
||||||
const bool mHarvestEnabled;
|
|
||||||
|
|
||||||
Container();
|
Container();
|
||||||
|
|
||||||
void ensureCustomData(const MWWorld::Ptr& ptr) const;
|
void ensureCustomData(const MWWorld::Ptr& ptr) const;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include <components/esm3/loadsndg.hpp>
|
#include <components/esm3/loadsndg.hpp>
|
||||||
#include <components/esm3/loadsoun.hpp>
|
#include <components/esm3/loadsoun.hpp>
|
||||||
#include <components/misc/rng.hpp>
|
#include <components/misc/rng.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include "../mwmechanics/actorutil.hpp"
|
#include "../mwmechanics/actorutil.hpp"
|
||||||
#include "../mwmechanics/aisetting.hpp"
|
#include "../mwmechanics/aisetting.hpp"
|
||||||
|
@ -484,10 +484,8 @@ namespace MWClass
|
||||||
|
|
||||||
if (stats.isDead())
|
if (stats.isDead())
|
||||||
{
|
{
|
||||||
bool canLoot = Settings::Manager::getBool("can loot during death animation", "Game");
|
|
||||||
|
|
||||||
// by default user can loot friendly actors during death animation
|
// by default user can loot friendly actors during death animation
|
||||||
if (canLoot && !stats.getAiSequence().isInCombat())
|
if (Settings::game().mCanLootDuringDeathAnimation && !stats.getAiSequence().isInCombat())
|
||||||
return std::make_unique<MWWorld::ActionOpen>(ptr);
|
return std::make_unique<MWWorld::ActionOpen>(ptr);
|
||||||
|
|
||||||
// otherwise wait until death animation
|
// otherwise wait until death animation
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include <components/esm3/loadnpc.hpp>
|
#include <components/esm3/loadnpc.hpp>
|
||||||
#include <components/esm3/objectstate.hpp>
|
#include <components/esm3/objectstate.hpp>
|
||||||
#include <components/esm4/loadligh.hpp>
|
#include <components/esm4/loadligh.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/soundmanager.hpp"
|
#include "../mwbase/soundmanager.hpp"
|
||||||
|
@ -166,8 +166,7 @@ namespace MWClass
|
||||||
std::string text;
|
std::string text;
|
||||||
|
|
||||||
// Don't show duration for infinite light sources.
|
// Don't show duration for infinite light sources.
|
||||||
if (Settings::Manager::getBool("show effect duration", "Game")
|
if (Settings::game().mShowEffectDuration && ptr.getClass().getRemainingUsageTime(ptr) != -1)
|
||||||
&& ptr.getClass().getRemainingUsageTime(ptr) != -1)
|
|
||||||
text += MWGui::ToolTips::getDurationString(ptr.getClass().getRemainingUsageTime(ptr), "\n#{sDuration}");
|
text += MWGui::ToolTips::getDurationString(ptr.getClass().getRemainingUsageTime(ptr), "\n#{sDuration}");
|
||||||
|
|
||||||
text += MWGui::ToolTips::getWeightString(ref->mBase->mData.mWeight, "#{sWeight}");
|
text += MWGui::ToolTips::getWeightString(ref->mBase->mData.mWeight, "#{sWeight}");
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include <components/esm3/loadmisc.hpp>
|
#include <components/esm3/loadmisc.hpp>
|
||||||
#include <components/esm3/loadnpc.hpp>
|
#include <components/esm3/loadnpc.hpp>
|
||||||
|
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
@ -90,7 +90,7 @@ namespace MWClass
|
||||||
if (creature)
|
if (creature)
|
||||||
{
|
{
|
||||||
int soul = creature->mData.mSoul;
|
int soul = creature->mData.mSoul;
|
||||||
if (Settings::Manager::getBool("rebalance soul gem values", "Game"))
|
if (Settings::game().mRebalanceSoulGemValues)
|
||||||
{
|
{
|
||||||
// use the 'soul gem value rebalance' formula from the Morrowind Code Patch
|
// use the 'soul gem value rebalance' formula from the Morrowind Code Patch
|
||||||
float soulValue = 0.0001 * pow(soul, 3) + 2 * soul;
|
float soulValue = 0.0001 * pow(soul, 3) + 2 * soul;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include <components/esm3/loadrace.hpp>
|
#include <components/esm3/loadrace.hpp>
|
||||||
#include <components/esm3/loadsoun.hpp>
|
#include <components/esm3/loadsoun.hpp>
|
||||||
#include <components/esm3/npcstate.hpp>
|
#include <components/esm3/npcstate.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include "../mwbase/dialoguemanager.hpp"
|
#include "../mwbase/dialoguemanager.hpp"
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
|
@ -826,12 +826,10 @@ namespace MWClass
|
||||||
}
|
}
|
||||||
if (hasArmor)
|
if (hasArmor)
|
||||||
{
|
{
|
||||||
static const bool creatureDamage
|
// Unarmed creature attacks don't affect armor condition unless it was
|
||||||
= Settings::Manager::getBool("unarmed creature attacks damage armor", "Game");
|
// explicitly requested.
|
||||||
|
|
||||||
if (!object.isEmpty() || attacker.isEmpty() || attacker.getClass().isNpc()
|
if (!object.isEmpty() || attacker.isEmpty() || attacker.getClass().isNpc()
|
||||||
|| creatureDamage) // Unarmed creature attacks don't affect armor condition unless it was
|
|| Settings::game().mUnarmedCreatureAttacksDamageArmor)
|
||||||
// explicitly requested.
|
|
||||||
{
|
{
|
||||||
int armorhealth = armor.getClass().getItemHealth(armor);
|
int armorhealth = armor.getClass().getItemHealth(armor);
|
||||||
armorhealth -= std::min(damageDiff, armorhealth);
|
armorhealth -= std::min(damageDiff, armorhealth);
|
||||||
|
@ -919,10 +917,8 @@ namespace MWClass
|
||||||
|
|
||||||
if (stats.isDead())
|
if (stats.isDead())
|
||||||
{
|
{
|
||||||
bool canLoot = Settings::Manager::getBool("can loot during death animation", "Game");
|
|
||||||
|
|
||||||
// by default user can loot friendly actors during death animation
|
// by default user can loot friendly actors during death animation
|
||||||
if (canLoot && !stats.getAiSequence().isInCombat())
|
if (Settings::game().mCanLootDuringDeathAnimation && !stats.getAiSequence().isInCombat())
|
||||||
return std::make_unique<MWWorld::ActionOpen>(ptr);
|
return std::make_unique<MWWorld::ActionOpen>(ptr);
|
||||||
|
|
||||||
// otherwise wait until death animation
|
// otherwise wait until death animation
|
||||||
|
@ -940,9 +936,7 @@ namespace MWClass
|
||||||
}
|
}
|
||||||
else // In combat
|
else // In combat
|
||||||
{
|
{
|
||||||
const bool stealingInCombat
|
if (Settings::game().mAlwaysAllowStealingFromKnockedOutActors && stats.getKnockedDown())
|
||||||
= Settings::Manager::getBool("always allow stealing from knocked out actors", "Game");
|
|
||||||
if (stealingInCombat && stats.getKnockedDown())
|
|
||||||
return std::make_unique<MWWorld::ActionOpen>(ptr); // stealing
|
return std::make_unique<MWWorld::ActionOpen>(ptr); // stealing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1090,9 +1084,7 @@ namespace MWClass
|
||||||
if (!customData.mNpcStats.getAiSequence().isInCombat())
|
if (!customData.mNpcStats.getAiSequence().isInCombat())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
const bool stealingInCombat
|
if (Settings::game().mAlwaysAllowStealingFromKnockedOutActors && customData.mNpcStats.getKnockedDown())
|
||||||
= Settings::Manager::getBool("always allow stealing from knocked out actors", "Game");
|
|
||||||
if (stealingInCombat && customData.mNpcStats.getKnockedDown())
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <components/esm3/loadnpc.hpp>
|
#include <components/esm3/loadnpc.hpp>
|
||||||
#include <components/esm3/loadweap.hpp>
|
#include <components/esm3/loadweap.hpp>
|
||||||
#include <components/misc/constants.hpp>
|
#include <components/misc/constants.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/mechanicsmanager.hpp"
|
#include "../mwbase/mechanicsmanager.hpp"
|
||||||
|
@ -160,8 +160,7 @@ namespace MWClass
|
||||||
std::string text;
|
std::string text;
|
||||||
|
|
||||||
// weapon type & damage
|
// weapon type & damage
|
||||||
if (weaponType->mWeaponClass != ESM::WeaponType::Ammo
|
if (weaponType->mWeaponClass != ESM::WeaponType::Ammo || Settings::game().mShowProjectileDamage)
|
||||||
|| Settings::Manager::getBool("show projectile damage", "Game"))
|
|
||||||
{
|
{
|
||||||
text += "\n#{sType} ";
|
text += "\n#{sType} ";
|
||||||
|
|
||||||
|
@ -215,7 +214,7 @@ namespace MWClass
|
||||||
+ MWGui::ToolTips::toString(ref->mBase->mData.mHealth);
|
+ MWGui::ToolTips::toString(ref->mBase->mData.mHealth);
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool verbose = Settings::Manager::getBool("show melee info", "Game");
|
const bool verbose = Settings::game().mShowMeleeInfo;
|
||||||
// add reach for melee weapon
|
// add reach for melee weapon
|
||||||
if (weaponType->mWeaponClass == ESM::WeaponType::Melee && verbose)
|
if (weaponType->mWeaponClass == ESM::WeaponType::Melee && verbose)
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include <components/interpreter/defines.hpp>
|
#include <components/interpreter/defines.hpp>
|
||||||
#include <components/interpreter/interpreter.hpp>
|
#include <components/interpreter/interpreter.hpp>
|
||||||
|
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/journal.hpp"
|
#include "../mwbase/journal.hpp"
|
||||||
|
@ -583,7 +583,7 @@ namespace MWDialogue
|
||||||
updateOriginalDisposition();
|
updateOriginalDisposition();
|
||||||
mCurrentDisposition += delta;
|
mCurrentDisposition += delta;
|
||||||
mActor.getClass().getNpcStats(mActor).setBaseDisposition(mCurrentDisposition);
|
mActor.getClass().getNpcStats(mActor).setBaseDisposition(mCurrentDisposition);
|
||||||
if (Settings::Manager::getBool("barter disposition change is permanent", "Game"))
|
if (Settings::game().mBarterDispositionChangeIsPermanent)
|
||||||
mPermanentDispositionChange += delta;
|
mPermanentDispositionChange += delta;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include <MyGUI_ScrollView.h>
|
#include <MyGUI_ScrollView.h>
|
||||||
|
|
||||||
#include <components/misc/strings/format.hpp>
|
#include <components/misc/strings/format.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
#include <components/widgets/list.hpp>
|
#include <components/widgets/list.hpp>
|
||||||
|
|
||||||
#include <components/esm3/loadgmst.hpp>
|
#include <components/esm3/loadgmst.hpp>
|
||||||
|
@ -158,8 +158,7 @@ namespace MWGui
|
||||||
mEnchanting.setSelfEnchanting(true);
|
mEnchanting.setSelfEnchanting(true);
|
||||||
mEnchanting.setEnchanter(MWMechanics::getPlayer());
|
mEnchanting.setEnchanter(MWMechanics::getPlayer());
|
||||||
mBuyButton->setCaptionWithReplacing("#{sCreate}");
|
mBuyButton->setCaptionWithReplacing("#{sCreate}");
|
||||||
bool enabled = Settings::Manager::getBool("show enchant chance", "Game");
|
mChanceLayout->setVisible(Settings::game().mShowEnchantChance);
|
||||||
mChanceLayout->setVisible(enabled);
|
|
||||||
mPtr = MWMechanics::getPlayer();
|
mPtr = MWMechanics::getPlayer();
|
||||||
setSoulGem(ptr);
|
setSoulGem(ptr);
|
||||||
mPrice->setVisible(false);
|
mPrice->setVisible(false);
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include <components/esm3/loadmgef.hpp>
|
#include <components/esm3/loadmgef.hpp>
|
||||||
#include <components/misc/resourcehelpers.hpp>
|
#include <components/misc/resourcehelpers.hpp>
|
||||||
#include <components/resource/resourcesystem.hpp>
|
#include <components/resource/resourcesystem.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
@ -136,7 +136,7 @@ namespace MWGui
|
||||||
+= MWBase::Environment::get().getWindowManager()->getGameSettingString("spoint", {});
|
+= MWBase::Environment::get().getWindowManager()->getGameSettingString("spoint", {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (effectInfo.mRemainingTime > -1 && Settings::Manager::getBool("show effect duration", "Game"))
|
if (effectInfo.mRemainingTime > -1 && Settings::game().mShowEffectDuration)
|
||||||
sourcesDescription
|
sourcesDescription
|
||||||
+= MWGui::ToolTips::getDurationString(effectInfo.mRemainingTime, " #{sDuration}");
|
+= MWGui::ToolTips::getDurationString(effectInfo.mRemainingTime, " #{sDuration}");
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include <components/esm/records.hpp>
|
#include <components/esm/records.hpp>
|
||||||
#include <components/l10n/manager.hpp>
|
#include <components/l10n/manager.hpp>
|
||||||
#include <components/misc/resourcehelpers.hpp>
|
#include <components/misc/resourcehelpers.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
#include <components/widgets/box.hpp>
|
#include <components/widgets/box.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
|
@ -42,7 +42,6 @@ namespace MWGui
|
||||||
, mLastMouseY(0)
|
, mLastMouseY(0)
|
||||||
, mEnabled(true)
|
, mEnabled(true)
|
||||||
, mFullHelp(false)
|
, mFullHelp(false)
|
||||||
, mShowOwned(0)
|
|
||||||
, mFrameDuration(0.f)
|
, mFrameDuration(0.f)
|
||||||
{
|
{
|
||||||
getWidget(mDynamicToolTipBox, "DynamicToolTipBox");
|
getWidget(mDynamicToolTipBox, "DynamicToolTipBox");
|
||||||
|
@ -61,8 +60,6 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
mMainWidget->getChildAt(i)->setVisible(false);
|
mMainWidget->getChildAt(i)->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
mShowOwned = Settings::Manager::getInt("show owned", "Game");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToolTips::setEnabled(bool enabled)
|
void ToolTips::setEnabled(bool enabled)
|
||||||
|
@ -402,7 +399,8 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
mDynamicToolTipBox->setVisible(true);
|
mDynamicToolTipBox->setVisible(true);
|
||||||
|
|
||||||
if ((mShowOwned == 1 || mShowOwned == 3) && isOwned)
|
const int showOwned = Settings::game().mShowOwned;
|
||||||
|
if ((showOwned == 1 || showOwned == 3) && isOwned)
|
||||||
mDynamicToolTipBox->changeWidgetSkin(MWBase::Environment::get().getWindowManager()->isGuiMode()
|
mDynamicToolTipBox->changeWidgetSkin(MWBase::Environment::get().getWindowManager()->isGuiMode()
|
||||||
? "HUD_Box_NoTransp_Owned"
|
? "HUD_Box_NoTransp_Owned"
|
||||||
: "HUD_Box_Owned");
|
: "HUD_Box_Owned");
|
||||||
|
|
|
@ -134,8 +134,6 @@ namespace MWGui
|
||||||
|
|
||||||
bool mFullHelp;
|
bool mFullHelp;
|
||||||
|
|
||||||
int mShowOwned;
|
|
||||||
|
|
||||||
float mFrameDuration;
|
float mFrameDuration;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#include "tradeitemmodel.hpp"
|
#include "tradeitemmodel.hpp"
|
||||||
|
|
||||||
#include <components/misc/strings/algorithm.hpp>
|
#include <components/misc/strings/algorithm.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include "../mwworld/class.hpp"
|
#include "../mwworld/class.hpp"
|
||||||
#include "../mwworld/containerstore.hpp"
|
#include "../mwworld/containerstore.hpp"
|
||||||
|
@ -140,9 +140,8 @@ namespace MWGui
|
||||||
throw std::runtime_error("The borrowed item disappeared");
|
throw std::runtime_error("The borrowed item disappeared");
|
||||||
|
|
||||||
const ItemStack& item = sourceModel->getItem(i);
|
const ItemStack& item = sourceModel->getItem(i);
|
||||||
static const bool prevent = Settings::Manager::getBool("prevent merchant equipping", "Game");
|
|
||||||
// copy the borrowed items to our model
|
// copy the borrowed items to our model
|
||||||
copyItem(item, itemStack.mCount, !prevent);
|
copyItem(item, itemStack.mCount, !Settings::game().mPreventMerchantEquipping);
|
||||||
// then remove them from the source model
|
// then remove them from the source model
|
||||||
sourceModel->removeItem(item, itemStack.mCount);
|
sourceModel->removeItem(item, itemStack.mCount);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include "../mwmechanics/npcstats.hpp"
|
#include "../mwmechanics/npcstats.hpp"
|
||||||
|
|
||||||
#include <components/esm3/loadclas.hpp>
|
#include <components/esm3/loadclas.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include "tooltips.hpp"
|
#include "tooltips.hpp"
|
||||||
|
|
||||||
|
@ -27,8 +27,6 @@ namespace MWGui
|
||||||
TrainingWindow::TrainingWindow()
|
TrainingWindow::TrainingWindow()
|
||||||
: WindowBase("openmw_trainingwindow.layout")
|
: WindowBase("openmw_trainingwindow.layout")
|
||||||
, mTimeAdvancer(0.05f)
|
, mTimeAdvancer(0.05f)
|
||||||
, mTrainingSkillBasedOnBaseSkill(
|
|
||||||
Settings::Manager::getBool("trainers training skills based on base skill", "Game"))
|
|
||||||
{
|
{
|
||||||
getWidget(mTrainingOptions, "TrainingOptions");
|
getWidget(mTrainingOptions, "TrainingOptions");
|
||||||
getWidget(mCancelButton, "CancelButton");
|
getWidget(mCancelButton, "CancelButton");
|
||||||
|
@ -199,7 +197,7 @@ namespace MWGui
|
||||||
|
|
||||||
float TrainingWindow::getSkillForTraining(const MWMechanics::NpcStats& stats, ESM::RefId id) const
|
float TrainingWindow::getSkillForTraining(const MWMechanics::NpcStats& stats, ESM::RefId id) const
|
||||||
{
|
{
|
||||||
if (mTrainingSkillBasedOnBaseSkill)
|
if (Settings::game().mTrainersTrainingSkillsBasedOnBaseSkill)
|
||||||
return stats.getSkill(id).getBase();
|
return stats.getSkill(id).getBase();
|
||||||
return stats.getSkill(id).getModified();
|
return stats.getSkill(id).getModified();
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,6 @@ namespace MWGui
|
||||||
|
|
||||||
WaitDialogProgressBar mProgressBar;
|
WaitDialogProgressBar mProgressBar;
|
||||||
TimeAdvancer mTimeAdvancer;
|
TimeAdvancer mTimeAdvancer;
|
||||||
bool mTrainingSkillBasedOnBaseSkill; // corresponds to the setting 'training skills based on base skill'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,7 +196,6 @@ namespace MWGui
|
||||||
, mForceHidden(GW_None)
|
, mForceHidden(GW_None)
|
||||||
, mAllowed(GW_ALL)
|
, mAllowed(GW_ALL)
|
||||||
, mRestAllowed(true)
|
, mRestAllowed(true)
|
||||||
, mShowOwned(0)
|
|
||||||
, mEncoding(encoding)
|
, mEncoding(encoding)
|
||||||
, mVersionDescription(versionDescription)
|
, mVersionDescription(versionDescription)
|
||||||
, mWindowVisible(true)
|
, mWindowVisible(true)
|
||||||
|
@ -297,8 +296,6 @@ namespace MWGui
|
||||||
MyGUI::ClipboardManager::getInstance().eventClipboardRequested
|
MyGUI::ClipboardManager::getInstance().eventClipboardRequested
|
||||||
+= MyGUI::newDelegate(this, &WindowManager::onClipboardRequested);
|
+= MyGUI::newDelegate(this, &WindowManager::onClipboardRequested);
|
||||||
|
|
||||||
mShowOwned = Settings::Manager::getInt("show owned", "Game");
|
|
||||||
|
|
||||||
mVideoWrapper = std::make_unique<SDLUtil::VideoWrapper>(window, viewer);
|
mVideoWrapper = std::make_unique<SDLUtil::VideoWrapper>(window, viewer);
|
||||||
mVideoWrapper->setGammaContrast(
|
mVideoWrapper->setGammaContrast(
|
||||||
Settings::Manager::getFloat("gamma", "Video"), Settings::Manager::getFloat("contrast", "Video"));
|
Settings::Manager::getFloat("gamma", "Video"), Settings::Manager::getFloat("contrast", "Video"));
|
||||||
|
@ -1040,7 +1037,8 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
mToolTips->setFocusObject(focus);
|
mToolTips->setFocusObject(focus);
|
||||||
|
|
||||||
if (mHud && (mShowOwned == 2 || mShowOwned == 3))
|
const int showOwned = Settings::game().mShowOwned;
|
||||||
|
if (mHud && (showOwned == 2 || showOwned == 3))
|
||||||
{
|
{
|
||||||
bool owned = mToolTips->checkOwned();
|
bool owned = mToolTips->checkOwned();
|
||||||
mHud->setCrosshairOwned(owned);
|
mHud->setCrosshairOwned(owned);
|
||||||
|
|
|
@ -515,8 +515,6 @@ namespace MWGui
|
||||||
|
|
||||||
void updateMap();
|
void updateMap();
|
||||||
|
|
||||||
int mShowOwned;
|
|
||||||
|
|
||||||
ToUTF8::FromType mEncoding;
|
ToUTF8::FromType mEncoding;
|
||||||
|
|
||||||
std::string mVersionDescription;
|
std::string mVersionDescription;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include <components/detournavigator/navigator.hpp>
|
#include <components/detournavigator/navigator.hpp>
|
||||||
#include <components/detournavigator/navigatorutils.hpp>
|
#include <components/detournavigator/navigatorutils.hpp>
|
||||||
#include <components/lua/luastate.hpp>
|
#include <components/lua/luastate.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
|
@ -166,8 +166,8 @@ namespace MWLua
|
||||||
}));
|
}));
|
||||||
|
|
||||||
static const DetourNavigator::AgentBounds defaultAgentBounds{
|
static const DetourNavigator::AgentBounds defaultAgentBounds{
|
||||||
DetourNavigator::toCollisionShapeType(Settings::Manager::getInt("actor collision shape type", "Game")),
|
Settings::game().mActorCollisionShapeType,
|
||||||
Settings::Manager::getVector3("default actor pathfind half extents", "Game"),
|
Settings::game().mDefaultActorPathfindHalfExtents,
|
||||||
};
|
};
|
||||||
static const float defaultStepSize
|
static const float defaultStepSize
|
||||||
= 2 * std::max(defaultAgentBounds.mHalfExtents.x(), defaultAgentBounds.mHalfExtents.y());
|
= 2 * std::max(defaultAgentBounds.mHalfExtents.x(), defaultAgentBounds.mHalfExtents.y());
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include <components/esm3/loadmgef.hpp>
|
#include <components/esm3/loadmgef.hpp>
|
||||||
#include <components/esm3/loadstat.hpp>
|
#include <components/esm3/loadstat.hpp>
|
||||||
|
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include "actorutil.hpp"
|
#include "actorutil.hpp"
|
||||||
#include "creaturestats.hpp"
|
#include "creaturestats.hpp"
|
||||||
|
@ -289,9 +289,7 @@ namespace MWMechanics
|
||||||
{
|
{
|
||||||
if (!reflected)
|
if (!reflected)
|
||||||
{
|
{
|
||||||
static const bool keepOriginalCaster
|
if (Settings::game().mClassicReflectedAbsorbSpellsBehavior)
|
||||||
= Settings::Manager::getBool("classic reflected absorb spells behavior", "Game");
|
|
||||||
if (keepOriginalCaster)
|
|
||||||
reflected = { *spellIt, caster };
|
reflected = { *spellIt, caster };
|
||||||
else
|
else
|
||||||
reflected = { *spellIt, ptr };
|
reflected = { *spellIt, ptr };
|
||||||
|
@ -369,8 +367,7 @@ namespace MWMechanics
|
||||||
++spellIt;
|
++spellIt;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const bool keepCalm = Settings::Manager::getBool("classic calm spells behavior", "Game");
|
if (Settings::game().mClassicCalmSpellsBehavior)
|
||||||
if (keepCalm)
|
|
||||||
{
|
{
|
||||||
ESM::MagicEffect::Effects effect
|
ESM::MagicEffect::Effects effect
|
||||||
= ptr.getClass().isNpc() ? ESM::MagicEffect::CalmHumanoid : ESM::MagicEffect::CalmCreature;
|
= ptr.getClass().isNpc() ? ESM::MagicEffect::CalmHumanoid : ESM::MagicEffect::CalmCreature;
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <components/misc/resourcehelpers.hpp>
|
#include <components/misc/resourcehelpers.hpp>
|
||||||
#include <components/misc/rng.hpp>
|
#include <components/misc/rng.hpp>
|
||||||
#include <components/sceneutil/positionattitudetransform.hpp>
|
#include <components/sceneutil/positionattitudetransform.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include <components/esm3/loadcrea.hpp>
|
#include <components/esm3/loadcrea.hpp>
|
||||||
#include <components/esm3/loadgmst.hpp>
|
#include <components/esm3/loadgmst.hpp>
|
||||||
|
@ -425,7 +425,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
void Actors::updateMovementSpeed(const MWWorld::Ptr& actor) const
|
void Actors::updateMovementSpeed(const MWWorld::Ptr& actor) const
|
||||||
{
|
{
|
||||||
if (mSmoothMovement)
|
if (Settings::game().mSmoothMovement)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const auto& actorClass = actor.getClass();
|
const auto& actorClass = actor.getClass();
|
||||||
|
@ -559,7 +559,7 @@ namespace MWMechanics
|
||||||
float angle = std::atan2(from, to);
|
float angle = std::atan2(from, to);
|
||||||
actorState.setAngleToPlayer(angle);
|
actorState.setAngleToPlayer(angle);
|
||||||
float deltaAngle = Misc::normalizeAngle(angle - actor.getRefData().getPosition().rot[2]);
|
float deltaAngle = Misc::normalizeAngle(angle - actor.getRefData().getPosition().rot[2]);
|
||||||
if (!mSmoothMovement || std::abs(deltaAngle) > osg::DegreesToRadians(60.f))
|
if (!Settings::game().mSmoothMovement || std::abs(deltaAngle) > osg::DegreesToRadians(60.f))
|
||||||
actorState.setTurningToPlayer(true);
|
actorState.setTurningToPlayer(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -598,8 +598,9 @@ namespace MWMechanics
|
||||||
const osg::Vec3f actor1Pos(actor1.getRefData().getPosition().asVec3());
|
const osg::Vec3f actor1Pos(actor1.getRefData().getPosition().asVec3());
|
||||||
const osg::Vec3f actor2Pos(actor2.getRefData().getPosition().asVec3());
|
const osg::Vec3f actor2Pos(actor2.getRefData().getPosition().asVec3());
|
||||||
const float sqrDist = (actor1Pos - actor2Pos).length2();
|
const float sqrDist = (actor1Pos - actor2Pos).length2();
|
||||||
|
const int actorsProcessingRange = Settings::game().mActorsProcessingRange;
|
||||||
|
|
||||||
if (sqrDist > mActorsProcessingRange * mActorsProcessingRange)
|
if (sqrDist > actorsProcessingRange * actorsProcessingRange)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// If this is set to true, actor1 will start combat with actor2 if the awareness check at the end of the method
|
// If this is set to true, actor1 will start combat with actor2 if the awareness check at the end of the method
|
||||||
|
@ -677,8 +678,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
// If set in the settings file, player followers and escorters will become aggressive toward enemies in combat
|
// If set in the settings file, player followers and escorters will become aggressive toward enemies in combat
|
||||||
// with them or the player
|
// with them or the player
|
||||||
static const bool followersAttackOnSight = Settings::Manager::getBool("followers attack on sight", "Game");
|
if (!aggressive && isPlayerFollowerOrEscorter && Settings::game().mFollowersAttackOnSight)
|
||||||
if (!aggressive && isPlayerFollowerOrEscorter && followersAttackOnSight)
|
|
||||||
{
|
{
|
||||||
if (creatureStats2.getAiSequence().isInCombat(actor1))
|
if (creatureStats2.getAiSequence().isInCombat(actor1))
|
||||||
aggressive = true;
|
aggressive = true;
|
||||||
|
@ -1161,23 +1161,6 @@ namespace MWMechanics
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Actors::Actors()
|
|
||||||
: mSmoothMovement(Settings::Manager::getBool("smooth movement", "Game"))
|
|
||||||
{
|
|
||||||
updateProcessingRange();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Actors::updateProcessingRange()
|
|
||||||
{
|
|
||||||
// We have to cap it since using high values (larger than 7168) will make some quests harder or impossible to
|
|
||||||
// complete (bug #1876)
|
|
||||||
static constexpr float maxRange = 7168.f;
|
|
||||||
static constexpr float minRange = maxRange / 2.f;
|
|
||||||
|
|
||||||
mActorsProcessingRange
|
|
||||||
= std::clamp(Settings::Manager::getFloat("actors processing range", "Game"), minRange, maxRange);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Actors::addActor(const MWWorld::Ptr& ptr, bool updateImmediately)
|
void Actors::addActor(const MWWorld::Ptr& ptr, bool updateImmediately)
|
||||||
{
|
{
|
||||||
removeActor(ptr, true);
|
removeActor(ptr, true);
|
||||||
|
@ -1208,7 +1191,8 @@ namespace MWMechanics
|
||||||
|
|
||||||
const float dist
|
const float dist
|
||||||
= (player.getRefData().getPosition().asVec3() - ptr.getRefData().getPosition().asVec3()).length();
|
= (player.getRefData().getPosition().asVec3() - ptr.getRefData().getPosition().asVec3()).length();
|
||||||
if (dist > mActorsProcessingRange)
|
const int actorsProcessingRange = Settings::game().mActorsProcessingRange;
|
||||||
|
if (dist > actorsProcessingRange)
|
||||||
{
|
{
|
||||||
ptr.getRefData().getBaseNode()->setNodeMask(0);
|
ptr.getRefData().getBaseNode()->setNodeMask(0);
|
||||||
return;
|
return;
|
||||||
|
@ -1218,8 +1202,8 @@ namespace MWMechanics
|
||||||
|
|
||||||
// Fade away actors on large distance (>90% of actor's processing distance)
|
// Fade away actors on large distance (>90% of actor's processing distance)
|
||||||
float visibilityRatio = 1.0;
|
float visibilityRatio = 1.0;
|
||||||
const float fadeStartDistance = mActorsProcessingRange * 0.9f;
|
const float fadeStartDistance = actorsProcessingRange * 0.9f;
|
||||||
const float fadeEndDistance = mActorsProcessingRange;
|
const float fadeEndDistance = actorsProcessingRange;
|
||||||
const float fadeRatio = (dist - fadeStartDistance) / (fadeEndDistance - fadeStartDistance);
|
const float fadeRatio = (dist - fadeStartDistance) / (fadeEndDistance - fadeStartDistance);
|
||||||
if (fadeRatio > 0)
|
if (fadeRatio > 0)
|
||||||
visibilityRatio -= std::max(0.f, fadeRatio);
|
visibilityRatio -= std::max(0.f, fadeRatio);
|
||||||
|
@ -1263,7 +1247,7 @@ namespace MWMechanics
|
||||||
// Otherwise check if any actor in AI processing range sees the target actor
|
// Otherwise check if any actor in AI processing range sees the target actor
|
||||||
std::vector<MWWorld::Ptr> neighbors;
|
std::vector<MWWorld::Ptr> neighbors;
|
||||||
osg::Vec3f position(actor.getRefData().getPosition().asVec3());
|
osg::Vec3f position(actor.getRefData().getPosition().asVec3());
|
||||||
getObjectsInRange(position, mActorsProcessingRange, neighbors);
|
getObjectsInRange(position, Settings::game().mActorsProcessingRange, neighbors);
|
||||||
for (const MWWorld::Ptr& neighbor : neighbors)
|
for (const MWWorld::Ptr& neighbor : neighbors)
|
||||||
{
|
{
|
||||||
if (neighbor == actor)
|
if (neighbor == actor)
|
||||||
|
@ -1310,13 +1294,15 @@ namespace MWMechanics
|
||||||
|
|
||||||
if (aiActive)
|
if (aiActive)
|
||||||
{
|
{
|
||||||
|
const int actorsProcessingRange = Settings::game().mActorsProcessingRange;
|
||||||
for (const Actor& actor : mActors)
|
for (const Actor& actor : mActors)
|
||||||
{
|
{
|
||||||
if (actor.getPtr() == player)
|
if (actor.getPtr() == player)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
bool inProcessingRange = (playerPos - actor.getPtr().getRefData().getPosition().asVec3()).length2()
|
const bool inProcessingRange
|
||||||
<= mActorsProcessingRange * mActorsProcessingRange;
|
= (playerPos - actor.getPtr().getRefData().getPosition().asVec3()).length2()
|
||||||
|
<= actorsProcessingRange * actorsProcessingRange;
|
||||||
if (inProcessingRange)
|
if (inProcessingRange)
|
||||||
{
|
{
|
||||||
MWMechanics::CreatureStats& stats = actor.getPtr().getClass().getCreatureStats(actor.getPtr());
|
MWMechanics::CreatureStats& stats = actor.getPtr().getClass().getCreatureStats(actor.getPtr());
|
||||||
|
@ -1353,7 +1339,7 @@ namespace MWMechanics
|
||||||
const float maxDistForPartialAvoiding = 200.f;
|
const float maxDistForPartialAvoiding = 200.f;
|
||||||
const float maxDistForStrictAvoiding = 100.f;
|
const float maxDistForStrictAvoiding = 100.f;
|
||||||
const float maxTimeToCheck = 2.0f;
|
const float maxTimeToCheck = 2.0f;
|
||||||
static const bool giveWayWhenIdle = Settings::Manager::getBool("NPCs give way", "Game");
|
const bool giveWayWhenIdle = Settings::game().mNPCsGiveWay;
|
||||||
|
|
||||||
const MWWorld::Ptr player = getPlayer();
|
const MWWorld::Ptr player = getPlayer();
|
||||||
const MWBase::World* const world = MWBase::Environment::get().getWorld();
|
const MWBase::World* const world = MWBase::Environment::get().getWorld();
|
||||||
|
@ -1538,6 +1524,7 @@ namespace MWMechanics
|
||||||
player.getClass().getCreatureStats(player).setHitAttemptActorId(-1);
|
player.getClass().getCreatureStats(player).setHitAttemptActorId(-1);
|
||||||
}
|
}
|
||||||
const bool godmode = MWBase::Environment::get().getWorld()->getGodModeState();
|
const bool godmode = MWBase::Environment::get().getWorld()->getGodModeState();
|
||||||
|
const int actorsProcessingRange = Settings::game().mActorsProcessingRange;
|
||||||
|
|
||||||
// AI and magic effects update
|
// AI and magic effects update
|
||||||
for (Actor& actor : mActors)
|
for (Actor& actor : mActors)
|
||||||
|
@ -1549,7 +1536,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
const float distSqr = (playerPos - actor.getPtr().getRefData().getPosition().asVec3()).length2();
|
const float distSqr = (playerPos - actor.getPtr().getRefData().getPosition().asVec3()).length2();
|
||||||
// AI processing is only done within given distance to the player.
|
// AI processing is only done within given distance to the player.
|
||||||
const bool inProcessingRange = distSqr <= mActorsProcessingRange * mActorsProcessingRange;
|
const bool inProcessingRange = distSqr <= actorsProcessingRange * actorsProcessingRange;
|
||||||
|
|
||||||
// If dead or no longer in combat, no longer store any actors who attempted to hit us. Also remove for
|
// If dead or no longer in combat, no longer store any actors who attempted to hit us. Also remove for
|
||||||
// the player.
|
// the player.
|
||||||
|
@ -1648,8 +1635,7 @@ namespace MWMechanics
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const bool avoidCollisions = Settings::Manager::getBool("NPCs avoid collisions", "Game");
|
if (Settings::game().mNPCsAvoidCollisions)
|
||||||
if (avoidCollisions)
|
|
||||||
predictAndAvoidCollisions(duration);
|
predictAndAvoidCollisions(duration);
|
||||||
|
|
||||||
mTimerUpdateHeadTrack += duration;
|
mTimerUpdateHeadTrack += duration;
|
||||||
|
@ -1671,7 +1657,7 @@ namespace MWMechanics
|
||||||
MWMechanics::AiSequence& seq = stats.getAiSequence();
|
MWMechanics::AiSequence& seq = stats.getAiSequence();
|
||||||
alwaysActive = !seq.isEmpty() && seq.getActivePackage().alwaysActive();
|
alwaysActive = !seq.isEmpty() && seq.getActivePackage().alwaysActive();
|
||||||
}
|
}
|
||||||
const bool inRange = isPlayer || dist <= mActorsProcessingRange || alwaysActive;
|
const bool inRange = isPlayer || dist <= actorsProcessingRange || alwaysActive;
|
||||||
const int activeFlag = isPlayer ? 2 : 1; // Can be changed back to '2' to keep updating bounding boxes
|
const int activeFlag = isPlayer ? 2 : 1; // Can be changed back to '2' to keep updating bounding boxes
|
||||||
// off screen (more accurate, but slower)
|
// off screen (more accurate, but slower)
|
||||||
const int active = inRange ? activeFlag : 0;
|
const int active = inRange ? activeFlag : 0;
|
||||||
|
@ -1885,6 +1871,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
const MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
const MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
const osg::Vec3f playerPos = player.getRefData().getPosition().asVec3();
|
const osg::Vec3f playerPos = player.getRefData().getPosition().asVec3();
|
||||||
|
const int actorsProcessingRange = Settings::game().mActorsProcessingRange;
|
||||||
|
|
||||||
for (const Actor& actor : mActors)
|
for (const Actor& actor : mActors)
|
||||||
{
|
{
|
||||||
|
@ -1899,7 +1886,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
if ((!actor.getPtr().getRefData().getBaseNode())
|
if ((!actor.getPtr().getRefData().getBaseNode())
|
||||||
|| (playerPos - actor.getPtr().getRefData().getPosition().asVec3()).length2()
|
|| (playerPos - actor.getPtr().getRefData().getPosition().asVec3()).length2()
|
||||||
> mActorsProcessingRange * mActorsProcessingRange)
|
> actorsProcessingRange * actorsProcessingRange)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
adjustMagicEffects(actor.getPtr(), duration);
|
adjustMagicEffects(actor.getPtr(), duration);
|
||||||
|
@ -1947,7 +1934,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
std::vector<MWWorld::Ptr> observers;
|
std::vector<MWWorld::Ptr> observers;
|
||||||
const osg::Vec3f position(player.getRefData().getPosition().asVec3());
|
const osg::Vec3f position(player.getRefData().getPosition().asVec3());
|
||||||
const float radius = std::min(fSneakUseDist, mActorsProcessingRange);
|
const float radius = std::min<float>(fSneakUseDist, Settings::game().mActorsProcessingRange);
|
||||||
getObjectsInRange(position, radius, observers);
|
getObjectsInRange(position, radius, observers);
|
||||||
|
|
||||||
std::set<MWWorld::Ptr> sidingActors;
|
std::set<MWWorld::Ptr> sidingActors;
|
||||||
|
@ -2231,7 +2218,7 @@ namespace MWMechanics
|
||||||
std::vector<MWWorld::Ptr> list;
|
std::vector<MWWorld::Ptr> list;
|
||||||
std::vector<MWWorld::Ptr> neighbors;
|
std::vector<MWWorld::Ptr> neighbors;
|
||||||
const osg::Vec3f position(actor.getRefData().getPosition().asVec3());
|
const osg::Vec3f position(actor.getRefData().getPosition().asVec3());
|
||||||
getObjectsInRange(position, mActorsProcessingRange, neighbors);
|
getObjectsInRange(position, Settings::game().mActorsProcessingRange, neighbors);
|
||||||
for (const MWWorld::Ptr& neighbor : neighbors)
|
for (const MWWorld::Ptr& neighbor : neighbors)
|
||||||
{
|
{
|
||||||
if (neighbor == actor)
|
if (neighbor == actor)
|
||||||
|
@ -2252,7 +2239,7 @@ namespace MWMechanics
|
||||||
std::vector<MWWorld::Ptr> list;
|
std::vector<MWWorld::Ptr> list;
|
||||||
std::vector<MWWorld::Ptr> neighbors;
|
std::vector<MWWorld::Ptr> neighbors;
|
||||||
osg::Vec3f position(actor.getRefData().getPosition().asVec3());
|
osg::Vec3f position(actor.getRefData().getPosition().asVec3());
|
||||||
getObjectsInRange(position, mActorsProcessingRange, neighbors);
|
getObjectsInRange(position, Settings::game().mActorsProcessingRange, neighbors);
|
||||||
|
|
||||||
std::set<MWWorld::Ptr> followers;
|
std::set<MWWorld::Ptr> followers;
|
||||||
getActorsFollowing(actor, followers);
|
getActorsFollowing(actor, followers);
|
||||||
|
|
|
@ -40,8 +40,6 @@ namespace MWMechanics
|
||||||
class Actors
|
class Actors
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Actors();
|
|
||||||
|
|
||||||
std::list<Actor>::const_iterator begin() const { return mActors.begin(); }
|
std::list<Actor>::const_iterator begin() const { return mActors.begin(); }
|
||||||
std::list<Actor>::const_iterator end() const { return mActors.end(); }
|
std::list<Actor>::const_iterator end() const { return mActors.end(); }
|
||||||
std::size_t size() const { return mActors.size(); }
|
std::size_t size() const { return mActors.size(); }
|
||||||
|
@ -56,8 +54,6 @@ namespace MWMechanics
|
||||||
/// paused we may want to do it manually (after equipping permanent enchantment)
|
/// paused we may want to do it manually (after equipping permanent enchantment)
|
||||||
void updateMagicEffects(const MWWorld::Ptr& ptr) const;
|
void updateMagicEffects(const MWWorld::Ptr& ptr) const;
|
||||||
|
|
||||||
void updateProcessingRange();
|
|
||||||
|
|
||||||
void addActor(const MWWorld::Ptr& ptr, bool updateImmediately = false);
|
void addActor(const MWWorld::Ptr& ptr, bool updateImmediately = false);
|
||||||
///< Register an actor for stats management
|
///< Register an actor for stats management
|
||||||
///
|
///
|
||||||
|
@ -186,8 +182,6 @@ namespace MWMechanics
|
||||||
float mTimerUpdateHello = 0;
|
float mTimerUpdateHello = 0;
|
||||||
float mSneakTimer = 0; // Times update of sneak icon
|
float mSneakTimer = 0; // Times update of sneak icon
|
||||||
float mSneakSkillTimer = 0; // Times sneak skill progress from "avoid notice"
|
float mSneakSkillTimer = 0; // Times sneak skill progress from "avoid notice"
|
||||||
float mActorsProcessingRange;
|
|
||||||
bool mSmoothMovement;
|
|
||||||
MusicType mCurrentMusic = MusicType::Title;
|
MusicType mCurrentMusic = MusicType::Title;
|
||||||
|
|
||||||
void updateVisibility(const MWWorld::Ptr& ptr, CharacterController& ctrl) const;
|
void updateVisibility(const MWWorld::Ptr& ptr, CharacterController& ctrl) const;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <components/esm3/loadcell.hpp>
|
#include <components/esm3/loadcell.hpp>
|
||||||
#include <components/esm3/loadland.hpp>
|
#include <components/esm3/loadland.hpp>
|
||||||
#include <components/misc/coordinateconverter.hpp>
|
#include <components/misc/coordinateconverter.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
|
@ -190,7 +190,7 @@ bool MWMechanics::AiPackage::pathTo(const MWWorld::Ptr& actor, const osg::Vec3f&
|
||||||
const float pointTolerance
|
const float pointTolerance
|
||||||
= getPointTolerance(actor.getClass().getMaxSpeed(actor), duration, world->getHalfExtents(actor));
|
= getPointTolerance(actor.getClass().getMaxSpeed(actor), duration, world->getHalfExtents(actor));
|
||||||
|
|
||||||
static const bool smoothMovement = Settings::Manager::getBool("smooth movement", "Game");
|
const bool smoothMovement = Settings::game().mSmoothMovement;
|
||||||
|
|
||||||
PathFinder::UpdateFlags updateFlags{};
|
PathFinder::UpdateFlags updateFlags{};
|
||||||
|
|
||||||
|
@ -469,15 +469,12 @@ bool MWMechanics::AiPackage::isReachableRotatingOnTheRun(const MWWorld::Ptr& act
|
||||||
|
|
||||||
DetourNavigator::Flags MWMechanics::AiPackage::getNavigatorFlags(const MWWorld::Ptr& actor) const
|
DetourNavigator::Flags MWMechanics::AiPackage::getNavigatorFlags(const MWWorld::Ptr& actor) const
|
||||||
{
|
{
|
||||||
static const bool allowToFollowOverWaterSurface
|
|
||||||
= Settings::Manager::getBool("allow actors to follow over water surface", "Game");
|
|
||||||
|
|
||||||
const MWWorld::Class& actorClass = actor.getClass();
|
const MWWorld::Class& actorClass = actor.getClass();
|
||||||
DetourNavigator::Flags result = DetourNavigator::Flag_none;
|
DetourNavigator::Flags result = DetourNavigator::Flag_none;
|
||||||
|
|
||||||
if ((actorClass.isPureWaterCreature(actor)
|
if ((actorClass.isPureWaterCreature(actor)
|
||||||
|| (getTypeId() != AiPackageTypeId::Wander
|
|| (getTypeId() != AiPackageTypeId::Wander
|
||||||
&& ((allowToFollowOverWaterSurface && getTypeId() == AiPackageTypeId::Follow)
|
&& ((Settings::game().mAllowActorsToFollowOverWaterSurface && getTypeId() == AiPackageTypeId::Follow)
|
||||||
|| actorClass.canSwim(actor) || hasWaterWalking(actor))))
|
|| actorClass.canSwim(actor) || hasWaterWalking(actor))))
|
||||||
&& actorClass.getSwimSpeed(actor) > 0)
|
&& actorClass.getSwimSpeed(actor) > 0)
|
||||||
result |= DetourNavigator::Flag_swim;
|
result |= DetourNavigator::Flag_swim;
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include <components/misc/strings/algorithm.hpp>
|
#include <components/misc/strings/algorithm.hpp>
|
||||||
#include <components/misc/strings/conversion.hpp>
|
#include <components/misc/strings/conversion.hpp>
|
||||||
|
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include <components/sceneutil/positionattitudetransform.hpp>
|
#include <components/sceneutil/positionattitudetransform.hpp>
|
||||||
|
|
||||||
|
@ -1509,9 +1509,7 @@ namespace MWMechanics
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const bool useCastingAnimations
|
if (isMagicItem && !Settings::game().mUseMagicItemAnimations)
|
||||||
= Settings::Manager::getBool("use magic item animations", "Game");
|
|
||||||
if (isMagicItem && !useCastingAnimations)
|
|
||||||
{
|
{
|
||||||
world->breakInvisibility(mPtr);
|
world->breakInvisibility(mPtr);
|
||||||
// Enchanted items by default do not use casting animations
|
// Enchanted items by default do not use casting animations
|
||||||
|
@ -1619,7 +1617,7 @@ namespace MWMechanics
|
||||||
mAttackType = "shoot";
|
mAttackType = "shoot";
|
||||||
else if (mPtr == getPlayer())
|
else if (mPtr == getPlayer())
|
||||||
{
|
{
|
||||||
if (Settings::Manager::getBool("best attack", "Game"))
|
if (Settings::game().mBestAttack)
|
||||||
{
|
{
|
||||||
if (!mWeapon.isEmpty() && mWeapon.getType() == ESM::Weapon::sRecordId)
|
if (!mWeapon.isEmpty() && mWeapon.getType() == ESM::Weapon::sRecordId)
|
||||||
{
|
{
|
||||||
|
@ -1864,8 +1862,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
float scale = mPtr.getCellRef().getScale();
|
float scale = mPtr.getCellRef().getScale();
|
||||||
|
|
||||||
static const bool normalizeSpeed = Settings::Manager::getBool("normalise race speed", "Game");
|
if (!Settings::game().mNormaliseRaceSpeed && cls.isNpc())
|
||||||
if (!normalizeSpeed && cls.isNpc())
|
|
||||||
{
|
{
|
||||||
const ESM::NPC* npc = mPtr.get<ESM::NPC>()->mBase;
|
const ESM::NPC* npc = mPtr.get<ESM::NPC>()->mBase;
|
||||||
const ESM::Race* race = world->getStore().get<ESM::Race>().find(npc->mRace);
|
const ESM::Race* race = world->getStore().get<ESM::Race>().find(npc->mRace);
|
||||||
|
@ -1913,11 +1910,9 @@ namespace MWMechanics
|
||||||
movementSettings.mSpeedFactor = std::min(vec.length(), 1.f);
|
movementSettings.mSpeedFactor = std::min(vec.length(), 1.f);
|
||||||
vec.normalize();
|
vec.normalize();
|
||||||
|
|
||||||
static const bool smoothMovement = Settings::Manager::getBool("smooth movement", "Game");
|
const bool smoothMovement = Settings::game().mSmoothMovement;
|
||||||
if (smoothMovement)
|
if (smoothMovement)
|
||||||
{
|
{
|
||||||
static const float playerTurningCoef = 1.0
|
|
||||||
/ std::max(0.01f, Settings::Manager::getFloat("smooth movement player turning delay", "Game"));
|
|
||||||
float angle = mPtr.getRefData().getPosition().rot[2];
|
float angle = mPtr.getRefData().getPosition().rot[2];
|
||||||
osg::Vec2f targetSpeed
|
osg::Vec2f targetSpeed
|
||||||
= Misc::rotateVec2f(osg::Vec2f(vec.x(), vec.y()), -angle) * movementSettings.mSpeedFactor;
|
= Misc::rotateVec2f(osg::Vec2f(vec.x(), vec.y()), -angle) * movementSettings.mSpeedFactor;
|
||||||
|
@ -1930,7 +1925,7 @@ namespace MWMechanics
|
||||||
maxDelta = 1;
|
maxDelta = 1;
|
||||||
else if (std::abs(speedDelta) < deltaLen / 2)
|
else if (std::abs(speedDelta) < deltaLen / 2)
|
||||||
// Turning is smooth for player and less smooth for NPCs (otherwise NPC can miss a path point).
|
// Turning is smooth for player and less smooth for NPCs (otherwise NPC can miss a path point).
|
||||||
maxDelta = duration * (isPlayer ? playerTurningCoef : 6.f);
|
maxDelta = duration * (isPlayer ? 1.0 / Settings::game().mSmoothMovementPlayerTurningDelay : 6.f);
|
||||||
else if (isPlayer && speedDelta < -deltaLen / 2)
|
else if (isPlayer && speedDelta < -deltaLen / 2)
|
||||||
// As soon as controls are released, mwinput switches player from running to walking.
|
// As soon as controls are released, mwinput switches player from running to walking.
|
||||||
// So stopping should be instant for player, otherwise it causes a small twitch.
|
// So stopping should be instant for player, otherwise it causes a small twitch.
|
||||||
|
@ -1964,8 +1959,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
float effectiveRotation = rot.z();
|
float effectiveRotation = rot.z();
|
||||||
bool canMove = cls.getMaxSpeed(mPtr) > 0;
|
bool canMove = cls.getMaxSpeed(mPtr) > 0;
|
||||||
static const bool turnToMovementDirection
|
const bool turnToMovementDirection = Settings::game().mTurnToMovementDirection;
|
||||||
= Settings::Manager::getBool("turn to movement direction", "Game");
|
|
||||||
if (!turnToMovementDirection || isFirstPersonPlayer)
|
if (!turnToMovementDirection || isFirstPersonPlayer)
|
||||||
{
|
{
|
||||||
movementSettings.mIsStrafing = std::abs(vec.x()) > std::abs(vec.y()) * 2;
|
movementSettings.mIsStrafing = std::abs(vec.x()) > std::abs(vec.y()) * 2;
|
||||||
|
@ -2230,13 +2224,11 @@ namespace MWMechanics
|
||||||
else
|
else
|
||||||
mAnimation->setBodyPitchRadians(0);
|
mAnimation->setBodyPitchRadians(0);
|
||||||
|
|
||||||
static const bool swimUpwardCorrection = Settings::Manager::getBool("swim upward correction", "Game");
|
if (inwater && isPlayer && !isFirstPersonPlayer && Settings::game().mSwimUpwardCorrection)
|
||||||
if (inwater && isPlayer && !isFirstPersonPlayer && swimUpwardCorrection)
|
|
||||||
{
|
{
|
||||||
static const float swimUpwardCoef = Settings::Manager::getFloat("swim upward coef", "Game");
|
const float swimUpwardCoef = Settings::game().mSwimUpwardCoef;
|
||||||
static const float swimForwardCoef = sqrtf(1.0f - swimUpwardCoef * swimUpwardCoef);
|
|
||||||
vec.z() = std::abs(vec.y()) * swimUpwardCoef;
|
vec.z() = std::abs(vec.y()) * swimUpwardCoef;
|
||||||
vec.y() *= swimForwardCoef;
|
vec.y() *= std::sqrt(1.0f - swimUpwardCoef * swimUpwardCoef);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Player can not use smooth turning as NPCs, so we play turning animation a bit to avoid jittering
|
// Player can not use smooth turning as NPCs, so we play turning animation a bit to avoid jittering
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include "combat.hpp"
|
#include "combat.hpp"
|
||||||
|
|
||||||
#include <components/misc/rng.hpp>
|
#include <components/misc/rng.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include <components/sceneutil/positionattitudetransform.hpp>
|
#include <components/sceneutil/positionattitudetransform.hpp>
|
||||||
|
|
||||||
|
@ -174,8 +174,7 @@ namespace MWMechanics
|
||||||
bool isMagical = flags & ESM::Weapon::Magical;
|
bool isMagical = flags & ESM::Weapon::Magical;
|
||||||
bool isEnchanted = !weapon.getClass().getEnchantment(weapon).empty();
|
bool isEnchanted = !weapon.getClass().getEnchantment(weapon).empty();
|
||||||
|
|
||||||
return !isSilver && !isMagical
|
return !isSilver && !isMagical && (!isEnchanted || !Settings::game().mEnchantedWeaponsAreMagical);
|
||||||
&& (!isEnchanted || !Settings::Manager::getBool("enchanted weapons are magical", "Game"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void resistNormalWeapon(
|
void resistNormalWeapon(
|
||||||
|
@ -251,8 +250,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
if (validVictim)
|
if (validVictim)
|
||||||
{
|
{
|
||||||
if (weapon == projectile
|
if (weapon == projectile || Settings::game().mOnlyAppropriateAmmunitionBypassesResistance
|
||||||
|| Settings::Manager::getBool("only appropriate ammunition bypasses resistance", "Game")
|
|
||||||
|| isNormalWeapon(weapon))
|
|| isNormalWeapon(weapon))
|
||||||
resistNormalWeapon(victim, attacker, projectile, damage);
|
resistNormalWeapon(victim, attacker, projectile, damage);
|
||||||
applyWerewolfDamageMult(victim, projectile, damage);
|
applyWerewolfDamageMult(victim, projectile, damage);
|
||||||
|
@ -469,7 +467,7 @@ namespace MWMechanics
|
||||||
// 0 = Do not factor strength into hand-to-hand combat.
|
// 0 = Do not factor strength into hand-to-hand combat.
|
||||||
// 1 = Factor into werewolf hand-to-hand combat.
|
// 1 = Factor into werewolf hand-to-hand combat.
|
||||||
// 2 = Ignore werewolves.
|
// 2 = Ignore werewolves.
|
||||||
int factorStrength = Settings::Manager::getInt("strength influences hand to hand", "Game");
|
const int factorStrength = Settings::game().mStrengthInfluencesHandToHand;
|
||||||
if (factorStrength == 1 || (factorStrength == 2 && !isWerewolf))
|
if (factorStrength == 1 || (factorStrength == 2 && !isWerewolf))
|
||||||
{
|
{
|
||||||
damage
|
damage
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "difficultyscaling.hpp"
|
#include "difficultyscaling.hpp"
|
||||||
|
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
|
@ -12,13 +12,10 @@ float scaleDamage(float damage, const MWWorld::Ptr& attacker, const MWWorld::Ptr
|
||||||
{
|
{
|
||||||
const MWWorld::Ptr& player = MWMechanics::getPlayer();
|
const MWWorld::Ptr& player = MWMechanics::getPlayer();
|
||||||
|
|
||||||
// [-500, 500]
|
|
||||||
const int difficultySetting = std::clamp(Settings::Manager::getInt("difficulty", "Game"), -500, 500);
|
|
||||||
|
|
||||||
static const float fDifficultyMult
|
static const float fDifficultyMult
|
||||||
= MWBase::Environment::get().getESMStore()->get<ESM::GameSetting>().find("fDifficultyMult")->mValue.getFloat();
|
= MWBase::Environment::get().getESMStore()->get<ESM::GameSetting>().find("fDifficultyMult")->mValue.getFloat();
|
||||||
|
|
||||||
float difficultyTerm = 0.01f * difficultySetting;
|
const float difficultyTerm = 0.01f * Settings::game().mDifficulty;
|
||||||
|
|
||||||
float x = 0;
|
float x = 0;
|
||||||
if (victim == player)
|
if (victim == player)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include <components/esm3/loadcrea.hpp>
|
#include <components/esm3/loadcrea.hpp>
|
||||||
#include <components/esm3/loadmgef.hpp>
|
#include <components/esm3/loadmgef.hpp>
|
||||||
#include <components/misc/rng.hpp>
|
#include <components/misc/rng.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include "../mwworld/class.hpp"
|
#include "../mwworld/class.hpp"
|
||||||
#include "../mwworld/containerstore.hpp"
|
#include "../mwworld/containerstore.hpp"
|
||||||
|
@ -368,11 +368,10 @@ namespace MWMechanics
|
||||||
ESM::WeaponType::Class weapclass = MWMechanics::getWeaponType(mWeaponType)->mWeaponClass;
|
ESM::WeaponType::Class weapclass = MWMechanics::getWeaponType(mWeaponType)->mWeaponClass;
|
||||||
if (weapclass == ESM::WeaponType::Thrown || weapclass == ESM::WeaponType::Ammo)
|
if (weapclass == ESM::WeaponType::Thrown || weapclass == ESM::WeaponType::Ammo)
|
||||||
{
|
{
|
||||||
static const float multiplier
|
|
||||||
= std::clamp(Settings::Manager::getFloat("projectiles enchant multiplier", "Game"), 0.f, 1.f);
|
|
||||||
MWWorld::Ptr player = getPlayer();
|
MWWorld::Ptr player = getPlayer();
|
||||||
count = player.getClass().getContainerStore(player).count(mOldItemPtr.getCellRef().getRefId());
|
count = player.getClass().getContainerStore(player).count(mOldItemPtr.getCellRef().getRefId());
|
||||||
count = std::clamp<int>(getGemCharge() * multiplier / enchantPoints, 1, count);
|
count = std::clamp<int>(
|
||||||
|
getGemCharge() * Settings::game().mProjectilesEnchantMultiplier / enchantPoints, 1, count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -381,8 +380,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
float Enchanting::getTypeMultiplier() const
|
float Enchanting::getTypeMultiplier() const
|
||||||
{
|
{
|
||||||
static const bool useMultiplier = Settings::Manager::getFloat("projectiles enchant multiplier", "Game") > 0;
|
if (Settings::game().mProjectilesEnchantMultiplier > 0 && mWeaponType != -1 && getEnchantPoints() > 0)
|
||||||
if (useMultiplier && mWeaponType != -1 && getEnchantPoints() > 0)
|
|
||||||
{
|
{
|
||||||
ESM::WeaponType::Class weapclass = MWMechanics::getWeaponType(mWeaponType)->mWeaponClass;
|
ESM::WeaponType::Class weapclass = MWMechanics::getWeaponType(mWeaponType)->mWeaponClass;
|
||||||
if (weapclass == ESM::WeaponType::Thrown || weapclass == ESM::WeaponType::Ammo)
|
if (weapclass == ESM::WeaponType::Thrown || weapclass == ESM::WeaponType::Ammo)
|
||||||
|
|
|
@ -350,8 +350,6 @@ namespace MWMechanics
|
||||||
if (state != MWBase::StateManager::State_Running)
|
if (state != MWBase::StateManager::State_Running)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
mActors.updateProcessingRange();
|
|
||||||
|
|
||||||
// Update mechanics for new processing range immediately
|
// Update mechanics for new processing range immediately
|
||||||
update(0.f, false);
|
update(0.f, false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include <components/esm3/loadstat.hpp>
|
#include <components/esm3/loadstat.hpp>
|
||||||
#include <components/misc/resourcehelpers.hpp>
|
#include <components/misc/resourcehelpers.hpp>
|
||||||
#include <components/misc/rng.hpp>
|
#include <components/misc/rng.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/mechanicsmanager.hpp"
|
#include "../mwbase/mechanicsmanager.hpp"
|
||||||
|
@ -649,9 +649,8 @@ namespace MWMechanics
|
||||||
modDynamicStat(target, index, -effect.mMagnitude);
|
modDynamicStat(target, index, -effect.mMagnitude);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
static const bool uncappedDamageFatigue
|
adjustDynamicStat(
|
||||||
= Settings::Manager::getBool("uncapped damage fatigue", "Game");
|
target, index, -effect.mMagnitude, index == 2 && Settings::game().mUncappedDamageFatigue);
|
||||||
adjustDynamicStat(target, index, -effect.mMagnitude, index == 2 && uncappedDamageFatigue);
|
|
||||||
if (index == 0)
|
if (index == 0)
|
||||||
receivedMagicDamage = affectedHealth = true;
|
receivedMagicDamage = affectedHealth = true;
|
||||||
}
|
}
|
||||||
|
@ -716,10 +715,9 @@ namespace MWMechanics
|
||||||
case ESM::MagicEffect::DrainFatigue:
|
case ESM::MagicEffect::DrainFatigue:
|
||||||
if (!godmode)
|
if (!godmode)
|
||||||
{
|
{
|
||||||
static const bool uncappedDamageFatigue
|
|
||||||
= Settings::Manager::getBool("uncapped damage fatigue", "Game");
|
|
||||||
int index = effect.mEffectId - ESM::MagicEffect::DrainHealth;
|
int index = effect.mEffectId - ESM::MagicEffect::DrainHealth;
|
||||||
adjustDynamicStat(target, index, -effect.mMagnitude, uncappedDamageFatigue && index == 2);
|
adjustDynamicStat(
|
||||||
|
target, index, -effect.mMagnitude, Settings::game().mUncappedDamageFatigue && index == 2);
|
||||||
if (index == 0)
|
if (index == 0)
|
||||||
receivedMagicDamage = affectedHealth = true;
|
receivedMagicDamage = affectedHealth = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#include "steering.hpp"
|
#include "steering.hpp"
|
||||||
|
|
||||||
#include <components/misc/mathutil.hpp>
|
#include <components/misc/mathutil.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include "../mwworld/class.hpp"
|
#include "../mwworld/class.hpp"
|
||||||
#include "../mwworld/ptr.hpp"
|
#include "../mwworld/ptr.hpp"
|
||||||
|
@ -26,8 +26,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
float limit
|
float limit
|
||||||
= getAngularVelocity(actor.getClass().getMaxSpeed(actor)) * MWBase::Environment::get().getFrameDuration();
|
= getAngularVelocity(actor.getClass().getMaxSpeed(actor)) * MWBase::Environment::get().getFrameDuration();
|
||||||
static const bool smoothMovement = Settings::Manager::getBool("smooth movement", "Game");
|
if (Settings::game().mSmoothMovement)
|
||||||
if (smoothMovement)
|
|
||||||
limit *= std::min(absDiff / osg::PI + 0.1, 0.5);
|
limit *= std::min(absDiff / osg::PI + 0.1, 0.5);
|
||||||
|
|
||||||
if (absDiff > limit)
|
if (absDiff > limit)
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#include <components/misc/strings/conversion.hpp>
|
#include <components/misc/strings/conversion.hpp>
|
||||||
#include <components/resource/bulletshapemanager.hpp>
|
#include <components/resource/bulletshapemanager.hpp>
|
||||||
#include <components/resource/resourcesystem.hpp>
|
#include <components/resource/resourcesystem.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
|
@ -104,8 +104,6 @@ namespace MWPhysics
|
||||||
, mWaterEnabled(false)
|
, mWaterEnabled(false)
|
||||||
, mParentNode(parentNode)
|
, mParentNode(parentNode)
|
||||||
, mPhysicsDt(1.f / 60.f)
|
, mPhysicsDt(1.f / 60.f)
|
||||||
, mActorCollisionShapeType(
|
|
||||||
DetourNavigator::toCollisionShapeType(Settings::Manager::getInt("actor collision shape type", "Game")))
|
|
||||||
{
|
{
|
||||||
mResourceSystem->addResourceManager(mShapeManager.get());
|
mResourceSystem->addResourceManager(mShapeManager.get());
|
||||||
|
|
||||||
|
@ -668,7 +666,8 @@ namespace MWPhysics
|
||||||
const MWMechanics::MagicEffects& effects = ptr.getClass().getCreatureStats(ptr).getMagicEffects();
|
const MWMechanics::MagicEffects& effects = ptr.getClass().getCreatureStats(ptr).getMagicEffects();
|
||||||
const bool canWaterWalk = effects.getOrDefault(ESM::MagicEffect::WaterWalking).getMagnitude() > 0;
|
const bool canWaterWalk = effects.getOrDefault(ESM::MagicEffect::WaterWalking).getMagnitude() > 0;
|
||||||
|
|
||||||
auto actor = std::make_shared<Actor>(ptr, shape, mTaskScheduler.get(), canWaterWalk, mActorCollisionShapeType);
|
auto actor = std::make_shared<Actor>(
|
||||||
|
ptr, shape, mTaskScheduler.get(), canWaterWalk, Settings::game().mActorCollisionShapeType);
|
||||||
|
|
||||||
mActors.emplace(ptr.mRef, std::move(actor));
|
mActors.emplace(ptr.mRef, std::move(actor));
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
#include <osg/Timer>
|
#include <osg/Timer>
|
||||||
#include <osg/ref_ptr>
|
#include <osg/ref_ptr>
|
||||||
|
|
||||||
#include <components/detournavigator/collisionshapetype.hpp>
|
|
||||||
#include <components/esm/util.hpp>
|
#include <components/esm/util.hpp>
|
||||||
|
|
||||||
#include "../mwworld/ptr.hpp"
|
#include "../mwworld/ptr.hpp"
|
||||||
|
@ -342,8 +341,6 @@ namespace MWPhysics
|
||||||
|
|
||||||
float mPhysicsDt;
|
float mPhysicsDt;
|
||||||
|
|
||||||
DetourNavigator::CollisionShapeType mActorCollisionShapeType;
|
|
||||||
|
|
||||||
std::size_t mSimulationsCounter = 0;
|
std::size_t mSimulationsCounter = 0;
|
||||||
std::array<std::vector<Simulation>, 2> mSimulations;
|
std::array<std::vector<Simulation>, 2> mSimulations;
|
||||||
std::vector<std::pair<MWWorld::Ptr, osg::Vec3f>> mActorsPositions;
|
std::vector<std::pair<MWWorld::Ptr, osg::Vec3f>> mActorsPositions;
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
#include <components/misc/resourcehelpers.hpp>
|
#include <components/misc/resourcehelpers.hpp>
|
||||||
|
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include <components/vfs/manager.hpp>
|
#include <components/vfs/manager.hpp>
|
||||||
|
|
||||||
|
@ -163,8 +163,7 @@ namespace MWRender
|
||||||
|
|
||||||
bool ActorAnimation::updateCarriedLeftVisible(const int weaptype) const
|
bool ActorAnimation::updateCarriedLeftVisible(const int weaptype) const
|
||||||
{
|
{
|
||||||
static const bool shieldSheathing = Settings::Manager::getBool("shield sheathing", "Game");
|
if (Settings::game().mShieldSheathing)
|
||||||
if (shieldSheathing)
|
|
||||||
{
|
{
|
||||||
const MWWorld::Class& cls = mPtr.getClass();
|
const MWWorld::Class& cls = mPtr.getClass();
|
||||||
MWMechanics::CreatureStats& stats = cls.getCreatureStats(mPtr);
|
MWMechanics::CreatureStats& stats = cls.getCreatureStats(mPtr);
|
||||||
|
@ -189,8 +188,7 @@ namespace MWRender
|
||||||
|
|
||||||
void ActorAnimation::updateHolsteredShield(bool showCarriedLeft)
|
void ActorAnimation::updateHolsteredShield(bool showCarriedLeft)
|
||||||
{
|
{
|
||||||
static const bool shieldSheathing = Settings::Manager::getBool("shield sheathing", "Game");
|
if (!Settings::game().mShieldSheathing)
|
||||||
if (!shieldSheathing)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!mPtr.getClass().hasInventoryStore(mPtr))
|
if (!mPtr.getClass().hasInventoryStore(mPtr))
|
||||||
|
@ -256,8 +254,7 @@ namespace MWRender
|
||||||
|
|
||||||
bool ActorAnimation::useShieldAnimations() const
|
bool ActorAnimation::useShieldAnimations() const
|
||||||
{
|
{
|
||||||
static const bool shieldSheathing = Settings::Manager::getBool("shield sheathing", "Game");
|
if (!Settings::game().mShieldSheathing)
|
||||||
if (!shieldSheathing)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const MWWorld::Class& cls = mPtr.getClass();
|
const MWWorld::Class& cls = mPtr.getClass();
|
||||||
|
@ -325,8 +322,7 @@ namespace MWRender
|
||||||
|
|
||||||
void ActorAnimation::updateHolsteredWeapon(bool showHolsteredWeapons)
|
void ActorAnimation::updateHolsteredWeapon(bool showHolsteredWeapons)
|
||||||
{
|
{
|
||||||
static const bool weaponSheathing = Settings::Manager::getBool("weapon sheathing", "Game");
|
if (!Settings::game().mWeaponSheathing)
|
||||||
if (!weaponSheathing)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!mPtr.getClass().hasInventoryStore(mPtr))
|
if (!mPtr.getClass().hasInventoryStore(mPtr))
|
||||||
|
@ -405,8 +401,7 @@ namespace MWRender
|
||||||
|
|
||||||
void ActorAnimation::updateQuiver()
|
void ActorAnimation::updateQuiver()
|
||||||
{
|
{
|
||||||
static const bool weaponSheathing = Settings::Manager::getBool("weapon sheathing", "Game");
|
if (!Settings::game().mWeaponSheathing)
|
||||||
if (!weaponSheathing)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!mPtr.getClass().hasInventoryStore(mPtr))
|
if (!mPtr.getClass().hasInventoryStore(mPtr))
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
#include <components/sceneutil/util.hpp>
|
#include <components/sceneutil/util.hpp>
|
||||||
#include <components/sceneutil/visitor.hpp>
|
#include <components/sceneutil/visitor.hpp>
|
||||||
|
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
|
@ -616,8 +616,7 @@ namespace MWRender
|
||||||
|
|
||||||
addSingleAnimSource(kfname, baseModel);
|
addSingleAnimSource(kfname, baseModel);
|
||||||
|
|
||||||
static const bool useAdditionalSources = Settings::Manager::getBool("use additional anim sources", "Game");
|
if (Settings::game().mUseAdditionalAnimSources)
|
||||||
if (useAdditionalSources)
|
|
||||||
loadAllAnimationsInFolder(kfname, baseModel);
|
loadAllAnimationsInFolder(kfname, baseModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1388,11 +1387,10 @@ namespace MWRender
|
||||||
mAccumRoot = nullptr;
|
mAccumRoot = nullptr;
|
||||||
mAccumCtrl = nullptr;
|
mAccumCtrl = nullptr;
|
||||||
|
|
||||||
static const bool useAdditionalSources = Settings::Manager::getBool("use additional anim sources", "Game");
|
|
||||||
std::string defaultSkeleton;
|
std::string defaultSkeleton;
|
||||||
bool inject = false;
|
bool inject = false;
|
||||||
|
|
||||||
if (useAdditionalSources && mPtr.getClass().isActor())
|
if (Settings::game().mUseAdditionalAnimSources && mPtr.getClass().isActor())
|
||||||
{
|
{
|
||||||
if (isCreature)
|
if (isCreature)
|
||||||
{
|
{
|
||||||
|
@ -1867,8 +1865,7 @@ namespace MWRender
|
||||||
visitor.remove();
|
visitor.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings::Manager::getBool("day night switches", "Game")
|
if (Settings::game().mDayNightSwitches && SceneUtil::hasUserDescription(mObjectRoot, Constants::NightDayLabel))
|
||||||
&& SceneUtil::hasUserDescription(mObjectRoot, Constants::NightDayLabel))
|
|
||||||
{
|
{
|
||||||
AddSwitchCallbacksVisitor visitor;
|
AddSwitchCallbacksVisitor visitor;
|
||||||
mObjectRoot->accept(visitor);
|
mObjectRoot->accept(visitor);
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include <components/sceneutil/keyframe.hpp>
|
#include <components/sceneutil/keyframe.hpp>
|
||||||
#include <components/sceneutil/lightcommon.hpp>
|
#include <components/sceneutil/lightcommon.hpp>
|
||||||
#include <components/sceneutil/visitor.hpp>
|
#include <components/sceneutil/visitor.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include <components/vfs/manager.hpp>
|
#include <components/vfs/manager.hpp>
|
||||||
|
|
||||||
|
@ -297,8 +297,7 @@ namespace MWRender
|
||||||
rebuild();
|
rebuild();
|
||||||
setRenderBin();
|
setRenderBin();
|
||||||
|
|
||||||
static const bool shieldSheathing = Settings::Manager::getBool("shield sheathing", "Game");
|
if (viewChange && Settings::game().mShieldSheathing)
|
||||||
if (viewChange && shieldSheathing)
|
|
||||||
{
|
{
|
||||||
int weaptype = ESM::Weapon::None;
|
int weaptype = ESM::Weapon::None;
|
||||||
MWMechanics::getActiveWeapon(mPtr, &weaptype);
|
MWMechanics::getActiveWeapon(mPtr, &weaptype);
|
||||||
|
@ -988,8 +987,7 @@ namespace MWRender
|
||||||
|
|
||||||
bool NpcAnimation::updateCarriedLeftVisible(const int weaptype) const
|
bool NpcAnimation::updateCarriedLeftVisible(const int weaptype) const
|
||||||
{
|
{
|
||||||
static const bool shieldSheathing = Settings::Manager::getBool("shield sheathing", "Game");
|
if (Settings::game().mShieldSheathing)
|
||||||
if (shieldSheathing)
|
|
||||||
{
|
{
|
||||||
const MWWorld::Class& cls = mPtr.getClass();
|
const MWWorld::Class& cls = mPtr.getClass();
|
||||||
MWMechanics::CreatureStats& stats = cls.getCreatureStats(mPtr);
|
MWMechanics::CreatureStats& stats = cls.getCreatureStats(mPtr);
|
||||||
|
@ -1125,8 +1123,7 @@ namespace MWRender
|
||||||
|
|
||||||
void NpcAnimation::equipmentChanged()
|
void NpcAnimation::equipmentChanged()
|
||||||
{
|
{
|
||||||
static const bool shieldSheathing = Settings::Manager::getBool("shield sheathing", "Game");
|
if (Settings::game().mShieldSheathing)
|
||||||
if (shieldSheathing)
|
|
||||||
{
|
{
|
||||||
int weaptype = ESM::Weapon::None;
|
int weaptype = ESM::Weapon::None;
|
||||||
MWMechanics::getActiveWeapon(mPtr, &weaptype);
|
MWMechanics::getActiveWeapon(mPtr, &weaptype);
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#include <components/sceneutil/nodecallback.hpp>
|
#include <components/sceneutil/nodecallback.hpp>
|
||||||
#include <components/sceneutil/visitor.hpp>
|
#include <components/sceneutil/visitor.hpp>
|
||||||
|
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include "../mwworld/class.hpp"
|
#include "../mwworld/class.hpp"
|
||||||
#include "../mwworld/esmstore.hpp"
|
#include "../mwworld/esmstore.hpp"
|
||||||
|
@ -431,7 +431,7 @@ namespace MWWorld
|
||||||
|
|
||||||
void ProjectileManager::moveMagicBolts(float duration)
|
void ProjectileManager::moveMagicBolts(float duration)
|
||||||
{
|
{
|
||||||
static const bool normaliseRaceSpeed = Settings::Manager::getBool("normalise race speed", "Game");
|
const bool normaliseRaceSpeed = Settings::game().mNormaliseRaceSpeed;
|
||||||
for (auto& magicBoltState : mMagicBolts)
|
for (auto& magicBoltState : mMagicBolts)
|
||||||
{
|
{
|
||||||
if (magicBoltState.mToDelete)
|
if (magicBoltState.mToDelete)
|
||||||
|
|
|
@ -53,6 +53,8 @@
|
||||||
#include <components/files/conversion.hpp>
|
#include <components/files/conversion.hpp>
|
||||||
#include <components/loadinglistener/loadinglistener.hpp>
|
#include <components/loadinglistener/loadinglistener.hpp>
|
||||||
|
|
||||||
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/luamanager.hpp"
|
#include "../mwbase/luamanager.hpp"
|
||||||
#include "../mwbase/mechanicsmanager.hpp"
|
#include "../mwbase/mechanicsmanager.hpp"
|
||||||
|
@ -256,9 +258,6 @@ namespace MWWorld
|
||||||
, mDiscardMovements(true)
|
, mDiscardMovements(true)
|
||||||
, mContentFiles(contentFiles)
|
, mContentFiles(contentFiles)
|
||||||
, mUserDataPath(userDataPath)
|
, mUserDataPath(userDataPath)
|
||||||
, mDefaultHalfExtents(Settings::Manager::getVector3("default actor pathfind half extents", "Game"))
|
|
||||||
, mDefaultActorCollisionShapeType(
|
|
||||||
DetourNavigator::toCollisionShapeType(Settings::Manager::getInt("actor collision shape type", "Game")))
|
|
||||||
, mActivationDistanceOverride(activationDistanceOverride)
|
, mActivationDistanceOverride(activationDistanceOverride)
|
||||||
, mStartCell(startCell)
|
, mStartCell(startCell)
|
||||||
, mDistanceToFacedObject(-1.f)
|
, mDistanceToFacedObject(-1.f)
|
||||||
|
@ -3808,7 +3807,8 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
const MWPhysics::Actor* physicsActor = mPhysics->getActor(actor);
|
const MWPhysics::Actor* physicsActor = mPhysics->getActor(actor);
|
||||||
if (physicsActor == nullptr || !actor.isInCell() || actor.getCell()->isExterior())
|
if (physicsActor == nullptr || !actor.isInCell() || actor.getCell()->isExterior())
|
||||||
return DetourNavigator::AgentBounds{ mDefaultActorCollisionShapeType, mDefaultHalfExtents };
|
return DetourNavigator::AgentBounds{ Settings::game().mActorCollisionShapeType,
|
||||||
|
Settings::game().mDefaultActorPathfindHalfExtents };
|
||||||
else
|
else
|
||||||
return DetourNavigator::AgentBounds{ physicsActor->getCollisionShapeType(),
|
return DetourNavigator::AgentBounds{ physicsActor->getCollisionShapeType(),
|
||||||
physicsActor->getHalfExtents() };
|
physicsActor->getHalfExtents() };
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
#include <osg/Timer>
|
#include <osg/Timer>
|
||||||
#include <osg/ref_ptr>
|
#include <osg/ref_ptr>
|
||||||
|
|
||||||
#include <components/detournavigator/collisionshapetype.hpp>
|
|
||||||
#include <components/esm3/readerscache.hpp>
|
#include <components/esm3/readerscache.hpp>
|
||||||
#include <components/misc/rng.hpp>
|
#include <components/misc/rng.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/settings.hpp>
|
||||||
|
@ -114,9 +113,6 @@ namespace MWWorld
|
||||||
|
|
||||||
std::filesystem::path mUserDataPath;
|
std::filesystem::path mUserDataPath;
|
||||||
|
|
||||||
osg::Vec3f mDefaultHalfExtents;
|
|
||||||
DetourNavigator::CollisionShapeType mDefaultActorCollisionShapeType;
|
|
||||||
|
|
||||||
int mActivationDistanceOverride;
|
int mActivationDistanceOverride;
|
||||||
|
|
||||||
std::string mStartCell;
|
std::string mStartCell;
|
||||||
|
|
|
@ -25,6 +25,8 @@ namespace Settings
|
||||||
SettingValue<bool> mShowEnchantChance{ mIndex, "Game", "show enchant chance" };
|
SettingValue<bool> mShowEnchantChance{ mIndex, "Game", "show enchant chance" };
|
||||||
SettingValue<bool> mBestAttack{ mIndex, "Game", "best attack" };
|
SettingValue<bool> mBestAttack{ mIndex, "Game", "best attack" };
|
||||||
SettingValue<int> mDifficulty{ mIndex, "Game", "difficulty", makeClampSanitizerInt(-500, 500) };
|
SettingValue<int> mDifficulty{ mIndex, "Game", "difficulty", makeClampSanitizerInt(-500, 500) };
|
||||||
|
// We have to cap it since using high values (larger than 7168) will make some quests harder or impossible to
|
||||||
|
// complete (bug #1876)
|
||||||
SettingValue<int> mActorsProcessingRange{ mIndex, "Game", "actors processing range",
|
SettingValue<int> mActorsProcessingRange{ mIndex, "Game", "actors processing range",
|
||||||
makeClampSanitizerInt(3584, 7168) };
|
makeClampSanitizerInt(3584, 7168) };
|
||||||
SettingValue<bool> mClassicReflectedAbsorbSpellsBehavior{ mIndex, "Game",
|
SettingValue<bool> mClassicReflectedAbsorbSpellsBehavior{ mIndex, "Game",
|
||||||
|
|
Loading…
Reference in a new issue