From f1b2ab9d67dc17fff9ab7972abbcb7e8e7469a15 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Fri, 10 Apr 2020 15:47:33 +0100 Subject: [PATCH 1/8] Add .vs to gitignore Apparently Visual Studio puts stuff in a .vs directory now. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e95139b8f..45c87a2c5 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ cmake-build-* files/windows/*.aps ## qt-creator CMakeLists.txt.user* +.vs ## resources data From e1d635cd71799b387d6ed54dd17c1c4f0541fd54 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Fri, 10 Apr 2020 17:47:40 +0300 Subject: [PATCH 2/8] Make extra sure groups with special behavior aren't optimized out --- components/nifosg/nifloader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index 51d25210d..5a9693740 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -457,7 +457,7 @@ namespace NifOsg { const Nif::NiLODNode* niLodNode = static_cast(nifNode); node = handleLodNode(niLodNode); - dataVariance = osg::Object::STATIC; + dataVariance = osg::Object::DYNAMIC; break; } case Nif::RC_NiSwitchNode: @@ -476,8 +476,8 @@ namespace NifOsg { bool enabled = nifNode->flags & Nif::NiNode::Flag_ActiveCollision; node = new CollisionSwitch(nifNode->trafo.toMatrix(), enabled); - dataVariance = osg::Object::STATIC; - + // This matrix transform must not be combined with another matrix transform. + dataVariance = osg::Object::DYNAMIC; break; } default: From 39a55318b0710de79a7bb67cade2e3e85f859640 Mon Sep 17 00:00:00 2001 From: fredzio Date: Sun, 7 Jul 2019 09:41:32 +0200 Subject: [PATCH 3/8] Remove unused variable --- components/terrain/quadtreeworld.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/components/terrain/quadtreeworld.cpp b/components/terrain/quadtreeworld.cpp index f998b7877..05f33078f 100644 --- a/components/terrain/quadtreeworld.cpp +++ b/components/terrain/quadtreeworld.cpp @@ -215,7 +215,6 @@ private: float mMinSize; osg::ref_ptr mRootNode; - osg::ref_ptr mLodCallback; }; QuadTreeWorld::QuadTreeWorld(osg::Group *parent, osg::Group *compileRoot, Resource::ResourceSystem *resourceSystem, Storage *storage, int compMapResolution, float compMapLevel, float lodFactor, int vertexLodMod, float maxCompGeometrySize) From de7ecddbb8868ce8d7c14863e47f95d154fb5b7c Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sat, 11 Apr 2020 14:42:04 +0300 Subject: [PATCH 4/8] Don't play equip sound for reactivated quick key items (bug #5367) --- CHANGELOG.md | 1 + apps/openmw/mwgui/quickkeysmenu.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31a5271db..1f5865996 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ 0.47.0 ------ + Bug #5367: Selecting a spell on an enchanted item per hotkey always plays the equip sound 0.46.0 ------ diff --git a/apps/openmw/mwgui/quickkeysmenu.cpp b/apps/openmw/mwgui/quickkeysmenu.cpp index ed5328d36..39278f0fa 100644 --- a/apps/openmw/mwgui/quickkeysmenu.cpp +++ b/apps/openmw/mwgui/quickkeysmenu.cpp @@ -401,7 +401,8 @@ namespace MWGui return; } - MWBase::Environment::get().getWindowManager()->useItem(item); + if (!store.isEquipped(item)) + MWBase::Environment::get().getWindowManager()->useItem(item); MWWorld::ConstContainerStoreIterator rightHand = store.getSlot(MWWorld::InventoryStore::Slot_CarriedRight); // change draw state only if the item is in player's right hand if (rightHand != store.end() && item == *rightHand) @@ -411,8 +412,8 @@ namespace MWGui } else if (key->type == Type_MagicItem) { - // equip, if it can be equipped - if (!item.getClass().getEquipmentSlots(item).first.empty()) + // equip, if it can be equipped and isn't yet equipped + if (!item.getClass().getEquipmentSlots(item).first.empty() && !store.isEquipped(item)) { MWBase::Environment::get().getWindowManager()->useItem(item); From f79e20379bd1958f25be0c3aa96fed8bfc4b7ae2 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sun, 12 Apr 2020 01:55:42 +0300 Subject: [PATCH 5/8] Make sure it's a crime to unlock owned doors --- apps/openmw/mwmechanics/security.cpp | 6 ++++-- apps/openmw/mwmechanics/spellcasting.cpp | 10 +++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwmechanics/security.cpp b/apps/openmw/mwmechanics/security.cpp index cafc65b99..ab286cbee 100644 --- a/apps/openmw/mwmechanics/security.cpp +++ b/apps/openmw/mwmechanics/security.cpp @@ -43,6 +43,8 @@ namespace MWMechanics x *= pickQuality * mFatigueTerm; x += fPickLockMult * lockStrength; + MWBase::Environment::get().getMechanicsManager()->unlockAttempted(mActor, lock); + resultSound = "Open Lock Fail"; if (x <= 0) resultMessage = "#{sLockImpossible}"; @@ -59,7 +61,6 @@ namespace MWMechanics resultMessage = "#{sLockFail}"; } - MWBase::Environment::get().getMechanicsManager()->unlockAttempted(mActor, lock); int uses = lockpick.getClass().getItemHealth(lockpick); --uses; lockpick.getCellRef().setCharge(uses); @@ -84,6 +85,8 @@ namespace MWMechanics x += fTrapCostMult * trapSpellPoints; x *= probeQuality * mFatigueTerm; + MWBase::Environment::get().getMechanicsManager()->unlockAttempted(mActor, trap); + resultSound = "Disarm Trap Fail"; if (x <= 0) resultMessage = "#{sTrapImpossible}"; @@ -101,7 +104,6 @@ namespace MWMechanics resultMessage = "#{sTrapFail}"; } - MWBase::Environment::get().getMechanicsManager()->unlockAttempted(mActor, trap); int uses = probe.getClass().getItemHealth(probe); --uses; probe.getCellRef().setCharge(uses); diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index 21fa7f369..3f32485de 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -709,6 +709,11 @@ namespace MWMechanics } else if (effectId == ESM::MagicEffect::Open) { + if (!caster.isEmpty()) + { + MWBase::Environment::get().getMechanicsManager()->unlockAttempted(getPlayer(), target); + // Use the player instead of the caster for vanilla crime compatibility + } const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); const ESM::MagicEffect *magiceffect = store.get().find(effectId); MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(target); @@ -726,11 +731,10 @@ namespace MWMechanics target.getCellRef().unlock(); } else + { MWBase::Environment::get().getSoundManager()->playSound3D(target, "Open Lock Fail", 1.f, 1.f); + } - if (!caster.isEmpty()) - MWBase::Environment::get().getMechanicsManager()->unlockAttempted(getPlayer(), target); - // Use the player instead of the caster for vanilla crime compatibility return true; } } From 6d0022096d77f782e79cfdee89fd8b2eb5618cad Mon Sep 17 00:00:00 2001 From: fredzio Date: Sat, 11 Apr 2020 22:52:29 +0200 Subject: [PATCH 6/8] Bump copyright year in documentation --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 60b25ae57..7653b94ed 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -53,7 +53,7 @@ master_doc = 'index' # General information about the project. project = u'OpenMW' -copyright = u'2017, OpenMW Team' +copyright = u'2020, OpenMW Team' # The version info for the project you're documenting, acts as replacement for From 96a447ee3a9d7b8a746167eb71d0990acc36b6ce Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Fri, 10 Apr 2020 23:14:00 +0300 Subject: [PATCH 7/8] Show the soulgem soul in count dialog (feature #5362) --- CHANGELOG.md | 1 + apps/openmw/mwclass/misc.cpp | 13 +------------ apps/openmw/mwgui/companionwindow.cpp | 4 +++- apps/openmw/mwgui/container.cpp | 4 +++- apps/openmw/mwgui/inventorywindow.cpp | 4 +++- apps/openmw/mwgui/tooltips.cpp | 14 ++++++++++++++ apps/openmw/mwgui/tooltips.hpp | 3 +++ apps/openmw/mwgui/tradewindow.cpp | 4 +++- 8 files changed, 31 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31a5271db..3bf58395d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ 0.47.0 ------ + Feature #5362: Show the soul gems' trapped soul in count dialog 0.46.0 ------ diff --git a/apps/openmw/mwclass/misc.cpp b/apps/openmw/mwclass/misc.cpp index 4eb3eabef..8d3cda6fe 100644 --- a/apps/openmw/mwclass/misc.cpp +++ b/apps/openmw/mwclass/misc.cpp @@ -141,8 +141,6 @@ namespace MWClass MWGui::ToolTipInfo info; - const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); - bool gold = isGold(ptr); if (gold) count *= getValue(ptr); @@ -153,18 +151,9 @@ namespace MWClass else // gold displays its count also if it's 1. countString = " (" + std::to_string(count) + ")"; - info.caption = MyGUI::TextIterator::toTagsString(getName(ptr)) + countString; + info.caption = MyGUI::TextIterator::toTagsString(getName(ptr)) + countString + MWGui::ToolTips::getSoulString(ptr.getCellRef()); info.icon = ref->mBase->mIcon; - if (ref->mRef.getSoul() != "") - { - const ESM::Creature *creature = store.get().search(ref->mRef.getSoul()); - if (creature && !creature->mName.empty()) - info.caption += " (" + creature->mName + ")"; - else if (creature) - info.caption += " (" + creature->mId + ")"; - } - std::string text; text += MWGui::ToolTips::getWeightString(ref->mBase->mData.mWeight, "#{sWeight}"); diff --git a/apps/openmw/mwgui/companionwindow.cpp b/apps/openmw/mwgui/companionwindow.cpp index c069ae885..b3f6e3339 100644 --- a/apps/openmw/mwgui/companionwindow.cpp +++ b/apps/openmw/mwgui/companionwindow.cpp @@ -16,6 +16,7 @@ #include "draganddrop.hpp" #include "countdialog.hpp" #include "widgets.hpp" +#include "tooltips.hpp" namespace { @@ -86,7 +87,8 @@ void CompanionWindow::onItemSelected(int index) if (count > 1 && !shift) { CountDialog* dialog = MWBase::Environment::get().getWindowManager()->getCountDialog(); - dialog->openCountDialog(object.getClass().getName(object), "#{sTake}", count); + std::string name = object.getClass().getName(object) + MWGui::ToolTips::getSoulString(object.getCellRef()); + dialog->openCountDialog(name, "#{sTake}", count); dialog->eventOkClicked.clear(); dialog->eventOkClicked += MyGUI::newDelegate(this, &CompanionWindow::dragItem); } diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index f0e025a33..444ce4cb1 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -25,6 +25,7 @@ #include "sortfilteritemmodel.hpp" #include "pickpocketitemmodel.hpp" #include "draganddrop.hpp" +#include "tooltips.hpp" namespace MWGui { @@ -79,7 +80,8 @@ namespace MWGui if (count > 1 && !shift) { CountDialog* dialog = MWBase::Environment::get().getWindowManager()->getCountDialog(); - dialog->openCountDialog(object.getClass().getName(object), "#{sTake}", count); + std::string name = object.getClass().getName(object) + MWGui::ToolTips::getSoulString(object.getCellRef()); + dialog->openCountDialog(name, "#{sTake}", count); dialog->eventOkClicked.clear(); dialog->eventOkClicked += MyGUI::newDelegate(this, &ContainerWindow::dragItem); } diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index 653f03153..6041838f5 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -38,6 +38,7 @@ #include "tradewindow.hpp" #include "draganddrop.hpp" #include "widgets.hpp" +#include "tooltips.hpp" namespace { @@ -298,7 +299,8 @@ namespace MWGui { CountDialog* dialog = MWBase::Environment::get().getWindowManager()->getCountDialog(); std::string message = mTrading ? "#{sQuanityMenuMessage01}" : "#{sTake}"; - dialog->openCountDialog(object.getClass().getName(object), message, count); + std::string name = object.getClass().getName(object) + MWGui::ToolTips::getSoulString(object.getCellRef()); + dialog->openCountDialog(name, message, count); dialog->eventOkClicked.clear(); if (mTrading) dialog->eventOkClicked += MyGUI::newDelegate(this, &InventoryWindow::sellItem); diff --git a/apps/openmw/mwgui/tooltips.cpp b/apps/openmw/mwgui/tooltips.cpp index b86eba651..e3250e5fe 100644 --- a/apps/openmw/mwgui/tooltips.cpp +++ b/apps/openmw/mwgui/tooltips.cpp @@ -647,6 +647,20 @@ namespace MWGui return " (" + MyGUI::utility::toString(value) + ")"; } + std::string ToolTips::getSoulString(const MWWorld::CellRef& cellref) + { + std::string soul = cellref.getSoul(); + if (soul.empty()) + return std::string(); + const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); + const ESM::Creature *creature = store.get().search(soul); + if (!creature) + return std::string(); + if (creature->mName.empty()) + return " (" + creature->mId + ")"; + return " (" + creature->mName + ")"; + } + std::string ToolTips::getCellRefString(const MWWorld::CellRef& cellref) { std::string ret; diff --git a/apps/openmw/mwgui/tooltips.hpp b/apps/openmw/mwgui/tooltips.hpp index afdc7dec0..d7bb87bdb 100644 --- a/apps/openmw/mwgui/tooltips.hpp +++ b/apps/openmw/mwgui/tooltips.hpp @@ -81,6 +81,9 @@ namespace MWGui static std::string getCountString(const int value); ///< @return blank string if count is 1, or else " (value)" + static std::string getSoulString(const MWWorld::CellRef& cellref); + ///< Returns a string containing the name of the creature that the ID in the cellref's soul field belongs to. + static std::string getCellRefString(const MWWorld::CellRef& cellref); ///< Returns a string containing debug tooltip information about the given cellref. diff --git a/apps/openmw/mwgui/tradewindow.cpp b/apps/openmw/mwgui/tradewindow.cpp index b102b13ce..672ccbd06 100644 --- a/apps/openmw/mwgui/tradewindow.cpp +++ b/apps/openmw/mwgui/tradewindow.cpp @@ -27,6 +27,7 @@ #include "tradeitemmodel.hpp" #include "countdialog.hpp" #include "controllers.hpp" +#include "tooltips.hpp" namespace { @@ -201,7 +202,8 @@ namespace MWGui { CountDialog* dialog = MWBase::Environment::get().getWindowManager()->getCountDialog(); std::string message = "#{sQuanityMenuMessage02}"; - dialog->openCountDialog(object.getClass().getName(object), message, count); + std::string name = object.getClass().getName(object) + MWGui::ToolTips::getSoulString(object.getCellRef()); + dialog->openCountDialog(name, message, count); dialog->eventOkClicked.clear(); dialog->eventOkClicked += MyGUI::newDelegate(this, &TradeWindow::sellItem); mItemToSell = mSortModel->mapToSource(index); From 07779d7fcf6e140e40fe074c572d11571aa46687 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sun, 12 Apr 2020 13:14:32 +0300 Subject: [PATCH 8/8] Properly utilize creature levelled list's scale (bug #5369) --- CHANGELOG.md | 1 + apps/openmw/mwclass/creaturelevlist.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31a5271db..fbb2fdfdd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ 0.47.0 ------ + Bug #5369: Spawnpoint in the Grazelands doesn't produce oversized creatures 0.46.0 ------ diff --git a/apps/openmw/mwclass/creaturelevlist.cpp b/apps/openmw/mwclass/creaturelevlist.cpp index 1f47b483f..2f3ac0d1e 100644 --- a/apps/openmw/mwclass/creaturelevlist.cpp +++ b/apps/openmw/mwclass/creaturelevlist.cpp @@ -125,6 +125,7 @@ namespace MWClass const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); MWWorld::ManualRef manualRef(store, id); manualRef.getPtr().getCellRef().setPosition(ptr.getCellRef().getPosition()); + manualRef.getPtr().getCellRef().setScale(ptr.getCellRef().getScale()); MWWorld::Ptr placed = MWBase::Environment::get().getWorld()->placeObject(manualRef.getPtr(), ptr.getCell() , ptr.getCellRef().getPosition()); customData.mSpawnActorId = placed.getClass().getCreatureStats(placed).getActorId(); customData.mSpawn = false;