summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-04-29 09:10:43 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-04-29 09:10:43 +0000
commit567d35731d8cca0e535f23652b8fbe050a629f91 (patch)
tree260e523fd2f0494369bd28c72cc1e7155690d680
parent5943323aff9db6c1405177478564072e9d2214b3 (diff)
downloadmana-567d35731d8cca0e535f23652b8fbe050a629f91.tar.gz
mana-567d35731d8cca0e535f23652b8fbe050a629f91.tar.bz2
mana-567d35731d8cca0e535f23652b8fbe050a629f91.tar.xz
mana-567d35731d8cca0e535f23652b8fbe050a629f91.zip
* Fixed issue with determining whether chat input is focused (method no longer
virtual). * Fixed sometimes rendering with the wrong font. * Fixed warnings about hiding virtual method, Window now always deletes its children (the option not to do so was never used anyway).
-rw-r--r--ChangeLog10
-rw-r--r--src/game.cpp8
-rw-r--r--src/gui/chat.cpp2
-rw-r--r--src/gui/chat.h2
-rw-r--r--src/gui/itemshortcutcontainer.cpp2
-rw-r--r--src/gui/window.cpp8
-rw-r--r--src/gui/window.h10
7 files changed, 28 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 6d9a8bb5..bb65faac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-04-29 Bjørn Lindeijer <bjorn@lindeijer.nl>
+
+ * src/game.cpp, src/gui/chat.h, src/gui/chat.cpp: Fixed issue with
+ determining whether chat input is focused (method no longer virtual).
+ * src/gui/itemshortcutcontainer.cpp: Fixed sometimes rendering with
+ the wrong font.
+ * src/gui/window.h, src/gui/window.cpp: Fixed warnings about hiding
+ virtual method, Window now always deletes its children (the option not
+ to do so was never used anyway).
+
2008-04-28 Bjørn Lindeijer <bjorn@lindeijer.nl>
* src/gui/inventorywindow.h, src/gui/itemcontainer.h,
diff --git a/src/game.cpp b/src/game.cpp
index 9bfdea9a..e66902d9 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -559,7 +559,7 @@ void Game::handleInput()
case SDLK_RETURN:
// Input chat window
- if (chatWindow->isFocused() ||
+ if (chatWindow->isInputFocused() ||
deathNotice != NULL ||
weightNotice != NULL)
{
@@ -605,7 +605,7 @@ void Game::handleInput()
default:
break;
}
- if (keyboard.isEnabled() && !chatWindow->isFocused())
+ if (keyboard.isEnabled() && !chatWindow->isInputFocused())
{
const int tKey = keyboard.getKeyIndex(event.key.keysym.sym);
// Checks if any item shortcut is pressed.
@@ -655,7 +655,7 @@ void Game::handleInput()
break;
case KeyboardConfig::KEY_HIDE_WINDOWS:
// Hide certain windows
- if (!chatWindow->isFocused())
+ if (!chatWindow->isInputFocused())
{
statusWindow->setVisible(false);
inventoryWindow->setVisible(false);
@@ -710,7 +710,7 @@ void Game::handleInput()
// Moving player around
if (player_node->mAction != Being::DEAD &&
current_npc == 0 &&
- !chatWindow->isFocused())
+ !chatWindow->isInputFocused())
{
// Get the state of the keyboard keys
keyboard.refreshActiveKeys();
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index d01e934d..8b53ef98 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -243,7 +243,7 @@ ChatWindow::requestChatFocus()
}
bool
-ChatWindow::isFocused()
+ChatWindow::isInputFocused()
{
return mChatInput->isFocused();
}
diff --git a/src/gui/chat.h b/src/gui/chat.h
index 30c8dba5..f2e018a6 100644
--- a/src/gui/chat.h
+++ b/src/gui/chat.h
@@ -155,7 +155,7 @@ class ChatWindow : public Window, public gcn::ActionListener,
/**
* Checks whether ChatWindow is Focused or not.
*/
- bool isFocused();
+ bool isInputFocused();
/*
* Determines whether to send a command or an ordinary message, then
diff --git a/src/gui/itemshortcutcontainer.cpp b/src/gui/itemshortcutcontainer.cpp
index 4c376718..50f45dee 100644
--- a/src/gui/itemshortcutcontainer.cpp
+++ b/src/gui/itemshortcutcontainer.cpp
@@ -76,6 +76,8 @@ ItemShortcutContainer::draw(gcn::Graphics *graphics)
{
Graphics *g = static_cast<Graphics*>(graphics);
+ graphics->setFont(getFont());
+
for (int i = 0; i < mMaxItems; i++)
{
const int itemX = (i % mGridWidth) * mBoxWidth;
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index 9bef5d68..4ce167cd 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -302,14 +302,14 @@ void Window::scheduleDelete()
windowContainer->scheduleDelete(this);
}
-void Window::add(gcn::Widget *w, bool delChild)
+void Window::add(gcn::Widget *w)
{
- mChrome->add(w, delChild);
+ mChrome->add(w);
}
-void Window::add(gcn::Widget *w, int x, int y, bool delChild)
+void Window::add(gcn::Widget *w, int x, int y)
{
- mChrome->add(w, x, y, delChild);
+ mChrome->add(w, x, y);
}
void Window::mousePressed(gcn::MouseEvent &event)
diff --git a/src/gui/window.h b/src/gui/window.h
index 9ca435a9..f88e5c01 100644
--- a/src/gui/window.h
+++ b/src/gui/window.h
@@ -76,14 +76,16 @@ class Window : public gcn::Window, gcn::WidgetListener
void draw(gcn::Graphics *graphics);
/**
- * Adds a widget to the window.
+ * Adds a widget to the window. The widget will be deleted by the
+ * window.
*/
- void add(gcn::Widget *wi, bool delChild = true);
+ void add(gcn::Widget *w);
/**
- * Adds a widget to the window and also specifices its position.
+ * Adds a widget to the window and also specifices its position. The
+ * widget will be deleted by the window.
*/
- void add(gcn::Widget *w, int x, int y, bool delChild = true);
+ void add(gcn::Widget *w, int x, int y);
/**
* Sets the size of this window.