mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
Merge pull request #436 from OpenMW/master
Add OpenMW commits up to 22 May 2018
This commit is contained in:
commit
296c69d788
5 changed files with 44 additions and 26 deletions
|
@ -23,6 +23,7 @@ bool Launcher::AdvancedPage::loadSettings()
|
||||||
loadSettingBool(showEnchantChanceCheckBox, "show enchant chance", "Game");
|
loadSettingBool(showEnchantChanceCheckBox, "show enchant chance", "Game");
|
||||||
loadSettingBool(showMeleeInfoCheckBox, "show melee info", "Game");
|
loadSettingBool(showMeleeInfoCheckBox, "show melee info", "Game");
|
||||||
loadSettingBool(showProjectileDamageCheckBox, "show projectile damage", "Game");
|
loadSettingBool(showProjectileDamageCheckBox, "show projectile damage", "Game");
|
||||||
|
loadSettingBool(rebalanceSoulGemValuesCheckBox, "rebalance soul gem values", "Game");
|
||||||
|
|
||||||
// Expected values are (0, 1, 2, 3)
|
// Expected values are (0, 1, 2, 3)
|
||||||
int showOwnedIndex = mEngineSettings.getInt("show owned", "Game");
|
int showOwnedIndex = mEngineSettings.getInt("show owned", "Game");
|
||||||
|
@ -61,6 +62,7 @@ void Launcher::AdvancedPage::saveSettings()
|
||||||
saveSettingBool(showEnchantChanceCheckBox, "show enchant chance", "Game");
|
saveSettingBool(showEnchantChanceCheckBox, "show enchant chance", "Game");
|
||||||
saveSettingBool(showMeleeInfoCheckBox, "show melee info", "Game");
|
saveSettingBool(showMeleeInfoCheckBox, "show melee info", "Game");
|
||||||
saveSettingBool(showProjectileDamageCheckBox, "show projectile damage", "Game");
|
saveSettingBool(showProjectileDamageCheckBox, "show projectile damage", "Game");
|
||||||
|
saveSettingBool(rebalanceSoulGemValuesCheckBox, "rebalance soul gem values", "Game");
|
||||||
|
|
||||||
int showOwnedCurrentIndex = showOwnedComboBox->currentIndex();
|
int showOwnedCurrentIndex = showOwnedComboBox->currentIndex();
|
||||||
if (showOwnedCurrentIndex != mEngineSettings.getInt("show owned", "Game"))
|
if (showOwnedCurrentIndex != mEngineSettings.getInt("show owned", "Game"))
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "misc.hpp"
|
#include "misc.hpp"
|
||||||
|
|
||||||
#include <components/esm/loadmisc.hpp>
|
#include <components/esm/loadmisc.hpp>
|
||||||
|
#include <components/settings/settings.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
|
@ -85,7 +86,22 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
const ESM::Creature *creature = MWBase::Environment::get().getWorld()->getStore().get<ESM::Creature>().search(ref->mRef.getSoul());
|
const ESM::Creature *creature = MWBase::Environment::get().getWorld()->getStore().get<ESM::Creature>().search(ref->mRef.getSoul());
|
||||||
if (creature)
|
if (creature)
|
||||||
value *= creature->mData.mSoul;
|
{
|
||||||
|
int soul = creature->mData.mSoul;
|
||||||
|
if (Settings::Manager::getBool("rebalance soul gem values", "Game"))
|
||||||
|
{
|
||||||
|
// use the 'soul gem value rebalance' formula from the Morrowind Code Patch
|
||||||
|
float soulValue = 0.0001 * pow(soul, 3) + 2 * soul;
|
||||||
|
|
||||||
|
// for Azura's star add the unfilled value
|
||||||
|
if (Misc::StringUtils::ciEqual(ptr.getCellRef().getRefId(), "Misc_SoulGem_Azura"))
|
||||||
|
value += soulValue;
|
||||||
|
else
|
||||||
|
value = soulValue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
value *= soul;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
|
|
|
@ -189,35 +189,22 @@ public:
|
||||||
node->setViewDataMap(mViewDataMap);
|
node->setViewDataMap(mViewDataMap);
|
||||||
parent->addChild(node);
|
parent->addChild(node);
|
||||||
|
|
||||||
if (center.x() - size > mMaxX
|
if (node->getSize() > mMinSize)
|
||||||
|| center.x() + size < mMinX
|
|
||||||
|| center.y() - size > mMaxY
|
|
||||||
|| center.y() + size < mMinY )
|
|
||||||
// Out of bounds of the actual terrain - this will happen because
|
|
||||||
// we rounded the size up to the next power of two
|
|
||||||
{
|
|
||||||
// Still create and return an empty node so as to not break the assumption that each QuadTreeNode has either 4 or 0 children.
|
|
||||||
return node;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (node->getSize() <= mMinSize)
|
|
||||||
{
|
|
||||||
// We arrived at a leaf
|
|
||||||
float minZ,maxZ;
|
|
||||||
if (mStorage->getMinMaxHeights(size, center, minZ, maxZ))
|
|
||||||
{
|
|
||||||
float cellWorldSize = mStorage->getCellWorldSize();
|
|
||||||
osg::BoundingBox boundingBox(osg::Vec3f((center.x()-size)*cellWorldSize, (center.y()-size)*cellWorldSize, minZ),
|
|
||||||
osg::Vec3f((center.x()+size)*cellWorldSize, (center.y()+size)*cellWorldSize, maxZ));
|
|
||||||
node->setBoundingBox(boundingBox);
|
|
||||||
}
|
|
||||||
return node;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
addChildren(node);
|
addChildren(node);
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We arrived at a leaf
|
||||||
|
float minZ, maxZ;
|
||||||
|
mStorage->getMinMaxHeights(size, center, minZ, maxZ);
|
||||||
|
|
||||||
|
float cellWorldSize = mStorage->getCellWorldSize();
|
||||||
|
osg::BoundingBox boundingBox(osg::Vec3f((center.x()-size)*cellWorldSize, (center.y()-size)*cellWorldSize, minZ),
|
||||||
|
osg::Vec3f((center.x()+size)*cellWorldSize, (center.y()+size)*cellWorldSize, maxZ));
|
||||||
|
node->setBoundingBox(boundingBox);
|
||||||
|
|
||||||
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
osg::ref_ptr<RootNode> getRootNode()
|
osg::ref_ptr<RootNode> getRootNode()
|
||||||
|
|
|
@ -216,6 +216,9 @@ followers attack on sight = false
|
||||||
# Can loot non-fighting actors during death animation
|
# Can loot non-fighting actors during death animation
|
||||||
can loot during death animation = true
|
can loot during death animation = true
|
||||||
|
|
||||||
|
# Makes the value of filled soul gems dependent only on soul magnitude (with formula from the Morrowind Code Patch)
|
||||||
|
rebalance soul gem values = true
|
||||||
|
|
||||||
[General]
|
[General]
|
||||||
|
|
||||||
# Anisotropy reduces distortion in textures at low angles (e.g. 0 to 16).
|
# Anisotropy reduces distortion in textures at low angles (e.g. 0 to 16).
|
||||||
|
|
|
@ -109,6 +109,16 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="rebalanceSoulGemValuesCheckBox">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>If this setting is true, the value of filled soul gems is dependent only on soul magnitude.</p><p>The default value is true.</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Rebalance soul gem values</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item alignment="Qt::AlignLeft">
|
<item alignment="Qt::AlignLeft">
|
||||||
<widget class="QWidget" name="showOwnedGroup" native="true">
|
<widget class="QWidget" name="showOwnedGroup" native="true">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
|
|
Loading…
Reference in a new issue