]> git.localhorst.tv Git - l2e.git/blob - src/menu/CapsuleMenu.cpp
added capsule menu stub
[l2e.git] / src / menu / CapsuleMenu.cpp
1 #include "CapsuleMenu.h"
2
3 #include "PartyMenu.h"
4 #include "Resources.h"
5 #include "../app/Application.h"
6 #include "../app/Input.h"
7 #include "../common/GameConfig.h"
8 #include "../common/GameState.h"
9 #include "../common/Stats.h"
10 #include "../graphics/Font.h"
11 #include "../graphics/Frame.h"
12 #include "../graphics/Texture.h"
13
14 using app::Input;
15 using common::Capsule;
16 using common::Stats;
17 using geometry::Vector;
18 using graphics::Font;
19 using graphics::Frame;
20
21 namespace menu {
22
23 CapsuleMenu::CapsuleMenu(PartyMenu *parent)
24 : parent(parent)
25 , menu(*parent->Res().capsuleMenuProperties) {
26         menu.Add(parent->Res().capsuleFeedLabel, 0);
27         menu.Add(parent->Res().capsuleChangeLabel, 1);
28         menu.Add(parent->Res().capsuleNameLabel, 2);
29 }
30
31
32 void CapsuleMenu::OnEnterState(SDL_Surface *) {
33
34 }
35
36 void CapsuleMenu::OnExitState(SDL_Surface *) {
37
38 }
39
40 void CapsuleMenu::OnResumeState(SDL_Surface *) {
41
42 }
43
44 void CapsuleMenu::OnPauseState(SDL_Surface *) {
45
46 }
47
48
49 void CapsuleMenu::OnResize(int width, int height) {
50
51 }
52
53
54 void CapsuleMenu::HandleEvents(const Input &input) {
55         if (input.JustPressed(Input::ACTION_B)) {
56                 Ctrl().PopState();
57         }
58 }
59
60 void CapsuleMenu::UpdateWorld(float deltaT) {
61
62 }
63
64 void CapsuleMenu::Render(SDL_Surface *screen) {
65         Vector<int> offset((screen->w - Width()) / 2, (screen->h - Height()) / 2);
66
67         RenderBackground(screen);
68 }
69
70 void CapsuleMenu::RenderBackground(SDL_Surface *screen) const {
71         parent->Res().capsulebg->Render(screen, Vector<int>(), Vector<int>(screen->w, screen->h));
72 }
73
74 int CapsuleMenu::Width() const {
75         return parent->Width();
76 }
77
78 int CapsuleMenu::Height() const {
79         return parent->Height();
80 }
81
82 const Capsule &CapsuleMenu::GetCapsule() const {
83         return *parent->Game().state->capsule;
84 }
85
86 }