From 1ae95b709235ce811ce72437aa257bb7500e00d0 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Mon, 9 Feb 2009 16:31:58 -0700 Subject: Changed AETHYRA_DATADIR to PKG_DATADIR. Signed-off-by: Ira Rice --- src/Makefile.am | 2 +- src/main.cpp | 4 ++-- src/main.h | 4 ++-- src/resources/resourcemanager.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index c6a9a9c4..be2258f5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -346,7 +346,7 @@ aethyra_SOURCES = gui/widgets/dropdown.cpp \ # set the include path found by configure INCLUDES = \ $(all_includes) \ - -DAETHYRA_DATADIR=\""$(pkgdatadir)/"\" \ + -DPKG_DATADIR=\""$(pkgdatadir)/"\" \ -DLOCALEDIR=\""$(localedir)/"\" # the library search path. diff --git a/src/main.cpp b/src/main.cpp index 73e0b0fe..1802c378 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -332,7 +332,7 @@ void init_engine(const Options &options) strncat(path, "/data", PATH_MAX - 1); resman->addToSearchPath(path, true); #else - resman->addToSearchPath(AETHYRA_DATADIR "data", true); + resman->addToSearchPath(PKG_DATADIR "data", true); #endif // Fill configuration with defaults @@ -389,7 +389,7 @@ void init_engine(const Options &options) SetClassLong(pInfo.window, GCL_HICON, (LONG) icon); } #else - SDL_Surface *icon = IMG_Load(AETHYRA_DATADIR "data/icons/aethyra.png"); + SDL_Surface *icon = IMG_Load(PKG_DATADIR "data/icons/aethyra.png"); if (icon) { SDL_SetAlpha(icon, SDL_SRCALPHA, SDL_ALPHA_OPAQUE); diff --git a/src/main.h b/src/main.h index df2c4397..5a337d15 100644 --- a/src/main.h +++ b/src/main.h @@ -30,8 +30,8 @@ #include "winver.h" #endif -#ifndef AETHYRA_DATADIR -#define AETHYRA_DATADIR "" +#ifndef PKG_DATADIR +#define PKG_DATADIR "" #endif /* diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index f193d55d..a5d927dd 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -207,7 +207,7 @@ std::string ResourceManager::getPath(const std::string &file) else { // if not found in search path return the default path - path = std::string(AETHYRA_DATADIR) + std::string("data") + "/" + file; + path = std::string(PKG_DATADIR) + std::string("data") + "/" + file; } return path; -- cgit v1.2.3-70-g09d2 From 1db7d10787f462430054ba04110a8d4647bdbd0a Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Mon, 9 Feb 2009 22:30:00 +0100 Subject: Mostly whitespace fixes Removed tab characters and trailing spaces and added spaces between "if(", "for(", "while(" and "switch(". --- docs/FAQ.txt | 2 +- docs/INSTALL/win32.txt | 2 +- docs/packages.txt | 26 +++--- src/Makefile.am | 10 +- src/being.cpp | 28 +++--- src/being.h | 2 +- src/effectmanager.cpp | 8 +- src/engine.cpp | 2 +- src/equipment.cpp | 3 +- src/game.cpp | 20 ++-- src/game.h | 46 +++++----- src/gui/browserbox.cpp | 2 +- src/gui/char_select.cpp | 24 ++--- src/gui/chat.cpp | 34 +++---- src/gui/confirm_dialog.cpp | 2 +- src/gui/equipmentwindow.cpp | 2 +- src/gui/inventorywindow.cpp | 6 +- src/gui/itemcontainer.h | 2 +- src/gui/itempopup.cpp | 6 +- src/gui/itempopup.h | 6 +- src/gui/login.h | 47 +++++----- src/gui/minimap.cpp | 4 +- src/gui/ministatus.cpp | 2 +- src/gui/ok_dialog.cpp | 2 +- src/gui/passwordfield.h | 2 +- src/gui/popupmenu.cpp | 198 ++++++++++++++++++++-------------------- src/gui/recorder.cpp | 7 +- src/gui/register.cpp | 24 ++--- src/gui/register.h | 36 ++++---- src/gui/scrollarea.cpp | 12 +-- src/gui/sdlinput.cpp | 2 +- src/gui/shortcutcontainer.cpp | 6 +- src/gui/speechbubble.h | 19 ++-- src/gui/trade.cpp | 4 +- src/gui/viewport.cpp | 9 +- src/gui/window.cpp | 32 +++---- src/gui/window.h | 2 +- src/joystick.h | 2 +- src/keyboardconfig.cpp | 14 +-- src/localplayer.cpp | 10 +- src/main.cpp | 10 +- src/monster.cpp | 2 +- src/net/beinghandler.cpp | 9 +- src/net/loginhandler.cpp | 2 +- src/net/npchandler.cpp | 2 +- src/net/partyhandler.cpp | 150 +++++++++++++++--------------- src/net/partyhandler.h | 6 +- src/net/playerhandler.cpp | 2 +- src/net/tradehandler.cpp | 4 +- src/party.cpp | 132 ++++++++++++++------------- src/party.h | 66 +++++++------- src/resources/buddylist.cpp | 4 +- src/resources/colordb.cpp | 4 +- src/resources/colordb.h | 2 +- src/resources/emotedb.cpp | 2 +- src/resources/emotedb.h | 2 +- src/resources/monsterinfo.h | 8 +- src/resources/resourcemanager.h | 5 +- 58 files changed, 543 insertions(+), 536 deletions(-) diff --git a/docs/FAQ.txt b/docs/FAQ.txt index 6adfb2b3..5a3baace 100644 --- a/docs/FAQ.txt +++ b/docs/FAQ.txt @@ -69,7 +69,7 @@ A: There are a lot of ways: - If you're a programmer, an artist or just willing to help in any way, you can become part of the development team. Send an e-mail to - blame582@gmail.com explaining what you want to do, or join our irc + irarice@gmail.com explaining what you want to do, or join our irc channel: #aethyra @ irc.freenode.net. - You can be a beta tester. Just play with Aethyra and report diff --git a/docs/INSTALL/win32.txt b/docs/INSTALL/win32.txt index 2fd12f8c..34d26e3f 100644 --- a/docs/INSTALL/win32.txt +++ b/docs/INSTALL/win32.txt @@ -46,7 +46,7 @@ This tutorial is written and tested with the latest beta version, which is the old stable version, so don't do that. Get Dev-C++ here: http://www.bloodshed.net/ - + After you have fetched it, simply run and install as prompted. diff --git a/docs/packages.txt b/docs/packages.txt index f29fbe8c..e29112c0 100644 --- a/docs/packages.txt +++ b/docs/packages.txt @@ -136,23 +136,23 @@ are needed, and unloaded as they become unused. In order to ensure the autonomous functioning of this process reference counting is the agreed upon technique for managing loaded resources in Aethyra. -For those unfamiliar with the practice of reference counting, it involves +For those unfamiliar with the practice of reference counting, it involves every resource object having a variable containing the number of references to the object. When a reference is added the function addRef() is called and when -it is removed the function release() is called. When the reference count -reaches zero the object will automatically delete itself, thus handling the +it is removed the function release() is called. When the reference count +reaches zero the object will automatically delete itself, thus handling the cleanup of resources. Reference counting will form the core of the resource management system. Each resource object will have the functionality of a reference counted object. The -resource manager will hold ResourceEntry objects. The resource entry object -contains a pointer to the resource as well as the location of the path of the +resource manager will hold ResourceEntry objects. The resource entry object +contains a pointer to the resource as well as the location of the path of the file the resource was loaded from. This would look something like: /** * A generic reference counted resource object. */ - class Resource { + class Resource { public: /** * Loads the resource from the specified path. @@ -165,17 +165,17 @@ file the resource was loaded from. This would look something like: * Increments the reference counted of this object. */ void addRef() { ++referenceCount; } - + /** * Decrements the reference count and deletes the object * if no references are left. * @return true if the object was deleted * false otherwise. */ - void release() { + void release() { --referenceCount; - if(!referenceCount) + if (!referenceCount) { delete this; return true; @@ -190,14 +190,14 @@ file the resource was loaded from. This would look something like: /** * A resource entry descriptor. */ - struct ResourceEntry { - Resource* resource; - std::string filePath; + struct ResourceEntry { + Resource* resource; + std::string filePath; }; ... The resource manager would then hold a mapping containing the resource entry as -well as the string defining its resource identification path. The resource +well as the string defining its resource identification path. The resource manager would thus look something like this: /** diff --git a/src/Makefile.am b/src/Makefile.am index be2258f5..4a6461dd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,5 @@ +AUTOMAKE_OPTIONS = subdir-objects + bin_PROGRAMS = aethyra aethyra_SOURCES = gui/widgets/dropdown.cpp \ gui/widgets/dropdown.h \ @@ -187,8 +189,8 @@ aethyra_SOURCES = gui/widgets/dropdown.cpp \ net/network.h \ net/npchandler.cpp \ net/npchandler.h \ - net/partyhandler.cpp \ - net/partyhandler.h \ + net/partyhandler.cpp \ + net/partyhandler.h \ net/playerhandler.cpp \ net/playerhandler.h \ net/protocol.cpp \ @@ -316,8 +318,8 @@ aethyra_SOURCES = gui/widgets/dropdown.cpp \ particleemitter.cpp \ particleemitter.h \ particleemitterprop.h \ - party.cpp \ - party.h \ + party.cpp \ + party.h \ player.cpp \ player.h \ player_relations.cpp \ diff --git a/src/being.cpp b/src/being.cpp index 9b8ede27..0ac86d13 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -190,7 +190,7 @@ void Being::setSpeech(const std::string &text, Uint32 time) while (start != std::string::npos && end != std::string::npos) { // Catch multiple embeds and ignore them so it doesn't crash the client. - while ((mSpeech.find('[', start + 1) != std::string::npos) && + while ((mSpeech.find('[', start + 1) != std::string::npos) && (mSpeech.find('[', start + 1) < end)) { start = mSpeech.find('[', start + 1); @@ -314,7 +314,7 @@ void Being::setAction(Action action) { currentAction = mEquippedWeapon->getAttackType(); } - else + else { currentAction = ACTION_ATTACK; } @@ -383,11 +383,11 @@ SpriteDirection Being::getSpriteDirection() const { dir = DIRECTION_RIGHT; } - else + else { dir = DIRECTION_LEFT; } - + return dir; } @@ -517,10 +517,10 @@ void Being::drawSpeech(int offsetX, int offsetY) mSpeechBubble->setCaption(mName, mNameColor); - // Not quite centered, but close enough. However, it's not too important to get - // it right right now, as it doesn't take bubble collision into account yet. + // Not quite centered, but close enough. However, it's not too important to get + // it right right now, as it doesn't take bubble collision into account yet. mSpeechBubble->setText(mSpeech); - mSpeechBubble->setPosition(px - (mSpeechBubble->getWidth() * 4 / 11), py - 70 - + mSpeechBubble->setPosition(px - (mSpeechBubble->getWidth() * 4 / 11), py - 70 - (mSpeechBubble->getNumRows()*14)); mSpeechBubble->setVisible(true); } @@ -548,7 +548,7 @@ Being::Type Being::getType() const int Being::getOffset(char pos, char neg) const { // Check whether we're walking in the requested direction - if (mAction != WALK || !(mDirection & (pos | neg))) + if (mAction != WALK || !(mDirection & (pos | neg))) { return 0; } @@ -557,13 +557,13 @@ int Being::getOffset(char pos, char neg) const // We calculate the offset _from_ the _target_ location offset -= 32; - if (offset > 0) + if (offset > 0) { offset = 0; } // Going into negative direction? Invert the offset. - if (mDirection & pos) + if (mDirection & pos) { offset = -offset; } @@ -576,11 +576,11 @@ int Being::getWidth() const if (mSprites[BASE_SPRITE]) { const int width = mSprites[BASE_SPRITE]->getWidth() > DEFAULT_WIDTH ? - mSprites[BASE_SPRITE]->getWidth() : + mSprites[BASE_SPRITE]->getWidth() : DEFAULT_WIDTH; return width; } - else + else { return DEFAULT_WIDTH; } @@ -592,11 +592,11 @@ int Being::getHeight() const if (mSprites[BASE_SPRITE]) { const int height = mSprites[BASE_SPRITE]->getHeight() > DEFAULT_HEIGHT ? - mSprites[BASE_SPRITE]->getHeight() : + mSprites[BASE_SPRITE]->getHeight() : DEFAULT_HEIGHT; return height; } - else + else { return DEFAULT_HEIGHT; } diff --git a/src/being.h b/src/being.h index d722092e..dcbd3553 100644 --- a/src/being.h +++ b/src/being.h @@ -121,7 +121,7 @@ class Being : public Sprite Uint16 mJob; /**< Job (player job, npc, monster, ) */ Uint16 mX, mY; /**< Tile coordinates */ Action mAction; /**< Action the being is performing */ - Uint16 mFrame; + Uint16 mFrame; Uint16 mWalkTime; Uint8 mEmotion; /**< Currently showing emotion */ Uint8 mEmotionTime; /**< Time until emotion disappears */ diff --git a/src/effectmanager.cpp b/src/effectmanager.cpp index 0a04c33d..83cdf382 100644 --- a/src/effectmanager.cpp +++ b/src/effectmanager.cpp @@ -70,13 +70,13 @@ bool EffectManager::trigger(int id, Being* being) if ((*i).id == id) { rValue = true; - if((*i).GFX != "") + if (!(*i).GFX.empty()) { Particle *selfFX; selfFX = particleEngine->addEffect((*i).GFX, 0, 0); being->controlParticle(selfFX); } - if((*i).SFX != "") + if (!(*i).SFX.empty()) sound.playSfx((*i).SFX); break; } @@ -92,9 +92,9 @@ bool EffectManager::trigger(int id, int x, int y) if ((*i).id == id) { rValue = true; - if((*i).GFX != "") + if (!(*i).GFX.empty()) particleEngine->addEffect((*i).GFX, x, y); - if((*i).SFX != "") + if (!(*i).SFX.empty()) sound.playSfx((*i).SFX); break; } diff --git a/src/engine.cpp b/src/engine.cpp index c91e42f9..39b9b3ec 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -98,7 +98,7 @@ void Engine::changeMap(const std::string &mapPath) map_path.c_str()); } - // How many pixels equal one tile. .5 (which is the TMW default) is + // How many pixels equal one tile. .5 (which is the TMW default) is // 2 tiles to a pixel, while 1 is 1 tile to 1 pixel if (newMap->hasProperty("minimapproportion")) minimap->setProportion(atof( diff --git a/src/equipment.cpp b/src/equipment.cpp index b21115a3..cb7acd44 100644 --- a/src/equipment.cpp +++ b/src/equipment.cpp @@ -35,6 +35,5 @@ void Equipment::setEquipment(int index, int inventoryIndex) mEquipment[index] = inventoryIndex; Item* item = player_node->getInventory()->getItem(inventoryIndex); if (item) - item->setEquipped(true); + item->setEquipped(true); } - diff --git a/src/game.cpp b/src/game.cpp index e2064f58..f8903ed2 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -176,11 +176,11 @@ Uint32 nextSecond(Uint32 interval, void *param) int get_elapsed_time(int start_time) { - if (start_time <= tick_time) + if (start_time <= tick_time) { return (tick_time - start_time) * 10; } - else + else { return (tick_time + (MAX_TIME - start_time)) * 10; } @@ -488,7 +488,7 @@ void Game::handleInput() { gcn::Window *requestedWindow = NULL; - if (setupWindow->isVisible() && + if (setupWindow->isVisible() && keyboard.getNewKeyIndex() > keyboard.KEY_NO_VALUE) { keyboard.setNewKey((int) event.key.keysym.sym); @@ -594,7 +594,7 @@ void Game::handleInput() case KeyboardConfig::KEY_QUIT: if (!exitConfirm) { - exitConfirm = new ConfirmDialog( _("Quit"), + exitConfirm = new ConfirmDialog( _("Quit"), _("Are you sure you " "want to quit?")); exitConfirm->addActionListener(&exitListener); @@ -621,7 +621,7 @@ void Game::handleInput() i <= KeyboardConfig::KEY_SHORTCUT_12; i++) { - if (tKey == i && !used) + if (tKey == i && !used) { itemShortcut->useItem( i - KeyboardConfig::KEY_SHORTCUT_1); @@ -822,7 +822,7 @@ void Game::handleInput() if (keyboard.isKeyActive(keyboard.KEY_ATTACK) || (joystick && joystick->buttonPressed(0))) { - Being *target = beingManager->findNearestLivingBeing(x, y, 20, + Being *target = beingManager->findNearestLivingBeing(x, y, 20, Being::MONSTER); bool newTarget = !keyboard.isKeyActive(keyboard.KEY_TARGET); @@ -850,7 +850,7 @@ void Game::handleInput() } // Target the nearest player if 'q' is pressed - if ( keyboard.isKeyActive(keyboard.KEY_TARGET_PLAYER) && + if ( keyboard.isKeyActive(keyboard.KEY_TARGET_PLAYER) && !keyboard.isKeyActive(keyboard.KEY_TARGET) ) { Being *target = beingManager->findNearestLivingBeing(player_node, 20, Being::PLAYER); @@ -859,8 +859,8 @@ void Game::handleInput() } // Target the nearest monster if 'a' pressed - if ((keyboard.isKeyActive(keyboard.KEY_TARGET_CLOSEST) || - (joystick && joystick->buttonPressed(3))) && + if ((keyboard.isKeyActive(keyboard.KEY_TARGET_CLOSEST) || + (joystick && joystick->buttonPressed(3))) && !keyboard.isKeyActive(keyboard.KEY_TARGET)) { Being *target = beingManager->findNearestLivingBeing( @@ -870,7 +870,7 @@ void Game::handleInput() } // Target the nearest npc if 'n' pressed - if ( keyboard.isKeyActive(keyboard.KEY_TARGET_NPC) && + if ( keyboard.isKeyActive(keyboard.KEY_TARGET_NPC) && !keyboard.isKeyActive(keyboard.KEY_TARGET) ) { Being *target = beingManager->findNearestLivingBeing( diff --git a/src/game.h b/src/game.h index e885ea16..d7d2a562 100644 --- a/src/game.h +++ b/src/game.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef GAME_ -#define GAME_ +#ifndef GAME_H +#define GAME_H #include @@ -36,35 +36,35 @@ extern volatile int tick_time; class Game : public ConfigListener { public: - Game(Network *network); - ~Game(); + Game(Network *network); + ~Game(); - void logic(); + void logic(); - void handleInput(); + void handleInput(); - void optionChanged(const std::string &name); + void optionChanged(const std::string &name); private: - Network *mNetwork; + Network *mNetwork; - /** Used to determine whether to draw the next frame. */ - int mDrawTime; + /** Used to determine whether to draw the next frame. */ + int mDrawTime; - /** The minimum frame time (used for frame limiting). */ - int mMinFrameTime; + /** The minimum frame time (used for frame limiting). */ + int mMinFrameTime; - typedef const std::auto_ptr MessageHandlerPtr; - MessageHandlerPtr mBeingHandler; - MessageHandlerPtr mBuySellHandler; - MessageHandlerPtr mChatHandler; - MessageHandlerPtr mEquipmentHandler; - MessageHandlerPtr mInventoryHandler; - MessageHandlerPtr mItemHandler; - MessageHandlerPtr mNpcHandler; - MessageHandlerPtr mPlayerHandler; - MessageHandlerPtr mSkillHandler; - MessageHandlerPtr mTradeHandler; + typedef const std::auto_ptr MessageHandlerPtr; + MessageHandlerPtr mBeingHandler; + MessageHandlerPtr mBuySellHandler; + MessageHandlerPtr mChatHandler; + MessageHandlerPtr mEquipmentHandler; + MessageHandlerPtr mInventoryHandler; + MessageHandlerPtr mItemHandler; + MessageHandlerPtr mNpcHandler; + MessageHandlerPtr mPlayerHandler; + MessageHandlerPtr mSkillHandler; + MessageHandlerPtr mTradeHandler; }; /** diff --git a/src/gui/browserbox.cpp b/src/gui/browserbox.cpp index 5895d557..65659df6 100644 --- a/src/gui/browserbox.cpp +++ b/src/gui/browserbox.cpp @@ -103,7 +103,7 @@ void BrowserBox::addRow(const std::string &row) newRow += "##<" + bLink.caption; tmp.erase(0, idx3 + 2); - if(tmp != "") + if (tmp != "") { newRow += "##>"; } diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp index 6626b848..8de4f5a7 100644 --- a/src/gui/char_select.cpp +++ b/src/gui/char_select.cpp @@ -94,8 +94,8 @@ CharSelectDialog::CharSelectDialog(Network *network, mJobLevelLabel = new gcn::Label(strprintf(_("Job Level: %d"), 0)); mMoneyLabel = new gcn::Label(strprintf(_("Money: %d"), 0)); - const std::string tempString = getFont()->getWidth(_("New")) < - getFont()->getWidth(_("Delete")) ? + const std::string tempString = getFont()->getWidth(_("New")) < + getFont()->getWidth(_("Delete")) ? _("Delete") : _("New"); mPreviousButton = new Button(_("Previous"), "previous", this); @@ -231,7 +231,7 @@ bool CharSelectDialog::selectByName(const std::string &name) unsigned int oldPos = mCharInfo->getPos(); mCharInfo->select(0); - do + do { LocalPlayer *player = mCharInfo->getEntry(); @@ -309,15 +309,15 @@ CharCreateDialog::~CharCreateDialog() void CharCreateDialog::action(const gcn::ActionEvent &event) { int numberOfColors = ColorDB::size(); - if (event.getId() == "create") + if (event.getId() == "create") { - if (getName().length() >= 4) + if (getName().length() >= 4) { // Attempt to create the character mCreateButton->setEnabled(false); attemptCharCreate(); } - else + else { new OkDialog("Error", "Your name needs to be at least 4 characters.", this); @@ -326,18 +326,18 @@ void CharCreateDialog::action(const gcn::ActionEvent &event) else if (event.getId() == "cancel") scheduleDelete(); else if (event.getId() == "nextcolor") - mPlayer->setHairStyle(mPlayer->getHairStyle(), + mPlayer->setHairStyle(mPlayer->getHairStyle(), (mPlayer->getHairColor() + 1) % numberOfColors); else if (event.getId() == "prevcolor") - mPlayer->setHairStyle(mPlayer->getHairStyle(), - (mPlayer->getHairColor() + numberOfColors - 1) % + mPlayer->setHairStyle(mPlayer->getHairStyle(), + (mPlayer->getHairColor() + numberOfColors - 1) % numberOfColors); else if (event.getId() == "nextstyle") - mPlayer->setHairStyle(mPlayer->getHairStyle() + 1, + mPlayer->setHairStyle(mPlayer->getHairStyle() + 1, mPlayer->getHairColor()); else if (event.getId() == "prevstyle") - mPlayer->setHairStyle(mPlayer->getHairStyle() + - mPlayer->getNumOfHairstyles() - 1, + mPlayer->setHairStyle(mPlayer->getHairStyle() + + mPlayer->getNumOfHairstyles() - 1, mPlayer->getHairColor()); } diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 2363fc50..92dd46d7 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -138,7 +138,7 @@ void ChatWindow::chatLog(std::string line, int own, bool ignoreRecord) } std::string lineColor = "##C"; - switch (own) + switch (own) { case BY_GM: if (tmp.nick.empty()) @@ -215,7 +215,7 @@ void ChatWindow::chatLog(std::string line, int own, bool ignoreRecord) // adding a row, otherwise the max will always be a row higher // at comparison. if (mScrollArea->getVerticalScrollAmount() == - mScrollArea->getVerticalMaxScroll()) + mScrollArea->getVerticalMaxScroll()) { mTextOutput->addRow(line); mScrollArea->setVerticalScrollAmount(mScrollArea-> @@ -341,7 +341,7 @@ void ChatWindow::chatSend(const std::string &nick, std::string msg) return; // Send party message - if (msg.at(0) == mPartyPrefix) + if (msg.at(0) == mPartyPrefix) { msg.erase(0, 1); std::size_t length = msg.length() + 1; @@ -367,7 +367,7 @@ void ChatWindow::chatSend(const std::string &nick, std::string msg) if (end != std::string::npos) { // Catch multiple embeds and ignore them so it doesn't crash the client. - while ((msg.find('[', start + 1) != std::string::npos) && + while ((msg.find('[', start + 1) != std::string::npos) && (msg.find('[', start + 1) < end)) { start = msg.find('[', start + 1); @@ -395,7 +395,7 @@ void ChatWindow::chatSend(const std::string &nick, std::string msg) } // Prepare ordinary message - if (msg.substr(0, 1) != "/") + if (msg.substr(0, 1) != "/") { msg = nick + " : " + msg; @@ -423,14 +423,14 @@ void ChatWindow::chatSend(const std::string &nick, std::string msg) trim(msg); } - if (command == "announce") + if (command == "announce") { MessageOut outMsg(mNetwork); outMsg.writeInt16(0x0099); outMsg.writeInt16(msg.length() + 4); outMsg.writeString(msg, msg.length()); } - else if (command == "help") + else if (command == "help") { trim(msg); std::size_t space = msg.find(" "); @@ -483,16 +483,16 @@ void ChatWindow::chatSend(const std::string &nick, std::string msg) msg = msg.substr(0, 1); - if (msg == "1" || - msg == "y" || msg == "Y" || + if (msg == "1" || + msg == "y" || msg == "Y" || msg == "t" || msg == "T") { chatLog(_("Return now toggles chat."), BY_SERVER); mReturnToggles = true; return; } - else if (msg == "0" || - msg == "n" || msg == "N" || + else if (msg == "0" || + msg == "n" || msg == "N" || msg == "f" || msg == "F") { chatLog(_("Message now closes chat."), BY_SERVER); @@ -787,7 +787,7 @@ void ChatWindow::party(const std::string & command, const std::string & rest) void ChatWindow::help(const std::string & msg1, const std::string & msg2) { chatLog(_("-- Help --"), BY_SERVER); - if (msg1 == "") + if (msg1 == "") { chatLog(_("/announce: Global announcement (GM only)"), BY_SERVER); chatLog(_("/clear: Clears this window"), BY_SERVER); @@ -827,18 +827,18 @@ void ChatWindow::help(const std::string & msg1, const std::string & msg2) chatLog(_("Command: /help "), BY_SERVER); chatLog(_("This command displays help on ."), BY_SERVER); } - else if (msg1 == "party") + else if (msg1 == "party") { mParty->help(msg2); } - else if (msg1 == "present") + else if (msg1 == "present") { chatLog(_("Command: /present"), BY_SERVER); chatLog(_("This command gets a list of players within hearing and " "sends it to either the record log if recording, or the chat " "log otherwise."), BY_SERVER); } - else if (msg1 == "record") + else if (msg1 == "record") { chatLog(_("Command: /record "), BY_SERVER); chatLog(_("This command starts recording the chat log to the file " @@ -846,10 +846,10 @@ void ChatWindow::help(const std::string & msg1, const std::string & msg2) chatLog(_("Command: /record"), BY_SERVER); chatLog(_("This command finishes a recording session."), BY_SERVER); } - else if (msg1 == "toggle") + else if (msg1 == "toggle") { chatLog(_("Command: /toggle "), BY_SERVER); - chatLog(_("This command sets whether the return key should toggle the" + chatLog(_("This command sets whether the return key should toggle the" "chat log, or whether the chat log turns off automatically."), BY_SERVER); chatLog(_(" can be one of \"1\", \"yes\", \"true\" to " diff --git a/src/gui/confirm_dialog.cpp b/src/gui/confirm_dialog.cpp index 8bb9c578..38697f3a 100644 --- a/src/gui/confirm_dialog.cpp +++ b/src/gui/confirm_dialog.cpp @@ -55,7 +55,7 @@ ConfirmDialog::ConfirmDialog(const std::string &title, const std::string &msg, // 15 == height of each line of text (based on font heights) // 14 == row top + bottom graphic pixel heights setContentSize(mTextBox->getMinWidth() + 15, 15 + (numRows * 15) + noButton->getHeight()); - mTextArea->setDimension(gcn::Rectangle(4, 5, mTextBox->getMinWidth() + 5, + mTextArea->setDimension(gcn::Rectangle(4, 5, mTextBox->getMinWidth() + 5, 3 + (numRows * 14))); } else diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp index e553fbe7..a2be6b00 100644 --- a/src/gui/equipmentwindow.cpp +++ b/src/gui/equipmentwindow.cpp @@ -125,7 +125,7 @@ void EquipmentWindow::draw(gcn::Graphics *graphics) graphics->drawText(toString(item->getQuantity()), mEquipBox[i].posX + (BOX_WIDTH / 2), mEquipBox[i].posY - getFont()->getHeight(), - gcn::Graphics::CENTER); + gcn::Graphics::CENTER); } } diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index 70b3efb5..b9fe1c90 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -57,11 +57,11 @@ InventoryWindow::InventoryWindow(int invSize): // If you adjust these defaults, don't forget to adjust the trade window's. setDefaultSize(115, 25, 375, 300); - std::string longestUseString = getFont()->getWidth(_("Equip")) > + std::string longestUseString = getFont()->getWidth(_("Equip")) > getFont()->getWidth(_("Use")) ? _("Equip") : _("Use"); - if (getFont()->getWidth(longestUseString) < + if (getFont()->getWidth(longestUseString) < getFont()->getWidth(_("Unequip"))) { longestUseString = _("Unequip"); @@ -150,7 +150,7 @@ void InventoryWindow::logic() // Adjust progress bars mSlotsBar->setProgress((float) player_node->getInventory()->getNumberOfSlotsUsed() / mMaxSlots); - mWeightBar->setProgress((float) player_node->mTotalWeight / + mWeightBar->setProgress((float) player_node->mTotalWeight / player_node->mMaxWeight); mSlotsBar->setText(strprintf("%s/%d", mUsedSlots.c_str(), mMaxSlots)); diff --git a/src/gui/itemcontainer.h b/src/gui/itemcontainer.h index f027de19..23b9e5e1 100644 --- a/src/gui/itemcontainer.h +++ b/src/gui/itemcontainer.h @@ -42,7 +42,7 @@ namespace gcn { * * \ingroup GUI */ -class ItemContainer : public gcn::Widget, +class ItemContainer : public gcn::Widget, public gcn::MouseListener, public gcn::WidgetListener { diff --git a/src/gui/itempopup.cpp b/src/gui/itempopup.cpp index b7e015a4..ddce449a 100644 --- a/src/gui/itempopup.cpp +++ b/src/gui/itempopup.cpp @@ -136,12 +136,12 @@ void ItemPopup::setItem(const ItemInfo &item) mItemWeightScroll->setDimension(gcn::Rectangle(2, 0, minWidth, numRowsWeight * getFont()->getHeight())); - if(item.getEffect() == "") + if (item.getEffect() == "") { setContentSize(minWidth, (numRowsDesc * getFont()->getHeight() + (3 * getFont()->getHeight()))); - mItemWeightScroll->setPosition(2, + mItemWeightScroll->setPosition(2, (numRowsDesc * getFont()->getHeight()) + (2 * getFont()->getHeight())); } @@ -151,7 +151,7 @@ void ItemPopup::setItem(const ItemInfo &item) (numRowsEffect * getFont()->getHeight()) + (3 * getFont()->getHeight())); - mItemWeightScroll->setPosition(2, + mItemWeightScroll->setPosition(2, (numRowsDesc * getFont()->getHeight()) + (numRowsEffect * getFont()->getHeight()) + (2 * getFont()->getHeight())); diff --git a/src/gui/itempopup.h b/src/gui/itempopup.h index 95ab6ffa..1d37346e 100644 --- a/src/gui/itempopup.h +++ b/src/gui/itempopup.h @@ -20,8 +20,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef ITEMPOPUP_H__ -#define ITEMPOPUP_H__ +#ifndef ITEMPOPUP_H +#define ITEMPOPUP_H #include "window.h" @@ -51,4 +51,4 @@ class ItemPopup : public Window gcn::Color getColor(const std::string& type); }; -#endif // ITEMPOPUP_H__ +#endif // ITEMPOPUP_H diff --git a/src/gui/login.h b/src/gui/login.h index 023d60aa..c0d6e755 100644 --- a/src/gui/login.h +++ b/src/gui/login.h @@ -73,29 +73,29 @@ class LoginDialog : public Window, public gcn::ActionListener, */ bool canSubmit(); - /** - * Function to decide whether string is an unsigned short or not - * - * @param str the string to parse - * - * @return true is str is an unsigned short, false otherwise - */ - static bool isUShort(const std::string &str); - - /** - * Converts string to an unsigned short (undefined if invalid) - * - * @param str the string to parse - * - * @return the value str represents - */ - static unsigned short getUShort(const std::string &str); + /** + * Function to decide whether string is an unsigned short or not + * + * @param str the string to parse + * + * @return true is str is an unsigned short, false otherwise + */ + static bool isUShort(const std::string &str); + + /** + * Converts string to an unsigned short (undefined if invalid) + * + * @param str the string to parse + * + * @return the value str represents + */ + static unsigned short getUShort(const std::string &str); DropDown *mServerDropDown; gcn::TextField *mUserField; gcn::TextField *mPassField; gcn::TextField *mServerField; - gcn::TextField *mPortField; + gcn::TextField *mPortField; gcn::CheckBox *mKeepCheck; gcn::Button *mOkButton; gcn::Button *mCancelButton; @@ -111,26 +111,25 @@ class LoginDialog : public Window, public gcn::ActionListener, { private: std::vector mServers; - std::vector mPorts; + std::vector mPorts; std::string mConfigPrefix; int mMaxEntries; void saveEntry(const std::string &server, - const std::string &port, int &saved); + const std::string &port, int &saved); public: DropDownList(std::string prefix, std::vector dfltServer, - std::vector dfltPort, + std::vector dfltPort, int maxEntries); void save(const std::string &server, const std::string &port); int getNumberOfElements(); std::string getElementAt(int i); - std::string getServerAt(int i); - std::string getPortAt(int i); + std::string getServerAt(int i); + std::string getPortAt(int i); }; DropDownList *mServerList; gcn::ListBox *mServerListBox; gcn::ScrollArea *mServerScrollArea; - }; #endif diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp index 37505305..55cd8b5d 100644 --- a/src/gui/minimap.cpp +++ b/src/gui/minimap.cpp @@ -68,9 +68,9 @@ void Minimap::setMapImage(Image *img) const int offsetX = 2 * getPadding(); const int offsetY = getTitleBarHeight() + getPadding(); const int titleWidth = getFont()->getWidth(getCaption()) + 15; - const int mapWidth = mMapImage->getWidth() < 100 ? + const int mapWidth = mMapImage->getWidth() < 100 ? mMapImage->getWidth() + offsetX : 100; - const int mapHeight = mMapImage->getHeight() < 100 ? + const int mapHeight = mMapImage->getHeight() < 100 ? mMapImage->getHeight() + offsetY : 100; setMinWidth(mapWidth > titleWidth ? mapWidth : titleWidth); diff --git a/src/gui/ministatus.cpp b/src/gui/ministatus.cpp index 4c22e63d..13351915 100644 --- a/src/gui/ministatus.cpp +++ b/src/gui/ministatus.cpp @@ -91,7 +91,7 @@ void MiniStatusWindow::update() // Displays the number of monsters to next lvl // (disabled for now but interesting idea) /* - if(config.getValue("xpBarMonsterCounterExp", 0)!=0) + if (config.getValue("xpBarMonsterCounterExp", 0)!=0) { updatedText << " | " << (int)(((float)player_node->mXpForNextLevel - (float)player_node->mXp) diff --git a/src/gui/ok_dialog.cpp b/src/gui/ok_dialog.cpp index 0d1f658f..2c67e71f 100644 --- a/src/gui/ok_dialog.cpp +++ b/src/gui/ok_dialog.cpp @@ -52,7 +52,7 @@ OkDialog::OkDialog(const std::string &title, const std::string &msg, // 15 == height of each line of text (based on font heights) // 14 == row top + bottom graphic pixel heights setContentSize(mTextBox->getMinWidth() + 15, 15 + (numRows * 15) + okButton->getHeight()); - mTextArea->setDimension(gcn::Rectangle(4, 5, mTextBox->getMinWidth() + 5, + mTextArea->setDimension(gcn::Rectangle(4, 5, mTextBox->getMinWidth() + 5, 3 + (numRows * 14))); } else diff --git a/src/gui/passwordfield.h b/src/gui/passwordfield.h index 89293b05..42f8d187 100644 --- a/src/gui/passwordfield.h +++ b/src/gui/passwordfield.h @@ -31,7 +31,7 @@ * * \ingroup GUI */ -class PasswordField : public TextField +class PasswordField : public TextField { public: /** diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index 6c0e6ad6..53c24960 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -70,52 +70,52 @@ void PopupMenu::showPopup(int x, int y, Being *being) switch (mBeing->getType()) { - case Being::PLAYER: - { - // Players can be traded with. Later also attack, follow and - // add as buddy will be options in this menu. - const std::string &name = mBeing->getName(); - mBrowserBox->addRow(strprintf(_("@@trade|Trade With %s@@"), name.c_str())); - mBrowserBox->addRow(strprintf(_("@@attack|Attack %s@@"), name.c_str())); - - mBrowserBox->addRow("##3---"); - - switch (player_relations.getRelation(name)) { - case PlayerRelation::NEUTRAL: - mBrowserBox->addRow(strprintf(_("@@friend|Befriend %s@@"), name.c_str())); - - case PlayerRelation::FRIEND: - mBrowserBox->addRow(strprintf(_("@@disregard|Disregard %s@@"), name.c_str())); - mBrowserBox->addRow(strprintf(_("@@ignore|Ignore %s@@"), name.c_str())); - break; - - case PlayerRelation::DISREGARDED: - mBrowserBox->addRow(strprintf(_("@@unignore|Un-Ignore %s@@"), name.c_str())); - mBrowserBox->addRow(strprintf(_("@@ignore|Completely ignore %s@@"), name.c_str())); - break; - - case PlayerRelation::IGNORED: - mBrowserBox->addRow(strprintf(_("@@unignore|Un-Ignore %s@@"), name.c_str())); - break; - } - - //mBrowserBox->addRow(_("@@follow|Follow ") + name + "@@"); - //mBrowserBox->addRow(_("@@buddy|Add ") + name + " to Buddy List@@"); - - mBrowserBox->addRow("##3---"); - mBrowserBox->addRow(strprintf(_("@@party-invite|Invite %s to party@@"), name.c_str())); - } - break; - - case Being::NPC: - // NPCs can be talked to (single option, candidate for removal - // unless more options would be added) - mBrowserBox->addRow(_("@@talk|Talk To NPC@@")); - break; - - default: - /* Other beings aren't interesting... */ - break; + case Being::PLAYER: + { + // Players can be traded with. Later also attack, follow and + // add as buddy will be options in this menu. + const std::string &name = mBeing->getName(); + mBrowserBox->addRow(strprintf(_("@@trade|Trade With %s@@"), name.c_str())); + mBrowserBox->addRow(strprintf(_("@@attack|Attack %s@@"), name.c_str())); + + mBrowserBox->addRow("##3---"); + + switch (player_relations.getRelation(name)) { + case PlayerRelation::NEUTRAL: + mBrowserBox->addRow(strprintf(_("@@friend|Befriend %s@@"), name.c_str())); + + case PlayerRelation::FRIEND: + mBrowserBox->addRow(strprintf(_("@@disregard|Disregard %s@@"), name.c_str())); + mBrowserBox->addRow(strprintf(_("@@ignore|Ignore %s@@"), name.c_str())); + break; + + case PlayerRelation::DISREGARDED: + mBrowserBox->addRow(strprintf(_("@@unignore|Un-Ignore %s@@"), name.c_str())); + mBrowserBox->addRow(strprintf(_("@@ignore|Completely ignore %s@@"), name.c_str())); + break; + + case PlayerRelation::IGNORED: + mBrowserBox->addRow(strprintf(_("@@unignore|Un-Ignore %s@@"), name.c_str())); + break; + } + + //mBrowserBox->addRow(_("@@follow|Follow ") + name + "@@"); + //mBrowserBox->addRow(_("@@buddy|Add ") + name + " to Buddy List@@"); + + mBrowserBox->addRow("##3---"); + mBrowserBox->addRow(strprintf(_("@@party-invite|Invite %s to party@@"), name.c_str())); + } + break; + + case Being::NPC: + // NPCs can be talked to (single option, candidate for removal + // unless more options would be added) + mBrowserBox->addRow(_("@@talk|Talk To NPC@@")); + break; + + default: + /* Other beings aren't interesting... */ + break; } //browserBox->addRow("@@look|Look To@@"); @@ -145,56 +145,56 @@ void PopupMenu::handleLink(const std::string& link) { // Talk To action if (link == "talk" && - mBeing != NULL && - mBeing->getType() == Being::NPC && - current_npc == 0) + mBeing != NULL && + mBeing->getType() == Being::NPC && + current_npc == 0) { - dynamic_cast(mBeing)->talk(); + dynamic_cast(mBeing)->talk(); } // Trade action else if (link == "trade" && - mBeing != NULL && - mBeing->getType() == Being::PLAYER) + mBeing != NULL && + mBeing->getType() == Being::PLAYER) { - player_node->trade(mBeing); - tradePartnerName = mBeing->getName(); + player_node->trade(mBeing); + tradePartnerName = mBeing->getName(); } // Attack action else if (link == "attack" && - mBeing != NULL && - mBeing->getType() == Being::PLAYER) + mBeing != NULL && + mBeing->getType() == Being::PLAYER) { - player_node->attack(mBeing, true); + player_node->attack(mBeing, true); } else if (link == "unignore" && - mBeing != NULL && - mBeing->getType() == Being::PLAYER) + mBeing != NULL && + mBeing->getType() == Being::PLAYER) { - player_relations.setRelation(mBeing->getName(), PlayerRelation::NEUTRAL); + player_relations.setRelation(mBeing->getName(), PlayerRelation::NEUTRAL); } else if (link == "ignore" && - mBeing != NULL && - mBeing->getType() == Being::PLAYER) + mBeing != NULL && + mBeing->getType() == Being::PLAYER) { - player_relations.setRelation(mBeing->getName(), PlayerRelation::IGNORED); + player_relations.setRelation(mBeing->getName(), PlayerRelation::IGNORED); } else if (link == "disregard" && - mBeing != NULL && - mBeing->getType() == Being::PLAYER) + mBeing != NULL && + mBeing->getType() == Being::PLAYER) { - player_relations.setRelation(mBeing->getName(), PlayerRelation::DISREGARDED); + player_relations.setRelation(mBeing->getName(), PlayerRelation::DISREGARDED); } else if (link == "friend" && - mBeing != NULL && - mBeing->getType() == Being::PLAYER) + mBeing != NULL && + mBeing->getType() == Being::PLAYER) { - player_relations.setRelation(mBeing->getName(), PlayerRelation::FRIEND); + player_relations.setRelation(mBeing->getName(), PlayerRelation::FRIEND); } /* @@ -207,16 +207,16 @@ void PopupMenu::handleLink(const std::string& link) // Add Buddy action else if ((link == "buddy") && mBeing != NULL && mBeing->isPlayer()) { - if (!buddyWindow->isVisible()) - buddyWindow->setVisible(true); + if (!buddyWindow->isVisible()) + buddyWindow->setVisible(true); - buddyWindow->addBuddy(mBeing->getName()); + buddyWindow->addBuddy(mBeing->getName()); }*/ // Pick Up Floor Item action else if ((link == "pickup") && mFloorItem != NULL) { - player_node->pickUp(mFloorItem); + player_node->pickUp(mFloorItem); } // Look To action @@ -226,46 +226,46 @@ void PopupMenu::handleLink(const std::string& link) else if (link == "use") { - assert(mItem); - if (mItem->isEquipment()) - { - if (mItem->isEquipped()) - { - player_node->unequipItem(mItem); - } - else - { - player_node->equipItem(mItem); - } - } - else - { - player_node->useItem(mItem); - } + assert(mItem); + if (mItem->isEquipment()) + { + if (mItem->isEquipped()) + { + player_node->unequipItem(mItem); + } + else + { + player_node->equipItem(mItem); + } + } + else + { + player_node->useItem(mItem); + } } else if (link == "chat") { - chatWindow->addItemText(mItem->getInfo().getName()); + chatWindow->addItemText(mItem->getInfo().getName()); } else if (link == "drop") { - new ItemAmountWindow(AMOUNT_ITEM_DROP, inventoryWindow, mItem); + new ItemAmountWindow(AMOUNT_ITEM_DROP, inventoryWindow, mItem); } else if (link == "party-invite" && - mBeing != NULL && - mBeing->getType() == Being::PLAYER) + mBeing != NULL && + mBeing->getType() == Being::PLAYER) { - MessageOut outMsg(player_node->getNetwork()); - outMsg.writeInt16(CMSG_PARTY_INVITE); - outMsg.writeInt32(mBeing->getId()); + MessageOut outMsg(player_node->getNetwork()); + outMsg.writeInt16(CMSG_PARTY_INVITE); + outMsg.writeInt32(mBeing->getId()); } // Unknown actions else { - std::cout << link << std::endl; + std::cout << link << std::endl; } setVisible(false); @@ -303,9 +303,9 @@ void PopupMenu::showPopup(int x, int y) { setContentSize(mBrowserBox->getWidth() + 8, mBrowserBox->getHeight() + 8); if (windowContainer->getWidth() < (x + getWidth() + 5)) - x = windowContainer->getWidth() - getWidth(); + x = windowContainer->getWidth() - getWidth(); if (windowContainer->getHeight() < (y + getHeight() + 5)) - y = windowContainer->getHeight() - getHeight(); + y = windowContainer->getHeight() - getHeight(); setPosition(x, y); setVisible(true); requestMoveToTop(); diff --git a/src/gui/recorder.cpp b/src/gui/recorder.cpp index 1e7d8e13..2e2ee8a5 100644 --- a/src/gui/recorder.cpp +++ b/src/gui/recorder.cpp @@ -52,6 +52,10 @@ Recorder::Recorder(ChatWindow *chat, const std::string &title, loadWindowState(); } +Recorder::~Recorder() +{ +} + void Recorder::record(const std::string &msg) { if (mStream.is_open()) @@ -110,6 +114,3 @@ void Recorder::action(const gcn::ActionEvent &event) changeRecordingStatus(""); } -Recorder::~Recorder() -{ -} diff --git a/src/gui/register.cpp b/src/gui/register.cpp index cbf87e5b..cf12375c 100644 --- a/src/gui/register.cpp +++ b/src/gui/register.cpp @@ -251,21 +251,21 @@ bool RegisterDialog::isUShort(const std::string &str) { if (str == "") { - return false; + return false; } unsigned long l = 0; for (std::string::const_iterator strPtr = str.begin(), strEnd = str.end(); - strPtr != strEnd; ++strPtr) + strPtr != strEnd; ++strPtr) { - if (*strPtr < '0' || *strPtr > '9') + if (*strPtr < '0' || *strPtr > '9') { - return false; - } - l = l * 10 + (*strPtr - '0'); // *strPtr - '0' will never be negative - if (l > 65535) - { - return false; - } + return false; + } + l = l * 10 + (*strPtr - '0'); // *strPtr - '0' will never be negative + if (l > 65535) + { + return false; + } } return true; } @@ -274,9 +274,9 @@ unsigned short RegisterDialog::getUShort(const std::string &str) { unsigned long l = 0; for (std::string::const_iterator strPtr = str.begin(), strEnd = str.end(); - strPtr != strEnd; ++strPtr) + strPtr != strEnd; ++strPtr) { - l = l * 10 + (*strPtr - '0'); + l = l * 10 + (*strPtr - '0'); } return static_cast(l); } diff --git a/src/gui/register.h b/src/gui/register.h index e58ac9db..9588e07e 100644 --- a/src/gui/register.h +++ b/src/gui/register.h @@ -72,29 +72,29 @@ class RegisterDialog : public Window, public gcn::ActionListener, */ bool canSubmit() const; - /** - * Function to decide whether string is an unsigned short or not - * - * @param str the string to parse - * - * @return true if str is an unsigned short, false otherwise - */ - static bool isUShort(const std::string &str); - - /** - * Converts string to an unsigned short (undefined if invalid) - * - * @param str the string to parse - * - * @return the value str represents - */ - static unsigned short getUShort(const std::string &str); + /** + * Function to decide whether string is an unsigned short or not + * + * @param str the string to parse + * + * @return true if str is an unsigned short, false otherwise + */ + static bool isUShort(const std::string &str); + + /** + * Converts string to an unsigned short (undefined if invalid) + * + * @param str the string to parse + * + * @return the value str represents + */ + static unsigned short getUShort(const std::string &str); gcn::TextField *mUserField; gcn::TextField *mPasswordField; gcn::TextField *mConfirmField; gcn::TextField *mServerField; - gcn::TextField *mPortField; + gcn::TextField *mPortField; gcn::Button *mRegisterButton; gcn::Button *mCancelButton; diff --git a/src/gui/scrollarea.cpp b/src/gui/scrollarea.cpp index 09f7c5e7..eacc4714 100644 --- a/src/gui/scrollarea.cpp +++ b/src/gui/scrollarea.cpp @@ -110,9 +110,9 @@ void ScrollArea::init() int vsgridy[4] = {0, 4, 15, 19}; a = 0; - for (y = 0; y < 3; y++) + for (y = 0; y < 3; y++) { - for (x = 0; x < 3; x++) + for (x = 0; x < 3; x++) { vMarker.grid[a] = vscroll->getSubImage( vsgridx[x], vsgridy[y], @@ -214,7 +214,7 @@ void ScrollArea::drawFrame(gcn::Graphics *graphics) int w = getWidth() + bs * 2; int h = getHeight() + bs * 2; - if (mOpaque) + if (mOpaque) { static_cast(graphics)-> drawImageRect(0, 0, w, h, background); @@ -225,11 +225,11 @@ void ScrollArea::setOpaque(bool opaque) { mOpaque = opaque; - if (mOpaque) + if (mOpaque) { setFrameSize(2); } - else + else { setFrameSize(0); } @@ -240,7 +240,7 @@ void ScrollArea::drawButton(gcn::Graphics *graphics, BUTTON_DIR dir) int state = 0; gcn::Rectangle dim; - switch(dir) + switch (dir) { case UP: state = mUpButtonPressed ? 1 : 0; diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp index f68dc9c8..51442798 100644 --- a/src/gui/sdlinput.cpp +++ b/src/gui/sdlinput.cpp @@ -228,7 +228,7 @@ int SDLInput::convertMouseButton(int button) int SDLInput::convertKeyCharacter(SDL_Event event) { SDL_keysym keysym = event.key.keysym; - + int value = keysym.unicode; switch (keysym.sym) diff --git a/src/gui/shortcutcontainer.cpp b/src/gui/shortcutcontainer.cpp index eae24785..4472818e 100644 --- a/src/gui/shortcutcontainer.cpp +++ b/src/gui/shortcutcontainer.cpp @@ -38,7 +38,7 @@ ShortcutContainer::ShortcutContainer(): void ShortcutContainer::widgetResized(const gcn::Event &event) { mGridWidth = getWidth() / mBoxWidth; - if (mGridWidth < 1) + if (mGridWidth < 1) { mGridWidth = 1; } @@ -47,7 +47,7 @@ void ShortcutContainer::widgetResized(const gcn::Event &event) (mMaxItems % mGridWidth > 0 ? 1 : 0)) * mBoxHeight); mGridHeight = getHeight() / mBoxHeight; - if (mGridHeight < 1) + if (mGridHeight < 1) { mGridHeight = 1; } @@ -57,7 +57,7 @@ int ShortcutContainer::getIndexFromGrid(int pointX, int pointY) const { const gcn::Rectangle tRect = gcn::Rectangle( 0, 0, mGridWidth * mBoxWidth, mGridHeight * mBoxHeight); - if (!tRect.isPointInRect(pointX, pointY)) + if (!tRect.isPointInRect(pointX, pointY)) { return -1; } diff --git a/src/gui/speechbubble.h b/src/gui/speechbubble.h index 7f5818af..43267a4e 100644 --- a/src/gui/speechbubble.h +++ b/src/gui/speechbubble.h @@ -20,8 +20,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef SPEECHBUBBLE_H__ -#define SPEECHBUBBLE_H__ +#ifndef SPEECHBUBBLE_H +#define SPEECHBUBBLE_H #include "window.h" @@ -31,20 +31,19 @@ class TextBox; class SpeechBubble : public Window { public: - - SpeechBubble(); - ~SpeechBubble(); + SpeechBubble(); + ~SpeechBubble(); void setCaption(const std::string &name, const gcn::Color &color = 0x000000); - void setText(std::string mText); - void setLocation(int x, int y); - unsigned int getNumRows(); + void setText(std::string mText); + void setLocation(int x, int y); + unsigned int getNumRows(); private: gcn::Label *mCaption; - TextBox *mSpeechBox; - ScrollArea *mSpeechArea; + TextBox *mSpeechBox; + ScrollArea *mSpeechArea; }; #endif diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp index f901be5e..af30d1fe 100644 --- a/src/gui/trade.cpp +++ b/src/gui/trade.cpp @@ -125,7 +125,7 @@ void TradeWindow::addMoney(int amount) void TradeWindow::addItem(int id, bool own, int quantity, bool equipment) { - if (own) + if (own) { mMyItemContainer->setWidth(mMyScroll->getWidth()); mMyInventory->addItem(id, quantity, equipment); @@ -139,7 +139,7 @@ void TradeWindow::addItem(int id, bool own, int quantity, bool equipment) void TradeWindow::removeItem(int id, bool own) { - if (own) + if (own) mMyInventory->removeItem(id); else mPartnerInventory->removeItem(id); diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 19e9a4fb..6b6c982a 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -167,7 +167,7 @@ void Viewport::draw(gcn::Graphics *gcnGraphics) // Find a path from the player to the mouse, and draw it. This is for debug // purposes. - if (mShowDebugPath) + if (mShowDebugPath) { // Get the current mouse position int mouseX, mouseY; @@ -263,7 +263,8 @@ void Viewport::mousePressed(gcn::MouseEvent &event) mPopupMenu->showPopup(event.getX(), event.getY(), being); return; } - else if((floorItem = floorItemManager->findByCoordinates(tilex, tiley))) + else if ((floorItem = floorItemManager->findByCoordinates(tilex, + tiley))) { mPopupMenu->showPopup(event.getX(), event.getY(), floorItem); return; @@ -282,7 +283,7 @@ void Viewport::mousePressed(gcn::MouseEvent &event) { Being *being; FloorItem *item; - + // Interact with some being // if ((being = beingManager->findBeing(tilex, tiley))) if ((being = beingManager->findBeingByPixel(x, y))) @@ -330,7 +331,7 @@ void Viewport::mousePressed(gcn::MouseEvent &event) { // Find the being nearest to the clicked position Being *target = beingManager->findBeingByPixel(x, y); - + if (target) { player_node->setTarget(target); diff --git a/src/gui/window.cpp b/src/gui/window.cpp index 934bd9b3..8000179d 100644 --- a/src/gui/window.cpp +++ b/src/gui/window.cpp @@ -75,7 +75,7 @@ Window::Window(const std::string& caption, bool modal, Window *parent, const std { logger->log("Window::Window(\"%s\")", caption.c_str()); - if (!windowContainer) + if (!windowContainer) { throw GCN_EXCEPTION("Window::Window(): no windowContainer set"); } @@ -126,7 +126,7 @@ Window::~Window() config.setValue(name + "WinY", getY()); config.setValue(name + "Visible", isVisible()); - if (mGrip) + if (mGrip) { config.setValue(name + "WinWidth", getWidth()); config.setValue(name + "WinHeight", getHeight()); @@ -145,7 +145,7 @@ Window::~Window() instances--; // Clean up static resources - for( int i = 0; i < 9; i++ ) + for (int i = 0; i < 9; i++) { delete border.grid[i]; border.grid[i] = NULL; @@ -525,7 +525,7 @@ int Window::getResizeHandles(gcn::MouseEvent &event) void Window::setGuiAlpha() { //logger->log("Window::setGuiAlpha: Alpha Value %f", config.getValue("guialpha", 0.8)); - for(int i = 0; i < 9; i++) + for (int i = 0; i < 9; i++) { //logger->log("Window::setGuiAlpha: Border Image (%i)", i); border.grid[i]->setAlpha(config.getValue("guialpha", 0.8)); @@ -534,7 +534,7 @@ void Window::setGuiAlpha() mAlphaChanged = false; } -void Window::loadSkin(const std::string filename) +void Window::loadSkin(const std::string &filename) { const std::string windowId = Window::getId(); @@ -544,7 +544,7 @@ void Window::loadSkin(const std::string filename) logger->log("Loading Window ID '%s'.", windowId.c_str()); - if(filename == "") + if (filename.empty()) logger->error("Window::loadSkin(): Invalid File Name."); // TODO: @@ -562,7 +562,7 @@ void Window::loadSkin(const std::string filename) std::string skinSetImage; skinSetImage = XML::getProperty(rootNode, "image", ""); Image *dBorders = NULL; - if(skinSetImage != "") + if (!skinSetImage.empty()) { logger->log("Window::loadSkin(): defines '%s' as a skin image.", skinSetImage.c_str()); dBorders = resman->getImage("graphics/gui/" + skinSetImage);//"graphics/gui/speech_bubble.png"); @@ -596,7 +596,7 @@ void Window::loadSkin(const std::string filename) std::string partType; partType = XML::getProperty(partNode, "type", "unknown"); // TOP ROW - if(partType == "top-left-corner") + if (partType == "top-left-corner") { const int xPos = XML::getProperty(partNode, "xpos", 0); const int yPos = XML::getProperty(partNode, "ypos", 0); @@ -605,7 +605,7 @@ void Window::loadSkin(const std::string filename) border.grid[0] = dBorders->getSubImage(xPos, yPos, width, height); } - else if(partType == "top-edge") + else if (partType == "top-edge") { const int xPos = XML::getProperty(partNode, "xpos", 0); const int yPos = XML::getProperty(partNode, "ypos", 0); @@ -614,7 +614,7 @@ void Window::loadSkin(const std::string filename) border.grid[1] = dBorders->getSubImage(xPos, yPos, width, height); } - else if(partType == "top-right-corner") + else if (partType == "top-right-corner") { const int xPos = XML::getProperty(partNode, "xpos", 0); const int yPos = XML::getProperty(partNode, "ypos", 0); @@ -625,7 +625,7 @@ void Window::loadSkin(const std::string filename) } // MIDDLE ROW - else if(partType == "left-edge") + else if (partType == "left-edge") { const int xPos = XML::getProperty(partNode, "xpos", 0); const int yPos = XML::getProperty(partNode, "ypos", 0); @@ -634,7 +634,7 @@ void Window::loadSkin(const std::string filename) border.grid[3] = dBorders->getSubImage(xPos, yPos, width, height); } - else if(partType == "bg-quad") + else if (partType == "bg-quad") { const int xPos = XML::getProperty(partNode, "xpos", 0); const int yPos = XML::getProperty(partNode, "ypos", 0); @@ -643,7 +643,7 @@ void Window::loadSkin(const std::string filename) border.grid[4] = dBorders->getSubImage(xPos, yPos, width, height); } - else if(partType == "right-edge") + else if (partType == "right-edge") { const int xPos = XML::getProperty(partNode, "xpos", 0); const int yPos = XML::getProperty(partNode, "ypos", 0); @@ -654,7 +654,7 @@ void Window::loadSkin(const std::string filename) } // BOTTOM ROW - else if(partType == "bottom-left-corner") + else if (partType == "bottom-left-corner") { const int xPos = XML::getProperty(partNode, "xpos", 0); const int yPos = XML::getProperty(partNode, "ypos", 0); @@ -663,7 +663,7 @@ void Window::loadSkin(const std::string filename) border.grid[6] = dBorders->getSubImage(xPos, yPos, width, height); } - else if(partType == "bottom-edge") + else if (partType == "bottom-edge") { const int xPos = XML::getProperty(partNode, "xpos", 0); const int yPos = XML::getProperty(partNode, "ypos", 0); @@ -672,7 +672,7 @@ void Window::loadSkin(const std::string filename) border.grid[7] = dBorders->getSubImage(xPos, yPos, width, height); } - else if(partType == "bottom-right-corner") + else if (partType == "bottom-right-corner") { const int xPos = XML::getProperty(partNode, "xpos", 0); const int yPos = XML::getProperty(partNode, "ypos", 0); diff --git a/src/gui/window.h b/src/gui/window.h index 501ad160..25bf903a 100644 --- a/src/gui/window.h +++ b/src/gui/window.h @@ -264,7 +264,7 @@ class Window : public gcn::Window, gcn::WidgetListener /** * Loads a window skin */ - void loadSkin(const std::string filename); + void loadSkin(const std::string &filename); /** * Adds a widget to the window and sets it at given cell. diff --git a/src/joystick.h b/src/joystick.h index 4e5c3d23..4c5390c2 100644 --- a/src/joystick.h +++ b/src/joystick.h @@ -31,7 +31,7 @@ class Joystick * Number of buttons we can handle. */ enum - { + { MAX_BUTTONS = 6 }; diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp index ecf47573..6c836a62 100644 --- a/src/keyboardconfig.cpp +++ b/src/keyboardconfig.cpp @@ -141,10 +141,10 @@ void KeyboardConfig::makeDefault() bool KeyboardConfig::hasConflicts() { int i, j; -/** - * No need to parse the square matrix: only check one triangle - * that's enough to detect conflicts - */ + /** + * No need to parse the square matrix: only check one triangle + * that's enough to detect conflicts + */ for (i = 0; i < KEY_TOTAL; i++) { for (j = i, j++; j < KEY_TOTAL; j++) @@ -154,7 +154,7 @@ bool KeyboardConfig::hasConflicts() ((j >= KEY_EMOTE_1) && (j <= KEY_EMOTE_12))) || ((i == KEY_TOGGLE_CHAT) && (j == KEY_OK))) && (mKey[i].value == mKey[j].value) - ) + ) { return true; } @@ -172,7 +172,7 @@ int KeyboardConfig::getKeyIndex(int keyValue) const { for (int i = 0; i < KEY_TOTAL; i++) { - if(keyValue == mKey[i].value) + if (keyValue == mKey[i].value) { return i; } @@ -185,7 +185,7 @@ int KeyboardConfig::getKeyEmoteOffset(int keyValue) const { for (int i = KEY_EMOTE_1; i <= KEY_EMOTE_12; i++) { - if(keyValue == mKey[i].value) + if (keyValue == mKey[i].value) { return 1 + i - KEY_EMOTE_1; } diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 01de3b41..d047cc80 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -72,7 +72,7 @@ LocalPlayer::LocalPlayer(Uint32 id, Uint16 job, Map *map): mTarget(NULL), mPickUpTarget(NULL), mTrading(false), mGoingToTarget(false), mTargetTime(-1), mLastAction(-1), - mLastTarget(-1), mWalkingDir(0), + mLastTarget(-1), mWalkingDir(0), mDestX(0), mDestY(0), mInventory(new Inventory(INVENTORY_SIZE)), mStorage(new Inventory(STORAGE_SIZE)) @@ -176,7 +176,7 @@ void LocalPlayer::logic() } void LocalPlayer::setGM() -{ +{ mIsGM = !mIsGM; mNameColor = mIsGM ? 0x009000: 0x202020; setName(getName()); @@ -509,7 +509,7 @@ void LocalPlayer::attack(Being *target, bool keep) int dist_y = target->mY - mY; // Must be standing and be within attack range to continue - if ((mAction != STAND) || (mAttackRange < abs(dist_x)) || + if ((mAction != STAND) || (mAttackRange < abs(dist_x)) || (mAttackRange < abs(dist_y))) return; @@ -654,7 +654,7 @@ void LocalPlayer::loadTargetCursor(std::string filename, int width, int height, mOutRangeImages[size] = currentImageSet; mTargetCursorOutRange[size] = currentCursor; } - else + else { mInRangeImages[size] = currentImageSet; mTargetCursorInRange[size] = currentCursor; @@ -681,7 +681,7 @@ void LocalPlayer::drawTargetCursor(Graphics *graphics, int scrollX, int scrollY) { mTarget->mTargetCursor = mTargetCursorOutRange[cursorSize]->getCurrentImage(); } - else + else { mTarget->mTargetCursor = mTargetCursorInRange[cursorSize]->getCurrentImage(); } diff --git a/src/main.cpp b/src/main.cpp index 1802c378..35943abf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -201,7 +201,7 @@ void setUpdatesDir() { if (pos + 3 < updateHost.length()) { - updates << "updates/" << updateHost.substr(pos + 3) + updates << "updates/" << updateHost.substr(pos + 3) << "/" << loginData.port; updatesDir = updates.str(); } @@ -958,15 +958,15 @@ int main(int argc, char *argv[]) case CHAR_SERVER_STATE: logger->log("State: CHAR_SERVER"); - if (n_server == 1) + if (n_server == 1) { SERVER_INFO *si = *server_info; loginData.hostname = iptostring(si->address); loginData.port = si->port; loginData.updateHost = si->updateHost; state = UPDATE_STATE; - } - else + } + else { int nextState = (options.skipUpdate) ? LOADDATA_STATE : UPDATE_STATE; @@ -974,7 +974,7 @@ int main(int argc, char *argv[]) nextState); positionDialog(currentDialog, screenWidth, screenHeight); - if (options.chooseDefault || options.playername != "") + if (options.chooseDefault || options.playername != "") { ((ServerSelectDialog*) currentDialog)->action( gcn::ActionEvent(NULL, "ok")); diff --git a/src/monster.cpp b/src/monster.cpp index 33703817..4cdcbb11 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -74,7 +74,7 @@ Monster::Monster(Uint32 id, Uint16 job, Map *map): mNameColor = 0xff2020; } -Monster::~Monster() +Monster::~Monster() { if (mText) { diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index 69f462ec..2f5f0fee 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -230,7 +230,7 @@ void BeingHandler::handleMessage(MessageIn *msg) switch (type) { case 0x0a: // Critical Damage - if (dstBeing) + if (dstBeing) dstBeing->showCrit(); case 0x00: // Damage if (dstBeing) @@ -240,7 +240,7 @@ void BeingHandler::handleMessage(MessageIn *msg) break; case 0x02: // Sit - if (srcBeing) + if (srcBeing) { srcBeing->mFrame = 0; srcBeing->setAction(Being::SIT); @@ -248,7 +248,7 @@ void BeingHandler::handleMessage(MessageIn *msg) break; case 0x03: // Stand up - if (srcBeing) + if (srcBeing) { srcBeing->mFrame = 0; srcBeing->setAction(Being::STAND); @@ -446,7 +446,7 @@ void BeingHandler::handleMessage(MessageIn *msg) switch (msg->readInt8()) { case 1: - if (dstBeing->getType() != Being::NPC) + if (dstBeing->getType() != Being::NPC) dstBeing->setAction(Being::DEAD); break; @@ -511,4 +511,3 @@ void BeingHandler::handleMessage(MessageIn *msg) break; } } - diff --git a/src/net/loginhandler.cpp b/src/net/loginhandler.cpp index 4f5f2acc..41314d16 100644 --- a/src/net/loginhandler.cpp +++ b/src/net/loginhandler.cpp @@ -113,7 +113,7 @@ void LoginHandler::handleMessage(MessageIn *msg) iptostring(server_info[i]->address), server_info[i]->port); } - state = CHAR_SERVER_STATE; + state = CHAR_SERVER_STATE; break; case 0x006a: diff --git a/src/net/npchandler.cpp b/src/net/npchandler.cpp index 4e17a27e..ea03537f 100644 --- a/src/net/npchandler.cpp +++ b/src/net/npchandler.cpp @@ -79,7 +79,7 @@ void NPCHandler::handleMessage(MessageIn *msg) case SMSG_NPC_CLOSE: id = msg->readInt32(); if (current_npc == dynamic_cast(beingManager->findBeing(id))) - current_npc = NULL; + current_npc = NULL; break; case SMSG_NPC_NEXT: diff --git a/src/net/partyhandler.cpp b/src/net/partyhandler.cpp index 2437d0a0..03aca66d 100644 --- a/src/net/partyhandler.cpp +++ b/src/net/partyhandler.cpp @@ -34,17 +34,17 @@ PartyHandler::PartyHandler(Party *party) : mParty(party) { static const Uint16 _messages[] = { - SMSG_PARTY_CREATE, - SMSG_PARTY_INFO, - SMSG_PARTY_INVITE, - SMSG_PARTY_INVITED, - SMSG_PARTY_SETTINGS, - SMSG_PARTY_MEMBER_INFO, - SMSG_PARTY_LEAVE, - SMSG_PARTY_UPDATE_HP, - SMSG_PARTY_UPDATE_COORDS, - SMSG_PARTY_MESSAGE, - 0 + SMSG_PARTY_CREATE, + SMSG_PARTY_INFO, + SMSG_PARTY_INVITE, + SMSG_PARTY_INVITED, + SMSG_PARTY_SETTINGS, + SMSG_PARTY_MEMBER_INFO, + SMSG_PARTY_LEAVE, + SMSG_PARTY_UPDATE_HP, + SMSG_PARTY_UPDATE_COORDS, + SMSG_PARTY_MESSAGE, + 0 }; handledMessages = _messages; } @@ -53,70 +53,70 @@ void PartyHandler::handleMessage(MessageIn *msg) { switch (msg->getId()) { - case SMSG_PARTY_CREATE: - mParty->createResponse(msg->readInt8()); - break; - case SMSG_PARTY_INFO: - break; - case SMSG_PARTY_INVITE: - { - std::string nick = msg->readString(24); - int status = msg->readInt8(); - mParty->inviteResponse(nick, status); - break; - } - case SMSG_PARTY_INVITED: - { - int id = msg->readInt32(); - Being *being = beingManager->findBeing(id); - if (being == NULL) - { - break; - } - std::string nick; + case SMSG_PARTY_CREATE: + mParty->createResponse(msg->readInt8()); + break; + case SMSG_PARTY_INFO: + break; + case SMSG_PARTY_INVITE: + { + std::string nick = msg->readString(24); + int status = msg->readInt8(); + mParty->inviteResponse(nick, status); + break; + } + case SMSG_PARTY_INVITED: + { + int id = msg->readInt32(); + Being *being = beingManager->findBeing(id); + if (being == NULL) + { + break; + } + std::string nick; int gender = 0; - std::string partyName = ""; - if (being->getType() != Being::PLAYER) - { - nick = ""; - } - else - { - nick = being->getName(); - gender = being->getGender(); - partyName = msg->readString(24); - } - mParty->invitedAsk(nick, gender, partyName); - break; - } - case SMSG_PARTY_SETTINGS: - break; - case SMSG_PARTY_MEMBER_INFO: - break; - case SMSG_PARTY_LEAVE: - { - /*int id = */msg->readInt32(); - std::string nick = msg->readString(24); - /*int fail = */msg->readInt8(); - mParty->leftResponse(nick); - break; - } - case SMSG_PARTY_UPDATE_HP: - break; - case SMSG_PARTY_UPDATE_COORDS: - break; - case SMSG_PARTY_MESSAGE: - { // new block to enable local variables - int msgLength = msg->readInt16() - 8; - if (msgLength <= 0) - { - return; - } - int id = msg->readInt32(); - Being *being = beingManager->findBeing(id); - std::string chatMsg = msg->readString(msgLength); - mParty->receiveChat(being, chatMsg); - } - break; + std::string partyName = ""; + if (being->getType() != Being::PLAYER) + { + nick = ""; + } + else + { + nick = being->getName(); + gender = being->getGender(); + partyName = msg->readString(24); + } + mParty->invitedAsk(nick, gender, partyName); + break; + } + case SMSG_PARTY_SETTINGS: + break; + case SMSG_PARTY_MEMBER_INFO: + break; + case SMSG_PARTY_LEAVE: + { + /*int id = */msg->readInt32(); + std::string nick = msg->readString(24); + /*int fail = */msg->readInt8(); + mParty->leftResponse(nick); + break; + } + case SMSG_PARTY_UPDATE_HP: + break; + case SMSG_PARTY_UPDATE_COORDS: + break; + case SMSG_PARTY_MESSAGE: + { // new block to enable local variables + int msgLength = msg->readInt16() - 8; + if (msgLength <= 0) + { + return; + } + int id = msg->readInt32(); + Being *being = beingManager->findBeing(id); + std::string chatMsg = msg->readString(msgLength); + mParty->receiveChat(being, chatMsg); + } + break; } } diff --git a/src/net/partyhandler.h b/src/net/partyhandler.h index 08d85ad0..048da9b1 100644 --- a/src/net/partyhandler.h +++ b/src/net/partyhandler.h @@ -29,11 +29,11 @@ class Party; class PartyHandler : public MessageHandler { public: - PartyHandler(Party *party); + PartyHandler(Party *party); - void handleMessage(MessageIn *msg); + void handleMessage(MessageIn *msg); private: - Party *mParty; + Party *mParty; }; #endif diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp index d06f1108..46ded32e 100644 --- a/src/net/playerhandler.cpp +++ b/src/net/playerhandler.cpp @@ -146,7 +146,7 @@ void PlayerHandler::handleMessage(MessageIn *msg) /* Scroll if neccessary */ if (!nearby || (abs(x - player_node->mX) > MAP_TELEPORT_SCROLL_DISTANCE) - || (abs(y - player_node->mY) > MAP_TELEPORT_SCROLL_DISTANCE)) + || (abs(y - player_node->mY) > MAP_TELEPORT_SCROLL_DISTANCE)) { scrollOffsetX = (x - player_node->mX) * 32; scrollOffsetY = (y - player_node->mY) * 32; diff --git a/src/net/tradehandler.cpp b/src/net/tradehandler.cpp index 0c7c9205..c5465835 100644 --- a/src/net/tradehandler.cpp +++ b/src/net/tradehandler.cpp @@ -112,7 +112,7 @@ void TradeHandler::handleMessage(MessageIn *msg) BY_SERVER); break; case 2: // Invite request check failed... - chatWindow->chatLog(_("Trade cancelled due to an unknown reason."), + chatWindow->chatLog(_("Trade cancelled due to an unknown reason."), BY_SERVER); break; case 3: // Trade accepted @@ -191,7 +191,7 @@ void TradeHandler::handleMessage(MessageIn *msg) BY_SERVER); break; default: - chatWindow->chatLog(_("Failed adding item for unknown reason."), + chatWindow->chatLog(_("Failed adding item for unknown reason."), BY_SERVER); break; } diff --git a/src/party.cpp b/src/party.cpp index 70e0d3c2..fe575a37 100644 --- a/src/party.cpp +++ b/src/party.cpp @@ -33,7 +33,9 @@ #include "utils/strprintf.h" Party::Party(ChatWindow *chat, Network *network) : - mChat(chat), mNetwork(network), mInviteListener(network, &mInParty) + mChat(chat), + mNetwork(network), + mInviteListener(network, &mInParty) { } @@ -41,24 +43,24 @@ void Party::respond(const std::string &command, const std::string &args) { if (command == "new" || command == "create") { - create(args); - return; + create(args); + return; } if (command == "leave") { - leave(args); - return; + leave(args); + return; } if (command == "settings") { - mChat->chatLog(_("Not yet implemented!"), BY_SERVER); - return; - /* - MessageOut outMsg(mNetwork); - outMsg.writeInt16(CMSG_PARTY_SETTINGS); - outMsg.writeInt16(0); // Experience - outMsg.writeInt16(0); // Item - */ + mChat->chatLog(_("Not yet implemented!"), BY_SERVER); + return; + /* + MessageOut outMsg(mNetwork); + outMsg.writeInt16(CMSG_PARTY_SETTINGS); + outMsg.writeInt16(0); // Experience + outMsg.writeInt16(0); // Item + */ } mChat->chatLog(_("Party command not known."), BY_SERVER); } @@ -67,8 +69,8 @@ void Party::create(const std::string &party) { if (party == "") { - mChat->chatLog(_("Party name is missing."), BY_SERVER); - return; + mChat->chatLog(_("Party name is missing."), BY_SERVER); + return; } MessageOut outMsg(mNetwork); outMsg.writeInt16(CMSG_PARTY_CREATE); @@ -88,12 +90,12 @@ void Party::createResponse(bool ok) { if (ok) { - mChat->chatLog(_("Party successfully created."), BY_SERVER); - mInParty = true; + mChat->chatLog(_("Party successfully created."), BY_SERVER); + mInParty = true; } else { - mChat->chatLog(_("Could not create party."), BY_SERVER); + mChat->chatLog(_("Could not create party."), BY_SERVER); } } @@ -102,34 +104,34 @@ void Party::inviteResponse(const std::string &nick, int status) switch (status) { case 0: - mChat->chatLog(strprintf(_("%s is already a member of a party."), - nick.c_str()), BY_SERVER); - break; + mChat->chatLog(strprintf(_("%s is already a member of a party."), + nick.c_str()), BY_SERVER); + break; case 1: - mChat->chatLog(strprintf(_("%s refused your invitation."), - nick.c_str()), BY_SERVER); - break; + mChat->chatLog(strprintf(_("%s refused your invitation."), + nick.c_str()), BY_SERVER); + break; case 2: - mChat->chatLog(strprintf(_("%s is now a member of your party."), - nick.c_str()), BY_SERVER); - break; + mChat->chatLog(strprintf(_("%s is now a member of your party."), + nick.c_str()), BY_SERVER); + break; } } void Party::invitedAsk(const std::string &nick, int gender, - const std::string &partyName) + const std::string &partyName) { mPartyName = partyName; /* Quick and nasty - needs redoing */ if (nick == "") { mChat->chatLog(_("You can\'t have a blank party name!"), BY_SERVER); - return; + return; } mCreating = false; ConfirmDialog *dlg = new ConfirmDialog(_("Invite to party"), - strprintf(_("%s invites you to join" - " the %s party, do you accept?"), - nick.c_str(), partyName.c_str())); + strprintf(_("%s invites you to join" + " the %s party, do you accept?"), + nick.c_str(), partyName.c_str())); dlg->addActionListener(&mInviteListener); } @@ -145,7 +147,7 @@ void Party::InviteListener::action(const gcn::ActionEvent &event) void Party::leftResponse(const std::string &nick) { - mChat->chatLog(strprintf(_("%s has left your party."), nick.c_str()), + mChat->chatLog(strprintf(_("%s has left your party."), nick.c_str()), BY_SERVER); } @@ -153,13 +155,13 @@ void Party::receiveChat(Being *being, const std::string &msg) { if (being == NULL) { - return; + return; } if (being->getType() != Being::PLAYER) { - mChat->chatLog(_("Party chat received, but being is not a player"), + mChat->chatLog(_("Party chat received, but being is not a player"), BY_SERVER); - return; + return; } being->setSpeech(msg, SPEECH_TIME); mChat->chatLog(being->getName() + " : " + msg, BY_PARTY); @@ -169,46 +171,46 @@ void Party::help(const std::string &msg) { if (msg == "") { - mChat->chatLog(_("Command: /party "), BY_SERVER); - mChat->chatLog(_("where can be one of:"), BY_SERVER); - mChat->chatLog(_(" /new"), BY_SERVER); - mChat->chatLog(_(" /create"), BY_SERVER); - mChat->chatLog(_(" /prefix"), BY_SERVER); - mChat->chatLog(_(" /leave"), BY_SERVER); - mChat->chatLog(_("This command implements the partying function."), - BY_SERVER); - mChat->chatLog(_("Type /help party for further help."), - BY_SERVER); - return; + mChat->chatLog(_("Command: /party "), BY_SERVER); + mChat->chatLog(_("where can be one of:"), BY_SERVER); + mChat->chatLog(_(" /new"), BY_SERVER); + mChat->chatLog(_(" /create"), BY_SERVER); + mChat->chatLog(_(" /prefix"), BY_SERVER); + mChat->chatLog(_(" /leave"), BY_SERVER); + mChat->chatLog(_("This command implements the partying function."), + BY_SERVER); + mChat->chatLog(_("Type /help party for further help."), + BY_SERVER); + return; } if (msg == "new" || msg == "create") { - mChat->chatLog(_("Command: /party new "), BY_SERVER); - mChat->chatLog(_("Command: /party create "), BY_SERVER); - mChat->chatLog(_("These commands create a new party chatLog(_("Command: /party new "), BY_SERVER); + mChat->chatLog(_("Command: /party create "), BY_SERVER); + mChat->chatLog(_("These commands create a new party chatLog(_("Command: /party prefix "), BY_SERVER); - mChat->chatLog(_("This command sets the party prefix character."), - BY_SERVER); - mChat->chatLog(_("Any message preceded by is sent to " - "the party instead of everyone."), BY_SERVER); - mChat->chatLog(_("Command: /party prefix"), BY_SERVER); - mChat->chatLog(_("This command reports the current party prefix " - "character."), BY_SERVER); - return; + mChat->chatLog(_("Command: /party prefix "), BY_SERVER); + mChat->chatLog(_("This command sets the party prefix character."), + BY_SERVER); + mChat->chatLog(_("Any message preceded by is sent to " + "the party instead of everyone."), BY_SERVER); + mChat->chatLog(_("Command: /party prefix"), BY_SERVER); + mChat->chatLog(_("This command reports the current party prefix " + "character."), BY_SERVER); + return; } //if (msg == "settings") //if (msg == "info") if (msg == "leave") { - mChat->chatLog(_("Command: /party leave"), BY_SERVER); - mChat->chatLog(_("This command causes the player to leave the party."), - BY_SERVER); - return; + mChat->chatLog(_("Command: /party leave"), BY_SERVER); + mChat->chatLog(_("This command causes the player to leave the party."), + BY_SERVER); + return; } mChat->chatLog(_("Unknown /party command."), BY_SERVER); mChat->chatLog(_("Type /help party for a list of options."), BY_SERVER); diff --git a/src/party.h b/src/party.h index 5643f894..98252c37 100644 --- a/src/party.h +++ b/src/party.h @@ -33,40 +33,44 @@ class Network; class Party { - public: - Party(ChatWindow *chat, Network *network); - void respond(const std::string &command, const std::string &args); + public: + Party(ChatWindow *chat, Network *network); + void respond(const std::string &command, const std::string &args); - void create(const std::string &party); - void leave(const std::string &args); + void create(const std::string &party); + void leave(const std::string &args); - void createResponse(bool ok); - void inviteResponse(const std::string &nick, int status); - void invitedAsk(const std::string &nick, int gender, - const std::string &partyName); - void leftResponse(const std::string &nick); - void receiveChat(Being *being, const std::string &msg); + void createResponse(bool ok); + void inviteResponse(const std::string &nick, int status); + void invitedAsk(const std::string &nick, int gender, + const std::string &partyName); + void leftResponse(const std::string &nick); + void receiveChat(Being *being, const std::string &msg); - void help(const std::string &msg); - private: - ChatWindow *mChat; - std::string mPartyName; - Network *mNetwork; - bool mInParty; - bool mCreating; /**< Used to give an appropriate response to - failure */ - PartyHandler *handler; + void help(const std::string &msg); - class InviteListener : public gcn::ActionListener - { - public: - InviteListener(Network *network, bool *inParty) : - mNetwork(network), mInParty(inParty) {}; - void action(const gcn::ActionEvent &event); - Network *mNetwork; - private: - bool *mInParty; - }; - InviteListener mInviteListener; + private: + ChatWindow *mChat; + std::string mPartyName; + Network *mNetwork; + bool mInParty; + bool mCreating; /**< Used to give an appropriate response to + failure */ + PartyHandler *handler; + + class InviteListener : public gcn::ActionListener + { + public: + InviteListener(Network *network, bool *inParty) : + mNetwork(network), + mInParty(inParty) + {} + void action(const gcn::ActionEvent &event); + Network *mNetwork; + private: + bool *mInParty; + }; + InviteListener mInviteListener; }; + #endif diff --git a/src/resources/buddylist.cpp b/src/resources/buddylist.cpp index 541acabe..719ecab1 100644 --- a/src/resources/buddylist.cpp +++ b/src/resources/buddylist.cpp @@ -55,9 +55,9 @@ void BuddyList::loadFile() char *buddy = new char[LEN_MAX_USERNAME]; inputStream.getline(buddy, LEN_MAX_USERNAME); // Ugly ? - if(strcmp(buddy,"")) mBuddylist.push_back(buddy); + if (strcmp(buddy, "")) mBuddylist.push_back(buddy); delete [] buddy; - } while(!inputStream.eof()); + } while (!inputStream.eof()); // Read buddy and close file inputStream.close(); diff --git a/src/resources/colordb.cpp b/src/resources/colordb.cpp index 7456f0e4..61ea4bc0 100644 --- a/src/resources/colordb.cpp +++ b/src/resources/colordb.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 Aethyra; if not, write to the Free Software Foundation, + * along with Aethyra; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -101,7 +101,7 @@ void ColorDB::unload() std::string& ColorDB::get(int id) { - if(!mLoaded) + if (!mLoaded) load(); ColorIterator i = mColors.find(id); diff --git a/src/resources/colordb.h b/src/resources/colordb.h index da36048a..2166abcf 100644 --- a/src/resources/colordb.h +++ b/src/resources/colordb.h @@ -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 Aethyra; if not, write to the Free Software Foundation, + * along with Aethyra; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/src/resources/emotedb.cpp b/src/resources/emotedb.cpp index adc1635c..ac41b59c 100644 --- a/src/resources/emotedb.cpp +++ b/src/resources/emotedb.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 Aethyra; if not, write to the Free Software Foundation, + * along with Aethyra; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/src/resources/emotedb.h b/src/resources/emotedb.h index 0962edad..2b9dbbc2 100644 --- a/src/resources/emotedb.h +++ b/src/resources/emotedb.h @@ -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 Aethyra; if not, write to the Free Software Foundation, + * along with Aethyra; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/src/resources/monsterinfo.h b/src/resources/monsterinfo.h index 75464035..359791fd 100644 --- a/src/resources/monsterinfo.h +++ b/src/resources/monsterinfo.h @@ -67,13 +67,13 @@ class MonsterInfo void addParticleEffect(std::string filename); - const std::string& getName() const + const std::string& getName() const { return mName; } - const std::list& getSprites() const + const std::list& getSprites() const { return mSprites; } - Being::TargetCursorSize getTargetCursorSize() const + Being::TargetCursorSize getTargetCursorSize() const { return mTargetCursorSize; } std::string getSound(MonsterSoundEvent event) const; @@ -83,7 +83,7 @@ class MonsterInfo void addAttackParticleEffect(const std::string &particleEffect) { mAttackParticle = particleEffect; } - const std::list& getParticleEffects() const + const std::list& getParticleEffects() const { return mParticleEffects; } private: diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h index 7996e816..3a97c05f 100644 --- a/src/resources/resourcemanager.h +++ b/src/resources/resourcemanager.h @@ -98,8 +98,9 @@ class ResourceManager bool isDirectory(const std::string &path); /** - * Returns the real path to a file - * + * Returns the real path to a file. Note that this method will always + * return a path, it does not check whether the file exists. + * * @param file The file to get the real path to. * @return The real path. */ -- cgit v1.2.3-70-g09d2 From e9df7438f734341bf7c906c33ac8a82a7733e204 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Mon, 9 Feb 2009 17:13:45 -0700 Subject: Removed tab characters. Signed-off-by: Ira Rice --- packaging/windows/make-translations.vbs | 40 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/packaging/windows/make-translations.vbs b/packaging/windows/make-translations.vbs index dee9f2bb..4d2b44c3 100644 --- a/packaging/windows/make-translations.vbs +++ b/packaging/windows/make-translations.vbs @@ -3,15 +3,15 @@ Set WshShell = CreateObject("WScript.Shell") Dim s, infile, outfile, command Function CreateFolderIfNonexistent(folder) - if not fso.FolderExists(folder) then - fso.CreateFolder(folder) - end if + if not fso.FolderExists(folder) then + fso.CreateFolder(folder) + end if end Function 'check for existence of msgfmt if not fso.FileExists("msgfmt.exe") then - WScript.echo "msgfmt.exe not found. Please get gettext for windows from http://gnuwin32.sourceforge.net/packages/gettext.htm and copy the files msgfmt.exe and all dll files from the gettext/bin directory into this directory and run this script again." - WScript.Quit(1) + WScript.echo "msgfmt.exe not found. Please get gettext for windows from http://gnuwin32.sourceforge.net/packages/gettext.htm and copy the files msgfmt.exe and all dll files from the gettext/bin directory into this directory and run this script again." + WScript.Quit(1) end if CreateFolderIfNonexistent("..\..\translations\") @@ -22,21 +22,21 @@ Set stream = fso.GetFile("..\..\po\LINGUAS").OpenAsTextStream(1, 0) 'iterate contents of translations file translations = 0 do while not stream.AtEndOfStream - s = stream.ReadLine() - if inStr(s, "#") = false then - 'create the output directory - CreateFolderIfNonexistent("..\..\translations\" + s) - CreateFolderIfNonexistent("..\..\translations\" + s + "\LC_MESSAGES") - 'build the translate command - infile = "../../po/" + s + ".po" - outfile = "../../translations/" + s +"/LC_MESSAGES/aethyra.mo" - command = "msgfmt -c -o " + outfile + " " + infile - 'execute translate command - errval = WshShell.run(command, 0, true) - if errval = 0 then - translations = translations + 1 - end if - end if + s = stream.ReadLine() + if inStr(s, "#") = false then + 'create the output directory + CreateFolderIfNonexistent("..\..\translations\" + s) + CreateFolderIfNonexistent("..\..\translations\" + s + "\LC_MESSAGES") + 'build the translate command + infile = "../../po/" + s + ".po" + outfile = "../../translations/" + s +"/LC_MESSAGES/aethyra.mo" + command = "msgfmt -c -o " + outfile + " " + infile + 'execute translate command + errval = WshShell.run(command, 0, true) + if errval = 0 then + translations = translations + 1 + end if + end if loop WScript.echo translations, " translations compiled." -- cgit v1.2.3-70-g09d2 From ac468007930e8f9531403fbfb683903cfa263307 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Wed, 4 Feb 2009 01:14:28 +0100 Subject: Fixed up the copyright headers Decision is to go with exact authors when some file is basically done by one person, and in most other cases assign TMW or Aethyra team copyright when multiple people from those teams have been involved. Also, the first summary line should now contain the subset of functionality that the file is part of, not the name of the whole project. --- src/effectmanager.cpp | 14 ++++++------ src/effectmanager.h | 21 ++++++++--------- src/emoteshortcut.cpp | 14 ++++++------ src/emoteshortcut.h | 18 +++++++-------- src/gui/colour.cpp | 40 ++++++++++++++++----------------- src/gui/colour.h | 46 +++++++++++++++++++------------------- src/gui/emotecontainer.cpp | 18 +++++++-------- src/gui/emotecontainer.h | 24 ++++++++++---------- src/gui/emoteshortcutcontainer.cpp | 34 ++++++++++++++-------------- src/gui/emoteshortcutcontainer.h | 18 +++++++-------- src/gui/emotewindow.cpp | 16 ++++++------- src/gui/emotewindow.h | 14 ++++++------ src/gui/recorder.cpp | 10 ++++----- src/gui/recorder.h | 5 +++-- src/gui/setup_colours.cpp | 40 ++++++++++++++++----------------- src/gui/setup_colours.h | 44 ++++++++++++++++++------------------ src/text.cpp | 40 +++++++++++++++++---------------- src/text.h | 40 +++++++++++++++++---------------- src/textmanager.cpp | 39 ++++++++++++++++---------------- src/textmanager.h | 39 ++++++++++++++++---------------- 20 files changed, 269 insertions(+), 265 deletions(-) diff --git a/src/effectmanager.cpp b/src/effectmanager.cpp index 83cdf382..f004a450 100644 --- a/src/effectmanager.cpp +++ b/src/effectmanager.cpp @@ -1,8 +1,9 @@ /* - * The Mana World - * Copyright 2008 The Mana World Development Team + * An effects manager + * Copyright (C) 2008 Fate + * Copyright (C) 2008 Chuck Miller * - * This file is part of Aethyra. + * This file is part of 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 @@ -40,7 +41,7 @@ EffectManager::EffectManager() else { logger->log("Effects are now loading"); - } + } for_each_xml_child_node(node, root) { @@ -78,7 +79,7 @@ bool EffectManager::trigger(int id, Being* being) } if (!(*i).SFX.empty()) sound.playSfx((*i).SFX); - break; + break; } } return rValue; @@ -96,9 +97,8 @@ bool EffectManager::trigger(int id, int x, int y) particleEngine->addEffect((*i).GFX, x, y); if (!(*i).SFX.empty()) sound.playSfx((*i).SFX); - break; + break; } } return rValue; } - diff --git a/src/effectmanager.h b/src/effectmanager.h index 619b8e0d..a06ecbc7 100644 --- a/src/effectmanager.h +++ b/src/effectmanager.h @@ -1,8 +1,9 @@ /* - * The Mana World - * Copyright 2008 The Mana World Development Team + * An effects manager + * Copyright (C) 2008 Fate + * Copyright (C) 2008 Chuck Miller * - * This file is part of Aethyra. + * This file is part of 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 @@ -19,8 +20,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _EFFECT_MANAGER_H -#define _EFFECT_MANAGER_H +#ifndef EFFECT_MANAGER_H +#define EFFECT_MANAGER_H #include #include @@ -29,7 +30,6 @@ class Being; class EffectManager { - public: struct EffectDescription { @@ -38,28 +38,25 @@ class EffectManager std::string SFX; }; - EffectManager(); - ~EffectManager(); /** * Triggers a effect with the id, at * the specified being. */ - bool trigger(int id, Being* being); + bool trigger(int id, Being* being); /** * Triggers a effect with the id, at * the specified x and y coordinate. */ - bool trigger(int id, int x, int y); + bool trigger(int id, int x, int y); private: std::list mEffects; - }; extern EffectManager *effectManager; -#endif // _EFFECT_MANAGER_H +#endif // EFFECT_MANAGER_H diff --git a/src/emoteshortcut.cpp b/src/emoteshortcut.cpp index 66989d44..807fa3a2 100644 --- a/src/emoteshortcut.cpp +++ b/src/emoteshortcut.cpp @@ -1,22 +1,22 @@ /* - * Aethyra - * Copyright 2009 Aethyra Development Team + * Extended support for activating emotes + * Copyright (C) 2009 Aethyra Development Team * - * This file is part of Aethyra. + * This file is part of The Mana World. * - * Aethyra is free software; you can redistribute it and/or modify + * 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 * the Free Software Foundation; either version 2 of the License, or * any later version. * - * Aethyra is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Aethyra; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "emoteshortcut.h" diff --git a/src/emoteshortcut.h b/src/emoteshortcut.h index 3f907e1b..ceb51a9b 100644 --- a/src/emoteshortcut.h +++ b/src/emoteshortcut.h @@ -1,26 +1,26 @@ /* - * Aethyra - * Copyright 2009 Aethyra Development Team + * Extended support for activating emotes + * Copyright (C) 2009 Aethyra Development Team * - * This file is part of Aethyra. + * This file is part of The Mana World. * - * Aethyra is free software; you can redistribute it and/or modify + * 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 * the Free Software Foundation; either version 2 of the License, or * any later version. * - * Aethyra is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Aethyra; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef EMOTESHORTCUT_H__ -#define EMOTESHORTCUT_H__ +#ifndef EMOTESHORTCUT_H +#define EMOTESHORTCUT_H #define SHORTCUT_EMOTES 12 diff --git a/src/gui/colour.cpp b/src/gui/colour.cpp index c4505c2f..cdb5a3fd 100644 --- a/src/gui/colour.cpp +++ b/src/gui/colour.cpp @@ -1,23 +1,23 @@ -/*************************************************************************** - * Copyright (C) 2008 by Douglas Boffey * - * * - * DougABoffey@netscape.net * - * 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 * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed with The Mana Experiment * - * in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ +/* + * Configurable text colors + * Copyright (C) 2008 Douglas Boffey + * + * This file is part of 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 + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include "colour.h" diff --git a/src/gui/colour.h b/src/gui/colour.h index d0349b7d..6ea02840 100644 --- a/src/gui/colour.h +++ b/src/gui/colour.h @@ -1,26 +1,26 @@ -/*************************************************************************** - * Copyright (C) 2008 by Douglas Boffey * - * * - * DougABoffey@netscape.net * - * 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 * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed with The Mana Experiment * - * in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef _COLOUR_H -#define _COLOUR_H +/* + * Configurable text colors + * Copyright (C) 2008 Douglas Boffey + * + * This file is part of 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 + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef COLOUR_H +#define COLOUR_H #include #include diff --git a/src/gui/emotecontainer.cpp b/src/gui/emotecontainer.cpp index fa63d4bb..94ce9736 100644 --- a/src/gui/emotecontainer.cpp +++ b/src/gui/emotecontainer.cpp @@ -1,22 +1,22 @@ /* - * Aethyra - * Copyright 2009 Aethyra Development Team + * Extended support for activating emotes + * Copyright (C) 2009 Aethyra Development Team * - * This file is part of Aethyra. + * This file is part of The Mana World. * - * Aethyra is free software; you can redistribute it and/or modify + * 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 * the Free Software Foundation; either version 2 of the License, or * any later version. * - * Aethyra is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Aethyra; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include @@ -90,7 +90,7 @@ void EmoteContainer::draw(gcn::Graphics *graphics) { int emoteX = ((i) % columns) * gridWidth; int emoteY = ((i) / columns) * gridHeight; - + // Draw emote icon mEmoteImg[i]->draw(static_cast(graphics), emoteX, emoteY); @@ -121,7 +121,7 @@ void EmoteContainer::recalculateHeight() setHeight(height); } -int EmoteContainer::getSelectedEmote() +int EmoteContainer::getSelectedEmote() { if (mSelectedEmoteIndex == NO_EMOTE) return 0; diff --git a/src/gui/emotecontainer.h b/src/gui/emotecontainer.h index 5a2b8c2e..fefce793 100644 --- a/src/gui/emotecontainer.h +++ b/src/gui/emotecontainer.h @@ -1,26 +1,26 @@ /* - * Aethyra - * Copyright 2009 Aethyra Development Team + * Extended support for activating emotes + * Copyright (C) 2009 Aethyra Development Team * - * This file is part of Aethyra. + * This file is part of The Mana World. * - * Aethyra is free software; you can redistribute it and/or modify + * 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 * the Free Software Foundation; either version 2 of the License, or * any later version. * - * Aethyra is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Aethyra; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef EMOTECONTAINER_H__ -#define EMOTECONTAINER_H__ +#ifndef EMOTECONTAINER_H +#define EMOTECONTAINER_H #include #include @@ -41,7 +41,7 @@ namespace gcn { * * \ingroup GUI */ -class EmoteContainer : public gcn::Widget, +class EmoteContainer : public gcn::Widget, public gcn::MouseListener, public gcn::WidgetListener { @@ -101,8 +101,8 @@ class EmoteContainer : public gcn::Widget, private: /** - - * Sets the currently selected emote. Invalid (e.g., negative) indices set `no emotr'. + * Sets the currently selected emote. Invalid (e.g., negative) indices + * set `no emotr'. */ void setSelectedEmoteIndex(int index); diff --git a/src/gui/emoteshortcutcontainer.cpp b/src/gui/emoteshortcutcontainer.cpp index e35d037f..b66592c1 100644 --- a/src/gui/emoteshortcutcontainer.cpp +++ b/src/gui/emoteshortcutcontainer.cpp @@ -1,22 +1,22 @@ /* - * Aethyra - * Copyright 2009 Aethyra Development Team + * Extended support for activating emotes + * Copyright (C) 2009 Aethyra Development Team * - * This file is part of Aethyra. + * This file is part of The Mana World. * - * Aethyra is free software; you can redistribute it and/or modify + * 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 * the Free Software Foundation; either version 2 of the License, or * any later version. * - * Aethyra is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Aethyra; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "emoteshortcutcontainer.h" @@ -121,14 +121,14 @@ void EmoteShortcutContainer::draw(gcn::Graphics *graphics) void EmoteShortcutContainer::mouseDragged(gcn::MouseEvent &event) { - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == gcn::MouseEvent::LEFT) { - if (!mEmoteMoved && mEmoteClicked) + if (!mEmoteMoved && mEmoteClicked) { const int index = getIndexFromGrid(event.getX(), event.getY()); const int emoteId = emoteShortcut->getEmote(index); - if (index == -1) + if (index == -1) { return; } @@ -139,7 +139,7 @@ void EmoteShortcutContainer::mouseDragged(gcn::MouseEvent &event) emoteShortcut->removeEmote(index); } } - if (mEmoteMoved) + if (mEmoteMoved) { mCursorPosX = event.getX(); mCursorPosY = event.getY(); @@ -151,18 +151,18 @@ void EmoteShortcutContainer::mousePressed(gcn::MouseEvent &event) { const int index = getIndexFromGrid(event.getX(), event.getY()); - if (index == -1) + if (index == -1) { return; } // Stores the selected emote if there is one. - if (emoteShortcut->isEmoteSelected()) + if (emoteShortcut->isEmoteSelected()) { emoteShortcut->setEmote(index); emoteShortcut->setEmoteSelected(0); } - else if (emoteShortcut->getEmote(index)) + else if (emoteShortcut->getEmote(index)) { mEmoteClicked = true; } @@ -179,13 +179,13 @@ void EmoteShortcutContainer::mouseReleased(gcn::MouseEvent &event) emoteShortcut->setEmoteSelected(0); } - if (index == -1) + if (index == -1) { mEmoteMoved = 0; return; } - if (mEmoteMoved) + if (mEmoteMoved) { emoteShortcut->setEmotes(index, mEmoteMoved); mEmoteMoved = 0; @@ -195,7 +195,7 @@ void EmoteShortcutContainer::mouseReleased(gcn::MouseEvent &event) emoteShortcut->useEmote(index + 1); } - if (mEmoteClicked) + if (mEmoteClicked) { mEmoteClicked = false; } diff --git a/src/gui/emoteshortcutcontainer.h b/src/gui/emoteshortcutcontainer.h index e8d87b60..d32a9f79 100644 --- a/src/gui/emoteshortcutcontainer.h +++ b/src/gui/emoteshortcutcontainer.h @@ -1,26 +1,26 @@ /* - * Aethyra - * Copyright 2009 Aethyra Development Team + * Extended support for activating emotes + * Copyright (C) 2009 Aethyra Development Team * - * This file is part of Aethyra. + * This file is part of The Mana World. * - * Aethyra is free software; you can redistribute it and/or modify + * 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 * the Free Software Foundation; either version 2 of the License, or * any later version. * - * Aethyra is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Aethyra; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef EMOTESHORTCUTCONTAINER_H__ -#define EMOTESHORTCUTCONTAINER_H__ +#ifndef EMOTESHORTCUTCONTAINER_H +#define EMOTESHORTCUTCONTAINER_H #include diff --git a/src/gui/emotewindow.cpp b/src/gui/emotewindow.cpp index 3fa96a6d..f4a8999a 100644 --- a/src/gui/emotewindow.cpp +++ b/src/gui/emotewindow.cpp @@ -1,22 +1,22 @@ /* - * Aethyra - * Copyright 2009 Aethyra Development Team + * Extended support for activating emotes + * Copyright (C) 2009 Aethyra Development Team * - * This file is part of Aethyra. + * This file is part of The Mana World. * - * Aethyra is free software; you can redistribute it and/or modify + * 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 * the Free Software Foundation; either version 2 of the License, or * any later version. * - * Aethyra is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Aethyra; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "button.h" @@ -29,7 +29,7 @@ #include "../localplayer.h" -#include "../utils/gettext.h" +#include "../utils/gettext.h" #include "../utils/tostring.h" EmoteWindow::EmoteWindow(): diff --git a/src/gui/emotewindow.h b/src/gui/emotewindow.h index c642ff6f..8af24a7b 100644 --- a/src/gui/emotewindow.h +++ b/src/gui/emotewindow.h @@ -1,22 +1,22 @@ /* - * Aethyra - * Copyright 2009 Aethyra Development Team + * Extended support for activating emotes + * Copyright (C) 2009 Aethyra Development Team * - * This file is part of Aethyra. + * This file is part of The Mana World. * - * Aethyra is free software; you can redistribute it and/or modify + * 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 * the Free Software Foundation; either version 2 of the License, or * any later version. * - * Aethyra is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Aethyra; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef EMOTEWINDOW_H diff --git a/src/gui/recorder.cpp b/src/gui/recorder.cpp index 2e2ee8a5..c7989495 100644 --- a/src/gui/recorder.cpp +++ b/src/gui/recorder.cpp @@ -1,15 +1,15 @@ /* - * The Mana World - * Copyright 2004 The Mana World Development Team + * A chat recorder + * Copyright (C) 2008 Lloyd Bryant * - * This file is part of The Mana World. + * This file is part of Aethyra. * - * The Mana World is free software; you can redistribute it and/or modify + * 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 * the Free Software Foundation; either version 2 of the License, or * any later version. * - * The Mana World is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/src/gui/recorder.h b/src/gui/recorder.h index 707f08ab..4f41ff42 100644 --- a/src/gui/recorder.h +++ b/src/gui/recorder.h @@ -1,6 +1,6 @@ /* - * Aethyra - * Copyright (C) 2008 Aethyra Development Team + * A chat recorder + * Copyright (C) 2008 Lloyd Bryant * * This file is part of Aethyra. * @@ -72,4 +72,5 @@ class Recorder : public Window, public gcn::ActionListener std::ofstream mStream; }; + #endif diff --git a/src/gui/setup_colours.cpp b/src/gui/setup_colours.cpp index acc28b1f..49e08aeb 100644 --- a/src/gui/setup_colours.cpp +++ b/src/gui/setup_colours.cpp @@ -1,23 +1,23 @@ -/*************************************************************************** - * Copyright (C) 2008 by Douglas Boffey * - * * - * DougABoffey@netscape.net * - * 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 * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed with The Mana Experiment * - * in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ +/* + * Configurable text colors + * Copyright (C) 2008 Douglas Boffey + * + * This file is part of 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 + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include diff --git a/src/gui/setup_colours.h b/src/gui/setup_colours.h index f56daa60..57d9e304 100644 --- a/src/gui/setup_colours.h +++ b/src/gui/setup_colours.h @@ -1,26 +1,26 @@ -/*************************************************************************** - * Copyright (C) 2008 by Douglas Boffey * - * * - * DougABoffey@netscape.net * - * 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 * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed with The Mana Experiment * - * in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ +/* + * Configurable text colors + * Copyright (C) 2008 Douglas Boffey + * + * This file is part of 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 + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ -#ifndef _SETUP_COLOURS_H -#define _SETUP_COLOURS_H +#ifndef SETUP_COLOURS_H +#define SETUP_COLOURS_H #include diff --git a/src/text.cpp b/src/text.cpp index 8f93f157..5a015139 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -1,22 +1,24 @@ -/*************************************************************************** - * Copyright (C) 2008 by Douglas Boffey * - * * - * DougABoffey@netscape.net * - * 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 * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ +/* + * Support for non-overlapping floating text + * Copyright (C) 2008 Douglas Boffey + * Copyright (C) 2008 The Mana World Development Team + * + * This file is part of Aethyra. + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include diff --git a/src/text.h b/src/text.h index c898bbe3..d62a125d 100644 --- a/src/text.h +++ b/src/text.h @@ -1,22 +1,24 @@ -/*************************************************************************** - * Copyright (C) 2008 by Douglas Boffey * - * * - * DougABoffey@netscape.net * - * 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 * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ +/* + * Support for non-overlapping floating text + * Copyright (C) 2008 Douglas Boffey + * Copyright (C) 2008 The Mana World Development Team + * + * This file is part of Aethyra. + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #ifndef TEXT_H #define TEXT_H diff --git a/src/textmanager.cpp b/src/textmanager.cpp index d40ba4d2..0cf09478 100644 --- a/src/textmanager.cpp +++ b/src/textmanager.cpp @@ -1,22 +1,23 @@ -/*************************************************************************** - * Copyright (C) 2008 by Douglas Boffey * - * * - * DougABoffey@netscape.net * - * 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 * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ +/* + * Support for non-overlapping floating text + * Copyright (C) 2008 Douglas Boffey + * + * This file is part of Aethyra. + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include diff --git a/src/textmanager.h b/src/textmanager.h index b1e10f08..d6485e34 100644 --- a/src/textmanager.h +++ b/src/textmanager.h @@ -1,22 +1,23 @@ -/*************************************************************************** - * Copyright (C) 2008 by Douglas Boffey * - * * - * DougABoffey@netscape.net * - * 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 * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ +/* + * Support for non-overlapping floating text + * Copyright (C) 2008 Douglas Boffey + * + * This file is part of Aethyra. + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #ifndef TEXTMANAGER_H #define TEXTMANAGER_H -- cgit v1.2.3-70-g09d2 From 24dee6b42b461f8e3504b0f03ea856283d3599d3 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Mon, 9 Feb 2009 17:39:10 -0700 Subject: Removed a getImage() function I added. Considered renaming it to getBaseImage() instead, but after looking at it a bit more, I can't particularly see anything that this can be used for yet. Was originally added when I was toying around with an idea for how to get image transparency to work under SDL, but which ended coming up busted. Signed-off-by: Ira Rice --- src/resources/image.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/resources/image.h b/src/resources/image.h index 9af10fda..fe3081ac 100644 --- a/src/resources/image.h +++ b/src/resources/image.h @@ -93,12 +93,6 @@ class Image : public Resource */ virtual void unload(); - /** - * Returns the image. - */ - virtual const Image* getImage() const - { return this; } - /** * Returns the width of the image. */ @@ -188,12 +182,6 @@ class SubImage : public Image */ ~SubImage(); - /** - * Returns the image. - */ - virtual const Image* getImage() const - { return mParent; } - /** * Creates a new image with the desired clipping rectangle. * -- cgit v1.2.3-70-g09d2 From 62d5da97187d81aece0374b114e1444b757ac873 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Mon, 9 Feb 2009 17:47:11 -0700 Subject: Made progress bars in the status window a bit bigger based on a suggestion by Grimmjow. Signed-off-by: Ira Rice --- src/gui/status.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/status.cpp b/src/gui/status.cpp index e0e43b36..271b6f1e 100644 --- a/src/gui/status.cpp +++ b/src/gui/status.cpp @@ -41,7 +41,7 @@ StatusWindow::StatusWindow(LocalPlayer *player): setWindowName(_("Status")); setCloseButton(true); setDefaultSize((windowContainer->getWidth() - 365) / 2, - (windowContainer->getHeight() - 255) / 2, 400, 335); + (windowContainer->getHeight() - 255) / 2, 400, 345); // ---------------------- // Status Part @@ -116,13 +116,13 @@ StatusWindow::StatusWindow(LocalPlayer *player): place(0, 0, mLvlLabel, 3); place(5, 0, mJobLvlLabel, 3); place(8, 0, mGpLabel, 3); - place(1, 1, mHpLabel); + place(1, 1, mHpLabel).setPadding(3); place(2, 1, mHpBar, 3); - place(6, 1, mXpLabel); + place(6, 1, mXpLabel).setPadding(3); place(7, 1, mXpBar, 3); - place(1, 2, mMpLabel); + place(1, 2, mMpLabel).setPadding(3); place(2, 2, mMpBar, 3); - place(6, 2, mJobLabel); + place(6, 2, mJobLabel).setPadding(3); place(7, 2, mJobBar, 3); place.getCell().matchColWidth(0, 1); place = getPlacer(0, 3); -- cgit v1.2.3-70-g09d2 From a8a992ade40c9d68c9faec1cc3a54e7f064fb9d5 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Mon, 9 Feb 2009 18:15:15 -0700 Subject: Fixed width of the weight label, as noticed by Grimmjow. Signed-off-by: Ira Rice --- src/gui/inventorywindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index b9fe1c90..af3b29a2 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -87,12 +87,12 @@ InventoryWindow::InventoryWindow(int invSize): mWeightBar = new ProgressBar(1.0f, 100, 20, 0, 0, 255); setMinHeight(130); - setMinWidth(mWeightLabel->getWidth() + mSlotsLabel->getWidth() + 310); + setMinWidth(mWeightLabel->getWidth() + mSlotsLabel->getWidth() + 280); place(0, 0, mWeightLabel).setPadding(3); - place(1, 0, mWeightBar, 2); - place(3, 0, mSlotsLabel).setPadding(3); - place(4, 0, mSlotsBar, 2); + place(1, 0, mWeightBar, 3); + place(4, 0, mSlotsLabel).setPadding(3); + place(5, 0, mSlotsBar, 2); place(0, 1, mInvenScroll, 7, 4); place(5, 5, mDropButton); place(6, 5, mUseButton); -- cgit v1.2.3-70-g09d2