summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/array.cpp20
-rw-r--r--core/array.h4
-rw-r--r--core/object.cpp9
-rw-r--r--core/os/input.cpp2
-rw-r--r--core/os/os.h1
-rw-r--r--core/script_debugger_remote.cpp3
-rw-r--r--core/ustring.cpp2
-rw-r--r--core/ustring.h2
-rw-r--r--core/variant_call.cpp4
9 files changed, 35 insertions, 12 deletions
diff --git a/core/array.cpp b/core/array.cpp
index 23792f90fc..683a43e3d0 100644
--- a/core/array.cpp
+++ b/core/array.cpp
@@ -276,16 +276,26 @@ void Array::push_front(const Variant& p_value) {
_p->array.insert(0,p_value);
}
-void Array::pop_back(){
+Variant Array::pop_back(){
- if (!_p->array.empty())
- _p->array.resize( _p->array.size() -1 );
+ if (!_p->array.empty()) {
+ int n = _p->array.size() - 1;
+ Variant ret = _p->array.get(n);
+ _p->array.resize(n);
+ return ret;
+ }
+ return Variant();
}
-void Array::pop_front(){
- if (!_p->array.empty())
+Variant Array::pop_front(){
+
+ if (!_p->array.empty()) {
+ Variant ret = _p->array.get(0);
_p->array.remove(0);
+ return ret;
+ }
+ return Variant();
}
diff --git a/core/array.h b/core/array.h
index dfc902525c..eb79b0cf33 100644
--- a/core/array.h
+++ b/core/array.h
@@ -80,8 +80,8 @@ public:
void erase(const Variant& p_value);
void push_front(const Variant& p_value);
- void pop_back();
- void pop_front();
+ Variant pop_back();
+ Variant pop_front();
Array(const Array& p_from);
Array(bool p_shared=false);
diff --git a/core/object.cpp b/core/object.cpp
index 8cd4e07097..9a1e9be8d5 100644
--- a/core/object.cpp
+++ b/core/object.cpp
@@ -1215,6 +1215,15 @@ void Object::emit_signal(const StringName& p_name,const Variant** p_args,int p_a
Signal *s = signal_map.getptr(p_name);
if (!s) {
+#ifdef DEBUG_ENABLED
+ bool signal_is_valid = ObjectTypeDB::has_signal(get_type_name(),p_name);
+ //check in script
+ if (!signal_is_valid && !script.is_null() && !Ref<Script>(script)->has_script_signal(p_name)) {
+ ERR_EXPLAIN("Can't emit non-existing signal " + String("\"")+p_name+"\".");
+ ERR_FAIL();
+ }
+#endif
+ //not connected? just return
return;
}
diff --git a/core/os/input.cpp b/core/os/input.cpp
index 88c17740b1..4ab57a84ea 100644
--- a/core/os/input.cpp
+++ b/core/os/input.cpp
@@ -94,7 +94,7 @@ void Input::get_argument_options(const StringName& p_function,int p_idx,List<Str
#ifdef TOOLS_ENABLED
String pf=p_function;
- if (p_idx==0 && (pf=="is_action_pressed" || pf=="action_press" || pf=="action_release")) {
+ if (p_idx==0 && (pf=="is_action_pressed" || pf=="action_press" || pf=="action_release" || pf=="is_action_just_pressed" || pf=="is_action_just_released")) {
List<PropertyInfo> pinfo;
Globals::get_singleton()->get_property_list(&pinfo);
diff --git a/core/os/os.h b/core/os/os.h
index 8e9293b3c8..c2b46a5420 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -372,6 +372,7 @@ public:
virtual void set_screen_orientation(ScreenOrientation p_orientation);
ScreenOrientation get_screen_orientation() const;
+ virtual void enable_for_stealing_focus(ProcessID pid) {}
virtual void move_window_to_foreground() {}
virtual void debug_break();
diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp
index 1ac0907967..6d685d3c43 100644
--- a/core/script_debugger_remote.cpp
+++ b/core/script_debugger_remote.cpp
@@ -134,6 +134,8 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script,bool p_can_continue) {
ERR_FAIL();
}
+ OS::get_singleton()->enable_for_stealing_focus(Globals::get_singleton()->get("editor_pid"));
+
packet_peer_stream->put_var("debug_enter");
packet_peer_stream->put_var(2);
packet_peer_stream->put_var(p_can_continue);
@@ -273,6 +275,7 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script,bool p_can_continue) {
set_depth(-1);
set_lines_left(-1);
+ OS::get_singleton()->move_window_to_foreground();
break;
} else if (command=="break") {
ERR_PRINT("Got break when already broke!");
diff --git a/core/ustring.cpp b/core/ustring.cpp
index 0d887210c3..f7dcba6b14 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -3173,7 +3173,7 @@ bool String::is_valid_identifier() const {
//kind of poor should be rewritten properly
-String String::world_wrap(int p_chars_per_line) const {
+String String::word_wrap(int p_chars_per_line) const {
int from=0;
int last_space=0;
diff --git a/core/ustring.h b/core/ustring.h
index bb57b11d88..09d13a9e64 100644
--- a/core/ustring.h
+++ b/core/ustring.h
@@ -218,7 +218,7 @@ public:
String c_escape() const;
String c_unescape() const;
String json_escape() const;
- String world_wrap(int p_chars_per_line) const;
+ String word_wrap(int p_chars_per_line) const;
String percent_encode() const;
String percent_decode() const;
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index 5f052bce8e..a84eed4d88 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -465,8 +465,8 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var
VCALL_LOCALMEM0R(Array,hash);
VCALL_LOCALMEM1(Array,push_back);
VCALL_LOCALMEM1(Array,push_front);
- VCALL_LOCALMEM0(Array,pop_back);
- VCALL_LOCALMEM0(Array,pop_front);
+ VCALL_LOCALMEM0R(Array,pop_back);
+ VCALL_LOCALMEM0R(Array,pop_front);
VCALL_LOCALMEM1(Array,append);
VCALL_LOCALMEM1(Array,resize);
VCALL_LOCALMEM2(Array,insert);