1 // ============================================================== 2 // This file is part of Glest (www.glest.org) 3 // 4 // Copyright (C) 2001-2008 Marti�o Figueroa 5 // 6 // You can redistribute this code and/or modify it under 7 // the terms of the GNU General Public License as published 8 // by the Free Software Foundation; either version 2 of the 9 // License, or (at your option) any later version 10 // ============================================================== 11 12 #include "game_util.h" 13 14 #include "util.h" 15 #include "lang.h" 16 #include "game_constants.h" 17 #include "config.h" 18 #include "leak_dumper.h" 19 20 using namespace Shared::Util; 21 22 namespace Glest{ namespace Game{ 23 24 const string mailString= "contact_game@glest.org"; 25 const string glestVersionString= "v3.2.2"; 26 getCrashDumpFileName()27string getCrashDumpFileName(){ 28 return "glest"+glestVersionString+".dmp"; 29 } 30 getNetworkVersionString()31string getNetworkVersionString(){ 32 return glestVersionString + " - " + string(__DATE__) + " - " + string(__TIME__); 33 } 34 getAboutString1(int i)35string getAboutString1(int i){ 36 switch(i){ 37 case 0: return "Glest " + glestVersionString + " (" + "Shared Library " + sharedLibVersionString + ")"; 38 case 1: return "Built: " + string(__DATE__); 39 case 2: return "Copyright 2001-2009 The Glest Team"; 40 } 41 return ""; 42 } 43 getAboutString2(int i)44string getAboutString2(int i){ 45 switch(i){ 46 case 0: return "Web: http://glest.org"; 47 case 1: return "Mail: " + mailString; 48 case 2: return "Irc: irc://irc.freenode.net/glest"; 49 } 50 return ""; 51 } 52 getTeammateName(int i)53string getTeammateName(int i){ 54 switch(i){ 55 case 0: return "Marti�o Figueroa"; 56 case 1: return "Jos� Luis Gonz�lez"; 57 case 2: return "Tucho Fern�ndez"; 58 case 3: return "Jos� Zanni"; 59 case 4: return "F�lix Men�ndez"; 60 case 5: return "Marcos Caruncho"; 61 case 6: return "Matthias Braun"; 62 } 63 return ""; 64 } 65 getTeammateRole(int i)66string getTeammateRole(int i){ 67 Lang &l= Lang::getInstance(); 68 69 switch(i){ 70 case 0: return l.get("Programming"); 71 case 1: return l.get("SoundAndMusic"); 72 case 2: return l.get("3dAnd2dArt"); 73 case 3: return l.get("2dArtAndWeb"); 74 case 4: return l.get("Animation"); 75 case 5: return l.get("3dArt"); 76 case 6: return l.get("LinuxPort"); 77 } 78 return ""; 79 } 80 formatString(const string & str)81string formatString(const string &str){ 82 string outStr = str; 83 84 if(!outStr.empty()){ 85 outStr[0]= toupper(outStr[0]); 86 } 87 88 bool afterSeparator= false; 89 for(int i= 0; i<str.size(); ++i){ 90 if(outStr[i]=='_'){ 91 outStr[i]= ' '; 92 } 93 else if(afterSeparator){ 94 outStr[i]= toupper(outStr[i]); 95 afterSeparator= false; 96 } 97 if(outStr[i]=='\n' || outStr[i]=='(' || outStr[i]==' '){ 98 afterSeparator= true; 99 } 100 } 101 return outStr; 102 } 103 104 }}//end namespace 105