namespace battle {
+SelectSpell::SelectSpell(Battle *battle, SelectAttackType *parent)
+: battle(battle)
+, parent(parent) {
+
+}
+
+
void SelectSpell::OnEnterState(SDL_Surface *screen) {
OnResize(screen->w, screen->h);
}
void SelectSpell::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(), battle->Res().magicTargetCursor));
+ Ctrl().PushState(new SelectTarget(battle, parent, &ac.Selection(), parent->Res().magicTargetCursor));
}
}
}
}
void SelectSpell::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 SelectSpell::RenderHeadline(SDL_Surface *screen) {
- const Resources &res = battle->Res();
+ const Resources &res = parent->Res();
res.normalFont->DrawString(res.spellMenuHeadline, screen, headlinePosition);
}