make images fit in inventory grids better, and fix the mithril dust texture

This commit is contained in:
darkrose 2015-08-06 06:17:50 +10:00
parent cd9b5bc6fa
commit 8ff989b064
2 changed files with 9 additions and 4 deletions

View File

@ -746,7 +746,7 @@ void content_craftitem_init()
i = CONTENT_CRAFTITEM_MITHRILDUST; i = CONTENT_CRAFTITEM_MITHRILDUST;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
f->content = CONTENT_CRAFTITEM_MITHRILDUST; f->content = CONTENT_CRAFTITEM_MITHRILDUST;
f->texture = "mese_dust.png"; f->texture = "mithril_dust.png";
f->name = "mese_dust"; f->name = "mese_dust";
f->description = wgettext("Mithril Dust"); f->description = wgettext("Mithril Dust");
f->drop_count = 1; f->drop_count = 1;

View File

@ -480,6 +480,8 @@ GUIFormSpecMenu::ItemSpec GUIFormSpecMenu::getItemAtPos(v2s32 p) const
s32 y = ((i-s.i_start)/s.geom.X) * spacing.Y; s32 y = ((i-s.i_start)/s.geom.X) * spacing.Y;
v2s32 p0(x,y); v2s32 p0(x,y);
core::rect<s32> rect = imgrect + s.pos + p0; core::rect<s32> rect = imgrect + s.pos + p0;
rect.UpperLeftCorner -= 2;
rect.LowerRightCorner += 2;
if (rect.isPointInside(p)) { if (rect.isPointInside(p)) {
return ItemSpec(s.inventoryloc, s.listname, i); return ItemSpec(s.inventoryloc, s.listname, i);
} }
@ -515,17 +517,20 @@ void GUIFormSpecMenu::drawList(const ListDrawSpec &s, int phase)
s32 y = ((i-s.i_start)/s.geom.X) * spacing.Y; s32 y = ((i-s.i_start)/s.geom.X) * spacing.Y;
v2s32 p(x,y); v2s32 p(x,y);
core::rect<s32> rect = imgrect + s.pos + p; core::rect<s32> rect = imgrect + s.pos + p;
core::rect<s32> brect = rect;
brect.UpperLeftCorner -= 2;
brect.LowerRightCorner += 2;
InventoryItem *item = NULL; InventoryItem *item = NULL;
if (ilist) if (ilist)
item = ilist->getItem(i); item = ilist->getItem(i);
driver->draw2DRectangle(GUI_INV_BG, rect, &AbsoluteClippingRect); driver->draw2DRectangle(GUI_INV_BG, brect, &AbsoluteClippingRect);
if (m_selected_item != NULL && m_selected_item->listname == s.listname && m_selected_item->i == i) { if (m_selected_item != NULL && m_selected_item->listname == s.listname && m_selected_item->i == i) {
driver->draw2DRectangleOutline(rect, GUI_INV_HIGHLIGHT); driver->draw2DRectangleOutline(brect, GUI_INV_HIGHLIGHT);
}else{ }else{
driver->draw2DRectangleOutline(rect, GUI_INV_BORDER); driver->draw2DRectangleOutline(brect, GUI_INV_BORDER);
} }
if (item) { if (item) {