Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/mpconley/Mudlet into…
Browse files Browse the repository at this point in the history
… development
  • Loading branch information
mpconley committed Dec 2, 2019
2 parents b24ae1e + 70d9676 commit 8804114
Show file tree
Hide file tree
Showing 21 changed files with 1,219 additions and 598 deletions.
Binary file removed 3rdparty/discord/rpc/lib/discord-rpc.dll
Binary file not shown.
Binary file added 3rdparty/discord/rpc/lib/discord-rpc32.dll
Binary file not shown.
Binary file added 3rdparty/discord/rpc/lib/discord-rpc64.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion CI/copy-non-qt-win-dependencies.ps1
Expand Up @@ -11,4 +11,4 @@ COPY ..\*.dic .
COPY ..\*.aff .
XCOPY /S /I /Q /Y $Env:MINGW_BASE_DIR\lib\lua\5.1 .
XCOPY /S /I /Q /Y ..\..\3rdparty\lcf lcf
COPY ..\..\3rdparty\discord\rpc\lib\discord-rpc.dll discord-rpc.dll
COPY ..\..\3rdparty\discord\rpc\lib\discord-rpc32.dll discord-rpc32.dll
33 changes: 33 additions & 0 deletions src/Host.cpp
Expand Up @@ -331,6 +331,11 @@ Host::Host(int port, const QString& hostname, const QString& login, const QStrin
// DISABLED: - Prevent "None" option for user dictionary - changed to true and not changed anywhere else
, mEnableUserDictionary(true)
, mUseSharedDictionary(false)
, mPlayerRoomStyle(0)
, mPlayerRoomOuterColor(Qt::red)
, mPlayerRoomInnerColor(Qt::white)
, mPlayerRoomOuterDiameterPercentage(120)
, mPlayerRoomInnerDiameterPercentage(70)
{
// mLogStatus = mudlet::self()->mAutolog;
mLuaInterface.reset(new LuaInterface(this));
Expand Down Expand Up @@ -2398,3 +2403,31 @@ void Host::updateAnsi16ColorsInTable()
{
mLuaInterpreter.updateAnsi16ColorsInTable();
}

void Host::setPlayerRoomStyleDetails(const quint8 styleCode, const quint8 outerDiameter, const quint8 innerDiameter, const QColor& outerColor, const QColor& innerColor)
{
QMutexLocker locker(& mLock);
// Now we have the exclusive lock on this class's protected members

mPlayerRoomStyle = styleCode;
mPlayerRoomOuterDiameterPercentage = outerDiameter;
mPlayerRoomInnerDiameterPercentage = innerDiameter;
mPlayerRoomOuterColor = outerColor;
mPlayerRoomInnerColor = innerColor;
// We have made the change to the protected aspects of this class so can unlock the mutex locker and proceed:
locker.unlock();
}

void Host::getPlayerRoomStyleDetails(quint8& styleCode, quint8& outerDiameter, quint8& innerDiameter, QColor& primaryColor, QColor& secondaryColor)
{
QMutexLocker locker(& mLock);
// Now we have the exclusive lock on this class's protected members

styleCode = mPlayerRoomStyle;
outerDiameter = mPlayerRoomOuterDiameterPercentage;
innerDiameter = mPlayerRoomInnerDiameterPercentage;
primaryColor = mPlayerRoomOuterColor;
secondaryColor = mPlayerRoomInnerColor;
// We have accessed the protected aspects of this class so can unlock the mutex locker and proceed:
locker.unlock();
}
25 changes: 25 additions & 0 deletions src/Host.h
Expand Up @@ -321,6 +321,9 @@ class Host : public QObject
void updateProxySettings(QNetworkAccessManager* manager);
std::unique_ptr<QNetworkProxy>& getConnectionProxy();
void updateAnsi16ColorsInTable();
// Store/retrieve all the settings in one call:
void setPlayerRoomStyleDetails(const quint8 styleCode, const quint8 outerDiameter = 120, const quint8 innerDiameter = 70, const QColor& outerColor = QColor(), const QColor& innerColor = QColor());
void getPlayerRoomStyleDetails(quint8& styleCode, quint8& outerDiameter, quint8& innerDiameter, QColor& outerColor, QColor& innerColor);

cTelnet mTelnet;
QPointer<TConsole> mpConsole;
Expand Down Expand Up @@ -656,6 +659,28 @@ private slots:
// looked up directly by that class:
bool mEnableUserDictionary;
bool mUseSharedDictionary;

// These hold values that are needed in the TMap clas which are saved with
// the profile - but which cannot be kept there as that class is not
// necessarily instantiated when the profile is read.
// Base color(s) for the player room in the mappers:
// Mode selected:
// 0 is closest to original style with adjustable outer diameter
// 1 is Fixed red color ring with adjustable outer/inner diameter
// 2 is fixed blue/yellow colors ring with adjustable outer/inner diameter
// 3 is adjustable outer(primary)/inner(secondary) colors ring with adjustable outer/inner diameter
quint8 mPlayerRoomStyle;
QColor mPlayerRoomOuterColor;
QColor mPlayerRoomInnerColor;
// Percentage of the room size (actually width) for the outer diameter of
// the circular marking, integer percentage clamped in the preferences
// between 200 and 50 - default 120:
quint8 mPlayerRoomOuterDiameterPercentage;
// Percentage of the outer size for the inner diameter of the circular
// marking, integer percentage clamped in the preferences between 83 and 0,
// with a default of 70. NOT USED FOR "Original" style marking (the 0'th
// one):
quint8 mPlayerRoomInnerDiameterPercentage;
};

Q_DECLARE_OPERATORS_FOR_FLAGS(Host::DiscordOptionFlags)
Expand Down

0 comments on commit 8804114

Please sign in to comment.