Commit 89966a9a authored by thrust26's avatar thrust26
Browse files

added help links to most dialogs (see #740)

TODO: tab specific help?
parent 29ec5c5e
Pipeline #20504 passed with stages
in 6 minutes and 38 seconds
......@@ -3732,7 +3732,7 @@
</table>
<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">
<tr>
<td><img src="graphics/options_emulation.png"></td>
......@@ -3769,7 +3769,7 @@
</table>
<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">
<tr>
<td><img src="graphics/eventmapping.png"></td>
......@@ -3807,7 +3807,6 @@
</tr>
<tr>
<td colspan="3"><center><img src="graphics/options_misc_light.png"></center></td>
</tr>
</table>
<br>
......@@ -3840,7 +3839,7 @@
</tr>
</table>
<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">
<tr>
<td><img src="graphics/options_developer.png"></td>
......@@ -3851,7 +3850,7 @@
</tr>
</table>
<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">
<tr>
<td><img src="graphics/options_gameinfo_emulation.png"></td>
......@@ -3862,7 +3861,7 @@
</tr>
</table>
<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">
<tr>
<td><img src="graphics/romaudit.png"></td>
......@@ -4053,7 +4052,7 @@
contains the following items:</p>
<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
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
......@@ -4127,8 +4126,8 @@
</blockquote></br>
<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
and trackballs (CX22/CX80 'Trak-Ball', Atari and Amiga mouse) using the
<a href="http://www.grandideastudio.com/stelladaptor-2600">Stelladaptor</a> and
......
......@@ -107,6 +107,8 @@ CheatCodeDialog::CheatCodeDialog(OSystem& osystem, DialogContainer& parent,
wid.clear();
addOKCancelBGroup(wid, font);
addBGroupToFocusList(wid);
setHelpAnchor("Cheats");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......
......@@ -253,7 +253,7 @@ bool CartDebug::disassembleAddr(uInt16 address, bool force)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartDebug::disassemblePC(bool force)
{
return (disassembleAddr(myDebugger.cpuDebug().pc(), force));
return disassembleAddr(myDebugger.cpuDebug().pc(), force);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......
......@@ -106,6 +106,8 @@ CommandDialog::CommandDialog(OSystem& osystem, DialogContainer& parent)
// We don't have a close/cancel button, but we still want the cancel
// event to be processed
processCancelWithoutWidget(true);
setHelpAnchor("CommandMenu");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......@@ -223,7 +225,7 @@ void CommandDialog::handleCommand(CommandSender* sender, int cmd,
break;
default:
return;
Dialog::handleCommand(sender, cmd, data, 0);
}
// Console commands should be performed right away, after leaving the menu
......
......@@ -80,6 +80,8 @@ DeveloperDialog::DeveloperDialog(OSystem& osystem, DialogContainer& parent,
// Activate the first tab
myTab->setActiveTab(0);
setHelpAnchor("Debugger");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......
......@@ -144,6 +144,34 @@ void Dialog::setTitle(const string& title)
_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()
{
......@@ -851,6 +879,15 @@ void Dialog::handleCommand(CommandSender* sender, int cmd, int data, int id)
close();
break;
case kHelpCmd:
if(hasHelp())
{
if(SDL_OpenURL(getHelpURL().c_str()))
{
cerr << "error opening URL " << getHelpURL() << endl;
}
break;
}
default:
break;
}
......
......@@ -97,6 +97,9 @@ class Dialog : public GuiObject
void setTitle(const string& title);
bool hasTitle() { return !_title.empty(); }
void setHelpAnchor(const string& helpAnchor, bool debugger = false);
const string getHelpURL();
virtual bool isShading() const { return true; }
/**
......@@ -198,7 +201,13 @@ class Dialog : public GuiObject
virtual bool repeatEnabled() { return true; }
bool hasHelp() { return !getHelpURL().empty(); }
private:
enum {
kHelpCmd = 'DlHp'
};
void buildCurrentFocusList(int tabID = -1);
bool handleNavEvent(Event::Type e, bool repeated = false);
void getTabIdForWidget(Widget* w);
......@@ -221,6 +230,9 @@ class Dialog : public GuiObject
int _th{0};
int _layer{0};
unique_ptr<ToolTip> _toolTip;
string _helpAnchor;
bool _debuggerHelp{false};
ButtonWidget* _helpWidget{nullptr};
private:
struct Focus {
......
......@@ -157,6 +157,8 @@ EmulationDialog::EmulationDialog(OSystem& osystem, DialogContainer& parent,
addDefaultsOKCancelBGroup(wid, font);
addToFocusList(wid);
setHelpAnchor("Emulation");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......
......@@ -95,6 +95,8 @@ GameInfoDialog::GameInfoDialog(
_extraWidget->setToolTip("Export the current ROM's properties\n"
"into the default directory.");
addBGroupToFocusList(wid);
setHelpAnchor("Properties");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......
......@@ -130,6 +130,8 @@ GlobalPropsDialog::GlobalPropsDialog(GuiObject* boss, const GUI::Font& font)
addDefaultsOKCancelBGroup(wid, font, "Load ROM", "Cancel");
addToFocusList(wid);
setHelpAnchor("PowerOn");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......
......@@ -83,6 +83,8 @@ HelpDialog::HelpDialog(OSystem& osystem, DialogContainer& parent,
}
addToFocusList(wid);
setHelpAnchor(" ");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......
......@@ -206,6 +206,8 @@ HighScoresDialog::HighScoresDialog(OSystem& osystem, DialogContainer& parent,
addToFocusList(wid);
_focusedWidget = _okWidget; // start with focus on 'Save' button
setHelpAnchor("Highscores");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......
......@@ -96,6 +96,8 @@ InputDialog::InputDialog(OSystem& osystem, DialogContainer& parent,
WidgetArray wid;
addDefaultsOKCancelBGroup(wid, _font);
addBGroupToFocusList(wid);
setHelpAnchor("Input");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......@@ -233,6 +235,8 @@ void InputDialog::addDevicePortTab()
// Add items for virtual device ports
addToFocusList(wid, myTab, tabID);
setHelpAnchor("Input");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......
......@@ -85,6 +85,8 @@ LoggerDialog::LoggerDialog(OSystem& osystem, DialogContainer& parent,
addOKCancelBGroup(wid, font);
addToFocusList(wid);
setHelpAnchor("Logs");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......
......@@ -146,6 +146,8 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
{
myRomAuditButton->clearFlags(Widget::FLAG_ENABLED);
}
setHelpAnchor("Options");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......
......@@ -93,6 +93,8 @@ SnapshotDialog::SnapshotDialog(OSystem& osystem, DialogContainer& parent,
addDefaultsOKCancelBGroup(wid, font);
addToFocusList(wid);
setHelpAnchor("Snapshots");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......
......@@ -311,6 +311,8 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent,
addDefaultsOKCancelBGroup(wid, font);
addBGroupToFocusList(wid);
setHelpAnchor("UserInterface");
#ifndef WINDOWED_SUPPORT
myCenter->clearFlags(Widget::FLAG_ENABLED);
#endif
......
......@@ -90,6 +90,8 @@ VideoAudioDialog::VideoAudioDialog(OSystem& osystem, DialogContainer& parent,
// Activate the first tab
myTab->setActiveTab(0);
setHelpAnchor("VideoAudio");
// Disable certain functions when we know they aren't present
#ifndef WINDOWED_SUPPORT
myFullscreen->clearFlags(Widget::FLAG_ENABLED);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment