X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FMenu.h;h=886e2fd07af5a7bacb4d0c04566bc9824719231f;hb=2255d436a0c2acc10b015827366a72b2ece86094;hp=b29e9687cc58bd7019bc9f879bea14c9e3b24340;hpb=ea2353f282a48a4474b32a1ab604eaf1aeff4e2b;p=l2e.git diff --git a/src/graphics/Menu.h b/src/graphics/Menu.h index b29e968..886e2fd 100644 --- a/src/graphics/Menu.h +++ b/src/graphics/Menu.h @@ -1,10 +1,3 @@ -/* - * Menu.h - * - * Created on: Aug 8, 2012 - * Author: holy - */ - #ifndef GRAPHICS_MENU_H_ #define GRAPHICS_MENU_H_ @@ -109,6 +102,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 +273,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;