(svn r23490) -Add [FS#2750]: OpenBrowser function to open a browser on major OSes

This commit is contained in:
yexo
2011-12-11 11:47:08 +00:00
parent 0143f00d6f
commit b4fdba2fb3
4 changed files with 34 additions and 0 deletions

View File

@@ -359,6 +359,15 @@ void MakeNewgameSettingsLive()
}
}
void OpenBrowser(const char *url)
{
/* Make sure we only accept urls that are sure to open a browser. */
if (strstr(url, "http://") != url && strstr(url, "https://") != url) return;
extern void OSOpenBrowser(const char *url);
OSOpenBrowser(url);
}
/** Callback structure of statements to be executed after the NewGRF scan. */
struct AfterNewGRFScan : NewGRFScanCallback {
Year startyear; ///< The start year.