summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2013-02-20 16:59:56 +0100
committerErik Schilling <ablu.erikschilling@googlemail.com>2013-02-20 16:59:56 +0100
commit551675cb8284b03a1e43be9d11eda0bab7b70139 (patch)
treeeed1121d421176f4044e5f38190c767f6b905388 /src
parentae14594cfa804a89a36312e142498eca7f147cc9 (diff)
parentd4a407254cfffbb79087c1248650fbaed5d568d8 (diff)
downloadmana-551675cb8284b03a1e43be9d11eda0bab7b70139.tar.gz
mana-551675cb8284b03a1e43be9d11eda0bab7b70139.tar.bz2
mana-551675cb8284b03a1e43be9d11eda0bab7b70139.tar.xz
mana-551675cb8284b03a1e43be9d11eda0bab7b70139.zip
Merge branch 'master' into lpc2012
Conflicts: src/graphics.h src/gui/setup_video.cpp src/gui/specialswindow.cpp src/gui/viewport.cpp src/gui/widgets/container.cpp src/gui/widgets/container.h
Diffstat (limited to 'src')
-rw-r--r--src/client.cpp3
-rw-r--r--src/gui/setup_video.cpp18
-rw-r--r--src/gui/specialswindow.cpp37
-rw-r--r--src/gui/widgets/container.cpp1
-rw-r--r--src/main.cpp3
-rw-r--r--src/net/manaserv/guildhandler.cpp4
-rw-r--r--src/net/manaserv/playerhandler.cpp1
-rw-r--r--src/net/tmwa/chathandler.cpp5
-rw-r--r--src/playerinfo.cpp5
-rw-r--r--src/playerinfo.h5
10 files changed, 56 insertions, 26 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 8eb9b154..16c43f19 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -102,9 +102,6 @@
*/
static const int MAX_TICK_VALUE = 10000;
-static const int defaultSfxVolume = 100;
-static const int defaultMusicVolume = 60;
-
// TODO: Get rid fo these globals
std::string errorMessage;
LoginData loginData;
diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp
index 05bc6c44..5a697160 100644
--- a/src/gui/setup_video.cpp
+++ b/src/gui/setup_video.cpp
@@ -187,16 +187,24 @@ Setup_Video::Setup_Video():
mFpsSlider->addActionListener(this);
// Do the layout
- getLayout().setHAlign(LayoutCell::FILL);
+ ContainerPlacer place = getPlacer(0, 0);
+ place.getCell().setHAlign(LayoutCell::FILL);
+
place(0, 0, scrollArea, 1, 4).setPadding(2).setHAlign(LayoutCell::FILL);
place(1, 0, space, 1, 4);
place(2, 0, mFsCheckBox);
place(2, 1, mOpenGLCheckBox);
place(2, 2, mCustomCursorCheckBox);
- place(2, 3, mDisableSDLTransparencyCheckBox, 4);
- place(2, 4, mFpsCheckBox);
- place(3, 4, mFpsSlider, 2);
- place(5, 4, mFpsLabel);
+
+ place = getPlacer(0, 1);
+ place.getCell().setHAlign(LayoutCell::FILL);
+
+ place(0, 0, space, 3);
+ place(0, 1, mDisableSDLTransparencyCheckBox, 4);
+
+ place(0, 2, mFpsCheckBox);
+ place(1, 2, mFpsSlider, 2);
+ place(3, 2, mFpsLabel);
}
Setup_Video::~Setup_Video()
diff --git a/src/gui/specialswindow.cpp b/src/gui/specialswindow.cpp
index dd287791..ac1f460b 100644
--- a/src/gui/specialswindow.cpp
+++ b/src/gui/specialswindow.cpp
@@ -127,19 +127,20 @@ void SpecialsWindow::draw(gcn::Graphics *graphics)
bool foundNew = false;
unsigned int found = 0; // number of entries in specialData which match mEntries
- for (std::map<int, Special>::iterator i = specialData.begin();
- i != specialData.end();
- i++)
+ for (std::map<int, Special>::iterator it = specialData.begin();
+ it != specialData.end(); ++it)
{
- std::map<int, SpecialEntry *>::iterator e = mEntries.find(i->first);
+ std::map<int, SpecialEntry *>::iterator e = mEntries.find(it->first);
if (e == mEntries.end())
{
// found a new special - abort update and rebuild from scratch
foundNew = true;
break;
- } else {
+ }
+ else
+ {
// update progress bar of special
- e->second->update(i->second.currentMana, i->second.neededMana);
+ e->second->update(it->second.currentMana, it->second.neededMana);
found++;
}
}
@@ -152,28 +153,30 @@ void SpecialsWindow::draw(gcn::Graphics *graphics)
void SpecialsWindow::rebuild(const std::map<int, Special> &specialData)
{
- make_dtor(mEntries);
+ delete_all(mEntries);
+
mEntries.clear();
int vPos = 0; //vertical position of next placed element
- for (std::map<int, Special>::const_iterator i = specialData.begin();
- i != specialData.end();
- i++)
+ for (std::map<int, Special>::const_iterator it = specialData.begin();
+ it != specialData.end(); ++it)
{
- logger->log("Updating special GUI for %d", i->first);
+ logger->log("Updating special GUI for %d", it->first);
- SpecialInfo* info = SpecialDB::get(i->first);
+ SpecialInfo *info = SpecialDB::get(it->first);
if (info)
{
- info->rechargeCurrent = i->second.currentMana;
- info->rechargeNeeded = i->second.neededMana;
+ info->rechargeCurrent = it->second.currentMana;
+ info->rechargeNeeded = it->second.neededMana;
SpecialEntry* entry = new SpecialEntry(info);
entry->setPosition(0, vPos);
vPos += entry->getHeight() + 3;
add(entry);
- mEntries[i->first] = entry;
- } else {
- logger->log("Warning: No info available of special %d", i->first);
+ mEntries[it->first] = entry;
+ }
+ else
+ {
+ logger->log("Warning: No info available of special %d", it->first);
}
}
}
diff --git a/src/gui/widgets/container.cpp b/src/gui/widgets/container.cpp
index 61211ddd..11566a4a 100644
--- a/src/gui/widgets/container.cpp
+++ b/src/gui/widgets/container.cpp
@@ -55,6 +55,7 @@ ContainerPlacer Container::getPlacer(int x, int y)
return ContainerPlacer(this, &getLayout().at(x, y));
}
+
void Container::updateLayout()
{
const gcn::Rectangle area = getChildrenArea();
diff --git a/src/main.cpp b/src/main.cpp
index b7669f0e..e3225d63 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -150,7 +150,8 @@ static void parseOptions(int argc, char *argv[], Client::Options &options)
options.noOpenGL = true;
break;
case 'T':
- options.chatLogDir = std::string(optarg);
+ options.chatLogDir = optarg;
+ break;
case 'i':
options.screenshotDir = optarg;
break;
diff --git a/src/net/manaserv/guildhandler.cpp b/src/net/manaserv/guildhandler.cpp
index cd22fcec..19fa03ca 100644
--- a/src/net/manaserv/guildhandler.cpp
+++ b/src/net/manaserv/guildhandler.cpp
@@ -105,6 +105,10 @@ void GuildHandler::handleMessage(MessageIn &msg)
{
SERVER_NOTICE(_("Invited player can't join another guild."));
}
+ else // any other failure
+ {
+ SERVER_NOTICE(_("Invite failed."));
+ }
} break;
case CPMSG_GUILD_ACCEPT_RESPONSE:
diff --git a/src/net/manaserv/playerhandler.cpp b/src/net/manaserv/playerhandler.cpp
index c2c491d5..484e551a 100644
--- a/src/net/manaserv/playerhandler.cpp
+++ b/src/net/manaserv/playerhandler.cpp
@@ -248,6 +248,7 @@ void PlayerHandler::handleMessage(MessageIn &msg)
case GPMSG_SPECIAL_STATUS :
{
+ PlayerInfo::clearSpecialStatus();
while (msg.getUnreadLength())
{
// { B specialID, L current, L max, L recharge }
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp
index 9e5e7b19..155263b5 100644
--- a/src/net/tmwa/chathandler.cpp
+++ b/src/net/tmwa/chathandler.cpp
@@ -181,6 +181,11 @@ void ChatHandler::handleMessage(MessageIn &msg)
| PlayerRelation::SPEECH_FLOAT);
}
+ // This is a sure sign of some special command of manaplus,
+ // none of those are supported at the moment.
+ if (chatMsg.compare(0, 2, "\302\202") == 0)
+ return;
+
trim(chatMsg);
std::string reducedMessage = chatMsg;
diff --git a/src/playerinfo.cpp b/src/playerinfo.cpp
index 692090af..03c48340 100644
--- a/src/playerinfo.cpp
+++ b/src/playerinfo.cpp
@@ -282,6 +282,11 @@ void setBuySellState(BuySellState buySellState)
// --- Specials ---------------------------------------------------------------
+void clearSpecialStatus()
+{
+ mSpecials.clear();
+}
+
void setSpecialStatus(int id, int current, int max, int recharge)
{
logger->log("SpecialUpdate Skill #%d -- (%d/%d) -> %d", id, current, max,
diff --git a/src/playerinfo.h b/src/playerinfo.h
index d7483cc1..e228ec7e 100644
--- a/src/playerinfo.h
+++ b/src/playerinfo.h
@@ -225,6 +225,11 @@ namespace PlayerInfo
// --- Specials ---------------------------------------------------------------
/**
+ * Removes all specials.
+ */
+ void clearSpecialStatus();
+
+ /**
* Changes the status of the given special.
*/
void setSpecialStatus(int id, int current, int max, int recharge);