X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FMenu.h;h=179c457d6f9f4a2639f7f8ce416851fb1eeb3990;hb=350055a7ff27c74882aff8a4d6af2014782f830b;hp=b29e9687cc58bd7019bc9f879bea14c9e3b24340;hpb=ea2353f282a48a4474b32a1ab604eaf1aeff4e2b;p=l2e.git 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;