Vector<int> equipOffset(
17 * parent->Res().statusFont->CharWidth(),
4 * parent->Res().statusFont->CharHeight() - parent->Res().statusFont->CharHeight() / 8);
+ Vector<int> experienceOffset(
+ 11 * parent->Res().statusFont->CharWidth(),
+ 17 * parent->Res().statusFont->CharHeight() - parent->Res().statusFont->CharHeight() / 8);
parent->RenderBackground(screen);
parent->Res().shoulderNav->Draw(screen, offset + shoulderNavOffset);
RenderStatus(screen, offset + parent->StatusOffset(0));
RenderStats(screen, offset + statsOffset);
RenderEquipment(screen, offset + equipOffset);
+ RenderExperience(screen, experienceOffset);
}
int StatusMenu::Width() const {
}
void StatusMenu::RenderStats(SDL_Surface *screen, const Vector<int> &offset) const {
- const Stats &stats(parent->Game().state->party[cursor]->GetStats());
+ const Stats &stats(GetHero().GetStats());
Vector<int> lineBreak(0, parent->Res().statusFont->CharHeight());
Vector<int> position(offset);
}
void StatusMenu::RenderEquipment(SDL_Surface *screen, const Vector<int> &offset) const {
- const Hero &hero(*parent->Game().state->party[cursor]);
+ const Hero &hero(GetHero());
Vector<int> lineBreak(0, 2 * parent->Res().statusFont->CharHeight());
Vector<int> position(offset);
}
}
+void StatusMenu::RenderExperience(SDL_Surface *screen, const geometry::Vector<int> &offset) const {
+ const Font &font(*parent->Res().statusFont);
+ font.DrawStringRight(parent->Res().experienceLabel, screen, offset, 10);
+
+ Vector<int> numberOffset(offset.X(), offset.Y() + font.CharHeight());
+ font.DrawNumberRight(GetHero().Experience(), screen, numberOffset, 7);
+}
+
void StatusMenu::NextHero() {
cursor = (cursor + 1) % parent->Game().state->partySize;
cursor = (cursor + parent->Game().state->partySize - 1) % parent->Game().state->partySize;
}
+const Hero &StatusMenu::GetHero() const {
+ return *parent->Game().state->party[cursor];
+}
+
}
void NextHero();
void PreviousHero();
+ const common::Hero &GetHero() const;
+
void RenderStatus(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
void RenderStats(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
void RenderStatsLine(const char *label, int number, SDL_Surface *screen, const geometry::Vector<int> &position) const;
void RenderEquipment(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
void RenderEquipmentLine(const common::Item *, SDL_Surface *screen, const geometry::Vector<int> &position) const;
+ /// @param offset the top right corner!
+ void RenderExperience(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
private:
PartyMenu *parent;