fixed bug when leaving 'Options' in debugger

This commit is contained in:
thrust26 2017-12-17 13:52:50 +01:00
parent 7f08d9b74c
commit 0def7adb61
5 changed files with 19 additions and 11 deletions

View File

@ -63,7 +63,7 @@ DebuggerDialog::DebuggerDialog(OSystem& osystem, DialogContainer& parent,
// Inform the TIA output widget about its associated zoom widget
myTiaOutput->setZoomWidget(myTiaZoom);
myOptions = make_unique<OptionsDialog>(osystem, parent, this, w, h, false);
myOptions = make_unique<OptionsDialog>(osystem, parent, this, w, h, OptionsDialog::debugger);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -160,7 +160,7 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
mySelectedItem = 0; // Highlight 'Rom Listing'
// Create an options dialog, similar to the in-game one
myOptions = make_unique<OptionsDialog>(osystem, parent, this, w, h, true);
myOptions = make_unique<OptionsDialog>(osystem, parent, this, w, h, OptionsDialog::launcher);
// Create a game list, which contains all the information about a ROM that
// the launcher needs

View File

@ -26,5 +26,5 @@ Menu::Menu(OSystem& osystem)
: DialogContainer(osystem)
{
myBaseDialog = new OptionsDialog(myOSystem, *this, nullptr,
FrameBuffer::kFBMinW, FrameBuffer::kFBMinH, false);
FrameBuffer::kFBMinW, FrameBuffer::kFBMinH, OptionsDialog::emulator);
}

View File

@ -45,9 +45,9 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
GuiObject* boss, int max_w, int max_h, bool global)
GuiObject* boss, int max_w, int max_h, stellaMode mode)
: Dialog(osystem, parent),
myIsGlobal(global)
myMode(mode)
{
const GUI::Font& font = instance().frameBuffer().font();
const int buttonWidth = font.getStringWidth("Developer Settings" + ELLIPSIS) + 20,
@ -122,7 +122,7 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
addCancelWidget(b);
// Now create all the dialogs attached to each menu button
myVideoDialog = make_unique<VideoDialog>(osystem, parent, font, max_w, max_h, myIsGlobal);
myVideoDialog = make_unique<VideoDialog>(osystem, parent, font, max_w, max_h, myMode == launcher);
myAudioDialog = make_unique<AudioDialog>(osystem, parent, font);
myInputDialog = make_unique<InputDialog>(osystem, parent, font, max_w, max_h);
myUIDialog = make_unique<UIDialog>(osystem, parent, font);
@ -141,7 +141,7 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
addToFocusList(wid);
// Certain buttons are disabled depending on mode
if(myIsGlobal)
if(myMode == launcher)
{
myCheatCodeButton->clearFlags(WIDGET_ENABLED);
}
@ -225,7 +225,7 @@ void OptionsDialog::handleCommand(CommandSender* sender, int cmd,
case kLoggerCmd:
// This dialog is resizable under certain conditions, so we need
// to re-create it as necessary
if(!myIsGlobal)
if(myMode != launcher)
{
uInt32 w = 0, h = 0;
bool uselargefont = getResizableBounds(w, h);
@ -249,7 +249,7 @@ void OptionsDialog::handleCommand(CommandSender* sender, int cmd,
break;
case kExitCmd:
if(myIsGlobal)
if(myMode != emulator)
close();
else
instance().eventHandler().leaveMenuMode();

View File

@ -45,8 +45,16 @@ class DeveloperDialog;
class OptionsDialog : public Dialog
{
public:
// Current Stella mode
enum stellaMode
{
launcher,
emulator,
debugger
};
OptionsDialog(OSystem& osystem, DialogContainer& parent, GuiObject* boss,
int max_w, int max_h, bool global);
int max_w, int max_h, stellaMode mode);
virtual ~OptionsDialog();
private:
@ -75,7 +83,7 @@ class OptionsDialog : public Dialog
ButtonWidget* myCheatCodeButton;
// Indicates if this dialog is used for global (vs. in-game) settings
bool myIsGlobal;
stellaMode myMode;
enum {
kVidCmd = 'VIDO',