From: Daniel Karbach Date: Sat, 17 Nov 2012 13:28:25 +0000 (+0100) Subject: third column menu hack for cursor X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=dc2dcbbfa1298bed46a4190fbd337c7ef83cc8af;p=l2e.git third column menu hack for cursor --- 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;