game_text.hpp

Go to the documentation of this file.
00001 /* $Id: game_text.hpp 25818 2013-10-06 12:13:20Z frosch $ */
00002 
00003 /*
00004  * This file is part of OpenTTD.
00005  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
00006  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00007  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
00008  */
00009 
00012 #ifndef GAME_TEXT_HPP
00013 #define GAME_TEXT_HPP
00014 
00015 #include "../core/smallvec_type.hpp"
00016 
00018 static const uint GAME_TEXT_TAB = 18;
00019 
00020 const char *GetGameStringPtr(uint id);
00021 void RegisterGameTranslation(class Squirrel *engine);
00022 void ReconsiderGameScriptLanguage();
00023 
00025 struct LanguageStrings {
00026   const char *language; 
00027   StringList lines;     
00028 
00029   LanguageStrings(const char *language, const char *end = NULL);
00030   ~LanguageStrings();
00031 };
00032 
00034 struct GameStrings {
00035   uint version;                  
00036   LanguageStrings *cur_language; 
00037 
00038   AutoDeleteSmallVector<LanguageStrings *, 4> raw_strings;      
00039   AutoDeleteSmallVector<LanguageStrings *, 4> compiled_strings; 
00040   StringList string_names;                                      
00041 
00042   void Compile();
00043 };
00044 
00045 #endif /* GAME_TEXT_HPP */