]> git.localhorst.tv Git - l2e.git/blobdiff - src/menu/PartyMenu.cpp
added hero status tags in party menu
[l2e.git] / src / menu / PartyMenu.cpp
index 1243df95d4c8d39c18c601eebcbeb9d95ec14cb2..f230358b1de4c1e1c6fdd20ab61c6efb51ffb0ca 100644 (file)
@@ -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<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() {
@@ -65,6 +73,13 @@ void PartyMenu::UpdateWorld(float deltaT) {
 
 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);
+       }
 }