mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 12:01:50 +00:00
add ItemStack::fields
This commit is contained in:
parent
fd8c26d585
commit
d86c5508d2
5 changed files with 85 additions and 29 deletions
|
|
@ -186,17 +186,26 @@ void SlotView::draw(const DrawContext& pctx, const Assets& assets) {
|
|||
}
|
||||
}
|
||||
|
||||
if (stack.getCount() > 1) {
|
||||
if (stack.getCount() > 1 || stack.getFields() != nullptr) {
|
||||
auto font = assets.get<Font>("normal");
|
||||
std::wstring text = std::to_wstring(stack.getCount());
|
||||
|
||||
if (stack.getCount() > 1) {
|
||||
std::wstring text = std::to_wstring(stack.getCount());
|
||||
|
||||
int x = pos.x+slotSize-text.length()*8;
|
||||
int y = pos.y+slotSize-16;
|
||||
int x = pos.x+slotSize-text.length()*8;
|
||||
int y = pos.y+slotSize-16;
|
||||
|
||||
batch->setColor({0, 0, 0, 1.0f});
|
||||
font->draw(*batch, text, x+1, y+1, nullptr, 0);
|
||||
batch->setColor(glm::vec4(1.0f));
|
||||
font->draw(*batch, text, x, y, nullptr, 0);
|
||||
batch->setColor({0, 0, 0, 1.0f});
|
||||
font->draw(*batch, text, x+1, y+1, nullptr, 0);
|
||||
batch->setColor(glm::vec4(1.0f));
|
||||
font->draw(*batch, text, x, y, nullptr, 0);
|
||||
}
|
||||
if (stack.getFields() != nullptr) {
|
||||
batch->setColor({0, 0, 0, 1.0f});
|
||||
font->draw(*batch, L"#", pos.x+1, pos.y+1, nullptr, 0);
|
||||
batch->setColor(glm::vec4(1.0f));
|
||||
font->draw(*batch, L"#", pos.x, pos.y, nullptr, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue