]> git.localhorst.tv Git - l2e.git/blobdiff - src/menu/CapsuleMenu.cpp
added capsule menu stub
[l2e.git] / src / menu / CapsuleMenu.cpp
diff --git a/src/menu/CapsuleMenu.cpp b/src/menu/CapsuleMenu.cpp
new file mode 100644 (file)
index 0000000..c85091b
--- /dev/null
@@ -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<int> offset((screen->w - Width()) / 2, (screen->h - Height()) / 2);
+
+       RenderBackground(screen);
+}
+
+void CapsuleMenu::RenderBackground(SDL_Surface *screen) const {
+       parent->Res().capsulebg->Render(screen, Vector<int>(), Vector<int>(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;
+}
+
+}