]> git.localhorst.tv Git - l2e.git/commitdiff
added ikari level to status menu
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Wed, 31 Oct 2012 21:47:58 +0000 (22:47 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Wed, 31 Oct 2012 21:47:58 +0000 (22:47 +0100)
src/menu/StatusMenu.cpp
src/menu/StatusMenu.h

index aea11b9cda0ffd9888b0aea38982281ed6247cc3..b0377033b50f1920258332595586325382a368c3 100644 (file)
@@ -91,6 +91,9 @@ void StatusMenu::Render(SDL_Surface *screen) {
        Vector<int> nextLevelOffset(
                        11 * parent->Res().statusFont->CharWidth(),
                        19 * parent->Res().statusFont->CharHeight() - parent->Res().statusFont->CharHeight() / 8);
+       Vector<int> ikariOffset(
+                       17 * parent->Res().statusFont->CharWidth(),
+                       17 * parent->Res().statusFont->CharHeight() - parent->Res().statusFont->CharHeight() / 8);
 
        parent->RenderBackground(screen);
        parent->Res().shoulderNav->Draw(screen, offset + shoulderNavOffset);
@@ -99,6 +102,7 @@ void StatusMenu::Render(SDL_Surface *screen) {
        RenderEquipment(screen, offset + equipOffset);
        RenderExperience(screen, experienceOffset);
        RenderNextLevel(screen, nextLevelOffset);
+       RenderIkari(screen, ikariOffset);
 }
 
 int StatusMenu::Width() const {
@@ -199,6 +203,17 @@ void StatusMenu::RenderNextLevel(SDL_Surface *screen, const geometry::Vector<int
        font.DrawNumberRight(GetHero().NextLevel(), screen, numberOffset, 7);
 }
 
+void StatusMenu::RenderIkari(SDL_Surface *screen, const geometry::Vector<int> &offset) const {
+       const Font &font(*parent->Res().statusFont);
+       font.DrawString(parent->Res().ipLabel, screen, offset, 5);
+
+       Vector<int> numberOffset(offset.X() + 5 * font.CharWidth(), offset.Y());
+       font.DrawNumber(GetHero().RelativeIP(100), screen, numberOffset, 3);
+
+       Vector<int> percentOffset(offset.X() + 8 * font.CharWidth(), offset.Y());
+       font.DrawChar('%', screen, percentOffset);
+}
+
 
 void StatusMenu::NextHero() {
        cursor = (cursor + 1) % parent->Game().state->partySize;
index f6bcb293f37d782b3b380862149ad157a855366e..40fac6b6a0e0b61bfe37aabd559ca7b309d06020 100644 (file)
@@ -52,6 +52,7 @@ private:
        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;
+       void RenderIkari(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
 
 private:
        PartyMenu *parent;