X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2Fstates%2FSelectItem.cpp;h=fe6ce7b3ba7dc9fa8e1addc5382883012317e3d0;hb=3f8fac16c7ae2cbe7da47b98aba9b558825723e7;hp=86f11c25bf3e79547671a9cb507ce85c974a2c94;hpb=65158353d1ecbed0032752863c6c4eb96b1a084a;p=l2e.git diff --git a/src/battle/states/SelectItem.cpp b/src/battle/states/SelectItem.cpp index 86f11c2..fe6ce7b 100644 --- a/src/battle/states/SelectItem.cpp +++ b/src/battle/states/SelectItem.cpp @@ -24,11 +24,11 @@ using graphics::Frame; namespace battle { void SelectItem::OnEnterState(Application &c, SDL_Surface *screen) { - ctrl = &c; + } void SelectItem::OnExitState(Application &c, SDL_Surface *screen) { - ctrl = 0; + } void SelectItem::OnResumeState(Application &ctrl, SDL_Surface *screen) { @@ -44,7 +44,7 @@ void SelectItem::OnPauseState(Application &ctrl, SDL_Surface *screen) { } -void SelectItem::Resize(int width, int height) { +void SelectItem::OnResize(int width, int height) { } @@ -64,19 +64,19 @@ void SelectItem::HandleEvents(const Input &input) { ac.SetType(AttackChoice::ITEM); ac.SetItem(item); battle->NextHero(); - ctrl->PopState(); + Ctrl().PopState(); } else { if (item->GetTargetingMode().TargetsSingle()) { ac.Selection().SetSingle(); } else { ac.Selection().SetMultiple(); } - ctrl->PushState(new SelectTarget(battle, parent, &ac.Selection(), battle->Res().itemTargetCursor)); + Ctrl().PushState(new SelectTarget(battle, parent, &ac.Selection(), battle->Res().itemTargetCursor)); } } } if (input.JustPressed(Input::ACTION_B)) { - ctrl->PopState(); // return control to parent + Ctrl().PopState(); // return control to parent } if (input.JustPressed(Input::PAD_UP)) { battle->ItemMenu().PreviousRow();