X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmenu%2FCapsuleMenu.cpp;h=67afd57af42ee4360b44a197af487bd59c6bba67;hb=a3ba4dc677ad7c92eeb78b20b642241563605c9d;hp=ab32a1bcb2260b3b2a51d57d6cda58958ed23362;hpb=60e0fe29ce6cd033edc78b181d9d07fa72c11172;p=l2e.git diff --git a/src/menu/CapsuleMenu.cpp b/src/menu/CapsuleMenu.cpp index ab32a1b..67afd57 100644 --- a/src/menu/CapsuleMenu.cpp +++ b/src/menu/CapsuleMenu.cpp @@ -18,7 +18,7 @@ using app::Input; using common::Capsule; using common::Stats; -using geometry::Vector; +using math::Vector; using graphics::Font; using graphics::Frame; @@ -97,7 +97,9 @@ void CapsuleMenu::Render(SDL_Surface *screen) { 12 * font.CharWidth(), 2 * font.CharHeight() - font.CharHeight() / 8); // TODO: wheel offset: top left, center, or center bottom? - const Vector wheelOffset; + const Vector wheelOffset( + 6 * font.CharWidth(), + 19 * font.CharHeight() - font.CharHeight() / 8); const Vector statsOffset( 12 * font.CharWidth(), 15 * font.CharHeight() - font.CharHeight() / 8); @@ -177,7 +179,8 @@ void CapsuleMenu::RenderInfo(SDL_Surface *screen, const Vector &offset) con } void CapsuleMenu::RenderWheel(SDL_Surface *screen, const Vector &offset) const { - // later + Res().capsuleAlignmentWheel->DrawCenter(screen, offset); + Res().capsuleAlignmentCursor->DrawCenter(screen, offset + Game().state->GetCapsule().AlignmentOffset()); } void CapsuleMenu::RenderStats(SDL_Surface *screen, const Vector &offset) const { @@ -217,7 +220,7 @@ void CapsuleMenu::RenderStats(SDL_Surface *screen, const Vector &offset) co font.DrawNumberRight(capsule.NextLevel(), screen, lineHead); } -void CapsuleMenu::RenderStatsLine(SDL_Surface *screen, const geometry::Vector &offset, const char *name, int value) const { +void CapsuleMenu::RenderStatsLine(SDL_Surface *screen, const math::Vector &offset, const char *name, int value) const { const Font &font(*Res().statusFont); const Vector numberOffset(4 * font.CharWidth(), 0); @@ -260,8 +263,12 @@ int CapsuleMenu::Height() const { return parent->Height(); } +Capsule &CapsuleMenu::GetCapsule() { + return Game().state->GetCapsule(); +} + const Capsule &CapsuleMenu::GetCapsule() const { - return *Game().state->capsule; + return Game().state->GetCapsule(); } }