summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-08-23 13:43:17 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-08-23 13:43:17 +0000
commit4b8df221acc3bd3e681357df912bdbc7a1ce6c3f (patch)
tree3b3d196dcbeacc67b1479d56e3eccc14dfef07e1 /src/gui
parent4346b429cc875a85095fff271a8d82a46c2cfc91 (diff)
downloadmana-client-4b8df221acc3bd3e681357df912bdbc7a1ce6c3f.tar.gz
mana-client-4b8df221acc3bd3e681357df912bdbc7a1ce6c3f.tar.bz2
mana-client-4b8df221acc3bd3e681357df912bdbc7a1ce6c3f.tar.xz
mana-client-4b8df221acc3bd3e681357df912bdbc7a1ce6c3f.zip
Removed two useless popup related methods, used generic close button
functionality for the debug window and renamed Particle::mVector to Particle::mVelocity for clarity.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/debugwindow.cpp14
-rw-r--r--src/gui/debugwindow.h9
-rw-r--r--src/gui/viewport.cpp16
-rw-r--r--src/gui/viewport.h12
4 files changed, 5 insertions, 46 deletions
diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp
index ebf7d974..d6d99307 100644
--- a/src/gui/debugwindow.cpp
+++ b/src/gui/debugwindow.cpp
@@ -44,6 +44,7 @@ DebugWindow::DebugWindow():
setWindowName("Debug");
setResizable(true);
+ setCloseButton(true);
setDefaultSize(0, 0, 400, 100);
loadWindowState();
@@ -62,15 +63,11 @@ DebugWindow::DebugWindow():
mParticleCountLabel = new gcn::Label("[Particle count: 0]");
mParticleCountLabel->setPosition(100, 60);
- Button *closeButton = new Button("Close", "close", this);
- closeButton->setPosition(5, 60);
-
add(mFPSLabel);
add(mMusicFileLabel);
add(mMapFileLabel);
add(mTileMouseLabel);
add(mParticleCountLabel);
- add(closeButton);
}
void
@@ -108,12 +105,3 @@ DebugWindow::logic()
+"]");
mParticleCountLabel->adjustSize();
}
-
-void
-DebugWindow::action(const gcn::ActionEvent &event)
-{
- if (event.getId() == "close")
- {
- setVisible(false);
- }
-}
diff --git a/src/gui/debugwindow.h b/src/gui/debugwindow.h
index d082b2ca..9b6f2017 100644
--- a/src/gui/debugwindow.h
+++ b/src/gui/debugwindow.h
@@ -33,11 +33,11 @@
#include "../guichanfwd.h"
/**
- * The chat window.
+ * The debug window.
*
* \ingroup Interface
*/
-class DebugWindow : public Window, public gcn::ActionListener
+class DebugWindow : public Window
{
public:
/**
@@ -50,11 +50,6 @@ class DebugWindow : public Window, public gcn::ActionListener
*/
void logic();
- /**
- * Performs action.
- */
- void action(const gcn::ActionEvent &event);
-
private:
gcn::Label *mMusicFileLabel, *mMapFileLabel;
gcn::Label *mTileMouseLabel, *mFPSLabel;
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 6c89d107..4c64c627 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -371,12 +371,12 @@ Viewport::mousePressed(gcn::MouseEvent &event)
if ((being = beingManager->findBeing(tilex, tiley)) &&
being->getType() != Being::LOCALPLAYER)
{
- showPopup(event.getX(), event.getY(), being);
+ mPopupMenu->showPopup(event.getX(), event.getY(), being);
return;
}
else if((floorItem = floorItemManager->findByCoordinates(tilex, tiley)))
{
- showPopup(event.getX(), event.getY(), floorItem);
+ mPopupMenu->showPopup(event.getX(), event.getY(), floorItem);
return;
}
}
@@ -474,18 +474,6 @@ Viewport::showPopup(int x, int y, Item *item)
}
void
-Viewport::showPopup(int x, int y, FloorItem *floorItem)
-{
- mPopupMenu->showPopup(x, y, floorItem);
-}
-
-void
-Viewport::showPopup(int x, int y, Being *being)
-{
- mPopupMenu->showPopup(x, y, being);
-}
-
-void
Viewport::optionChanged(const std::string &name)
{
mScrollLaziness = (int) config.getValue("ScrollLaziness", 32);
diff --git a/src/gui/viewport.h b/src/gui/viewport.h
index 16136cee..eeb31bae 100644
--- a/src/gui/viewport.h
+++ b/src/gui/viewport.h
@@ -130,18 +130,6 @@ class Viewport : public WindowContainer, public gcn::MouseListener,
private:
/**
- * Shows a popup for a floor item.
- * TODO Find some way to get rid of FloorItem here
- */
- void showPopup(int x, int y, FloorItem *floorItem);
-
- /**
- * Shows a popup for a being.
- * TODO Find some way to get rid of Being here
- */
- void showPopup(int x, int y, Being *being);
-
- /**
* Helper function for loading target cursors
*/
void