Inventory display window tabs are implemented, inventory component is displayed. Ranger Backstep cancels casts. Casts are forced to be channeled for 0.2 seconds before walking can cancel them,

This commit is contained in:
2023-12-10 20:14:32 -06:00
parent 737463c695
commit 469bea4c5e
13 changed files with 82 additions and 29 deletions
+8 -1
View File
@@ -51,6 +51,13 @@ MenuComponent::MenuComponent(geom2d::rect<float>rect,std::string label,MenuType
this->menuDest=menuDest;
}
MenuComponent::MenuComponent(geom2d::rect<float>rect,std::string label,MenuType menuDest,MenuFunc onClick,vf2d labelScaling,ButtonAttr attributes)
:MenuComponent(rect,label,menuDest,onClick,attributes){
//NOTE: This constructor also calls the other constructor above!
this->labelScaling=labelScaling;
if (labelScaling!=vf2d{1,1})this->decal=true; //Since we would have to draw text smaller than an integer scale, we are forced to use a decal here.
}
MenuComponent::~MenuComponent(){
Menu*pMenu=Menu::menus[parentMenu];
for(auto key:pMenu->buttons){
@@ -122,7 +129,7 @@ void MenuComponent::DrawDecal(Crawler*game,vf2d parentPos,bool focused){
game->FillRectDecal(rect.pos+parentPos+vf2d{0,rect.size.y-1},{rect.size.x,1});
}
if(showDefaultLabel){
game->DrawStringPropDecal(rect.pos+parentPos+rect.size/2-game->GetTextSizeProp(label)/2,label);
game->DrawStringPropDecal(rect.pos+parentPos+rect.size/2-vf2d(game->GetTextSizeProp(label))/2.f*labelScaling,label,WHITE,labelScaling);
}
}
}