X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2Fstates%2FSelectItem.cpp;h=86f11c25bf3e79547671a9cb507ce85c974a2c94;hb=65158353d1ecbed0032752863c6c4eb96b1a084a;hp=f58a78eaf72fa9eb9c658d7f75b5af8ab3fbd395;hpb=0542849dfccfec1ce1477265fa0fee2401a8fb23;p=l2e.git diff --git a/src/battle/states/SelectItem.cpp b/src/battle/states/SelectItem.cpp index f58a78e..86f11c2 100644 --- a/src/battle/states/SelectItem.cpp +++ b/src/battle/states/SelectItem.cpp @@ -23,15 +23,15 @@ using graphics::Frame; namespace battle { -void SelectItem::EnterState(Application &c, SDL_Surface *screen) { +void SelectItem::OnEnterState(Application &c, SDL_Surface *screen) { ctrl = &c; } -void SelectItem::ExitState(Application &c, SDL_Surface *screen) { +void SelectItem::OnExitState(Application &c, SDL_Surface *screen) { ctrl = 0; } -void SelectItem::ResumeState(Application &ctrl, SDL_Surface *screen) { +void SelectItem::OnResumeState(Application &ctrl, SDL_Surface *screen) { if (battle->ActiveHero().GetAttackChoice().Selection().HasSelected()) { battle->ActiveHero().GetAttackChoice().SetType(AttackChoice::ITEM); battle->ActiveHero().GetAttackChoice().SetItem(battle->ItemMenu().Selected()); @@ -39,7 +39,7 @@ void SelectItem::ResumeState(Application &ctrl, SDL_Surface *screen) { } } -void SelectItem::PauseState(Application &ctrl, SDL_Surface *screen) { +void SelectItem::OnPauseState(Application &ctrl, SDL_Surface *screen) { } @@ -62,7 +62,6 @@ void SelectItem::HandleEvents(const Input &input) { } if (item->GetTargetingMode().TargetsAll()) { ac.SetType(AttackChoice::ITEM); - // TODO: remove item from inventory ac.SetItem(item); battle->NextHero(); ctrl->PopState(); @@ -107,7 +106,7 @@ void SelectItem::Render(SDL_Surface *screen) { void SelectItem::RenderFrame(SDL_Surface *screen, const Vector &offset) { const Frame *frame(battle->Res().selectFrame); - Vector position(frame->BorderWidth(), frame->BorderHeight()); + Vector position(frame->BorderSize()); int width(battle->Width() - 2 * frame->BorderWidth()); int height(battle->Res().normalFont->CharHeight() * 13); frame->Draw(screen, position + offset, width, height);