X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=src%2Fbattle%2FHeroTag.cpp;h=96dedd9269e836037804c4d1a0c822375ca20763;hb=341371f1ac26af555407bf9fe9b78794297a385b;hp=01cee4485f463ed1c68fce599c7fb6e47f0aa08e;hpb=b6502719f0f02bdb4fc39aa66fa4a369ea583036;p=l2e.git diff --git a/src/battle/HeroTag.cpp b/src/battle/HeroTag.cpp index 01cee44..96dedd9 100644 --- a/src/battle/HeroTag.cpp +++ b/src/battle/HeroTag.cpp @@ -7,6 +7,7 @@ #include "HeroTag.h" +#include "AttackChoice.h" #include "Hero.h" #include "Resources.h" #include "../geometry/operators.h" @@ -26,6 +27,7 @@ void HeroTag::Render(SDL_Surface *screen, int width, int height, Point posi // frame const Frame *frame(active ? res->activeHeroTagFrame : res->heroTagFrame); Vector frameOffset(frame->BorderWidth(), frame->BorderHeight()); + Vector alignOffset(align == LEFT ? 4 * res->heroTagFont->CharWidth() : 0, 0); frame->Draw(screen, position, width, height); int yOffset((height - hero->Sprite()->Height()) / 2); @@ -74,6 +76,15 @@ void HeroTag::Render(SDL_Surface *screen, int width, int height, Point posi Vector manaNumberOffset(labelX + res->heroTagLabels->Width(), manaLabelOffset.Y()); res->heroTagFont->DrawNumber(hero->Mana(), screen, position + manaNumberOffset, 3); + // name + res->normalFont->DrawString(hero->Name(), screen, position + frameOffset + alignOffset, 5); + + // attack icon + if (choice->GetType() != AttackChoice::UNDECIDED) { + Vector attackIconOffset(labelX + res->heroTagLabels->Width(), frameOffset.Y() + 3 * res->heroTagFont->CharHeight()); + res->attackChoiceIcons->Draw(screen, position + attackIconOffset, 0, choice->GetType()); + } + // hero Vector heroOffset( (align == LEFT) ? yOffset : width - hero->Sprite()->Width() - yOffset,