Prepare framework with Draw and DrawDecal split.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "Crawler.h"
|
||||
#include "Item.h"
|
||||
#include "safemap.h"
|
||||
#include "olcPGEX_Graphics2D.h"
|
||||
|
||||
INCLUDE_game
|
||||
INCLUDE_ITEM_DATA
|
||||
@@ -57,12 +58,12 @@ protected:
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual inline void Draw(Crawler*game,vf2d parentPos,bool focused)override{
|
||||
MenuIconButton::Draw(game,parentPos,focused);
|
||||
virtual inline void DrawDecal(Crawler*game,vf2d parentPos,bool focused)override{
|
||||
MenuIconButton::DrawDecal(game,parentPos,focused);
|
||||
if(valid){
|
||||
std::string quantityText="x"+std::to_string(Inventory::GetItemCount(invRef.at(inventoryIndex)));
|
||||
vf2d textSize=vf2d(game->GetTextSizeProp(quantityText))*0.5;
|
||||
game->DrawShadowStringDecal(parentPos+rect.pos+rect.size-textSize,quantityText,WHITE,BLACK,{0.5,0.5},0.5);
|
||||
game->DrawShadowStringDecal(Menu::menus[parentMenu]->pos+parentPos+rect.pos+rect.size-textSize,quantityText,WHITE,BLACK,{0.5,0.5},0.5);
|
||||
}
|
||||
}
|
||||
virtual inline MenuComponent*PickUpDraggableItem()override{
|
||||
|
||||
Reference in New Issue
Block a user