(svn r23249) -Feature: Also allow viewing of the other two textfiles supplied by BaNaNaS tars, i.e. changelog and license.

This commit is contained in:
frosch
2011-11-18 14:40:57 +00:00
parent b725913f3b
commit 0d901d599f
4 changed files with 61 additions and 22 deletions

View File

@@ -834,11 +834,19 @@ bool GRFConfig::IsOpenTTDBaseGRF() const
/**
* Search a textfile file next to this NewGRF.
* @param type The type of the textfile to search for.
* @return The filename for the textfile, \c NULL otherwise.
*/
const char *GRFConfig::GetTextfile() const
const char *GRFConfig::GetTextfile(TextfileType type) const
{
static const char prefix[] = "readme";
static const char * const prefixes[] = {
"readme",
"changelog",
"license",
};
assert_compile(lengthof(prefixes) == TFT_END);
const char *prefix = prefixes[type];
if (this->filename == NULL) return NULL;