From d268447e18c6e3edd80658f8f8d4317740c33af9 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Tue, 10 Feb 2009 20:09:33 -0700 Subject: Fixed header files, as well as removed the unused buddy list class (not useful since buddy lists are tracked through the player relation interface instead) Signed-off-by: Ira Rice --- src/game.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/game.cpp') diff --git a/src/game.cpp b/src/game.cpp index f8903ed2..99888c73 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2004 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by -- cgit v1.2.3-70-g09d2 From d99b00a149e7828adb3c4651069483e51b0b458b Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Wed, 11 Feb 2009 00:01:36 +0100 Subject: Removed many pointless comparisons with NULL Sometimes it's nice for clarity, but most of the time this is just clutter. C++ != Java. :) --- src/being.cpp | 8 ++++---- src/game.cpp | 4 ++-- src/gui/focushandler.cpp | 2 +- src/gui/playerbox.cpp | 2 +- src/gui/popupmenu.cpp | 34 ++++++++++------------------------ src/gui/radiobutton.cpp | 2 +- src/gui/scrollarea.cpp | 2 +- src/gui/table.cpp | 4 ++-- src/gui/truetypefont.cpp | 2 +- src/gui/updatewindow.cpp | 4 ++-- src/gui/widgets/tabbedarea.cpp | 2 +- src/net/partyhandler.cpp | 2 +- src/resources/resourcemanager.cpp | 2 +- src/simpleanimation.cpp | 2 +- src/sound.cpp | 8 ++++---- 15 files changed, 33 insertions(+), 47 deletions(-) (limited to 'src/game.cpp') diff --git a/src/being.cpp b/src/being.cpp index 1acbdb50..7a7f3df7 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -344,8 +344,8 @@ void Being::setDirection(Uint8 direction) for (int i = 0; i < VECTOREND_SPRITE; i++) { - if (mSprites[i] != NULL) - mSprites[i]->setDirection(dir); + if (mSprites[i]) + mSprites[i]->setDirection(dir); } } @@ -446,7 +446,7 @@ void Being::logic() for (int i = 0; i < VECTOREND_SPRITE; i++) { - if (mSprites[i] != NULL) + if (mSprites[i]) mSprites[i]->update(tick_time * 10); } @@ -468,7 +468,7 @@ void Being::draw(Graphics *graphics, int offsetX, int offsetY) const for (int i = 0; i < VECTOREND_SPRITE; i++) { - if (mSprites[i] != NULL) + if (mSprites[i]) { mSprites[i]->draw(graphics, px, py); } diff --git a/src/game.cpp b/src/game.cpp index 99888c73..9552c2ef 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -516,8 +516,8 @@ void Game::handleInput() { // Input chat window if (!(chatWindow->isInputFocused() || - deathNotice != NULL || - weightNotice != NULL)) + deathNotice || + weightNotice)) { // Quit by pressing Enter if the exit confirm is there if (exitConfirm && diff --git a/src/gui/focushandler.cpp b/src/gui/focushandler.cpp index cb52ae9f..c642127d 100644 --- a/src/gui/focushandler.cpp +++ b/src/gui/focushandler.cpp @@ -27,7 +27,7 @@ void FocusHandler::requestModalFocus(gcn::Widget *widget) /* If there is another widget with modal focus, remove its modal focus * and put it on the modal widget stack. */ - if (mModalFocusedWidget != NULL && mModalFocusedWidget != widget) + if (mModalFocusedWidget && mModalFocusedWidget != widget) { mModalStack.push_front(mModalFocusedWidget); mModalFocusedWidget = NULL; diff --git a/src/gui/playerbox.cpp b/src/gui/playerbox.cpp index e05288cc..e7ee3afe 100644 --- a/src/gui/playerbox.cpp +++ b/src/gui/playerbox.cpp @@ -88,7 +88,7 @@ void PlayerBox::draw(gcn::Graphics *graphics) y = getHeight() / 2 + bs; for (int i = 0; i < Being::VECTOREND_SPRITE; i++) { - if (mPlayer->getSprite(i) != NULL) + if (mPlayer->getSprite(i)) { mPlayer->getSprite(i)->draw(static_cast(graphics), x, y); } diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index d10faa0d..7f82d1b5 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -145,55 +145,42 @@ void PopupMenu::showPopup(int x, int y, FloorItem *floorItem) void PopupMenu::handleLink(const std::string& link) { // Talk To action - if (link == "talk" && - mBeing != NULL && - mBeing->getType() == Being::NPC && + if (link == "talk" && mBeing && mBeing->getType() == Being::NPC && current_npc == 0) { dynamic_cast(mBeing)->talk(); } // Trade action - else if (link == "trade" && - mBeing != NULL && - mBeing->getType() == Being::PLAYER) + else if (link == "trade" && mBeing && mBeing->getType() == Being::PLAYER) { player_node->trade(mBeing); tradePartnerName = mBeing->getName(); } // Attack action - else if (link == "attack" && - mBeing != NULL && - mBeing->getType() == Being::PLAYER) + else if (link == "attack" && mBeing && mBeing->getType() == Being::PLAYER) { player_node->attack(mBeing, true); } - else if (link == "unignore" && - mBeing != NULL && - mBeing->getType() == Being::PLAYER) + else if (link == "unignore" && mBeing && mBeing->getType() == Being::PLAYER) { player_relations.setRelation(mBeing->getName(), PlayerRelation::NEUTRAL); } - else if (link == "ignore" && - mBeing != NULL && - mBeing->getType() == Being::PLAYER) + else if (link == "ignore" && mBeing && mBeing->getType() == Being::PLAYER) { player_relations.setRelation(mBeing->getName(), PlayerRelation::IGNORED); } - else if (link == "disregard" && - mBeing != NULL && + else if (link == "disregard" && mBeing && mBeing->getType() == Being::PLAYER) { player_relations.setRelation(mBeing->getName(), PlayerRelation::DISREGARDED); } - else if (link == "friend" && - mBeing != NULL && - mBeing->getType() == Being::PLAYER) + else if (link == "friend" && mBeing && mBeing->getType() == Being::PLAYER) { player_relations.setRelation(mBeing->getName(), PlayerRelation::FRIEND); } @@ -206,7 +193,7 @@ void PopupMenu::handleLink(const std::string& link) /* // Add Buddy action - else if ((link == "buddy") && mBeing != NULL && mBeing->isPlayer()) + else if ((link == "buddy") && mBeing && mBeing->isPlayer()) { if (!buddyWindow->isVisible()) buddyWindow->setVisible(true); @@ -215,7 +202,7 @@ void PopupMenu::handleLink(const std::string& link) }*/ // Pick Up Floor Item action - else if ((link == "pickup") && mFloorItem != NULL) + else if ((link == "pickup") && mFloorItem) { player_node->pickUp(mFloorItem); } @@ -254,8 +241,7 @@ void PopupMenu::handleLink(const std::string& link) { new ItemAmountWindow(AMOUNT_ITEM_DROP, inventoryWindow, mItem); } - else if (link == "party-invite" && - mBeing != NULL && + else if (link == "party-invite" && mBeing && mBeing->getType() == Being::PLAYER) { MessageOut outMsg(player_node->getNetwork()); diff --git a/src/gui/radiobutton.cpp b/src/gui/radiobutton.cpp index 2e48f78a..a8ab61c4 100644 --- a/src/gui/radiobutton.cpp +++ b/src/gui/radiobutton.cpp @@ -93,7 +93,7 @@ void RadioButton::drawBox(gcn::Graphics* graphics) else box = radioDisabled; - if (box != NULL) + if (box) static_cast(graphics)->drawImage(box, 2, 2); } diff --git a/src/gui/scrollarea.cpp b/src/gui/scrollarea.cpp index 4c225e81..d655ad52 100644 --- a/src/gui/scrollarea.cpp +++ b/src/gui/scrollarea.cpp @@ -154,7 +154,7 @@ void ScrollArea::logic() // When no scrollbar in a certain direction, adapt content size to match // the content dimension exactly. - if (content != NULL) + if (content) { if (getHorizontalScrollPolicy() == gcn::ScrollArea::SHOW_NEVER) { diff --git a/src/gui/table.cpp b/src/gui/table.cpp index 425c5b6f..b79d43cf 100644 --- a/src/gui/table.cpp +++ b/src/gui/table.cpp @@ -186,7 +186,7 @@ int GuiTable::getColumnWidth(int i) void GuiTable::setSelectedRow(int selected) { - if (mModel == NULL) + if (!mModel) { mSelectedRow = -1; } @@ -214,7 +214,7 @@ void GuiTable::setSelectedRow(int selected) void GuiTable::setSelectedColumn(int selected) { - if (mModel == NULL) + if (!mModel) { mSelectedColumn = -1; } diff --git a/src/gui/truetypefont.cpp b/src/gui/truetypefont.cpp index a92e0dab..24c60caf 100644 --- a/src/gui/truetypefont.cpp +++ b/src/gui/truetypefont.cpp @@ -89,7 +89,7 @@ TrueTypeFont::TrueTypeFont(const std::string& filename, int size) ++fontCounter; mFont = TTF_OpenFont(filename.c_str(), size); - if (mFont == NULL) + if (!mFont) { throw GCN_EXCEPTION("SDLTrueTypeFont::SDLTrueTypeFont: " + std::string(TTF_GetError())); diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp index 29e7e763..5a6f3f28 100644 --- a/src/gui/updatewindow.cpp +++ b/src/gui/updatewindow.cpp @@ -206,7 +206,7 @@ void UpdaterWindow::loadNews() // Tokenize and add each line separately char *line = strtok(mMemoryBuffer, "\n"); - while (line != NULL) + while (line) { mBrowserBox->addRow(line); line = strtok(NULL, "\n"); @@ -409,7 +409,7 @@ void UpdaterWindow::download() mDownloadComplete = false; mThread = SDL_CreateThread(UpdaterWindow::downloadThread, this); - if (mThread == NULL) + if (!mThread) { logger->log(_("Unable to create mThread")); mDownloadStatus = UPDATE_ERROR; diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index f0d719c6..aaa3463f 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -91,7 +91,7 @@ void TabbedArea::addTab(Tab *tab, gcn::Widget *widget) mTabContainer->add(tab); mTabs.push_back(std::pair(tab, widget)); - if (mSelectedTab == NULL) + if (!mSelectedTab) { setSelectedTab(tab); } diff --git a/src/net/partyhandler.cpp b/src/net/partyhandler.cpp index 3378a5d0..b65ff2c9 100644 --- a/src/net/partyhandler.cpp +++ b/src/net/partyhandler.cpp @@ -69,7 +69,7 @@ void PartyHandler::handleMessage(MessageIn *msg) { int id = msg->readInt32(); Being *being = beingManager->findBeing(id); - if (being == NULL) + if (!being) { break; } diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index fcd9495f..d6ab39a0 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -160,7 +160,7 @@ void ResourceManager::searchAndAddArchives(const std::string &path, const char *dirSep = PHYSFS_getDirSeparator(); char **list = PHYSFS_enumerateFiles(path.c_str()); - for (char **i = list; *i != NULL; i++) + for (char **i = list; *i; i++) { size_t len = strlen(*i); diff --git a/src/simpleanimation.cpp b/src/simpleanimation.cpp index 09e8e0d3..ab50674b 100644 --- a/src/simpleanimation.cpp +++ b/src/simpleanimation.cpp @@ -51,7 +51,7 @@ SimpleAnimation::SimpleAnimation(xmlNodePtr animationNode): // Get animation frames for ( xmlNodePtr frameNode = animationNode->xmlChildrenNode; - frameNode != NULL; + frameNode; frameNode = frameNode->next) { int delay = XML::getProperty(frameNode, "delay", 0); diff --git a/src/sound.cpp b/src/sound.cpp index 083ffb6a..5b8dedef 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -129,7 +129,7 @@ void Sound::playMusic(const std::string &filename, int loop) { if (!mInstalled) return; - if (mMusic != NULL) { + if (mMusic) { stopMusic(); } @@ -155,7 +155,7 @@ void Sound::stopMusic() logger->log("Sound::stopMusic()"); - if (mMusic != NULL) { + if (mMusic) { Mix_HaltMusic(); Mix_FreeMusic(mMusic); mMusic = NULL; @@ -166,7 +166,7 @@ void Sound::fadeInMusic(const std::string &path, int loop, int ms) { if (!mInstalled) return; - if (mMusic != NULL) { + if (mMusic) { stopMusic(); } @@ -189,7 +189,7 @@ void Sound::fadeOutMusic(int ms) logger->log("Sound::fadeOutMusic() Fading-out (%i ms)", ms); - if (mMusic != NULL) { + if (mMusic) { Mix_FadeOutMusic(ms); Mix_FreeMusic(mMusic); mMusic = NULL; -- cgit v1.2.3-70-g09d2 From 4f038e895499fcf94fec168ef964f7de4f813113 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Tue, 10 Feb 2009 22:54:14 +0100 Subject: Whitespace fixes Mainly removed trailing whitespace. Also small fix in header of recorder.cpp. --- src/effectmanager.h | 2 +- src/game.cpp | 6 +++--- src/gui/itempopup.cpp | 6 +++--- src/gui/minimap.cpp | 2 +- src/gui/recorder.cpp | 7 +++---- src/gui/setup_players.cpp | 2 +- src/gui/setup_players.h | 5 +++-- src/gui/shortcutwindow.cpp | 2 +- src/gui/status.cpp | 2 +- src/gui/widgets/tab.cpp | 10 +++++----- src/keyboardconfig.cpp | 4 ++-- 11 files changed, 24 insertions(+), 24 deletions(-) (limited to 'src/game.cpp') diff --git a/src/effectmanager.h b/src/effectmanager.h index 0d694f4a..c69ade09 100644 --- a/src/effectmanager.h +++ b/src/effectmanager.h @@ -31,7 +31,7 @@ class Being; class EffectManager { - public: + public: struct EffectDescription { int id; diff --git a/src/game.cpp b/src/game.cpp index 9552c2ef..9b11fad2 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -548,9 +548,9 @@ void Game::handleInput() keyboard.isKeyActive(keyboard.KEY_OK)) npcIntegerDialog->action(gcn::ActionEvent(NULL, "ok")); else if (!(keyboard.getKeyValue( - KeyboardConfig::KEY_TOGGLE_CHAT) == + KeyboardConfig::KEY_TOGGLE_CHAT) == keyboard.getKeyValue( - KeyboardConfig::KEY_OK) && + KeyboardConfig::KEY_OK) && (npcStringDialog->isVisible() || npcTextDialog->isVisible() || npcListDialog->isVisible() || @@ -593,7 +593,7 @@ void Game::handleInput() break; // Quitting confirmation dialog case KeyboardConfig::KEY_QUIT: - if (!exitConfirm) + if (!exitConfirm) { exitConfirm = new ConfirmDialog( _("Quit"), _("Are you sure you " diff --git a/src/gui/itempopup.cpp b/src/gui/itempopup.cpp index f589286b..d13cd1c2 100644 --- a/src/gui/itempopup.cpp +++ b/src/gui/itempopup.cpp @@ -109,7 +109,7 @@ void ItemPopup::setItem(const ItemInfo &item) mItemName->setWidth(boldFont->getWidth(item.getName())); mItemDesc->setTextWrapped(item.getDescription(), 196); mItemEffect->setTextWrapped(item.getEffect(), 196); - mItemWeight->setTextWrapped(_("Weight: ") + toString(item.getWeight()) + + mItemWeight->setTextWrapped(_("Weight: ") + toString(item.getWeight()) + _(" grams"), 196); int minWidth = mItemName->getWidth(); @@ -139,7 +139,7 @@ void ItemPopup::setItem(const ItemInfo &item) if (item.getEffect().empty()) { - setContentSize(minWidth, (numRowsDesc * getFont()->getHeight() + + setContentSize(minWidth, (numRowsDesc * getFont()->getHeight() + (3 * getFont()->getHeight()))); mItemWeightScroll->setPosition(2, @@ -148,7 +148,7 @@ void ItemPopup::setItem(const ItemInfo &item) } else { - setContentSize(minWidth, (numRowsDesc * getFont()->getHeight()) + + setContentSize(minWidth, (numRowsDesc * getFont()->getHeight()) + (numRowsEffect * getFont()->getHeight()) + (3 * getFont()->getHeight())); diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp index 5c52b38e..80c95dd7 100644 --- a/src/gui/minimap.cpp +++ b/src/gui/minimap.cpp @@ -76,7 +76,7 @@ void Minimap::setMapImage(Image *img) setMinWidth(mapWidth > titleWidth ? mapWidth : titleWidth); setMinHeight(mapHeight); - setMaxWidth(mMapImage->getWidth() > titleWidth ? + setMaxWidth(mMapImage->getWidth() > titleWidth ? mMapImage->getWidth() + offsetX : titleWidth); setMaxHeight(mMapImage->getHeight() + offsetY); diff --git a/src/gui/recorder.cpp b/src/gui/recorder.cpp index 032b9790..982d808d 100644 --- a/src/gui/recorder.cpp +++ b/src/gui/recorder.cpp @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -40,7 +40,7 @@ Recorder::Recorder(ChatWindow *chat, const std::string &title, mChat = chat; Button *button = new Button(buttonTxt, "activate", this); - setDefaultSize(0, windowContainer->getHeight() - 123 - button->getHeight() - + setDefaultSize(0, windowContainer->getHeight() - 123 - button->getHeight() - offsetY, button->getWidth() + offsetX, button->getHeight() + offsetY); @@ -99,7 +99,7 @@ void Recorder::changeRecordingStatus(const std::string &msg) */ mChat->chatLog(_("Starting to record..."), BY_SERVER); std::string file = std::string(PHYSFS_getUserDir()) + "/.aethyra/" + msgCopy; - + mStream.open(file.c_str(), std::ios_base::trunc); if (mStream.is_open()) @@ -113,4 +113,3 @@ void Recorder::action(const gcn::ActionEvent &event) { changeRecordingStatus(""); } - diff --git a/src/gui/setup_players.cpp b/src/gui/setup_players.cpp index 0ea6d167..d9dc47c8 100644 --- a/src/gui/setup_players.cpp +++ b/src/gui/setup_players.cpp @@ -241,7 +241,7 @@ Setup_Players::Setup_Players(): mIgnoreActionChoicesBox = new DropDown(ignoreChoices, new ScrollArea(), new ListBox(ignoreChoices), false); - for (int i = 0; i < COLUMNS_NR; i++) + for (int i = 0; i < COLUMNS_NR; i++) { mPlayerTableTitleModel->set(0, i, new gcn::Label(gettext(table_titles[i]))); diff --git a/src/gui/setup_players.h b/src/gui/setup_players.h index 07f70b00..46eae0db 100644 --- a/src/gui/setup_players.h +++ b/src/gui/setup_players.h @@ -32,8 +32,9 @@ class GuiTable; class PlayerTableModel; class StaticTableModel; -class Setup_Players : public SetupTab, - public gcn::ActionListener, public PlayerRelationsListener +class Setup_Players : public SetupTab, + public gcn::ActionListener, + public PlayerRelationsListener { public: Setup_Players(); diff --git a/src/gui/shortcutwindow.cpp b/src/gui/shortcutwindow.cpp index 754b410a..cd9bc65f 100644 --- a/src/gui/shortcutwindow.cpp +++ b/src/gui/shortcutwindow.cpp @@ -51,7 +51,7 @@ ShortcutWindow::ShortcutWindow(const char *title, ShortcutContainer *content) const int width = (int) config.getValue("screenwidth", 800); const int height = (int) config.getValue("screenheight", 600); - setDefaultSize(width - (mInstances * mItems->getBoxWidth()) - + setDefaultSize(width - (mInstances * mItems->getBoxWidth()) - (mInstances * border), height - (mItems->getBoxHeight() * mItems->getMaxItems()) - border, mItems->getBoxWidth() + border, (mItems->getBoxHeight() * mItems->getMaxItems()) + diff --git a/src/gui/status.cpp b/src/gui/status.cpp index 5547b996..42a48b2f 100644 --- a/src/gui/status.cpp +++ b/src/gui/status.cpp @@ -130,7 +130,7 @@ StatusWindow::StatusWindow(LocalPlayer *player): place(0, 0, mStatsTitleLabel, 5); place(5, 1, mStatsTotalLabel, 5); place(12, 1, mStatsCostLabel, 5); - for(int i = 0; i < 6; i++) + for (int i = 0; i < 6; i++) { place(0, 2 + i, mStatsLabel[i], 7).setPadding(5); place(7, 2 + i, mStatsDisplayLabel[i]).setPadding(5); diff --git a/src/gui/widgets/tab.cpp b/src/gui/widgets/tab.cpp index 1562e3f2..263e5bbd 100644 --- a/src/gui/widgets/tab.cpp +++ b/src/gui/widgets/tab.cpp @@ -52,10 +52,10 @@ struct TabData }; static TabData const data[TAB_COUNT] = { - {"graphics/gui/tab.png", 0, 0}, - {"graphics/gui/tab.png", 9, 4}, - {"graphics/gui/tabselected.png", 16, 19}, - {"graphics/gui/tab.png", 25, 23} + { "graphics/gui/tab.png", 0, 0 }, + { "graphics/gui/tab.png", 9, 4 }, + { "graphics/gui/tabselected.png", 16, 19 }, + { "graphics/gui/tab.png", 25, 23 } }; ImageRect Tab::tabImg[TAB_COUNT]; @@ -118,7 +118,7 @@ void Tab::draw(gcn::Graphics *graphics) // check which type of tab to draw if (mTabbedArea) { - if(mTabbedArea->isTabSelected(this)) + if (mTabbedArea->isTabSelected(this)) { mode = TAB_SELECTED; // if tab is selected, it doesnt need to highlight activity diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp index b75a3c1c..1976e803 100644 --- a/src/keyboardconfig.cpp +++ b/src/keyboardconfig.cpp @@ -151,8 +151,8 @@ bool KeyboardConfig::hasConflicts() for (j = i, j++; j < KEY_TOTAL; j++) { // Allow for item shortcut and emote keys to overlap, but no other keys - if (!((((i >= KEY_SHORTCUT_1) && (i <= KEY_SHORTCUT_12)) && - ((j >= KEY_EMOTE_1) && (j <= KEY_EMOTE_12))) || + if (!((((i >= KEY_SHORTCUT_1) && (i <= KEY_SHORTCUT_12)) && + ((j >= KEY_EMOTE_1) && (j <= KEY_EMOTE_12))) || ((i == KEY_TOGGLE_CHAT) && (j == KEY_OK))) && (mKey[i].value == mKey[j].value) ) -- cgit v1.2.3-70-g09d2 From 1ea7d80aff0961e6f55ee467b8cbe26d146828f8 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Tue, 10 Feb 2009 23:08:35 +0100 Subject: Don't make log statements translatable The log is mainly used to aid the developers, hence shouldn't be translated to the user's local language. Also introduces unnecessary work for all translators. --- po/POTFILES.in | 2 -- src/game.cpp | 10 +++++----- src/gui/register.cpp | 2 +- src/gui/setup_video.cpp | 4 ++-- src/gui/skill.cpp | 2 +- src/gui/updatewindow.cpp | 8 ++++---- src/main.cpp | 42 ++++++++++++++++++++++-------------------- src/net/playerhandler.cpp | 8 ++++---- src/resources/colordb.cpp | 11 +++++------ src/resources/emotedb.cpp | 9 ++++----- src/resources/itemdb.cpp | 16 ++++++++-------- src/resources/monsterdb.cpp | 23 ++++++++++++++--------- src/resources/npcdb.cpp | 6 +++--- 13 files changed, 73 insertions(+), 70 deletions(-) (limited to 'src/game.cpp') diff --git a/po/POTFILES.in b/po/POTFILES.in index 1b3dea84..9a2cf604 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -50,8 +50,6 @@ src/net/loginhandler.cpp src/net/maploginhandler.cpp src/net/playerhandler.cpp src/net/tradehandler.cpp -src/resources/colordb.cpp -src/resources/emotedb.cpp src/resources/itemdb.cpp src/resources/monsterdb.cpp src/resources/npcdb.cpp diff --git a/src/game.cpp b/src/game.cpp index 9b11fad2..bc0c86b5 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -389,7 +389,7 @@ static bool saveScreenshot() else { chatWindow->chatLog(_("Saving screenshot failed!"), BY_SERVER); - logger->log(_("Error: could not save screenshot.")); + logger->log("Error: could not save screenshot."); } SDL_FreeSurface(screenshot); @@ -595,9 +595,9 @@ void Game::handleInput() case KeyboardConfig::KEY_QUIT: if (!exitConfirm) { - exitConfirm = new ConfirmDialog( _("Quit"), - _("Are you sure you " - "want to quit?")); + exitConfirm = new ConfirmDialog(_("Quit"), + _("Are you sure you " + "want to quit?")); exitConfirm->addActionListener(&exitListener); exitConfirm->requestMoveToTop(); } @@ -774,7 +774,7 @@ void Game::handleInput() catch (gcn::Exception e) { const char* err = e.getMessage().c_str(); - logger->log(_("Warning: guichan input exception: %s"), err); + logger->log("Warning: guichan input exception: %s", err); } } } // End while diff --git a/src/gui/register.cpp b/src/gui/register.cpp index 50182de1..fd7df18d 100644 --- a/src/gui/register.cpp +++ b/src/gui/register.cpp @@ -153,7 +153,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) else if (event.getId() == "register" && canSubmit()) { const std::string user = mUserField->getText(); - logger->log(_("RegisterDialog::register Username is %s"), user.c_str()); + logger->log("RegisterDialog::register Username is %s", user.c_str()); std::string errorMsg; int error = 0; diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index 48bf63e7..bf5682e6 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -90,9 +90,9 @@ ModeListModel::ModeListModel() /* Check which modes are available */ if (modes == (SDL_Rect **)0) { - logger->log(_("No modes available")); + logger->log("No modes available"); } else if (modes == (SDL_Rect **)-1) { - logger->log(_("All resolutions available")); + logger->log("All resolutions available"); } else { //logger->log("Available Modes"); for (int i = 0; modes[i]; ++i) { diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp index 6c0414f3..42ac4d86 100644 --- a/src/gui/skill.cpp +++ b/src/gui/skill.cpp @@ -269,7 +269,7 @@ static void initSkillinfo(void) if (!root || !xmlStrEqual(root->name, BAD_CAST "skills")) { - logger->log(_("Error loading skills file: %s"), SKILLS_FILE); + logger->log("Error loading skills file: %s", SKILLS_FILE); skill_db.resize(2, emptySkillInfo); skill_db[1].name = "Basic"; skill_db[1].modifiable = true; diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp index 5a6f3f28..a25d57d4 100644 --- a/src/gui/updatewindow.cpp +++ b/src/gui/updatewindow.cpp @@ -76,7 +76,7 @@ std::vector loadTextFile(const std::string &fileName) std::ifstream fin(fileName.c_str()); if (!fin) { - logger->log(_("Couldn't load text file: %s"), fileName.c_str()); + logger->log("Couldn't load text file: %s", fileName.c_str()); return lines; } @@ -194,7 +194,7 @@ void UpdaterWindow::loadNews() { if (!mMemoryBuffer) { - logger->log(_("Couldn't load news")); + logger->log("Couldn't load news"); return; } @@ -411,7 +411,7 @@ void UpdaterWindow::download() if (!mThread) { - logger->log(_("Unable to create mThread")); + logger->log("Unable to create mThread"); mDownloadStatus = UPDATE_ERROR; } } @@ -505,7 +505,7 @@ void UpdaterWindow::logic() } else { - logger->log(_("%s already here"), mCurrentFile.c_str()); + logger->log("%s already here", mCurrentFile.c_str()); } mLineIndex++; } diff --git a/src/main.cpp b/src/main.cpp index 80cff8d1..4f66e9da 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -208,14 +208,14 @@ void setUpdatesDir() } else { - logger->log(_("Error: Invalid update host: %s"), updateHost.c_str()); + logger->log("Error: Invalid update host: %s", updateHost.c_str()); errorMessage = _("Invalid update host: ") + updateHost; state = ERROR_STATE; } } else { - logger->log(_("Warning: no protocol was specified for the update host")); + logger->log("Warning: no protocol was specified for the update host"); updates << "updates/" << updateHost << "/" << loginData.port; updatesDir = updates.str(); } @@ -240,14 +240,14 @@ void setUpdatesDir() if (!CreateDirectory(newDir.c_str(), 0) && GetLastError() != ERROR_ALREADY_EXISTS) { - logger->log(_("Error: %s can't be made, but doesn't exist!"), - newDir.c_str()); + logger->log("Error: %s can't be made, but doesn't exist!", + newDir.c_str()); errorMessage = _("Error creating updates directory!"); state = ERROR_STATE; } #else - logger->log(_("Error: %s/%s can't be made, but doesn't exist!"), - homeDir.c_str(), updatesDir.c_str()); + logger->log("Error: %s/%s can't be made, but doesn't exist!", + homeDir.c_str(), updatesDir.c_str()); errorMessage = _("Error creating updates directory!"); state = ERROR_STATE; #endif @@ -286,13 +286,13 @@ void init_engine(const Options &options) logger->setLogFile(homeDir + std::string("/aethyra.log")); #ifdef PACKAGE_VERSION - logger->log(_("Starting Aethyra Version %s"), PACKAGE_VERSION); + logger->log("Starting Aethyra Version %s", PACKAGE_VERSION); #else - logger->log(_("Starting Aethyra - Version not defined")); + logger->log("Starting Aethyra - Version not defined")); #endif // Initialize SDL - logger->log(_("Initializing SDL...")); + logger->log("Initializing SDL..."); if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0) { std::cerr << _("Could not initialize SDL: ") << SDL_GetError() << std::endl; @@ -337,7 +337,7 @@ void init_engine(const Options &options) #endif // Fill configuration with defaults - logger->log(_("Initializing configuration...")); + logger->log("Initializing configuration..."); config.setValue("host", "www.aethyra.org"); config.setValue("port", 21001); config.setValue("hwaccel", 0); @@ -451,7 +451,7 @@ void init_engine(const Options &options) catch (const char *err) { state = ERROR_STATE; errorMessage = err; - logger->log(_("Warning: %s"), err); + logger->log("Warning: %s", err); } // Initialize keyboard @@ -497,7 +497,8 @@ void printHelp() << _("Options: ") << std::endl << _(" -C --configfile : Configuration file to use") << std::endl << _(" -d --data : Directory to load game data from") << std::endl - << _(" -D --default : Bypass the login process with default settings") << std::endl + << _(" -D --default : Bypass the login process with default settings") + << std::endl << _(" -h --help : Display this help") << std::endl << _(" -H --updatehost : Use this update host") << std::endl << _(" -p --playername : Login with this player") << std::endl @@ -610,8 +611,8 @@ struct ErrorListener : public gcn::ActionListener // TODO Find some nice place for these functions void accountLogin(Network *network, LoginData *loginData) { - logger->log(_("Trying to connect to account server...")); - logger->log(_("Username is %s"), loginData->username.c_str()); + logger->log("Trying to connect to account server..."); + logger->log("Username is %s", loginData->username.c_str()); network->connect(loginData->hostname, loginData->port); network->registerHandler(&loginHandler); loginHandler.setLoginData(loginData); @@ -665,7 +666,7 @@ void positionDialog(Window *dialog, int screenWidth, int screenHeight) void charLogin(Network *network, LoginData *loginData) { - logger->log(_("Trying to connect to char server...")); + logger->log("Trying to connect to char server..."); network->connect(loginData->hostname, loginData->port); network->registerHandler(&charServerHandler); charServerHandler.setCharInfo(&charInfo); @@ -677,7 +678,8 @@ void charLogin(Network *network, LoginData *loginData) outMsg.writeInt32(loginData->account_ID); outMsg.writeInt32(loginData->session_ID1); outMsg.writeInt32(loginData->session_ID2); - // [Fate] The next word is unused by the old char server, so we squeeze in tmw client version information + // [Fate] The next word is unused by the old char server, so we squeeze in + // tmw client version information outMsg.writeInt16(CLIENT_PROTOCOL_VERSION); outMsg.writeInt8(loginData->sex); @@ -687,14 +689,14 @@ void charLogin(Network *network, LoginData *loginData) void mapLogin(Network *network, LoginData *loginData) { - logger->log(_("Memorizing selected character %s"), + logger->log("Memorizing selected character %s", player_node->getName().c_str()); config.setValue("lastCharacter", player_node->getName()); MessageOut outMsg(network); - logger->log(_("Trying to connect to map server...")); - logger->log(_("Map: %s"), map_path.c_str()); + logger->log("Trying to connect to map server..."); + logger->log("Map: %s", map_path.c_str()); network->connect(loginData->hostname, loginData->port); network->registerHandler(&mapLoginHandler); @@ -824,7 +826,7 @@ int main(int argc, char *argv[]) login_wallpaper = ResourceManager::getInstance()-> getImage(wallpaperName); if (!login_wallpaper) - logger->log(_("Couldn't load %s as wallpaper"), wallpaperName.c_str()); + logger->log("Couldn't load %s as wallpaper", wallpaperName.c_str()); while (state != EXIT_STATE) { diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp index 21c37ea3..9ca3b48a 100644 --- a/src/net/playerhandler.cpp +++ b/src/net/playerhandler.cpp @@ -192,9 +192,9 @@ void PlayerHandler::handleMessage(MessageIn *msg) player_node->mMaxWeight / 2) { weightNotice = new OkDialog(_("Message"), - _("You are carrying more then half " - "your weight. You are unable to " - "regain health.")); + _("You are carrying more then " + "half your weight. You are " + "unable to regain health.")); weightNotice->addActionListener( &weightListener); } @@ -392,7 +392,7 @@ void PlayerHandler::handleMessage(MessageIn *msg) BY_SERVER); break; default: - logger->log(_("0x013b: Unhandled message %i"), type); + logger->log("0x013b: Unhandled message %i", type); break; } } diff --git a/src/resources/colordb.cpp b/src/resources/colordb.cpp index 4ff8944c..b53798bb 100644 --- a/src/resources/colordb.cpp +++ b/src/resources/colordb.cpp @@ -25,7 +25,6 @@ #include "../log.h" -#include "../utils/gettext.h" #include "../utils/xml.h" #define HAIR_COLOR_FILE "colors.xml" @@ -51,7 +50,7 @@ void ColorDB::load() if (!root || !xmlStrEqual(root->name, BAD_CAST "colors")) { - logger->log(_("Trying TMW's color file, %s."), TMW_COLOR_FILE); + logger->log("Trying TMW's color file, %s.", TMW_COLOR_FILE); TMWHair = true; @@ -61,7 +60,7 @@ void ColorDB::load() root = doc->rootNode(); if (!root || !xmlStrEqual(root->name, BAD_CAST "colors")) { - logger->log(_("ColorDB: Failed")); + logger->log("ColorDB: Failed"); mColors[0] = mFail; mLoaded = true; @@ -78,7 +77,7 @@ void ColorDB::load() if (mColors.find(id) != mColors.end()) { - logger->log(_("ColorDB: Redefinition of dye ID %d"), id); + logger->log("ColorDB: Redefinition of dye ID %d", id); } TMWHair ? mColors[id] = XML::getProperty(node, "value", "#FFFFFF") : @@ -93,7 +92,7 @@ void ColorDB::load() void ColorDB::unload() { - logger->log(_("Unloading color database...")); + logger->log("Unloading color database..."); mColors.clear(); mLoaded = false; @@ -108,7 +107,7 @@ std::string& ColorDB::get(int id) if (i == mColors.end()) { - logger->log(_("ColorDB: Error, unknown dye ID# %d"), id); + logger->log("ColorDB: Error, unknown dye ID# %d", id); return mFail; } else diff --git a/src/resources/emotedb.cpp b/src/resources/emotedb.cpp index 5a014c95..23a7833c 100644 --- a/src/resources/emotedb.cpp +++ b/src/resources/emotedb.cpp @@ -23,7 +23,6 @@ #include "../log.h" -#include "../utils/gettext.h" #include "../utils/xml.h" namespace @@ -47,14 +46,14 @@ void EmoteDB::load() unknownSprite->variant = 0; mUnknown.sprites.push_back(unknownSprite); - logger->log(_("Initializing emote database...")); + logger->log("Initializing emote database..."); XML::Document doc("emotes.xml"); xmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "emotes")) { - logger->log(_("Emote Database: Error while loading emotes.xml!")); + logger->log("Emote Database: Error while loading emotes.xml!"); return; } @@ -67,7 +66,7 @@ void EmoteDB::load() int id = XML::getProperty(emoteNode, "id", -1); if (id == -1) { - logger->log(_("Emote Database: Emote with missing ID in emotes.xml!")); + logger->log("Emote Database: Emote with missing ID in emotes.xml!"); continue; } @@ -126,7 +125,7 @@ const EmoteInfo& EmoteDB::get(int id) if (i == mEmoteInfos.end()) { - logger->log(_("EmoteDB: Warning, unknown emote ID %d requested"), id); + logger->log("EmoteDB: Warning, unknown emote ID %d requested", id); return mUnknown; } else diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 5577b5e1..ceaf0395 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -50,7 +50,7 @@ void ItemDB::load() if (mLoaded) return; - logger->log(_("Initializing item database...")); + logger->log("Initializing item database..."); mUnknown = new ItemInfo(); mUnknown->setName(_("Unknown item")); @@ -63,7 +63,7 @@ void ItemDB::load() if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "items")) { - logger->error(_("ItemDB: Error while loading items.xml!")); + logger->error("ItemDB: Error while loading items.xml!"); } for_each_xml_child_node(node, rootNode) @@ -75,12 +75,12 @@ void ItemDB::load() if (id == 0) { - logger->log(_("ItemDB: Invalid or missing item ID in items.xml!")); + logger->log("ItemDB: Invalid or missing item ID in items.xml!"); continue; } else if (mItemInfos.find(id) != mItemInfos.end()) { - logger->log(_("ItemDB: Redefinition of item ID %d"), id); + logger->log("ItemDB: Redefinition of item ID %d", id); } std::string type = XML::getProperty(node, "type", "other"); @@ -136,7 +136,7 @@ void ItemDB::load() } else { - logger->log(_("ItemDB: Duplicate name of item found item %d"), + logger->log("ItemDB: Duplicate name of item found item %d", id); } } @@ -162,7 +162,7 @@ void ItemDB::load() void ItemDB::unload() { - logger->log(_("Unloading item database...")); + logger->log("Unloading item database..."); delete mUnknown; mUnknown = NULL; @@ -180,7 +180,7 @@ const ItemInfo& ItemDB::get(int id) if (i == mItemInfos.end()) { - logger->log(_("ItemDB: Error, unknown item ID# %d"), id); + logger->log("ItemDB: Error, unknown item ID# %d", id); return *mUnknown; } else @@ -236,7 +236,7 @@ void loadSoundRef(ItemInfo *itemInfo, xmlNodePtr node) } else { - logger->log(_("ItemDB: Ignoring unknown sound event '%s'"), + logger->log("ItemDB: Ignoring unknown sound event '%s'", event.c_str()); } } diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index 13f3a7ee..b1965989 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -44,14 +44,14 @@ void MonsterDB::load() mUnknown.addSprite("error.xml"); mUnknown.setName(_("unnamed")); - logger->log(_("Initializing monster database...")); + logger->log("Initializing monster database..."); XML::Document doc(_("monsters.xml")); xmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "monsters")) { - logger->error(_("Monster Database: Error while loading monster.xml!")); + logger->error("Monster Database: Error while loading monster.xml!"); } //iterate s @@ -64,7 +64,7 @@ void MonsterDB::load() MonsterInfo *currentInfo = new MonsterInfo(); - currentInfo->setName (XML::getProperty(monsterNode, "name", "unnamed")); + currentInfo->setName(XML::getProperty(monsterNode, "name", _("unnamed"))); std::string targetCursor; targetCursor = XML::getProperty(monsterNode, "targetCursor", "medium"); @@ -82,7 +82,8 @@ void MonsterDB::load() } else { - logger->log(_("MonsterDB: Unknown target cursor type \"%s\" for %s - using medium sized one"), + logger->log("MonsterDB: Unknown target cursor type \"%s\" for %s -" + "using medium sized one", targetCursor.c_str(), currentInfo->getName().c_str()); currentInfo->setTargetCursorSize(Being::TC_MEDIUM); } @@ -92,7 +93,8 @@ void MonsterDB::load() { if (xmlStrEqual(spriteNode->name, BAD_CAST "sprite")) { - currentInfo->addSprite((const char*) spriteNode->xmlChildrenNode->content); + currentInfo->addSprite( + (const char*) spriteNode->xmlChildrenNode->content); } if (xmlStrEqual(spriteNode->name, BAD_CAST "sound")) @@ -119,14 +121,17 @@ void MonsterDB::load() } else { - logger->log(_("MonsterDB: Warning, sound effect %s for unknown event %s of monster %s"), - filename, event.c_str(), currentInfo->getName().c_str()); + logger->log("MonsterDB: Warning, sound effect %s for " + "unknown event %s of monster %s", + filename, event.c_str(), + currentInfo->getName().c_str()); } } if (xmlStrEqual(spriteNode->name, BAD_CAST "attack")) { - std::string event = XML::getProperty(spriteNode, "particle-effect", ""); + std::string event = XML::getProperty( + spriteNode, "particle-effect", ""); currentInfo->addAttackParticleEffect(event); } @@ -157,7 +162,7 @@ const MonsterInfo &MonsterDB::get(int id) if (i == mMonsterInfos.end()) { - logger->log(_("MonsterDB: Warning, unknown monster ID %d requested"), id); + logger->log("MonsterDB: Warning, unknown monster ID %d requested", id); return mUnknown; } else diff --git a/src/resources/npcdb.cpp b/src/resources/npcdb.cpp index 177d3116..3e9decf1 100644 --- a/src/resources/npcdb.cpp +++ b/src/resources/npcdb.cpp @@ -44,7 +44,7 @@ void NPCDB::load() unknownSprite->variant = 0; mUnknown.sprites.push_back(unknownSprite); - logger->log(_("Initializing NPC database...")); + logger->log("Initializing NPC database..."); XML::Document doc("npcs.xml"); xmlNodePtr rootNode = doc.rootNode(); @@ -63,7 +63,7 @@ void NPCDB::load() int id = XML::getProperty(npcNode, "id", 0); if (id == 0) { - logger->log(_("NPC Database: NPC with missing ID in npcs.xml!")); + logger->log("NPC Database: NPC with missing ID in npcs.xml!"); continue; } @@ -121,7 +121,7 @@ const NPCInfo& NPCDB::get(int id) if (i == mNPCInfos.end()) { - logger->log(_("NPCDB: Warning, unknown NPC ID %d requested"), id); + logger->log("NPCDB: Warning, unknown NPC ID %d requested", id); return mUnknown; } else -- cgit v1.2.3-70-g09d2 From 1fd572f6e81f81b3699f46caf613514507d87cac Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Wed, 11 Feb 2009 18:58:25 -0700 Subject: Separated out the setup and help windows from the chat shortcut so that they are now under the OK shortcut. Figured that if anyone doesn't like the NPC dialogs trumping their chat dialogs, then we should also allow for it under the setup and help buttons as well. The only window behavior that this keeps under the chat shortcut now is the confirmation for exiting shortcut. Signed-off-by: Ira Rice --- src/game.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/game.cpp') diff --git a/src/game.cpp b/src/game.cpp index bc0c86b5..03febaff 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -525,11 +525,11 @@ void Game::handleInput() done = true; // Close the Browser if opened else if (helpWindow->isVisible() && - keyboard.isKeyActive(keyboard.KEY_TOGGLE_CHAT)) + keyboard.isKeyActive(keyboard.KEY_OK)) helpWindow->setVisible(false); // Close the config window, cancelling changes if opened else if (setupWindow->isVisible() && - keyboard.isKeyActive(keyboard.KEY_TOGGLE_CHAT)) + keyboard.isKeyActive(keyboard.KEY_OK)) setupWindow->action(gcn::ActionEvent(NULL, "cancel")); // Submits the text and proceeds to the next dialog else if (npcStringDialog->isVisible() && @@ -551,7 +551,9 @@ void Game::handleInput() KeyboardConfig::KEY_TOGGLE_CHAT) == keyboard.getKeyValue( KeyboardConfig::KEY_OK) && - (npcStringDialog->isVisible() || + (helpWindow->isVisible() || + setupWindow->isVisible() || + npcStringDialog->isVisible() || npcTextDialog->isVisible() || npcListDialog->isVisible() || npcIntegerDialog->isVisible()))) -- cgit v1.2.3-70-g09d2 From cb0be69dcf9ca771943fbe36c8b740490a6f459c Mon Sep 17 00:00:00 2001 From: Steve Cotton Date: Wed, 11 Feb 2009 23:28:18 +0000 Subject: Ignore "window manager + arrow" key combinations Adds two configurable "ignore" keys. Stops the character moving about if the user's window manager uses "ignore+arrow key" to switch virtual desktops. --- src/game.cpp | 9 +++++++++ src/keyboardconfig.cpp | 4 +++- src/keyboardconfig.h | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src/game.cpp') diff --git a/src/game.cpp b/src/game.cpp index 03febaff..e4b6e54d 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -792,6 +792,15 @@ void Game::handleInput() // Get the state of the keyboard keys keyboard.refreshActiveKeys(); + // Ignore input if either "ignore" key is pressed + // Stops the character moving about if the user's window manager + // uses "ignore+arrow key" to switch virtual desktops. + if (keyboard.isKeyActive(keyboard.KEY_IGNORE_INPUT_1) || + keyboard.isKeyActive(keyboard.KEY_IGNORE_INPUT_2)) + { + return; + } + const Uint16 x = player_node->mX; const Uint16 y = player_node->mY; unsigned char direction = 0; diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp index 1976e803..8187bef7 100644 --- a/src/keyboardconfig.cpp +++ b/src/keyboardconfig.cpp @@ -96,7 +96,9 @@ static KeyData const keyData[KeyboardConfig::KEY_TOTAL] = { {"keyChatScrollUp", SDLK_PAGEUP, _("Scroll Chat Up")}, {"keyChatScrollDown", SDLK_PAGEDOWN, _("Scroll Chat Down")}, {"keyOK", SDLK_RETURN, _("Select OK")}, - {"keyQuit", SDLK_ESCAPE, _("Quit")} + {"keyQuit", SDLK_ESCAPE, _("Quit")}, + {"keyIgnoreInput1", SDLK_LSUPER, _("Ignore input 1")}, + {"keyIgnoreInput2", SDLK_RSUPER, _("Ignore input 2")} }; void KeyboardConfig::init() diff --git a/src/keyboardconfig.h b/src/keyboardconfig.h index 484c0c63..61d7887d 100644 --- a/src/keyboardconfig.h +++ b/src/keyboardconfig.h @@ -208,6 +208,8 @@ class KeyboardConfig KEY_SCROLL_CHAT_DOWN, KEY_OK, KEY_QUIT, + KEY_IGNORE_INPUT_1, + KEY_IGNORE_INPUT_2, KEY_TOTAL }; -- cgit v1.2.3-70-g09d2