forked from teamnwah/openmw-tes3coop
Merge pull request #409 from TES3MP/0.6.3 while resolving conflicts
Conflicts: apps/openmw-mp/CMakeLists.txt apps/openmw-mp/Script/Functions/GUI.cpp apps/openmw-mp/Script/Functions/GUI.hpp apps/openmw-mp/Script/Functions/Items.hpp apps/openmw-mp/Script/Functions/Mechanics.cpp apps/openmw-mp/Script/Functions/Mechanics.hpp apps/openmw-mp/Script/Functions/Stats.cpp apps/openmw-mp/Script/Functions/Stats.hpp apps/openmw-mp/Script/ScriptFunctions.cpp apps/openmw-mp/Script/ScriptFunctions.hpp
This commit is contained in:
commit
e355dca4dd
51 changed files with 280 additions and 376 deletions
|
@ -599,11 +599,6 @@ ENDIF(BUILD_OPENMW OR BUILD_OPENCS)
|
||||||
# Components
|
# Components
|
||||||
add_subdirectory (components)
|
add_subdirectory (components)
|
||||||
|
|
||||||
# Plugins
|
|
||||||
#if (BUILD_MYGUI_PLUGIN)
|
|
||||||
# add_subdirectory(plugins/mygui_resource_plugin)
|
|
||||||
#endif()
|
|
||||||
|
|
||||||
# Apps and tools
|
# Apps and tools
|
||||||
if (BUILD_OPENMW_MP)
|
if (BUILD_OPENMW_MP)
|
||||||
add_subdirectory( apps/openmw-mp )
|
add_subdirectory( apps/openmw-mp )
|
||||||
|
|
|
@ -10,8 +10,7 @@ Currently, we are focused on completing the MW game experience and general polis
|
||||||
Note:
|
Note:
|
||||||
* Tasks set to 'openmw-future' are usually out of the current scope of the project and can't be started yet.
|
* Tasks set to 'openmw-future' are usually out of the current scope of the project and can't be started yet.
|
||||||
* Bugs that are not 'Confirmed' should be confirmed first.
|
* Bugs that are not 'Confirmed' should be confirmed first.
|
||||||
* Larger Features should have a discussion before you start implementing.
|
* Often, it's best to start a discussion about possible solutions before you jump into coding, especially for larger features.
|
||||||
* In many cases, it's best to have a discussion about possible solutions before you jump into coding.
|
|
||||||
|
|
||||||
Aside from coding, you can also help by triaging the issues list. Check for bugs that are 'Unconfirmed' and try to confirm them on your end, working out any details that may be necessary. Check for bugs that do not conform to [Bug reporting guidelines](https://wiki.openmw.org/index.php?title=Bug_Reporting_Guidelines) and improve them to do so!
|
Aside from coding, you can also help by triaging the issues list. Check for bugs that are 'Unconfirmed' and try to confirm them on your end, working out any details that may be necessary. Check for bugs that do not conform to [Bug reporting guidelines](https://wiki.openmw.org/index.php?title=Bug_Reporting_Guidelines) and improve them to do so!
|
||||||
|
|
||||||
|
@ -22,7 +21,7 @@ Pull Request Guidelines
|
||||||
|
|
||||||
To facilitate the review process, your pull request description should include the following, if applicable:
|
To facilitate the review process, your pull request description should include the following, if applicable:
|
||||||
|
|
||||||
* A link back to the bug report or forum discussion that prompted the change
|
* A link back to the bug report or forum discussion that prompted the change. Note: when linking bugs, use the syntax ```[Bug #xyz](https://bugs.openmw.org/issues/#xyz)``` to create a clickable link. Writing only 'Bug #xyz' will unfortunately create a link to the Github pull request with that number instead.
|
||||||
* Summary of the changes made
|
* Summary of the changes made
|
||||||
* Reasoning / motivation behind the change
|
* Reasoning / motivation behind the change
|
||||||
* What testing you have carried out to verify the change
|
* What testing you have carried out to verify the change
|
||||||
|
@ -48,7 +47,7 @@ Unfortunately, the definition of what is a "bug" is not so clear. Consider that
|
||||||
* Many people will actually <i>like</i> these "bugs" because that is what they remember the game for.
|
* Many people will actually <i>like</i> these "bugs" because that is what they remember the game for.
|
||||||
* Exploits may be part of the fun of an open-world game - they reward knowledge with power. There are too many of them to plug them all, anyway.
|
* Exploits may be part of the fun of an open-world game - they reward knowledge with power. There are too many of them to plug them all, anyway.
|
||||||
|
|
||||||
OpenMW, in its default configuration, is meant to be a faithful reimplementation of Morrowind, minus things like crash bugs, stability issues and design errors. However, we try to avoid touching anything that affects the core gameplay, the balancing of the game or introduces incompatibilities with existing mod content.
|
OpenMW, in its default configuration, is meant to be a faithful reimplementation of Morrowind, minus things like crash bugs, stability issues and severe design errors. However, we try to avoid touching anything that affects the core gameplay, the balancing of the game or introduces incompatibilities with existing mod content.
|
||||||
|
|
||||||
That said, we may sometimes evaluate such issues on an individual basis. Common exceptions to the above would be:
|
That said, we may sometimes evaluate such issues on an individual basis. Common exceptions to the above would be:
|
||||||
|
|
||||||
|
@ -102,7 +101,7 @@ Merging
|
||||||
|
|
||||||
To be able to merge PRs, commit priviledges are required. If you do not have the priviledges, just ping someone that does have them with a short comment like "Looks good to me @user".
|
To be able to merge PRs, commit priviledges are required. If you do not have the priviledges, just ping someone that does have them with a short comment like "Looks good to me @user".
|
||||||
|
|
||||||
The person to merge the PR may either use github's Merge button or if using the command line, use the ```--no-ff``` flag and include the pull request number in the commit description.
|
The person to merge the PR may either use github's Merge button or if using the command line, use the ```--no-ff``` flag (so a merge commit is created, just like with Github's merge button) and include the pull request number in the commit description.
|
||||||
|
|
||||||
|
|
||||||
Other resources
|
Other resources
|
||||||
|
|
|
@ -694,7 +694,7 @@ void Record<ESM::Dialogue>::print()
|
||||||
// loads, rather than loading and then dumping. :-( Anyone mind if
|
// loads, rather than loading and then dumping. :-( Anyone mind if
|
||||||
// I change this?
|
// I change this?
|
||||||
ESM::Dialogue::InfoContainer::iterator iit;
|
ESM::Dialogue::InfoContainer::iterator iit;
|
||||||
for (iit = mData.mInfo.begin(); iit != mData.mInfo.end(); iit++)
|
for (iit = mData.mInfo.begin(); iit != mData.mInfo.end(); ++iit)
|
||||||
std::cout << "INFO!" << iit->mId << std::endl;
|
std::cout << "INFO!" << iit->mId << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1123,7 +1123,7 @@ void Record<ESM::Pathgrid>::print()
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
ESM::Pathgrid::PointList::iterator pit;
|
ESM::Pathgrid::PointList::iterator pit;
|
||||||
for (pit = mData.mPoints.begin(); pit != mData.mPoints.end(); pit++)
|
for (pit = mData.mPoints.begin(); pit != mData.mPoints.end(); ++pit)
|
||||||
{
|
{
|
||||||
std::cout << " Point[" << i << "]:" << std::endl;
|
std::cout << " Point[" << i << "]:" << std::endl;
|
||||||
std::cout << " Coordinates: (" << pit->mX << ","
|
std::cout << " Coordinates: (" << pit->mX << ","
|
||||||
|
@ -1135,7 +1135,7 @@ void Record<ESM::Pathgrid>::print()
|
||||||
}
|
}
|
||||||
i = 0;
|
i = 0;
|
||||||
ESM::Pathgrid::EdgeList::iterator eit;
|
ESM::Pathgrid::EdgeList::iterator eit;
|
||||||
for (eit = mData.mEdges.begin(); eit != mData.mEdges.end(); eit++)
|
for (eit = mData.mEdges.begin(); eit != mData.mEdges.end(); ++eit)
|
||||||
{
|
{
|
||||||
std::cout << " Edge[" << i << "]: " << eit->mV0 << " -> " << eit->mV1 << std::endl;
|
std::cout << " Edge[" << i << "]: " << eit->mV0 << " -> " << eit->mV1 << std::endl;
|
||||||
if (eit->mV0 >= mData.mData.mS2 || eit->mV1 >= mData.mData.mS2)
|
if (eit->mV0 >= mData.mData.mS2 || eit->mV1 >= mData.mData.mS2)
|
||||||
|
|
|
@ -106,7 +106,7 @@ if (DESIRED_QT_VERSION MATCHES 4)
|
||||||
target_link_libraries(openmw-launcher ${QT_QTMAIN_LIBRARY})
|
target_link_libraries(openmw-launcher ${QT_QTMAIN_LIBRARY})
|
||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
else()
|
else()
|
||||||
qt5_use_modules(openmw-launcher Widgets Core)
|
target_link_libraries(openmw-launcher Qt5::Widgets Qt5::Core)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (BUILD_WITH_CODE_COVERAGE)
|
if (BUILD_WITH_CODE_COVERAGE)
|
||||||
|
|
|
@ -33,12 +33,12 @@ bool hasExtension(std::string filename, std::string extensionToFind)
|
||||||
}
|
}
|
||||||
|
|
||||||
///See if the file has the "nif" extension.
|
///See if the file has the "nif" extension.
|
||||||
bool isNIF(std::string filename)
|
bool isNIF(const std::string & filename)
|
||||||
{
|
{
|
||||||
return hasExtension(filename,"nif");
|
return hasExtension(filename,"nif");
|
||||||
}
|
}
|
||||||
///See if the file has the "bsa" extension.
|
///See if the file has the "bsa" extension.
|
||||||
bool isBSA(std::string filename)
|
bool isBSA(const std::string & filename)
|
||||||
{
|
{
|
||||||
return hasExtension(filename,"bsa");
|
return hasExtension(filename,"bsa");
|
||||||
}
|
}
|
||||||
|
|
|
@ -246,7 +246,7 @@ if (DESIRED_QT_VERSION MATCHES 4)
|
||||||
target_link_libraries(openmw-cs ${QT_QTMAIN_LIBRARY})
|
target_link_libraries(openmw-cs ${QT_QTMAIN_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
qt5_use_modules(openmw-cs Widgets Core Network OpenGL)
|
target_link_libraries(openmw-cs Qt5::Widgets Qt5::Core Qt5::Network Qt5::OpenGL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
|
|
@ -579,7 +579,7 @@ bool CSMFilter::Parser::parse (const std::string& filter, bool allowPredefined)
|
||||||
}
|
}
|
||||||
// We do not use isString() here, because there could be a pre-defined filter with an ID that is
|
// We do not use isString() here, because there could be a pre-defined filter with an ID that is
|
||||||
// equal a filter keyword.
|
// equal a filter keyword.
|
||||||
else if (token.mType==Token::Type_String && allowPredefined)
|
else if (token.mType==Token::Type_String)
|
||||||
{
|
{
|
||||||
if (getNextToken()!=Token (Token::Type_EOS))
|
if (getNextToken()!=Token (Token::Type_EOS))
|
||||||
{
|
{
|
||||||
|
|
|
@ -49,7 +49,7 @@ namespace CSMPrefs
|
||||||
ShortcutMap::iterator shortcutListIt = mWidgetShortcuts.find(widget);
|
ShortcutMap::iterator shortcutListIt = mWidgetShortcuts.find(widget);
|
||||||
if (shortcutListIt != mWidgetShortcuts.end())
|
if (shortcutListIt != mWidgetShortcuts.end())
|
||||||
{
|
{
|
||||||
std::remove(shortcutListIt->second.begin(), shortcutListIt->second.end(), shortcut);
|
shortcutListIt->second.erase(std::remove(shortcutListIt->second.begin(), shortcutListIt->second.end(), shortcut), shortcutListIt->second.end());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ void CSMTools::PathgridCheckStage::perform (int stage, CSMDoc::Messages& message
|
||||||
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Pathgrid, pathgrid.mId);
|
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Pathgrid, pathgrid.mId);
|
||||||
|
|
||||||
// check the number of pathgrid points
|
// check the number of pathgrid points
|
||||||
if (pathgrid.mData.mS2 > static_cast<int>(pathgrid.mPoints.size()))
|
if (pathgrid.mData.mS2 < static_cast<int>(pathgrid.mPoints.size()))
|
||||||
messages.add (id, pathgrid.mId + " has less points than expected", "", CSMDoc::Message::Severity_Error);
|
messages.add (id, pathgrid.mId + " has less points than expected", "", CSMDoc::Message::Severity_Error);
|
||||||
else if (pathgrid.mData.mS2 > static_cast<int>(pathgrid.mPoints.size()))
|
else if (pathgrid.mData.mS2 > static_cast<int>(pathgrid.mPoints.size()))
|
||||||
messages.add (id, pathgrid.mId + " has more points than expected", "", CSMDoc::Message::Severity_Error);
|
messages.add (id, pathgrid.mId + " has more points than expected", "", CSMDoc::Message::Severity_Error);
|
||||||
|
|
|
@ -1375,8 +1375,6 @@ QVariant CSMWorld::CreatureAttackRefIdAdapter::getNestedData (const RefIdColumn
|
||||||
return subRowIndex + 1;
|
return subRowIndex + 1;
|
||||||
else if (subColIndex < 3) // 1 or 2
|
else if (subColIndex < 3) // 1 or 2
|
||||||
return creature.mData.mAttack[(subRowIndex * 2) + (subColIndex - 1)];
|
return creature.mData.mAttack[(subRowIndex * 2) + (subColIndex - 1)];
|
||||||
else
|
|
||||||
return QVariant(); // throw an exception here?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSMWorld::CreatureAttackRefIdAdapter::setNestedData (const RefIdColumn *column,
|
void CSMWorld::CreatureAttackRefIdAdapter::setNestedData (const RefIdColumn *column,
|
||||||
|
|
|
@ -167,7 +167,7 @@ void CSVDoc::Loader::loadingStopped (CSMDoc::Document *document, bool completed,
|
||||||
delete iter->second;
|
delete iter->second;
|
||||||
mDocuments.erase (iter);
|
mDocuments.erase (iter);
|
||||||
}
|
}
|
||||||
else if (!completed && !error.empty())
|
else
|
||||||
{
|
{
|
||||||
iter->second->abort (error);
|
iter->second->abort (error);
|
||||||
// Leave the window open for now (wait for the user to close it)
|
// Leave the window open for now (wait for the user to close it)
|
||||||
|
|
|
@ -63,19 +63,9 @@ std::string CSVWorld::ReferenceCreator::getErrors() const
|
||||||
std::string cell = mCell->text().toUtf8().constData();
|
std::string cell = mCell->text().toUtf8().constData();
|
||||||
|
|
||||||
if (cell.empty())
|
if (cell.empty())
|
||||||
{
|
|
||||||
if (!errors.empty())
|
|
||||||
errors += "<br>";
|
|
||||||
|
|
||||||
errors += "Missing Cell ID";
|
errors += "Missing Cell ID";
|
||||||
}
|
|
||||||
else if (getData().getCells().searchId (cell)==-1)
|
else if (getData().getCells().searchId (cell)==-1)
|
||||||
{
|
|
||||||
if (!errors.empty())
|
|
||||||
errors += "<br>";
|
|
||||||
|
|
||||||
errors += "Invalid Cell ID";
|
errors += "Invalid Cell ID";
|
||||||
}
|
|
||||||
|
|
||||||
return errors;
|
return errors;
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,8 +111,11 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
|
||||||
|
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Attempts so far: %i", player->getHandshakeAttempts());
|
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Attempts so far: %i", player->getHandshakeAttempts());
|
||||||
|
|
||||||
if (player->getHandshakeAttempts() > 5)
|
if (player->getHandshakeAttempts() > 20)
|
||||||
kickPlayer(player->guid);
|
kickPlayer(player->guid, false);
|
||||||
|
else if (player->getHandshakeAttempts() > 5)
|
||||||
|
kickPlayer(player->guid, true);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -529,9 +532,9 @@ int Networking::mainLoop()
|
||||||
return exitCode;
|
return exitCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Networking::kickPlayer(RakNet::RakNetGUID guid)
|
void Networking::kickPlayer(RakNet::RakNetGUID guid, bool sendNotification)
|
||||||
{
|
{
|
||||||
peer->CloseConnection(guid, true);
|
peer->CloseConnection(guid, sendNotification);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Networking::banAddress(const char *ipAddress)
|
void Networking::banAddress(const char *ipAddress)
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace mwmp
|
||||||
|
|
||||||
void newPlayer(RakNet::RakNetGUID guid);
|
void newPlayer(RakNet::RakNetGUID guid);
|
||||||
void disconnectPlayer(RakNet::RakNetGUID guid);
|
void disconnectPlayer(RakNet::RakNetGUID guid);
|
||||||
void kickPlayer(RakNet::RakNetGUID guid);
|
void kickPlayer(RakNet::RakNetGUID guid, bool sendNotification = true);
|
||||||
|
|
||||||
void banAddress(const char *ipAddress);
|
void banAddress(const char *ipAddress);
|
||||||
void unbanAddress(const char *ipAddress);
|
void unbanAddress(const char *ipAddress);
|
||||||
|
|
84
apps/openmw-mp/Script/Functions/Shapeshift.cpp
Normal file
84
apps/openmw-mp/Script/Functions/Shapeshift.cpp
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
#include "Shapeshift.hpp"
|
||||||
|
|
||||||
|
#include <components/openmw-mp/NetworkMessages.hpp>
|
||||||
|
#include <components/openmw-mp/Log.hpp>
|
||||||
|
|
||||||
|
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
|
||||||
|
#include <apps/openmw-mp/Networking.hpp>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
double ShapeshiftFunctions::GetScale(unsigned short pid) noexcept
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, 0.0f);
|
||||||
|
|
||||||
|
return player->scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ShapeshiftFunctions::IsWerewolf(unsigned short pid) noexcept
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, 0);
|
||||||
|
|
||||||
|
return player->isWerewolf;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *ShapeshiftFunctions::GetCreatureRefId(unsigned short pid) noexcept
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, 0);
|
||||||
|
|
||||||
|
return player->creatureRefId.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ShapeshiftFunctions::GetCreatureNameDisplayState(unsigned short pid) noexcept
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, 0);
|
||||||
|
|
||||||
|
return player->displayCreatureName;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShapeshiftFunctions::SetScale(unsigned short pid, double scale) noexcept
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
|
player->scale = scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShapeshiftFunctions::SetWerewolfState(unsigned short pid, bool isWerewolf) noexcept
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
|
player->isWerewolf = isWerewolf;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShapeshiftFunctions::SetCreatureRefId(unsigned short pid, const char *refId) noexcept
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
|
player->creatureRefId = refId;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShapeshiftFunctions::SetCreatureNameDisplayState(unsigned short pid, bool displayState) noexcept
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
|
player->displayCreatureName = displayState;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShapeshiftFunctions::SendShapeshift(unsigned short pid)
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_SHAPESHIFT)->setPlayer(player);
|
||||||
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_SHAPESHIFT)->Send(false);
|
||||||
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_SHAPESHIFT)->Send(true);
|
||||||
|
}
|
120
apps/openmw-mp/Script/Functions/Shapeshift.hpp
Normal file
120
apps/openmw-mp/Script/Functions/Shapeshift.hpp
Normal file
|
@ -0,0 +1,120 @@
|
||||||
|
#ifndef OPENMW_SHAPESHIFTAPI_HPP
|
||||||
|
#define OPENMW_SHAPESHIFTAPI_HPP
|
||||||
|
|
||||||
|
#include "../Types.hpp"
|
||||||
|
|
||||||
|
#define SHAPESHIFTAPI \
|
||||||
|
{"GetScale", ShapeshiftFunctions::GetScale},\
|
||||||
|
{"IsWerewolf", ShapeshiftFunctions::IsWerewolf},\
|
||||||
|
{"GetCreatureRefId", ShapeshiftFunctions::GetCreatureRefId},\
|
||||||
|
{"GetCreatureNameDisplayState", ShapeshiftFunctions::GetCreatureNameDisplayState},\
|
||||||
|
\
|
||||||
|
{"SetScale", ShapeshiftFunctions::SetScale},\
|
||||||
|
{"SetWerewolfState", ShapeshiftFunctions::SetWerewolfState},\
|
||||||
|
{"SetCreatureRefId", ShapeshiftFunctions::SetCreatureRefId},\
|
||||||
|
{"SetCreatureNameDisplayState", ShapeshiftFunctions::SetCreatureNameDisplayState},\
|
||||||
|
\
|
||||||
|
{"SendShapeshift", ShapeshiftFunctions::SendShapeshift}
|
||||||
|
|
||||||
|
class ShapeshiftFunctions
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Get the scale of a player.
|
||||||
|
*
|
||||||
|
* \param pid The player ID.
|
||||||
|
* \return The scale.
|
||||||
|
*/
|
||||||
|
static double GetScale(unsigned short pid) noexcept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Check whether a player is a werewolf.
|
||||||
|
*
|
||||||
|
* This is based on the last PlayerShapeshift packet received or sent for that player.
|
||||||
|
*
|
||||||
|
* \param pid The player ID.
|
||||||
|
* \return The werewolf state.
|
||||||
|
*/
|
||||||
|
static bool IsWerewolf(unsigned short pid) noexcept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Get the refId of the creature the player is disguised as.
|
||||||
|
*
|
||||||
|
* \param pid The player ID.
|
||||||
|
* \return The creature refId.
|
||||||
|
*/
|
||||||
|
static const char *GetCreatureRefId(unsigned short pid) noexcept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Check whether a player's name is replaced by that of the creature they are
|
||||||
|
* disguised as when other players hover over them.
|
||||||
|
*
|
||||||
|
* This is based on the last PlayerShapeshift packet received or sent for that player.
|
||||||
|
*
|
||||||
|
* \param pid The player ID.
|
||||||
|
* \return The creature name display state.
|
||||||
|
*/
|
||||||
|
static bool GetCreatureNameDisplayState(unsigned short pid) noexcept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set the scale of a player.
|
||||||
|
*
|
||||||
|
* This changes the scale recorded for that player in the server memory, but
|
||||||
|
* does not by itself send a packet.
|
||||||
|
*
|
||||||
|
* \param pid The player ID.
|
||||||
|
* \param scale The new scale.
|
||||||
|
* \return void
|
||||||
|
*/
|
||||||
|
static void SetScale(unsigned short pid, double scale) noexcept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set the werewolf state of a player.
|
||||||
|
*
|
||||||
|
* This changes the werewolf state recorded for that player in the server memory, but
|
||||||
|
* does not by itself send a packet.
|
||||||
|
*
|
||||||
|
* \param pid The player ID.
|
||||||
|
* \param isWerewolf The new werewolf state.
|
||||||
|
* \return void
|
||||||
|
*/
|
||||||
|
static void SetWerewolfState(unsigned short pid, bool isWerewolf) noexcept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set the refId of the creature a player is disguised as.
|
||||||
|
*
|
||||||
|
* This changes the creature refId recorded for that player in the server memory, but
|
||||||
|
* does not by itself send a packet.
|
||||||
|
*
|
||||||
|
* \param pid The player ID.
|
||||||
|
* \param refId The creature refId.
|
||||||
|
* \param displaysCreatureName Whether the player's name appears as that of the creature
|
||||||
|
* when hovered over by others.
|
||||||
|
* \return void
|
||||||
|
*/
|
||||||
|
static void SetCreatureRefId(unsigned short pid, const char *refId) noexcept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set whether a player's name is replaced by that of the creature they are
|
||||||
|
* disguised as when other players hover over them.
|
||||||
|
*
|
||||||
|
* \param pid The player ID.
|
||||||
|
* \param displayState The creature name display state.
|
||||||
|
* \return void
|
||||||
|
*/
|
||||||
|
static void SetCreatureNameDisplayState(unsigned short pid, bool displayState) noexcept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Send a PlayerShapeshift packet about a player.
|
||||||
|
*
|
||||||
|
* This sends the packet to all players connected to the server. It is currently used
|
||||||
|
* only to communicate werewolf states.
|
||||||
|
*
|
||||||
|
* \param pid The player ID.
|
||||||
|
* \return void
|
||||||
|
*/
|
||||||
|
static void SendShapeshift(unsigned short pid);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //OPENMW_SHAPESHIFTAPI_HPP
|
|
@ -143,6 +143,12 @@ namespace MWGui
|
||||||
|
|
||||||
mItemView->setModel(mSortModel);
|
mItemView->setModel(mSortModel);
|
||||||
|
|
||||||
|
mFilterAll->setStateSelected(true);
|
||||||
|
mFilterWeapon->setStateSelected(false);
|
||||||
|
mFilterApparel->setStateSelected(false);
|
||||||
|
mFilterMagic->setStateSelected(false);
|
||||||
|
mFilterMisc->setStateSelected(false);
|
||||||
|
|
||||||
mPreview->updatePtr(mPtr);
|
mPreview->updatePtr(mPtr);
|
||||||
mPreview->rebuild();
|
mPreview->rebuild();
|
||||||
mPreview->update();
|
mPreview->update();
|
||||||
|
|
|
@ -15,11 +15,8 @@ namespace MWGui
|
||||||
// check if count of the reference has become 0
|
// check if count of the reference has become 0
|
||||||
if (!mPtr.isEmpty() && mPtr.getRefData().getCount() == 0)
|
if (!mPtr.isEmpty() && mPtr.getRefData().getCount() == 0)
|
||||||
{
|
{
|
||||||
if (!mPtr.isEmpty())
|
mPtr = MWWorld::Ptr();
|
||||||
{
|
onReferenceUnavailable();
|
||||||
mPtr = MWWorld::Ptr();
|
|
||||||
onReferenceUnavailable();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -533,10 +533,10 @@ namespace MWGui
|
||||||
}
|
}
|
||||||
|
|
||||||
MWScrollBar::MWScrollBar()
|
MWScrollBar::MWScrollBar()
|
||||||
: mEnableRepeat(true)
|
: mEnableRepeat(true)
|
||||||
, mRepeatTriggerTime(0.5f)
|
, mRepeatTriggerTime(0.5f)
|
||||||
, mRepeatStepTime(0.1f)
|
, mRepeatStepTime(0.1f)
|
||||||
, mIsIncreasing(true)
|
, mIsIncreasing(true)
|
||||||
{
|
{
|
||||||
#if MYGUI_VERSION >= MYGUI_DEFINE_VERSION(3,2,2)
|
#if MYGUI_VERSION >= MYGUI_DEFINE_VERSION(3,2,2)
|
||||||
ScrollBar::setRepeatEnabled(false);
|
ScrollBar::setRepeatEnabled(false);
|
||||||
|
|
|
@ -25,7 +25,7 @@ void WindowBase::setVisible(bool visible)
|
||||||
|
|
||||||
if (visible)
|
if (visible)
|
||||||
onOpen();
|
onOpen();
|
||||||
else if (wasVisible && !visible)
|
else if (wasVisible)
|
||||||
onClose();
|
onClose();
|
||||||
|
|
||||||
// This is needed as invisible widgets can retain key focus.
|
// This is needed as invisible widgets can retain key focus.
|
||||||
|
|
|
@ -1576,7 +1576,7 @@ namespace MWMechanics
|
||||||
MWBase::Environment::get().getWindowManager()->setSneakVisibility(false);
|
MWBase::Environment::get().getWindowManager()->setSneakVisibility(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (!detected)
|
else
|
||||||
avoidedNotice = true;
|
avoidedNotice = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -533,8 +533,7 @@ void CharacterController::refreshMovementAnims(const WeaponInfo* weap, Character
|
||||||
|
|
||||||
void CharacterController::refreshIdleAnims(const WeaponInfo* weap, CharacterState idle, bool force)
|
void CharacterController::refreshIdleAnims(const WeaponInfo* weap, CharacterState idle, bool force)
|
||||||
{
|
{
|
||||||
if(force || idle != mIdleState ||
|
if(force || idle != mIdleState || (!mAnimation->isPlaying(mCurrentIdle) && mAnimQueue.empty()))
|
||||||
((idle == mIdleState) && !mAnimation->isPlaying(mCurrentIdle) && mAnimQueue.empty()))
|
|
||||||
{
|
{
|
||||||
mIdleState = idle;
|
mIdleState = idle;
|
||||||
size_t numLoops = ~0ul;
|
size_t numLoops = ~0ul;
|
||||||
|
@ -1249,7 +1248,7 @@ bool CharacterController::updateWeaponState()
|
||||||
std::string weapgroup;
|
std::string weapgroup;
|
||||||
if(weaptype == WeapType_None)
|
if(weaptype == WeapType_None)
|
||||||
{
|
{
|
||||||
if ((!isWerewolf || mWeaponType != WeapType_Spell))
|
if (!isWerewolf || mWeaponType != WeapType_Spell)
|
||||||
{
|
{
|
||||||
getWeaponGroup(mWeaponType, weapgroup);
|
getWeaponGroup(mWeaponType, weapgroup);
|
||||||
mAnimation->play(weapgroup, priorityWeapon,
|
mAnimation->play(weapgroup, priorityWeapon,
|
||||||
|
@ -2291,7 +2290,7 @@ bool CharacterController::playGroup(const std::string &groupname, int mode, int
|
||||||
End of tes3mp addition
|
End of tes3mp addition
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
else if(mode == 0)
|
else
|
||||||
{
|
{
|
||||||
mAnimQueue.resize(1);
|
mAnimQueue.resize(1);
|
||||||
mAnimQueue.push_back(entry);
|
mAnimQueue.push_back(entry);
|
||||||
|
|
|
@ -316,7 +316,7 @@ namespace MWMechanics
|
||||||
buildPath(startPoint, endPoint, cell, pathgridGraph);
|
buildPath(startPoint, endPoint, cell, pathgridGraph);
|
||||||
if (mPath.size() >= 2)
|
if (mPath.size() >= 2)
|
||||||
{
|
{
|
||||||
// if 2nd waypoint of new path == 1st waypoint of old,
|
// if 2nd waypoint of new path == 1st waypoint of old,
|
||||||
// delete 1st waypoint of new path.
|
// delete 1st waypoint of new path.
|
||||||
std::list<ESM::Pathgrid::Point>::iterator iter = ++mPath.begin();
|
std::list<ESM::Pathgrid::Point>::iterator iter = ++mPath.begin();
|
||||||
if (iter->mX == oldStart.mX
|
if (iter->mX == oldStart.mX
|
||||||
|
|
|
@ -174,7 +174,7 @@ void DedicatedPlayer::setShapeshift()
|
||||||
if (reference)
|
if (reference)
|
||||||
isNpc = ptr.getTypeName() == typeid(ESM::NPC).name();
|
isNpc = ptr.getTypeName() == typeid(ESM::NPC).name();
|
||||||
|
|
||||||
if (creatureRefId != previousCreatureRefId)
|
if (creatureRefId != previousCreatureRefId || displayCreatureName != previousDisplayCreatureName)
|
||||||
{
|
{
|
||||||
if (!creatureRefId.empty() && RecordHelper::doesCreatureExist(creatureRefId))
|
if (!creatureRefId.empty() && RecordHelper::doesCreatureExist(creatureRefId))
|
||||||
{
|
{
|
||||||
|
@ -229,6 +229,7 @@ void DedicatedPlayer::setShapeshift()
|
||||||
}
|
}
|
||||||
|
|
||||||
previousCreatureRefId = creatureRefId;
|
previousCreatureRefId = creatureRefId;
|
||||||
|
previousDisplayCreatureName = displayCreatureName;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ptr.getTypeName() == typeid(ESM::NPC).name())
|
if (ptr.getTypeName() == typeid(ESM::NPC).name())
|
||||||
|
|
|
@ -73,6 +73,7 @@ namespace mwmp
|
||||||
|
|
||||||
std::string previousRace;
|
std::string previousRace;
|
||||||
std::string previousCreatureRefId;
|
std::string previousCreatureRefId;
|
||||||
|
bool previousDisplayCreatureName;
|
||||||
|
|
||||||
std::string creatureRecordId;
|
std::string creatureRecordId;
|
||||||
};
|
};
|
||||||
|
|
|
@ -488,7 +488,7 @@ namespace MWScript
|
||||||
const MWWorld::ESMStore &store = world->getStore();
|
const MWWorld::ESMStore &store = world->getStore();
|
||||||
const ESM::Faction *faction = store.get<ESM::Faction>().find(factionId);
|
const ESM::Faction *faction = store.get<ESM::Faction>().find(factionId);
|
||||||
|
|
||||||
if(rank < 0 || rank > 9)
|
if(rank < 0)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
return faction->mRanks[rank];
|
return faction->mRanks[rank];
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
#include "quicksavemanager.hpp"
|
#include "quicksavemanager.hpp"
|
||||||
|
|
||||||
MWState::QuickSaveManager::QuickSaveManager(std::string &saveName, unsigned int maxSaves)
|
MWState::QuickSaveManager::QuickSaveManager(std::string &saveName, unsigned int maxSaves)
|
||||||
|
: mSaveName(saveName)
|
||||||
|
, mMaxSaves(maxSaves)
|
||||||
|
, mOldestSlotVisited(NULL)
|
||||||
|
, mSlotsVisited(0)
|
||||||
{
|
{
|
||||||
this->mSaveName = saveName;
|
|
||||||
this->mMaxSaves = maxSaves;
|
|
||||||
this->mOldestSlotVisited = NULL;
|
|
||||||
this->mSlotsVisited = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWState::QuickSaveManager::visitSave(const Slot *saveSlot)
|
void MWState::QuickSaveManager::visitSave(const Slot *saveSlot)
|
||||||
|
|
|
@ -865,7 +865,6 @@ namespace MWWorld
|
||||||
if (mCell->mData.mFlags & ESM::Cell::Interior && mCell->mData.mFlags & ESM::Cell::HasWater)
|
if (mCell->mData.mFlags & ESM::Cell::Interior && mCell->mData.mFlags & ESM::Cell::HasWater)
|
||||||
mWaterLevel = state.mWaterLevel;
|
mWaterLevel = state.mWaterLevel;
|
||||||
|
|
||||||
mWaterLevel = state.mWaterLevel;
|
|
||||||
mLastRespawn = MWWorld::TimeStamp(state.mLastRespawn);
|
mLastRespawn = MWWorld::TimeStamp(state.mLastRespawn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -876,7 +875,6 @@ namespace MWWorld
|
||||||
if (mCell->mData.mFlags & ESM::Cell::Interior && mCell->mData.mFlags & ESM::Cell::HasWater)
|
if (mCell->mData.mFlags & ESM::Cell::Interior && mCell->mData.mFlags & ESM::Cell::HasWater)
|
||||||
state.mWaterLevel = mWaterLevel;
|
state.mWaterLevel = mWaterLevel;
|
||||||
|
|
||||||
state.mWaterLevel = mWaterLevel;
|
|
||||||
state.mHasFogOfWar = (mFogState.get() ? 1 : 0);
|
state.mHasFogOfWar = (mFogState.get() ? 1 : 0);
|
||||||
state.mLastRespawn = mLastRespawn.toEsm();
|
state.mLastRespawn = mLastRespawn.toEsm();
|
||||||
}
|
}
|
||||||
|
|
|
@ -528,8 +528,7 @@ namespace MWWorld
|
||||||
float z = pos.rot[2];
|
float z = pos.rot[2];
|
||||||
world->rotateObject(player, x, y, z);
|
world->rotateObject(player, x, y, z);
|
||||||
|
|
||||||
if (adjustPlayerPos)
|
player.getClass().adjustPosition(player, true);
|
||||||
player.getClass().adjustPosition(player, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MWBase::MechanicsManager *mechMgr =
|
MWBase::MechanicsManager *mechMgr =
|
||||||
|
|
|
@ -1134,7 +1134,6 @@ inline void WeatherManager::calculateTransitionResult(const float factor, const
|
||||||
mResult.mIsStorm = current.mIsStorm;
|
mResult.mIsStorm = current.mIsStorm;
|
||||||
mResult.mParticleEffect = current.mParticleEffect;
|
mResult.mParticleEffect = current.mParticleEffect;
|
||||||
mResult.mRainEffect = current.mRainEffect;
|
mResult.mRainEffect = current.mRainEffect;
|
||||||
mResult.mParticleEffect = current.mParticleEffect;
|
|
||||||
mResult.mRainSpeed = current.mRainSpeed;
|
mResult.mRainSpeed = current.mRainSpeed;
|
||||||
mResult.mRainFrequency = current.mRainFrequency;
|
mResult.mRainFrequency = current.mRainFrequency;
|
||||||
mResult.mAmbientSoundVolume = 1-(factor*2);
|
mResult.mAmbientSoundVolume = 1-(factor*2);
|
||||||
|
@ -1146,7 +1145,6 @@ inline void WeatherManager::calculateTransitionResult(const float factor, const
|
||||||
mResult.mIsStorm = other.mIsStorm;
|
mResult.mIsStorm = other.mIsStorm;
|
||||||
mResult.mParticleEffect = other.mParticleEffect;
|
mResult.mParticleEffect = other.mParticleEffect;
|
||||||
mResult.mRainEffect = other.mRainEffect;
|
mResult.mRainEffect = other.mRainEffect;
|
||||||
mResult.mParticleEffect = other.mParticleEffect;
|
|
||||||
mResult.mRainSpeed = other.mRainSpeed;
|
mResult.mRainSpeed = other.mRainSpeed;
|
||||||
mResult.mRainFrequency = other.mRainFrequency;
|
mResult.mRainFrequency = other.mRainFrequency;
|
||||||
mResult.mAmbientSoundVolume = 2*(factor-0.5f);
|
mResult.mAmbientSoundVolume = 2*(factor-0.5f);
|
||||||
|
|
|
@ -441,7 +441,6 @@ namespace MWWorld
|
||||||
gmst["sCompanionWarningMessage"] = ESM::Variant("Warning message");
|
gmst["sCompanionWarningMessage"] = ESM::Variant("Warning message");
|
||||||
gmst["sCompanionWarningButtonOne"] = ESM::Variant("Button 1");
|
gmst["sCompanionWarningButtonOne"] = ESM::Variant("Button 1");
|
||||||
gmst["sCompanionWarningButtonTwo"] = ESM::Variant("Button 2");
|
gmst["sCompanionWarningButtonTwo"] = ESM::Variant("Button 2");
|
||||||
gmst["sCompanionShare"] = ESM::Variant("Companion Share");
|
|
||||||
gmst["sProfitValue"] = ESM::Variant("Profit Value");
|
gmst["sProfitValue"] = ESM::Variant("Profit Value");
|
||||||
gmst["sTeleportDisabled"] = ESM::Variant("Teleport disabled");
|
gmst["sTeleportDisabled"] = ESM::Variant("Teleport disabled");
|
||||||
gmst["sLevitateDisabled"] = ESM::Variant("Levitate disabled");
|
gmst["sLevitateDisabled"] = ESM::Variant("Levitate disabled");
|
||||||
|
|
|
@ -118,7 +118,7 @@ if (DESIRED_QT_VERSION MATCHES 4)
|
||||||
target_link_libraries(openmw-wizard ${QT_QTMAIN_LIBRARY})
|
target_link_libraries(openmw-wizard ${QT_QTMAIN_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
qt5_use_modules(openmw-wizard Widgets Core)
|
target_link_libraries(openmw-wizard Qt5::Widgets Qt5::Core)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (OPENMW_USE_UNSHIELD)
|
if (OPENMW_USE_UNSHIELD)
|
||||||
|
|
|
@ -161,7 +161,7 @@ void Wizard::InstallationPage::showFileDialog(Wizard::Component component)
|
||||||
|
|
||||||
if (path.isEmpty()) {
|
if (path.isEmpty()) {
|
||||||
logTextEdit->appendHtml(tr("<p><br/><span style=\"color:red;\"> \
|
logTextEdit->appendHtml(tr("<p><br/><span style=\"color:red;\"> \
|
||||||
<b>Error: The installation was aborted by the user</b></p>"));
|
<b>Error: The installation was aborted by the user</b></span></p>"));
|
||||||
|
|
||||||
mWizard->addLogText(QLatin1String("Error: The installation was aborted by the user"));
|
mWizard->addLogText(QLatin1String("Error: The installation was aborted by the user"));
|
||||||
mWizard->mError = true;
|
mWizard->mError = true;
|
||||||
|
|
|
@ -472,8 +472,8 @@ bool Wizard::UnshieldWorker::setupComponent(Component component)
|
||||||
|
|
||||||
if (morrowindFound) {
|
if (morrowindFound) {
|
||||||
// Check if we have correct archive, other archives have Morrowind.bsa too
|
// Check if we have correct archive, other archives have Morrowind.bsa too
|
||||||
if ((tribunalFound && bloodmoonFound)
|
if (tribunalFound == bloodmoonFound)
|
||||||
|| (!tribunalFound && !bloodmoonFound)) {
|
{
|
||||||
cabFile = file;
|
cabFile = file;
|
||||||
found = true; // We have a GoTY disk or a Morrowind-only disk
|
found = true; // We have a GoTY disk or a Morrowind-only disk
|
||||||
}
|
}
|
||||||
|
|
|
@ -275,7 +275,7 @@ if (USE_QT)
|
||||||
${QT_QTCORE_LIBRARY}
|
${QT_QTCORE_LIBRARY}
|
||||||
${QT_QTGUI_LIBRARY})
|
${QT_QTGUI_LIBRARY})
|
||||||
else()
|
else()
|
||||||
qt5_use_modules(components Widgets Core)
|
target_link_libraries(components Qt5::Widgets Qt5::Core)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -173,10 +173,10 @@ void ESM::CellRef::save (ESMWriter &esm, bool wideRefNum, bool inInventory, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!inInventory)
|
if (!inInventory)
|
||||||
|
{
|
||||||
esm.writeHNOCString ("KNAM", mKey);
|
esm.writeHNOCString ("KNAM", mKey);
|
||||||
|
|
||||||
if (!inInventory)
|
|
||||||
esm.writeHNOCString ("TNAM", mTrap);
|
esm.writeHNOCString ("TNAM", mTrap);
|
||||||
|
}
|
||||||
|
|
||||||
if (mReferenceBlocked != -1)
|
if (mReferenceBlocked != -1)
|
||||||
esm.writeHNT("UNAM", mReferenceBlocked);
|
esm.writeHNT("UNAM", mReferenceBlocked);
|
||||||
|
@ -188,7 +188,7 @@ void ESM::CellRef::save (ESMWriter &esm, bool wideRefNum, bool inInventory, bool
|
||||||
void ESM::CellRef::blank()
|
void ESM::CellRef::blank()
|
||||||
{
|
{
|
||||||
mRefNum.unset();
|
mRefNum.unset();
|
||||||
mRefID.clear();
|
mRefID.clear();
|
||||||
mScale = 1;
|
mScale = 1;
|
||||||
mOwner.clear();
|
mOwner.clear();
|
||||||
mGlobalVariable.clear();
|
mGlobalVariable.clear();
|
||||||
|
@ -205,7 +205,7 @@ void ESM::CellRef::blank()
|
||||||
mTrap.clear();
|
mTrap.clear();
|
||||||
mReferenceBlocked = -1;
|
mReferenceBlocked = -1;
|
||||||
mTeleport = false;
|
mTeleport = false;
|
||||||
|
|
||||||
for (int i=0; i<3; ++i)
|
for (int i=0; i<3; ++i)
|
||||||
{
|
{
|
||||||
mDoorDest.pos[i] = 0;
|
mDoorDest.pos[i] = 0;
|
||||||
|
|
|
@ -109,8 +109,6 @@ namespace ESM
|
||||||
|
|
||||||
void Region::blank()
|
void Region::blank()
|
||||||
{
|
{
|
||||||
mName.clear();
|
|
||||||
|
|
||||||
mData.mClear = mData.mCloudy = mData.mFoggy = mData.mOvercast = mData.mRain =
|
mData.mClear = mData.mCloudy = mData.mFoggy = mData.mOvercast = mData.mRain =
|
||||||
mData.mThunder = mData.mAsh, mData.mBlight = mData.mA = mData.mB = 0;
|
mData.mThunder = mData.mAsh, mData.mBlight = mData.mA = mData.mB = 0;
|
||||||
|
|
||||||
|
|
|
@ -232,9 +232,9 @@ namespace ESMTerrain
|
||||||
// Skip the first row / column unless we're at a chunk edge,
|
// Skip the first row / column unless we're at a chunk edge,
|
||||||
// since this row / column is already contained in a previous cell
|
// since this row / column is already contained in a previous cell
|
||||||
// This is only relevant if we're creating a chunk spanning multiple cells
|
// This is only relevant if we're creating a chunk spanning multiple cells
|
||||||
if (colStart == 0 && vertY_ != 0)
|
if (vertY_ != 0)
|
||||||
colStart += increment;
|
colStart += increment;
|
||||||
if (rowStart == 0 && vertX_ != 0)
|
if (vertX_ != 0)
|
||||||
rowStart += increment;
|
rowStart += increment;
|
||||||
|
|
||||||
// Only relevant for chunks smaller than (contained in) one cell
|
// Only relevant for chunks smaller than (contained in) one cell
|
||||||
|
|
|
@ -448,7 +448,7 @@ namespace Gui
|
||||||
MyGUI::FontCodeType::Enum type;
|
MyGUI::FontCodeType::Enum type;
|
||||||
if(i == 0)
|
if(i == 0)
|
||||||
type = MyGUI::FontCodeType::Selected;
|
type = MyGUI::FontCodeType::Selected;
|
||||||
else if (i == 1)
|
else // if (i == 1)
|
||||||
type = MyGUI::FontCodeType::SelectedBack;
|
type = MyGUI::FontCodeType::SelectedBack;
|
||||||
|
|
||||||
MyGUI::xml::ElementPtr cursorCode = codes->createChild("Code");
|
MyGUI::xml::ElementPtr cursorCode = codes->createChild("Code");
|
||||||
|
|
|
@ -275,7 +275,6 @@ namespace NifOsg
|
||||||
for (unsigned int i=0; i<root->getNumChildren(); ++i)
|
for (unsigned int i=0; i<root->getNumChildren(); ++i)
|
||||||
skel->addChild(root->getChild(i));
|
skel->addChild(root->getChild(i));
|
||||||
root->removeChildren(0, root->getNumChildren());
|
root->removeChildren(0, root->getNumChildren());
|
||||||
created = skel;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
skel->addChild(created);
|
skel->addChild(created);
|
||||||
|
|
|
@ -21,6 +21,9 @@ namespace SceneUtil
|
||||||
/// @note The source geometry will not be modified.
|
/// @note The source geometry will not be modified.
|
||||||
void setSourceGeometry(osg::ref_ptr<osg::Geometry> sourceGeom);
|
void setSourceGeometry(osg::ref_ptr<osg::Geometry> sourceGeom);
|
||||||
|
|
||||||
|
// Currently empty as this is difficult to implement. Technically we would need to compile both internal geometries in separate frames but this method is only called once. Alternatively we could compile just the static parts of the model.
|
||||||
|
virtual void compileGLObjects(osg::RenderInfo& renderInfo) const {}
|
||||||
|
|
||||||
class MorphTarget
|
class MorphTarget
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -23,8 +23,8 @@ namespace SceneUtil
|
||||||
|
|
||||||
META_Object(SceneUtil, RigGeometry)
|
META_Object(SceneUtil, RigGeometry)
|
||||||
|
|
||||||
// At this point compileGLObjects() remains unimplemented, hard to avoid race conditions
|
// Currently empty as this is difficult to implement. Technically we would need to compile both internal geometries in separate frames but this method is only called once. Alternatively we could compile just the static parts of the model.
|
||||||
// and there is limited value in compiling anyway since the data will change again for the next frame
|
virtual void compileGLObjects(osg::RenderInfo& renderInfo) const {}
|
||||||
|
|
||||||
struct BoneInfluence
|
struct BoneInfluence
|
||||||
{
|
{
|
||||||
|
|
2
extern/osgQt/CMakeLists.txt
vendored
2
extern/osgQt/CMakeLists.txt
vendored
|
@ -12,7 +12,7 @@ if (DESIRED_QT_VERSION MATCHES 4)
|
||||||
include(${QT_USE_FILE})
|
include(${QT_USE_FILE})
|
||||||
target_link_libraries(${OSGQT_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTOPENGL_LIBRARY})
|
target_link_libraries(${OSGQT_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTOPENGL_LIBRARY})
|
||||||
else()
|
else()
|
||||||
qt5_use_modules(${OSGQT_LIBRARY} Core OpenGL)
|
target_link_libraries(${OSGQT_LIBRARY} Qt5::Core Qt5::OpenGL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
link_directories(${CMAKE_CURRENT_BINARY_DIR})
|
link_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
|
@ -47,9 +47,9 @@ varying float depth;
|
||||||
#define PER_PIXEL_LIGHTING (@normalMap || @forcePPL)
|
#define PER_PIXEL_LIGHTING (@normalMap || @forcePPL)
|
||||||
|
|
||||||
#if !PER_PIXEL_LIGHTING
|
#if !PER_PIXEL_LIGHTING
|
||||||
varying vec4 lighting;
|
centroid varying vec4 lighting;
|
||||||
#else
|
#else
|
||||||
varying vec4 passColor;
|
centroid varying vec4 passColor;
|
||||||
#endif
|
#endif
|
||||||
varying vec3 passViewPos;
|
varying vec3 passViewPos;
|
||||||
varying vec3 passNormal;
|
varying vec3 passNormal;
|
||||||
|
|
|
@ -38,9 +38,9 @@ varying float depth;
|
||||||
#define PER_PIXEL_LIGHTING (@normalMap || @forcePPL)
|
#define PER_PIXEL_LIGHTING (@normalMap || @forcePPL)
|
||||||
|
|
||||||
#if !PER_PIXEL_LIGHTING
|
#if !PER_PIXEL_LIGHTING
|
||||||
varying vec4 lighting;
|
centroid varying vec4 lighting;
|
||||||
#else
|
#else
|
||||||
varying vec4 passColor;
|
centroid varying vec4 passColor;
|
||||||
#endif
|
#endif
|
||||||
varying vec3 passViewPos;
|
varying vec3 passViewPos;
|
||||||
varying vec3 passNormal;
|
varying vec3 passNormal;
|
||||||
|
|
|
@ -17,9 +17,9 @@ varying float depth;
|
||||||
#define PER_PIXEL_LIGHTING (@normalMap || @forcePPL)
|
#define PER_PIXEL_LIGHTING (@normalMap || @forcePPL)
|
||||||
|
|
||||||
#if !PER_PIXEL_LIGHTING
|
#if !PER_PIXEL_LIGHTING
|
||||||
varying vec4 lighting;
|
centroid varying vec4 lighting;
|
||||||
#else
|
#else
|
||||||
varying vec4 passColor;
|
centroid varying vec4 passColor;
|
||||||
#endif
|
#endif
|
||||||
varying vec3 passViewPos;
|
varying vec3 passViewPos;
|
||||||
varying vec3 passNormal;
|
varying vec3 passNormal;
|
||||||
|
|
|
@ -6,9 +6,9 @@ varying float depth;
|
||||||
#define PER_PIXEL_LIGHTING (@normalMap || @forcePPL)
|
#define PER_PIXEL_LIGHTING (@normalMap || @forcePPL)
|
||||||
|
|
||||||
#if !PER_PIXEL_LIGHTING
|
#if !PER_PIXEL_LIGHTING
|
||||||
varying vec4 lighting;
|
centroid varying vec4 lighting;
|
||||||
#else
|
#else
|
||||||
varying vec4 passColor;
|
centroid varying vec4 passColor;
|
||||||
#endif
|
#endif
|
||||||
varying vec3 passViewPos;
|
varying vec3 passViewPos;
|
||||||
varying vec3 passNormal;
|
varying vec3 passNormal;
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
set (MYGUI_RESOURCE_PLUGIN_SOURCES
|
|
||||||
plugin.hpp
|
|
||||||
plugin.cpp
|
|
||||||
plugin_export.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
set (MYGUI_RESOURCE_PLUGIN_LIBRARY
|
|
||||||
Plugin_MyGUI_OpenMW_Resources
|
|
||||||
)
|
|
||||||
|
|
||||||
add_definitions("-D_USRDLL -DMYGUI_BUILD_DLL")
|
|
||||||
|
|
||||||
add_library(${MYGUI_RESOURCE_PLUGIN_LIBRARY}
|
|
||||||
SHARED
|
|
||||||
${MYGUI_RESOURCE_PLUGIN_SOURCES}
|
|
||||||
)
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
if(MSVC)
|
|
||||||
# from top-level CMakelists.txt:
|
|
||||||
# 4305 - Truncating value (double to float, for example)
|
|
||||||
set_target_properties(${MYGUI_RESOURCE_PLUGIN_LIBRARY} PROPERTIES COMPILE_FLAGS "/wd4305")
|
|
||||||
endif(MSVC)
|
|
||||||
endif(WIN32)
|
|
||||||
|
|
||||||
set_target_properties(${MYGUI_RESOURCE_PLUGIN_LIBRARY} PROPERTIES PREFIX "")
|
|
||||||
|
|
||||||
target_link_libraries(${MYGUI_RESOURCE_PLUGIN_LIBRARY}
|
|
||||||
${OGRE_LIBRARIES}
|
|
||||||
components
|
|
||||||
)
|
|
|
@ -1,183 +0,0 @@
|
||||||
#include "plugin.hpp"
|
|
||||||
|
|
||||||
#include <MyGUI_LogManager.h>
|
|
||||||
#include <MyGUI_FactoryManager.h>
|
|
||||||
#include <MyGUI_ScrollBar.h>
|
|
||||||
#include <MyGUI_Gui.h>
|
|
||||||
#include <MyGUI_Window.h>
|
|
||||||
#include <MyGUI_LanguageManager.h>
|
|
||||||
|
|
||||||
#include <components/bsa/resources.hpp>
|
|
||||||
#include <components/files/configurationmanager.hpp>
|
|
||||||
#include <components/fontloader/fontloader.hpp>
|
|
||||||
|
|
||||||
#include <components/widgets/tags.hpp>
|
|
||||||
#include <components/widgets/widgets.hpp>
|
|
||||||
|
|
||||||
#include <OgreTextureManager.h>
|
|
||||||
#include <OgreHardwarePixelBuffer.h>
|
|
||||||
|
|
||||||
//FIXME: code duplication
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
struct FallbackMap {
|
|
||||||
std::map<std::string,std::string> mMap;
|
|
||||||
};
|
|
||||||
|
|
||||||
void validate(boost::any &v, std::vector<std::string> const &tokens, FallbackMap*, int)
|
|
||||||
{
|
|
||||||
if(v.empty())
|
|
||||||
{
|
|
||||||
v = boost::any(FallbackMap());
|
|
||||||
}
|
|
||||||
|
|
||||||
FallbackMap *map = boost::any_cast<FallbackMap>(&v);
|
|
||||||
|
|
||||||
for(std::vector<std::string>::const_iterator it=tokens.begin(); it != tokens.end(); ++it)
|
|
||||||
{
|
|
||||||
int sep = it->find(",");
|
|
||||||
if(sep < 1 || sep == (int)it->length()-1)
|
|
||||||
#if (BOOST_VERSION < 104200)
|
|
||||||
throw boost::program_options::validation_error("invalid value");
|
|
||||||
#else
|
|
||||||
throw boost::program_options::validation_error(boost::program_options::validation_error::invalid_option_value);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
std::string key(it->substr(0,sep));
|
|
||||||
std::string value(it->substr(sep+1));
|
|
||||||
|
|
||||||
if(map->mMap.find(key) == map->mMap.end())
|
|
||||||
{
|
|
||||||
map->mMap.insert(std::make_pair (key,value));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace MyGUIPlugin
|
|
||||||
{
|
|
||||||
|
|
||||||
// Dummy - obsolete when using MyGUI git, because the ScrollBar there has autorepeat support added.
|
|
||||||
class MWScrollBar : public MyGUI::ScrollBar
|
|
||||||
{
|
|
||||||
MYGUI_RTTI_DERIVED(MWScrollBar)
|
|
||||||
};
|
|
||||||
|
|
||||||
const std::string& ResourcePlugin::getName() const
|
|
||||||
{
|
|
||||||
static const std::string name = "OpenMW resource plugin";
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ResourcePlugin::install()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
void ResourcePlugin::uninstall()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void ResourcePlugin::registerResources()
|
|
||||||
{
|
|
||||||
boost::program_options::variables_map variables;
|
|
||||||
|
|
||||||
boost::program_options::options_description desc("Allowed options");
|
|
||||||
desc.add_options()
|
|
||||||
("data", boost::program_options::value<Files::PathContainer>()->default_value(Files::PathContainer(), "data")->multitoken()->composing())
|
|
||||||
("data-local", boost::program_options::value<std::string>()->default_value(""))
|
|
||||||
("fs-strict", boost::program_options::value<bool>()->implicit_value(true)->default_value(false))
|
|
||||||
("fallback-archive", boost::program_options::value<std::vector<std::string> >()->
|
|
||||||
default_value(std::vector<std::string>(), "fallback-archive")->multitoken())
|
|
||||||
("encoding", boost::program_options::value<std::string>()->default_value("win1252"))
|
|
||||||
("fallback", boost::program_options::value<boost::FallbackMap>()->default_value(boost::FallbackMap(), "")
|
|
||||||
->multitoken()->composing(), "fallback values");
|
|
||||||
|
|
||||||
boost::program_options::notify(variables);
|
|
||||||
|
|
||||||
Files::ConfigurationManager cfgManager;
|
|
||||||
cfgManager.readConfiguration(variables, desc);
|
|
||||||
|
|
||||||
std::vector<std::string> archives = variables["fallback-archive"].as<std::vector<std::string> >();
|
|
||||||
bool fsStrict = variables["fs-strict"].as<bool>();
|
|
||||||
|
|
||||||
Files::PathContainer dataDirs, dataLocal;
|
|
||||||
if (!variables["data"].empty()) {
|
|
||||||
dataDirs = Files::PathContainer(variables["data"].as<Files::PathContainer>());
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string local = variables["data-local"].as<std::string>();
|
|
||||||
if (!local.empty()) {
|
|
||||||
dataLocal.push_back(Files::PathContainer::value_type(local));
|
|
||||||
}
|
|
||||||
|
|
||||||
cfgManager.processPaths (dataDirs);
|
|
||||||
cfgManager.processPaths (dataLocal, true);
|
|
||||||
|
|
||||||
if (!dataLocal.empty())
|
|
||||||
dataDirs.insert (dataDirs.end(), dataLocal.begin(), dataLocal.end());
|
|
||||||
|
|
||||||
Files::Collections collections (dataDirs, !fsStrict);
|
|
||||||
|
|
||||||
Bsa::registerResources(collections, archives, true, fsStrict);
|
|
||||||
|
|
||||||
std::string encoding(variables["encoding"].as<std::string>());
|
|
||||||
std::cout << ToUTF8::encodingUsingMessage(encoding) << std::endl;
|
|
||||||
|
|
||||||
Gui::FontLoader loader(ToUTF8::calculateEncoding(encoding));
|
|
||||||
loader.loadAllFonts(false);
|
|
||||||
|
|
||||||
mFallbackMap = variables["fallback"].as<boost::FallbackMap>().mMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ResourcePlugin::registerWidgets()
|
|
||||||
{
|
|
||||||
MyGUI::FactoryManager::getInstance().registerFactory<MWScrollBar>("Widget");
|
|
||||||
|
|
||||||
Gui::registerAllWidgets();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ResourcePlugin::createTransparentBGTexture()
|
|
||||||
{
|
|
||||||
// This texture is manually created in OpenMW to be able to change its opacity at runtime in the options menu
|
|
||||||
Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton().createManual(
|
|
||||||
"transparent.png",
|
|
||||||
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
|
|
||||||
Ogre::TEX_TYPE_2D,
|
|
||||||
1, 1,
|
|
||||||
0,
|
|
||||||
Ogre::PF_A8R8G8B8,
|
|
||||||
Ogre::TU_WRITE_ONLY);
|
|
||||||
std::vector<Ogre::uint32> buffer;
|
|
||||||
buffer.resize(1);
|
|
||||||
const float val = 0.7;
|
|
||||||
buffer[0] = (int(255*val) << 24) | (255 << 16) | (255 << 8) | 255;
|
|
||||||
memcpy(tex->getBuffer()->lock(Ogre::HardwareBuffer::HBL_DISCARD), &buffer[0], 1*4);
|
|
||||||
tex->getBuffer()->unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ResourcePlugin::initialize()
|
|
||||||
{
|
|
||||||
MYGUI_LOGGING("OpenMW_Resource_Plugin", Info, "initialize");
|
|
||||||
|
|
||||||
registerResources();
|
|
||||||
registerWidgets();
|
|
||||||
createTransparentBGTexture();
|
|
||||||
|
|
||||||
MyGUI::LanguageManager::getInstance().eventRequestTag = MyGUI::newDelegate(this, &ResourcePlugin::onRetrieveTag);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ResourcePlugin::shutdown()
|
|
||||||
{
|
|
||||||
/// \todo cleanup
|
|
||||||
|
|
||||||
MYGUI_LOGGING("OpenMW_Resource_Plugin", Info, "shutdown");
|
|
||||||
}
|
|
||||||
|
|
||||||
void ResourcePlugin::onRetrieveTag(const MyGUI::UString& tag, MyGUI::UString& out)
|
|
||||||
{
|
|
||||||
if (!Gui::replaceTag(tag, out, mFallbackMap))
|
|
||||||
out = tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,52 +0,0 @@
|
||||||
#ifndef OPENMW_MYGUI_RESOURCE_PLUGIN_H
|
|
||||||
#define OPENMW_MYGUI_RESOURCE_PLUGIN_H
|
|
||||||
|
|
||||||
#include <MyGUI_Plugin.h>
|
|
||||||
#include <MyGUI_UString.h>
|
|
||||||
|
|
||||||
namespace MyGUIPlugin
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief MyGUI plugin used to register Morrowind resources, custom widgets used in OpenMW, and load Morrowind fonts.
|
|
||||||
* @paragraph The plugin isn't used in OpenMW itself, but it is useful with the standalone MyGUI tools. To use it,
|
|
||||||
* change EditorPlugin.xml in Media/Tools/LayoutEditor/EditorPlugin.xml and add an entry for this plugin.
|
|
||||||
*/
|
|
||||||
class ResourcePlugin : public MyGUI::IPlugin
|
|
||||||
{
|
|
||||||
/*! Get the name of the plugin.
|
|
||||||
@remarks An implementation must be supplied for this method to uniquely
|
|
||||||
identify the plugin
|
|
||||||
*/
|
|
||||||
virtual const std::string& getName() const;
|
|
||||||
|
|
||||||
/*! Perform the plugin initial installation sequence
|
|
||||||
*/
|
|
||||||
virtual void install();
|
|
||||||
|
|
||||||
/*! Perform any tasks the plugin needs to perform on full system
|
|
||||||
initialisation.
|
|
||||||
*/
|
|
||||||
virtual void initialize();
|
|
||||||
|
|
||||||
/*! Perform any tasks the plugin needs to perform when the system is shut down
|
|
||||||
*/
|
|
||||||
virtual void shutdown();
|
|
||||||
|
|
||||||
/*! Perform the final plugin uninstallation sequence
|
|
||||||
*/
|
|
||||||
virtual void uninstall();
|
|
||||||
|
|
||||||
private:
|
|
||||||
void registerResources();
|
|
||||||
void registerWidgets();
|
|
||||||
void createTransparentBGTexture();
|
|
||||||
|
|
||||||
void onRetrieveTag(const MyGUI::UString& tag, MyGUI::UString& out);
|
|
||||||
|
|
||||||
std::map<std::string, std::string> mFallbackMap;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,17 +0,0 @@
|
||||||
#include "plugin.hpp"
|
|
||||||
#include "MyGUI_PluginManager.h"
|
|
||||||
|
|
||||||
MyGUIPlugin::ResourcePlugin* plugin_item = nullptr;
|
|
||||||
|
|
||||||
extern "C" MYGUI_EXPORT_DLL void dllStartPlugin(void)
|
|
||||||
{
|
|
||||||
plugin_item = new MyGUIPlugin::ResourcePlugin();
|
|
||||||
MyGUI::PluginManager::getInstance().installPlugin(plugin_item);
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" MYGUI_EXPORT_DLL void dllStopPlugin(void)
|
|
||||||
{
|
|
||||||
MyGUI::PluginManager::getInstance().uninstallPlugin(plugin_item);
|
|
||||||
delete plugin_item;
|
|
||||||
plugin_item = nullptr;
|
|
||||||
}
|
|
Loading…
Reference in a new issue