Merge pull request #322 from TES3MP/master

Add master commits up to 23 Oct 2017
new-script-api
David Cernat 7 years ago committed by GitHub
commit 0e73571111

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

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

@ -95,11 +95,15 @@ namespace MWDialogue
void Journal::addEntry (const std::string& id, int index, const MWWorld::Ptr& actor) 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); std::string infoId = JournalEntry::idFromIndex (id, index);
for (TEntryIter i = mJournal.begin (); i != mJournal.end (); ++i) for (TEntryIter i = mJournal.begin (); i != mJournal.end (); ++i)
if (i->mTopic == id && i->mInfoId == infoId) if (i->mTopic == id && i->mInfoId == infoId)
{
setJournalIndex(id, index);
MWBase::Environment::get().getWindowManager()->messageBox ("#{sJournalEntry}");
return; return;
}
StampedJournalEntry entry = StampedJournalEntry::makeFromQuest (id, index, actor); StampedJournalEntry entry = StampedJournalEntry::makeFromQuest (id, index, actor);

@ -40,7 +40,6 @@
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
#include "../mwworld/action.hpp" #include "../mwworld/action.hpp"
#include "../mwscript/interpretercontext.hpp" #include "../mwscript/interpretercontext.hpp"
#include "../mwrender/characterpreview.hpp"
#include "../mwmechanics/actorutil.hpp" #include "../mwmechanics/actorutil.hpp"
#include "../mwmechanics/creaturestats.hpp" #include "../mwmechanics/creaturestats.hpp"
@ -243,8 +242,8 @@ namespace MWGui
MWWorld::Ptr object = item.mBase; MWWorld::Ptr object = item.mBase;
int count = item.mCount; int count = item.mCount;
bool shift = MyGUI::InputManager::getInstance().isShiftPressed(); bool shift = MyGUI::InputManager::getInstance().isShiftPressed();
if (MyGUI::InputManager::getInstance().isControlPressed()) if (MyGUI::InputManager::getInstance().isControlPressed())
count = 1; count = 1;
@ -542,6 +541,7 @@ namespace MWGui
if (mDragAndDrop->mIsOnDragAndDrop) if (mDragAndDrop->mIsOnDragAndDrop)
{ {
MWWorld::Ptr ptr = mDragAndDrop->mItem.mBase; MWWorld::Ptr ptr = mDragAndDrop->mItem.mBase;
mDragAndDrop->finish(); mDragAndDrop->finish();
if (mDragAndDrop->mSourceModel != mTradeModel) if (mDragAndDrop->mSourceModel != mTradeModel)
@ -549,7 +549,19 @@ namespace MWGui
// Move item to the player's inventory // Move item to the player's inventory
ptr = mDragAndDrop->mSourceModel->moveItem(mDragAndDrop->mItem, mDragAndDrop->mDraggedCount, mTradeModel); ptr = mDragAndDrop->mSourceModel->moveItem(mDragAndDrop->mItem, mDragAndDrop->mDraggedCount, mTradeModel);
} }
useItem(ptr); 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 else
{ {

Loading…
Cancel
Save