From b66f18ea01fc1935795392f4aaef188fb02e8d64 Mon Sep 17 00:00:00 2001 From: Freeyorp Date: Sun, 24 May 2009 00:55:10 +1200 Subject: Modify the default keyboard settings to resolve a conflict --- src/keyboardconfig.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp index e013bfc5..670a96be 100644 --- a/src/keyboardconfig.cpp +++ b/src/keyboardconfig.cpp @@ -97,7 +97,7 @@ static KeyData const keyData[KeyboardConfig::KEY_TOTAL] = { {"keyChatScrollDown", SDLK_PAGEDOWN, _("Scroll Chat Down")}, {"keyChatPrevTab", SDLK_LEFTBRACKET, _("Previous Chat Tab")}, {"keyChatNextTab", SDLK_RIGHTBRACKET, _("Next Chat Tab")}, - {"keyOK", SDLK_RETURN, _("Select OK")}, + {"keyOK", SDLK_SPACE, _("Select OK")}, {"keyQuit", SDLK_ESCAPE, _("Quit")}, {"keyIgnoreInput1", SDLK_LSUPER, _("Ignore input 1")}, {"keyIgnoreInput2", SDLK_RSUPER, _("Ignore input 2")} -- cgit v1.2.3-70-g09d2 From 33fdceaa4c44745184d44b626741c73d3f35fdbb Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 24 May 2009 15:16:18 +0200 Subject: Updated NEWS file with changes for 0.0.29.1 --- NEWS | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/NEWS b/NEWS index 178a58f9..ab8c1c15 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,17 @@ +0.0.29.1 (...) +- The leader of a party is now displayed in bold +- Status window was reorganized to allow larger numbers to be displayed +- Fixed position of floating text for damage, pickup and experience +- Fixed a possible crash on logging in to the map server +- Fixed the crash when shift-clicking an item in the inventory +- Fixed a crash related to item links in the chat window +- Fixed lightspeed bug when stopping to attack +- Fixed the -S/--home-dir command line option +- Fixed Reset Windows to also reset the party window +- Fixed problems with the context menu in the Brazilian translation +- Fixed resetting the height of the chat on /clear +- Small optimizations to OpenGL mode when drawing certain GUI widgets + 0.0.29 (13 May 2009) - Added support for dynamic emotes and a new way to select them - Added speech balloons that wrap the text -- cgit v1.2.3-70-g09d2 From 8804e57c206281551b6d4c29ef5fbe8d571dd18c Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 24 May 2009 18:37:37 +0200 Subject: Made the "a" part in "You picked up a ..." translatable Mantis-issue: 704 --- src/net/ea/inventoryhandler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp index e91a1c19..e9c9f91c 100644 --- a/src/net/ea/inventoryhandler.cpp +++ b/src/net/ea/inventoryhandler.cpp @@ -190,7 +190,9 @@ void InventoryHandler::handleMessage(MessageIn &msg) { const ItemInfo &itemInfo = ItemDB::get(itemId); const std::string amountStr = - (amount > 1) ? toString(amount) : "a"; + // TRANSLATORS: Used as in "You picked up a ...", when + // picking up only one item. + (amount > 1) ? toString(amount) : _("a"); if (config.getValue("showpickupchat", 1)) { -- cgit v1.2.3-70-g09d2 From 9ece3811d6ca6577b238a08eea50449d89e9eba1 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 24 May 2009 21:04:09 +0200 Subject: Added Dennis Friis to the .mailmap file To make sure the 'peavey' entries get credited to him in the shortlog. --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index 210bd5a4..1e2f3717 100644 --- a/.mailmap +++ b/.mailmap @@ -2,6 +2,7 @@ Blue Bjørn Lindeijer Bjørn Lindeijer Bjørn Lindeijer +Dennis Friis Falkreon Ira Rice Majin Sniper -- cgit v1.2.3-70-g09d2 From c354af888779c9038cedf64c1502574eb8b29399 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 24 May 2009 21:28:14 +0200 Subject: Fixed crash on whispering somebody a second time after closing the tab The tabs are referred to case-insentively, but the removal of references to deleted tabs was happening case-sensitively. This caused roaming pointers to stay around and get reused later, crashing the client. --- NEWS | 1 + src/gui/chat.cpp | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index ab8c1c15..0fda11ee 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ - Fixed a possible crash on logging in to the map server - Fixed the crash when shift-clicking an item in the inventory - Fixed a crash related to item links in the chat window +- Fixed a crash on whispering somebody again after closing their tab - Fixed lightspeed bug when stopping to attack - Fixed the -S/--home-dir command line option - Fixed Reset Windows to also reset the party window diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 414d1e02..73af83ff 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -292,7 +292,9 @@ void ChatWindow::addTab(ChatTab *tab) void ChatWindow::removeWhisper(const std::string &nick) { - mWhispers.erase(nick); + std::string tempNick = nick; + toLower(tempNick); + mWhispers.erase(tempNick); } void ChatWindow::chatInput(std::string &msg) @@ -444,12 +446,13 @@ void ChatWindow::whisper(const std::string &nick, std::string mes, bool own) if (tempNick.compare(playerName) == 0) return; - ChatTab *tab = mWhispers[tempNick]; + ChatTab *tab = 0; + TabMap::const_iterator i = mWhispers.find(tempNick); - if (!tab && config.getValue("whispertab", false)) - { + if (i != mWhispers.end()) + tab = i->second; + else if (config.getValue("whispertab", false)) tab = addWhisperTab(nick); - } if (tab) { @@ -480,10 +483,12 @@ ChatTab *ChatWindow::addWhisperTab(const std::string &nick, bool switchTo) toLower(playerName); toLower(tempNick); - if (mWhispers[tempNick] || tempNick.compare(playerName) == 0) + if (mWhispers.find(tempNick) != mWhispers.end() + || tempNick.compare(playerName) == 0) return NULL; - ChatTab *ret = mWhispers[tempNick] = new WhisperTab(nick); + ChatTab *ret = new WhisperTab(nick); + mWhispers[tempNick] = ret; if (switchTo) mChatTabs->setSelectedTab(ret); -- cgit v1.2.3-70-g09d2 From cc28b48adcc8ef3b584312e598035c34384dcf78 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 24 May 2009 21:31:00 +0200 Subject: Made some parameters const references like they should be --- src/commandhandler.cpp | 3 ++- src/gui/chat.cpp | 7 +++++-- src/gui/chat.h | 4 ++-- src/gui/widgets/chattab.cpp | 3 ++- src/gui/widgets/chattab.h | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index aaca632a..0af77398 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -340,7 +340,8 @@ void CommandHandler::handleMsg(const std::string &args, ChatTab *tab) tab->chatLog(_("Cannot send empty whispers!"), BY_SERVER); } -void CommandHandler::handleQuery(const std::string &args, ChatTab *tab) { +void CommandHandler::handleQuery(const std::string &args, ChatTab *tab) +{ if (chatWindow->addWhisperTab(args, true)) return; diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 73af83ff..1ce1b77c 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -297,7 +297,7 @@ void ChatWindow::removeWhisper(const std::string &nick) mWhispers.erase(tempNick); } -void ChatWindow::chatInput(std::string &msg) +void ChatWindow::chatInput(const std::string &msg) { ChatTab *tab = getFocused(); tab->chatInput(msg); @@ -432,7 +432,8 @@ void ChatWindow::setRecordingFile(const std::string &msg) mRecorder->setRecordingFile(msg); } -void ChatWindow::whisper(const std::string &nick, std::string mes, bool own) +void ChatWindow::whisper(const std::string &nick, + const std::string &mes, bool own) { if (mes.empty()) return; @@ -471,7 +472,9 @@ void ChatWindow::whisper(const std::string &nick, std::string mes, bool own) nick.c_str(), mes.c_str()), BY_PLAYER); } else + { localChatTab->chatLog(nick + " : " + mes, ACT_WHISPER, false); + } } } diff --git a/src/gui/chat.h b/src/gui/chat.h index c6e8e326..7080392e 100644 --- a/src/gui/chat.h +++ b/src/gui/chat.h @@ -136,7 +136,7 @@ class ChatWindow : public Window, * * @param msg The message text which is to be sent. */ - void chatInput(std::string &msg); + void chatInput(const std::string &msg); /** Called when key is pressed */ void keyPressed(gcn::KeyEvent &event); @@ -171,7 +171,7 @@ class ChatWindow : public Window, void doPresent(); - void whisper(const std::string &nick, std::string mes, + void whisper(const std::string &nick, const std::string &mes, bool own = false); ChatTab *addWhisperTab(const std::string &nick, bool switchTo = false); diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp index ad0911c9..d2fa33b8 100644 --- a/src/gui/widgets/chattab.cpp +++ b/src/gui/widgets/chattab.cpp @@ -203,8 +203,9 @@ void ChatTab::chatLog(const std::string &nick, const std::string &msg) false); } -void ChatTab::chatInput(std::string &msg) +void ChatTab::chatInput(const std::string &message) { + std::string msg = message; trim(msg); if (msg.empty()) diff --git a/src/gui/widgets/chattab.h b/src/gui/widgets/chattab.h index dc0d3047..4cb6a58f 100644 --- a/src/gui/widgets/chattab.h +++ b/src/gui/widgets/chattab.h @@ -77,7 +77,7 @@ class ChatTab : public Tab * * @param msg The message text which is to be sent. */ - void chatInput(std::string &msg); + void chatInput(const std::string &msg); /** * Scrolls the chat window -- cgit v1.2.3-70-g09d2 From 4e18e7619e9a8c909dea3374a2a7aa39befe0c16 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 24 May 2009 21:34:15 +0200 Subject: Fixed item links that aren't written in lowercase In commit 2a9f8e05312c210ec204e09861f47c3d017706eb I meant to move the normalizing of item names into the database, but the commit failed to include this change. --- src/resources/itemdb.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index a8a0681d..9a17eb3a 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -96,6 +96,12 @@ static WeaponType weaponTypeFromString(const std::string &name, int id = 0) else return WPNTYPE_NONE; } +static std::string normalized(const std::string &name) +{ + std::string normalized = name; + return toLower(trim(normalized));; +} + void ItemDB::load() { if (mLoaded) @@ -196,8 +202,7 @@ void ItemDB::load() mItemInfos[id] = itemInfo; if (!name.empty()) { - std::string temp = name; - toLower(trim(temp)); + std::string temp = normalized(name); NamedItemInfos::const_iterator itr = mNamedItemInfos.find(temp); if (itr == mNamedItemInfos.end()) @@ -262,7 +267,7 @@ const ItemInfo &ItemDB::get(const std::string &name) { assert(mLoaded); - NamedItemInfos::const_iterator i = mNamedItemInfos.find(name); + NamedItemInfos::const_iterator i = mNamedItemInfos.find(normalized(name)); if (i == mNamedItemInfos.end()) { -- cgit v1.2.3-70-g09d2