Fredric: Pause implicitly when entering the menu (and remove the

option)
This commit is contained in:
simon.kagstrom 2010-03-14 12:03:30 +00:00
parent 486b5bffc7
commit a470e21b63
3 changed files with 31 additions and 51 deletions

View File

@ -340,6 +340,10 @@ GuiView *Gui::popView()
/* Deactivate when no views are left */
this->is_active = false;
if (TheC64->IsPaused())
Gui::gui->status_bar->queueMessage("C64 emulation resumed");
TheC64->Resume();
return NULL;
}
@ -485,6 +489,12 @@ void Gui::activate()
this->np = &cur_prefs;
this->pushView(this->mv);
TheC64->Pause();
if (TheC64->network)
Gui::gui->status_bar->queueMessage("Can't pause when in network mode");
else
Gui::gui->status_bar->queueMessage("C64 emulation paused");
}
SDL_Surface *Gui::loadThemeImage(const char *dir, const char *what)

View File

@ -60,34 +60,20 @@ public:
MainMenu(Font *font, HelpBox *help) : Menu(font)
{
this->help = help;
this->updatePauseState();
this->setText(main_menu_messages);
}
virtual void selectCallback(int which)
{
switch (which)
{
case 0:
TheC64->IsPaused() ? TheC64->Resume() : TheC64->Pause();
if (TheC64->network)
{
Gui::gui->status_bar->queueMessage("Can't pause when in network mode");
break;
}
if (TheC64->IsPaused())
Gui::gui->status_bar->queueMessage("C64 emulation paused");
else
Gui::gui->status_bar->queueMessage("C64 emulation resumed");
this->updatePauseState();
break;
case 2: /* Insert disc */
case 0: /* Insert disc */
Gui::gui->dv->setDirectory(Gui::gui->game_base_path);
Gui::gui->pushView(Gui::gui->dv);
Gui::gui->dv->runStartSequence(this->p_submenus[0].sel == 0);
break;
case 4: /* Load/save states */
case 2: /* Load/save states */
if (this->p_submenus[1].sel == 1)
Gui::gui->sgv->saveSnapshot();
else
@ -98,7 +84,7 @@ public:
Gui::gui->sgv->setLoadSnapshot(this->p_submenus[1].sel == 0);
}
break;
case 6: /* Keyboard */
case 4: /* Keyboard */
switch(this->p_submenus[2].sel)
{
case 0:
@ -113,16 +99,16 @@ public:
panic("Illegal selection\n");
}
break;
case 9: /* Game info */
case 7: /* Game info */
Gui::gui->pushView(Gui::gui->giv);
break;
case 10: /* Networking */
case 8: /* Networking */
Gui::gui->pushView(Gui::gui->nv);
break;
case 11: /* Options */
case 9: /* Options */
Gui::gui->pushView(Gui::gui->ov);
break;
case 12: /* Exit */
case 11: /* Exit */
DialogueBox *exit_dialogue = new DialogueBox(exit_dialogue_messages);
exit_dialogue->registerListener(new ExitListener());
Gui::gui->pushDialogueBox(exit_dialogue);
@ -141,14 +127,6 @@ public:
}
private:
void updatePauseState()
{
if (TheC64->IsPaused())
main_menu_messages[0] = "Resume";
else
main_menu_messages[0] = "Pause";
this->setText(main_menu_messages);
}
HelpBox *help;
};

View File

@ -128,31 +128,22 @@ const char *frodo_help[11] = {
const char *main_menu_messages[14] = {
/*00*/ NULL, /* Setup dynamically */
/*01*/ " ",
/*02*/ "File",
/*03*/ "^|Start|Insert",
/*04*/ "States",
/*05*/ "^|Load|Save|Delete",
/*06*/ "Keyboard",
/*07*/ "^|Type|Bind",
/*08*/ " ",
/*09*/ "Game info",
/*10*/ "Networking",
/*11*/ "Options",
/*12*/ "Quit",
/*00*/ "File",
/*01*/ "^|Start|Insert",
/*02*/ "States",
/*03*/ "^|Load|Save|Delete",
/*04*/ "Keyboard",
/*05*/ "^|Type|Bind",
/*06*/ " ",
/*07*/ "Game info",
/*08*/ "Networking",
/*09*/ "Options",
/*10*/ " ",
/*11*/ "Quit",
NULL
};
const char **main_menu_help[14] = {
(const char*[]){
"Pause or resume the C64",
"emulation. Not available",
"when running in networked",
"mode.",
NULL,
},
NULL,
(const char*[]){
"Insert a disc/tape or",
"start it",
@ -189,6 +180,7 @@ const char **main_menu_help[14] = {
"Configure Frodo",
NULL,
},
NULL,
(const char*[]){
"Quit Frodo",
NULL,