AttackTypeMenu &GetAttackTypeMenu() { return attackTypeMenu; }
MoveMenu &GetMoveMenu() { return moveMenu; }
- graphics::Menu<const common::Item *> &GetItemMenu() { return itemMenu; }
- const graphics::Menu<const common::Item *> &GetItemMenu() const { return itemMenu; }
+ graphics::Menu<const common::Item *> &ItemMenu() { return itemMenu; }
+ const graphics::Menu<const common::Item *> &ItemMenu() const { return itemMenu; }
void NextHero();
bool BeforeFirstHero() const { return activeHero < 0; }
void SelectItem::ResumeState(Application &ctrl, SDL_Surface *screen) {
if (battle->ActiveHero().GetAttackChoice().Selection().HasSelected()) {
battle->ActiveHero().GetAttackChoice().SetType(AttackChoice::ITEM);
- battle->ActiveHero().GetAttackChoice().SetItem(battle->GetItemMenu().Selected());
+ battle->ActiveHero().GetAttackChoice().SetItem(battle->ItemMenu().Selected());
ctrl.PopState();
}
}
void SelectItem::HandleEvents(const Input &input) {
if (input.JustPressed(Input::ACTION_A)) {
- if (battle->GetItemMenu().SelectedIsEnabled()) {
+ if (battle->ItemMenu().SelectedIsEnabled()) {
AttackChoice &ac(battle->ActiveHero().GetAttackChoice());
- const Item *item(battle->GetItemMenu().Selected());
+ const Item *item(battle->ItemMenu().Selected());
ac.Selection().Reset();
if (item->GetTargetingMode().TargetsAlly()) {
ac.Selection().SelectHeroes();
ctrl->PopState(); // return control to parent
}
if (input.JustPressed(Input::PAD_UP)) {
- battle->GetItemMenu().PreviousRow();
+ battle->ItemMenu().PreviousRow();
}
if (input.JustPressed(Input::PAD_RIGHT)) {
- battle->GetItemMenu().NextItem();
+ battle->ItemMenu().NextItem();
}
if (input.JustPressed(Input::PAD_DOWN)) {
- battle->GetItemMenu().NextRow();
+ battle->ItemMenu().NextRow();
}
if (input.JustPressed(Input::PAD_LEFT)) {
- battle->GetItemMenu().PreviousItem();
+ battle->ItemMenu().PreviousItem();
}
}
Point<int> position(
2 * res.selectFrame->BorderWidth() + res.normalFont->CharWidth(),
2 * res.selectFrame->BorderHeight() + 2 * res.normalFont->CharHeight());
- battle->GetItemMenu().Draw(screen, position + offset);
+ battle->ItemMenu().Draw(screen, position + offset);
}
}