enhanced launcher context menu with direct Game properties dialog link

This commit is contained in:
Thomas Jentzsch 2022-02-16 21:54:20 +01:00
parent 5b5eccf28f
commit e537eaffd5
3 changed files with 68 additions and 39 deletions

View File

@ -2290,6 +2290,11 @@
<td>Control + F</td>
<td>Control + F</td>
</tr>
<tr>
<td>Open Game properties dialog</td>
<td>Control + G</td>
<td>Control + G</td>
</tr>
<tr>
<td>Open Power-On options dialog</td>
<td>Control + P</td>
@ -4317,18 +4322,22 @@
<p><ul>
<li>
<p><b>Remove from recently played/most popular</b> (or 'Control + X'):
This option removes the selected ROM from the current folder.</p>
Removes the selected ROM from the current virtual folder.</p>
</li>
<li>
<p><b>Add to/remove from favorites</b> (or 'Control + F'): This option
toggles the favorite state of the selected ROM or directory.</p>
<p><b>Add to/remove from favorites</b> (or 'Control + F'): Toggles the
favorite state of the selected ROM or directory.</p>
</li>
<li>
<p><b>Game properties</b> (or 'Control + G'): Opens the
<b><a href="#Properties">Game properties</a></b> dialog.</p>
</li>
<li><p><b><a name="PowerOn">Power-on options</a></b> (or 'Control + P'):
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
its functionality, and use ROM properties as defined by the ROM itself. The dialog is as
Opens 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 its
functionality, and use ROM properties as defined by the ROM itself. The dialog is as
follows (see <b>Advanced Configuration - <a href="#Properties">Game Properties</a></b>
for more information concerning ROM properties):</p>
<table border="5" cellpadding="2" frame="box" rules="none">
@ -4354,9 +4363,9 @@
</table>
</li>
<li>
<p><b>High scores</b> (or 'Control + H'): This option displays the <a href="#HighScores">
High Scores</a> dialog for the selected ROM. Only available if high score
properties have been setup for the ROM.</p>
<p><b>High scores</b> (or 'Control + H'): Opens the
<b><a href="#HighScores"></b>High Scores</a> dialog for the selected ROM.
Only available if high score properties have been setup for the ROM.</p>
</li>
<li>
<p><b>Enable/disable file extensions</b> (or 'Control + E'): Toggles the
@ -4375,8 +4384,8 @@
of ROMs in current directory only or all subdirectories too.</p>
</li>
<li>
<p><b>Reload listing</b> (or 'Control + R'): Selecting this performs a
reload of the current listing. </p>
<p><b>Reload listing</b> (or 'Control + R'): Performs a reload of the
current file listing. </p>
</li>
</ul></p>
</blockquote></br>

View File

@ -28,6 +28,7 @@
#include "FSNode.hxx"
#include "MD5.hxx"
#include "OptionsDialog.hxx"
#include "GameInfoDialog.hxx"
#include "HighScoresDialog.hxx"
#include "HighScoresManager.hxx"
#include "GlobalPropsDialog.hxx"
@ -245,7 +246,6 @@ void LauncherDialog::addPathWidgets(int& ypos)
buttonWidth, buttonHeight, reloadIcon, kReloadCmd);
myReloadButton->setToolTip("Reload listing");
wid.push_back(myReloadButton);
ypos = myNavigationBar->getBottom() + Dialog::vGap();
}
else
{
@ -256,10 +256,10 @@ void LauncherDialog::addPathWidgets(int& ypos)
lwFound, fontHeight, "", TextAlign::Right);
EditTextWidget* e = new EditTextWidget(this, _font, myNavigationBar->getRight() - 1, ypos,
lwFound + LBL_GAP + 1, lineHeight, "");
lwFound + LBL_GAP + 1, buttonHeight - 2, "");
e->setEditable(false, true);
ypos = myNavigationBar->getBottom();
}
ypos = myNavigationBar->getBottom() + Dialog::vGap();
addToFocusList(wid);
}
@ -739,6 +739,8 @@ void LauncherDialog::handleContextMenu()
removeAllPopular();
else if(cmd == "removerecent")
removeAllRecent();
else if(cmd == "properties")
openGameProperties();
else if(cmd == "override")
openGlobalProps();
else if(cmd == "extensions")
@ -807,6 +809,10 @@ void LauncherDialog::handleKeyDown(StellaKey key, StellaMod mod, bool repeated)
myList->toggleUserFavorite();
break;
case KBDK_G:
openGameProperties();
break;
case KBDK_H:
if(instance().highScores().enabled())
openHighScores();
@ -1137,6 +1143,7 @@ void LauncherDialog::openContextMenu(int x, int y)
}
if(!currentNode().isDirectory() && Bankswitch::isValidRomName(currentNode()))
{
items.push_back(ContextItem("Game properties" + ELLIPSIS, "Ctrl+G", "properties"));
items.push_back(ContextItem("Power-on options" + ELLIPSIS, "Ctrl+P", "override"));
if(instance().highScores().enabled())
items.push_back(ContextItem("High scores" + ELLIPSIS, "Ctrl+H", "highscores"));
@ -1212,6 +1219,18 @@ void LauncherDialog::openSettings()
myDialog->open();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void LauncherDialog::openGameProperties()
{
if(!currentNode().isDirectory() && Bankswitch::isValidRomName(currentNode()))
{
// Create game properties dialog
myDialog = make_unique<GameInfoDialog>(instance(), parent(),
myUseMinimalUI ? _font : instance().frameBuffer().font(), this, _w, _h);
myDialog->open();
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void LauncherDialog::openGlobalProps()
{

View File

@ -168,6 +168,7 @@ class LauncherDialog : public Dialog, CommandSender
void loadRom();
void loadRomInfo();
void openSettings();
void openGameProperties();
void openContextMenu(int x = -1, int y = -1);
void openGlobalProps();
void openHighScores();