5 #include "textscroller.hpp"
6 #include "functions.hpp"
7 #include "script_interpreter.hpp"
8 #include "tinygettext/tinygettext.hpp"
9 #include "resources.hpp"
10 #include "gettext.hpp"
12 #include "mainloop.hpp"
17 void wait(float seconds)
19 ScriptInterpreter::current()->set_wakeup_time(seconds);
22 std::string translate(const std::string& text)
24 return dictionary_manager.get_dictionary().translate(text);
27 void display_text_file(const std::string& filename)
30 = ScriptInterpreter::current()->get_working_directory() + filename;
31 main_loop->push_screen(new TextScroller(file));
34 void import(HSQUIRRELVM v, const std::string& filename)
37 = ScriptInterpreter::current()->get_working_directory() + filename;
38 if(sqstd_loadfile(v, file.c_str(), true) < 0) {
39 msg_warning << "couldn't load script '" << filename << "' (" << file << ")" << std::endl;
44 if(sq_call(v, 1, false) < 0) {
45 msg_warning << "Couldn't execute script '" << filename << "' (" << file << ")" << std::endl;
50 void add_key(int new_key)
52 player_status->set_keys(new_key);