diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-10-10 17:19:42 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-10-10 17:19:42 +0000 |
commit | b2c5d720fdf88e7e5e8ff6921e9d01cfe009a074 (patch) | |
tree | 55eb57830b45538ecdccd82769ddeba40e57be4e | |
parent | 61430703402d9f98fdf1a3f748df4f87586f73cb (diff) | |
download | mana-b2c5d720fdf88e7e5e8ff6921e9d01cfe009a074.tar.gz mana-b2c5d720fdf88e7e5e8ff6921e9d01cfe009a074.tar.bz2 mana-b2c5d720fdf88e7e5e8ff6921e9d01cfe009a074.tar.xz mana-b2c5d720fdf88e7e5e8ff6921e9d01cfe009a074.zip |
Introduced new window shortcuts and corrected position of job xp bar. Also
corrected strange commit by ElvenProgrammer.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | README | 25 | ||||
-rw-r--r-- | data/help/changes.txt | 2 | ||||
-rw-r--r-- | data/help/commands.txt | 33 | ||||
-rw-r--r-- | src/game.cpp | 127 | ||||
-rw-r--r-- | src/gui/browserbox.cpp | 2 | ||||
-rw-r--r-- | src/gui/gui.cpp | 2 | ||||
-rw-r--r-- | src/gui/status.cpp | 44 | ||||
-rw-r--r-- | src/properties.h | 84 | ||||
-rw-r--r-- | src/resources/iteminfo.cpp | 115 | ||||
-rw-r--r-- | src/resources/iteminfo.h | 4 | ||||
-rw-r--r-- | src/sprite.h | 65 |
13 files changed, 270 insertions, 238 deletions
@@ -8,6 +8,9 @@ data/graphics/gui/rpgfont_wider.png, src/gui/browserbox.cpp, src/gui/gui.cpp: Pajarico added more international characters to the fixed font and rpg font. + * src/game.cpp, README, data/helps/commands.txt: Introduced new window + shortcuts. + * src/gui/status.cpp: Corrected position of job XP bar. 2005-10-09 Yohann Ferreira <bertram@cegetel.net> @@ -6,10 +6,12 @@ - Added messagebox on error for MacOS X - Added new network layer based on SDL_net - Added proper error message for when the map server goes offline +- Added more international characters to fixed and rpg fonts - Improved damage text font, shadow is now translucent - Improved GUI layout, new profile window - Improved support for building on FreeBSD and MacOS X - Improved tile engine to fix graphics glitches and make mapping easier +- Rearanged keyboard shortcuts - Fixed items on map to be removed on map switch - Fixed OpenGL checkbox in the setup window to be usable - Cleaned up a lot of code @@ -39,20 +39,23 @@ KEYBOARD: Use arrow keys to move around. Other keys: -- Left Ctrl attack +- Ctrl attack +- F1 toggle the online help +- F2 toggle profile window +- F3 toggle inventory window +- F4 toggle equipment window +- F5 toggle skills window +- F6 toggle minimap +- F7 toggle chat window +- F9 show setup window +- F10 toggle debug window - Alt + 0-9 show emotions -- F1 show the online help -- F5 sit down / stand up -- F6 toggle debug pathfinding feature +- Alt + S sit down / stand up +- Alt + F toggle debug pathfinding feature +- Alt + P take screenshot - G or Z pick up item - Enter focus chat window / send message -- Alt + K show skills -- Alt + S show stats -- Alt + I show inventory -- Alt + E show equipment -- Alt + C show setup window -- Alt + P take screenshot -- Left Shift hold it when attacking to lock target for auto attack +- Shift hold it when attacking to lock target for auto attack MOUSE: diff --git a/data/help/changes.txt b/data/help/changes.txt index 4fb23d87..2f246ab5 100644 --- a/data/help/changes.txt +++ b/data/help/changes.txt @@ -12,10 +12,12 @@ - Added messagebox on error for MacOS X - Added new network layer based on SDL_net - Added proper error message for when the map server goes offline + - Added more international characters to fixed and rpg fonts - Improved damage text font, shadow is now translucent - Improved GUI layout, new profile window - Improved support for building on FreeBSD and MacOS X - Improved tile engine to fix graphics glitches and make mapping easier + - Rearanged keyboard shortcuts - Fixed items on map to be removed on map switch - Fixed OpenGL checkbox in the setup window to be usable - Cleaned up a lot of code diff --git a/data/help/commands.txt b/data/help/commands.txt index 60a7992e..dbb37195 100644 --- a/data/help/commands.txt +++ b/data/help/commands.txt @@ -9,20 +9,25 @@ Other keys: - ##2Left Ctrl##P attack - ##2Alt + 0-9##P show emotions - ##2F1##P show the in-game help - ##2F5##P sit down / stand up - ##2F6##P toggle debug pathfinding feature - ##2G or Z##P pick up item - ##2Enter##P focus chat window / send message - ##2Alt + K##P show skills - ##2Alt + S##P show stats - ##2Alt + I##P show inventory - ##2Alt + E##P show equipment - ##2Alt + C##P show setup window - ##2Left Shift##P hold it when attacking to lock target for auto - attack + ##2Ctrl##P attack + ##2F1##P toggle the online help + ##2F2##P toggle profile window + ##2F3##P toggle inventory window + ##2F4##P toggle equipment window + ##2F5##P toggle skills window + ##2F6##P toggle minimap + ##2F7##P toggle chat window + ##2F9##P show setup window + ##2F10##P toggle debug window + ##2Alt + 0-9##P show emotions + ##2Alt + S##P sit down / stand up + ##2Alt + F##P toggle debug pathfinding feature + ##2Alt + P##P take screenshot + ##2G or Z##P pick up item + ##2Enter##P focus chat window / send message + ##2Shift##P hold it when attacking to lock target for auto + attack + ##2MOUSE: diff --git a/src/game.cpp b/src/game.cpp index 8d5d0cf8..8c1eee60 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -470,43 +470,44 @@ void do_input() // Keyboard events (for discontinuous keys) if (event.type == SDL_KEYDOWN) { + gcn::Window *requestedWindow = NULL; + switch (event.key.keysym.sym) { - // In-game Help case SDLK_F1: - if (helpWindow->isVisible()) { + // In-game Help + if (helpWindow->isVisible()) + { helpWindow->setVisible(false); - } else { + } + else + { helpWindow->loadHelp("index"); - if (helpWindow->isVisible()) helpWindow->requestMoveToTop(); + helpWindow->requestMoveToTop(); } used = true; break; - // Player sit action - case SDLK_F5: - if (!action_time) { - break; - } - - switch (player_node->action) - { - case Being::STAND: - action(2, 0); - break; - case Being::SIT: - action(3, 0); - break; - } + case SDLK_F2: requestedWindow = statusWindow; break; + case SDLK_F3: requestedWindow = inventoryWindow; break; + case SDLK_F4: requestedWindow = equipmentWindow; break; + case SDLK_F5: requestedWindow = skillDialog; break; + case SDLK_F6: requestedWindow = minimap; break; + case SDLK_F7: requestedWindow = chatWindow; break; + //case SDLK_F8: requestedWindow = buddyWindow; break; + + case SDLK_F9: + // Setup window + setupWindow->setVisible(true); + setupWindow->requestMoveToTop(); + used = true; break; - // Display path to mouse (debug purpose) - case SDLK_F6: - displayPathToMouse = !displayPathToMouse; - break; + case SDLK_F10: requestedWindow = debugWindow; break; + //case SDLK_F11: requestedWindow = newSkillWindow; break; - // Input chat window case SDLK_RETURN: + // Input chat window if (chatWindow->isFocused() || deathNotice != NULL || weightNotice != NULL) @@ -592,62 +593,37 @@ void do_input() break; } + if (requestedWindow) + { + requestedWindow->setVisible(!requestedWindow->isVisible()); + if (requestedWindow->isVisible()) + { + requestedWindow->requestMoveToTop(); + } + used = true; + } + // Keys pressed together with Alt/Meta // Emotions and some internal gui windows if (event.key.keysym.mod & KMOD_ALT) { - gcn::Window *requestedWindow = 0; - switch (event.key.keysym.sym) { - // Inventory window - case SDLK_i: - requestedWindow = inventoryWindow; - break; - - // Statistics window case SDLK_s: - requestedWindow = statusWindow; - break; - - // Skill window - case SDLK_k: - requestedWindow = skillDialog; - break; - - // Equipment window - case SDLK_e: - requestedWindow = equipmentWindow; - break; - - /* - // Buddy window - case SDLK_b: - requestedWindow = buddyWindow; - break; - */ - - /* - // New skills window - case SDLK_n: - requestedWindow = newSkillWindow; - break; - */ - - // Setup window - case SDLK_c: - setupWindow->setVisible(true); - setupWindow->requestMoveToTop(); - used = true; - break; + // Player sit action + if (!action_time) { + break; + } - // Debug window - case SDLK_d: - requestedWindow = debugWindow; + switch (player_node->action) + { + case Being::STAND: action(2, 0); break; + case Being::SIT: action(3, 0); break; + } break; - // screenshot (picture, hence the p) case SDLK_p: + // Screenshot (picture, hence the p) { SDL_Surface *screenshot = graphics->getScreenshot(); if (!saveScreenshot(screenshot)) @@ -660,16 +636,11 @@ void do_input() default: break; - } - if (requestedWindow) - { - requestedWindow->setVisible(!requestedWindow->isVisible()); - if (requestedWindow->isVisible()) - { - requestedWindow->requestMoveToTop(); - } - used = true; + case SDLK_f: + // Find path to mouse (debug purpose) + displayPathToMouse = !displayPathToMouse; + break; } // Emotions diff --git a/src/gui/browserbox.cpp b/src/gui/browserbox.cpp index 973f9251..a4d418e0 100644 --- a/src/gui/browserbox.cpp +++ b/src/gui/browserbox.cpp @@ -58,7 +58,7 @@ BrowserBox::BrowserBox(unsigned int mode): " abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567" "89:@!\"$%&/=?^+*#[]{}()<>_;'.,\\|-~`" - "øåáÁéÉíÍóÓúÚç_¥£¢¡¿àãõêñÑöüäÖÜÄß"); + "øåáÁéÉíÍóÓúÚç륣¢¡¿àãõêñÑöüäÖÜÄß"); } else #endif { diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index c01c05c8..60a1e0da 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -140,7 +140,7 @@ Gui::Gui(Graphics *graphics): speechFont = new gcn::ImageFont("graphics/gui/rpgfont_wider.png", " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789.,!?-+/():;%&`'*#=[]\"<>{}^~|_@$\\" - "áÁéÉíÍóÓúÚç_¥£¢¡¿àãõêñÑöüäÖÜÄßø" + "áÁéÉíÍóÓúÚç륣¢¡¿àãõêñÑöüäÖÜÄßø" ); } catch (gcn::Exception e) diff --git a/src/gui/status.cpp b/src/gui/status.cpp index 1ba09b98..f5302e95 100644 --- a/src/gui/status.cpp +++ b/src/gui/status.cpp @@ -66,21 +66,26 @@ StatusWindow::StatusWindow(): gpLabel->setPosition(lvlLabel->getX() + lvlLabel->getWidth() + 40, 3); hpLabel->setPosition(5, lvlLabel->getY() + lvlLabel->getHeight() + 5); hpBar = new ProgressBar(1.0f, - hpLabel->getX() + hpLabel->getWidth() + 5, hpLabel->getY(), 80, - 15, 0, 171, 34); - hpValueLabel->setPosition(hpBar->getX() + hpBar->getWidth() + 5, hpBar->getY()); - mpLabel->setPosition(5,hpLabel->getY() + hpLabel->getHeight() + 5); - mpBar = new ProgressBar(1.0f, hpBar->getX(), - mpLabel->getY(), 80, 15, 26, 102, 230); + hpLabel->getX() + hpLabel->getWidth() + 5, + hpLabel->getY(), 80, 15, 0, 171, 34); + hpValueLabel->setPosition(hpBar->getX() + hpBar->getWidth() + 5, + hpBar->getY()); + mpLabel->setPosition(5, hpLabel->getY() + hpLabel->getHeight() + 5); + mpBar = new ProgressBar(1.0f, + hpBar->getX(), + mpLabel->getY(), 80, 15, 26, 102, 230); mpValueLabel->setPosition(hpValueLabel->getX(), mpBar->getY()); xpLabel->setPosition(175, hpLabel->getY()); xpBar = new ProgressBar(1.0f, 205, xpLabel->getY(), 80, 15, - 143, 192, 211); + 143, 192, 211); xpValueLabel->setPosition(290, xpBar->getY()); jobXpLabel->setPosition(175, mpLabel->getY()); - jobXpBar = new ProgressBar(1.0f, 225, jobXpLabel->getY(), 60, 15, - 220, 135, 203); + jobXpBar = new ProgressBar(1.0f, + xpBar->getX() + xpBar->getWidth() - 60, + jobXpLabel->getY(), + 60, 15, + 220, 135, 203); jobValueLabel->setPosition(290, jobXpBar->getY()); add(lvlLabel); @@ -145,17 +150,22 @@ StatusWindow::StatusWindow(): statsButton[4]->setEventId("DEX"); statsButton[5]->setEventId("LUK"); + // Set position statsTitleLabel->setPosition(mpLabel->getX(), mpLabel->getY() + 23 ); statsTotalLabel->setPosition(110, statsTitleLabel->getY() + 15); - statsCostLabel->setPosition(170, statsTotalLabel->getY()); + int totalLabelY = statsTotalLabel->getY(); + statsCostLabel->setPosition(170, totalLabelY); + for (int i = 0; i < 6; i++) { statsLabel[i]->setPosition(5, statsTotalLabel->getY() + (i * 23) + 15); - statsDisplayLabel[i]->setPosition(115, statsTotalLabel->getY() + (i * 23) + 15); - statsButton[i]->setPosition(145, statsTotalLabel->getY() + (i * 23) + 10); - pointsLabel[i]->setPosition(175, statsTotalLabel->getY() + (i * 23) + 15); + statsDisplayLabel[i]->setPosition(115, + totalLabelY + (i * 23) + 15); + statsButton[i]->setPosition(145, totalLabelY + (i * 23) + 10); + pointsLabel[i]->setPosition(175, totalLabelY + (i * 23) + 15); } + remainingStatsPointsLabel->setPosition(5, pointsLabel[5]->getY() + 25); statsAttackLabel->setPosition(220, statsLabel[0]->getY()); @@ -342,7 +352,7 @@ void StatusWindow::update() updateText.str(""); updateText << "Remaining Status Points: " << statusPoints; - + pointsStr[0] << (int)player_info->STRUp; pointsStr[1] << (int)player_info->AGIUp; pointsStr[2] << (int)player_info->VITUp; @@ -415,7 +425,8 @@ void StatusWindow::update() statsReflexPoints->adjustSize(); // Update Second column widgets position - gpLabel->setPosition(lvlLabel->getX() + lvlLabel->getWidth() + 20, lvlLabel->getY()); + gpLabel->setPosition(lvlLabel->getX() + lvlLabel->getWidth() + 20, + lvlLabel->getY()); xpLabel->setPosition(hpValueLabel->getX() + hpValueLabel->getWidth() + 10, hpLabel->getY()); @@ -425,7 +436,8 @@ void StatusWindow::update() xpLabel->getY()); jobXpLabel->setPosition(xpLabel->getX(), mpLabel->getY()); - jobXpBar->setPosition(xpBar->getX(),jobXpLabel->getY()); + jobXpBar->setPosition(xpBar->getX() + xpBar->getWidth() - + jobXpBar->getWidth(), jobXpLabel->getY()); jobValueLabel->setPosition(290, jobXpLabel->getY()); } diff --git a/src/properties.h b/src/properties.h new file mode 100644 index 00000000..ccf8cd00 --- /dev/null +++ b/src/properties.h @@ -0,0 +1,84 @@ +/* + * The Mana World + * Copyright 2004 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World 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, + * 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 The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id$ + */ + +#ifndef _TMW_PROPERTIES_H_ +#define _TMW_PROPERTIES_H_ + +#include <map> +#include <string> + +/** + * A class holding a set of properties. + */ +class Properties +{ + public: + virtual + ~Properties() {} + + /** + * Get a map property. + * + * @return the value of the given property or an empty string when it + * doesn't exist. + */ + const std::string& + getProperty(const std::string &name) + { + const static std::string undefined = ""; + std::map<std::string, std::string>::const_iterator i = + properties.find(name); + + if (i != properties.end()) + { + return (*i).second; + } + else + { + return undefined; + } + } + + /** + * Returns whether a certain property is available. + */ + bool + hasProperty(const std::string &name) + { + return (properties.find(name) != properties.end()); + } + + /** + * Set a map property. + */ + void + setProperty(const std::string &name, const std::string &value) + { + properties[name] = value; + } + + private: + std::map<std::string, std::string> properties; +}; + +#endif diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp deleted file mode 100644 index 69090dcb..00000000 --- a/src/resources/iteminfo.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - * The Mana World - * Copyright 2004 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World 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, - * 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 The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ - */ - -#include "iteminfo.h" - -ItemInfo::ItemInfo() : - image(0), name(""), - description(""), type(0), - weight(0), slot(0) -{ -} - -ItemInfo::~ItemInfo() -{ -} - -void ItemInfo::setImage(short image) -{ - this->image = image; -} - -short ItemInfo::getImage() -{ - return image; -} - -void ItemInfo::setArt(short art) -{ - this->art = art; -} - -short ItemInfo::getArt() -{ - return art; -} - -void ItemInfo::setName(const std::string &name) -{ - this->name = name; -} - -std::string ItemInfo::getName() -{ - return name; -} - -void ItemInfo::setDescription(const std::string &description) -{ - this->description = description; -} - -std::string ItemInfo::getDescription() -{ - return description; -} - -void ItemInfo::setEffect(const std::string &effect) -{ - this->effect = effect; -} - -std::string ItemInfo::getEffect() -{ - return effect; -} - -void ItemInfo::setType(short type) -{ - this->type = type; -} - -short ItemInfo::getType() -{ - return type; -} - -void ItemInfo::setWeight(short weight) -{ - this->weight = weight; -} - -short ItemInfo::getWeight() -{ - return weight; -} - -void ItemInfo::setSlot(char slot) -{ - this->slot = slot; -} - -char ItemInfo::getSlot() -{ - return slot; -} diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h index c515fd1c..54e7907b 100644 --- a/src/resources/iteminfo.h +++ b/src/resources/iteminfo.h @@ -21,8 +21,8 @@ * $Id$ */ -#ifndef _TMW_ITEMINFO_H -#define _TMW_ITEMINFO_H +#ifndef _TMW_ITEMINFO_H_ +#define _TMW_ITEMINFO_H_ #include <string> diff --git a/src/sprite.h b/src/sprite.h new file mode 100644 index 00000000..2950f4e8 --- /dev/null +++ b/src/sprite.h @@ -0,0 +1,65 @@ +/* + * The Mana World + * Copyright 2004 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World 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, + * 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 The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id$ + */ + +#ifndef _TMW_SPRITE_H_ +#define _TMW_SPRITE_H_ + +class Graphics; + +/** + * A sprite is some visible object on a map. This abstract class defines the + * interface used by the map to sort and display the sprite. + */ +class Sprite +{ + public: + /** + * Destructor. + */ + virtual + ~Sprite() {} + + /** + * Draws the sprite to the given graphics context. + * + * Note: this function could be simplified if the graphics context + * would support setting a translation offset. It already does this + * partly with the clipping rectangle support. + */ + virtual void + draw(Graphics *graphics, int offsetX, int offsetY) = 0; + + /** + * Returns the pixel Y coordinate of the sprite. + */ + virtual int + getPixelY() const = 0; + + protected: + /** + * Constructor. + */ + Sprite() {} +}; + +#endif |