Skip to content
This repository has been archived by the owner on Nov 6, 2018. It is now read-only.

Commit

Permalink
Merge commit 'aethyra/master'
Browse files Browse the repository at this point in the history
Conflicts:
	CMakeLists.txt
	configure.ac
	data/help/header.txt
	packaging/windows/setup.nsi
	po/POTFILES.in
	src/being.cpp
	src/being.h
	src/game.cpp
	src/gui/color.cpp
	src/gui/color.h
	src/gui/equipmentwindow.h
	src/gui/popupmenu.cpp
	src/gui/recorder.cpp
	src/gui/setup_colors.h
	src/gui/setup_keyboard.cpp
	src/gui/setup_keyboard.h
	src/gui/skill.cpp
	src/gui/speechbubble.cpp
	src/gui/speechbubble.h
	src/gui/table.cpp
	src/keyboardconfig.cpp
	src/keyboardconfig.h
	src/localplayer.cpp
	src/main.cpp
	src/main.h
	src/map.cpp
	src/resources/colordb.cpp
	src/resources/colordb.h
	src/resources/emotedb.cpp
	src/resources/emotedb.h
	src/text.cpp
	src/text.h
	src/tmw.rc
	src/winver.h
  • Loading branch information
bjorn committed Feb 15, 2009
2 parents 7b3b60f + 38708de commit 83bbc5c
Show file tree
Hide file tree
Showing 63 changed files with 449 additions and 527 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PROJECT(TMW)

SET(VERSION 0.0.28.1)
SET(VERSION 0.0.29)

# where to look for cmake modules
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/Modules)
Expand Down
4 changes: 2 additions & 2 deletions Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>The Mana World</string>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>The Mana World.icns</string>
<key>CFBundleIdentifier</key>
<string>TMW</string>
<key>CFBundleName</key>
<string>The Mana World</string>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AC_PREREQ(2.59)
AC_INIT([The Mana World], [0.0.28.1], [[email protected]], [tmw])
AC_INIT([The Mana World], [0.0.29], [[email protected]], [tmw])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([config.h:config.h.in])
AC_LANG_CPLUSPLUS
Expand Down
2 changes: 1 addition & 1 deletion data/help/header.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
##1 T H E M A N A W O R L D
##1 ==========================================

##2Version:##6 0.0.28.1 ##2Date:##3 12 February 2009
##2Version:##6 0.0.29 ##2Date:##3 12 February 2009

##2 Website: http://themanaworld.org

Expand Down
2 changes: 1 addition & 1 deletion packaging/windows/setup.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SetCompressor /SOLID lzma

; HM NIS Edit helper defines
!define PRODUCT_NAME "The Mana World"
!define PRODUCT_VERSION "0.0.28.1"
!define PRODUCT_VERSION "0.0.29"
!define PRODUCT_PUBLISHER "The Mana World Development Team"
!define PRODUCT_WEB_SITE "http://themanaworld.org"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\tmw.exe"
Expand Down
2 changes: 0 additions & 2 deletions po/POTFILES.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ src/net/loginhandler.cpp
src/net/maploginhandler.cpp
src/net/playerhandler.cpp
src/net/tradehandler.cpp
src/resources/colordb.cpp
src/resources/emotedb.cpp
src/resources/itemdb.cpp
src/resources/monsterdb.cpp
src/resources/npcdb.cpp
Expand Down
2 changes: 0 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,6 @@ SET(SRCS
resources/ambientoverlay.h
resources/animation.cpp
resources/animation.h
resources/buddylist.cpp
resources/buddylist.h
resources/colordb.cpp
resources/colordb.h
resources/dye.cpp
Expand Down
2 changes: 0 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,6 @@ tmw_SOURCES = gui/widgets/dropdown.cpp \
resources/ambientoverlay.h \
resources/animation.cpp \
resources/animation.h \
resources/buddylist.cpp \
resources/buddylist.h \
resources/colordb.cpp \
resources/colordb.h \
resources/dye.cpp \
Expand Down
77 changes: 42 additions & 35 deletions src/being.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,16 @@
#include "log.h"
#include "map.h"
#include "particle.h"
#include "simpleanimation.h"
#include "sound.h"
#include "text.h"
#include "statuseffect.h"

#include "gui/speechbubble.h"

#include "resources/colordb.h"

#include "resources/emotedb.h"
#include "resources/image.h"
#include "resources/imageset.h"
#include "resources/itemdb.h"
#include "resources/iteminfo.h"
#include "resources/resourcemanager.h"
Expand Down Expand Up @@ -95,7 +94,8 @@ Being::Being(int id, int job, Map *map):
mSpriteColors(VECTOREND_SPRITE, ""),
mStatusParticleEffects(&mStunParticleEffects, false),
mChildParticleEffects(&mStatusParticleEffects, false),
mMustResetParticles(false)
mMustResetParticles(false),
mUsedTargetCursor(NULL)
{
setMap(map);

Expand All @@ -113,7 +113,8 @@ Being::Being(int id, int job, Map *map):
emotionSet.push_back(AnimatedSprite::load(file, variant));
}

// Hairstyles are encoded as negative numbers. Count how far negative we can go.
// Hairstyles are encoded as negative numbers. Count how far negative
// we can go.
int hairstyles = 1;
while (ItemDB::get(-hairstyles).getSprite(GENDER_MALE) != "error.xml")
{
Expand All @@ -130,6 +131,7 @@ Being::Being(int id, int job, Map *map):

Being::~Being()
{
mUsedTargetCursor = NULL;
delete_all(mSprites);
clearPath();

Expand All @@ -149,9 +151,7 @@ Being::~Being()
void Being::setDestination(Uint16 destX, Uint16 destY)
{
if (mMap)
{
setPath(mMap->findPath(mX, mY, destX, destY));
}
}

void Being::clearPath()
Expand Down Expand Up @@ -232,19 +232,13 @@ void Being::takeDamage(int amount)

// Selecting the right color
if (damage == "miss")
{
font = hitYellowFont;
}
else
{
if (getType() == MONSTER)
{
font = hitBlueFont;
}
else
{
font = hitRedFont;
}
}

// Show damage number
Expand All @@ -270,17 +264,13 @@ void Being::setMap(Map *map)
{
// Remove sprite from potential previous map
if (mMap)
{
mMap->removeSprite(mSpriteIterator);
}

mMap = map;

// Add sprite to potential new map
if (mMap)
{
mSpriteIterator = mMap->addSprite(this);
}

// Clear particle effect list because child particles became invalid
mChildParticleEffects.clear();
Expand Down Expand Up @@ -316,9 +306,7 @@ void Being::setAction(Action action)
for (int i = 0; i < VECTOREND_SPRITE; i++)
{
if (mSprites[i])
{
mSprites[i]->reset();
}
}
break;
case HURT:
Expand All @@ -339,9 +327,7 @@ void Being::setAction(Action action)
for (int i = 0; i < VECTOREND_SPRITE; i++)
{
if (mSprites[i])
{
mSprites[i]->play(currentAction);
}
}
mAction = action;
}
Expand Down Expand Up @@ -449,18 +435,18 @@ void Being::logic()
if (mEmotion != 0)
{
mEmotionTime--;
if (mEmotionTime == 0) {
if (mEmotionTime == 0)
mEmotion = 0;
}
}

// Update sprite animations
if (mUsedTargetCursor != NULL)
mUsedTargetCursor->update(tick_time * 10);

for (int i = 0; i < VECTOREND_SPRITE; i++)
{
if (mSprites[i])
{
mSprites[i]->update(tick_time * 10);
}
}

// Restart status/particle effects, if needed
Expand All @@ -485,6 +471,11 @@ void Being::draw(Graphics *graphics, int offsetX, int offsetY) const
int px = mPx + offsetX;
int py = mPy + offsetY;

if (mUsedTargetCursor != NULL)
{
mUsedTargetCursor->draw(graphics, px, py);
}

for (int i = 0; i < VECTOREND_SPRITE; i++)
{
if (mSprites[i])
Expand All @@ -509,28 +500,33 @@ void Being::drawEmotion(Graphics *graphics, int offsetX, int offsetY)

void Being::drawSpeech(int offsetX, int offsetY)
{
int px = mPx + offsetX;
int py = mPy + offsetY;
const int px = mPx + offsetX;
const int py = mPy + offsetY;
const int speech = (int) config.getValue("speech", NAME_IN_BUBBLE);

// Draw speech above this being
if (mSpeechTime > 0 && config.getValue("speechbubble", 1))
if (mSpeechTime > 0 && (speech == NAME_IN_BUBBLE ||
speech == NO_NAME_IN_BUBBLE))
{
const bool showName = (speech == NAME_IN_BUBBLE);

if (mText)
{
delete mText;
mText = 0;
}

mSpeechBubble->setCaption(mName, mNameColor);
mSpeechBubble->setCaption(showName ? 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.
mSpeechBubble->setText(mSpeech);
mSpeechBubble->setPosition(px - (mSpeechBubble->getWidth() * 4 / 11), py - 70 -
(mSpeechBubble->getNumRows()*14));
// 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, showName);
mSpeechBubble->setPosition(px - (mSpeechBubble->getWidth() * 4 / 11),
py - 40 - (mSpeechBubble->getHeight()));
mSpeechBubble->setVisible(true);
}
else if (mSpeechTime > 0 && !config.getValue("speechbubble", 1))
else if (mSpeechTime > 0 && speech == TEXT_OVERHEAD)
{
mSpeechBubble->setVisible(false);
// don't introduce a memory leak
Expand All @@ -540,6 +536,13 @@ void Being::drawSpeech(int offsetX, int offsetY)
mText = new Text(mSpeech, mPx + X_SPEECH_OFFSET, mPy - Y_SPEECH_OFFSET,
gcn::Graphics::CENTER, gcn::Color(255, 255, 255));
}
else if (speech == NO_SPEECH)
{
mSpeechBubble->setVisible(false);
if (mText)
delete mText;
mText = NULL;
}
else if (mSpeechTime == 0)
{
mSpeechBubble->setVisible(false);
Expand Down Expand Up @@ -648,7 +651,6 @@ int Being::getWidth() const
}
}


int Being::getHeight() const
{
if (mSprites[BASE_SPRITE])
Expand All @@ -664,6 +666,11 @@ int Being::getHeight() const
}
}

void Being::setTargetAnimation(SimpleAnimation* animation)
{
mUsedTargetCursor = animation;
mUsedTargetCursor->reset();
}

struct EffectDescription {
std::string mGFXEffect;
Expand Down
23 changes: 23 additions & 0 deletions src/being.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class Map;
class Graphics;
class Particle;
class Position;
class SimpleAnimation;
class SpeechBubble;
class Text;

Expand Down Expand Up @@ -114,6 +115,15 @@ class Being : public Sprite
NUM_TC
};

enum Speech
{
NO_SPEECH = 0,
TEXT_OVERHEAD,
NO_NAME_IN_BUBBLE,
NAME_IN_BUBBLE,
NUM_SPEECH
};

/**
* Directions, to be used as bitmask values
*/
Expand Down Expand Up @@ -364,6 +374,16 @@ class Being : public Sprite
*/
void controlParticle(Particle *particle);

/**
* Sets the target animation for this being.
*/
void setTargetAnimation(SimpleAnimation* animation);

/**
* Untargets the being
*/
void untarget() { mUsedTargetCursor = NULL; }

AnimatedSprite* getEmote(int index) { return emotionSet[index]; }

void setEmote(Uint8 emotion, Uint8 emote_time)
Expand Down Expand Up @@ -503,6 +523,9 @@ class Being : public Sprite
// Speech Bubble components
SpeechBubble *mSpeechBubble;

// Target cursor being used
SimpleAnimation* mUsedTargetCursor;

static int instances; /**< Number of Being instances */
static std::vector<AnimatedSprite*> emotionSet; /**< Emoticons used by beings */
};
Expand Down
17 changes: 14 additions & 3 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,11 +527,11 @@ void Game::handleInput()
done = true;
// Close the Browser if opened
else if (helpWindow->isVisible() &&
keyboard.isKeyActive(keyboard.KEY_TOGGLE_CHAT))
keyboard.isKeyActive(keyboard.KEY_OK))
helpWindow->setVisible(false);
// Close the config window, cancelling changes if opened
else if (setupWindow->isVisible() &&
keyboard.isKeyActive(keyboard.KEY_TOGGLE_CHAT))
keyboard.isKeyActive(keyboard.KEY_OK))
setupWindow->action(gcn::ActionEvent(NULL, "cancel"));
// Submits the text and proceeds to the next dialog
else if (npcStringDialog->isVisible() &&
Expand All @@ -553,7 +553,9 @@ void Game::handleInput()
KeyboardConfig::KEY_TOGGLE_CHAT) ==
keyboard.getKeyValue(
KeyboardConfig::KEY_OK) &&
(npcStringDialog->isVisible() ||
(helpWindow->isVisible() ||
setupWindow->isVisible() ||
npcStringDialog->isVisible() ||
npcTextDialog->isVisible() ||
npcListDialog->isVisible() ||
npcIntegerDialog->isVisible())))
Expand Down Expand Up @@ -794,6 +796,15 @@ void Game::handleInput()
// Get the state of the keyboard keys
keyboard.refreshActiveKeys();

// Ignore input if either "ignore" key is pressed
// Stops the character moving about if the user's window manager
// uses "ignore+arrow key" to switch virtual desktops.
if (keyboard.isKeyActive(keyboard.KEY_IGNORE_INPUT_1) ||
keyboard.isKeyActive(keyboard.KEY_IGNORE_INPUT_2))
{
return;
}

const Uint16 x = player_node->mX;
const Uint16 y = player_node->mY;
unsigned char direction = 0;
Expand Down
Loading

0 comments on commit 83bbc5c

Please sign in to comment.