X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmenu%2FPartyMenu.cpp;h=f230358b1de4c1e1c6fdd20ab61c6efb51ffb0ca;hb=57a75f13e98f4b5d311c2d3b9d9ff637120c5ee2;hp=1243df95d4c8d39c18c601eebcbeb9d95ec14cb2;hpb=e4f678d8cce5408590178bc873fde1754c037d0d;p=l2e.git diff --git a/src/menu/PartyMenu.cpp b/src/menu/PartyMenu.cpp index 1243df9..f230358 100644 --- a/src/menu/PartyMenu.cpp +++ b/src/menu/PartyMenu.cpp @@ -11,7 +11,9 @@ #include "../app/Application.h" #include "../app/Input.h" #include "../common/GameConfig.h" +#include "../common/GameState.h" #include "../geometry/Vector.h" +#include "../graphics/Font.h" #include "../graphics/Texture.h" using app::Input; @@ -22,7 +24,13 @@ namespace menu { PartyMenu::PartyMenu(GameConfig *game) : game(game) { - + for (int i(0); i < 4; ++i) { + status[i].SetHero(game->state->party[i]); + status[i].SetResources(game->menuResources); + } + status[1].SetPosition(Vector(status[0].Width() + Res().normalFont->CharWidth(), 0)); + status[2].SetPosition(Vector(0, status[0].Height() + Res().normalFont->CharHeight())); + status[3].SetPosition(Vector(status[0].Width() + Res().normalFont->CharWidth(), status[0].Height() + Res().normalFont->CharHeight())); } PartyMenu::~PartyMenu() { @@ -65,6 +73,13 @@ void PartyMenu::UpdateWorld(float deltaT) { void PartyMenu::Render(SDL_Surface *screen) { Res().menubg->Render(screen, Vector(), Vector(screen->w, screen->h)); + RenderHeros(screen, Vector()); +} + +void PartyMenu::RenderHeros(SDL_Surface *screen, const geometry::Vector &offset) const { + for (int i(0); i < 4; ++i) { + status[i].Render(screen, offset); + } }