1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Added initial version of selection highlight

This commit is contained in:
Ivan Savenko
2023-07-19 19:19:21 +03:00
parent 816adecca0
commit e2ad8bbf58
11 changed files with 34 additions and 8 deletions

View File

@@ -37,13 +37,16 @@ class RadialMenuItem : public CIntObject
{
friend class RadialMenu;
std::shared_ptr<IImage> image;
std::shared_ptr<CPicture> picture;
std::shared_ptr<CPicture> iconImage;
std::shared_ptr<CPicture> selectedImage;
std::shared_ptr<CPicture> inactiveImage;
std::function<void()> callback;
std::string hoverText;
public:
RadialMenuItem(const std::string & imageName, const std::string & hoverText, const std::function<void()> & callback);
void setSelected(bool selected);
};
class RadialMenu : public CIntObject
@@ -52,6 +55,8 @@ class RadialMenu : public CIntObject
std::shared_ptr<CGStatusBar> statusBar;
std::shared_ptr<RadialMenuItem> selectedItem;
void addItem(const Point & offset, bool enabled, const std::string & path, const std::string & hoverText, const std::function<void()> & callback);
std::shared_ptr<RadialMenuItem> findNearestItem(const Point & cursorPosition) const;