diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-03-01 21:11:53 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-03-02 14:39:09 +0100 |
commit | c7e48aaf7eb0f2df76327b963879416a0cc8d5e7 (patch) | |
tree | b8bec0950af7dcd9a913d6aa92a7944216e6ae48 /src/gui/gui.h | |
parent | 5efaa5125fe92a5438b3cc2949f4d720bced5a7a (diff) | |
download | mana-c7e48aaf7eb0f2df76327b963879416a0cc8d5e7.tar.gz mana-c7e48aaf7eb0f2df76327b963879416a0cc8d5e7.tar.bz2 mana-c7e48aaf7eb0f2df76327b963879416a0cc8d5e7.tar.xz mana-c7e48aaf7eb0f2df76327b963879416a0cc8d5e7.zip |
Updated mouse cursors to latest version
The new cursor types are not used yet for now.
Diffstat (limited to 'src/gui/gui.h')
-rw-r--r-- | src/gui/gui.h | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/src/gui/gui.h b/src/gui/gui.h index eea3f23d..b731514f 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -41,6 +41,26 @@ class SDLInput; */ /** + * Cursors are in graphic order from left to right. + * CURSOR_POINTER should be left untouched. + */ +enum class Cursor { + POINTER = 0, + RESIZE_ACROSS, + RESIZE_DOWN, + RESIZE_DOWN_LEFT, + RESIZE_DOWN_RIGHT, + FIGHT, + PICKUP, + TALK, + ACTION, + LEFT, + UP, + RIGHT, + DOWN, +}; + +/** * Main GUI class. * * \ingroup GUI @@ -93,26 +113,9 @@ class Gui : public gcn::Gui /** * Sets which cursor should be used. */ - void setCursorType(int index) + void setCursorType(Cursor index) { mCursorType = index; } - /** - * Cursors are in graphic order from left to right. - * CURSOR_POINTER should be left untouched. - * CURSOR_TOTAL should always be last. - */ - enum { - CURSOR_POINTER = 0, - CURSOR_RESIZE_ACROSS, - CURSOR_RESIZE_DOWN, - CURSOR_RESIZE_DOWN_LEFT, - CURSOR_RESIZE_DOWN_RIGHT, - CURSOR_FIGHT, - CURSOR_PICKUP, - CURSOR_TALK, - CURSOR_TOTAL - }; - protected: void handleMouseMoved(const gcn::MouseInput &mouseInput) override; void handleTextInput(const TextInput &textInput); @@ -121,11 +124,11 @@ class Gui : public gcn::Gui GuiConfigListener *mConfigListener; gcn::Font *mGuiFont; /**< The global GUI font */ gcn::Font *mInfoParticleFont; /**< Font for Info Particles*/ - bool mCustomCursor; /**< Show custom cursor */ - ImageSet *mMouseCursors; /**< Mouse cursor images */ - float mMouseCursorAlpha; - int mMouseInactivityTimer; - int mCursorType; + bool mCustomCursor = false; /**< Show custom cursor */ + ImageSet *mMouseCursors = nullptr; /**< Mouse cursor images */ + float mMouseCursorAlpha = 1.0f; + int mMouseInactivityTimer = 0; + Cursor mCursorType = Cursor::POINTER; }; extern Gui *gui; /**< The GUI system */ |