summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHal9OOO <miglietta.francesco@gmail.com>2012-12-04 23:04:47 +0100
committerHal9OOO <miglietta.francesco@gmail.com>2012-12-04 23:04:47 +0100
commitee7c35db55d587136970712158481cd3d94d3db5 (patch)
treeb51d6ec189ea4a1a9aa592e70afd67943ad3aa97
parentc91fb6d5826a39ab0f560737936ca16b019946c2 (diff)
parent29890cc253fc9230ec815433f1f5a923998c9439 (diff)
downloadplus-ee7c35db55d587136970712158481cd3d94d3db5.tar.gz
plus-ee7c35db55d587136970712158481cd3d94d3db5.tar.bz2
plus-ee7c35db55d587136970712158481cd3d94d3db5.tar.xz
plus-ee7c35db55d587136970712158481cd3d94d3db5.zip
Merge branch 'master' of gitorious.org:manaplus/manaplus
-rw-r--r--.gitignore2
-rw-r--r--Xcode/ManaPlus.xcodeproj/project.pbxproj10
-rw-r--r--src/client.cpp5
-rw-r--r--src/gui/chatwindow.cpp17
-rw-r--r--src/net/ea/beinghandler.cpp2
5 files changed, 26 insertions, 10 deletions
diff --git a/.gitignore b/.gitignore
index 8b3ff6d3f..3a69feef2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -147,3 +147,5 @@ gmon.out
.DS_Store
Xcode/ManaPlus.xcodeproj/xcuserdata
Xcode/ManaPlus.xcodeproj/project.xcworkspace/xcuserdata
+Xcode/Release
+Xcode/locale
diff --git a/Xcode/ManaPlus.xcodeproj/project.pbxproj b/Xcode/ManaPlus.xcodeproj/project.pbxproj
index 47ee2f1aa..39e2804dd 100644
--- a/Xcode/ManaPlus.xcodeproj/project.pbxproj
+++ b/Xcode/ManaPlus.xcodeproj/project.pbxproj
@@ -7,6 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
+ 2B4EBD02166DE12200BDD105 /* locale in Resources */ = {isa = PBXBuildFile; fileRef = 2B4EBD01166DE12200BDD105 /* locale */; };
2BAC2B44166DB4B300874178 /* manaplus.icns in Resources */ = {isa = PBXBuildFile; fileRef = 2BAC2B43166DB4B300874178 /* manaplus.icns */; };
2BAC2B4E166DCFB900874178 /* libXdmcp.6.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2BAC2B46166DCFB900874178 /* libXdmcp.6.dylib */; };
2BAC2B4F166DCFB900874178 /* libXau.6.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2BAC2B47166DCFB900874178 /* libXau.6.dylib */; };
@@ -746,7 +747,6 @@
2BDF4D53166D5D9E0054E77F /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BDF4D4E166D5D9E0054E77F /* SDL.framework */; };
2BDF4D55166D5DCD0054E77F /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BDF4D54166D5DCD0054E77F /* OpenGL.framework */; };
2BDF4D57166D5E040054E77F /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BDF4D56166D5E040054E77F /* libcurl.dylib */; };
- 2BDF4D6F166D6ADC0054E77F /* Mana.icns in Resources */ = {isa = PBXBuildFile; fileRef = 2BDF4D6E166D6ADC0054E77F /* Mana.icns */; };
2BDF4D76166D783A0054E77F /* data in Resources */ = {isa = PBXBuildFile; fileRef = 2BDF4D75166D781C0054E77F /* data */; };
2BDF4D81166D7F060054E77F /* SDL_image.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2BDF4D4A166D5D9E0054E77F /* SDL_image.framework */; };
2BDF4D82166D7F090054E77F /* SDL_mixer.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2BDF4D4B166D5D9E0054E77F /* SDL_mixer.framework */; };
@@ -826,6 +826,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
+ 2B4EBD01166DE12200BDD105 /* locale */ = {isa = PBXFileReference; lastKnownFileType = folder; path = locale; sourceTree = SOURCE_ROOT; };
2BAC2B43166DB4B300874178 /* manaplus.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = manaplus.icns; sourceTree = "<group>"; };
2BAC2B46166DCFB900874178 /* libXdmcp.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libXdmcp.6.dylib; path = libs/libXdmcp.6.dylib; sourceTree = "<group>"; };
2BAC2B47166DCFB900874178 /* libXau.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libXau.6.dylib; path = libs/libXau.6.dylib; sourceTree = "<group>"; };
@@ -1640,7 +1641,6 @@
2BDF4D4E166D5D9E0054E77F /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = "<absolute>"; };
2BDF4D54166D5DCD0054E77F /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
2BDF4D56166D5E040054E77F /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.dylib; path = usr/lib/libcurl.dylib; sourceTree = SDKROOT; };
- 2BDF4D6E166D6ADC0054E77F /* Mana.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Mana.icns; sourceTree = "<group>"; };
2BDF4D75166D781C0054E77F /* data */ = {isa = PBXFileReference; lastKnownFileType = folder; name = data; path = ../../data; sourceTree = "<group>"; };
2BDF4D8F166D8E0C0054E77F /* libfreetype.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libfreetype.6.dylib; path = libs/libfreetype.6.dylib; sourceTree = "<group>"; };
2BDF4D90166D8E0C0054E77F /* libiconv.2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libiconv.2.dylib; path = libs/libiconv.2.dylib; sourceTree = "<group>"; };
@@ -1709,7 +1709,6 @@
isa = PBXGroup;
children = (
2BAC2B43166DB4B300874178 /* manaplus.icns */,
- 2BDF4D6E166D6ADC0054E77F /* Mana.icns */,
2BDF45C9166D5AEC0054E77F /* ManaPlus */,
2BDF45E6166D5AEC0054E77F /* ManaPlusTests */,
2BDF45C2166D5AEC0054E77F /* Frameworks */,
@@ -1805,6 +1804,7 @@
2BDF4778166D5B680054E77F /* configlistener.h */,
2BDF4779166D5B680054E77F /* configuration.cpp */,
2BDF477A166D5B680054E77F /* configuration.h */,
+ 2B4EBD01166DE12200BDD105 /* locale */,
2BDF4D75166D781C0054E77F /* data */,
2BDF477B166D5B680054E77F /* debug */,
2BDF4780166D5B680054E77F /* debug.h */,
@@ -2834,9 +2834,9 @@
2BDF45CE166D5AEC0054E77F /* InfoPlist.strings in Resources */,
2BDF45D4166D5AEC0054E77F /* Credits.rtf in Resources */,
2BDF45DA166D5AEC0054E77F /* MainMenu.xib in Resources */,
- 2BDF4D6F166D6ADC0054E77F /* Mana.icns in Resources */,
2BDF4D76166D783A0054E77F /* data in Resources */,
2BAC2B44166DB4B300874178 /* manaplus.icns in Resources */,
+ 2B4EBD02166DE12200BDD105 /* locale in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -3737,6 +3737,7 @@
OTHER_CPLUSPLUSFLAGS = (
"-DUSE_INTERNALGUICHAN",
"-DUSE_OPENGL",
+ "-DENABLE_NLS",
);
PRODUCT_NAME = "$(TARGET_NAME)";
SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES;
@@ -3777,6 +3778,7 @@
OTHER_CPLUSPLUSFLAGS = (
"-DUSE_INTERNALGUICHAN",
"-DUSE_OPENGL",
+ "-DENABLE_NLS",
);
PRODUCT_NAME = "$(TARGET_NAME)";
SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES;
diff --git a/src/client.cpp b/src/client.cpp
index 1265d048f..c1fde21d2 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -348,10 +348,15 @@ void Client::gameInit()
bindTextDomain("manaplus", (std::string(PHYSFS_getBaseDir())
+ "../locale/").c_str());
#else
+#ifdef __APPLE__
+ //TODO: Use physfs instead of absolute path.
+ bindTextDomain("manaplus", "ManaPlus.app/Contents/Resources/locale/");
+#else
bindTextDomain("manaplus", LOCALEDIR);
#endif
#endif
#endif
+#endif
char *locale = setlocale(LC_MESSAGES, lang.c_str());
if (locale)
logger->log("locale: %s", locale);
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp
index 11f399537..c0258eade 100644
--- a/src/gui/chatwindow.cpp
+++ b/src/gui/chatwindow.cpp
@@ -1410,12 +1410,19 @@ void ChatWindow::resortChatLog(std::string line, Own own,
return;
}
- const size_t idx = line.find(": \302\202");
- if (idx != std::string::npos)
+ const size_t idx2 = line.find(": ");
+ if (idx2 != std::string::npos)
{
- line = line.erase(idx + 2, 2);
- tradeChatTab->chatLog(line, own, ignoreRecord, tryRemoveColors);
- return;
+ const size_t idx = line.find(": \302\202");
+ if (idx == idx2)
+ {
+ // ignore special message formats.
+ if (line.find(": \302\202\302") != std::string::npos)
+ return;
+ line = line.erase(idx + 2, 2);
+ tradeChatTab->chatLog(line, own, ignoreRecord, tryRemoveColors);
+ return;
+ }
}
const size_t idx1 = line.find("@@");
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp
index 528608d7e..bb7b7bc67 100644
--- a/src/net/ea/beinghandler.cpp
+++ b/src/net/ea/beinghandler.cpp
@@ -691,7 +691,7 @@ void BeingHandler::processBeingChangeDirection(Net::MessageIn &msg)
msg.readInt16(); // unused
- const unsigned char dir = msg.readInt8();
+ const unsigned char dir = msg.readInt8() & 0x0f;
dstBeing->setDirection(dir);
if (player_node)
player_node->imitateDirection(dstBeing, dir);