mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-28 16:09:41 +00:00
Merge pull request #272 from TES3MP/0.6.0
Add hotfix commits for 0.6.0 up to 23 Aug 2017
This commit is contained in:
commit
2597f018d2
11 changed files with 85 additions and 26 deletions
|
@ -46,6 +46,17 @@ namespace MWBase
|
||||||
|
|
||||||
virtual void addTopic (const std::string& topic) = 0;
|
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 askQuestion (const std::string& question,int choice) = 0;
|
||||||
|
|
||||||
virtual void goodbye() = 0;
|
virtual void goodbye() = 0;
|
||||||
|
|
|
@ -97,6 +97,20 @@ namespace MWDialogue
|
||||||
mKnownTopics.insert( Misc::StringUtils::lowerCase(topic) );
|
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)
|
void DialogueManager::parseText (const std::string& text)
|
||||||
{
|
{
|
||||||
std::vector<HyperTextParser::Token> hypertext = HyperTextParser::parseHyperText(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
|
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);
|
mwmp::Main::get().getLocalPlayer()->sendTopic(topicId);
|
||||||
/*
|
/*
|
||||||
End of tes3mp addition
|
End of tes3mp addition
|
||||||
|
|
|
@ -68,6 +68,17 @@ namespace MWDialogue
|
||||||
|
|
||||||
virtual void addTopic (const std::string& topic);
|
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 askQuestion (const std::string& question,int choice);
|
||||||
|
|
||||||
virtual void goodbye();
|
virtual void goodbye();
|
||||||
|
|
|
@ -13,7 +13,16 @@
|
||||||
#include <components/sdlutil/sdlinputwrapper.hpp>
|
#include <components/sdlutil/sdlinputwrapper.hpp>
|
||||||
#include <components/sdlutil/sdlvideowrapper.hpp>
|
#include <components/sdlutil/sdlvideowrapper.hpp>
|
||||||
|
|
||||||
|
/*
|
||||||
|
Start of tes3mp addition
|
||||||
|
|
||||||
|
Include additional headers for multiplayer purposes
|
||||||
|
*/
|
||||||
#include "../mwmp/Main.hpp"
|
#include "../mwmp/Main.hpp"
|
||||||
|
#include "../mwmp/LocalPlayer.hpp"
|
||||||
|
/*
|
||||||
|
End of tes3mp addition
|
||||||
|
*/
|
||||||
|
|
||||||
#include <components/esm/esmwriter.hpp>
|
#include <components/esm/esmwriter.hpp>
|
||||||
#include <components/esm/esmreader.hpp>
|
#include <components/esm/esmreader.hpp>
|
||||||
|
@ -1026,6 +1035,17 @@ namespace MWInput
|
||||||
|
|
||||||
void InputManager::toggleConsole()
|
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())
|
if (MyGUI::InputManager::getInstance ().isModalAny())
|
||||||
return;
|
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)->setPlayer(Main::get().getLocalPlayer());
|
||||||
Main::get().getNetworking()->getPlayerPacket(ID_GUI_MESSAGEBOX)->Send();
|
Main::get().getNetworking()->getPlayerPacket(ID_GUI_MESSAGEBOX)->Send();
|
||||||
}
|
}
|
||||||
|
|
||||||
blockConsole();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void mwmp::GUIController::WM_UpdateVisible(MWGui::GuiMode mode)
|
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);
|
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;
|
GUIDialogList *mListBox;
|
||||||
void onInputBoxDone(MWGui::WindowBase* parWindow);
|
void onInputBoxDone(MWGui::WindowBase* parWindow);
|
||||||
//MyGUI::Widget *oldFocusWidget, *currentFocusWidget;
|
//MyGUI::Widget *oldFocusWidget, *currentFocusWidget;
|
||||||
void blockConsole();
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ LocalPlayer::LocalPlayer()
|
||||||
charGenStage.current = 0;
|
charGenStage.current = 0;
|
||||||
charGenStage.end = 1;
|
charGenStage.end = 1;
|
||||||
|
|
||||||
consoleAllowed = true;
|
consoleAllowed = false;
|
||||||
difficulty = 0;
|
difficulty = 0;
|
||||||
|
|
||||||
ignorePosPacket = false;
|
ignorePosPacket = false;
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
#ifndef OPENMW_PROCESSORGAMESETTINGS_HPP
|
#ifndef OPENMW_PROCESSORGAMESETTINGS_HPP
|
||||||
#define OPENMW_PROCESSORGAMESETTINGS_HPP
|
#define OPENMW_PROCESSORGAMESETTINGS_HPP
|
||||||
|
|
||||||
|
#include "apps/openmw/mwbase/environment.hpp"
|
||||||
|
#include "apps/openmw/mwgui/windowmanagerimp.hpp"
|
||||||
|
|
||||||
#include "../PlayerProcessor.hpp"
|
#include "../PlayerProcessor.hpp"
|
||||||
|
|
||||||
namespace mwmp
|
namespace mwmp
|
||||||
|
@ -15,7 +18,16 @@ namespace mwmp
|
||||||
|
|
||||||
virtual void Do(PlayerPacket &packet, BasePlayer *player)
|
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);
|
std::string topic = runtime.getStringLiteral (runtime[0].mInteger);
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
MWBase::Environment::get().getDialogueManager()->addTopic(topic);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Start of tes3mp addition
|
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
|
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
|
End of tes3mp addition
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
MWBase::Environment::get().getDialogueManager()->addTopic(topic);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -592,7 +592,7 @@ namespace MWScript
|
||||||
*/
|
*/
|
||||||
if (mwmp::Main::get().getLocalPlayer()->hasFinishedCharGen())
|
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();
|
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
|
||||||
worldEvent->reset();
|
worldEvent->reset();
|
||||||
|
@ -620,7 +620,7 @@ namespace MWScript
|
||||||
*/
|
*/
|
||||||
if (mwmp::Main::get().getLocalPlayer()->hasFinishedCharGen())
|
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();
|
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
|
||||||
worldEvent->reset();
|
worldEvent->reset();
|
||||||
|
|
|
@ -60,10 +60,13 @@ namespace MWScript
|
||||||
Send an ID_OBJECT_SCALE every time an object's scale is changed
|
Send an ID_OBJECT_SCALE every time an object's scale is changed
|
||||||
through a script
|
through a script
|
||||||
*/
|
*/
|
||||||
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
|
if (ptr.isInCell())
|
||||||
worldEvent->reset();
|
{
|
||||||
worldEvent->addObjectScale(ptr, scale);
|
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
|
||||||
worldEvent->sendObjectScale();
|
worldEvent->reset();
|
||||||
|
worldEvent->addObjectScale(ptr, scale);
|
||||||
|
worldEvent->sendObjectScale();
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
End of tes3mp addition
|
End of tes3mp addition
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue