From: <geo...@us...> - 2007-05-26 02:57:03
|
Revision: 2060 http://svn.sourceforge.net/freeorion/revision/?rev=2060&view=rev Author: geoffthemedio Date: 2007-05-25 19:57:04 -0700 (Fri, 25 May 2007) Log Message: ----------- -Created new AI directory in /default -Moved FreeOrionAI.py to /default/AI -Made PythonAI locate FreeOrionAI.py in /default/AI using GetGlobalDir() which will also work on Linux (presumably) -Added a few tech icons -Updated MSVC project file for above change in location of FreeOrinAI.py -Single character change in comments of Directories.h Modified Paths: -------------- trunk/FreeOrion/AI/PythonAI.cpp trunk/FreeOrion/msvc2005/FreeOrion/freeorionca/freeorionca.vcproj trunk/FreeOrion/util/Directories.h Added Paths: ----------- trunk/FreeOrion/default/AI/ trunk/FreeOrion/default/AI/FreeOrionAI.py trunk/FreeOrion/default/data/art/tech_icons/Genome_Bank.png trunk/FreeOrion/default/data/art/tech_icons/Habitation_Domes.png trunk/FreeOrion/default/data/art/tech_icons/Urban_Farming.png Removed Paths: ------------- trunk/FreeOrion/AI/FreeOrionAI.py Deleted: trunk/FreeOrion/AI/FreeOrionAI.py =================================================================== --- trunk/FreeOrion/AI/FreeOrionAI.py 2007-05-26 02:25:31 UTC (rev 2059) +++ trunk/FreeOrion/AI/FreeOrionAI.py 2007-05-26 02:57:04 UTC (rev 2060) @@ -1,9 +0,0 @@ -import foaiint - -def InitFreeOrionAI(): - foaiint.LogOutput("Initialized FreeOrion Python AI") - -def GenerateOrders(): - foaiint.DoneTurn() - foaiint.SendChatMessage(0, "Sending chat message from within Python!") - foaiint.LogOutput("Generated Orders") \ No newline at end of file Modified: trunk/FreeOrion/AI/PythonAI.cpp =================================================================== --- trunk/FreeOrion/AI/PythonAI.cpp 2007-05-26 02:25:31 UTC (rev 2059) +++ trunk/FreeOrion/AI/PythonAI.cpp 2007-05-26 02:57:04 UTC (rev 2060) @@ -1,5 +1,6 @@ #include "PythonAI.h" #include "../util/AppInterface.h" +#include "../util/Directories.h" #include <boost/python.hpp> @@ -50,8 +51,8 @@ } // tell Python the path in which to locate AI script file - std::string AI_DIR("C:\\FreeOrion\\AI"); - std::string python_path_command = "sys.path.append('" + AI_DIR + "')"; + std::string AI_path = (GetGlobalDir() / "default" / "AI").native_directory_string(); + std::string python_path_command = "sys.path.append('" + AI_path + "')"; try { handle = PyHANDLE(PyRun_String(python_path_command.c_str(), Py_file_input, dict.ptr(), dict.ptr())); } catch (PyERROR err) { Added: trunk/FreeOrion/default/AI/FreeOrionAI.py =================================================================== --- trunk/FreeOrion/default/AI/FreeOrionAI.py (rev 0) +++ trunk/FreeOrion/default/AI/FreeOrionAI.py 2007-05-26 02:57:04 UTC (rev 2060) @@ -0,0 +1,9 @@ +import foaiint + +def InitFreeOrionAI(): + foaiint.LogOutput("Initialized FreeOrion Python AI") + +def GenerateOrders(): + foaiint.DoneTurn() + foaiint.SendChatMessage(0, "Sending chat message from within Python!") + foaiint.LogOutput("Generated Orders") \ No newline at end of file Added: trunk/FreeOrion/default/data/art/tech_icons/Genome_Bank.png =================================================================== (Binary files differ) Property changes on: trunk/FreeOrion/default/data/art/tech_icons/Genome_Bank.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/FreeOrion/default/data/art/tech_icons/Habitation_Domes.png =================================================================== (Binary files differ) Property changes on: trunk/FreeOrion/default/data/art/tech_icons/Habitation_Domes.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/FreeOrion/default/data/art/tech_icons/Urban_Farming.png =================================================================== (Binary files differ) Property changes on: trunk/FreeOrion/default/data/art/tech_icons/Urban_Farming.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/FreeOrion/msvc2005/FreeOrion/freeorionca/freeorionca.vcproj =================================================================== --- trunk/FreeOrion/msvc2005/FreeOrion/freeorionca/freeorionca.vcproj 2007-05-26 02:25:31 UTC (rev 2059) +++ trunk/FreeOrion/msvc2005/FreeOrion/freeorionca/freeorionca.vcproj 2007-05-26 02:57:04 UTC (rev 2060) @@ -714,7 +714,7 @@ > </File> <File - RelativePath="..\..\..\AI\FreeOrionAI.py" + RelativePath="..\..\..\default\AI\FreeOrionAI.py" > </File> <File Modified: trunk/FreeOrion/util/Directories.h =================================================================== --- trunk/FreeOrion/util/Directories.h 2007-05-26 02:25:31 UTC (rev 2059) +++ trunk/FreeOrion/util/Directories.h 2007-05-26 02:57:04 UTC (rev 2060) @@ -12,7 +12,7 @@ /** This function returns the directory where FreeOrion should store user specific data, like the configuration file and savegames. Under Unix, this would be <tt>~/.freeorion</tt>, under Windows, this might be something along the lines - of <tt>C:\\Documents and settings\\Username\\FreeOrion</tt> or even + of <tt>C:\\Documents and Settings\\Username\\FreeOrion</tt> or even <tt>\\\\Gandalf\\Users\\Frodo\\Settings\\FreeOrion</tt>. \note <ul><li> If the directory does not exist, it will be created.<li>This directory is the only one that can be considered writable!</ul> */ |