forked from len0rd/rockbox
rbutil: extend game file installation
RbUtil will now install freely distributable data files for Duke Nukem 3D, Quake, SGT-Puzzles (fonts), Wolfenstein 3-D, and Another World. Currently the urls point to my personal server, pending upload to the main download server. Change-Id: I2806fd1ad7e9bb0fcb7aee5444840708e6e63032
This commit is contained in:
parent
ec8b3d3147
commit
26b55ba5f0
4 changed files with 50 additions and 7 deletions
|
|
@ -483,22 +483,51 @@ void SelectiveInstallWidget::installThemes(void)
|
|||
}
|
||||
}
|
||||
|
||||
static const struct {
|
||||
const char *name;
|
||||
const char *pluginpath;
|
||||
SystemInfo::SystemInfos zipurl; // add new games to SystemInfo
|
||||
} GamesList[] = {
|
||||
{ "Doom", "/.rockbox/rocks/games/doom.rock", SystemInfo::DoomUrl },
|
||||
{ "Duke3D", "/.rockbox/rocks/games/duke3d.rock", SystemInfo::Duke3DUrl },
|
||||
{ "Quake", "/.rockbox/rocks/games/quake.rock", SystemInfo::QuakeUrl },
|
||||
{ "Puzzles fonts", "/.rockbox/rocks/games/sgt-blackbox.rock", SystemInfo::PuzzFontsUrl },
|
||||
{ "Wolf3D", "/.rockbox/rocks/games/wolf3d.rock", SystemInfo::Wolf3DUrl },
|
||||
{ "XWorld", "/.rockbox/rocks/games/xworld.rock", SystemInfo::XWorldUrl },
|
||||
};
|
||||
|
||||
void SelectiveInstallWidget::installGamefiles(void)
|
||||
{
|
||||
if(ui.gamefileCheckbox->isChecked()) {
|
||||
// check if installed Rockbox has doom plugin. If not disable doom.
|
||||
if(!QFileInfo(m_mountpoint + "/.rockbox/rocks/games/doom.rock").exists()) {
|
||||
m_logger->addItem(tr("Your installation doesn't require game files, skipping."), LOGINFO);
|
||||
emit installSkipped(false);
|
||||
// build a list of zip urls that we need, then install
|
||||
QStringList gameUrls;
|
||||
QStringList gameNames;
|
||||
|
||||
for(unsigned int i = 0; i < sizeof(GamesList) / sizeof(GamesList[0]); i++)
|
||||
{
|
||||
// check if installed Rockbox has this plugin.
|
||||
if(QFileInfo(m_mountpoint + GamesList[i].pluginpath).exists()) {
|
||||
gameNames.append(GamesList[i].name);
|
||||
gameUrls.append(SystemInfo::value(GamesList[i].zipurl).toString());
|
||||
LOG_INFO() << gameUrls.at(gameUrls.size() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
if(gameUrls.size() == 0)
|
||||
{
|
||||
m_logger->addItem(tr("Your installation doesn't require any game files, skipping."), LOGINFO);
|
||||
emit installSkipped(false);
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_INFO() << "installing gamefiles";
|
||||
|
||||
// create new zip installer
|
||||
if(m_zipinstaller != NULL) m_zipinstaller->deleteLater();
|
||||
m_zipinstaller = new ZipInstaller(this);
|
||||
|
||||
m_zipinstaller->setUrl(SystemInfo::value(SystemInfo::DoomUrl).toString());
|
||||
m_zipinstaller->setLogSection("Game Addons");
|
||||
m_zipinstaller->setUrl(gameUrls);
|
||||
m_zipinstaller->setLogSection(gameNames);
|
||||
m_zipinstaller->setLogVersion();
|
||||
m_zipinstaller->setMountPoint(m_mountpoint);
|
||||
if(!RbSettings::value(RbSettings::CacheDisabled).toBool())
|
||||
|
|
@ -523,4 +552,3 @@ void SelectiveInstallWidget::changeEvent(QEvent *e)
|
|||
QWidget::changeEvent(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue