From 4b8df221acc3bd3e681357df912bdbc7a1ce6c3f Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Thu, 23 Aug 2007 13:43:17 +0000 Subject: Removed two useless popup related methods, used generic close button functionality for the debug window and renamed Particle::mVector to Particle::mVelocity for clarity. --- src/gui/debugwindow.cpp | 14 +------------- src/gui/debugwindow.h | 9 ++------- src/gui/viewport.cpp | 16 ++-------------- src/gui/viewport.h | 12 ------------ 4 files changed, 5 insertions(+), 46 deletions(-) (limited to 'src/gui') 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; } } @@ -473,18 +473,6 @@ Viewport::showPopup(int x, int y, Item *item) mPopupMenu->showPopup(x, y, 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) { 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 @@ -129,18 +129,6 @@ class Viewport : public WindowContainer, public gcn::MouseListener, getCameraY() { return mCameraY; } 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 */ -- cgit v1.2.3-70-g09d2