Mana
Loading...
Searching...
No Matches
itemshortcutcontainer.h
Go to the documentation of this file.
1/*
2 * The Mana Client
3 * Copyright (C) 2007-2009 The Mana World Development Team
4 * Copyright (C) 2009-2012 The Mana Developers
5 *
6 * This file is part of The Mana Client.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#pragma once
23
25
26#include <guichan/mouselistener.hpp>
27
28#include <memory>
29
30class Image;
31class Item;
32class ItemPopup;
33
40{
41 public:
43
45
49 void draw(gcn::Graphics *graphics) override;
50
54 void mouseDragged(gcn::MouseEvent &event) override;
55
59 void mousePressed(gcn::MouseEvent &event) override;
60
64 void mouseReleased(gcn::MouseEvent &event) override;
65
66 private:
67 void mouseExited(gcn::MouseEvent &event) override;
68 void mouseMoved(gcn::MouseEvent &event) override;
69
70 Item *getItemAt(int x, int y) const;
71
72 bool mItemClicked = false;
73 Item *mItemMoved = nullptr;
74
75 std::unique_ptr<ItemPopup> mItemPopup;
76};
Defines a class for loading and storing images.
Definition image.h:45
A popup that displays information about an item.
Definition itempopup.h:39
An item shortcut container.
Item * getItemAt(int x, int y) const
void mousePressed(gcn::MouseEvent &event) override
Handles mouse when pressed.
void draw(gcn::Graphics *graphics) override
Draws the items.
void mouseReleased(gcn::MouseEvent &event) override
Handles mouse release.
void mouseMoved(gcn::MouseEvent &event) override
void mouseExited(gcn::MouseEvent &event) override
void mouseDragged(gcn::MouseEvent &event) override
Handles mouse when dragged.
std::unique_ptr< ItemPopup > mItemPopup
~ItemShortcutContainer() override
Represents one or more instances of a certain item type.
Definition item.h:35
A generic shortcut container.
Graphics * graphics
Definition client.cpp:104