mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2024-11-23 03:49:26 +01:00
34 lines
670 B
C++
34 lines
670 B
C++
#include "dialogue_box.hh"
|
|
|
|
DialogueBox::DialogueBox(Font *font, const char *msgs[], int cancel) : Menu(font)
|
|
{
|
|
this->m_selected = -1;
|
|
this->m_cancel = cancel;
|
|
|
|
this->setText(msgs, NULL);
|
|
/* Place on the second to last entry */
|
|
this->cur_sel = this->n_entries - 2;
|
|
}
|
|
|
|
int DialogueBox::selectNext(event_t ev)
|
|
{
|
|
/* No up/down movement please! */
|
|
if (ev == KEY_UP || ev == KEY_DOWN)
|
|
return this->cur_sel;
|
|
return Menu::selectNext(ev);
|
|
}
|
|
|
|
void DialogueBox::selectCallback(int which)
|
|
{
|
|
this->m_selected = this->p_submenus[0].sel;
|
|
}
|
|
|
|
void DialogueBox::hoverCallback(int which)
|
|
{
|
|
}
|
|
|
|
void DialogueBox::escapeCallback(int which)
|
|
{
|
|
this->m_selected = this->m_cancel;
|
|
}
|