td.AddField("additionalTextGap", FieldDescription(((char *)&p.additionalTextGap) - ((char *)&p), Interpreter::NUMBER_ID).SetDescription("space between normal and additional text in pixels"));
td.AddField("wrapX", FieldDescription(((char *)&p.wrapX) - ((char *)&p), Interpreter::BOOLEAN_ID).SetDescription("horizontally wrap cursor movement"));
td.AddField("wrapY", FieldDescription(((char *)&p.wrapY) - ((char *)&p), Interpreter::BOOLEAN_ID).SetDescription("vertically wrap cursor movement"));
+ td.AddField("thirdColumnHack", FieldDescription(((char *)&p.thirdColumnHack) - ((char *)&p), Interpreter::NUMBER_ID).SetDescription("offset the third column by this many characters"));
}
void MenuProperties::Construct(void *data) {
int charsPerNumber;
int charsPerAdditionalText;
int additionalTextGap;
+ int thirdColumnHack;
char delimiter;
bool wrapX;
bool wrapY;
, charsPerEntry(0), rows(1), rowGap(0)
, iconSpace(0), cols(1), colGap(0)
, charsPerNumber(0), charsPerAdditionalText(0)
- , additionalTextGap(0), delimiter(':')
+ , additionalTextGap(0), thirdColumnHack(0), delimiter(':')
, wrapX(false), wrapY(false) { }
static void CreateTypeDescription();
(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);
+ // This fixes the position of the third column of the inventory and capsule menus.
+ if (thirdColumnHack && i % cols == 2) {
+ iconOffset += geometry::Vector<int>(font->CharWidth() * thirdColumnHack, 0);
}
if (entries[start + i].icon) {
geometry::Vector<int> cursorOffset(
(selected % cols) * (ColWidth() + colGap) - cursor->Width(),
((selected - start) / cols) * RowHeight());
- // Third column hack!
- // This fixes the position of the "DROP" item in the inventory menu.
- if (selected % cols == 2) {
- cursorOffset += geometry::Vector<int>(font->CharWidth(), 0);
+ // This fixes the position of the third column of the inventory and capsule menus.
+ if (thirdColumnHack && selected % cols == 2) {
+ cursorOffset += geometry::Vector<int>(font->CharWidth() * thirdColumnHack, 0);
}
switch (state) {
case STATE_INACTIVE: