Changeset - r18336:f5d99f393cb2
[Not reviewed]
master
0 1 0
yexo - 13 years ago 2011-11-10 18:07:56
yexo@openttd.org
(svn r23182) -Feature: allow translatable readme files
1 file changed with 7 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/newgrf_config.cpp
Show inline comments
 
@@ -19,6 +19,7 @@
 
#include "window_func.h"
 
#include "progress.h"
 
#include "video/video_driver.hpp"
 
#include "strings_func.h"
 

	
 
#include "fileio_func.h"
 
#include "fios.h"
 
@@ -846,6 +847,12 @@ const char *GRFConfig::GetReadme() const
 
	char *slash = strrchr(readme_path, PATHSEPCHAR);
 
	if (slash == NULL) return NULL;
 

	
 
	seprintf(slash + 1, lastof(readme_path), "readme_%s.txt", GetCurrentLanguageIsoCode());
 
	if (FioCheckFileExists(readme_path, NEWGRF_DIR)) return readme_path;
 

	
 
	seprintf(slash + 1, lastof(readme_path), "readme_%.2s.txt", GetCurrentLanguageIsoCode());
 
	if (FioCheckFileExists(readme_path, NEWGRF_DIR)) return readme_path;
 

	
 
	strecpy(slash + 1, "readme.txt", lastof(readme_path));
 
	return FioCheckFileExists(readme_path, NEWGRF_DIR) ? readme_path : NULL;
 
}
0 comments (0 inline, 0 general)