31#include <guichan/mouselistener.hpp>
78 void logic()
override;
110 bool isInventory =
true,
bool canDrop =
true);
161 void shakeScreen(
float x,
float y,
float decay = 0.95f,
unsigned duration = 0);
182 gcn::Color color = gcn::Color(255, 0, 0));
An item lying on the floor.
A central point of control for graphics.
Stores a set of subimages originating from a single image.
Represents one or more instances of a certain item type.
Simple timer that can be used to check if a certain amount of time has passed.
Map * getCurrentMap() const
Returns the current map object.
int mMouseX
Current mouse position in pixels.
int getMouseY() const
Returns mouse y in pixels.
void mousePressed(gcn::MouseEvent &event) override
Handles mouse press on map.
void _drawPath(Graphics *graphics, const Path &path, gcn::Color color=gcn::Color(255, 0, 0))
Draws the given path.
void logic() override
Implements player to keep following mouse.
std::list< ShakeEffect > mShakeEffects
void mouseMoved(gcn::MouseEvent &event) override
Handles mouse move on map.
Being * mHoverBeing
Being mouse is currently over.
int getMouseX() const
Returns mouse x in pixels.
Timer mLocalWalkTimer
Timer for sending walk messages.
void setMap(Map *map)
Sets the map displayed by the viewport.
PopupMenu * mPopupMenu
Popup menu.
void event(Event::Channel channel, const Event &event) override
float mPixelViewY
Current viewpoint in pixels.
void mouseDragged(gcn::MouseEvent &event) override
Handles mouse move on map.
int mDebugFlags
Flags for showing debug graphics.
BeingPopup * mBeingPopup
Being information popup.
void closePopupMenu()
Closes the popup menu.
void shakeScreenStop()
Stops all active screen shake effects.
void draw(gcn::Graphics *graphics) override
Draws the viewport.
void scrollBy(float x, float y)
Changes viewpoint by relative pixel coordinates.
Map * mMap
The current map.
float mPixelViewX
Current viewpoint in pixels.
void _followMouse()
Make the player go to the mouse position.
int getCameraY() const
Returns camera y offset in pixels.
void _drawDebugPath(Graphics *graphics)
Finds a path from the player to the mouse, and draws it.
void setDebugFlags(int debugFlags)
Sets which debug flags (see Map::DebugFlags) should be enabled.
void hideBeingPopup()
Hides the BeingPopup.
void updateCursorType()
Updates the cursor type.
void mouseReleased(gcn::MouseEvent &event) override
Handles mouse button release on map.
void showPopup(Window *parent, int x, int y, Item *item, bool isInventory=true, bool canDrop=true)
Shows a popup for an item.
int getCameraX() const
Returns camera x offset in pixels.
FloorItem * mHoverItem
FloorItem mouse is currently over.
void shakeScreen(int intensity)
Makes the screen shake in a random direction.
int mMouseY
Current mouse position in pixels.
std::list< Position > Path
Viewport * viewport
The viewport.
const int walkingMouseDelay
Delay between two mouse calls when dragging mouse and move the player.