forked from teamnwah/openmw-tes3coop
Merge pull request #337 from OpenMW/master
Add OpenMW commits up to 15 Nov 2017
This commit is contained in:
commit
5aff515d3f
6 changed files with 23 additions and 13 deletions
|
@ -104,6 +104,7 @@ namespace MWDialogue
|
|||
|
||||
void DialogueManager::parseText (const std::string& text)
|
||||
{
|
||||
updateActorKnownTopics();
|
||||
std::vector<HyperTextParser::Token> hypertext = HyperTextParser::parseHyperText(text);
|
||||
|
||||
for (std::vector<HyperTextParser::Token>::iterator tok = hypertext.begin(); tok != hypertext.end(); ++tok)
|
||||
|
@ -183,18 +184,13 @@ namespace MWDialogue
|
|||
// TODO play sound
|
||||
}
|
||||
|
||||
// first topics update so that parseText knows the keywords to highlight
|
||||
updateActorKnownTopics();
|
||||
|
||||
parseText (info->mResponse);
|
||||
|
||||
MWScript::InterpreterContext interpreterContext(&mActor.getRefData().getLocals(),mActor);
|
||||
callback->addResponse("", Interpreter::fixDefinesDialog(info->mResponse, interpreterContext));
|
||||
executeScript (info->mResultScript, mActor);
|
||||
mLastTopic = it->mId;
|
||||
|
||||
// update topics again to accommodate changes resulting from executeScript
|
||||
updateActorKnownTopics();
|
||||
parseText (info->mResponse);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -290,8 +286,6 @@ namespace MWDialogue
|
|||
const ESM::DialInfo* info = filter.search(dialogue, true);
|
||||
if (info)
|
||||
{
|
||||
parseText (info->mResponse);
|
||||
|
||||
std::string title;
|
||||
if (dialogue.mType==ESM::Dialogue::Persuasion)
|
||||
{
|
||||
|
@ -330,6 +324,8 @@ namespace MWDialogue
|
|||
|
||||
executeScript (info->mResultScript, mActor);
|
||||
|
||||
parseText (info->mResponse);
|
||||
|
||||
mLastTopic = topic;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,11 @@ namespace MWGui
|
|||
mWindow->addResponse(title, text, mNeedMargin);
|
||||
}
|
||||
|
||||
void updateTopics()
|
||||
{
|
||||
mWindow->updateTopics();
|
||||
}
|
||||
|
||||
private:
|
||||
DialogueWindow* mWindow;
|
||||
bool mNeedMargin;
|
||||
|
@ -91,6 +96,7 @@ namespace MWGui
|
|||
type = MWBase::MechanicsManager::PT_Bribe1000;
|
||||
|
||||
MWBase::Environment::get().getDialogueManager()->persuade(type, mCallback.get());
|
||||
mCallback->updateTopics();
|
||||
|
||||
setVisible(false);
|
||||
}
|
||||
|
@ -395,6 +401,8 @@ namespace MWGui
|
|||
else if (topic == gmst.find("sRepair")->getString())
|
||||
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_MerchantRepair, mPtr);
|
||||
}
|
||||
else
|
||||
updateTopics();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -432,7 +440,9 @@ namespace MWGui
|
|||
|
||||
setTitle(mPtr.getClass().getName(mPtr));
|
||||
|
||||
updateTopicsPane();
|
||||
updateTopics();
|
||||
updateTopicsPane(); // force update for new services
|
||||
|
||||
updateDisposition();
|
||||
restock();
|
||||
}
|
||||
|
@ -620,11 +630,13 @@ namespace MWGui
|
|||
void DialogueWindow::onTopicActivated(const std::string &topicId)
|
||||
{
|
||||
MWBase::Environment::get().getDialogueManager()->keywordSelected(topicId, mCallback.get());
|
||||
updateTopics();
|
||||
}
|
||||
|
||||
void DialogueWindow::onChoiceActivated(int id)
|
||||
{
|
||||
MWBase::Environment::get().getDialogueManager()->questionAnswered(id, mCallback.get());
|
||||
updateTopics();
|
||||
}
|
||||
|
||||
void DialogueWindow::onGoodbyeActivated()
|
||||
|
|
|
@ -131,8 +131,9 @@ namespace MWGui
|
|||
void onFrame(float dt);
|
||||
void clear() { resetReference(); }
|
||||
|
||||
protected:
|
||||
void updateTopics();
|
||||
|
||||
protected:
|
||||
void updateTopicsPane();
|
||||
bool isCompanion(const MWWorld::Ptr& actor);
|
||||
bool isCompanion();
|
||||
|
|
|
@ -85,7 +85,7 @@ bool AiPursue::execute (const MWWorld::Ptr& actor, CharacterController& characte
|
|||
float pathTolerance = 100.0;
|
||||
|
||||
if (pathTo(actor, dest, duration, pathTolerance) &&
|
||||
abs(dest.mZ - aPos.pos[2]) < pathTolerance) // check the true distance in case the target is far away in Z-direction
|
||||
std::abs(dest.mZ - aPos.pos[2]) < pathTolerance) // check the true distance in case the target is far away in Z-direction
|
||||
{
|
||||
target.getClass().activate(target,actor).get()->execute(actor); //Arrest player when reached
|
||||
|
||||
|
|
|
@ -196,8 +196,6 @@ class CharacterController : public MWRender::Animation::TextKeyListener
|
|||
float mSecondsOfSwimming;
|
||||
float mSecondsOfRunning;
|
||||
|
||||
float mTimeUntilWake;
|
||||
|
||||
MWWorld::ConstPtr mHeadTrackTarget;
|
||||
|
||||
float mTurnAnimationThreshold; // how long to continue playing turning animation after actor stopped turning
|
||||
|
@ -206,6 +204,8 @@ class CharacterController : public MWRender::Animation::TextKeyListener
|
|||
|
||||
bool mAttackingOrSpell;
|
||||
|
||||
float mTimeUntilWake;
|
||||
|
||||
void setAttackTypeBasedOnMovement();
|
||||
|
||||
void refreshCurrentAnims(CharacterState idle, CharacterState movement, JumpingState jump, bool force=false);
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<Property key="TextAlign" value="Left Top"/>
|
||||
<Property key="TextColour" value="1 1 1"/>
|
||||
<Property key="InvertSelected" value="false"/>
|
||||
<Property key="WordWrap" value="true"/>
|
||||
</Widget>
|
||||
|
||||
<!-- Command line -->
|
||||
|
|
Loading…
Reference in a new issue