GUI: Added Help button to Launcher, GMM and the Browser dialog

It leads to the Markdown help. In the launcher we show button
only on highres, non-classic themes, due to absence of vertical space

Also bump the theme version.
This commit is contained in:
Eugene Sandulenko
2026-01-27 00:58:19 +01:00
parent d210871860
commit 7cb7a322c1
19 changed files with 136 additions and 32 deletions
+9 -1
View File
@@ -29,6 +29,7 @@
#include "gui/about.h"
#include "gui/gui-manager.h"
#include "gui/helpdialog.h"
#include "gui/message.h"
#include "gui/options.h"
#include "gui/saveload.h"
@@ -75,10 +76,12 @@ MainMenuDialog::MainMenuDialog(Engine *engine)
// The help button is disabled by default.
// To enable "Help", an engine needs to use a subclass of MainMenuDialog
// (at least for now, we might change how this works in the future).
_helpButton = new GUI::ButtonWidget(this, "GlobalMenu.Help", _("~H~elp"), Common::U32String(), kHelpCmd);
_helpButton = new GUI::ButtonWidget(this, "GlobalMenu.Help", _("Game ~H~elp"), Common::U32String(), kHelpCmd);
_helpButton->setVisible(_engine->hasFeature(Engine::kSupportsHelp));
_helpButton->setEnabled(_engine->hasFeature(Engine::kSupportsHelp));
new GUI::ButtonWidget(this, "GlobalMenu.MainHelp", _("~H~elp"), Common::U32String(), kMainHelpCmd);
new GUI::ButtonWidget(this, "GlobalMenu.About", _("~A~bout"), Common::U32String(), kAboutCmd);
if (g_gui.getGUIWidth() > 320)
@@ -128,6 +131,11 @@ void MainMenuDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint3
dialog.runModal();
}
break;
case kMainHelpCmd: {
GUI::HelpDialog dlg;
dlg.runModal();
}
break;
case kLauncherCmd: {
Common::Event eventReturnToLauncher;
eventReturnToLauncher.type = Common::EVENT_RETURN_TO_LAUNCHER;
+1
View File
@@ -43,6 +43,7 @@ public:
kPlayCmd = 'PLAY',
kOptionsCmd = 'OPTN',
kHelpCmd = 'HELP',
kMainHelpCmd = 'MHLP',
kAboutCmd = 'ABOU',
kQuitCmd = 'QUIT',
kLauncherCmd = 'LNCR',
+1 -1
View File
@@ -36,7 +36,7 @@
#include "graphics/pixelformat.h"
#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.9.20"
#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.9.21"
class OSystem;
+9 -1
View File
@@ -20,6 +20,7 @@
*/
#include "gui/browser.h"
#include "gui/helpdialog.h"
#include "gui/gui-manager.h"
#include "gui/widgets/edittext.h"
#include "gui/widgets/list.h"
@@ -39,7 +40,8 @@ enum {
kChooseCmd = 'Chos',
kGoUpCmd = 'GoUp',
kHiddenCmd = 'Hidd',
kPathEditedCmd = 'Path'
kPathEditedCmd = 'Path',
kHelpCmd = 'Help',
};
/* We want to use this as a general directory selector at some point... possible uses
@@ -59,6 +61,7 @@ BrowserDialog::BrowserDialog(const Common::U32String &title, bool dirBrowser)
// Headline - TODO: should be customizable during creation time
new StaticTextWidget(this, "Browser.Headline", title);
new ButtonWidget(this, "Browser.Help", _("Help"), Common::U32String(), kHelpCmd);
// Current path - TODO: handle long paths ?
_currentPath = new EditTextWidget(this, "Browser.Path", Common::U32String(), Common::U32String(), 0, kPathEditedCmd);
@@ -122,6 +125,11 @@ void BrowserDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
_node = Common::FSNode(Common::Path(Common::convertFromU32String(_currentPath->getEditString()), Common::Path::kNativeSeparator));
updateListing();
break;
case kHelpCmd: {
GUI::HelpDialog dlg;
dlg.runModal();
}
break;
//Search by text input
case kChooseCmd:
if (_isDirBrowser) {
+20 -3
View File
@@ -269,6 +269,11 @@ void LauncherDialog::build() {
// I18N: Button About ScummVM program. b is the shortcut, Ctrl+b, put it in parens for non-latin (~b~)
new ButtonWidget(this, _title + ".AboutButton", _("A~b~out"), _("About ScummVM"), kAboutCmd);
_mainHelpButton = nullptr;
if (g_gui.xmlEval()->getVar("Globals.Launcher.ShowMainHelp") == 1)
_mainHelpButton = new ButtonWidget(this, _title + ".MainHelpButton", _("Help"), _("General help"), kHelpCmd);
// I18N: Button caption. O is the shortcut, Ctrl+O, put it in parens for non-latin (~O~)
new ButtonWidget(this, _title + ".OptionsButton", _("Global ~O~ptions..."), _("Change global ScummVM options"), kOptionsCmd, 0, _c("Global ~O~pts...", "lowres"));
@@ -942,6 +947,18 @@ void LauncherDialog::reflowLayout() {
g_gui.addToTrash(_searchClearButton, this);
_searchClearButton = addClearButton(this, _title + ".SearchClearButton", kSearchClearCmd);
#endif
if (g_gui.xmlEval()->getVar("Globals.Launcher.ShowMainHelp") == 1) {
if (!_mainHelpButton)
_mainHelpButton = new ButtonWidget(this, _title + ".MainHelpButton", _("Help"), _("General help"), kHelpCmd);
} else {
if (_mainHelpButton) {
removeWidget(_mainHelpButton);
g_gui.addToTrash(_mainHelpButton, this);
_mainHelpButton = nullptr;
}
}
#ifndef DISABLE_LAUNCHERDISPLAY_GRID
addLayoutChooserButtons();
#endif
@@ -1436,7 +1453,7 @@ void LauncherSimple::updateSelectionAfterRemoval() {
if (_list) {
_list->clearSelection();
const Common::Array<bool> &selectedItems = getSelectedItems();
// Get the real data index of the last selected item and adjust with bounds
int lastSelectedDataItem = MIN((int)selectedItems.size() - 1, _list->getSelected());
// Convert real data index to visual index for marking
@@ -1790,7 +1807,7 @@ void LauncherGrid::build() {
void LauncherGrid::updateSelectionAfterRemoval() {
if (_grid) {
_grid->clearSelection();
// Select at the same index as before, or the last item if out of bounds
_grid->_lastSelectedEntryID = MIN((int)getSelectedItems().size() - 1, _grid->_lastSelectedEntryID);
_grid->markSelectedItem(_grid->_lastSelectedEntryID, true);
@@ -1803,7 +1820,7 @@ void LauncherDialog::confirmRemoveGames(const Common::Array<bool> &selectedItems
// Validate that at least one item is selected
if (!hasAnySelection(selectedItems))
return;
// Count selected items
int selectedCount = 0;
for (int i = 0; i < (int)selectedItems.size(); ++i) {
+1
View File
@@ -136,6 +136,7 @@ protected:
Widget *_startButton;
ButtonWidget *_loadButton;
Widget *_editButton;
Widget *_mainHelpButton;
Common::StringArray _domains;
BrowserDialog *_browser;
SaveLoadChooser *_loadDialog;
+17 -4
View File
@@ -48,7 +48,8 @@
<def var = 'ShowChooserPics' value = '1'/>
<def var = 'ShowChooserPageDisplay' value = '1'/>
<def var = 'Launcher.HelpButton.Width' value = '24' scalable = 'yes'/> <!-- Button.Width * 3 -->
<def var = 'Launcher.HelpButton.Width' value = '24' scalable = 'yes'/> <!-- Button.Width * 3 -->
<def var = 'Launcher.ShowMainHelp' value = '1'/>
<def var = 'SaveLoadChooser.ExtInfo.Visible' value = '1'/>
<def var = 'RecorderDialog.ExtInfo.Visible' value = '1'/>
@@ -232,6 +233,9 @@
<widget name = 'OptionsButton'
type = 'Button'
/>
<widget name = 'MainHelpButton'
type = 'Button'
/>
<widget name = 'AboutButton'
type = 'Button'
/>
@@ -484,9 +488,14 @@
<dialog name = 'Browser' overlays = 'Dialog.Launcher.GameList' shading = 'dim'>
<layout type = 'vertical' padding = '8, 8, 8, 8'>
<widget name = 'Headline'
height = 'Globals.Line.Height'
/>
<layout type = 'horizontal' padding = '0, 0, 0, 0'>
<widget name = 'Headline'
height = 'Globals.Line.Height'
/>
<widget name = 'Help'
type = 'Button'
/>
</layout>
<widget name = 'Path'
height = 'Globals.Line.Height'
/>
@@ -1885,6 +1894,10 @@
width = '150'
height = 'Globals.Button.Height'
/>
<widget name = 'MainHelp'
width = '150'
height = 'Globals.Button.Height'
/>
<widget name = 'About'
width = '150'
height = 'Globals.Button.Height'
+20 -8
View File
@@ -39,7 +39,8 @@
<def var = 'ShowChooserPics' value = '0'/>
<def var = 'ShowChooserPageDisplay' value = '0'/>
<def var = 'Launcher.HelpButton.Width' value = '16' scalable = 'yes'/> <!-- Button.Width -->
<def var = 'Launcher.HelpButton.Width' value = '16' scalable = 'yes'/> <!-- Button.Width -->
<def var = 'Launcher.ShowMainHelp' value = '0'/>
<def var = 'SaveLoadChooser.ExtInfo.Visible' value = '0'/>
<def var = 'RecorderDialog.ExtInfo.Visible' value = '0'/>
@@ -341,9 +342,14 @@
<dialog name = 'Browser' overlays = 'screen' inset = '8' shading = 'dim'>
<layout type = 'vertical' padding = '8, 8, 0, 4'>
<widget name = 'Headline'
height = 'Globals.Line.Height'
/>
<layout type = 'horizontal' padding = '0, 0, 0, 0'>
<widget name = 'Headline'
height = 'Globals.Line.Height'
/>
<widget name = 'Help'
type = 'Button'
/>
</layout>
<widget name = 'Path'
height = 'Globals.Line.Height'
/>
@@ -1714,10 +1720,16 @@
width = '120'
height = 'Globals.Button.Height'
/>
<widget name = 'Help'
width = '120'
height = 'Globals.Button.Height'
/>
<layout type = 'horizontal' padding = '4, 4, 4, 4' align = 'center' spacing='2'>
<widget name = 'Help'
width = '60'
height = 'Globals.Button.Height'
/>
<widget name = 'MainHelp'
width = '60'
height = 'Globals.Button.Height'
/>
</layout>
<widget name = 'About'
width = '120'
height = 'Globals.Button.Height'
+23 -1
View File
@@ -1454,6 +1454,7 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"<def var='ShowChooserPics' value='0'/>"
"<def var='ShowChooserPageDisplay' value='1'/>"
"<def var='Launcher.HelpButton.Width' value='24' scalable='yes'/> "
"<def var='Launcher.ShowMainHelp' value='0'/>"
"<def var='SaveLoadChooser.ExtInfo.Visible' value='1'/>"
"<def var='RecorderDialog.ExtInfo.Visible' value='1'/>"
"<def var='ImageAlbum.ImageInset' value='16' scalable='yes' />"
@@ -1639,9 +1640,14 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"</dialog>"
"<dialog name='Browser' overlays='Dialog.Launcher.GameList' shading='dim'>"
"<layout type='vertical' padding='8,8,8,8'>"
"<layout type='horizontal' padding='0,0,0,0'>"
"<widget name='Headline' "
"height='Globals.Line.Height' "
"/>"
"<widget name='Help' "
"type='Button' "
"/>"
"</layout>"
"<widget name='Path' "
"height='Globals.Line.Height' "
"/>"
@@ -2862,6 +2868,10 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"width='150' "
"height='Globals.Button.Height' "
"/>"
"<widget name='MainHelp' "
"width='150' "
"height='Globals.Button.Height' "
"/>"
"<widget name='About' "
"width='150' "
"height='Globals.Button.Height' "
@@ -3842,6 +3852,7 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"<def var='ShowChooserPics' value='0'/>"
"<def var='ShowChooserPageDisplay' value='0'/>"
"<def var='Launcher.HelpButton.Width' value='16' scalable='yes'/> "
"<def var='Launcher.ShowMainHelp' value='0'/>"
"<def var='SaveLoadChooser.ExtInfo.Visible' value='0'/>"
"<def var='RecorderDialog.ExtInfo.Visible' value='0'/>"
"<def var='ImageAlbum.ImageInset' value='16' scalable='yes' />"
@@ -4035,9 +4046,14 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"</dialog>"
"<dialog name='Browser' overlays='screen' inset='8' shading='dim'>"
"<layout type='vertical' padding='8,8,0,4'>"
"<layout type='horizontal' padding='0,0,0,0'>"
"<widget name='Headline' "
"height='Globals.Line.Height' "
"/>"
"<widget name='Help' "
"type='Button' "
"/>"
"</layout>"
"<widget name='Path' "
"height='Globals.Line.Height' "
"/>"
@@ -5264,10 +5280,16 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"width='120' "
"height='12' "
"/>"
"<layout type='horizontal' padding='4,4,4,4' align='center' spacing='2'>"
"<widget name='Help' "
"width='120' "
"width='60' "
"height='12' "
"/>"
"<widget name='MainHelp' "
"width='60' "
"height='12' "
"/>"
"</layout>"
"<widget name='About' "
"width='120' "
"height='12' "
Binary file not shown.
+1 -1
View File
@@ -1,3 +1,3 @@
[SCUMMVM_STX0.9.20:ResidualVM Modern Theme Remastered:No Author]
[SCUMMVM_STX0.9.21:ResidualVM Modern Theme Remastered:No Author]
%using ../common
%using ../common-svg
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
[SCUMMVM_STX0.9.20:ScummVM Classic Theme:No Author]
[SCUMMVM_STX0.9.21:ScummVM Classic Theme:No Author]
+14 -4
View File
@@ -39,7 +39,8 @@
<def var = 'ShowChooserPics' value = '0'/>
<def var = 'ShowChooserPageDisplay' value = '1'/>
<def var = 'Launcher.HelpButton.Width' value = '24' scalable = 'yes'/> <!-- Button.Width -->
<def var = 'Launcher.HelpButton.Width' value = '24' scalable = 'yes'/> <!-- Button.Width -->
<def var = 'Launcher.ShowMainHelp' value = '0'/>
<def var = 'SaveLoadChooser.ExtInfo.Visible' value = '1'/>
<def var = 'RecorderDialog.ExtInfo.Visible' value = '1'/>
@@ -240,9 +241,14 @@
<dialog name = 'Browser' overlays = 'Dialog.Launcher.GameList' shading = 'dim'>
<layout type = 'vertical' padding = '8, 8, 8, 8'>
<widget name = 'Headline'
height = 'Globals.Line.Height'
/>
<layout type = 'horizontal' padding = '0, 0, 0, 0'>
<widget name = 'Headline'
height = 'Globals.Line.Height'
/>
<widget name = 'Help'
type = 'Button'
/>
</layout>
<widget name = 'Path'
height = 'Globals.Line.Height'
/>
@@ -1530,6 +1536,10 @@
width = '150'
height = 'Globals.Button.Height'
/>
<widget name = 'MainHelp'
width = '150'
height = 'Globals.Button.Height'
/>
<widget name = 'About'
width = '150'
height = 'Globals.Button.Height'
@@ -39,7 +39,8 @@
<def var = 'ShowChooserPics' value = '0'/>
<def var = 'ShowChooserPageDisplay' value = '0'/>
<def var = 'Launcher.HelpButton.Width' value = '16' scalable = 'yes'/> <!-- Button.Width -->
<def var = 'Launcher.HelpButton.Width' value = '16' scalable = 'yes'/> <!-- Button.Width -->
<def var = 'Launcher.ShowMainHelp' value = '0'/>
<def var = 'SaveLoadChooser.ExtInfo.Visible' value = '0'/>
<def var = 'RecorderDialog.ExtInfo.Visible' value = '0'/>
@@ -248,9 +249,14 @@
<dialog name = 'Browser' overlays = 'screen' inset = '8' shading = 'dim'>
<layout type = 'vertical' padding = '8, 8, 0, 4'>
<widget name = 'Headline'
height = 'Globals.Line.Height'
/>
<layout type = 'horizontal' padding = '0, 0, 0, 0'>
<widget name = 'Headline'
height = 'Globals.Line.Height'
/>
<widget name = 'Help'
type = 'Button'
/>
</layout>
<widget name = 'Path'
height = 'Globals.Line.Height'
/>
@@ -1543,10 +1549,16 @@
width = '120'
height = '12'
/>
<layout type = 'horizontal' padding = '4, 4, 4, 4' align = 'center' spacing='2'>
<widget name = 'Help'
width = '120'
width = '60'
height = '12'
/>
<widget name = 'MainHelp'
width = '60'
height = '12'
/>
</layout>
<widget name = 'About'
width = '120'
height = '12'
Binary file not shown.
+1 -1
View File
@@ -1,2 +1,2 @@
[SCUMMVM_STX0.9.20:ScummVM Modern Theme:No Author]
[SCUMMVM_STX0.9.21:ScummVM Modern Theme:No Author]
%using ../common
Binary file not shown.
+1 -1
View File
@@ -1,3 +1,3 @@
[SCUMMVM_STX0.9.20:ScummVM Modern Theme Remastered:No Author]
[SCUMMVM_STX0.9.21:ScummVM Modern Theme Remastered:No Author]
%using ../common
%using ../common-svg