MenuProperties()
: font(0), disabledFont(0), cursor(0)
- , charsPerEntry(0), rows(0), rowGap(0)
- , iconSpace(0), cols(0), colGap(0)
+ , charsPerEntry(0), rows(1), rowGap(0)
+ , iconSpace(0), cols(1), colGap(0)
, charsPerNumber(0), charsPerAdditionalText(0)
, additionalTextGap(0), delimiter(':')
, wrapX(false), wrapY(false) { }
geometry::Vector<int> iconOffset(
(i % cols) * (ColWidth() + colGap),
(i / cols) * RowHeight());
+
+ // Third column hack!
+ // This fixes the position of the "DROP" item in the inventory menu.
+ if (i % cols == 2) {
+ iconOffset += geometry::Vector<int>(font->CharWidth(), 0);
+ }
+
if (entries[start + i].icon) {
entries[start + i].icon->Draw(dest, position + iconOffset);
}
if (charsPerNumber) {
usedFont->DrawChar(delimiter, dest, position + textOffset);
textOffset += geometry::Vector<int>(usedFont->CharWidth(), 0);
- usedFont->DrawNumber(entries[start + i].number, dest, position + textOffset);
+ usedFont->DrawNumber(entries[start + i].number, dest, position + textOffset, charsPerNumber);
}
}
geometry::Vector<int> cursorOffset(