From dc2dcbbfa1298bed46a4190fbd337c7ef83cc8af Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Sat, 17 Nov 2012 14:28:25 +0100 Subject: [PATCH] third column menu hack for cursor --- src/graphics/Menu.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/graphics/Menu.h b/src/graphics/Menu.h index b29e968..179c457 100644 --- a/src/graphics/Menu.h +++ b/src/graphics/Menu.h @@ -109,6 +109,7 @@ public: void Enable(int index) { entries[index].enabled = true; } void Reserve(int n) { entries.reserve(n); } void Clear() { entries.clear(); } + void ClearEntry(int at) { entries[at] = Entry(0, T(), false); } void Draw(SDL_Surface *dest, const geometry::Vector &position) const; @@ -279,6 +280,11 @@ void Menu::Draw(SDL_Surface *dest, const geometry::Vector &position) con geometry::Vector 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(font->CharWidth(), 0); + } switch (state) { case STATE_INACTIVE: break; -- 2.39.2