Browse Source

Merge pull request #7462 from karroffel/error_code

expose OS.set_exit_code and OS.get_exit_code to ClassDB
Rémi Verschelde 8 years ago
parent
commit
9856843717
2 changed files with 16 additions and 0 deletions
  1. 13 0
      core/bind/core_bind.cpp
  2. 3 0
      core/bind/core_bind.h

+ 13 - 0
core/bind/core_bind.cpp

@@ -553,6 +553,16 @@ void _OS::set_icon(const Image& p_icon) {
 	OS::get_singleton()->set_icon(p_icon);
 	OS::get_singleton()->set_icon(p_icon);
 }
 }
 
 
+int _OS::get_exit_code() const {
+
+	return OS::get_singleton()->get_exit_code();
+}
+
+void _OS::set_exit_code(int p_code) {
+
+	OS::get_singleton()->set_exit_code(p_code);
+}
+
 /**
 /**
  *  Get current datetime with consideration for utc and
  *  Get current datetime with consideration for utc and
  *     dst
  *     dst
@@ -1112,6 +1122,9 @@ void _OS::_bind_methods() {
 
 
 	ClassDB::bind_method(_MD("set_icon","icon"),&_OS::set_icon);
 	ClassDB::bind_method(_MD("set_icon","icon"),&_OS::set_icon);
 
 
+	ClassDB::bind_method(_MD("get_exit_code"),&_OS::get_exit_code);
+	ClassDB::bind_method(_MD("set_exit_code","code"),&_OS::set_exit_code);
+
 	ClassDB::bind_method(_MD("delay_usec","usec"),&_OS::delay_usec);
 	ClassDB::bind_method(_MD("delay_usec","usec"),&_OS::delay_usec);
 	ClassDB::bind_method(_MD("delay_msec","msec"),&_OS::delay_msec);
 	ClassDB::bind_method(_MD("delay_msec","msec"),&_OS::delay_msec);
 	ClassDB::bind_method(_MD("get_ticks_msec"),&_OS::get_ticks_msec);
 	ClassDB::bind_method(_MD("get_ticks_msec"),&_OS::get_ticks_msec);

+ 3 - 0
core/bind/core_bind.h

@@ -246,6 +246,9 @@ public:
 	void set_use_file_access_save_and_swap(bool p_enable);
 	void set_use_file_access_save_and_swap(bool p_enable);
 
 
 	void set_icon(const Image& p_icon);
 	void set_icon(const Image& p_icon);
+
+	int get_exit_code() const;
+	void set_exit_code(int p_code);
 	Dictionary get_date(bool utc) const;
 	Dictionary get_date(bool utc) const;
 	Dictionary get_time(bool utc) const;
 	Dictionary get_time(bool utc) const;
 	Dictionary get_datetime(bool utc) const;
 	Dictionary get_datetime(bool utc) const;