Show a button on first run instead of taking the user directly to the plugin download screen. Ensures that the emu is usable even if the download would crash.

This commit is contained in:
Henrik Rydgard 2013-06-25 23:29:49 +02:00
parent 81c6e63fd6
commit 563cf1acfa
4 changed files with 18 additions and 8 deletions

View File

@ -184,6 +184,8 @@ void LogoScreen::render() {
// ==================
MenuScreen::MenuScreen() : frames_(0) {
// If first run, let's show the user an easy way to access the atrac3plus download screen.
showAtracShortcut_ = g_Config.bFirstRun && !Atrac3plus_Decoder::IsInstalled();
}
void MenuScreen::update(InputState &input_state) {
@ -275,6 +277,12 @@ void MenuScreen::render() {
}
}
if (showAtracShortcut_) {
if (UIButton(GEN_ID, Pos(10,dp_yres - 10), 500, 50, "Download audio plugin", ALIGN_BOTTOMLEFT)) {
screenManager()->push(new PluginScreen());
}
}
int recentW = 350;
if (g_Config.recentIsos.size()) {
ui_draw2d.DrawText(UBUNTU24, m->T("Recent"), -xoff, 80, 0xFFFFFFFF, ALIGN_BOTTOMLEFT);
@ -287,13 +295,19 @@ void MenuScreen::render() {
if (dp_yres < 480)
spacing = 8;
int extraSpace = 0;
if (showAtracShortcut_)
extraSpace = 60;
if (showAtracShortcut_)
// On small screens, we can't fit four vertically.
if (100 + spacing * 6 + textureButtonHeight * 4 > dp_yres) {
textureButtonHeight = (dp_yres - 100 - spacing * 6) / 4;
textureButtonWidth = (textureButtonHeight / 80) * 144;
}
VGrid vgrid_recent(-xoff, 100, std::min(dp_yres-spacing*2, 480), spacing, spacing);
VGrid vgrid_recent(-xoff, 100, std::min(dp_yres-spacing*2-extraSpace, 480), spacing, spacing);
for (size_t i = 0; i < g_Config.recentIsos.size(); i++) {
std::string filename;

View File

@ -50,6 +50,7 @@ public:
private:
int frames_;
bool showAtracShortcut_;
};
// Dialog box, meant to be pushed

View File

@ -373,13 +373,8 @@ void NativeInitGraphics() {
#if (defined(_WIN32) && (defined(_M_IX86) || defined(_M_X64))) || defined(ARMEABI) || defined(ARMEABI_V7A) || (defined(MACOSX) && defined(_M_IX64))
if (Atrac3plus_Decoder::CanAutoInstall()) {
Atrac3plus_Decoder::DoAutoInstall();
screenManager->switchScreen(new LogoScreen(boot_filename));
} else {
screenManager->switchScreen(new LogoScreen(boot_filename));
// If first run and can't autoinstall, let's send the user to the atrac3plus download screen.
if (g_Config.bFirstRun && !Atrac3plus_Decoder::IsInstalled())
screenManager->push(new PluginScreen());
}
screenManager->switchScreen(new LogoScreen(boot_filename));
#else
screenManager->switchScreen(new LogoScreen(boot_filename));
#endif

2
native

@ -1 +1 @@
Subproject commit 0c0b023058740f6b367a616fa69fd93002cd8305
Subproject commit c9e10892611df10426c3c84a3c1071674b015a8f