X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmenu%2FPartyMenu.cpp;h=8e627ee312ba1902ffe02d5a59427e9b90d948de;hb=f6548c2aabfb371bd81382d7800e6e2cdb826e06;hp=bda633129211b3973d5e1d33034f6691c8d5efbd;hpb=f2abfc21845c29024ce2478f95429801e91ef8e8;p=l2e.git diff --git a/src/menu/PartyMenu.cpp b/src/menu/PartyMenu.cpp index bda6331..8e627ee 100644 --- a/src/menu/PartyMenu.cpp +++ b/src/menu/PartyMenu.cpp @@ -1,16 +1,12 @@ -/* - * PartyMenu.cpp - * - * Created on: Oct 21, 2012 - * Author: holy - */ - #include "PartyMenu.h" +#include "CapsuleMenu.h" #include "ChangeHero.h" +#include "ConfigMenu.h" #include "EquipMenu.h" #include "InventoryMenu.h" #include "Resources.h" +#include "ScenarioMenu.h" #include "SelectHero.h" #include "SpellMenu.h" #include "StatusMenu.h" @@ -18,14 +14,14 @@ #include "../app/Input.h" #include "../common/GameConfig.h" #include "../common/GameState.h" -#include "../geometry/Vector.h" +#include "../math/Vector.h" #include "../graphics/Font.h" #include "../graphics/Frame.h" #include "../graphics/Texture.h" using app::Input; using common::GameConfig; -using geometry::Vector; +using math::Vector; namespace menu { @@ -45,7 +41,7 @@ PartyMenu::PartyMenu(GameConfig *game) mainMenu.Add(Res().mainMenuStatusText, 4); mainMenu.Add(Res().mainMenuSpellText, 1); mainMenu.Add(Res().mainMenuChangeText, 5); - mainMenu.Add(Res().mainMenuCapsuleText, 2); + mainMenu.Add(Res().mainMenuCapsuleText, 2, game->state->capsule); mainMenu.Add(Res().mainMenuConfigText, 6); mainMenu.Add(Res().mainMenuEquipmentText, 3); mainMenu.Add(Res().mainMenuScenarioText, 7); @@ -57,7 +53,7 @@ PartyMenu::~PartyMenu() { void PartyMenu::OnEnterState(SDL_Surface *) { - + mainMenu.StartAnimation(Ctrl()); } void PartyMenu::OnExitState(SDL_Surface *) { @@ -103,6 +99,11 @@ void PartyMenu::HandleEvents(const Input &input) { Ctrl().PushState(new SelectHero(this, this, this, OnSpellSelect)); break; case MENU_ITEM_CAPSULE: + if (game->state->capsule) { + Ctrl().PushState(new CapsuleMenu(this)); + } else { + // noise and blur + } break; case MENU_ITEM_EQUIP: Ctrl().PushState(new SelectHero(this, this, this, OnEquipSelect)); @@ -114,8 +115,10 @@ void PartyMenu::HandleEvents(const Input &input) { Ctrl().PushState(new ChangeHero(this)); break; case MENU_ITEM_CONFIG: + Ctrl().PushState(new ConfigMenu(this)); break; case MENU_ITEM_SCENARIO: + Ctrl().PushState(new ScenarioMenu(this)); break; default: break; @@ -123,7 +126,7 @@ void PartyMenu::HandleEvents(const Input &input) { } } -void PartyMenu::UpdateWorld(float deltaT) { +void PartyMenu::UpdateWorld(Uint32 deltaT) { } @@ -150,7 +153,7 @@ int PartyMenu::Height() const { } void PartyMenu::RenderBackground(SDL_Surface *screen) const { - Res().menubg->Render(screen, Vector(), Vector(screen->w, screen->h)); + Res().menubg->Draw(screen, Vector(), Vector(screen->w, screen->h)); } void PartyMenu::RenderHeros(SDL_Surface *screen, const Vector &offset) const {