+ parent->Res().shoulderNav->Draw(screen, offset + shoulderNavOffset);
+ RenderStatus(screen, offset + parent->StatusOffset(0));
+ RenderEquipment(screen, offset + statsOffset);
+}
+
+int StatusMenu::Width() const {
+ return parent->Width();
+}
+
+int StatusMenu::Height() const {
+ return parent->Height();
+}
+
+void StatusMenu::RenderStatus(SDL_Surface *screen, const Vector<int> &offset) const {
+ parent->GetHeroStatus(cursor).Render(screen, offset);
+}
+
+void StatusMenu::RenderEquipment(SDL_Surface *screen, const geometry::Vector<int> &offset) const {
+ const Hero &hero(*parent->Game().state->party[cursor]);
+ Vector<int> lineBreak(0, 2 * parent->Res().statusFont->CharHeight());
+
+ Vector<int> position(offset);
+ RenderEquipmentLine(hero.Weapon(), screen, position);
+
+ position += lineBreak;
+ RenderEquipmentLine(hero.Armor(), screen, position);
+
+ position += lineBreak;
+ RenderEquipmentLine(hero.Shield(), screen, position);
+
+ position += lineBreak;
+ RenderEquipmentLine(hero.Helmet(), screen, position);
+
+ position += lineBreak;
+ RenderEquipmentLine(hero.Ring(), screen, position);
+
+ position += lineBreak;
+ RenderEquipmentLine(hero.Jewel(), screen, position);
+}
+
+void StatusMenu::RenderEquipmentLine(const Item *item, SDL_Surface *screen, const Vector<int> &position) const {
+ const Font &font(*parent->Res().statusFont);
+ const Vector<int> textOffset(font.CharWidth(), 0);
+ if (item) {
+ if (item->MenuIcon()) {
+ item->MenuIcon()->Draw(screen, position);
+ }
+ font.DrawString(item->Name(), screen, position + textOffset);
+ } else {
+ font.DrawString(parent->Res().noEquipmentText, screen, position + textOffset);
+ }
+}
+
+
+void StatusMenu::NextHero() {
+ cursor = (cursor + 1) % parent->Game().state->partySize;
+}
+
+void StatusMenu::PreviousHero() {
+ cursor = (cursor + parent->Game().state->partySize - 1) % parent->Game().state->partySize;