From: Daniel Karbach Date: Wed, 31 Oct 2012 21:32:07 +0000 (+0100) Subject: show next level in status screen X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=fab9883177573c105579a37cbc5b9bbbe69d0280;p=l2e.git show next level in status screen --- diff --git a/src/menu/StatusMenu.cpp b/src/menu/StatusMenu.cpp index f155c16..aea11b9 100644 --- a/src/menu/StatusMenu.cpp +++ b/src/menu/StatusMenu.cpp @@ -88,6 +88,9 @@ void StatusMenu::Render(SDL_Surface *screen) { Vector experienceOffset( 11 * parent->Res().statusFont->CharWidth(), 17 * parent->Res().statusFont->CharHeight() - parent->Res().statusFont->CharHeight() / 8); + Vector 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 &offset) const { + const Font &font(*parent->Res().statusFont); + font.DrawStringRight(parent->Res().nextLevelLabel, screen, offset, 10); + + Vector numberOffset(offset.X(), offset.Y() + font.CharHeight()); + font.DrawNumberRight(GetHero().NextLevel(), screen, numberOffset, 7); +} + void StatusMenu::NextHero() { cursor = (cursor + 1) % parent->Game().state->partySize; diff --git a/src/menu/StatusMenu.h b/src/menu/StatusMenu.h index 51c169a..f6bcb29 100644 --- a/src/menu/StatusMenu.h +++ b/src/menu/StatusMenu.h @@ -50,6 +50,8 @@ private: void RenderEquipmentLine(const common::Item *, SDL_Surface *screen, const geometry::Vector &position) const; /// @param offset the top right corner! void RenderExperience(SDL_Surface *screen, const geometry::Vector &offset) const; + /// @param offset the top right corner! + void RenderNextLevel(SDL_Surface *screen, const geometry::Vector &offset) const; private: PartyMenu *parent;