summaryrefslogtreecommitdiffstats
path: root/src/script/cbottoken.cpp
diff options
context:
space:
mode:
authorkrzys-h <krzys_h@interia.pl>2013-05-19 16:56:08 +0200
committerkrzys-h <krzys_h@interia.pl>2013-05-19 16:56:08 +0200
commit6b25608e698cc117ffeeaa6454bd6fc1a72fdc50 (patch)
tree37c34ebfbf70b3e49f8de985a7f77ad4c93a5203 /src/script/cbottoken.cpp
parentb9d0ee034e1e0b78cbca137cc2f39930fb7ad127 (diff)
downloadcolobot-6b25608e698cc117ffeeaa6454bd6fc1a72fdc50.tar.gz
colobot-6b25608e698cc117ffeeaa6454bd6fc1a72fdc50.tar.bz2
colobot-6b25608e698cc117ffeeaa6454bd6fc1a72fdc50.zip
Added progfunc( funcname );
For simple creating of programs executing public functions :) Example: public void object::SecondBot() { message("It works!"); } extern void object::FirstBot() { object item = radar(BotFactory); item.factory(WheeledGrabber, progfunc("SecondBot")); }
Diffstat (limited to 'src/script/cbottoken.cpp')
-rw-r--r--src/script/cbottoken.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/script/cbottoken.cpp b/src/script/cbottoken.cpp
index bf29e1d..1747e5c 100644
--- a/src/script/cbottoken.cpp
+++ b/src/script/cbottoken.cpp
@@ -253,6 +253,7 @@ std::string GetHelpFilename(const char *token)
if ( strcmp(token, "getresearchenable" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/getresen.txt");
if ( strcmp(token, "getresearchdone" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/getresdo.txt");
if ( strcmp(token, "retobject" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/retobj.txt");
+ if ( strcmp(token, "progfunc" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/factory.txt");
if ( strcmp(token, "busy" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/busy.txt");
if ( strcmp(token, "factory" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/factory.txt");
if ( strcmp(token, "destroy" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/destroy.txt");
@@ -378,6 +379,7 @@ bool IsFunction(const char *token)
if ( strcmp(token, "getresearchdone" ) == 0 ) return true;
if ( strcmp(token, "retobjectbyid") == 0 ) return true;
if ( strcmp(token, "retobject" ) == 0 ) return true;
+ if ( strcmp(token, "progfunc" ) == 0 ) return true;
if ( strcmp(token, "busy" ) == 0 ) return true;
if ( strcmp(token, "factory" ) == 0 ) return true;
if ( strcmp(token, "destroy" ) == 0 ) return true;
@@ -469,6 +471,7 @@ const char* GetHelpText(const char *token)
if ( strcmp(token, "getresearchdone" ) == 0 ) return "getresearchdone ( );";
if ( strcmp(token, "retobject" ) == 0 ) return "retobject ( rank );";
if ( strcmp(token, "retobjectbyid") == 0 ) return "retobjectbyid ( rank );";
+ if ( strcmp(token, "progfunc" ) == 0 ) return "progfunc ( funcname );";
if ( strcmp(token, "busy" ) == 0 ) return "object.busy ( );";
if ( strcmp(token, "factory" ) == 0 ) return "object.factory ( cat, program );";
if ( strcmp(token, "destroy" ) == 0 ) return "object.destroy ( );";