When compiled for R77, use 'minimal_ui' mode.

This commit is contained in:
Stephen Anthony 2019-03-09 14:35:22 -03:30
parent fa59b6b9d2
commit 51981d633d
5 changed files with 74 additions and 49 deletions

View File

@ -2919,7 +2919,7 @@
least 640x480. If the launcher isn't large enough, the functionality
will be disabled.</li>
<li>To view snapshots in 2x mode, the ROM launcher window must be sized at
least 1000x760. If the launcher isn't large enough, an attempt will
least 1000x720. If the launcher isn't large enough, an attempt will
be made to use 1x mode.</li>
</ol>
@ -2929,7 +2929,7 @@
<p>ROM Info Viewer in 1x mode, UI sized 800x480, small launcher font:</p>
<img src="graphics/rominfo_1x_small.png">
<p>ROM Info Viewer in 1x mode, UI sized 1000x760, medium launcher font:</p>
<p>ROM Info Viewer in 1x mode, UI sized 1000x720, medium launcher font:</p>
<img src="graphics/rominfo_1x_large.png">
<p>ROM Info Viewer in 2x mode, UI sized 1280x900, large launcher font:</p>

View File

@ -24,7 +24,7 @@ namespace TIAConstants {
constexpr uInt32 frameBufferHeight = 320;
constexpr uInt32 maxYStart = 64;
constexpr uInt32 minViewableHeight = 210, maxViewableHeight = 256;
constexpr uInt32 minViewableHeight = 240, maxViewableHeight = 240; // FIXME - remove this (or at least use only one)
constexpr uInt32 initialGarbageFrames = 10;
static constexpr uInt16

View File

@ -39,6 +39,7 @@
#include "StringListWidget.hxx"
#include "Widget.hxx"
#include "Font.hxx"
#include "Version.hxx"
#include "LauncherDialog.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -51,6 +52,7 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
myQuitButton(nullptr),
myList(nullptr),
myPattern(nullptr),
myAllFiles(nullptr),
myRomInfoWidget(nullptr),
mySelectedItem(0)
{
@ -64,9 +66,11 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
bwidth = (_w - 2 * HBORDER - BUTTON_GAP * (4 - 1)),
bheight = lineHeight + 4,
LBL_GAP = fontWidth;
int xpos, ypos = 0, lwidth = 0, lwidth2 = 0;
int xpos = 0, ypos = 0, lwidth = 0, lwidth2 = 0;
WidgetArray wid;
const bool useMinimalUI = instance().settings().getBool("minimal_ui");
string lblRom = "Select a ROM from the list" + ELLIPSIS;
const string& lblFilter = "Filter";
const string& lblAllFiles = "Show all files";
@ -84,17 +88,31 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
lwidth = font.getStringWidth(lblRom);
}
if(useMinimalUI)
{
#if defined(RETRON77)
// App information
ostringstream ver;
ver << "Stella " << STELLA_VERSION << " for RetroN 77";
ypos += 8;
new StaticTextWidget(this, font, xpos, ypos, _w - 20, fontHeight,
ver.str(), TextAlign::Center);
ypos += fontHeight;
#endif
}
// Show the header
xpos = HBORDER; ypos += 8;
xpos += HBORDER; ypos += 8;
new StaticTextWidget(this, font, xpos, ypos, lblRom);
// Shop the files counter
xpos = _w - HBORDER - lwidth4;
myRomCount = new StaticTextWidget(this, font, xpos, ypos,
lwidth4, fontHeight,
"", TextAlign::Right);
// Add filter that can narrow the results shown in the listing
// It has to fit between both labels
if(w >= 640)
if(!useMinimalUI && w >= 640)
{
int fwidth = std::min(15 * fontWidth, xpos - lwidth3 - lwidth2 - lwidth - HBORDER - LBL_GAP * 8);
// Show the filter input field
@ -113,7 +131,7 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
xpos = HBORDER; ypos += lineHeight + 4;
int romWidth = 0;
int romSize = instance().settings().getInt("romviewer");
if(romSize > 1 && w >= 1000 && h >= 760)
if(romSize > 1 && w >= 1000 && h >= 720)
romWidth = 660;
else if(romSize > 0 && w >= 640 && h >= 480)
romWidth = 365;
@ -146,41 +164,44 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
myDir->setEditable(false, true);
myDir->clearFlags(WIDGET_RETAIN_FOCUS);
// Add four buttons at the bottom
xpos = HBORDER; ypos += myDir->getHeight() + 8;
#ifndef BSPF_MACOS
myStartButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 0) / 4, bheight,
"Select", kLoadROMCmd);
wid.push_back(myStartButton);
xpos += (bwidth + 0) / 4 + BUTTON_GAP;
myPrevDirButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 1) / 4, bheight,
"Go Up", kPrevDirCmd);
wid.push_back(myPrevDirButton);
xpos += (bwidth + 1) / 4 + BUTTON_GAP;
myOptionsButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 2) / 4, bheight,
if(!useMinimalUI)
{
// Add four buttons at the bottom
xpos = HBORDER; ypos += myDir->getHeight() + 8;
#ifndef BSPF_MACOS
myStartButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 0) / 4, bheight,
"Select", kLoadROMCmd);
wid.push_back(myStartButton);
xpos += (bwidth + 0) / 4 + BUTTON_GAP;
myPrevDirButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 1) / 4, bheight,
"Go Up", kPrevDirCmd);
wid.push_back(myPrevDirButton);
xpos += (bwidth + 1) / 4 + BUTTON_GAP;
myOptionsButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 2) / 4, bheight,
"Options" + ELLIPSIS, kOptionsCmd);
wid.push_back(myOptionsButton);
xpos += (bwidth + 2) / 4 + BUTTON_GAP;
myQuitButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 3) / 4, bheight,
"Quit", kQuitCmd);
wid.push_back(myQuitButton);
#else
myQuitButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 0) / 4, bheight,
"Quit", kQuitCmd);
wid.push_back(myQuitButton);
xpos += (bwidth + 0) / 4 + BUTTON_GAP;
myOptionsButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 1) / 4, bheight,
"Options" + ELLIPSIS, kOptionsCmd);
wid.push_back(myOptionsButton);
xpos += (bwidth + 2) / 4 + BUTTON_GAP;
myQuitButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 3) / 4, bheight,
"Quit", kQuitCmd);
wid.push_back(myQuitButton);
#else
myQuitButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 0) / 4, bheight,
"Quit", kQuitCmd);
wid.push_back(myQuitButton);
xpos += (bwidth + 0) / 4 + BUTTON_GAP;
myOptionsButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 1) / 4, bheight,
"Options" + ELLIPSIS, kOptionsCmd);
wid.push_back(myOptionsButton);
xpos += (bwidth + 1) / 4 + BUTTON_GAP;
myPrevDirButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 2) / 4, bheight,
"Go Up", kPrevDirCmd);
wid.push_back(myPrevDirButton);
xpos += (bwidth + 2) / 4 + BUTTON_GAP;
myStartButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 3) / 4, bheight,
"Select", kLoadROMCmd);
wid.push_back(myStartButton);
#endif
wid.push_back(myOptionsButton);
xpos += (bwidth + 1) / 4 + BUTTON_GAP;
myPrevDirButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 2) / 4, bheight,
"Go Up", kPrevDirCmd);
wid.push_back(myPrevDirButton);
xpos += (bwidth + 2) / 4 + BUTTON_GAP;
myStartButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 3) / 4, bheight,
"Select", kLoadROMCmd);
wid.push_back(myStartButton);
#endif
}
mySelectedItem = 0; // Highlight 'Rom Listing'
// Create an options dialog, similar to the in-game one
@ -205,7 +226,8 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
// Do we show only ROMs or all files?
bool onlyROMs = instance().settings().getBool("launcherroms");
showOnlyROMs(onlyROMs);
myAllFiles->setState(!onlyROMs);
if(myAllFiles)
myAllFiles->setState(!onlyROMs);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -249,7 +271,8 @@ void LauncherDialog::loadConfig()
// has been called (and we should reload the list)
if(myList->getList().empty())
{
myPrevDirButton->setEnabled(false);
if(myPrevDirButton)
myPrevDirButton->setEnabled(false);
myCurrentNode = FilesystemNode(romdir == "" ? "~" : romdir);
if(!(myCurrentNode.exists() && myCurrentNode.isDirectory()))
myCurrentNode = FilesystemNode("~");
@ -278,7 +301,8 @@ void LauncherDialog::updateListing(const string& nameToSelect)
loadDirListing();
// Only hilite the 'up' button if there's a parent directory
myPrevDirButton->setEnabled(myCurrentNode.hasParent());
if(myPrevDirButton)
myPrevDirButton->setEnabled(myCurrentNode.hasParent());
// Show current directory
myDir->setText(myCurrentNode.getShortPath());
@ -455,7 +479,7 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd,
switch (cmd)
{
case kAllfilesCmd:
showOnlyROMs(!myAllFiles->getState());
showOnlyROMs(myAllFiles ? !myAllFiles->getState() : true);
updateListing();
break;
case kLoadROMCmd:

View File

@ -152,7 +152,7 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent,
ypos += lineHeight + V_GAP;
// Launcher font
pwidth = font.getStringWidth("2x (1000x760)");
pwidth = font.getStringWidth("2x (1000x720)");
items.clear();
VarList::push_back(items, "Small", "small");
VarList::push_back(items, "Medium", "medium");
@ -167,7 +167,7 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent,
items.clear();
VarList::push_back(items, "Off", "0");
VarList::push_back(items, "1x (640x480) ", "1");
VarList::push_back(items, "2x (1000x760)", "2");
VarList::push_back(items, "2x (1000x720)", "2");
myRomViewerPopup =
new PopUpWidget(myTab, font, xpos, ypos + 1, pwidth, lineHeight, items,
"ROM info viewer ", lwidth, kRomViewer);
@ -441,7 +441,7 @@ void UIDialog::handleRomViewer()
if(myLauncherWidthSlider->getValue() >= 1000 &&
myLauncherHeightSlider->getValue() >= 760)
{
VarList::push_back(items, "2x (1000x760)", "2");
VarList::push_back(items, "2x (1000x720)", "2");
}
myRomViewerPopup->addItems(items);

View File

@ -59,7 +59,8 @@ SettingsR77::SettingsR77()
setPermanent("romviewer", "2");
setPermanent("exitlauncher", "true");
setPermanent("dev.settings", "false");
setTemporary("minimal_ui", true);
setPermanent("dev.settings", false);
setPermanent("plr.timemachine", false);
// FIXME - these are out of date, since the # of events has changed since 3.x