From 1407a08f0087905edae30ac3793e83757ff56d4c Mon Sep 17 00:00:00 2001 From: Chuck Miller Date: Sat, 23 May 2009 05:53:31 -0400 Subject: Fixes a segmentfault and disables shift split for eA --- src/gui/inventorywindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/gui') diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index d6cd3a84..47f66e76 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -233,11 +233,12 @@ void InventoryWindow::keyReleased(gcn::KeyEvent &event) void InventoryWindow::valueChanged(const gcn::SelectionEvent &event) { - if (mSplit) + if (mSplit && Net::getInventoryHandler()->canSplit(mItems->getSelectedItem())) { Item *item = mItems->getSelectedItem(); - ItemAmountWindow::showWindow(ItemAmountWindow::ItemSplit, this, item, + if (item) + ItemAmountWindow::showWindow(ItemAmountWindow::ItemSplit, this, item, (item->getQuantity() - 1)); } } -- cgit v1.2.3-70-g09d2 From 4deff8569279d5cf23a73fdc1c986592ca4f7ed2 Mon Sep 17 00:00:00 2001 From: Kess Vargavind Date: Thu, 21 May 2009 00:00:24 +0200 Subject: Fix a segmentation fault The client crashed when entering [] inside an item link, for example the string [[]]. (cherry picked from commit 86a055d46df5a262fce0f76697cc3d54e75b19e1) --- src/gui/widgets/chattab.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/gui') diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp index 711680d1..85353bf7 100644 --- a/src/gui/widgets/chattab.cpp +++ b/src/gui/widgets/chattab.cpp @@ -227,15 +227,19 @@ void ChatTab::chatInput(std::string &msg) std::string temp = msg.substr(start + 1, end - start - 1); - toLower(trim(temp)); - - const ItemInfo itemInfo = ItemDB::get(temp); - if (itemInfo.getName() != _("Unknown item")) + // Do not parse an empty string (it crashes the client) + if (!temp.empty()) { - msg.insert(end, "@@"); - msg.insert(start+1, "|"); - msg.insert(start+1, toString(itemInfo.getId())); - msg.insert(start+1, "@@"); + toLower(trim(temp)); + + const ItemInfo itemInfo = ItemDB::get(temp); + if (itemInfo.getName() != _("Unknown item")) + { + msg.insert(end, "@@"); + msg.insert(start+1, "|"); + msg.insert(start+1, toString(itemInfo.getId())); + msg.insert(start+1, "@@"); + } } } start = msg.find('[', start + 1); -- cgit v1.2.3-70-g09d2 From 2a9f8e05312c210ec204e09861f47c3d017706eb Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 23 May 2009 13:11:40 +0200 Subject: Fixed the empty item link crash differently The crash was due to an assertion which shouldn't have been there, so I removed the assertion instead. I've also made sure the unknown item has its id initialized to 0, so that it can be used to check against instead of the item name. Normalization of item names was moved within the item database. --- src/gui/widgets/chattab.cpp | 22 ++++++++-------------- src/resources/itemdb.cpp | 26 +++++++++++++------------- src/resources/iteminfo.h | 7 ++++--- 3 files changed, 25 insertions(+), 30 deletions(-) (limited to 'src/gui') diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp index 85353bf7..ad0911c9 100644 --- a/src/gui/widgets/chattab.cpp +++ b/src/gui/widgets/chattab.cpp @@ -215,7 +215,7 @@ void ChatTab::chatInput(std::string &msg) while (start != std::string::npos && msg[start+1] != '@') { std::string::size_type end = msg.find(']', start); - if (start+1 != end && end != std::string::npos) + if (start + 1 != end && end != std::string::npos) { // Catch multiple embeds and ignore them // so it doesn't crash the client. @@ -227,22 +227,16 @@ void ChatTab::chatInput(std::string &msg) std::string temp = msg.substr(start + 1, end - start - 1); - // Do not parse an empty string (it crashes the client) - if (!temp.empty()) + const ItemInfo itemInfo = ItemDB::get(temp); + if (itemInfo.getId() != 0) { - toLower(trim(temp)); - - const ItemInfo itemInfo = ItemDB::get(temp); - if (itemInfo.getName() != _("Unknown item")) - { - msg.insert(end, "@@"); - msg.insert(start+1, "|"); - msg.insert(start+1, toString(itemInfo.getId())); - msg.insert(start+1, "@@"); - } + msg.insert(end, "@@"); + msg.insert(start + 1, "|"); + msg.insert(start + 1, toString(itemInfo.getId())); + msg.insert(start + 1, "@@"); } } - start = msg.find('[', start + 1); + start = msg.find('[', start + 1); } // Prepare ordinary message diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 99907ca7..5dda2bfd 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -243,7 +243,7 @@ void ItemDB::unload() mLoaded = false; } -const ItemInfo& ItemDB::get(int id) +const ItemInfo &ItemDB::get(int id) { assert(mLoaded); @@ -251,30 +251,30 @@ const ItemInfo& ItemDB::get(int id) if (i == mItemInfos.end()) { - logger->log("ItemDB: Error, unknown item ID# %d", id); + logger->log("ItemDB: Warning, unknown item ID# %d", id); return *mUnknown; } - else - { - return *(i->second); - } + + return *(i->second); } -const ItemInfo& ItemDB::get(const std::string &name) +const ItemInfo &ItemDB::get(const std::string &name) { - assert(mLoaded && !name.empty()); + assert(mLoaded); NamedItemInfos::const_iterator i = mNamedItemInfos.find(name); if (i == mNamedItemInfos.end()) { - logger->log("ItemDB: Error, unknown item name %s", name.c_str()); + if (!name.empty()) + { + logger->log("ItemDB: Warning, unknown item name \"%s\"", + name.c_str()); + } return *mUnknown; } - else - { - return *(i->second); - } + + return *(i->second); } void loadSpriteRef(ItemInfo *itemInfo, xmlNodePtr node) diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h index 3329d95b..0c87b585 100644 --- a/src/resources/iteminfo.h +++ b/src/resources/iteminfo.h @@ -118,6 +118,7 @@ class ItemInfo mType(ITEM_UNUSABLE), mWeight(0), mView(0), + mId(0), mAttackType(ACTION_DEFAULT) { } @@ -162,10 +163,10 @@ class ItemInfo ItemType getType() const { return mType; } - void setWeight(short weight) + void setWeight(int weight) { mWeight = weight; } - short getWeight() const + int getWeight() const { return mWeight; } void setView(int view) @@ -198,7 +199,7 @@ class ItemInfo std::string mEffect; /**< Description of effects. */ ItemType mType; /**< Item type. */ std::string mParticle; /**< Particle effect used with this item */ - short mWeight; /**< Weight in grams. */ + int mWeight; /**< Weight in grams. */ int mView; /**< Item ID of how this item looks. */ int mId; /**< Item ID */ -- cgit v1.2.3-70-g09d2 From cf9caaefeb69cafcf273028d12f074d5d1737bf9 Mon Sep 17 00:00:00 2001 From: Freeyorp Date: Thu, 21 May 2009 17:45:51 +1200 Subject: Display the party leaders name in bold font (cherry picked from commit 244b0d9b46128ab3498da078020c8bbf8c65f69f) --- src/gui/partywindow.cpp | 1 + src/gui/widgets/avatar.cpp | 6 +++++- src/gui/widgets/avatar.h | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/partywindow.cpp b/src/gui/partywindow.cpp index 68e5a371..5e384413 100644 --- a/src/gui/partywindow.cpp +++ b/src/gui/partywindow.cpp @@ -123,6 +123,7 @@ void PartyWindow::updateMember(int id, const std::string &memberName, member->name = memberName; member->leader = leader; member->online = online; + member->avatar->setDisplayBold(leader); member->avatar->setName(memberName); member->avatar->setOnline(online); diff --git a/src/gui/widgets/avatar.cpp b/src/gui/widgets/avatar.cpp index 16c77233..f7273c75 100644 --- a/src/gui/widgets/avatar.cpp +++ b/src/gui/widgets/avatar.cpp @@ -23,6 +23,7 @@ #include "localplayer.h" +#include "gui/gui.h" #include "gui/widgets/icon.h" #include "gui/widgets/label.h" @@ -39,7 +40,8 @@ namespace { Avatar::Avatar(): mHp(0), - mMaxHp(0) + mMaxHp(0), + mDisplayBold(false) { setOpaque(false); @@ -111,6 +113,8 @@ void Avatar::updateAvatarLabel() if (mName != player_node->getName() && mMaxHp != 0) ss << " (" << mHp << "/" << mMaxHp << ")"; + if (mDisplayBold) + mLabel->setFont(boldFont); mLabel->setCaption(ss.str()); mLabel->adjustSize(); } diff --git a/src/gui/widgets/avatar.h b/src/gui/widgets/avatar.h index 32586668..dbe30a94 100644 --- a/src/gui/widgets/avatar.h +++ b/src/gui/widgets/avatar.h @@ -51,6 +51,8 @@ public: void setMaxHp(int maxHp); + void setDisplayBold(bool displayBold) { mDisplayBold = displayBold; } + private: void updateAvatarLabel(); @@ -59,6 +61,7 @@ private: int mMaxHp; Icon *mStatus; gcn::Label *mLabel; + bool mDisplayBold; }; #endif // AVATAR_H -- cgit v1.2.3-70-g09d2 From ee6aea38c7d3dba0c4b6dab7f22f303dfbc14019 Mon Sep 17 00:00:00 2001 From: Kess Vargavind Date: Thu, 21 May 2009 09:38:06 +0200 Subject: Fixed a few strings for better translation Just a few notes that would help us translators immensly: * Please do not split one sentence into several strings * Please try to refrain from inserting extra spaces into the strings (cherry picked from commit 9712489ef67f95d6a5fa1fc3102bb7c4ee6a1f59) --- src/commandhandler.cpp | 8 +++---- src/gui/charselectdialog.cpp | 2 +- src/gui/itemamount.cpp | 24 ++++++++++----------- src/gui/npcpostdialog.cpp | 9 ++++---- src/gui/okdialog.cpp | 2 +- src/gui/partywindow.cpp | 16 ++++++++------ src/gui/quitdialog.cpp | 2 +- src/gui/serverdialog.cpp | 2 +- src/gui/skill.cpp | 2 +- src/gui/storagewindow.cpp | 2 +- src/gui/trade.cpp | 2 +- src/keyboardconfig.cpp | 2 +- src/main.cpp | 6 +++--- src/net/ea/buysellhandler.cpp | 10 ++++----- src/net/ea/charserverhandler.cpp | 6 +++--- src/net/ea/chathandler.cpp | 6 ++++-- src/net/ea/inventoryhandler.cpp | 9 +++++--- src/net/ea/loginhandler.cpp | 2 +- src/net/ea/playerhandler.cpp | 6 +++--- src/net/ea/playerhandler.h | 4 ++-- src/net/ea/tradehandler.cpp | 45 +++++++++++++++++++++------------------ src/net/playerhandler.h | 4 ++-- src/net/tmwserv/chathandler.cpp | 13 +++++------ src/net/tmwserv/guildhandler.cpp | 25 ++++++++++++++-------- src/net/tmwserv/partyhandler.cpp | 8 +++++-- src/net/tmwserv/playerhandler.cpp | 6 +++--- src/net/tmwserv/playerhandler.h | 4 ++-- src/net/tmwserv/tradehandler.cpp | 19 +++++++++++------ src/resources/itemdb.cpp | 2 +- src/resources/monsterdb.cpp | 2 +- 30 files changed, 139 insertions(+), 111 deletions(-) (limited to 'src/gui') diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index f2fafed4..aaca632a 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -110,7 +110,7 @@ void CommandHandler::handleCommand(const std::string &command, ChatTab *tab) } else { - tab->chatLog("Unknown command"); + tab->chatLog(_("Unknown command.")); } } @@ -167,7 +167,7 @@ void CommandHandler::handleHelp(const std::string &args, ChatTab *tab) tab->showHelp(); // Allow the tab to show it's help - tab->chatLog(_("For more information, type /help ")); + tab->chatLog(_("For more information, type /help .")); } else if (args == "help") // Do this before tabs so they can't change it { @@ -344,7 +344,7 @@ void CommandHandler::handleQuery(const std::string &args, ChatTab *tab) { if (chatWindow->addWhisperTab(args, true)) return; - tab->chatLog(strprintf(_("Cannot create a whisper tab for nick '%s'! " + tab->chatLog(strprintf(_("Cannot create a whisper tab for nick \"%s\"! " "It either already exists, or is you."), args.c_str()), BY_SERVER); } @@ -358,7 +358,7 @@ void CommandHandler::handleJoin(const std::string &args, ChatTab *tab) std::string::size_type pos = args.find(' '); std::string name(args, 0, pos); std::string password(args, pos+1); - tab->chatLog("Requesting to join channel " + name); + tab->chatLog(strprintf(_("Requesting to join channel %s."), name.c_str())); Net::getChatHandler()->enterChannel(name, password); } diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp index f88fa733..4df0243b 100644 --- a/src/gui/charselectdialog.cpp +++ b/src/gui/charselectdialog.cpp @@ -107,7 +107,7 @@ CharSelectDialog::CharSelectDialog(LockedArray *charInfo, mGender(gender) #endif { - mSelectButton = new Button(_("Ok"), "ok", this); + mSelectButton = new Button(_("OK"), "ok", this); mCancelButton = new Button(_("Cancel"), "cancel", this); mPreviousButton = new Button(_("Previous"), "previous", this); mNextButton = new Button(_("Next"), "next", this); diff --git a/src/gui/itemamount.cpp b/src/gui/itemamount.cpp index 252daf19..87df46c1 100644 --- a/src/gui/itemamount.cpp +++ b/src/gui/itemamount.cpp @@ -82,7 +82,7 @@ ItemAmountWindow::ItemAmountWindow(Usage usage, Window *parent, Item *item, // Slider mItemAmountSlide = new Slider(1.0, mMax); mItemAmountSlide->setHeight(10); - mItemAmountSlide->setActionEventId("Slide"); + mItemAmountSlide->setActionEventId("slide"); mItemAmountSlide->addActionListener(this); //Item icon @@ -90,11 +90,11 @@ ItemAmountWindow::ItemAmountWindow(Usage usage, Window *parent, Item *item, mItemIcon = new Icon(image); // Buttons - Button *minusButton = new Button("-", "Minus", this); - Button *plusButton = new Button("+", "Plus", this); - Button *okButton = new Button(_("Ok"), "Ok", this); - Button *cancelButton = new Button(_("Cancel"), "Cancel", this); - Button *addAllButton = new Button(_("All"), "All", this); + Button *minusButton = new Button("-", "minus", this); + Button *plusButton = new Button("+", "plus", this); + Button *okButton = new Button(_("Ok"), "ok", this); + Button *cancelButton = new Button(_("Cancel"), "cancel", this); + Button *addAllButton = new Button(_("All"), "all", this); minusButton->adjustSize(); minusButton->setWidth(plusButton->getWidth()); @@ -168,27 +168,27 @@ void ItemAmountWindow::action(const gcn::ActionEvent &event) { int amount = mItemAmountTextField->getValue(); - if (event.getId() == "Cancel") + if (event.getId() == "cancel") { close(); } - else if (event.getId() == "Plus" && amount < mMax) + else if (event.getId() == "plus" && amount < mMax) { amount++; } - else if (event.getId() == "Minus" && amount > 1) + else if (event.getId() == "minus" && amount > 1) { amount--; } - else if (event.getId() == "All") + else if (event.getId() == "all") { amount = mMax; } - else if (event.getId() == "Slide") + else if (event.getId() == "slide") { amount = static_cast(mItemAmountSlide->getValue()); } - else if (event.getId() == "Ok") + else if (event.getId() == "ok") { finish(mItem, amount, mUsage); scheduleDelete(); diff --git a/src/gui/npcpostdialog.cpp b/src/gui/npcpostdialog.cpp index 20123745..32dbe22c 100644 --- a/src/gui/npcpostdialog.cpp +++ b/src/gui/npcpostdialog.cpp @@ -41,7 +41,7 @@ NpcPostDialog::NpcPostDialog(): setContentSize(400, 180); // create text field for receiver - gcn::Label *senderText = new Label("To:"); + gcn::Label *senderText = new Label(_("To:")); senderText->setPosition(5, 5); mSender = new TextField; mSender->setPosition(senderText->getWidth() + 5, 5); @@ -49,8 +49,8 @@ NpcPostDialog::NpcPostDialog(): // create button for sending Button *sendButton = new Button(_("Send"), "send", this); - sendButton->setPosition(400-sendButton->getWidth(), - 170-sendButton->getHeight()); + sendButton->setPosition(400 - sendButton->getWidth(), + 170 - sendButton->getHeight()); Button *cancelButton = new Button(_("Cancel"), "cancel", this); cancelButton->setPosition(sendButton->getX() - (cancelButton->getWidth() + 2), sendButton->getY()); @@ -82,7 +82,8 @@ void NpcPostDialog::action(const gcn::ActionEvent &event) { if (mSender->getText().empty() || mText->getText().empty()) { - localChatTab->chatLog("Failed to send as sender or letter invalid"); + localChatTab->chatLog(_("Failed to send as sender or letter " + "invalid.")); } else { diff --git a/src/gui/okdialog.cpp b/src/gui/okdialog.cpp index 9da070eb..8982d528 100644 --- a/src/gui/okdialog.cpp +++ b/src/gui/okdialog.cpp @@ -39,7 +39,7 @@ OkDialog::OkDialog(const std::string &title, const std::string &msg, mTextBox->setOpaque(false); mTextBox->setTextWrapped(msg, 260); - gcn::Button *okButton = new Button(_("Ok"), "ok", this); + gcn::Button *okButton = new Button(_("OK"), "ok", this); const int numRows = mTextBox->getNumberOfRows(); const int fontHeight = getFont()->getHeight(); diff --git a/src/gui/partywindow.cpp b/src/gui/partywindow.cpp index 5e384413..f66ffaac 100644 --- a/src/gui/partywindow.cpp +++ b/src/gui/partywindow.cpp @@ -171,24 +171,24 @@ void PartyWindow::showPartyInvite(const std::string &inviter, // check there isnt already an invite showing if (mPartyInviter != "") { - localChatTab->chatLog("Received party request, but one already exists", - BY_SERVER); + localChatTab->chatLog(_("Received party request, but one already " + "exists."), BY_SERVER); return; } std::string msg; // log invite if (partyName.empty()) - msg = strprintf("%s has invited you to join their party", + msg = strprintf(N_("%s has invited you to join their party."), inviter.c_str()); else - msg = strprintf("%s has invited you to join the %s party", + msg = strprintf(N_("%s has invited you to join the %s party."), inviter.c_str(), partyName.c_str()); localChatTab->chatLog(msg, BY_SERVER); // show invite - acceptDialog = new ConfirmDialog("Accept Party Invite", msg, this); + acceptDialog = new ConfirmDialog(_("Accept Party Invite"), msg, this); acceptDialog->addActionListener(this); mPartyInviter = inviter; @@ -201,13 +201,15 @@ void PartyWindow::action(const gcn::ActionEvent &event) // check if they accepted the invite if (eventId == "yes") { - localChatTab->chatLog("Accepted invite from " + mPartyInviter); + localChatTab->chatLog(strprintf(_("Accepted invite from %s."), + mPartyInviter.c_str())); Net::getPartyHandler()->inviteResponse(mPartyInviter, true); mPartyInviter = ""; } else if (eventId == "no") { - localChatTab->chatLog("Rejected invite from " + mPartyInviter); + localChatTab->chatLog(strprintf(_("Rejected invite from %s."), + mPartyInviter.c_str())); Net::getPartyHandler()->inviteResponse(mPartyInviter, false); mPartyInviter = ""; } diff --git a/src/gui/quitdialog.cpp b/src/gui/quitdialog.cpp index e506aea3..98657001 100644 --- a/src/gui/quitdialog.cpp +++ b/src/gui/quitdialog.cpp @@ -36,7 +36,7 @@ QuitDialog::QuitDialog(bool* quitGame, QuitDialog** pointerToMe): mForceQuit = new RadioButton(_("Quit"), "quitdialog"); mSwitchAccountServer = new RadioButton(_("Switch server"), "quitdialog"); mSwitchCharacter = new RadioButton(_("Switch character"), "quitdialog"); - mOkButton = new Button(_("Ok"), "ok", this); + mOkButton = new Button(_("OK"), "ok", this); mCancelButton = new Button(_("Cancel"), "cancel", this); setContentSize(200, 91); diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index a3dfdeae..5d08a2ec 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -100,7 +100,7 @@ ServerDialog::ServerDialog(LoginData *loginData): mMostUsedServersDropDown = new DropDown(mMostUsedServersListModel); - mOkButton = new Button(_("Ok"), "connect", this); + mOkButton = new Button(_("OK"), "connect", this); mCancelButton = new Button(_("Cancel"), "cancel", this); mServerNameField->setActionEventId("connect"); diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp index 3a4fb75c..7698098c 100644 --- a/src/gui/skill.cpp +++ b/src/gui/skill.cpp @@ -41,7 +41,7 @@ #include "utils/stringutils.h" #include "utils/xml.h" -static const char *SKILLS_FILE = _("skills.xml"); +static const char *SKILLS_FILE = "skills.xml"; struct SkillInfo { diff --git a/src/gui/storagewindow.cpp b/src/gui/storagewindow.cpp index 593a49a3..91224359 100644 --- a/src/gui/storagewindow.cpp +++ b/src/gui/storagewindow.cpp @@ -75,7 +75,7 @@ StorageWindow::StorageWindow(int invSize): mUsedSlots = player_node->getStorage()->getNumberOfSlotsUsed(); - mSlotsLabel = new Label(_("Slots: ")); + mSlotsLabel = new Label(_("Slots:")); mSlotsBar = new ProgressBar(0.0f, 100, 20, gcn::Color(225, 200, 25)); mSlotsBar->setText(strprintf("%d/%d", mUsedSlots, mMaxSlots)); diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp index 1e7faa97..3abb985e 100644 --- a/src/gui/trade.cpp +++ b/src/gui/trade.cpp @@ -308,7 +308,7 @@ void TradeWindow::action(const gcn::ActionEvent &event) int curMoney = player_node->getMoney(); if(v > curMoney) { - localChatTab->chatLog(_("You don't have enough money"), BY_SERVER); + localChatTab->chatLog(_("You don't have enough money."), BY_SERVER); v = curMoney; } Net::getTradeHandler()->setMoney(v); diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp index b5db3de5..e013bfc5 100644 --- a/src/keyboardconfig.cpp +++ b/src/keyboardconfig.cpp @@ -71,7 +71,7 @@ static KeyData const keyData[KeyboardConfig::KEY_TOTAL] = { {"keyWindowHelp", SDLK_F1, _("Help Window")}, {"keyWindowStatus", SDLK_F2, _("Status Window")}, {"keyWindowInventory", SDLK_F3, _("Inventory Window")}, - {"keyWindowEquipment", SDLK_F4, _("Equipment WIndow")}, + {"keyWindowEquipment", SDLK_F4, _("Equipment Window")}, {"keyWindowSkill", SDLK_F5, _("Skill Window")}, {"keyWindowMinimap", SDLK_F6, _("Minimap Window")}, {"keyWindowChat", SDLK_F7, _("Chat Window")}, diff --git a/src/main.cpp b/src/main.cpp index f05ba665..c2e74ff3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -583,8 +583,8 @@ static void printHelp() << _(" -H --update-host : Use this update host") << endl << _(" -P --password : Login with this password") << endl << _(" -c --character : Login with this character") << endl - << _(" -p --port : Login Server Port") << endl - << _(" -s --server : Login Server name or IP") << endl + << _(" -p --port : Login server port") << endl + << _(" -s --server : Login server name or IP") << endl << _(" -u --skip-update : Skip the update downloads") << endl << _(" -U --username : Login with this username") << endl #ifdef USE_OPENGL @@ -595,7 +595,7 @@ static void printHelp() static void printVersion() { - std::cout << _("The Mana World ") << FULL_VERSION << std::endl; + std::cout << strprintf(_("The Mana World %s"), FULL_VERSION) << std::endl; } static void parseOptions(int argc, char *argv[], Options &options) diff --git a/src/net/ea/buysellhandler.cpp b/src/net/ea/buysellhandler.cpp index ca155228..48e856e4 100644 --- a/src/net/ea/buysellhandler.cpp +++ b/src/net/ea/buysellhandler.cpp @@ -108,7 +108,7 @@ void BuySellHandler::handleMessage(MessageIn &msg) } else { - localChatTab->chatLog(_("Nothing to sell"), BY_SERVER); + localChatTab->chatLog(_("Nothing to sell."), BY_SERVER); current_npc = 0; } break; @@ -116,22 +116,22 @@ void BuySellHandler::handleMessage(MessageIn &msg) case SMSG_NPC_BUY_RESPONSE: if (msg.readInt8() == 0) { - localChatTab->chatLog(_("Thanks for buying"), BY_SERVER); + localChatTab->chatLog(_("Thanks for buying."), BY_SERVER); } else { // Reset player money since buy dialog already assumed purchase // would go fine buyDialog->setMoney(player_node->getMoney()); - localChatTab->chatLog(_("Unable to buy"), BY_SERVER); + localChatTab->chatLog(_("Unable to buy."), BY_SERVER); } break; case SMSG_NPC_SELL_RESPONSE: if (msg.readInt8() == 0) - localChatTab->chatLog(_("Thanks for selling"), BY_SERVER); + localChatTab->chatLog(_("Thanks for selling."), BY_SERVER); else - localChatTab->chatLog(_("Unable to sell"), BY_SERVER); + localChatTab->chatLog(_("Unable to sell."), BY_SERVER); break; } diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp index b28961b6..77bfaa50 100644 --- a/src/net/ea/charserverhandler.cpp +++ b/src/net/ea/charserverhandler.cpp @@ -120,8 +120,8 @@ void CharServerHandler::handleMessage(MessageIn &msg) break; case SMSG_CHAR_CREATE_FAILED: - new OkDialog(_("Error"), _("Failed to create character. Most likely" - " the name is already taken.")); + new OkDialog(_("Error"), _("Failed to create character. Most " + "likely the name is already taken.")); if (mCharCreateDialog) mCharCreateDialog->unlock(); @@ -132,7 +132,7 @@ void CharServerHandler::handleMessage(MessageIn &msg) mCharInfo->setEntry(0); mCharInfo->unlock(); n_character--; - new OkDialog(_("Info"), _("Player deleted")); + new OkDialog(_("Info"), _("Character deleted.")); break; case SMSG_CHAR_DELETE_FAILED: diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index 09eca6f9..49f83e67 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -75,10 +75,12 @@ void ChatHandler::handleMessage(MessageIn &msg) //localChatTab->chatLog("Whisper sent", BY_SERVER); break; case 0x01: - localChatTab->chatLog(_("Whisper could not be sent, user is offline"), BY_SERVER); + localChatTab->chatLog(_("Whisper could not be sent, user " + "is offline."), BY_SERVER); break; case 0x02: - localChatTab->chatLog(_("Whisper could not be sent, ignored by user"), BY_SERVER); + localChatTab->chatLog(_("Whisper could not be sent, " + "ignored by user."), BY_SERVER); break; } break; diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp index 30c583b8..e91a1c19 100644 --- a/src/net/ea/inventoryhandler.cpp +++ b/src/net/ea/inventoryhandler.cpp @@ -181,7 +181,10 @@ void InventoryHandler::handleMessage(MessageIn &msg) if (msg.readInt8() > 0) { if (config.getValue("showpickupchat", 1)) - localChatTab->chatLog(_("Unable to pick up item"), BY_SERVER); + { + localChatTab->chatLog(_("Unable to pick up item."), + BY_SERVER); + } } else { @@ -191,7 +194,7 @@ void InventoryHandler::handleMessage(MessageIn &msg) if (config.getValue("showpickupchat", 1)) { - localChatTab->chatLog(strprintf(_("You picked up %s [@@%d|%s@@]"), + localChatTab->chatLog(strprintf(_("You picked up %s [@@%d|%s@@]."), amountStr.c_str(), itemInfo.getId(), itemInfo.getName().c_str()), BY_SERVER); } @@ -237,7 +240,7 @@ void InventoryHandler::handleMessage(MessageIn &msg) amount = msg.readInt16(); if (msg.readInt8() == 0) { - localChatTab->chatLog(_("Failed to use item"), BY_SERVER); + localChatTab->chatLog(_("Failed to use item."), BY_SERVER); } else { if (Item *item = inventory->getItem(index)) item->setQuantity(amount); diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp index 44eabe46..31d2c020 100644 --- a/src/net/ea/loginhandler.cpp +++ b/src/net/ea/loginhandler.cpp @@ -126,7 +126,7 @@ void LoginHandler::handleMessage(MessageIn &msg) case 6: errorMessage = strprintf(_("You have been temporarily " "banned from the game until " - "%s.\n Please contact the GM " + "%s.\nPlease contact the GM " "team via the forums."), msg.readString(20).c_str()); break; diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index b7131f0a..2d953df1 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -410,7 +410,7 @@ void PlayerHandler::handleMessage(MessageIn &msg) switch (type) { case 0: - localChatTab->chatLog(_("Equip arrows first"), + localChatTab->chatLog(_("Equip arrows first."), BY_SERVER); break; default: @@ -513,12 +513,12 @@ void PlayerHandler::respawn() outMsg.writeInt8(0); } -void PlayerHandler::ingorePlayer(const std::string &player, bool ignore) +void PlayerHandler::ignorePlayer(const std::string &player, bool ignore) { // TODO } -void PlayerHandler::ingoreAll(bool ignore) +void PlayerHandler::ignoreAll(bool ignore) { // TODO } diff --git a/src/net/ea/playerhandler.h b/src/net/ea/playerhandler.h index 94ae952f..808cd0ec 100644 --- a/src/net/ea/playerhandler.h +++ b/src/net/ea/playerhandler.h @@ -53,9 +53,9 @@ class PlayerHandler : public MessageHandler, public Net::PlayerHandler void respawn(); - void ingorePlayer(const std::string &player, bool ignore); + void ignorePlayer(const std::string &player, bool ignore); - void ingoreAll(bool ignore); + void ignoreAll(bool ignore); }; } // namespace EAthena diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp index 74722332..4f045573 100644 --- a/src/net/ea/tradehandler.cpp +++ b/src/net/ea/tradehandler.cpp @@ -38,6 +38,7 @@ #include "gui/widgets/chattab.h" #include "utils/gettext.h" +#include "utils/stringutils.h" std::string tradePartnerName; @@ -88,7 +89,8 @@ void TradeHandler::handleMessage(MessageIn &msg) // special message about the player being occupied. tradePartnerName = msg.readString(24); - if (player_relations.hasPermission(tradePartnerName, PlayerRelation::TRADE)) + if (player_relations.hasPermission(tradePartnerName, + PlayerRelation::TRADE)) { if (!player_node->tradeRequestOk()) { @@ -98,9 +100,9 @@ void TradeHandler::handleMessage(MessageIn &msg) player_node->setTrading(true); ConfirmDialog *dlg; - dlg = new ConfirmDialog(_("Request for trade"), - tradePartnerName + - _(" wants to trade with you, do you accept?")); + dlg = new ConfirmDialog(_("Request for Trade"), + strprintf(_("%s wants to trade with you, do you " + "accept?"), tradePartnerName.c_str())); dlg->addActionListener(&listener); } else @@ -114,35 +116,36 @@ void TradeHandler::handleMessage(MessageIn &msg) switch (msg.readInt8()) { case 0: // Too far away - localChatTab->chatLog(_("Trading isn't possible. Trade partner is too far away."), - BY_SERVER); + localChatTab->chatLog(_("Trading isn't possible. Trade " + "partner is too far away."), BY_SERVER); break; case 1: // Character doesn't exist - localChatTab->chatLog(_("Trading isn't possible. Character doesn't exist."), - BY_SERVER); + localChatTab->chatLog(_("Trading isn't possible. Character " + "doesn't exist."), BY_SERVER); break; case 2: // Invite request check failed... - localChatTab->chatLog(_("Trade cancelled due to an unknown reason."), - BY_SERVER); + localChatTab->chatLog(_("Trade cancelled due to an unknown " + "reason."), BY_SERVER); break; case 3: // Trade accepted tradeWindow->reset(); - tradeWindow->setCaption( - _("Trade: You and ") + tradePartnerName); + tradeWindow->setCaption(strprintf(_("Trade: You and %s"), + tradePartnerName.c_str())); tradeWindow->setVisible(true); break; case 4: // Trade cancelled if (player_relations.hasPermission(tradePartnerName, PlayerRelation::SPEECH_LOG)) - localChatTab->chatLog(_("Trade with ") + tradePartnerName + - _(" cancelled"), BY_SERVER); + localChatTab->chatLog(strprintf(_("Trade with %s " + "cancelled."), tradePartnerName.c_str()), + BY_SERVER); // otherwise ignore silently tradeWindow->setVisible(false); player_node->setTrading(false); break; default: // Shouldn't happen as well, but to be sure - localChatTab->chatLog(_("Unhandled trade cancel packet"), + localChatTab->chatLog(_("Unhandled trade cancel packet."), BY_SERVER); break; } @@ -192,17 +195,17 @@ void TradeHandler::handleMessage(MessageIn &msg) break; case 1: // Add item failed - player overweighted - localChatTab->chatLog(_("Failed adding item. Trade partner is over weighted."), - BY_SERVER); + localChatTab->chatLog(_("Failed adding item. Trade " + "partner is over weighted."), BY_SERVER); break; case 2: // Add item failed - player has no free slot - localChatTab->chatLog(_("Failed adding item. Trade partner has no free slot."), - BY_SERVER); + localChatTab->chatLog(_("Failed adding item. Trade " + "partner has no free slot."), BY_SERVER); break; default: - localChatTab->chatLog(_("Failed adding item for unknown reason."), - BY_SERVER); + localChatTab->chatLog(_("Failed adding item for " + "unknown reason."), BY_SERVER); break; } } diff --git a/src/net/playerhandler.h b/src/net/playerhandler.h index 0998da04..df49756d 100644 --- a/src/net/playerhandler.h +++ b/src/net/playerhandler.h @@ -49,9 +49,9 @@ class PlayerHandler virtual void respawn() = 0; - virtual void ingorePlayer(const std::string &player, bool ignore) = 0; + virtual void ignorePlayer(const std::string &player, bool ignore) = 0; - virtual void ingoreAll(bool ignore) = 0; + virtual void ignoreAll(bool ignore) = 0; }; } // namespace Net diff --git a/src/net/tmwserv/chathandler.cpp b/src/net/tmwserv/chathandler.cpp index 41dc7bee..e2d09534 100644 --- a/src/net/tmwserv/chathandler.cpp +++ b/src/net/tmwserv/chathandler.cpp @@ -43,11 +43,12 @@ #include "gui/chat.h" #include "gui/guildwindow.h" +#include "utils/gettext.h" +#include "utils/stringutils.h" + #include #include -#include "utils/gettext.h" - extern Being *player_node; Net::ChatHandler *chatHandler; @@ -154,7 +155,7 @@ void ChatHandler::handleEnterChannelResponse(MessageIn &msg) Channel *channel = new Channel(channelId, channelName, announcement); channelManager->addChannel(channel); ChatTab *tab = channel->getTab(); - tab->chatLog(_("Topic: ") + announcement, BY_CHANNEL); + tab->chatLog(strprintf(_("Topic: %s"), announcement.c_str()), BY_CHANNEL); std::string user; std::string userModes; @@ -175,13 +176,13 @@ void ChatHandler::handleEnterChannelResponse(MessageIn &msg) } else { - localChatTab->chatLog("Error joining channel", BY_SERVER); + localChatTab->chatLog("Error joining channel.", BY_SERVER); } } void ChatHandler::handleListChannelsResponse(MessageIn &msg) { - localChatTab->chatLog("Listing Channels", BY_SERVER); + localChatTab->chatLog("Listing channels", BY_SERVER); while(msg.getUnreadLength()) { std::string channelName = msg.readString(); @@ -193,7 +194,7 @@ void ChatHandler::handleListChannelsResponse(MessageIn &msg) channelName += numUsers.str(); localChatTab->chatLog(channelName, BY_SERVER); } - localChatTab->chatLog("End of channel list", BY_SERVER); + localChatTab->chatLog("End of channel list.", BY_SERVER); } void ChatHandler::handlePrivateMessage(MessageIn &msg) diff --git a/src/net/tmwserv/guildhandler.cpp b/src/net/tmwserv/guildhandler.cpp index 92057e6e..8d078740 100644 --- a/src/net/tmwserv/guildhandler.cpp +++ b/src/net/tmwserv/guildhandler.cpp @@ -37,6 +37,9 @@ #include "channel.h" #include "channelmanager.h" +#include "utils/gettext.h" +#include "utils/stringutils.h" + #include namespace TmwServ { @@ -68,12 +71,12 @@ void GuildHandler::handleMessage(MessageIn &msg) if(msg.readInt8() == ERRMSG_OK) { // TODO - Acknowledge guild was created - localChatTab->chatLog("Guild created."); + localChatTab->chatLog(_("Guild created.")); joinedGuild(msg); } else { - localChatTab->chatLog("Error creating guild."); + localChatTab->chatLog(_("Error creating guild.")); } } break; @@ -83,7 +86,7 @@ void GuildHandler::handleMessage(MessageIn &msg) if(msg.readInt8() == ERRMSG_OK) { // TODO - Acknowledge invite was sent - localChatTab->chatLog("Invite sent."); + localChatTab->chatLog(_("Invite sent.")); } } break; @@ -144,7 +147,8 @@ void GuildHandler::handleMessage(MessageIn &msg) { case GUILD_EVENT_NEW_PLAYER: guild->addMember(guildMember); - guildWindow->setOnline(guild->getName(), guildMember, true); + guildWindow->setOnline(guild->getName(), guildMember, + true); break; case GUILD_EVENT_LEAVING_PLAYER: @@ -152,11 +156,13 @@ void GuildHandler::handleMessage(MessageIn &msg) break; case GUILD_EVENT_ONLINE_PLAYER: - guildWindow->setOnline(guild->getName(), guildMember, true); + guildWindow->setOnline(guild->getName(), guildMember, + true); break; case GUILD_EVENT_OFFLINE_PLAYER: - guildWindow->setOnline(guild->getName(), guildMember, false); + guildWindow->setOnline(guild->getName(), guildMember, + false); break; default: @@ -185,12 +191,12 @@ void GuildHandler::handleMessage(MessageIn &msg) if (msg.readInt8() == ERRMSG_OK) { // promotion succeeded - localChatTab->chatLog("Member was promoted successfully"); + localChatTab->chatLog(_("Member was promoted successfully.")); } else { // promotion failed - localChatTab->chatLog("Failed to promote member"); + localChatTab->chatLog(_("Failed to promote member.")); } } @@ -241,7 +247,8 @@ void GuildHandler::joinedGuild(MessageIn &msg) // COMMENT: Should this go here?? Channel *channel = new Channel(channelId, guildName, announcement); channelManager->addChannel(channel); - channel->getTab()->chatLog("Topic: " + announcement, BY_CHANNEL); + channel->getTab()->chatLog(strprintf(_("Topic: %s"), announcement.c_str()), + BY_CHANNEL); } } // namespace TmwServ diff --git a/src/net/tmwserv/partyhandler.cpp b/src/net/tmwserv/partyhandler.cpp index 47ef791c..557a3a43 100644 --- a/src/net/tmwserv/partyhandler.cpp +++ b/src/net/tmwserv/partyhandler.cpp @@ -35,6 +35,9 @@ #include "log.h" #include "localplayer.h" +#include "utils/gettext.h" +#include "utils/stringutils.h" + #include Net::PartyHandler *partyHandler; @@ -80,7 +83,7 @@ void PartyHandler::handleMessage(MessageIn &msg) if (msg.readInt8() == ERRMSG_OK) { player_node->setInParty(true); - localChatTab->chatLog("Joined party"); + localChatTab->chatLog(_("Joined party.")); } } @@ -97,7 +100,8 @@ void PartyHandler::handleMessage(MessageIn &msg) int id = msg.readInt16(); // being id std::string name = msg.readString(); - localChatTab->chatLog(name + " joined the party"); + localChatTab->chatLog(strprintf(_("%s joined the " + "party."), name.c_str())); if (!player_node->isInParty()) player_node->setInParty(true); diff --git a/src/net/tmwserv/playerhandler.cpp b/src/net/tmwserv/playerhandler.cpp index b697e8a8..931e4294 100644 --- a/src/net/tmwserv/playerhandler.cpp +++ b/src/net/tmwserv/playerhandler.cpp @@ -284,7 +284,7 @@ void PlayerHandler::handleMessage(MessageIn &msg) switch (type) { case 0: - localChatTab->chatLog("Equip arrows first", + localChatTab->chatLog(_("Equip arrows first."), BY_SERVER); break; default: @@ -391,12 +391,12 @@ void PlayerHandler::respawn() // TODO } -void PlayerHandler::ingorePlayer(const std::string &player, bool ignore) +void PlayerHandler::ignorePlayer(const std::string &player, bool ignore) { // TODO } -void PlayerHandler::ingoreAll(bool ignore) +void PlayerHandler::ignoreAll(bool ignore) { // TODO } diff --git a/src/net/tmwserv/playerhandler.h b/src/net/tmwserv/playerhandler.h index 5524415e..13ae8f39 100644 --- a/src/net/tmwserv/playerhandler.h +++ b/src/net/tmwserv/playerhandler.h @@ -52,9 +52,9 @@ class PlayerHandler : public MessageHandler, public Net::PlayerHandler void respawn(); - void ingorePlayer(const std::string &player, bool ignore); + void ignorePlayer(const std::string &player, bool ignore); - void ingoreAll(bool ignore); + void ignoreAll(bool ignore); private: void handleMapChangeMessage(MessageIn &msg); diff --git a/src/net/tmwserv/tradehandler.cpp b/src/net/tmwserv/tradehandler.cpp index 74789a34..aabd8b2a 100644 --- a/src/net/tmwserv/tradehandler.cpp +++ b/src/net/tmwserv/tradehandler.cpp @@ -40,6 +40,9 @@ #include "gui/widgets/chattab.h" +#include "utils/gettext.h" +#include "utils/stringutils.h" + std::string tradePartnerName; int tradePartnerID; @@ -87,9 +90,9 @@ void TradeHandler::setAcceptTradeRequests(bool acceptTradeRequests) { mAcceptTradeRequests = acceptTradeRequests; if (mAcceptTradeRequests) { - localChatTab->chatLog("Accepting incoming trade requests", BY_SERVER); + localChatTab->chatLog(_("Accepting incoming trade requests."), BY_SERVER); } else { - localChatTab->chatLog("Ignoring incoming trade requests", BY_SERVER); + localChatTab->chatLog(_("Ignoring incoming trade requests."), BY_SERVER); } } @@ -108,8 +111,9 @@ void TradeHandler::handleMessage(MessageIn &msg) player_node->setTrading(true); tradePartnerName = being->getName(); tradePartnerID = being->getId(); - ConfirmDialog *dlg = new ConfirmDialog("Request for trade", - tradePartnerName + " wants to trade with you, do you accept?"); + ConfirmDialog *dlg = new ConfirmDialog(_("Request for Trade"), + strprintf(_("%s wants to trade with you, do you accept?"), + tradePartnerName.c_str())); dlg->addActionListener(&listener); } break; @@ -126,7 +130,8 @@ void TradeHandler::handleMessage(MessageIn &msg) case GPMSG_TRADE_START: tradeWindow->reset(); - tradeWindow->setCaption("Trading with " + tradePartnerName); + tradeWindow->setCaption(strprintf(_("Trading with %s"), + tradePartnerName.c_str())); tradeWindow->setVisible(true); break; @@ -139,14 +144,14 @@ void TradeHandler::handleMessage(MessageIn &msg) break; case GPMSG_TRADE_CANCEL: - localChatTab->chatLog("Trade canceled.", BY_SERVER); + localChatTab->chatLog(_("Trade canceled."), BY_SERVER); tradeWindow->setVisible(false); tradeWindow->reset(); player_node->setTrading(false); break; case GPMSG_TRADE_COMPLETE: - localChatTab->chatLog("Trade completed.", BY_SERVER); + localChatTab->chatLog(_("Trade completed."), BY_SERVER); tradeWindow->setVisible(false); tradeWindow->reset(); player_node->setTrading(false); diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 5dda2bfd..a8a0681d 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -109,7 +109,7 @@ void ItemDB::load() mUnknown->setSprite("error.xml", GENDER_MALE); mUnknown->setSprite("error.xml", GENDER_FEMALE); - XML::Document doc(_("items.xml")); + XML::Document doc("items.xml"); xmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "items")) diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index 7bbf9288..0c28586a 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -46,7 +46,7 @@ void MonsterDB::load() logger->log("Initializing monster database..."); - XML::Document doc(_("monsters.xml")); + XML::Document doc("monsters.xml"); xmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "monsters")) -- cgit v1.2.3-70-g09d2 From 76447e2d971a143f266401b2a7f7ecb88bf5da97 Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Sat, 23 May 2009 01:17:23 +0200 Subject: Reorganized status window and used non-bold font for progress bars to make more space for the numbers on the exp bar (cherry picked from commit addbb9bd9362550e91540c1caaf7f6683bdae9a8) --- src/gui/status.cpp | 18 +++++++++--------- src/gui/widgets/progressbar.cpp | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/gui') diff --git a/src/gui/status.cpp b/src/gui/status.cpp index 7fc42fdb..eca01725 100644 --- a/src/gui/status.cpp +++ b/src/gui/status.cpp @@ -125,17 +125,17 @@ StatusWindow::StatusWindow(LocalPlayer *player): place(0, 0, mLvlLabel, 3); place(5, 0, mJobLvlLabel, 3); place(8, 0, mGpLabel, 3); - place(1, 1, mHpLabel).setPadding(3); - place(2, 1, mHpBar, 3); - place(6, 1, mXpLabel).setPadding(3); - place(7, 1, mXpBar, 3); - place(1, 2, mMpLabel).setPadding(3); - place(2, 2, mMpBar, 3); - place(6, 2, mJobLabel).setPadding(3); - place(7, 2, mJobBar, 3); + place(0, 1, mHpLabel).setPadding(3); + place(1, 1, mHpBar, 4); + place(5, 1, mXpLabel).setPadding(3); + place(6, 1, mXpBar, 5); + place(0, 2, mMpLabel).setPadding(3); + place(1, 2, mMpBar, 4); + place(5, 2, mJobLabel).setPadding(3); + place(6, 2, mJobBar, 5); place.getCell().matchColWidth(0, 1); place = getPlacer(0, 3); - place(0, 0, mStatsTitleLabel, 5); + place(0, 1, mStatsTitleLabel, 5); place(5, 1, mStatsTotalLabel, 5); place(12, 1, mStatsCostLabel, 5); for (int i = 0; i < 6; i++) diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp index c673ffb3..134d071f 100644 --- a/src/gui/widgets/progressbar.cpp +++ b/src/gui/widgets/progressbar.cpp @@ -151,7 +151,7 @@ void ProgressBar::draw(gcn::Graphics *graphics) TextRenderer::renderText(graphics, mText, textX, textY, gcn::Graphics::CENTER, guiPalette->getColor(Palette::PROGRESS_BAR), - boldFont, true, false); + gui->getFont(), true, false); } } -- cgit v1.2.3-70-g09d2 From fbbd4c406bf95ef8591f7368baacfad6f4d3f30f Mon Sep 17 00:00:00 2001 From: Dennis Friis Date: Sat, 23 May 2009 21:37:09 +0200 Subject: Fix resetting height of browserbox on /clear. Patch by QOAL (cherry picked from commit cc2cd67e1c3c3f95485ae4477b6a2f0d255e9163) --- src/gui/widgets/browserbox.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gui') diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index a03d53eb..e4f0774b 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -212,6 +212,7 @@ void BrowserBox::clearRows() mTextRows.clear(); mLinks.clear(); setWidth(0); + setHeight(0); mSelectedLink = -1; } -- cgit v1.2.3-70-g09d2