]> git.localhorst.tv Git - l2e.git/blobdiff - src/menu/CapsuleChangeMenu.cpp
added capsule change menu stub
[l2e.git] / src / menu / CapsuleChangeMenu.cpp
diff --git a/src/menu/CapsuleChangeMenu.cpp b/src/menu/CapsuleChangeMenu.cpp
new file mode 100644 (file)
index 0000000..3b161ad
--- /dev/null
@@ -0,0 +1,97 @@
+#include "CapsuleChangeMenu.h"
+
+#include "CapsuleMenu.h"
+#include "Resources.h"
+#include "../app/Application.h"
+#include "../app/Input.h"
+#include "../common/Inventory.h"
+#include "../common/Item.h"
+#include "../common/GameConfig.h"
+#include "../common/GameState.h"
+#include "../graphics/Font.h"
+#include "../graphics/Frame.h"
+
+using app::Input;
+using common::Capsule;
+using common::Inventory;
+using common::Item;
+using geometry::Vector;
+using graphics::Font;
+using graphics::Frame;
+
+namespace menu {
+
+CapsuleChangeMenu::CapsuleChangeMenu(CapsuleMenu *parent)
+: parent(parent) {
+
+}
+
+
+void CapsuleChangeMenu::OnEnterState(SDL_Surface *) {
+
+}
+
+void CapsuleChangeMenu::OnExitState(SDL_Surface *) {
+
+}
+
+void CapsuleChangeMenu::OnResumeState(SDL_Surface *) {
+
+}
+
+void CapsuleChangeMenu::OnPauseState(SDL_Surface *) {
+
+}
+
+
+void CapsuleChangeMenu::OnResize(int width, int height) {
+
+}
+
+
+void CapsuleChangeMenu::HandleEvents(const Input &input) {
+       if (input.JustPressed(Input::ACTION_B)) {
+               Ctrl().PopState();
+       }
+}
+
+void CapsuleChangeMenu::UpdateWorld(float deltaT) {
+
+}
+
+void CapsuleChangeMenu::Render(SDL_Surface *screen) {
+       const Font &font(*parent->Res().statusFont);
+       const Vector<int> offset((screen->w - Width()) / 2, (screen->h - Height()) / 2);
+       const Vector<int> capsuleOffset(
+                       6 * font.CharWidth(),
+                       12 * font.CharHeight());
+       const Vector<int> infoOffset(
+                       12 * font.CharWidth(),
+                       2 * font.CharHeight() - font.CharHeight() / 8);
+       // TODO: wheel offset: top left, center, or center bottom?
+       const Vector<int> wheelOffset;
+       const Vector<int> menuOffset(
+                               font.CharWidth(),
+                               24 * font.CharHeight() - font.CharHeight() / 8);
+
+       parent->RenderBackground(screen);
+       parent->RenderCapsule(screen, offset + capsuleOffset);
+       parent->RenderInfo(screen, offset + infoOffset);
+       parent->RenderWheel(screen, offset + wheelOffset);
+       parent->RenderMenu(screen, offset + menuOffset);
+}
+
+
+int CapsuleChangeMenu::Width() const {
+       return parent->Width();
+}
+
+int CapsuleChangeMenu::Height() const {
+       return parent->Height();
+}
+
+const Capsule &CapsuleChangeMenu::GetCapsule() const {
+       return parent->GetCapsule();
+}
+
+}