Merge pull request #272 from TES3MP/0.6.0

Add hotfix commits for 0.6.0 up to 23 Aug 2017
0.6.1
David Cernat 7 years ago committed by GitHub
commit 2597f018d2

@ -46,6 +46,17 @@ namespace MWBase
virtual void addTopic (const std::string& topic) = 0;
/*
Start of tes3mp addition
Make it possible to check whether a topic is known by the player from elsewhere
in the code
*/
virtual bool isNewTopic(const std::string& topic) = 0;
/*
End of tes3mp addition
*/
virtual void askQuestion (const std::string& question,int choice) = 0;
virtual void goodbye() = 0;

@ -97,6 +97,20 @@ namespace MWDialogue
mKnownTopics.insert( Misc::StringUtils::lowerCase(topic) );
}
/*
Start of tes3mp addition
Make it possible to check whether a topic is known by the player from elsewhere
in the code
*/
bool DialogueManager::isNewTopic(const std::string& topic)
{
return (!mKnownTopics.count(topic));
}
/*
End of tes3mp addition
*/
void DialogueManager::parseText (const std::string& text)
{
std::vector<HyperTextParser::Token> hypertext = HyperTextParser::parseHyperText(text);
@ -120,7 +134,7 @@ namespace MWDialogue
Send an ID_PLAYER_TOPIC packet every time a new topic becomes known
*/
if (mActorKnownTopics.count(topicId) && !mKnownTopics.count(topicId))
if (mActorKnownTopics.count(topicId) && isNewTopic(topicId))
mwmp::Main::get().getLocalPlayer()->sendTopic(topicId);
/*
End of tes3mp addition

@ -68,6 +68,17 @@ namespace MWDialogue
virtual void addTopic (const std::string& topic);
/*
Start of tes3mp addition
Make it possible to check whether a topic is known by the player from elsewhere
in the code
*/
virtual bool isNewTopic(const std::string& topic);
/*
End of tes3mp addition
*/
virtual void askQuestion (const std::string& question,int choice);
virtual void goodbye();

@ -13,7 +13,16 @@
#include <components/sdlutil/sdlinputwrapper.hpp>
#include <components/sdlutil/sdlvideowrapper.hpp>
/*
Start of tes3mp addition
Include additional headers for multiplayer purposes
*/
#include "../mwmp/Main.hpp"
#include "../mwmp/LocalPlayer.hpp"
/*
End of tes3mp addition
*/
#include <components/esm/esmwriter.hpp>
#include <components/esm/esmreader.hpp>
@ -1026,6 +1035,17 @@ namespace MWInput
void InputManager::toggleConsole()
{
/*
Start of tes3mp addition
If a player's console is disabled by the server, go no further
*/
if (!mwmp::Main::get().getLocalPlayer()->consoleAllowed)
return;
/*
End of tes3mp addition
*/
if (MyGUI::InputManager::getInstance ().isModalAny())
return;

@ -214,8 +214,6 @@ void mwmp::GUIController::update(float dt)
Main::get().getNetworking()->getPlayerPacket(ID_GUI_MESSAGEBOX)->setPlayer(Main::get().getLocalPlayer());
Main::get().getNetworking()->getPlayerPacket(ID_GUI_MESSAGEBOX)->Send();
}
blockConsole();
}
void mwmp::GUIController::WM_UpdateVisible(MWGui::GuiMode mode)
@ -383,13 +381,3 @@ void mwmp::GUIController::updateGlobalMapMarkerTooltips(MWGui::MapWindow *mapWin
setGlobalMapMarkerTooltip(mapWindow, widget.second, x, y);
}
}
void mwmp::GUIController::blockConsole()
{
if (Main::get().getLocalPlayer()->consoleAllowed)
return;
if (MWBase::Environment::get().getWindowManager()->isGuiMode())
if (MWBase::Environment::get().getWindowManager()->getMode() == MWGui::GM_Console)
MWBase::Environment::get().getWindowManager()->popGuiMode();
}

@ -74,7 +74,6 @@ namespace mwmp
GUIDialogList *mListBox;
void onInputBoxDone(MWGui::WindowBase* parWindow);
//MyGUI::Widget *oldFocusWidget, *currentFocusWidget;
void blockConsole();
};
}

@ -47,7 +47,7 @@ LocalPlayer::LocalPlayer()
charGenStage.current = 0;
charGenStage.end = 1;
consoleAllowed = true;
consoleAllowed = false;
difficulty = 0;
ignorePosPacket = false;

@ -1,6 +1,9 @@
#ifndef OPENMW_PROCESSORGAMESETTINGS_HPP
#define OPENMW_PROCESSORGAMESETTINGS_HPP
#include "apps/openmw/mwbase/environment.hpp"
#include "apps/openmw/mwgui/windowmanagerimp.hpp"
#include "../PlayerProcessor.hpp"
namespace mwmp
@ -15,7 +18,16 @@ namespace mwmp
virtual void Do(PlayerPacket &packet, BasePlayer *player)
{
if (isLocal())
{
if (MWBase::Environment::get().getWindowManager()->isGuiMode())
{
if (MWBase::Environment::get().getWindowManager()->getMode() == MWGui::GM_Console && !player->consoleAllowed)
{
MWBase::Environment::get().getWindowManager()->popGuiMode();
}
}
}
}
};
}

@ -128,18 +128,19 @@ namespace MWScript
std::string topic = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop();
MWBase::Environment::get().getDialogueManager()->addTopic(topic);
/*
Start of tes3mp addition
Send an ID_PLAYER_TOPIC packet every time a topic is added
Send an ID_PLAYER_TOPIC packet every time a new topic is added
through a script
*/
mwmp::Main::get().getLocalPlayer()->sendTopic(topic);
if (MWBase::Environment::get().getDialogueManager()->isNewTopic(Misc::StringUtils::lowerCase(topic)))
mwmp::Main::get().getLocalPlayer()->sendTopic(Misc::StringUtils::lowerCase(topic));
/*
End of tes3mp addition
*/
MWBase::Environment::get().getDialogueManager()->addTopic(topic);
}
};

@ -592,7 +592,7 @@ namespace MWScript
*/
if (mwmp::Main::get().getLocalPlayer()->hasFinishedCharGen())
{
if (!ref.getRefData().isEnabled() && ref.getCell() != nullptr)
if (ref.isInCell() && !ref.getRefData().isEnabled())
{
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
@ -620,7 +620,7 @@ namespace MWScript
*/
if (mwmp::Main::get().getLocalPlayer()->hasFinishedCharGen())
{
if (ref.getRefData().isEnabled() && ref.getCell() != nullptr)
if (ref.isInCell() && ref.getRefData().isEnabled())
{
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();

@ -60,10 +60,13 @@ namespace MWScript
Send an ID_OBJECT_SCALE every time an object's scale is changed
through a script
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectScale(ptr, scale);
worldEvent->sendObjectScale();
if (ptr.isInCell())
{
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectScale(ptr, scale);
worldEvent->sendObjectScale();
}
/*
End of tes3mp addition
*/

Loading…
Cancel
Save