X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fscripting%2Ffunctions.cpp;h=a3c211a12a9db6cf5ff120c0f92132da0c781de0;hb=0676f7c09ab0d99e5b6a3bf74b9e2b62aaa885d4;hp=b0b9429a0ff19d327ecc59852c41fbaf8a5d1525;hpb=60908c905544776c376421b8d3e12eeb936c068f;p=supertux.git diff --git a/src/scripting/functions.cpp b/src/scripting/functions.cpp index b0b9429a0..a3c211a12 100644 --- a/src/scripting/functions.cpp +++ b/src/scripting/functions.cpp @@ -1,13 +1,31 @@ #include +#include +#include +#include "textscroller.h" #include "functions.h" +#include "script_interpreter.h" +#include "tinygettext/tinygettext.h" +#include "resources.h" +#include "gettext.h" namespace Scripting { -void wait(float secs) +void set_wakeup_time(float seconds) { - (void) secs; - printf("Wait not implemented.\n"); + ScriptInterpreter::current()->set_wakeup_time(seconds); +} + +std::string translate(const std::string& text) +{ + return dictionary_manager.get_dictionary().translate(text); +} + +void display_text_file(const std::string& filename) +{ + std::string file + = ScriptInterpreter::current()->get_working_directory() + filename; + ::display_text_file(file); } }