Fix dialogue window not being exited properly

pull/303/head
scrawl 7 years ago
parent 7a64098da3
commit 8964fc93d6

@ -164,7 +164,7 @@ void CompanionWindow::onMessageBoxButtonClicked(int button)
{ {
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Companion); MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Companion);
// Important for Calvus' contract script to work properly // Important for Calvus' contract script to work properly
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue); MWBase::Environment::get().getWindowManager()->exitCurrentGuiMode();
} }
} }

@ -9,7 +9,6 @@
#include <components/widgets/list.hpp> #include <components/widgets/list.hpp>
#include <components/settings/settings.hpp> #include <components/settings/settings.hpp>
#include "../mwbase/dialoguemanager.hpp"
#include "../mwbase/mechanicsmanager.hpp" #include "../mwbase/mechanicsmanager.hpp"
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
#include "../mwworld/containerstore.hpp" #include "../mwworld/containerstore.hpp"
@ -176,7 +175,6 @@ namespace MWGui
void EnchantingDialog::onReferenceUnavailable () void EnchantingDialog::onReferenceUnavailable ()
{ {
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Dialogue);
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Enchanting); MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Enchanting);
resetReference(); resetReference();
} }
@ -352,8 +350,7 @@ namespace MWGui
MWBase::Environment::get().getMechanicsManager()->confiscateStolenItemToOwner(player, item, mPtr, 1); MWBase::Environment::get().getMechanicsManager()->confiscateStolenItemToOwner(player, item, mPtr, 1);
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Enchanting); MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Enchanting);
MWBase::Environment::get().getDialogueManager()->goodbyeSelected(); MWBase::Environment::get().getWindowManager()->exitCurrentGuiMode();
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue);
return; return;
} }
} }

@ -187,7 +187,7 @@ namespace MWGui
{ {
// remove both Spells and Dialogue (since you always trade with the NPC/creature that you have previously talked to) // remove both Spells and Dialogue (since you always trade with the NPC/creature that you have previously talked to)
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_SpellBuying); MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_SpellBuying);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue); MWBase::Environment::get().getWindowManager()->exitCurrentGuiMode();
} }
void SpellBuyingWindow::onMouseWheel(MyGUI::Widget* _sender, int _rel) void SpellBuyingWindow::onMouseWheel(MyGUI::Widget* _sender, int _rel)

@ -322,8 +322,7 @@ namespace MWGui
MWBase::Environment::get().getMechanicsManager()->confiscateStolenItemToOwner(player, it->mBase, mPtr, it->mCount); MWBase::Environment::get().getMechanicsManager()->confiscateStolenItemToOwner(player, it->mBase, mPtr, it->mCount);
onCancelButtonClicked(mCancelButton); onCancelButtonClicked(mCancelButton);
MWBase::Environment::get().getDialogueManager()->goodbyeSelected(); MWBase::Environment::get().getWindowManager()->exitCurrentGuiMode();
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue);
return; return;
} }
} }
@ -503,7 +502,7 @@ namespace MWGui
{ {
// remove both Trade and Dialogue (since you always trade with the NPC/creature that you have previously talked to) // remove both Trade and Dialogue (since you always trade with the NPC/creature that you have previously talked to)
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Barter); MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Barter);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue); MWBase::Environment::get().getWindowManager()->exitCurrentGuiMode();
} }
int TradeWindow::getMerchantGold() int TradeWindow::getMerchantGold()

@ -6,7 +6,6 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/mechanicsmanager.hpp" #include "../mwbase/mechanicsmanager.hpp"
#include "../mwbase/dialoguemanager.hpp"
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
#include "../mwworld/containerstore.hpp" #include "../mwworld/containerstore.hpp"
@ -196,8 +195,7 @@ namespace MWGui
// go back to game mode // go back to game mode
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Training); MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Training);
MWBase::Environment::get().getDialogueManager()->goodbyeSelected(); MWBase::Environment::get().getWindowManager()->exitCurrentGuiMode();
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue);
} }
void TrainingWindow::onFrame(float dt) void TrainingWindow::onFrame(float dt)

@ -8,7 +8,6 @@
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/windowmanager.hpp" #include "../mwbase/windowmanager.hpp"
#include "../mwbase/mechanicsmanager.hpp" #include "../mwbase/mechanicsmanager.hpp"
#include "../mwbase/dialoguemanager.hpp"
#include "../mwmechanics/creaturestats.hpp" #include "../mwmechanics/creaturestats.hpp"
#include "../mwmechanics/actorutil.hpp" #include "../mwmechanics/actorutil.hpp"
@ -177,8 +176,7 @@ namespace MWGui
} }
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Travel); MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Travel);
MWBase::Environment::get().getDialogueManager()->goodbyeSelected(); MWBase::Environment::get().getWindowManager()->exitCurrentGuiMode();
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue);
// Teleports any followers, too. // Teleports any followers, too.
MWWorld::ActionTeleport action(interior ? cellname : "", pos, true); MWWorld::ActionTeleport action(interior ? cellname : "", pos, true);
@ -208,7 +206,7 @@ namespace MWGui
void TravelWindow::onReferenceUnavailable() void TravelWindow::onReferenceUnavailable()
{ {
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Travel); MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Travel);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue); MWBase::Environment::get().getWindowManager()->exitCurrentGuiMode();
} }
void TravelWindow::onMouseWheel(MyGUI::Widget* _sender, int _rel) void TravelWindow::onMouseWheel(MyGUI::Widget* _sender, int _rel)

Loading…
Cancel
Save