The open source repository for the action RPG game in development by Sig Productions titled 'Adventures in Lestoria'! https://forums.lestoria.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AdventuresInLestoria/Crawler/MenuComponent.h

26 lines
993 B

#pragma once
#include "Menu.h"
class MenuComponent{
friend class Menu;
MenuType menuDest;
bool hovered=false;
bool selectable=true;
private:
float hoverEffect=0;
protected:
geom2d::rect<float>rect;
std::string label;
bool border=true;
bool draggable=false;
MenuFunc onClick;
public:
MenuComponent(geom2d::rect<float>rect,std::string label,MenuFunc onClick,bool selectable=true);
MenuComponent(geom2d::rect<float>rect,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.
virtual MenuComponent*PickUpDraggableItem();
//We are attempting to drop draggable onto this item. If it's not allowed, return false.
virtual bool DropDraggableItem(MenuComponent*draggable);
};