#pragma once #include "Menu.h" class MenuComponent{ friend class Menu; friend class MenuItemButton; MenuType menuDest; bool selectable=true; private: float hoverEffect=0; protected: geom2d::rectrect; std::string label; bool border=true; bool draggable=false; MenuFunc onClick; MenuType parentMenu=MenuType::ENUM_END; bool hovered=false; public: MenuComponent(MenuType parent,geom2d::rectrect,std::string label,MenuFunc onClick,bool selectable=true); MenuComponent(MenuType parent,geom2d::rectrect,std::string label,MenuType menuDest,MenuFunc onClick,bool selectable=true); virtual void Update(Crawler*game); virtual void Draw(Crawler*game,vf2d parentPos,bool focused); //We picked up a draggable component, we should make a copy and return it here. If a nullptr is returned here, the pickup is not allowed. //WARNING!!! This allocates a brand new component when successful!!! Be prepared to clear it! virtual MenuComponent*PickUpDraggableItem(); //We are attempting to drop draggable onto this item. If it's not allowed, return false. virtual bool DropDraggableItem(MenuComponent*draggable); };