added help links to most dialogs (see #740)

TODO: tab specific help?
This commit is contained in:
thrust26 2021-04-17 13:31:36 +02:00
parent 29ec5c5e66
commit 89966a9a2e
18 changed files with 88 additions and 10 deletions

View File

@ -3732,7 +3732,7 @@
</table> </table>
<br> <br>
<p><b>Emulation</b> dialog:</p> <p><b><a name="Emulation">Emulation</a></b> dialog:</p>
<table border="5" cellpadding="2" frame="box" rules="none"> <table border="5" cellpadding="2" frame="box" rules="none">
<tr> <tr>
<td><img src="graphics/options_emulation.png"></td> <td><img src="graphics/options_emulation.png"></td>
@ -3769,7 +3769,7 @@
</table> </table>
<br> <br>
<p><b>Input Settings</b> dialog:</p> <p><b><a name="Input">Input Settings</a></b> dialog:</p>
<table border="5" cellpadding="2" frame="box" rules="none"> <table border="5" cellpadding="2" frame="box" rules="none">
<tr> <tr>
<td><img src="graphics/eventmapping.png"></td> <td><img src="graphics/eventmapping.png"></td>
@ -3807,7 +3807,6 @@
</tr> </tr>
<tr> <tr>
<td colspan="3"><center><img src="graphics/options_misc_light.png"></center></td> <td colspan="3"><center><img src="graphics/options_misc_light.png"></center></td>
</tr> </tr>
</table> </table>
<br> <br>
@ -3840,7 +3839,7 @@
</tr> </tr>
</table> </table>
<br> <br>
<p><b>Developer Settings</b> dialog:</p> <p><b><a name="Developer">Developer Settings</a></b> dialog:</p>
<table border="5" cellpadding="2" frame="box" rules="none"> <table border="5" cellpadding="2" frame="box" rules="none">
<tr> <tr>
<td><img src="graphics/options_developer.png"></td> <td><img src="graphics/options_developer.png"></td>
@ -3851,7 +3850,7 @@
</tr> </tr>
</table> </table>
<br> <br>
<p><b>Game Properties</b> dialog:</p> <p><b><a name="GameProperties">Game Properties</a></b> dialog:</p>
<table border="5" cellpadding="2" frame="box" rules="none"> <table border="5" cellpadding="2" frame="box" rules="none">
<tr> <tr>
<td><img src="graphics/options_gameinfo_emulation.png"></td> <td><img src="graphics/options_gameinfo_emulation.png"></td>
@ -3862,7 +3861,7 @@
</tr> </tr>
</table> </table>
<br> <br>
<p><b>Audit ROMs</b> dialog:</p> <p><b><a name="Audit">Audit ROMs</a></b> dialog:</p>
<table border="5" cellpadding="2" frame="box" rules="none"> <table border="5" cellpadding="2" frame="box" rules="none">
<tr> <tr>
<td><img src="graphics/romaudit.png"></td> <td><img src="graphics/romaudit.png"></td>
@ -4053,7 +4052,7 @@
contains the following items:</p> contains the following items:</p>
<p><ol> <p><ol>
<li><p><b>Power-on options</b>: Selecting this option shows a dialog whereby <li><p><b><a name="PowerOn">Power-on options</a></b>: Selecting this option shows a dialog whereby
ROM properties can be temporarily overridden, and joystick/console buttons can be ROM properties can be temporarily overridden, and joystick/console buttons can be
temporarily held down. Selecting options from this dialog will cause all ROMs launched temporarily held down. Selecting options from this dialog will cause all ROMs launched
after that to use those properties you specify. Clicking <b>Defaults</b> will disable after that to use those properties you specify. Clicking <b>Defaults</b> will disable
@ -4127,8 +4126,8 @@
</blockquote></br> </blockquote></br>
<h2><b><a name="Adaptor">Stelladaptor/2600-daptor Support</a></b></h2> <h2><b><a name="Adaptor">Stelladaptor/2600-daptor Support</a></b></h2>
<blockquote>
<blockquote> H
<p>Stella supports real Atari 2600 joysticks, paddles, driving controllers <p>Stella supports real Atari 2600 joysticks, paddles, driving controllers
and trackballs (CX22/CX80 'Trak-Ball', Atari and Amiga mouse) using the and trackballs (CX22/CX80 'Trak-Ball', Atari and Amiga mouse) using the
<a href="http://www.grandideastudio.com/stelladaptor-2600">Stelladaptor</a> and <a href="http://www.grandideastudio.com/stelladaptor-2600">Stelladaptor</a> and

View File

@ -107,6 +107,8 @@ CheatCodeDialog::CheatCodeDialog(OSystem& osystem, DialogContainer& parent,
wid.clear(); wid.clear();
addOKCancelBGroup(wid, font); addOKCancelBGroup(wid, font);
addBGroupToFocusList(wid); addBGroupToFocusList(wid);
setHelpAnchor("Cheats");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -253,7 +253,7 @@ bool CartDebug::disassembleAddr(uInt16 address, bool force)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartDebug::disassemblePC(bool force) bool CartDebug::disassemblePC(bool force)
{ {
return (disassembleAddr(myDebugger.cpuDebug().pc(), force)); return disassembleAddr(myDebugger.cpuDebug().pc(), force);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -106,6 +106,8 @@ CommandDialog::CommandDialog(OSystem& osystem, DialogContainer& parent)
// We don't have a close/cancel button, but we still want the cancel // We don't have a close/cancel button, but we still want the cancel
// event to be processed // event to be processed
processCancelWithoutWidget(true); processCancelWithoutWidget(true);
setHelpAnchor("CommandMenu");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -223,7 +225,7 @@ void CommandDialog::handleCommand(CommandSender* sender, int cmd,
break; break;
default: default:
return; Dialog::handleCommand(sender, cmd, data, 0);
} }
// Console commands should be performed right away, after leaving the menu // Console commands should be performed right away, after leaving the menu

View File

@ -80,6 +80,8 @@ DeveloperDialog::DeveloperDialog(OSystem& osystem, DialogContainer& parent,
// Activate the first tab // Activate the first tab
myTab->setActiveTab(0); myTab->setActiveTab(0);
setHelpAnchor("Debugger");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -144,6 +144,34 @@ void Dialog::setTitle(const string& title)
_h += _th; _h += _th;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Dialog::setHelpAnchor(const string& helpAnchor, bool debugger)
{
#ifndef RETRON77
_helpAnchor = helpAnchor;
_debuggerHelp = debugger;
if(_helpWidget == nullptr)
_helpWidget = new ButtonWidget(this, _font, _w - _font.getMaxCharWidth() * 3.5, 0,
_font.getMaxCharWidth() * 3.5, buttonHeight(), "?",
kHelpCmd);
if(hasTitle() && hasHelp())
_helpWidget->clearFlags(Widget::FLAG_INVISIBLE);
else
_helpWidget->setFlags(Widget::FLAG_INVISIBLE);
#endif
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const string Dialog::getHelpURL()
{
if(_debuggerHelp)
return "https://stella-emu.github.io/docs/debugger.html#" + _helpAnchor;
else
return "https://stella-emu.github.io/docs/index.html#" + _helpAnchor;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Dialog::setPosition() void Dialog::setPosition()
{ {
@ -851,6 +879,15 @@ void Dialog::handleCommand(CommandSender* sender, int cmd, int data, int id)
close(); close();
break; break;
case kHelpCmd:
if(hasHelp())
{
if(SDL_OpenURL(getHelpURL().c_str()))
{
cerr << "error opening URL " << getHelpURL() << endl;
}
break;
}
default: default:
break; break;
} }

View File

@ -97,6 +97,9 @@ class Dialog : public GuiObject
void setTitle(const string& title); void setTitle(const string& title);
bool hasTitle() { return !_title.empty(); } bool hasTitle() { return !_title.empty(); }
void setHelpAnchor(const string& helpAnchor, bool debugger = false);
const string getHelpURL();
virtual bool isShading() const { return true; } virtual bool isShading() const { return true; }
/** /**
@ -198,7 +201,13 @@ class Dialog : public GuiObject
virtual bool repeatEnabled() { return true; } virtual bool repeatEnabled() { return true; }
bool hasHelp() { return !getHelpURL().empty(); }
private: private:
enum {
kHelpCmd = 'DlHp'
};
void buildCurrentFocusList(int tabID = -1); void buildCurrentFocusList(int tabID = -1);
bool handleNavEvent(Event::Type e, bool repeated = false); bool handleNavEvent(Event::Type e, bool repeated = false);
void getTabIdForWidget(Widget* w); void getTabIdForWidget(Widget* w);
@ -221,6 +230,9 @@ class Dialog : public GuiObject
int _th{0}; int _th{0};
int _layer{0}; int _layer{0};
unique_ptr<ToolTip> _toolTip; unique_ptr<ToolTip> _toolTip;
string _helpAnchor;
bool _debuggerHelp{false};
ButtonWidget* _helpWidget{nullptr};
private: private:
struct Focus { struct Focus {

View File

@ -157,6 +157,8 @@ EmulationDialog::EmulationDialog(OSystem& osystem, DialogContainer& parent,
addDefaultsOKCancelBGroup(wid, font); addDefaultsOKCancelBGroup(wid, font);
addToFocusList(wid); addToFocusList(wid);
setHelpAnchor("Emulation");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -95,6 +95,8 @@ GameInfoDialog::GameInfoDialog(
_extraWidget->setToolTip("Export the current ROM's properties\n" _extraWidget->setToolTip("Export the current ROM's properties\n"
"into the default directory."); "into the default directory.");
addBGroupToFocusList(wid); addBGroupToFocusList(wid);
setHelpAnchor("Properties");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -130,6 +130,8 @@ GlobalPropsDialog::GlobalPropsDialog(GuiObject* boss, const GUI::Font& font)
addDefaultsOKCancelBGroup(wid, font, "Load ROM", "Cancel"); addDefaultsOKCancelBGroup(wid, font, "Load ROM", "Cancel");
addToFocusList(wid); addToFocusList(wid);
setHelpAnchor("PowerOn");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -83,6 +83,8 @@ HelpDialog::HelpDialog(OSystem& osystem, DialogContainer& parent,
} }
addToFocusList(wid); addToFocusList(wid);
setHelpAnchor(" ");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -206,6 +206,8 @@ HighScoresDialog::HighScoresDialog(OSystem& osystem, DialogContainer& parent,
addToFocusList(wid); addToFocusList(wid);
_focusedWidget = _okWidget; // start with focus on 'Save' button _focusedWidget = _okWidget; // start with focus on 'Save' button
setHelpAnchor("Highscores");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -96,6 +96,8 @@ InputDialog::InputDialog(OSystem& osystem, DialogContainer& parent,
WidgetArray wid; WidgetArray wid;
addDefaultsOKCancelBGroup(wid, _font); addDefaultsOKCancelBGroup(wid, _font);
addBGroupToFocusList(wid); addBGroupToFocusList(wid);
setHelpAnchor("Input");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -233,6 +235,8 @@ void InputDialog::addDevicePortTab()
// Add items for virtual device ports // Add items for virtual device ports
addToFocusList(wid, myTab, tabID); addToFocusList(wid, myTab, tabID);
setHelpAnchor("Input");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -85,6 +85,8 @@ LoggerDialog::LoggerDialog(OSystem& osystem, DialogContainer& parent,
addOKCancelBGroup(wid, font); addOKCancelBGroup(wid, font);
addToFocusList(wid); addToFocusList(wid);
setHelpAnchor("Logs");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -146,6 +146,8 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
{ {
myRomAuditButton->clearFlags(Widget::FLAG_ENABLED); myRomAuditButton->clearFlags(Widget::FLAG_ENABLED);
} }
setHelpAnchor("Options");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -93,6 +93,8 @@ SnapshotDialog::SnapshotDialog(OSystem& osystem, DialogContainer& parent,
addDefaultsOKCancelBGroup(wid, font); addDefaultsOKCancelBGroup(wid, font);
addToFocusList(wid); addToFocusList(wid);
setHelpAnchor("Snapshots");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -311,6 +311,8 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent,
addDefaultsOKCancelBGroup(wid, font); addDefaultsOKCancelBGroup(wid, font);
addBGroupToFocusList(wid); addBGroupToFocusList(wid);
setHelpAnchor("UserInterface");
#ifndef WINDOWED_SUPPORT #ifndef WINDOWED_SUPPORT
myCenter->clearFlags(Widget::FLAG_ENABLED); myCenter->clearFlags(Widget::FLAG_ENABLED);
#endif #endif

View File

@ -90,6 +90,8 @@ VideoAudioDialog::VideoAudioDialog(OSystem& osystem, DialogContainer& parent,
// Activate the first tab // Activate the first tab
myTab->setActiveTab(0); myTab->setActiveTab(0);
setHelpAnchor("VideoAudio");
// Disable certain functions when we know they aren't present // Disable certain functions when we know they aren't present
#ifndef WINDOWED_SUPPORT #ifndef WINDOWED_SUPPORT
myFullscreen->clearFlags(Widget::FLAG_ENABLED); myFullscreen->clearFlags(Widget::FLAG_ENABLED);