diff options
author | frosch <frosch@openttd.org> | 2012-03-17 15:45:37 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-03-17 15:45:37 +0000 |
commit | 161b6c348b5db6b4177ab5d2eb47607e1b706035 (patch) | |
tree | 74baa5720eecf1a556f31e7ed21996d8c42cc5b1 /src/base_media_base.h | |
parent | 2c956cac800b3c26ddcd8e2ecd2f0895982557c0 (diff) | |
download | openttd-161b6c348b5db6b4177ab5d2eb47607e1b706035.tar.xz |
(svn r24037) -Feature: Allow display of baseset textfiles. (LordAro)
Diffstat (limited to 'src/base_media_base.h')
-rw-r--r-- | src/base_media_base.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/base_media_base.h b/src/base_media_base.h index a5556f12b..828ae797e 100644 --- a/src/base_media_base.h +++ b/src/base_media_base.h @@ -15,6 +15,8 @@ #include "fileio_func.h" #include "core/smallmap_type.hpp" #include "gfx_type.h" +#include "textfile_type.h" +#include "textfile_gui.h" /* Forward declare these; can't do 'struct X' in functions as older GCCs barf on that */ struct IniFile; @@ -143,6 +145,22 @@ struct BaseSet { { return file->CheckMD5(subdir, SIZE_MAX); } + + /** + * Search a textfile file next to this base media. + * @param type The type of the textfile to search for. + * @return The filename for the textfile, \c NULL otherwise. + */ + const char *GetTextfile(TextfileType type) const + { + for (uint i = 0; i < NUM_FILES; i++) { + const char *textfile = ::GetTextfile(type, BASESET_DIR, this->files[i].filename); + if (textfile != NULL) { + return textfile; + } + } + return NULL; + } }; /** |