X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2Fstates%2FRunState.cpp;h=155313f0f686e675979ad4775815d334a3cc2017;hb=2147d00bbcb43f5cb4499091f646057cb6944cb3;hp=08c45e80cd8fb97f1a35f9cbc88783204da4a4a8;hpb=6d080d21d8055df9962296863b4c0954bc81410b;p=l2e.git diff --git a/src/battle/states/RunState.cpp b/src/battle/states/RunState.cpp index 08c45e8..155313f 100644 --- a/src/battle/states/RunState.cpp +++ b/src/battle/states/RunState.cpp @@ -12,6 +12,10 @@ #include "../../app/Input.h" #include "../../geometry/operators.h" #include "../../geometry/Point.h" +#include "../../graphics/Font.h" +#include "../../graphics/Frame.h" + +#include using app::Application; using app::Input; @@ -45,8 +49,8 @@ void RunState::Resize(int width, int height) { void RunState::HandleEvents(const Input &input) { if (timer.Finished()) { + battle->SetRunaway(); ctrl->PopState(); // pop self - ctrl->PopState(); // pop battle } } @@ -60,7 +64,18 @@ void RunState::Render(SDL_Surface *screen) { battle->RenderBackground(screen, offset); battle->RenderMonsters(screen, offset); battle->RenderHeroes(screen, offset); - // render small tags + battle->RenderSmallHeroTags(screen, offset); + RenderTitleBar(screen, offset); +} + +void RunState::RenderTitleBar(SDL_Surface *screen, const Vector &offset) { + int height(battle->Res().titleFrame->BorderHeight() * 2 + battle->Res().titleFont->CharHeight()); + battle->Res().titleFrame->Draw(screen, Point(offset.X(), offset.Y()), battle->Width(), height); + + Point textPosition( + (battle->Width() - (std::strlen(battle->Res().escapeText) * battle->Res().titleFont->CharWidth())) / 2, + battle->Res().titleFrame->BorderHeight()); + battle->Res().titleFont->DrawString(battle->Res().escapeText, screen, textPosition + offset); } }