summaryrefslogtreecommitdiff
path: root/src/newgrf_config.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-11-18 14:40:57 +0000
committerfrosch <frosch@openttd.org>2011-11-18 14:40:57 +0000
commit0d901d599f1c492006bd6e5a0aba96a76b42d765 (patch)
tree9c761b85e9f85890fb07a345494c206e0eccfcb7 /src/newgrf_config.cpp
parentb725913f3b57110e18114f1f316e810d1d807e35 (diff)
downloadopenttd-0d901d599f1c492006bd6e5a0aba96a76b42d765.tar.xz
(svn r23249) -Feature: Also allow viewing of the other two textfiles supplied by BaNaNaS tars, i.e. changelog and license.
Diffstat (limited to 'src/newgrf_config.cpp')
-rw-r--r--src/newgrf_config.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp
index 026b62ff3..de4462879 100644
--- a/src/newgrf_config.cpp
+++ b/src/newgrf_config.cpp
@@ -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;