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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user