summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-07-03 21:03:09 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-07-03 21:03:09 +0000
commitb5ca1c7c4021d9ef04cabd6f6dbc6e1bc050ab73 (patch)
treeff35acbbf544331e88912a62558c560c88f329b0 /src
parentde8b695c863576f10cfeb02c38b8980ec5dd019e (diff)
downloadmana-b5ca1c7c4021d9ef04cabd6f6dbc6e1bc050ab73.tar.gz
mana-b5ca1c7c4021d9ef04cabd6f6dbc6e1bc050ab73.tar.bz2
mana-b5ca1c7c4021d9ef04cabd6f6dbc6e1bc050ab73.tar.xz
mana-b5ca1c7c4021d9ef04cabd6f6dbc6e1bc050ab73.zip
- Fixed blue, red and yellow damage fonts to work in SDL mode
- Added two international characters to fixed font, fixed autotarget - Fixed mouse autotarget (now default for left click) - Cleaned up showing of empty right click menus
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am10
-rw-r--r--src/being.cpp2
-rw-r--r--src/game.cpp10
-rw-r--r--src/gui/gui.cpp13
-rw-r--r--src/gui/popupmenu.cpp34
-rw-r--r--src/net/protocol.cpp6
6 files changed, 44 insertions, 31 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index b5292dd8..b1fe75c5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,8 +1,8 @@
bin_PROGRAMS = tmw
tmw_SOURCES = graphic/spriteset.cpp \
graphic/spriteset.h \
- gui/browserbox.cpp \
- gui/browserbox.h \
+ gui/browserbox.cpp \
+ gui/browserbox.h \
gui/buddywindow.cpp \
gui/buddywindow.h \
gui/button.cpp \
@@ -39,7 +39,7 @@ tmw_SOURCES = graphic/spriteset.cpp \
gui/itemcontainer.h \
gui/item_amount.cpp \
gui/item_amount.h \
- gui/linkhandler.h \
+ gui/linkhandler.h \
gui/listbox.cpp \
gui/listbox.h \
gui/login.cpp \
@@ -58,8 +58,8 @@ tmw_SOURCES = graphic/spriteset.cpp \
gui/passwordfield.h \
gui/playerbox.cpp \
gui/playerbox.h \
- gui/popupmenu.cpp \
- gui/popupmenu.h \
+ gui/popupmenu.cpp \
+ gui/popupmenu.h \
gui/progressbar.cpp \
gui/progressbar.h \
gui/radiobutton.cpp \
diff --git a/src/being.cpp b/src/being.cpp
index 578d4be0..84ec6a58 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -346,7 +346,6 @@ void Being::drawSpeech(Graphics *graphics)
gcn::Graphics::CENTER);
}
if (showDamage) {
-#ifdef USE_OPENGL
// Selecting the right color
if (damage == "miss")
{
@@ -360,7 +359,6 @@ void Being::drawSpeech(Graphics *graphics)
{
graphics->setFont(hitRedFont);
}
-#endif
int textX = 0;
int textY = 0;
diff --git a/src/game.cpp b/src/game.cpp
index 181b7d6f..9e9b0da9 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -433,12 +433,12 @@ void do_input()
if (target->action != MONSTER_DEAD &&
player_node->action==STAND)
{
- if (keys[SDLK_LSHIFT])
- {
- autoTarget = target;
- }
attack(target);
-
+ // Autotarget by default with mouse
+ //if (keys[SDLK_LSHIFT])
+ //{
+ autoTarget = target;
+ //}
}
}
// Player default: trade
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index ec9a6adc..a6f9ad4b 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -84,8 +84,15 @@ Gui::Gui(Graphics *graphics)
guiFont = new gcn::ImageFont(
TMW_DATADIR "data/graphics/gui/fixedfont.png",
" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567"
- "89:@!\"$%&/=?^+*#[]{}()<>_;'.,\\|-~`"
+ "89:@!\"$%&/=?^+*#[]{}()<>_;'.,\\|-~`øå"
);
+ /*
+ guiFont = new gcn::ImageFont(
+ TMW_DATADIR "data/graphics/gui/rpgfont.png",
+ " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567"
+ "89_,!?-+/():;%&`'*#=[]\""
+ );
+ */
}
catch (gcn::Exception e)
{
@@ -161,9 +168,9 @@ void Gui::mousePress(int mx, int my, int button)
if (state == GAME && tiledMap->getWalk(tilex, tiley)) {
walk(tilex, tiley, 0);
player_node->setDestination(tilex, tiley);
- }
- autoTarget = NULL;
+ autoTarget = NULL;
+ }
}
}
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index c9b53324..4469eaaf 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -75,26 +75,34 @@ void PopupMenu::showPopup(int mx, int my)
mY = my;
browserBox->clearRows();
- if (being)
+ if (being && being->isNpc())
{
- if (being->isNpc())
- {
- browserBox->addRow("@@talk|Talk To NPC@@");
- }
- else if (being->isPlayer())
- {
- std::string name = being->name;
- //browserBox->addRow("@@attack|Attack " + name + "@@");
- browserBox->addRow("@@trade|Trade With " + name + "@@");
- //browserBox->addRow("@@follow|Follow " + name + "@@");
- //browserBox->addRow("@@buddy|Add " + name + " to Buddy List@@");
- }
+ // NPCs can be talked to (single option, candidate for removal unless
+ // more options would be added)
+ browserBox->addRow("@@talk|Talk To NPC@@");
+ }
+ else if (being && being->isPlayer())
+ {
+ // Players can be traded with. Later also attack, follow and add as
+ // buddy will be options in this menu.
+
+ std::string name = being->name;
+ //browserBox->addRow("@@attack|Attack " + name + "@@");
+ browserBox->addRow("@@trade|Trade With " + name + "@@");
+ //browserBox->addRow("@@follow|Follow " + name + "@@");
+ //browserBox->addRow("@@buddy|Add " + name + " to Buddy List@@");
}
else if (floorItem)
{
+ // Floor item can be picked up (single option, candidate for removal)
std::string name = itemDb->getItemInfo(floorItem->id)->getName();
browserBox->addRow("@@pickup|Pick Up " + name + "@@");
}
+ else
+ {
+ // If there is nothing of interest, don't display menu.
+ return;
+ }
//browserBox->addRow("@@look|Look To@@");
browserBox->addRow("##3---");
diff --git a/src/net/protocol.cpp b/src/net/protocol.cpp
index de41467e..eac679bc 100644
--- a/src/net/protocol.cpp
+++ b/src/net/protocol.cpp
@@ -243,9 +243,6 @@ Being* attack(unsigned short x, unsigned short y, unsigned char direction)
return target;
}
- // Implement charging attacks here
- char_info->lastAttackTime = 0;
-
return NULL;
}
@@ -269,6 +266,9 @@ void attack(Being *target)
player_node->direction = WEST;
}
+ // Implement charging attacks here
+ char_info->lastAttackTime = 0;
+
player_node->action = ATTACK;
action(0, target->id);
player_node->walk_time = tick_time;