Skip to content

Commit

Permalink
introduced switch for emulated exits
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.code.sf.net/p/mmapper/code/trunk/mmapper@88 14c008a5-6e10-0410-bf79-c100e0f1932b
  • Loading branch information
alve committed Aug 20, 2006
1 parent f7e5e14 commit 699588a
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 17 deletions.
2 changes: 2 additions & 0 deletions src/configuration/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions src/configuration/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion src/parser/abstractparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -835,6 +836,7 @@ void AbstractParser::sendRoomExitsInfoToUser(const Room* r)
}

emit sendToUser(etmp.toAscii()+cn);

}

void AbstractParser::sendPromptSimulationToUser()
Expand Down
3 changes: 2 additions & 1 deletion src/parser/mumexmlparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/parser/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
10 changes: 10 additions & 0 deletions src/preferences/generalpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand All @@ -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 );
Expand Down Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions src/preferences/generalpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public slots:
void matchingToleranceSpinBoxValueChanged(int);

void briefStateChanged(int);
void emulatedExitsStateChanged(int);
void updatedStateChanged(int);
void drawNotMappedExitsStateChanged(int);
void drawUpperLayersTexturedStateChanged(int);
Expand Down
35 changes: 21 additions & 14 deletions src/preferences/generalpage.ui
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>441</height>
<width>487</width>
<height>522</height>
</rect>
</property>
<property name="sizePolicy" >
Expand Down Expand Up @@ -284,20 +284,17 @@
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="1" >
<widget class="QCheckBox" name="brief" >
<item row="2" column="1" >
<widget class="QCheckBox" name="emulatedExits" >
<property name="text" >
<string>Brief mode</string>
<string>Show emulated exits</string>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QCheckBox" name="drawNotMappedExits" >
<item row="1" column="1" >
<widget class="QCheckBox" name="drawUpperLayersTextured" >
<property name="text" >
<string>Draw not mapped exits</string>
</property>
<property name="checked" >
<bool>true</bool>
<string>Draw upper layers textured</string>
</property>
</widget>
</item>
Expand All @@ -308,10 +305,20 @@
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QCheckBox" name="drawUpperLayersTextured" >
<item row="0" column="0" >
<widget class="QCheckBox" name="drawNotMappedExits" >
<property name="text" >
<string>Draw upper layers textured</string>
<string>Draw not mapped exits</string>
</property>
<property name="checked" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QCheckBox" name="brief" >
<property name="text" >
<string>Brief mode</string>
</property>
</widget>
</item>
Expand Down

0 comments on commit 699588a

Please sign in to comment.