X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmenu%2FPartyMenu.h;h=409ee16ccf672e77c07c671f33d478cc58717a5f;hb=092a2dd175a4001a495c84ee85211734fb928c83;hp=ee84239d9a19600c2d6fb313eb89f3aeaccc75e9;hpb=e4f678d8cce5408590178bc873fde1754c037d0d;p=l2e.git diff --git a/src/menu/PartyMenu.h b/src/menu/PartyMenu.h index ee84239..409ee16 100644 --- a/src/menu/PartyMenu.h +++ b/src/menu/PartyMenu.h @@ -1,16 +1,17 @@ -/* - * PartyMenu.h - * - * Created on: Oct 21, 2012 - * Author: holy - */ - #ifndef MENU_PARTYMENU_H_ #define MENU_PARTYMENU_H_ -#include "Resources.h" +namespace common { + struct GameConfig; +} +namespace menu { + struct Resources; +} + +#include "HeroStatus.h" #include "../app/State.h" -#include "../common/GameConfig.h" +#include "../math/Vector.h" +#include "../graphics/Menu.h" namespace menu { @@ -23,13 +24,31 @@ public: public: virtual void HandleEvents(const app::Input &); - virtual void UpdateWorld(float deltaT); + virtual void UpdateWorld(Uint32 deltaT); virtual void Render(SDL_Surface *); public: + common::GameConfig &Game() { return *game; } + const common::GameConfig &Game() const { return *game; } Resources &Res(); const Resources &Res() const; + int Width() const; + int Height() const; + +public: + void RenderBackground(SDL_Surface *screen) const; + void RenderHeros(SDL_Surface *screen, const math::Vector &offset) const; + void RenderMenu(SDL_Surface *screen, const math::Vector &offset) const; + void RenderInfo(SDL_Surface *screen, const math::Vector &offset) const; + + math::Vector StatusOffset(int index) const; + const HeroStatus &GetHeroStatus(int index) const { return status[index]; } + + static void OnEquipSelect(void *, int); + static void OnSpellSelect(void *, int); + static void OnStatusSelect(void *, int); + private: virtual void OnEnterState(SDL_Surface *screen); virtual void OnExitState(SDL_Surface *screen); @@ -39,7 +58,22 @@ private: virtual void OnResize(int width, int height); private: + enum MenuItem { + MENU_ITEM_ITEM, + MENU_ITEM_SPELL, + MENU_ITEM_CAPSULE, + MENU_ITEM_EQUIP, + MENU_ITEM_STATUS, + MENU_ITEM_CHANGE, + MENU_ITEM_CONFIG, + MENU_ITEM_SCENARIO, + }; + +private: + HeroStatus status[4]; + math::Vector statusPositions[4]; common::GameConfig *game; + graphics::Menu mainMenu; };