From 699588a1b477a3085eed86f0bc10c846d8e93593 Mon Sep 17 00:00:00 2001 From: alve Date: Sun, 20 Aug 2006 18:06:55 +0000 Subject: [PATCH] introduced switch for emulated exits git-svn-id: svn://svn.code.sf.net/p/mmapper/code/trunk/mmapper@88 14c008a5-6e10-0410-bf79-c100e0f1932b --- src/configuration/configuration.cpp | 2 ++ src/configuration/configuration.h | 1 + src/parser/abstractparser.cpp | 4 +++- src/parser/mumexmlparser.cpp | 3 ++- src/parser/parser.cpp | 3 ++- src/preferences/generalpage.cpp | 10 +++++++++ src/preferences/generalpage.h | 1 + src/preferences/generalpage.ui | 35 +++++++++++++++++------------ 8 files changed, 42 insertions(+), 17 deletions(-) diff --git a/src/configuration/configuration.cpp b/src/configuration/configuration.cpp index f36c347d5..07779a1de 100644 --- a/src/configuration/configuration.cpp +++ b/src/configuration/configuration.cpp @@ -89,6 +89,7 @@ void Configuration::read() conf.beginGroup("Mume native"); m_brief = conf.value("Brief mode", FALSE).toBool(); + m_emulatedExits = conf.value("Emulated Exits", TRUE).toBool(); conf.endGroup(); if (m_moveForcePatternsList.isEmpty()) @@ -226,6 +227,7 @@ void Configuration::write() const { conf.beginGroup("Mume native"); conf.setValue("Brief mode", m_brief); + conf.setValue("Emulated Exits", m_emulatedExits); conf.endGroup(); conf.beginGroup("Path Machine"); diff --git a/src/configuration/configuration.h b/src/configuration/configuration.h index b8bab9ab8..b51281588 100644 --- a/src/configuration/configuration.h +++ b/src/configuration/configuration.h @@ -52,6 +52,7 @@ class Configuration { QString m_roomNameColor; // ANSI room name color QString m_roomDescColor; // ANSI room descriptions color bool m_brief; + bool m_emulatedExits; bool m_showUpdated; bool m_drawNotMappedExits; bool m_drawUpperLayersTextured; diff --git a/src/parser/abstractparser.cpp b/src/parser/abstractparser.cpp index 841808863..7895f55a8 100644 --- a/src/parser/abstractparser.cpp +++ b/src/parser/abstractparser.cpp @@ -742,7 +742,8 @@ void AbstractParser::sendRoomExitsInfoToUser(const Room* r) QByteArray cn = " -"; bool noDoors = true; - QString etmp = "Exits/emulated:"; + + QString etmp = "Exits/emulated:"; int j; for (int jj = 0; jj < 7; jj++) { switch (jj) @@ -835,6 +836,7 @@ void AbstractParser::sendRoomExitsInfoToUser(const Room* r) } emit sendToUser(etmp.toAscii()+cn); + } void AbstractParser::sendPromptSimulationToUser() diff --git a/src/parser/mumexmlparser.cpp b/src/parser/mumexmlparser.cpp index c8b40fe90..033c50c92 100644 --- a/src/parser/mumexmlparser.cpp +++ b/src/parser/mumexmlparser.cpp @@ -355,7 +355,8 @@ bool MumeXmlParser::characters(QByteArray& ch) { m_readingRoomDesc = false; // we finished read desc mode m_descriptionReady = true; - emulateExits(); + if (Config().m_emulatedExits) + emulateExits(); } } else diff --git a/src/parser/parser.cpp b/src/parser/parser.cpp index 10503a5bb..5d568aa2b 100644 --- a/src/parser/parser.cpp +++ b/src/parser/parser.cpp @@ -161,7 +161,8 @@ void Parser::parseNewMudInput(IncomingData& data /*TelnetIncomingDataQueue& que* { m_readingRoomDesc = false; // we finished read desc mode m_descriptionReady = true; - emulateExits(); + if (Config().m_emulatedExits) + emulateExits(); } else // reading room description line { diff --git a/src/preferences/generalpage.cpp b/src/preferences/generalpage.cpp index 0d2d8790b..4255fad05 100644 --- a/src/preferences/generalpage.cpp +++ b/src/preferences/generalpage.cpp @@ -45,6 +45,7 @@ GeneralPage::GeneralPage(QWidget *parent) connect ( matchingToleranceSpinBox, SIGNAL(valueChanged(int)), this, SLOT(matchingToleranceSpinBoxValueChanged(int)) ); connect ( brief, SIGNAL(stateChanged(int)),SLOT(briefStateChanged(int))); + connect ( emulatedExits, SIGNAL(stateChanged(int)),SLOT(emulatedExitsStateChanged(int))); connect ( updated, SIGNAL(stateChanged(int)),SLOT(updatedStateChanged(int))); connect ( drawNotMappedExits, SIGNAL(stateChanged(int)),SLOT(drawNotMappedExitsStateChanged(int))); connect ( drawUpperLayersTextured, SIGNAL(stateChanged(int)),SLOT(drawUpperLayersTexturedStateChanged(int))); @@ -70,6 +71,7 @@ GeneralPage::GeneralPage(QWidget *parent) multipleConnectionsPenaltyDoubleSpinBox->setValue(Config().m_multipleConnectionsPenalty); brief->setChecked( Config().m_brief ); + emulatedExits->setChecked( Config().m_emulatedExits ); updated->setChecked( Config().m_showUpdated ); drawNotMappedExits->setChecked( Config().m_drawNotMappedExits ); drawUpperLayersTextured->setChecked( Config().m_drawUpperLayersTextured ); @@ -162,11 +164,19 @@ void GeneralPage::briefStateChanged(int) Config().m_brief = brief->isChecked(); } +void GeneralPage::emulatedExitsStateChanged(int) +{ + Config().m_emulatedExits = emulatedExits->isChecked(); +} + + void GeneralPage::updatedStateChanged(int) { Config().m_showUpdated = updated->isChecked(); } + + void GeneralPage::drawNotMappedExitsStateChanged(int) { Config().m_drawNotMappedExits = drawNotMappedExits->isChecked(); diff --git a/src/preferences/generalpage.h b/src/preferences/generalpage.h index 883b118a9..817e14ed8 100644 --- a/src/preferences/generalpage.h +++ b/src/preferences/generalpage.h @@ -48,6 +48,7 @@ public slots: void matchingToleranceSpinBoxValueChanged(int); void briefStateChanged(int); + void emulatedExitsStateChanged(int); void updatedStateChanged(int); void drawNotMappedExitsStateChanged(int); void drawUpperLayersTexturedStateChanged(int); diff --git a/src/preferences/generalpage.ui b/src/preferences/generalpage.ui index 8efbaa739..4072c5338 100644 --- a/src/preferences/generalpage.ui +++ b/src/preferences/generalpage.ui @@ -8,8 +8,8 @@ 0 0 - 400 - 441 + 487 + 522 @@ -284,20 +284,17 @@ 6 - - + + - Brief mode + Show emulated exits - - + + - Draw not mapped exits - - - true + Draw upper layers textured @@ -308,10 +305,20 @@ - - + + - Draw upper layers textured + Draw not mapped exits + + + true + + + + + + + Brief mode