Fix border display drawing for menus. Fix scrollable window components that went outside to use proper scrolling offsets. Fix issue with same-frame clicking and releasing causing a different button to be selected.

This commit is contained in:
2023-12-15 23:57:09 -06:00
parent 92c093c589
commit 025a89788e
22 changed files with 103 additions and 101 deletions
+4 -4
View File
@@ -133,10 +133,10 @@ protected:
}
}
}
virtual inline void DrawDecal(ViewPort&window,vf2d parentPos,bool focused)override{
MenuIconButton::DrawDecal(window,parentPos,focused);
virtual inline void DrawDecal(ViewPort&window,bool focused)override{
MenuIconButton::DrawDecal(window,focused);
if(selected!=-1){
drawutil::DrawCrosshairDecalViewPort(window,{parentPos+rect.pos,rect.size},0);
drawutil::DrawCrosshairDecalViewPort(window,{rect.pos,rect.size},0);
}
if(valid){
int itemQuantity=Inventory::GetItemCount(invRef.at(inventoryIndex).Name()); //Normally we'd retrieve how many of this item we have from our inventory...However Monster Loot and Stage Loot inventories are special and hold their own inventory counts...
@@ -146,7 +146,7 @@ protected:
std::string quantityText="x"+std::to_string(itemQuantity);
vf2d quantityTextScale=rect.size/48.f;
vf2d textSize=vf2d(game->GetTextSizeProp(quantityText))*quantityTextScale;
vf2d drawPos=parentPos+rect.pos+rect.size-textSize;
vf2d drawPos=rect.pos+rect.size-textSize;
geom2d::rect<float>boundingBox={drawPos,textSize};
window.DrawShadowStringDecal(drawPos,quantityText,WHITE,BLACK,quantityTextScale,quantityTextScale.x);
}