X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmenu%2FCapsuleMenu.cpp;h=e50215ce34979cc628853a9225d55d31c160f637;hb=5d1a76ae7725af998c6ee46adfe492c68ee1d34f;hp=22d0ad7129b757606ab580e55f1d0cb7844d057d;hpb=5bbf6cd4a9b9d51ca9f21a360d1ba039d4642614;p=l2e.git diff --git a/src/menu/CapsuleMenu.cpp b/src/menu/CapsuleMenu.cpp index 22d0ad7..e50215c 100644 --- a/src/menu/CapsuleMenu.cpp +++ b/src/menu/CapsuleMenu.cpp @@ -2,6 +2,7 @@ #include "CapsuleChangeMenu.h" #include "CapsuleFeedMenu.h" +#include "CapsuleNameMenu.h" #include "PartyMenu.h" #include "Resources.h" #include "../app/Application.h" @@ -17,7 +18,7 @@ using app::Input; using common::Capsule; using common::Stats; -using geometry::Vector; +using math::Vector; using graphics::Font; using graphics::Frame; @@ -73,7 +74,7 @@ void CapsuleMenu::HandleEvents(const Input &input) { menu.SetSelected(); break; case CHOICE_NAME: - // push name menu + Ctrl().PushState(new CapsuleNameMenu(this)); menu.SetSelected(); break; } @@ -82,7 +83,7 @@ void CapsuleMenu::HandleEvents(const Input &input) { } } -void CapsuleMenu::UpdateWorld(float deltaT) { +void CapsuleMenu::UpdateWorld(Uint32 deltaT) { } @@ -96,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); @@ -176,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 { @@ -216,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); @@ -259,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(); } }