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/keyboardconfig.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/keyboardconfig.cpp') diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp index 6c836a62..b75a3c1c 100644 --- a/src/keyboardconfig.cpp +++ b/src/keyboardconfig.cpp @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2007 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-60-g2f50 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/keyboardconfig.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-60-g2f50 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/keyboardconfig.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-60-g2f50