Merge remote-tracking branch 'zini/master' into animation2

This commit is contained in:
Chris Robinson 2013-01-18 01:02:53 -08:00
commit 613529f1d6
5 changed files with 22 additions and 10 deletions

View file

@ -122,15 +122,9 @@ namespace MWDialogue
MWMechanics::CreatureStats& creatureStats = MWWorld::Class::get (actor).getCreatureStats (actor); MWMechanics::CreatureStats& creatureStats = MWWorld::Class::get (actor).getCreatureStats (actor);
mTalkedTo = creatureStats.hasTalkedToPlayer(); mTalkedTo = creatureStats.hasTalkedToPlayer();
creatureStats.talkedToPlayer();
mActorKnownTopics.clear(); mActorKnownTopics.clear();
//initialise the GUI
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Dialogue);
MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow();
win->startDialogue(actor, MWWorld::Class::get (actor).getName (actor));
//setup the list of topics known by the actor. Topics who are also on the knownTopics list will be added to the GUI //setup the list of topics known by the actor. Topics who are also on the knownTopics list will be added to the GUI
updateTopics(); updateTopics();
@ -146,6 +140,13 @@ namespace MWDialogue
{ {
if (const ESM::DialInfo *info = filter.search (*it)) if (const ESM::DialInfo *info = filter.search (*it))
{ {
//initialise the GUI
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Dialogue);
MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow();
win->startDialogue(actor, MWWorld::Class::get (actor).getName (actor));
creatureStats.talkedToPlayer();
if (!info->mSound.empty()) if (!info->mSound.empty())
{ {
// TODO play sound // TODO play sound
@ -381,6 +382,10 @@ namespace MWDialogue
void DialogueManager::goodbyeSelected() void DialogueManager::goodbyeSelected()
{ {
// Do not close the dialogue window if the player has to answer a question
if (mIsInChoice)
return;
MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Dialogue); MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Dialogue);
// Apply disposition change to NPC's base disposition // Apply disposition change to NPC's base disposition

View file

@ -19,12 +19,19 @@
bool MWDialogue::Filter::testActor (const ESM::DialInfo& info) const bool MWDialogue::Filter::testActor (const ESM::DialInfo& info) const
{ {
bool isCreature = (mActor.getTypeName() != typeid (ESM::NPC).name());
// actor id // actor id
if (!info.mActor.empty()) if (!info.mActor.empty())
{
if ( Misc::StringUtils::lowerCase (info.mActor)!=MWWorld::Class::get (mActor).getId (mActor)) if ( Misc::StringUtils::lowerCase (info.mActor)!=MWWorld::Class::get (mActor).getId (mActor))
return false; return false;
}
bool isCreature = (mActor.getTypeName() != typeid (ESM::NPC).name()); else if (isCreature)
{
// Creatures must not have topics aside of those specific to their id
return false;
}
// NPC race // NPC race
if (!info.mRace.empty()) if (!info.mRace.empty())

View file

@ -490,7 +490,7 @@ void DialogueWindow::onReferenceUnavailable()
void DialogueWindow::onFrame() void DialogueWindow::onFrame()
{ {
if(mEnabled && mPtr.getTypeName() == typeid(ESM::NPC).name()) if(mMainWidget->getVisible() && mEnabled && mPtr.getTypeName() == typeid(ESM::NPC).name())
{ {
int disp = std::max(0, std::min(100, int disp = std::max(0, std::min(100,
MWBase::Environment::get().getMechanicsManager()->getDerivedDisposition(mPtr) MWBase::Environment::get().getMechanicsManager()->getDerivedDisposition(mPtr)

View file

@ -119,4 +119,4 @@ Thanks to Dongle,
for his Daedric fontface, see Daedric Font License.txt for his license terms. for his Daedric fontface, see Daedric Font License.txt for his license terms.
Thanks to DejaVu team, Thanks to DejaVu team,
for their DejaVuLGCSansMono fontface, see Dejavu_lgc_font_license.txt for their license terms. for their DejaVuLGCSansMono fontface, see DejaVu Font License.txt for their license terms.