|
@@ -576,6 +576,29 @@ Vector<String> _OS::get_cmdline_args() {
|
|
|
return cmdlinev;
|
|
|
}
|
|
|
|
|
|
+void _OS::set_restart_on_exit(bool p_restart, const Vector<String> &p_restart_arguments) {
|
|
|
+ List<String> args_list;
|
|
|
+ for (int i = 0; i < p_restart_arguments.size(); i++) {
|
|
|
+ args_list.push_back(p_restart_arguments[i]);
|
|
|
+ }
|
|
|
+
|
|
|
+ ::OS::get_singleton()->set_restart_on_exit(p_restart, args_list);
|
|
|
+}
|
|
|
+
|
|
|
+bool _OS::is_restart_on_exit_set() const {
|
|
|
+ return ::OS::get_singleton()->is_restart_on_exit_set();
|
|
|
+}
|
|
|
+
|
|
|
+Vector<String> _OS::get_restart_on_exit_arguments() const {
|
|
|
+ List<String> args = ::OS::get_singleton()->get_restart_on_exit_arguments();
|
|
|
+ Vector<String> args_vector;
|
|
|
+ for (List<String>::Element *E = args.front(); E; E = E->next()) {
|
|
|
+ args_vector.push_back(E->get());
|
|
|
+ }
|
|
|
+
|
|
|
+ return args_vector;
|
|
|
+}
|
|
|
+
|
|
|
String _OS::get_locale() const {
|
|
|
return OS::get_singleton()->get_locale();
|
|
|
}
|
|
@@ -1405,6 +1428,10 @@ void _OS::_bind_methods() {
|
|
|
ClassDB::bind_method(D_METHOD("get_name"), &_OS::get_name);
|
|
|
ClassDB::bind_method(D_METHOD("get_cmdline_args"), &_OS::get_cmdline_args);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_restart_on_exit", "restart", "arguments"), &_OS::set_restart_on_exit, DEFVAL(Vector<String>()));
|
|
|
+ ClassDB::bind_method(D_METHOD("is_restart_on_exit_set"), &_OS::is_restart_on_exit_set);
|
|
|
+ ClassDB::bind_method(D_METHOD("get_restart_on_exit_arguments"), &_OS::get_restart_on_exit_arguments);
|
|
|
+
|
|
|
ClassDB::bind_method(D_METHOD("get_datetime", "utc"), &_OS::get_datetime, DEFVAL(false));
|
|
|
ClassDB::bind_method(D_METHOD("get_date", "utc"), &_OS::get_date, DEFVAL(false));
|
|
|
ClassDB::bind_method(D_METHOD("get_time", "utc"), &_OS::get_time, DEFVAL(false));
|