#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;
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<int>(status[0].Width() + Res().normalFont->CharWidth(), 0));
+ status[2].SetPosition(Vector<int>(0, status[0].Height() + Res().normalFont->CharHeight()));
+ status[3].SetPosition(Vector<int>(status[0].Width() + Res().normalFont->CharWidth(), status[0].Height() + Res().normalFont->CharHeight()));
}
PartyMenu::~PartyMenu() {
void PartyMenu::Render(SDL_Surface *screen) {
Res().menubg->Render(screen, Vector<int>(), Vector<int>(screen->w, screen->h));
+ RenderHeros(screen, Vector<int>());
+}
+
+void PartyMenu::RenderHeros(SDL_Surface *screen, const geometry::Vector<int> &offset) const {
+ for (int i(0); i < 4; ++i) {
+ status[i].Render(screen, offset);
+ }
}