namespace battle {
+SelectIkari::SelectIkari(Battle *battle, SelectAttackType *parent)
+: battle(battle)
+, parent(parent) {
+
+}
+
+
void SelectIkari::OnEnterState(SDL_Surface *screen) {
OnResize(screen->w, screen->h);
}
void SelectIkari::OnResize(int width, int height) {
- const Vector<int> offset = battle->ScreenOffset();
+ const Vector<int> offset = parent->ScreenOffset();
- const Resources &res = battle->Res();
+ const Resources &res = parent->Res();
const Frame &frame = *res.selectFrame;
framePosition = offset + frame.BorderSize();
frameSize = Vector<int>(
- battle->Width() - 2 * frame.BorderWidth(),
+ parent->Width() - 2 * frame.BorderWidth(),
res.normalFont->CharHeight() * 13);
headlinePosition = offset + Vector<int>(
} else {
ac.Selection().SetMultiple();
}
- Ctrl().PushState(new SelectTarget(battle, parent, &ac.Selection(), ikari->IsMagical() ? battle->Res().magicTargetCursor : battle->Res().weaponTargetCursor));
+ Ctrl().PushState(new SelectTarget(battle, parent, &ac.Selection(), ikari->IsMagical() ? parent->Res().magicTargetCursor : parent->Res().weaponTargetCursor));
}
}
}
}
void SelectIkari::RenderFrame(SDL_Surface *screen) {
- const Frame &frame = *battle->Res().selectFrame;
+ const Frame &frame = *parent->Res().selectFrame;
frame.Draw(screen, framePosition, frameSize.X(), frameSize.Y());
}
void SelectIkari::RenderHeadline(SDL_Surface *screen) {
- const Resources &res = battle->Res();
+ const Resources &res = parent->Res();
res.normalFont->DrawString(res.ikariMenuHeadline, screen, headlinePosition);
}