]> git.localhorst.tv Git - l2e.git/commitdiff
show next level in status screen
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Wed, 31 Oct 2012 21:32:07 +0000 (22:32 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Wed, 31 Oct 2012 21:32:07 +0000 (22:32 +0100)
src/menu/StatusMenu.cpp
src/menu/StatusMenu.h

index f155c160b1fb71ab85d5a16a2be42956a7398b41..aea11b9cda0ffd9888b0aea38982281ed6247cc3 100644 (file)
@@ -88,6 +88,9 @@ void StatusMenu::Render(SDL_Surface *screen) {
        Vector<int> experienceOffset(
                        11 * parent->Res().statusFont->CharWidth(),
                        17 * parent->Res().statusFont->CharHeight() - parent->Res().statusFont->CharHeight() / 8);
+       Vector<int> nextLevelOffset(
+                       11 * parent->Res().statusFont->CharWidth(),
+                       19 * parent->Res().statusFont->CharHeight() - parent->Res().statusFont->CharHeight() / 8);
 
        parent->RenderBackground(screen);
        parent->Res().shoulderNav->Draw(screen, offset + shoulderNavOffset);
@@ -95,6 +98,7 @@ void StatusMenu::Render(SDL_Surface *screen) {
        RenderStats(screen, offset + statsOffset);
        RenderEquipment(screen, offset + equipOffset);
        RenderExperience(screen, experienceOffset);
+       RenderNextLevel(screen, nextLevelOffset);
 }
 
 int StatusMenu::Width() const {
@@ -187,6 +191,14 @@ void StatusMenu::RenderExperience(SDL_Surface *screen, const geometry::Vector<in
        font.DrawNumberRight(GetHero().Experience(), screen, numberOffset, 7);
 }
 
+void StatusMenu::RenderNextLevel(SDL_Surface *screen, const geometry::Vector<int> &offset) const {
+       const Font &font(*parent->Res().statusFont);
+       font.DrawStringRight(parent->Res().nextLevelLabel, screen, offset, 10);
+
+       Vector<int> numberOffset(offset.X(), offset.Y() + font.CharHeight());
+       font.DrawNumberRight(GetHero().NextLevel(), screen, numberOffset, 7);
+}
+
 
 void StatusMenu::NextHero() {
        cursor = (cursor + 1) % parent->Game().state->partySize;
index 51c169ac5cd4b50fd9343419c6456dd00ef96da3..f6bcb293f37d782b3b380862149ad157a855366e 100644 (file)
@@ -50,6 +50,8 @@ private:
        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;
+       /// @param offset the top right corner!
+       void RenderNextLevel(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
 
 private:
        PartyMenu *parent;