summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/bind/core_bind.cpp21
-rw-r--r--core/bind/core_bind.h2
-rw-r--r--core/os/input.cpp1
-rw-r--r--core/os/input.h1
-rw-r--r--core/os/os.cpp24
-rw-r--r--core/os/os.h8
-rw-r--r--core/resource.cpp7
-rw-r--r--doc/base/classes.xml37
-rw-r--r--drivers/unix/os_unix.cpp4
-rw-r--r--main/input_default.cpp14
-rw-r--r--main/input_default.h3
-rw-r--r--modules/gdscript/gd_compiler.cpp1
-rw-r--r--platform/android/godot_android.cpp22
-rw-r--r--platform/android/java/src/org/godotengine/godot/Godot.java7
-rw-r--r--platform/android/java/src/org/godotengine/godot/GodotLib.java1
-rw-r--r--platform/android/java_glue.cpp11
-rw-r--r--platform/android/java_glue.h1
-rw-r--r--platform/android/os_android.cpp5
-rw-r--r--platform/android/os_android.h1
-rw-r--r--platform/windows/godot.manifest24
-rw-r--r--platform/windows/godot_res.rc3
-rw-r--r--platform/x11/detect.py2
-rw-r--r--scene/gui/color_picker.cpp45
-rw-r--r--scene/gui/color_picker.h1
-rw-r--r--scene/gui/control.cpp26
-rw-r--r--scene/gui/control.h4
-rw-r--r--scene/gui/line_edit.cpp9
-rw-r--r--scene/gui/popup.cpp4
-rw-r--r--scene/gui/rich_text_label.cpp4
-rw-r--r--scene/gui/text_edit.cpp58
-rw-r--r--scene/gui/text_edit.h5
-rw-r--r--scene/gui/tree.cpp1
-rw-r--r--scene/main/viewport.cpp35
-rw-r--r--scene/resources/default_theme/default_theme.cpp9
-rw-r--r--scene/resources/font.cpp6
-rw-r--r--scene/resources/font.h1
-rw-r--r--scene/resources/material.cpp2
-rw-r--r--scene/resources/theme.cpp15
-rw-r--r--servers/physics_2d/body_pair_2d_sw.cpp45
-rw-r--r--tools/editor/create_dialog.cpp3
-rw-r--r--tools/editor/editor_node.cpp11
-rw-r--r--tools/editor/editor_settings.cpp3
-rw-r--r--tools/editor/icons/SCsub2
-rw-r--r--tools/editor/io_plugins/editor_scene_import_plugin.cpp2
-rw-r--r--tools/editor/io_plugins/editor_texture_import_plugin.cpp2
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp48
-rw-r--r--tools/editor/plugins/script_editor_plugin.h2
-rw-r--r--tools/editor/plugins/shader_editor_plugin.cpp4
-rw-r--r--tools/editor/scene_tree_editor.cpp12
-rw-r--r--tools/editor/script_editor_debugger.cpp3
50 files changed, 407 insertions, 155 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 9df31124f8..9cc934bb6f 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -857,7 +857,6 @@ void _OS::print_all_textures_by_size() {
for(List<_OSCoreBindImg>::Element *E=imgs.front();E;E=E->next()) {
- print_line(E->get().path+" - "+String::humanize_size(E->get().vram)+" ("+E->get().size+") - total:"+String::humanize_size(total) );
total-=E->get().vram;
}
}
@@ -891,19 +890,6 @@ void _OS::print_resources_by_type(const Vector<String>& p_types) {
type_count[r->get_type()]++;
-
- print_line(r->get_type()+": "+r->get_path());
-
- List<String> metas;
- r->get_meta_list(&metas);
- for (List<String>::Element* me = metas.front(); me; me = me->next()) {
- print_line(" "+String(me->get()) + ": " + r->get_meta(me->get()));
- };
- }
-
- for(Map<String,int>::Element *E=type_count.front();E;E=E->next()) {
-
- print_line(E->key()+" count: "+itos(E->get()));
}
};
@@ -1016,6 +1002,11 @@ void _OS::alert(const String& p_alert,const String& p_title) {
OS::get_singleton()->alert(p_alert,p_title);
}
+Dictionary _OS::get_engine_version() const {
+
+ return OS::get_singleton()->get_engine_version();
+}
+
_OS *_OS::singleton=NULL;
void _OS::_bind_methods() {
@@ -1163,6 +1154,8 @@ void _OS::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_use_vsync","enable"),&_OS::set_use_vsync);
ObjectTypeDB::bind_method(_MD("is_vsnc_enabled"),&_OS::is_vsnc_enabled);
+ ObjectTypeDB::bind_method(_MD("get_engine_version"),&_OS::get_engine_version);
+
BIND_CONSTANT( DAY_SUNDAY );
BIND_CONSTANT( DAY_MONDAY );
BIND_CONSTANT( DAY_TUESDAY );
diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h
index 5bd427578a..b43c5246ed 100644
--- a/core/bind/core_bind.h
+++ b/core/bind/core_bind.h
@@ -315,6 +315,8 @@ public:
void set_use_vsync(bool p_enable);
bool is_vsnc_enabled() const;
+ Dictionary get_engine_version() const;
+
static _OS *get_singleton() { return singleton; }
_OS();
diff --git a/core/os/input.cpp b/core/os/input.cpp
index efbae57950..531db73838 100644
--- a/core/os/input.cpp
+++ b/core/os/input.cpp
@@ -66,6 +66,7 @@ void Input::_bind_methods() {
ObjectTypeDB::bind_method(_MD("stop_joy_vibration", "device"), &Input::stop_joy_vibration);
ObjectTypeDB::bind_method(_MD("get_accelerometer"),&Input::get_accelerometer);
ObjectTypeDB::bind_method(_MD("get_magnetometer"),&Input::get_magnetometer);
+ ObjectTypeDB::bind_method(_MD("get_gyroscope"),&Input::get_gyroscope);
//ObjectTypeDB::bind_method(_MD("get_mouse_pos"),&Input::get_mouse_pos); - this is not the function you want
ObjectTypeDB::bind_method(_MD("get_mouse_speed"),&Input::get_mouse_speed);
ObjectTypeDB::bind_method(_MD("get_mouse_button_mask"),&Input::get_mouse_button_mask);
diff --git a/core/os/input.h b/core/os/input.h
index d11703470b..16bcc0ff9a 100644
--- a/core/os/input.h
+++ b/core/os/input.h
@@ -82,6 +82,7 @@ public:
virtual Vector3 get_accelerometer()=0;
virtual Vector3 get_magnetometer()=0;
+ virtual Vector3 get_gyroscope()=0;
virtual void action_press(const StringName& p_action)=0;
virtual void action_release(const StringName& p_action)=0;
diff --git a/core/os/os.cpp b/core/os/os.cpp
index e501bc2eb5..284bcb30cb 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -32,6 +32,8 @@
#include "dir_access.h"
#include "globals.h"
#include "input.h"
+// For get_engine_version, could be removed if it's moved to a new Engine singleton
+#include "version.h"
OS* OS::singleton=NULL;
@@ -548,6 +550,28 @@ bool OS::is_vsnc_enabled() const{
return true;
}
+Dictionary OS::get_engine_version() const {
+
+ Dictionary dict;
+ dict["major"] = _MKSTR(VERSION_MAJOR);
+ dict["minor"] = _MKSTR(VERSION_MINOR);
+#ifdef VERSION_PATCH
+ dict["patch"] = _MKSTR(VERSION_PATCH);
+#else
+ dict["patch"] = "";
+#endif
+ dict["status"] = _MKSTR(VERSION_STATUS);
+ dict["revision"] = _MKSTR(VERSION_REVISION);
+
+ String stringver = String(dict["major"]) + "." + String(dict["minor"]);
+ if (dict["patch"] != "")
+ stringver += "." + String(dict["patch"]);
+ stringver += "-" + String(dict["status"]) + " (" + String(dict["revision"]) + ")";
+ dict["string"] = stringver;
+
+ return dict;
+}
+
OS::OS() {
last_error=NULL;
frames_drawn=0;
diff --git a/core/os/os.h b/core/os/os.h
index c291d09250..40f3989a55 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -186,14 +186,14 @@ public:
virtual void set_target_fps(int p_fps);
virtual float get_target_fps() const;
- virtual float get_frames_per_second() const { return _fps; };
+ virtual float get_frames_per_second() const { return _fps; }
virtual void set_keep_screen_on(bool p_enabled);
virtual bool is_keep_screen_on() const;
virtual void set_low_processor_usage_mode(bool p_enabled);
virtual bool is_in_low_processor_usage_mode() const;
- virtual String get_installed_templates_path() const { return ""; };
+ virtual String get_installed_templates_path() const { return ""; }
virtual String get_executable_path() const;
virtual Error execute(const String& p_path, const List<String>& p_arguments,bool p_blocking,ProcessID *r_child_id=NULL,String* r_pipe=NULL,int *r_exitcode=NULL)=0;
virtual Error kill(const ProcessID& p_pid)=0;
@@ -363,7 +363,7 @@ public:
virtual void set_screen_orientation(ScreenOrientation p_orientation);
ScreenOrientation get_screen_orientation() const;
- virtual void move_window_to_foreground() {};
+ virtual void move_window_to_foreground() {}
virtual void debug_break();
@@ -423,6 +423,8 @@ public:
virtual void set_use_vsync(bool p_enable);
virtual bool is_vsnc_enabled() const;
+ Dictionary get_engine_version() const;
+
bool is_hidpi_allowed() const { return _allow_hidpi; }
OS();
virtual ~OS();
diff --git a/core/resource.cpp b/core/resource.cpp
index b80ec7012d..e8d4069779 100644
--- a/core/resource.cpp
+++ b/core/resource.cpp
@@ -95,10 +95,9 @@ bool ResourceImportMetadata::has_option(const String& p_key) const {
return options.has(p_key);
}
+
Variant ResourceImportMetadata::get_option(const String& p_key) const {
- if (!options.has(p_key))
- print_line(p_key);
ERR_FAIL_COND_V(!options.has(p_key),Variant());
return options[p_key];
@@ -487,8 +486,6 @@ void ResourceCache::dump(const char* p_file,bool p_short) {
if (!p_short) {
if (f)
f->store_line(r->get_type()+": "+r->get_path());
- else
- print_line(r->get_type()+": "+r->get_path());
}
}
@@ -496,8 +493,6 @@ void ResourceCache::dump(const char* p_file,bool p_short) {
if (f)
f->store_line(E->key()+" count: "+itos(E->get()));
- else
- print_line(E->key()+" count: "+itos(E->get()));
}
if (f) {
f->close();
diff --git a/doc/base/classes.xml b/doc/base/classes.xml
index 50d550f6b2..5be3639d9f 100644
--- a/doc/base/classes.xml
+++ b/doc/base/classes.xml
@@ -8663,7 +8663,7 @@
<return type="bool">
</return>
<description>
- Returns whether this color picker is in raw mode or not
+ Returns whether this color picker is in raw mode or not, raw mode will allow the color R, G, B component values to go beyond 1, you have to consider that the max value for color components is 1, going beyond that value will not have effect in the color, but can be used for special operations that require it (like tinting without darkening or rendering sprites in HDR).
</description>
</method>
<method name="set_color">
@@ -8684,7 +8684,7 @@
<argument index="0" name="mode" type="bool">
</argument>
<description>
- When set to true, every color channel will be represented as a value from 0 to 1, insetead of 0, 255.
+ Set whether this color picker is using raw mode or not, see [method is_raw_mode].
</description>
</method>
</methods>
@@ -12999,6 +12999,11 @@
Return the font descent (number of pixels below the baseline).
</description>
</method>
+ <method name="update_changes">
+ <description>
+ After editing a font (changing size, ascent, char rects, etc.). Call this function to propagate changes to controls that might use it.
+ </description>
+ </method>
<method name="get_height" qualifiers="const">
<return type="float">
</return>
@@ -15797,6 +15802,13 @@
Returns an [Array] containing the device IDs of all currently connected joysticks.
</description>
</method>
+ <method name="get_gyroscope">
+ <return type="Vector3">
+ </return>
+ <description>
+ If the device has a gyroscope, this will return the rate of rotation in rad/s around a device's x, y, and z axis.
+ </description>
+ </method>
<method name="get_joy_axis">
<return type="float">
</return>
@@ -39234,6 +39246,20 @@
Set the text editor caret blink speed. Cannot be less then or equal to 0.
</description>
</method>
+ <method name="cursor_set_block_mode">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ Set the text editor caret to block mode.
+ </description>
+ </method>
+ <method name="cursor_is_block_mode" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ Gets whether the text editor caret is in block mode.
+ </description>
+ </method>
<method name="cursor_set_column">
<argument index="0" name="column" type="int">
</argument>
@@ -39479,6 +39505,11 @@
</method>
</methods>
<signals>
+ <signal name="breakpoint_toggled">
+ <description>
+ Emitted when a breakpoint is placed via the breakpoint gutter.
+ </description>
+ </signal>
<signal name="cursor_changed">
<description>
Emitted when the cursor changes.
@@ -39524,6 +39555,8 @@
</theme_item>
<theme_item name="breakpoint_color" type="Color">
</theme_item>
+ <theme_item name="caret_background_color" type="Color">
+ </theme_item>
<theme_item name="caret_color" type="Color">
</theme_item>
<theme_item name="completion" type="StyleBox">
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index 8cb7c7b698..fd515d6dd3 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -357,7 +357,6 @@ Error OS_Unix::execute(const String& p_path, const List<String>& p_arguments,boo
pid_t pid = fork();
ERR_FAIL_COND_V(pid<0,ERR_CANT_FORK);
- //print("execute: %s\n",p_path.utf8().get_data());
if (pid==0) {
@@ -394,8 +393,6 @@ Error OS_Unix::execute(const String& p_path, const List<String>& p_arguments,boo
pid_t rpid = waitpid(pid,&status,0);
if (r_exitcode)
*r_exitcode=WEXITSTATUS(status);
-
- print("returned: %i, waiting for: %i\n",rpid,pid);
} else {
if (r_child_id)
@@ -498,7 +495,6 @@ String OS_Unix::get_executable_path() const {
char buf[256];
memset(buf,0,256);
readlink("/proc/self/exe", buf, sizeof(buf));
- //print_line("Exec path is:"+String(buf));
String b;
b.parse_utf8(buf);
if (b=="") {
diff --git a/main/input_default.cpp b/main/input_default.cpp
index 945898f1f3..5e66a8b585 100644
--- a/main/input_default.cpp
+++ b/main/input_default.cpp
@@ -259,6 +259,12 @@ Vector3 InputDefault::get_magnetometer() {
return magnetometer;
}
+Vector3 InputDefault::get_gyroscope() {
+
+ _THREAD_SAFE_METHOD_
+ return gyroscope;
+}
+
void InputDefault::parse_input_event(const InputEvent& p_event) {
_THREAD_SAFE_METHOD_
@@ -386,6 +392,14 @@ void InputDefault::set_magnetometer(const Vector3& p_magnetometer) {
}
+void InputDefault::set_gyroscope(const Vector3& p_gyroscope) {
+
+ _THREAD_SAFE_METHOD_
+
+ gyroscope=p_gyroscope;
+
+}
+
void InputDefault::set_main_loop(MainLoop *p_main_loop) {
main_loop=p_main_loop;
diff --git a/main/input_default.h b/main/input_default.h
index 644af15e3b..cb71312e22 100644
--- a/main/input_default.h
+++ b/main/input_default.h
@@ -44,6 +44,7 @@ class InputDefault : public Input {
Map<StringName,int> custom_action_press;
Vector3 accelerometer;
Vector3 magnetometer;
+ Vector3 gyroscope;
Vector2 mouse_pos;
MainLoop *main_loop;
@@ -179,6 +180,7 @@ public:
virtual Vector3 get_accelerometer();
virtual Vector3 get_magnetometer();
+ virtual Vector3 get_gyroscope();
virtual Point2 get_mouse_pos() const;
virtual Point2 get_mouse_speed() const;
@@ -190,6 +192,7 @@ public:
void parse_input_event(const InputEvent& p_event);
void set_accelerometer(const Vector3& p_accel);
void set_magnetometer(const Vector3& p_magnetometer);
+ void set_gyroscope(const Vector3& p_gyroscope);
void set_joy_axis(int p_device,int p_axis,float p_value);
virtual void start_joy_vibration(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration=0);
diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp
index 304ed6b100..68c3dc98d3 100644
--- a/modules/gdscript/gd_compiler.cpp
+++ b/modules/gdscript/gd_compiler.cpp
@@ -1436,6 +1436,7 @@ Error GDCompiler::_parse_class(GDScript *p_script, GDScript *p_owner, const GDPa
p_script->member_functions.clear();
p_script->member_indices.clear();
p_script->member_info.clear();
+ p_script->_signals.clear();
p_script->initializer=NULL;
p_script->subclasses.clear();
diff --git a/platform/android/godot_android.cpp b/platform/android/godot_android.cpp
index 9f909d7041..2371274d9d 100644
--- a/platform/android/godot_android.cpp
+++ b/platform/android/godot_android.cpp
@@ -314,6 +314,7 @@ struct engine {
ASensorManager* sensorManager;
const ASensor* accelerometerSensor;
const ASensor* magnetometerSensor;
+ const ASensor* gyroscopeSensor;
ASensorEventQueue* sensorEventQueue;
bool display_active;
@@ -746,6 +747,15 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) {
engine->magnetometerSensor, (1000L/60)*1000);
}
+ // And the gyroscope.
+ if (engine->gyroscopeSensor != NULL) {
+ ASensorEventQueue_enableSensor(engine->sensorEventQueue,
+ engine->gyroscopeSensor);
+ // We'd like to get 60 events per second (in us).
+ ASensorEventQueue_setEventRate(engine->sensorEventQueue,
+ engine->gyroscopeSensor, (1000L/60)*1000);
+
+ }
engine->animating = 1;
break;
case APP_CMD_LOST_FOCUS:
@@ -759,6 +769,10 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) {
ASensorEventQueue_disableSensor(engine->sensorEventQueue,
engine->magnetometerSensor);
}
+ if (engine->gyroscopeSensor != NULL) {
+ ASensorEventQueue_disableSensor(engine->sensorEventQueue,
+ engine->gyroscopeSensor);
+ }
// Also stop animating.
engine->animating = 0;
engine_draw_frame(engine);
@@ -788,6 +802,8 @@ void android_main(struct android_app* state) {
ASENSOR_TYPE_ACCELEROMETER);
engine.magnetometerSensor = ASensorManager_getDefaultSensor(engine.sensorManager,
ASENSOR_TYPE_MAGNETIC_FIELD);
+ engine.gyroscopeSensor = ASensorManager_getDefaultSensor(engine.sensorManager,
+ ASENSOR_TYPE_GYROSCOPE);
engine.sensorEventQueue = ASensorManager_createEventQueue(engine.sensorManager,
state->looper, LOOPER_ID_USER, NULL, NULL);
@@ -828,7 +844,7 @@ void android_main(struct android_app* state) {
// If a sensor has data, process it now.
// LOGI("events\n");
if (ident == LOOPER_ID_USER) {
- if (engine.accelerometerSensor != NULL || engine.magnetometerSensor != NULL) {
+ if (engine.accelerometerSensor != NULL || engine.magnetometerSensor != NULL || engine.gyroscopeSensor != NULL) {
ASensorEvent event;
while (ASensorEventQueue_getEvents(engine.sensorEventQueue,
&event, 1) > 0) {
@@ -843,6 +859,10 @@ void android_main(struct android_app* state) {
engine.os->process_magnetometer(Vector3(event.magnetic.x, event.magnetic.y,
event.magnetic.z));
}
+ if (event.vector != NULL) {
+ engine.os->process_gyroscope(Vector3(event.vector.x, event.vector.y,
+ event.vector.z));
+ }
}
}
diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java
index 4c0f4878f5..4b80db7e33 100644
--- a/platform/android/java/src/org/godotengine/godot/Godot.java
+++ b/platform/android/java/src/org/godotengine/godot/Godot.java
@@ -217,6 +217,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
private SensorManager mSensorManager;
private Sensor mAccelerometer;
private Sensor mMagnetometer;
+ private Sensor mGyroscope;
public FrameLayout layout;
public RelativeLayout adLayout;
@@ -387,6 +388,8 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_GAME);
mMagnetometer = mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
mSensorManager.registerListener(this, mMagnetometer, SensorManager.SENSOR_DELAY_GAME);
+ mGyroscope = mSensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE);
+ mSensorManager.registerListener(this, mGyroscope, SensorManager.SENSOR_DELAY_GAME);
result_callback = null;
@@ -604,6 +607,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
mView.onResume();
mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_GAME);
mSensorManager.registerListener(this, mMagnetometer, SensorManager.SENSOR_DELAY_GAME);
+ mSensorManager.registerListener(this, mGyroscope, SensorManager.SENSOR_DELAY_GAME);
GodotLib.focusin();
if(use_immersive && Build.VERSION.SDK_INT >= 19.0){ // check if the application runs on an android 4.4+
Window window = getWindow();
@@ -670,6 +674,9 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
if (typeOfSensor == event.sensor.TYPE_MAGNETIC_FIELD) {
GodotLib.magnetometer(x,y,z);
}
+ if (typeOfSensor == event.sensor.TYPE_GYROSCOPE) {
+ GodotLib.gyroscope(x,y,z);
+ }
}
@Override public final void onAccuracyChanged(Sensor sensor, int accuracy) {
diff --git a/platform/android/java/src/org/godotengine/godot/GodotLib.java b/platform/android/java/src/org/godotengine/godot/GodotLib.java
index df181ae1bb..9a2ea7df10 100644
--- a/platform/android/java/src/org/godotengine/godot/GodotLib.java
+++ b/platform/android/java/src/org/godotengine/godot/GodotLib.java
@@ -52,6 +52,7 @@ public class GodotLib {
public static native void touch(int what,int pointer,int howmany, int[] arr);
public static native void accelerometer(float x, float y, float z);
public static native void magnetometer(float x, float y, float z);
+ public static native void gyroscope(float x, float y, float z);
public static native void key(int p_scancode, int p_unicode_char, boolean p_pressed);
public static native void joybutton(int p_device, int p_but, boolean p_pressed);
public static native void joyaxis(int p_device, int p_axis, float p_value);
diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp
index 45d02876ba..b9d178280c 100644
--- a/platform/android/java_glue.cpp
+++ b/platform/android/java_glue.cpp
@@ -653,6 +653,7 @@ static bool quit_request=false;
static Size2 new_size;
static Vector3 accelerometer;
static Vector3 magnetometer;
+static Vector3 gyroscope;
static HashMap<String,JNISingleton*> jni_singletons;
static jobject godot_io;
@@ -1093,6 +1094,8 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv * env, jo
os_android->process_magnetometer(magnetometer);
+ os_android->process_gyroscope(gyroscope);
+
if (os_android->main_loop_iterate()==true) {
jclass cls = env->FindClass("org/godotengine/godot/Godot");
@@ -1501,6 +1504,14 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_magnetometer(JNIEnv *
}
+JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_gyroscope(JNIEnv * env, jobject obj, jfloat x, jfloat y, jfloat z) {
+
+ input_mutex->lock();
+ gyroscope=Vector3(x,y,z);
+ input_mutex->unlock();
+
+}
+
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_focusin(JNIEnv * env, jobject obj){
if (!suspend_mutex)
diff --git a/platform/android/java_glue.h b/platform/android/java_glue.h
index f7916efe2c..ae7ced45ee 100644
--- a/platform/android/java_glue.h
+++ b/platform/android/java_glue.h
@@ -50,6 +50,7 @@ extern "C" {
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_audio(JNIEnv * env, jobject obj);
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_accelerometer(JNIEnv * env, jobject obj, jfloat x, jfloat y, jfloat z);
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_magnetometer(JNIEnv * env, jobject obj, jfloat x, jfloat y, jfloat z);
+ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_gyroscope(JNIEnv * env, jobject obj, jfloat x, jfloat y, jfloat z);
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_focusin(JNIEnv * env, jobject obj);
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_focusout(JNIEnv * env, jobject obj);
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_singleton(JNIEnv * env, jobject obj, jstring name,jobject p_object);
diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp
index 13cdf2a020..3c2b4c22e7 100644
--- a/platform/android/os_android.cpp
+++ b/platform/android/os_android.cpp
@@ -614,6 +614,11 @@ void OS_Android::process_magnetometer(const Vector3& p_magnetometer) {
input->set_magnetometer(p_magnetometer);
}
+void OS_Android::process_gyroscope(const Vector3& p_gyroscope) {
+
+ input->set_gyroscope(p_gyroscope);
+}
+
bool OS_Android::has_touchscreen_ui_hint() const {
return true;
diff --git a/platform/android/os_android.h b/platform/android/os_android.h
index e82e08ea49..7f39784a74 100644
--- a/platform/android/os_android.h
+++ b/platform/android/os_android.h
@@ -242,6 +242,7 @@ public:
void process_accelerometer(const Vector3& p_accelerometer);
void process_magnetometer(const Vector3& p_magnetometer);
+ void process_gyroscope(const Vector3& p_gyroscope);
void process_touch(int p_what,int p_pointer, const Vector<TouchPos>& p_points);
void process_joy_event(JoystickEvent p_event);
void process_event(InputEvent p_event);
diff --git a/platform/windows/godot.manifest b/platform/windows/godot.manifest
deleted file mode 100644
index c095f007b0..0000000000
--- a/platform/windows/godot.manifest
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
- <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
- <security>
- <requestedPrivileges>
- <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
- </requestedPrivileges>
- </security>
- </trustInfo>
- <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
- <application>
- <!-- Windows 10 -->
- <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
- <!-- Windows 8.1 -->
- <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
- <!-- Windows 8 -->
- <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
- <!-- Windows 7 -->
- <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
- <!-- Windows Vista -->
- <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
- </application>
- </compatibility>
-</assembly>
diff --git a/platform/windows/godot_res.rc b/platform/windows/godot_res.rc
index d069ecdc79..5f1e951e0f 100644
--- a/platform/windows/godot_res.rc
+++ b/platform/windows/godot_res.rc
@@ -1,4 +1,3 @@
-#include <winuser.h>
#include "core/version.h"
#ifndef _STR
#define _STR(m_x) #m_x
@@ -7,8 +6,6 @@
GODOT_ICON ICON platform/windows/godot.ico
-CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST platform/windows/godot.manifest
-
1 VERSIONINFO
FILEVERSION VERSION_MAJOR,VERSION_MINOR,0,0
PRODUCTVERSION VERSION_MAJOR,VERSION_MINOR,0,0
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index 3c50e2cf5b..2be8b01dc3 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -182,7 +182,7 @@ def configure(env):
print("PulseAudio development libraries not found, disabling driver")
env.Append(CPPFLAGS=['-DX11_ENABLED','-DUNIX_ENABLED','-DGLES2_ENABLED','-DGLES_OVER_GL'])
- env.Append(LIBS=['GL', 'GLU', 'pthread', 'z'])
+ env.Append(LIBS=['GL', 'pthread', 'z'])
if (platform.system() == "Linux"):
env.Append(LIBS='dl')
#env.Append(CPPFLAGS=['-DMPC_FIXED_POINT'])
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp
index 06f8c27957..c8bd9749df 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -140,14 +140,13 @@ void ColorPicker::_value_changed(double) {
if (updating)
return;
- for(int i=0;i<3;i++) {
+ for(int i=0;i<4;i++) {
color.components[i] = scroll[i]->get_val()/(raw_mode_enabled?1.0:255.0);
}
- color.components[3] = scroll[3]->get_val()/255.0;
set_color(color);
- c_text->set_text(color.to_html(edit_alpha && color.a<1));
+ _update_text_value();
emit_signal("color_changed",color);
@@ -174,22 +173,16 @@ void ColorPicker::_update_color() {
for(int i=0;i<4;i++) {
scroll[i]->set_max(255);
scroll[i]->set_step(0.01);
- if (raw_mode_enabled && i != 3)
+ if (raw_mode_enabled) {
+ if (i == 3)
+ scroll[i]->set_max(1);
scroll[i]->set_val(color.components[i]);
- else
- scroll[i]->set_val(color.components[i]*255);
+ } else {
+ scroll[i]->set_val(color.components[i] * 255);
+ }
}
- if (text_is_constructor) {
- String t = "Color("+String::num(color.r)+","+String::num(color.g)+","+String::num(color.b);
- if (edit_alpha && color.a<1)
- t+=(","+String::num(color.a)+")") ;
- else
- t+=")";
- c_text->set_text(t);
- } else {
- c_text->set_text(color.to_html(edit_alpha && color.a<1));
- }
+ _update_text_value();
sample->update();
updating=false;
@@ -262,6 +255,20 @@ bool ColorPicker::is_raw_mode() const {
return raw_mode_enabled;
}
+
+void ColorPicker::_update_text_value() {
+ if (text_is_constructor) {
+ String t = "Color("+String::num(color.r)+","+String::num(color.g)+","+String::num(color.b);
+ if (edit_alpha && color.a<1)
+ t+=(","+String::num(color.a)+")") ;
+ else
+ t+=")";
+ c_text->set_text(t);
+ } else {
+ c_text->set_text(color.to_html(edit_alpha && color.a<1));
+ }
+}
+
void ColorPicker::_sample_draw() {
sample->draw_rect(Rect2(Point2(),Size2(256,20)),color);
}
@@ -271,12 +278,12 @@ void ColorPicker::_hsv_draw(int p_wich,Control* c)
if (!c)
return;
if (p_wich==0) {
- int x=c->get_size().x*s;
- int y=c->get_size().y-c->get_size().y*v;
+ int x = CLAMP(c->get_size().x * s, 0, c->get_size().x);
+ int y = CLAMP(c->get_size().y-c->get_size().y * v, 0, c->get_size().y);
Color col = color;
col.a=1;
c->draw_line(Point2(x,0),Point2(x,c->get_size().y),col.inverted());
- c->draw_line(Point2(0,y),Point2(c->get_size().x,y),col.inverted());
+ c->draw_line(Point2(0, y),Point2(c->get_size().x, y),col.inverted());
c->draw_line(Point2(x,y),Point2(x,y),Color(1,1,1),2);
} else if (p_wich==1) {
int y=c->get_size().y-c->get_size().y*h;
diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h
index b9ef1f1e2f..5e2cc57274 100644
--- a/scene/gui/color_picker.h
+++ b/scene/gui/color_picker.h
@@ -80,6 +80,7 @@ private:
void _update_controls();
void _update_color();
void _update_presets();
+ void _update_text_value();
void _text_type_toggled();
void _sample_draw();
void _hsv_draw(int p_wich,Control *c);
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index fc27c0d24f..c176e50cee 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -1865,7 +1865,7 @@ void Control::_modal_stack_remove() {
}
-void Control::_propagate_theme_changed(CanvasItem *p_at,Control *p_owner) {
+void Control::_propagate_theme_changed(CanvasItem *p_at,Control *p_owner,bool p_assign) {
Control *c = p_at->cast_to<Control>();
@@ -1884,15 +1884,30 @@ void Control::_propagate_theme_changed(CanvasItem *p_at,Control *p_owner) {
if (c) {
- c->data.theme_owner=p_owner;
+ if (p_assign) {
+ c->data.theme_owner=p_owner;
+ }
c->_notification(NOTIFICATION_THEME_CHANGED);
c->update();
}
}
+
+void Control::_theme_changed() {
+
+ _propagate_theme_changed(this,this,false);
+}
+
void Control::set_theme(const Ref<Theme>& p_theme) {
+ if (data.theme==p_theme)
+ return;
+
+ if (data.theme.is_valid()) {
+ data.theme->disconnect("changed",this,"_theme_changed");
+ }
+
data.theme=p_theme;
if (!p_theme.is_null()) {
@@ -1909,6 +1924,9 @@ void Control::set_theme(const Ref<Theme>& p_theme) {
}
+ if (data.theme.is_valid()) {
+ data.theme->connect("changed",this,"_theme_changed");
+ }
}
@@ -2448,6 +2466,10 @@ void Control::_bind_methods() {
ObjectTypeDB::bind_method(_MD("minimum_size_changed"), &Control::minimum_size_changed);
+ ObjectTypeDB::bind_method(_MD("_theme_changed"), &Control::_theme_changed);
+
+
+
ObjectTypeDB::bind_method(_MD("_font_changed"), &Control::_font_changed);
BIND_VMETHOD(MethodInfo("_input_event",PropertyInfo(Variant::INPUT_EVENT,"event")));
diff --git a/scene/gui/control.h b/scene/gui/control.h
index 830ebd1620..1337cbc4b9 100644
--- a/scene/gui/control.h
+++ b/scene/gui/control.h
@@ -172,7 +172,9 @@ private:
float _get_range(int p_idx) const;
float _s2a(float p_val, AnchorType p_anchor,float p_range) const;
float _a2s(float p_val, AnchorType p_anchor,float p_range) const;
- void _propagate_theme_changed(CanvasItem *p_at, Control *p_owner);
+ void _propagate_theme_changed(CanvasItem *p_at, Control *p_owner, bool p_assign=true);
+ void _theme_changed();
+
void _change_notify_margins();
void _update_minimum_size();
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 6c47072b33..89c235e101 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -118,7 +118,7 @@ void LineEdit::_input_event(InputEvent p_event) {
const InputEventMouseMotion& m=p_event.mouse_motion;
- if (m.button_mask&1) {
+ if (m.button_mask&BUTTON_LEFT) {
if (selection.creating) {
set_cursor_at_pixel_pos(m.x);
@@ -616,11 +616,11 @@ void LineEdit::_notification(int p_what) {
} break;
case ALIGN_CENTER: {
- x_ofs=x_ofs=int(size.width-(cached_width))/2;
+ x_ofs=int(size.width-(cached_width))/2;
} break;
case ALIGN_RIGHT: {
- x_ofs=x_ofs=int(size.width-style->get_offset().x-(cached_width));
+ x_ofs=int(size.width-style->get_offset().x-(cached_width));
} break;
}
@@ -811,6 +811,9 @@ void LineEdit::set_cursor_at_pixel_pos(int p_x) {
if ( (pixel_ofs-p_x) < (char_w >> 1 ) ) {
ofs+=1;
+ } else if ( (pixel_ofs-p_x) > (char_w >> 1 ) ) {
+
+ ofs-=1;
}
break;
diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp
index 8d02d0e4e5..5b83c3f8b8 100644
--- a/scene/gui/popup.cpp
+++ b/scene/gui/popup.cpp
@@ -125,8 +125,6 @@ void Popup::set_as_minsize() {
}
- print_line(String(c->get_type())+": "+minsize);
-
total_minsize.width = MAX( total_minsize.width, minsize.width );
total_minsize.height = MAX( total_minsize.height, minsize.height );
}
@@ -168,8 +166,6 @@ void Popup::popup_centered_minsize(const Size2& p_minsize) {
}
- print_line(String(c->get_type())+": "+minsize);
-
total_minsize.width = MAX( total_minsize.width, minsize.width );
total_minsize.height = MAX( total_minsize.height, minsize.height );
}
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index b4fa463cde..73a3cda5f3 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -662,7 +662,9 @@ void RichTextLabel::_notification(int p_what) {
} break;
case NOTIFICATION_ENTER_TREE: {
- set_bbcode(bbcode);
+ if (bbcode != "")
+ set_bbcode(bbcode);
+
main->first_invalid_line=0; //invalidate ALL
update();
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index a680d5d873..50b44c55a9 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -999,34 +999,39 @@ void TextEdit::_notification(int p_what) {
}
}
-
- if (str[j]>=32)
- cache.font->draw_char(ci,Point2i( char_ofs+char_margin, ofs_y+ascent),str[j],str[j+1],in_selection?cache.font_selected_color:color);
-
- else if (draw_tabs && str[j]=='\t') {
- int yofs= (get_row_height() - cache.tab_icon->get_height())/2;
- cache.tab_icon->draw(ci, Point2(char_ofs+char_margin,ofs_y+yofs),in_selection?cache.font_selected_color:color);
- }
-
-
if (cursor.column==j && cursor.line==line) {
cursor_pos = Point2i( char_ofs+char_margin, ofs_y );
if (insert_mode) {
- cursor_pos.y += get_row_height();
+ cursor_pos.y += (get_row_height() - 3);
}
+ int caret_w = (str[j]=='\t') ? cache.font->get_char_size(' ').width : char_w;
if (draw_caret) {
if (insert_mode) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cursor_pos, Size2i(char_w,1)),cache.caret_color);
+ int caret_h = (block_caret) ? 4 : 1;
+ VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cursor_pos, Size2i(caret_w,caret_h)),cache.caret_color);
} else {
- VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cursor_pos, Size2i(1,get_row_height())),cache.caret_color);
+ caret_w = (block_caret) ? caret_w : 1;
+ VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cursor_pos, Size2i(caret_w,get_row_height())),cache.caret_color);
}
}
}
- char_ofs+=char_w;
+ if (cursor.column==j && cursor.line==line && block_caret && draw_caret && !insert_mode) {
+ color = cache.caret_background_color;
+ }
+
+ if (str[j]>=32)
+ cache.font->draw_char(ci,Point2i( char_ofs+char_margin, ofs_y+ascent),str[j],str[j+1],in_selection?cache.font_selected_color:color);
+
+ else if (draw_tabs && str[j]=='\t') {
+ int yofs= (get_row_height() - cache.tab_icon->get_height())/2;
+ cache.tab_icon->draw(ci, Point2(char_ofs+char_margin,ofs_y+yofs),in_selection?cache.font_selected_color:color);
+ }
+
+ char_ofs+=char_w;
}
if (cursor.column==str.length() && cursor.line==line && (char_ofs+char_margin)>=xmargin_beg) {
@@ -1034,15 +1039,18 @@ void TextEdit::_notification(int p_what) {
cursor_pos=Point2i( char_ofs+char_margin, ofs_y );
if (insert_mode) {
- cursor_pos.y += get_row_height();
+ cursor_pos.y += (get_row_height() - 3);
}
if (draw_caret) {
if (insert_mode) {
int char_w = cache.font->get_char_size(' ').width;
- VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cursor_pos, Size2i(char_w,1)),cache.caret_color);
+ int caret_h = (block_caret) ? 4 : 1;
+ VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cursor_pos, Size2i(char_w,caret_h)),cache.caret_color);
} else {
- VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cursor_pos, Size2i(1,get_row_height())),cache.caret_color);
+ int char_w = cache.font->get_char_size(' ').width;
+ int caret_w = (block_caret) ? char_w : 1;
+ VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cursor_pos, Size2i(caret_w,get_row_height())),cache.caret_color);
}
}
}
@@ -1502,6 +1510,7 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
int gutter=cache.style_normal->get_margin(MARGIN_LEFT);
if (mb.x > gutter && mb.x <= gutter + cache.breakpoint_gutter_width + 3) {
set_line_as_breakpoint(row, !is_line_set_as_breakpoint(row));
+ emit_signal("breakpoint_toggled", row);
return;
}
}
@@ -3074,6 +3083,15 @@ void TextEdit::cursor_set_blink_speed(const float p_speed) {
caret_blink_timer->set_wait_time(p_speed);
}
+void TextEdit::cursor_set_block_mode(const bool p_enable){
+ block_caret = p_enable;
+ update();
+}
+
+bool TextEdit::cursor_is_block_mode() const {
+ return block_caret;
+}
+
void TextEdit::_scroll_moved(double p_to_val) {
@@ -3315,6 +3333,7 @@ void TextEdit::_update_caches() {
cache.completion_font_color=get_color("completion_font_color");
cache.font=get_font("font");
cache.caret_color=get_color("caret_color");
+ cache.caret_background_color=get_color("caret_background_color");
cache.line_number_color=get_color("line_number_color");
cache.font_color=get_color("font_color");
cache.font_selected_color=get_color("font_selected_color");
@@ -4417,6 +4436,8 @@ void TextEdit::_bind_methods() {
ObjectTypeDB::bind_method(_MD("cursor_get_blink_enabled"),&TextEdit::cursor_get_blink_enabled);
ObjectTypeDB::bind_method(_MD("cursor_set_blink_speed", "blink_speed"),&TextEdit::cursor_set_blink_speed);
ObjectTypeDB::bind_method(_MD("cursor_get_blink_speed"),&TextEdit::cursor_get_blink_speed);
+ ObjectTypeDB::bind_method(_MD("cursor_set_block_mode", "enable"), &TextEdit::cursor_set_block_mode);
+ ObjectTypeDB::bind_method(_MD("cursor_is_block_mode"), &TextEdit::cursor_is_block_mode);
ObjectTypeDB::bind_method(_MD("set_readonly","enable"),&TextEdit::set_readonly);
ObjectTypeDB::bind_method(_MD("set_wrap","enable"),&TextEdit::set_wrap);
@@ -4462,12 +4483,14 @@ void TextEdit::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "show_line_numbers"), _SCS("set_show_line_numbers"), _SCS("is_show_line_numbers_enabled"));
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "highlight_all_occurrences"), _SCS("set_highlight_all_occurrences"), _SCS("is_highlight_all_occurrences_enabled"));
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret/block_caret"), _SCS("cursor_set_block_mode"), _SCS("cursor_is_block_mode"));
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret/caret_blink"), _SCS("cursor_set_blink_enabled"), _SCS("cursor_get_blink_enabled"));
ADD_PROPERTYNZ(PropertyInfo(Variant::REAL, "caret/caret_blink_speed",PROPERTY_HINT_RANGE,"0.1,10,0.1"), _SCS("cursor_set_blink_speed"),_SCS("cursor_get_blink_speed") );
ADD_SIGNAL(MethodInfo("cursor_changed"));
ADD_SIGNAL(MethodInfo("text_changed"));
ADD_SIGNAL(MethodInfo("request_completion"));
+ ADD_SIGNAL(MethodInfo("breakpoint_toggled", PropertyInfo( Variant::INT, "row")));
BIND_CONSTANT( MENU_CUT );
BIND_CONSTANT( MENU_COPY );
@@ -4527,6 +4550,7 @@ TextEdit::TextEdit() {
selection.active=false;
syntax_coloring=false;
+ block_caret=false;
caret_blink_enabled=false;
caret_blink_timer = memnew(Timer);
add_child(caret_blink_timer);
diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h
index 270a1723b1..65e9615911 100644
--- a/scene/gui/text_edit.h
+++ b/scene/gui/text_edit.h
@@ -79,6 +79,7 @@ class TextEdit : public Control {
Color completion_existing_color;
Color completion_font_color;
Color caret_color;
+ Color caret_background_color;
Color line_number_color;
Color font_color;
Color font_selected_color;
@@ -222,6 +223,7 @@ class TextEdit : public Control {
bool caret_blink_enabled;
bool draw_caret;
bool window_has_focus;
+ bool block_caret;
bool setting_row;
bool wrap;
@@ -406,6 +408,9 @@ public:
float cursor_get_blink_speed() const;
void cursor_set_blink_speed(const float p_speed);
+ void cursor_set_block_mode(const bool p_enable);
+ bool cursor_is_block_mode() const;
+
void set_readonly(bool p_readonly);
void set_max_chars(int p_max_chars);
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 305a3920da..82459ba0ab 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -693,6 +693,7 @@ void TreeItem::_bind_methods() {
ObjectTypeDB::bind_method(_MD("add_button","column","button:Texture","button_idx","disabled"),&TreeItem::add_button,DEFVAL(-1),DEFVAL(false));
ObjectTypeDB::bind_method(_MD("get_button_count","column"),&TreeItem::get_button_count);
ObjectTypeDB::bind_method(_MD("get_button:Texture","column","button_idx"),&TreeItem::get_button);
+ ObjectTypeDB::bind_method(_MD("set_button","column","button_idx","button:Texture"),&TreeItem::set_button);
ObjectTypeDB::bind_method(_MD("erase_button","column","button_idx"),&TreeItem::erase_button);
ObjectTypeDB::bind_method(_MD("is_button_disabled","column","button_idx"),&TreeItem::is_button_disabled);
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index bb6e6e289b..bdb2754e5e 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -1346,13 +1346,21 @@ Matrix32 Viewport::_get_input_pre_xform() const {
void Viewport::_make_input_local(InputEvent& ev) {
+
switch(ev.type) {
case InputEvent::MOUSE_BUTTON: {
+ Vector2 vp_ofs;
+ if (parent_control) {
+ vp_ofs = (parent_control->get_viewport()->get_final_transform() * parent_control->get_global_transform_with_canvas()).get_origin();
+ }
+
Matrix32 ai = get_final_transform().affine_inverse() * _get_input_pre_xform();
Vector2 g = ai.xform(Vector2(ev.mouse_button.global_x,ev.mouse_button.global_y));
- Vector2 l = ai.xform(Vector2(ev.mouse_button.x,ev.mouse_button.y));
+ Vector2 l = ai.xform(Vector2(ev.mouse_button.x,ev.mouse_button.y)-vp_ofs);
+
+
ev.mouse_button.x=l.x;
ev.mouse_button.y=l.y;
ev.mouse_button.global_x=g.x;
@@ -1361,11 +1369,18 @@ void Viewport::_make_input_local(InputEvent& ev) {
} break;
case InputEvent::MOUSE_MOTION: {
+ Vector2 vp_ofs;
+ if (parent_control) {
+ vp_ofs = (parent_control->get_viewport()->get_final_transform() * parent_control->get_global_transform_with_canvas()).get_origin();
+ }
+
Matrix32 ai = get_final_transform().affine_inverse() * _get_input_pre_xform();
Vector2 g = ai.xform(Vector2(ev.mouse_motion.global_x,ev.mouse_motion.global_y));
- Vector2 l = ai.xform(Vector2(ev.mouse_motion.x,ev.mouse_motion.y));
+ Vector2 l = ai.xform(Vector2(ev.mouse_motion.x,ev.mouse_motion.y)-vp_ofs);
Vector2 r = ai.basis_xform(Vector2(ev.mouse_motion.relative_x,ev.mouse_motion.relative_y));
Vector2 s = ai.basis_xform(Vector2(ev.mouse_motion.speed_x,ev.mouse_motion.speed_y));
+
+
ev.mouse_motion.x=l.x;
ev.mouse_motion.y=l.y;
ev.mouse_motion.global_x=g.x;
@@ -1378,16 +1393,28 @@ void Viewport::_make_input_local(InputEvent& ev) {
} break;
case InputEvent::SCREEN_TOUCH: {
+ Vector2 vp_ofs;
+ if (parent_control) {
+ vp_ofs = (parent_control->get_viewport()->get_final_transform() * parent_control->get_global_transform_with_canvas()).get_origin();
+ }
+
Matrix32 ai = get_final_transform().affine_inverse() * _get_input_pre_xform();
- Vector2 t = ai.xform(Vector2(ev.screen_touch.x,ev.screen_touch.y));
+ Vector2 t = ai.xform(Vector2(ev.screen_touch.x,ev.screen_touch.y)-vp_ofs);
+
+
ev.screen_touch.x=t.x;
ev.screen_touch.y=t.y;
} break;
case InputEvent::SCREEN_DRAG: {
+ Vector2 vp_ofs;
+ if (parent_control) {
+ vp_ofs = (parent_control->get_viewport()->get_final_transform() * parent_control->get_global_transform_with_canvas()).get_origin();
+ }
+
Matrix32 ai = get_final_transform().affine_inverse() * _get_input_pre_xform();
- Vector2 t = ai.xform(Vector2(ev.screen_drag.x,ev.screen_drag.y));
+ Vector2 t = ai.xform(Vector2(ev.screen_drag.x,ev.screen_drag.y)-vp_ofs);
Vector2 r = ai.basis_xform(Vector2(ev.screen_drag.relative_x,ev.screen_drag.relative_y));
Vector2 s = ai.basis_xform(Vector2(ev.screen_drag.speed_x,ev.screen_drag.speed_y));
ev.screen_drag.x=t.x;
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp
index 182bc5dabc..499cf0a169 100644
--- a/scene/resources/default_theme/default_theme.cpp
+++ b/scene/resources/default_theme/default_theme.cpp
@@ -54,8 +54,10 @@ static Ref<StyleBoxTexture> make_stylebox(T p_src,float p_left, float p_top, flo
texture = Ref<ImageTexture>( memnew( ImageTexture ) );
Image img(p_src);
- if (scale>1)
+ if (scale>1) {
+ img.convert(Image::FORMAT_RGBA);
img.expand_x2_hq2x();
+ }
texture->create_from_image( img,ImageTexture::FLAG_FILTER );
(*tex_cache)[p_src]=texture;
}
@@ -92,8 +94,10 @@ static Ref<Texture> make_icon(T p_src) {
Ref<ImageTexture> texture( memnew( ImageTexture ) );
Image img = Image(p_src);
- if (scale>1)
+ if (scale>1) {
+ img.convert(Image::FORMAT_RGBA);
img.expand_x2_hq2x();
+ }
texture->create_from_image( img,ImageTexture::FLAG_FILTER );
return texture;
@@ -481,6 +485,7 @@ void fill_default_theme(Ref<Theme>& t,const Ref<Font> & default_font,const Ref<F
t->set_color("breakpoint_color","TextEdit", Color(0.8,0.8,0.4,0.2) );
t->set_color("current_line_color","TextEdit", Color(0.25,0.25,0.26,0.8) );
t->set_color("caret_color","TextEdit", control_font_color );
+ t->set_color("caret_background_color", "TextEdit", Color::html("000000"));
t->set_color("symbol_color","TextEdit", control_font_color_hover );
t->set_color("brace_mismatch_color","TextEdit", Color(1,0.2,0.2) );
t->set_color("line_number_color","TextEdit",Color::html("66aaaaaa"));
diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp
index 6ad8a95565..1afa3fec19 100644
--- a/scene/resources/font.cpp
+++ b/scene/resources/font.cpp
@@ -71,6 +71,11 @@ void Font::draw(RID p_canvas_item, const Point2& p_pos, const String& p_text, co
}
}
+void Font::update_changes() {
+
+ emit_changed();
+}
+
void Font::_bind_methods() {
ObjectTypeDB::bind_method(_MD("draw","canvas_item","pos","string","modulate","clip_w"),&Font::draw,DEFVAL(Color(1,1,1)),DEFVAL(-1));
@@ -80,6 +85,7 @@ void Font::_bind_methods() {
ObjectTypeDB::bind_method(_MD("is_distance_field_hint"),&Font::is_distance_field_hint);
ObjectTypeDB::bind_method(_MD("get_string_size","string"),&Font::get_string_size);
ObjectTypeDB::bind_method(_MD("draw_char","canvas_item","pos","char","next","modulate"),&Font::draw_char,DEFVAL(-1),DEFVAL(Color(1,1,1)));
+ ObjectTypeDB::bind_method(_MD("update_changes"),&Font::update_changes);
}
diff --git a/scene/resources/font.h b/scene/resources/font.h
index 67836564cd..fe4558f9e3 100644
--- a/scene/resources/font.h
+++ b/scene/resources/font.h
@@ -61,6 +61,7 @@ public:
void draw_halign(RID p_canvas_item, const Point2& p_pos, HAlign p_align,float p_width,const String& p_text,const Color& p_modulate=Color(1,1,1)) const;
virtual float draw_char(RID p_canvas_item, const Point2& p_pos, CharType p_char, CharType p_next=0,const Color& p_modulate=Color(1,1,1)) const=0;
+ void update_changes();
Font();
};
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index f6213f74e8..9dc54ef0e4 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -68,7 +68,7 @@ void Material::set_flag(Flag p_flag,bool p_enabled) {
void Material::set_blend_mode(BlendMode p_blend_mode) {
- ERR_FAIL_INDEX(p_blend_mode,3);
+ ERR_FAIL_INDEX(p_blend_mode,4);
blend_mode=p_blend_mode;
VisualServer::get_singleton()->material_set_blend_mode(material,(VS::MaterialBlendMode)p_blend_mode);
_change_notify();
diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp
index 92a6f0c0b9..b351167e10 100644
--- a/scene/resources/theme.cpp
+++ b/scene/resources/theme.cpp
@@ -219,7 +219,22 @@ Ref<Theme> Theme::get_default() {
void Theme::set_default_theme_font( const Ref<Font>& p_default_font ) {
+ if (default_theme_font==p_default_font)
+ return;
+
+ if (default_theme_font.is_valid()) {
+ _unref_font(default_theme_font);
+ }
+
default_theme_font=p_default_font;
+
+ if (default_theme_font.is_valid()) {
+ _ref_font(default_theme_font);
+ }
+
+ _change_notify();
+ emit_changed();;
+
}
Ref<Font> Theme::get_default_theme_font() const {
diff --git a/servers/physics_2d/body_pair_2d_sw.cpp b/servers/physics_2d/body_pair_2d_sw.cpp
index 35f19605df..ba0358a1f2 100644
--- a/servers/physics_2d/body_pair_2d_sw.cpp
+++ b/servers/physics_2d/body_pair_2d_sw.cpp
@@ -298,19 +298,17 @@ bool BodyPair2DSW::setup(float p_step) {
if (A->is_using_one_way_collision()) {
Vector2 direction = A->get_one_way_collision_direction();
bool valid=false;
- for(int i=0;i<contact_count;i++) {
- Contact& c = contacts[i];
-
- if (c.normal.dot(direction)<0)
- continue;
- if (B->get_linear_velocity().dot(direction)<0)
- continue;
-
- if (!c.reused) {
- continue;
+ if (B->get_linear_velocity().dot(direction)>=0){
+ for(int i=0;i<contact_count;i++) {
+ Contact& c = contacts[i];
+ if (!c.reused)
+ continue;
+ if (c.normal.dot(direction)<0)
+ continue;
+
+ valid=true;
+ break;
}
-
- valid=true;
}
if (!valid) {
@@ -323,20 +321,17 @@ bool BodyPair2DSW::setup(float p_step) {
if (B->is_using_one_way_collision()) {
Vector2 direction = B->get_one_way_collision_direction();
bool valid=false;
- for(int i=0;i<contact_count;i++) {
-
- Contact& c = contacts[i];
-
- if (c.normal.dot(direction)<0)
- continue;
- if (A->get_linear_velocity().dot(direction)<0)
- continue;
-
- if (!c.reused) {
- continue;
+ if (A->get_linear_velocity().dot(direction)>=0){
+ for(int i=0;i<contact_count;i++) {
+ Contact& c = contacts[i];
+ if (!c.reused)
+ continue;
+ if (c.normal.dot(direction)<0)
+ continue;
+
+ valid=true;
+ break;
}
-
- valid=true;
}
if (!valid) {
collided=false;
diff --git a/tools/editor/create_dialog.cpp b/tools/editor/create_dialog.cpp
index 210b799f3d..07d1566ab8 100644
--- a/tools/editor/create_dialog.cpp
+++ b/tools/editor/create_dialog.cpp
@@ -154,6 +154,9 @@ void CreateDialog::_update_search() {
TreeItem *root = search_options->create_item();
root->set_text(0,base_type);
+ if (has_icon(base_type,"EditorIcons")) {
+ root->set_icon(0,get_icon(base_type,"EditorIcons"));
+ }
List<StringName>::Element *I=type_list.front();
TreeItem *to_select=NULL;
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 92b22eb5d1..dee521beb3 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -704,7 +704,7 @@ void EditorNode::_get_scene_metadata(const String& p_file) {
cf.instance();
Error err = cf->load(path);
- if (err!=OK)
+ if (err!=OK || !cf->has_section("editor_states"))
return; //must not exist
List<String> esl;
@@ -740,7 +740,14 @@ void EditorNode::_set_scene_metadata(const String& p_file, int p_idx) {
Ref<ConfigFile> cf;
cf.instance();
- Dictionary md = editor_data.get_edited_scene()==p_idx?editor_data.get_editor_states():editor_data.get_scene_editor_states(p_idx);
+ Dictionary md;
+
+ if (p_idx<0 || editor_data.get_edited_scene()==p_idx) {
+ md = editor_data.get_editor_states();
+ } else {
+ md = editor_data.get_scene_editor_states(p_idx);
+ }
+
List<Variant> keys;
md.get_key_list(&keys);
diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp
index 7f496d0e22..c150e62754 100644
--- a/tools/editor/editor_settings.cpp
+++ b/tools/editor/editor_settings.cpp
@@ -554,6 +554,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
set("text_editor/create_signal_callbacks",true);
set("text_editor/autosave_interval_secs",0);
+ set("text_editor/block_caret", false);
set("text_editor/caret_blink", false);
set("text_editor/caret_blink_speed", 0.65);
hints["text_editor/caret_blink_speed"]=PropertyInfo(Variant::REAL,"text_editor/caret_blink_speed",PROPERTY_HINT_RANGE,"0.1, 10, 0.1");
@@ -685,6 +686,7 @@ void EditorSettings::_load_default_text_editor_theme() {
set("text_editor/completion_scroll_color", Color::html("ffffff"));
set("text_editor/completion_font_color", Color::html("aaaaaa"));
set("text_editor/caret_color",Color::html("aaaaaa"));
+ set("text_editor/caret_background_color", Color::html("000000"));
set("text_editor/line_number_color",Color::html("66aaaaaa"));
set("text_editor/text_color",Color::html("aaaaaa"));
set("text_editor/text_selected_color",Color::html("000000"));
@@ -922,6 +924,7 @@ bool EditorSettings::_save_text_editor_theme(String p_file) {
cf->set_value(theme_section, "completion_scroll_color", ((Color)get("text_editor/completion_scroll_color")).to_html());
cf->set_value(theme_section, "completion_font_color", ((Color)get("text_editor/completion_font_color")).to_html());
cf->set_value(theme_section, "caret_color", ((Color)get("text_editor/caret_color")).to_html());
+ cf->set_value(theme_section, "caret_background_color", ((Color)get("text_editor/caret_background_color")).to_html());
cf->set_value(theme_section, "line_number_color", ((Color)get("text_editor/line_number_color")).to_html());
cf->set_value(theme_section, "text_color", ((Color)get("text_editor/text_color")).to_html());
cf->set_value(theme_section, "text_selected_color", ((Color)get("text_editor/text_selected_color")).to_html());
diff --git a/tools/editor/icons/SCsub b/tools/editor/icons/SCsub
index 7132968c88..f2f5dcca48 100644
--- a/tools/editor/icons/SCsub
+++ b/tools/editor/icons/SCsub
@@ -65,7 +65,7 @@ def make_editor_icons_action(target, source, env):
s.write("static Ref<ImageTexture> make_icon(const uint8_t* p_png,const uint8_t* p_hidpi_png) {\n")
s.write("\tRef<ImageTexture> texture( memnew( ImageTexture ) );\n")
s.write("\tImage img((editor_is_hidpi()&&p_hidpi_png)?p_hidpi_png:p_png);\n")
- s.write("\tif (editor_is_hidpi() && !p_hidpi_png) img.expand_x2_hq2x();\n")
+ s.write("\tif (editor_is_hidpi() && !p_hidpi_png) { img.convert(Image::FORMAT_RGBA); img.expand_x2_hq2x(); }\n")
s.write("\ttexture->create_from_image( img,ImageTexture::FLAG_FILTER );\n")
s.write("\treturn texture;\n")
s.write("}\n\n")
diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp
index e24412d4ef..fa62283e37 100644
--- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp
@@ -756,6 +756,8 @@ void EditorSceneImportDialog::_import(bool p_and_open) {
}
+ // Scenes should always be imported as binary format since vertex data is large and would take
+ // up a lot of space and time to load if imported as text format (GH-5778)
String save_file = save_path->get_text().plus_file(import_path->get_text().get_file().basename()+".scn");
print_line("Saving to: "+save_file);
diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.cpp b/tools/editor/io_plugins/editor_texture_import_plugin.cpp
index 1d8319d460..60642999f2 100644
--- a/tools/editor/io_plugins/editor_texture_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_texture_import_plugin.cpp
@@ -147,8 +147,6 @@ void EditorImportTextureOptions::_changed() {
void EditorImportTextureOptions::_bind_methods() {
- print_line("bind toptions");
-
ObjectTypeDB::bind_method("_changed",&EditorImportTextureOptions::_changed);
ObjectTypeDB::bind_method("_changedp",&EditorImportTextureOptions::_changedp);
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index 3174742091..4032a790d8 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -317,6 +317,7 @@ void ScriptTextEditor::_load_theme_settings() {
get_text_edit()->add_color_override("font_color",EDITOR_DEF("text_editor/text_color",Color(0,0,0)));
get_text_edit()->add_color_override("line_number_color",EDITOR_DEF("text_editor/line_number_color",Color(0,0,0)));
get_text_edit()->add_color_override("caret_color",EDITOR_DEF("text_editor/caret_color",Color(0,0,0)));
+ get_text_edit()->add_color_override("caret_background_color",EDITOR_DEF("text_editor/caret_background_color",Color(0,0,0)));
get_text_edit()->add_color_override("font_selected_color",EDITOR_DEF("text_editor/text_selected_color",Color(1,1,1)));
get_text_edit()->add_color_override("selection_color",EDITOR_DEF("text_editor/selection_color",Color(0.2,0.2,1)));
get_text_edit()->add_color_override("brace_mismatch_color",EDITOR_DEF("text_editor/brace_mismatch_color",Color(1,0.2,0.2)));
@@ -818,7 +819,7 @@ void ScriptEditor::_close_tab(int p_idx) {
_update_script_names();
- EditorNode::get_singleton()->save_layout();
+ _save_layout();
}
void ScriptEditor::_close_current_tab() {
@@ -1028,6 +1029,18 @@ void ScriptEditor::swap_lines(TextEdit *tx, int line1, int line2)
tx->cursor_set_line(line2);
}
+void ScriptEditor::_breakpoint_toggled(const int p_row) {
+ int selected = tab_container->get_current_tab();
+ if (selected<0 || selected>=tab_container->get_child_count()) {
+ return;
+ }
+
+ ScriptTextEditor *current = tab_container->get_child(selected)->cast_to<ScriptTextEditor>();
+ if (current) {
+ get_debugger()->set_breakpoint(current->get_edited_script()->get_path(),p_row+1,current->get_text_edit()->is_line_set_as_breakpoint(p_row));
+ }
+}
+
void ScriptEditor::_file_dialog_action(String p_file) {
switch (file_dialog_option) {
@@ -1484,7 +1497,9 @@ void ScriptEditor::_menu_option(int p_option) {
if (scr.is_null())
return;
scr->set_source_code(te->get_text());
- scr->get_language()->reload_tool_script(scr,p_option==FILE_TOOL_RELOAD_SOFT);
+ bool soft = p_option==FILE_TOOL_RELOAD_SOFT || scr->get_instance_base_type()=="EditorPlugin"; //always soft-reload editor plugins
+
+ scr->get_language()->reload_tool_script(scr,soft);
} break;
case EDIT_TRIM_TRAILING_WHITESAPCE: {
_trim_trailing_whitespace(current->get_text_edit());
@@ -2066,6 +2081,9 @@ void ScriptEditor::_update_script_colors() {
void ScriptEditor::_update_script_names() {
+ if (restoring_layout)
+ return;
+
waiting_update_names=false;
Set<Ref<Script> > used;
Node* edited = EditorNode::get_singleton()->get_edited_scene();
@@ -2217,9 +2235,11 @@ void ScriptEditor::edit(const Ref<Script>& p_script) {
ste->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/caret_blink"));
ste->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/caret_blink_speed"));
ste->get_text_edit()->set_draw_breakpoint_gutter(EditorSettings::get_singleton()->get("text_editor/show_breakpoint_gutter"));
+ ste->get_text_edit()->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/block_caret"));
ste->get_text_edit()->set_callhint_settings(
EditorSettings::get_singleton()->get("text_editor/put_callhint_tooltip_below_current_line"),
EditorSettings::get_singleton()->get("text_editor/callhint_tooltip_offset"));
+ ste->get_text_edit()->connect("breakpoint_toggled", this, "_breakpoint_toggled");
tab_container->add_child(ste);
_go_to_tab(tab_container->get_tab_count()-1);
@@ -2227,10 +2247,8 @@ void ScriptEditor::edit(const Ref<Script>& p_script) {
_update_script_names();
+ _save_layout();
ste->connect("name_changed",this,"_update_script_names");
- if (!restoring_layout) {
- EditorNode::get_singleton()->save_layout();
- }
//test for modification, maybe the script was not edited but was loaded
@@ -2350,6 +2368,15 @@ void ScriptEditor::_add_callback(Object *p_obj, const String& p_function, const
}
+void ScriptEditor::_save_layout() {
+
+ if (restoring_layout) {
+ return;
+ }
+
+ editor->save_layout();
+}
+
void ScriptEditor::_editor_settings_changed() {
trim_trailing_whitespace_on_save = EditorSettings::get_singleton()->get("text_editor/trim_trailing_whitespace_on_save");
@@ -2384,6 +2411,7 @@ void ScriptEditor::_editor_settings_changed() {
ste->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/caret_blink"));
ste->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/caret_blink_speed"));
ste->get_text_edit()->set_draw_breakpoint_gutter(EditorSettings::get_singleton()->get("text_editor/show_breakpoint_gutter"));
+ ste->get_text_edit()->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/block_caret"));
}
ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/auto_reload_and_parse_scripts_on_save",true));
@@ -2406,7 +2434,7 @@ void ScriptEditor::_tree_changed() {
void ScriptEditor::_script_split_dragged(float) {
- EditorNode::get_singleton()->save_layout();
+ _save_layout();
}
void ScriptEditor::_unhandled_input(const InputEvent& p_event) {
@@ -2452,7 +2480,6 @@ void ScriptEditor::set_window_layout(Ref<ConfigFile> p_layout) {
}
}
-
for(int i=0;i<helps.size();i++) {
String path = helps[i];
@@ -2468,9 +2495,9 @@ void ScriptEditor::set_window_layout(Ref<ConfigFile> p_layout) {
script_split->set_split_offset(p_layout->get_value("ScriptEditor","split_offset"));
}
-
restoring_layout=false;
+ _update_script_names();
}
void ScriptEditor::get_window_layout(Ref<ConfigFile> p_layout) {
@@ -2530,7 +2557,7 @@ void ScriptEditor::_help_class_open(const String& p_class) {
eh->go_to_class(p_class,0);
eh->connect("go_to_help",this,"_help_class_goto");
_update_script_names();
-
+ _save_layout();
}
void ScriptEditor::_help_class_goto(const String& p_desc) {
@@ -2559,7 +2586,7 @@ void ScriptEditor::_help_class_goto(const String& p_desc) {
eh->go_to_help(p_desc);
eh->connect("go_to_help",this,"_help_class_goto");
_update_script_names();
-
+ _save_layout();
}
void ScriptEditor::_update_history_pos(int p_new_pos) {
@@ -2694,6 +2721,7 @@ void ScriptEditor::_bind_methods() {
ObjectTypeDB::bind_method("_res_saved_callback",&ScriptEditor::_res_saved_callback);
ObjectTypeDB::bind_method("_goto_script_line",&ScriptEditor::_goto_script_line);
ObjectTypeDB::bind_method("_goto_script_line2",&ScriptEditor::_goto_script_line2);
+ ObjectTypeDB::bind_method("_breakpoint_toggled", &ScriptEditor::_breakpoint_toggled);
ObjectTypeDB::bind_method("_breaked",&ScriptEditor::_breaked);
ObjectTypeDB::bind_method("_show_debugger",&ScriptEditor::_show_debugger);
ObjectTypeDB::bind_method("_get_debug_tooltip",&ScriptEditor::_get_debug_tooltip);
diff --git a/tools/editor/plugins/script_editor_plugin.h b/tools/editor/plugins/script_editor_plugin.h
index 06f22863cf..2f079b9fc7 100644
--- a/tools/editor/plugins/script_editor_plugin.h
+++ b/tools/editor/plugins/script_editor_plugin.h
@@ -270,6 +270,7 @@ class ScriptEditor : public VBoxContainer {
void _update_window_menu();
void _script_created(Ref<Script> p_script);
+ void _save_layout();
void _editor_settings_changed();
void _autosave_scripts();
@@ -323,6 +324,7 @@ public:
void get_breakpoints(List<String> *p_breakpoints);
void swap_lines(TextEdit *tx, int line1, int line2);
+ void _breakpoint_toggled(const int p_row);
void save_all_scripts();
diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp
index 9ef84af260..b3317e8313 100644
--- a/tools/editor/plugins/shader_editor_plugin.cpp
+++ b/tools/editor/plugins/shader_editor_plugin.cpp
@@ -86,6 +86,7 @@ void ShaderTextEditor::_load_theme_settings() {
get_text_edit()->add_color_override("font_color",EDITOR_DEF("text_editor/text_color",Color(0,0,0)));
get_text_edit()->add_color_override("line_number_color",EDITOR_DEF("text_editor/line_number_color",Color(0,0,0)));
get_text_edit()->add_color_override("caret_color",EDITOR_DEF("text_editor/caret_color",Color(0,0,0)));
+ get_text_edit()->add_color_override("caret_background_color",EDITOR_DEF("text_editor/caret_background_color",Color(0,0,0)));
get_text_edit()->add_color_override("font_selected_color",EDITOR_DEF("text_editor/text_selected_color",Color(1,1,1)));
get_text_edit()->add_color_override("selection_color",EDITOR_DEF("text_editor/selection_color",Color(0.2,0.2,1)));
get_text_edit()->add_color_override("brace_mismatch_color",EDITOR_DEF("text_editor/brace_mismatch_color",Color(1,0.2,0.2)));
@@ -381,6 +382,7 @@ void ShaderEditor::_editor_settings_changed() {
vertex_editor->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/caret_blink"));
vertex_editor->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/caret_blink_speed"));
vertex_editor->get_text_edit()->add_constant_override("line_spacing", EditorSettings::get_singleton()->get("text_editor/line_spacing"));
+ vertex_editor->get_text_edit()->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/block_caret"));
fragment_editor->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/auto_brace_complete"));
fragment_editor->get_text_edit()->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/scroll_past_end_of_file"));
@@ -392,6 +394,7 @@ void ShaderEditor::_editor_settings_changed() {
fragment_editor->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/caret_blink"));
fragment_editor->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/caret_blink_speed"));
fragment_editor->get_text_edit()->add_constant_override("line_spacing", EditorSettings::get_singleton()->get("text_editor/line_spacing"));
+ fragment_editor->get_text_edit()->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/block_caret"));
light_editor->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/auto_brace_complete"));
light_editor->get_text_edit()->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/scroll_past_end_of_file"));
@@ -403,6 +406,7 @@ void ShaderEditor::_editor_settings_changed() {
light_editor->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/caret_blink"));
light_editor->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/caret_blink_speed"));
light_editor->get_text_edit()->add_constant_override("line_spacing", EditorSettings::get_singleton()->get("text_editor/line_spacing"));
+ light_editor->get_text_edit()->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/block_caret"));
}
void ShaderEditor::_bind_methods() {
diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp
index f174bc2f1b..cc11cbc562 100644
--- a/tools/editor/scene_tree_editor.cpp
+++ b/tools/editor/scene_tree_editor.cpp
@@ -260,13 +260,21 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item,int p_column,int p_id)
} else if (p_id==BUTTON_SIGNALS) {
- item->select(0);
+ editor_selection->clear();
+ editor_selection->add_node(n);
+
+ set_selected(n);
+
NodeDock::singleton->get_parent()->call("set_current_tab",NodeDock::singleton->get_index());
NodeDock::singleton->show_connections();
} else if (p_id==BUTTON_GROUPS) {
- item->select(0);
+ editor_selection->clear();
+ editor_selection->add_node(n);
+
+ set_selected(n);
+
NodeDock::singleton->get_parent()->call("set_current_tab",NodeDock::singleton->get_index());
NodeDock::singleton->show_groups();
}
diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp
index fc746bc21d..b6390e5aae 100644
--- a/tools/editor/script_editor_debugger.cpp
+++ b/tools/editor/script_editor_debugger.cpp
@@ -338,8 +338,9 @@ void ScriptEditorDebugger::_parse_message(const String& p_msg,const Array& p_dat
docontinue->set_disabled(false);
emit_signal("breaked",true,can_continue);
OS::get_singleton()->move_window_to_foreground();
- if (!profiler->is_seeking())
+ if (error!="") {
tabs->set_current_tab(0);
+ }
profiler->set_enabled(false);