add R77 help dialog

This commit is contained in:
thrust26 2019-05-05 00:05:28 +02:00
parent 7ab5847350
commit f4f8bb435d
8 changed files with 87 additions and 21 deletions

View File

@ -19,6 +19,7 @@
#include "Dialog.hxx" #include "Dialog.hxx"
#include "Widget.hxx" #include "Widget.hxx"
#include "Font.hxx" #include "Font.hxx"
#include "HelpDialog.hxx" #include "HelpDialog.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -120,12 +121,12 @@ void HelpDialog::updateStrings(uInt8 page, uInt8 lines, string& title)
case 2: case 2:
title = "Special commands"; title = "Special commands";
ADD_BIND("Ctrl g", "Grab mouse (keep in window)");
ADD_BIND("Ctrl f", "Switch between NTSC/PAL/SECAM"); ADD_BIND("Ctrl f", "Switch between NTSC/PAL/SECAM");
ADD_BIND("Ctrl s", "Save game properties to a"); ADD_BIND("Alt p", "Toggle 'phosphor' effect");
ADD_BIND("", " new file"); ADD_BIND("Ctrl p", "Switch palette");
ADD_LINE(); ADD_LINE();
ADD_BIND("Ctrl 0", "Toggle controller for Mouse"); ADD_BIND("Ctrl g", "Grab mouse (keep in window)");
ADD_BIND("Ctrl 0", "Toggle controller for mouse");
ADD_BIND("Ctrl 1", "Toggle Stelladaptor left/right"); ADD_BIND("Ctrl 1", "Toggle Stelladaptor left/right");
break; break;

View File

@ -97,10 +97,10 @@ MinUICommandDialog::MinUICommandDialog(OSystem& osystem, DialogContainer& parent
wid.push_back(myStretchButton); wid.push_back(myStretchButton);
myPhosphorButton = ADD_CD_BUTTON("", kPhosphorCmd); myPhosphorButton = ADD_CD_BUTTON("", kPhosphorCmd);
wid.push_back(myPhosphorButton); wid.push_back(myPhosphorButton);
bw = ADD_CD_BUTTON("Settings"+ ELLIPSIS, kSettings);
wid.push_back(bw);
bw = ADD_CD_BUTTON("Fry", kFry); bw = ADD_CD_BUTTON("Fry", kFry);
wid.push_back(bw); wid.push_back(bw);
bw = ADD_CD_BUTTON("Settings" + ELLIPSIS, kSettings);
wid.push_back(bw);
// Bottom row // Bottom row
xoffset = HBORDER + (buttonWidth + HGAP) / 2; xoffset = HBORDER + (buttonWidth + HGAP) / 2;
@ -185,7 +185,7 @@ void MinUICommandDialog::handleCommand(CommandSender* sender, int cmd,
consoleCmd = true; consoleCmd = true;
break; break;
// Column 2 // Column 2
case kSaveStateCmd: case kSaveStateCmd:
event = Event::SaveState; event = Event::SaveState;
consoleCmd = true; consoleCmd = true;
@ -217,11 +217,7 @@ void MinUICommandDialog::handleCommand(CommandSender* sender, int cmd,
updateWinds(); updateWinds();
break; break;
case GuiObject::kCloseCmd: // Column 3
instance().eventHandler().leaveMenuMode();
break;
// Column 3
case kFormatCmd: case kFormatCmd:
instance().console().toggleFormat(); instance().console().toggleFormat();
updateTVFormat(); updateTVFormat();
@ -237,13 +233,18 @@ void MinUICommandDialog::handleCommand(CommandSender* sender, int cmd,
instance().console().togglePhosphor(); instance().console().togglePhosphor();
break; break;
case kFry:
instance().eventHandler().leaveMenuMode();
instance().console().fry();
break;
case kSettings: case kSettings:
openSettings(); openSettings();
break; break;
case kFry: // Bottom row
case GuiObject::kCloseCmd:
instance().eventHandler().leaveMenuMode(); instance().eventHandler().leaveMenuMode();
instance().console().fry();
break; break;
case kExitGameCmd: case kExitGameCmd:
@ -316,3 +317,4 @@ void MinUICommandDialog::openSettings()
myOptionsDialog->open(); myOptionsDialog->open();
} }
} }

View File

@ -70,7 +70,7 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
if (minSettings) if (minSettings)
{ {
ButtonWidget* bw = new ButtonWidget(this, _font, xoffset, yoffset, ButtonWidget* bw = new ButtonWidget(this, _font, xoffset, yoffset,
_w - HBORDER * 2, buttonHeight, "Switch to Basic Settings" + ELLIPSIS, kBasSetCmd); _w - HBORDER * 2, buttonHeight, "Use Basic Settings", kBasSetCmd);
wid.push_back(bw); wid.push_back(bw);
yoffset += rowHeight + GAP * 2; yoffset += rowHeight + GAP * 2;
_h += rowHeight + GAP * 2; _h += rowHeight + GAP * 2;

View File

@ -23,6 +23,14 @@
#include "NTSCFilter.hxx" #include "NTSCFilter.hxx"
#include "PopUpWidget.hxx" #include "PopUpWidget.hxx"
#include "MessageBox.hxx" #include "MessageBox.hxx"
// FIXME - use the R77 define in the final release
// use the '1' define for testing
#if defined(RETRON77)
// #if 1
#include "R77HelpDialog.hxx"
#else
#include "HelpDialog.hxx"
#endif
#include "StellaSettingsDialog.hxx" #include "StellaSettingsDialog.hxx"
@ -30,16 +38,19 @@
StellaSettingsDialog::StellaSettingsDialog(OSystem& osystem, DialogContainer& parent, StellaSettingsDialog::StellaSettingsDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, int max_w, int max_h, Menu::AppMode mode) const GUI::Font& font, int max_w, int max_h, Menu::AppMode mode)
: Dialog(osystem, parent, font, "Basic settings"), : Dialog(osystem, parent, font, "Basic settings"),
myMode(mode) myMode(mode),
myHelpDialog(nullptr)
{ {
const int VBORDER = 8; const int VBORDER = 8;
const int HBORDER = 10; const int HBORDER = 10;
const int INDENT = 20; const int INDENT = 20;
const int buttonHeight = font.getLineHeight() + 6, const int buttonHeight = font.getLineHeight() + 6,
lineHeight = font.getLineHeight(), lineHeight = font.getLineHeight(),
fontWidth = font.getMaxCharWidth(); fontWidth = font.getMaxCharWidth(),
buttonWidth = _font.getStringWidth("Help" + ELLIPSIS) + 32;
const int VGAP = 5; const int VGAP = 5;
int xpos, ypos; int xpos, ypos;
ButtonWidget* bw = nullptr;
WidgetArray wid; WidgetArray wid;
VariantList items; VariantList items;
@ -50,9 +61,13 @@ StellaSettingsDialog::StellaSettingsDialog(OSystem& osystem, DialogContainer& pa
xpos = HBORDER; xpos = HBORDER;
ypos = VBORDER + _th; ypos = VBORDER + _th;
myAdvancedSettings = new ButtonWidget(this, font, xpos, ypos, _w - HBORDER * 2, buttonHeight, bw = new ButtonWidget(this, font, xpos, ypos, _w - HBORDER * 2 - buttonWidth - 8, buttonHeight,
"Switch to Advanced Settings" + ELLIPSIS, kAdvancedSettings); "Use Advanced Settings" + ELLIPSIS, kAdvancedSettings);
wid.push_back(myAdvancedSettings); wid.push_back(bw);
bw = new ButtonWidget(this, font, bw->getRight() + 8, ypos, buttonWidth, buttonHeight,
"Help" + ELLIPSIS, kHelp);
wid.push_back(bw);
ypos += lineHeight + VGAP*4; ypos += lineHeight + VGAP*4;
new StaticTextWidget(this, font, xpos, ypos + 1, "Global settings:"); new StaticTextWidget(this, font, xpos, ypos + 1, "Global settings:");
@ -338,6 +353,10 @@ void StellaSettingsDialog::handleCommand(CommandSender* sender, int cmd,
instance().eventHandler().leaveMenuMode(); instance().eventHandler().leaveMenuMode();
break; break;
case kHelp:
openHelp();
break;
case kScanlinesChanged: case kScanlinesChanged:
if(myTVScanIntense->getValue() == 0) if(myTVScanIntense->getValue() == 0)
myTVScanIntense->setValueLabel("Off"); myTVScanIntense->setValueLabel("Off");
@ -481,3 +500,19 @@ int StellaSettingsDialog::valueToLevel(int value)
} }
return 0; return 0;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void StellaSettingsDialog::openHelp()
{
// Create an help dialog, similar to the in-game one
// FIXME - use the R77 define in the final release
// use the '1' define for testing
if (myHelpDialog == nullptr)
#if defined(RETRON77)
// #if 1
myHelpDialog = make_unique<R77HelpDialog>(instance(), parent(), _font);
#else
myHelpDialog = make_unique<HelpDialog>(instance(), parent(), _font);
#endif
myHelpDialog->open();
}

View File

@ -19,6 +19,14 @@
#define STELLA_OPTIONS_DIALOG_HXX #define STELLA_OPTIONS_DIALOG_HXX
class PopUpWidget; class PopUpWidget;
// FIXME - use the R77 define in the final release
// use the '1' define for testing
#if defined(RETRON77)
// #if 1
class R77HelpDialog;
#else
class HelpDialog;
#endif
#include "Props.hxx" #include "Props.hxx"
#include "Menu.hxx" #include "Menu.hxx"
@ -57,6 +65,8 @@ class StellaSettingsDialog : public Dialog
int levelToValue(int level); int levelToValue(int level);
int valueToLevel(int value); int valueToLevel(int value);
void openHelp();
private: private:
// advanced settings mode: // advanced settings mode:
ButtonWidget* myAdvancedSettings; ButtonWidget* myAdvancedSettings;
@ -86,6 +96,14 @@ class StellaSettingsDialog : public Dialog
StaticTextWidget* myRightPortDetected; StaticTextWidget* myRightPortDetected;
unique_ptr<GUI::MessageBox> myConfirmMsg; unique_ptr<GUI::MessageBox> myConfirmMsg;
// FIXME - use the R77 define in the final release
// use the '1' define for testing
#if defined(RETRON77)
// #if 1
unique_ptr<R77HelpDialog> myHelpDialog;
#else
unique_ptr<HelpDialog> myHelpDialog;
#endif
// Indicates if this dialog is used for global (vs. in-game) settings // Indicates if this dialog is used for global (vs. in-game) settings
Menu::AppMode myMode; Menu::AppMode myMode;
@ -93,6 +111,7 @@ class StellaSettingsDialog : public Dialog
enum { enum {
kAdvancedSettings = 'SSad', kAdvancedSettings = 'SSad',
kConfirmSwitchCmd = 'SScf', kConfirmSwitchCmd = 'SScf',
kHelp = 'SShl',
kScanlinesChanged = 'SSsc', kScanlinesChanged = 'SSsc',
kPhosphorChanged = 'SSph' kPhosphorChanged = 'SSph'
}; };

View File

@ -35,6 +35,7 @@ MODULE_OBJS := \
src/gui/OptionsDialog.o \ src/gui/OptionsDialog.o \
src/gui/PopUpWidget.o \ src/gui/PopUpWidget.o \
src/gui/ProgressDialog.o \ src/gui/ProgressDialog.o \
src/gui/R77HelpDialog.o \
src/gui/RadioButtonWidget.o \ src/gui/RadioButtonWidget.o \
src/gui/RomAuditDialog.o \ src/gui/RomAuditDialog.o \
src/gui/RomInfoWidget.o \ src/gui/RomInfoWidget.o \

View File

@ -504,6 +504,7 @@
<ClCompile Include="..\gui\JoystickDialog.cxx" /> <ClCompile Include="..\gui\JoystickDialog.cxx" />
<ClCompile Include="..\gui\LoggerDialog.cxx" /> <ClCompile Include="..\gui\LoggerDialog.cxx" />
<ClCompile Include="..\gui\MinUICommandDialog.cxx" /> <ClCompile Include="..\gui\MinUICommandDialog.cxx" />
<ClCompile Include="..\gui\R77HelpDialog.cxx" />
<ClCompile Include="..\gui\RadioButtonWidget.cxx" /> <ClCompile Include="..\gui\RadioButtonWidget.cxx" />
<ClCompile Include="..\gui\SnapshotDialog.cxx" /> <ClCompile Include="..\gui\SnapshotDialog.cxx" />
<ClCompile Include="..\gui\StellaSettingsDialog.cxx" /> <ClCompile Include="..\gui\StellaSettingsDialog.cxx" />
@ -1228,6 +1229,7 @@
<ClInclude Include="..\gui\JoystickDialog.hxx" /> <ClInclude Include="..\gui\JoystickDialog.hxx" />
<ClInclude Include="..\gui\LoggerDialog.hxx" /> <ClInclude Include="..\gui\LoggerDialog.hxx" />
<ClInclude Include="..\gui\MinUICommandDialog.hxx" /> <ClInclude Include="..\gui\MinUICommandDialog.hxx" />
<ClInclude Include="..\gui\R77HelpDialog.hxx" />
<ClInclude Include="..\gui\RadioButtonWidget.hxx" /> <ClInclude Include="..\gui\RadioButtonWidget.hxx" />
<ClInclude Include="..\gui\SnapshotDialog.hxx" /> <ClInclude Include="..\gui\SnapshotDialog.hxx" />
<ClInclude Include="..\gui\StellaSettingsDialog.hxx" /> <ClInclude Include="..\gui\StellaSettingsDialog.hxx" />
@ -1405,4 +1407,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
</Project> </Project>

View File

@ -972,6 +972,9 @@
<ClCompile Include="..\common\Logger.cxx"> <ClCompile Include="..\common\Logger.cxx">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\gui\R77HelpDialog.cxx">
<Filter>Source Files\gui</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\common\bspf.hxx"> <ClInclude Include="..\common\bspf.hxx">
@ -1988,6 +1991,9 @@
<ClInclude Include="..\common\Rect.hxx"> <ClInclude Include="..\common\Rect.hxx">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\gui\R77HelpDialog.hxx">
<Filter>Header Files\gui</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="stella.ico"> <None Include="stella.ico">