X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;ds=inline;f=src%2Fmenu%2FCapsuleMenu.cpp;fp=src%2Fmenu%2FCapsuleMenu.cpp;h=c85091ba52102e43a899d4da4eb2ceee33d34fdd;hb=10a8d3a83e7ad6815bc9f752922239ef32073a5e;hp=0000000000000000000000000000000000000000;hpb=d71217e2be1466726581146000a0f61620423e9b;p=l2e.git diff --git a/src/menu/CapsuleMenu.cpp b/src/menu/CapsuleMenu.cpp new file mode 100644 index 0000000..c85091b --- /dev/null +++ b/src/menu/CapsuleMenu.cpp @@ -0,0 +1,86 @@ +#include "CapsuleMenu.h" + +#include "PartyMenu.h" +#include "Resources.h" +#include "../app/Application.h" +#include "../app/Input.h" +#include "../common/GameConfig.h" +#include "../common/GameState.h" +#include "../common/Stats.h" +#include "../graphics/Font.h" +#include "../graphics/Frame.h" +#include "../graphics/Texture.h" + +using app::Input; +using common::Capsule; +using common::Stats; +using geometry::Vector; +using graphics::Font; +using graphics::Frame; + +namespace menu { + +CapsuleMenu::CapsuleMenu(PartyMenu *parent) +: parent(parent) +, menu(*parent->Res().capsuleMenuProperties) { + menu.Add(parent->Res().capsuleFeedLabel, 0); + menu.Add(parent->Res().capsuleChangeLabel, 1); + menu.Add(parent->Res().capsuleNameLabel, 2); +} + + +void CapsuleMenu::OnEnterState(SDL_Surface *) { + +} + +void CapsuleMenu::OnExitState(SDL_Surface *) { + +} + +void CapsuleMenu::OnResumeState(SDL_Surface *) { + +} + +void CapsuleMenu::OnPauseState(SDL_Surface *) { + +} + + +void CapsuleMenu::OnResize(int width, int height) { + +} + + +void CapsuleMenu::HandleEvents(const Input &input) { + if (input.JustPressed(Input::ACTION_B)) { + Ctrl().PopState(); + } +} + +void CapsuleMenu::UpdateWorld(float deltaT) { + +} + +void CapsuleMenu::Render(SDL_Surface *screen) { + Vector offset((screen->w - Width()) / 2, (screen->h - Height()) / 2); + + RenderBackground(screen); +} + +void CapsuleMenu::RenderBackground(SDL_Surface *screen) const { + parent->Res().capsulebg->Render(screen, Vector(), Vector(screen->w, screen->h)); +} + +int CapsuleMenu::Width() const { + return parent->Width(); +} + +int CapsuleMenu::Height() const { + return parent->Height(); +} + +const Capsule &CapsuleMenu::GetCapsule() const { + return *parent->Game().state->capsule; +} + +}