Merge pull request #321 from OpenMW/master

Add OpenMW commits up to 22 Oct 2017
new-script-api
David Cernat 7 years ago committed by GitHub
commit 360cf2ead7

@ -363,8 +363,7 @@ namespace MWDialogue
{
if (filter.responseAvailable (*iter))
{
std::string lower = Misc::StringUtils::lowerCase(iter->mId);
mActorKnownTopics.insert (lower);
mActorKnownTopics.insert (iter->mId);
}
}
}
@ -380,7 +379,7 @@ namespace MWDialogue
for (const std::string& topic : mActorKnownTopics)
{
//does the player know the topic?
if (mKnownTopics.count(Misc::StringUtils::lowerCase(topic)))
if (mKnownTopics.count(topic))
keywordList.push_back(topic);
}

@ -8,6 +8,7 @@
#include <components/compiler/streamerrorhandler.hpp>
#include <components/translation/translation.hpp>
#include <components/misc/stringops.hpp>
#include "../mwworld/ptr.hpp"
@ -22,13 +23,13 @@ namespace MWDialogue
{
class DialogueManager : public MWBase::DialogueManager
{
std::set<std::string> mKnownTopics;// Those are the topics the player knows.
std::set<std::string, Misc::StringUtils::CiComp> mKnownTopics;// Those are the topics the player knows.
// Modified faction reactions. <Faction1, <Faction2, Difference> >
typedef std::map<std::string, std::map<std::string, int> > ModFactionReactionMap;
ModFactionReactionMap mChangedFactionReaction;
std::set<std::string> mActorKnownTopics;
std::set<std::string, Misc::StringUtils::CiComp> mActorKnownTopics;
Translation::Storage& mTranslationDataStorage;
MWScript::CompilerContext mCompilerContext;

@ -95,11 +95,15 @@ namespace MWDialogue
void Journal::addEntry (const std::string& id, int index, const MWWorld::Ptr& actor)
{
// bail out of we already have heard this...
// bail out if we already have heard this...
std::string infoId = JournalEntry::idFromIndex (id, index);
for (TEntryIter i = mJournal.begin (); i != mJournal.end (); ++i)
if (i->mTopic == id && i->mInfoId == infoId)
{
setJournalIndex(id, index);
MWBase::Environment::get().getWindowManager()->messageBox ("#{sJournalEntry}");
return;
}
StampedJournalEntry entry = StampedJournalEntry::makeFromQuest (id, index, actor);

@ -40,7 +40,6 @@
#include "../mwworld/class.hpp"
#include "../mwworld/action.hpp"
#include "../mwscript/interpretercontext.hpp"
#include "../mwrender/characterpreview.hpp"
#include "../mwmechanics/actorutil.hpp"
#include "../mwmechanics/creaturestats.hpp"
@ -243,8 +242,8 @@ namespace MWGui
MWWorld::Ptr object = item.mBase;
int count = item.mCount;
bool shift = MyGUI::InputManager::getInstance().isShiftPressed();
if (MyGUI::InputManager::getInstance().isControlPressed())
count = 1;
@ -542,6 +541,7 @@ namespace MWGui
if (mDragAndDrop->mIsOnDragAndDrop)
{
MWWorld::Ptr ptr = mDragAndDrop->mItem.mBase;
mDragAndDrop->finish();
if (mDragAndDrop->mSourceModel != mTradeModel)
@ -549,7 +549,19 @@ namespace MWGui
// Move item to the player's inventory
ptr = mDragAndDrop->mSourceModel->moveItem(mDragAndDrop->mItem, mDragAndDrop->mDraggedCount, mTradeModel);
}
useItem(ptr);
// If item is ingredient or potion don't stop drag and drop to simplify action of taking more than one 1 item
if ((ptr.getTypeName() == typeid(ESM::Potion).name() ||
ptr.getTypeName() == typeid(ESM::Ingredient).name())
&& mDragAndDrop->mDraggedCount > 1)
{
// Item can be provided from other window for example container.
// But after DragAndDrop::startDrag item automaticly always gets to player inventory.
mSelectedItem = getModel()->getIndex(mDragAndDrop->mItem);
dragItem(nullptr, mDragAndDrop->mDraggedCount - 1);
}
}
else
{

Loading…
Cancel
Save