diff options
41 files changed, 511 insertions, 96 deletions
diff --git a/SConstruct b/SConstruct index d168820f66..0652414088 100644 --- a/SConstruct +++ b/SConstruct @@ -16,7 +16,6 @@ platform_list = [] # list of platforms platform_opts = {} # options for each platform platform_flags = {} # flags for each platform - active_platforms=[] active_platform_ids=[] platform_exporters=[] @@ -60,7 +59,7 @@ platform_arg = ARGUMENTS.get("platform", False) if (os.name=="posix"): pass elif (os.name=="nt"): - if (os.getenv("VSINSTALLDIR")==None or platform_arg=="android"): + if (not methods.msvc_is_detected() or platform_arg=="android"): custom_tools=['mingw'] env_base=Environment(tools=custom_tools); @@ -138,7 +137,8 @@ opts.Add('etc1','etc1 Texture compression support (yes/no)','yes') opts.Add('builtin_zlib','Use built-in zlib (yes/no)','yes') opts.Add('openssl','Use OpenSSL (yes/no/builtin)','no') opts.Add('musepack','Musepack Audio (yes/no)','yes') -opts.Add("CXX", "Compiler"); +opts.Add("CXX", "C++ Compiler") +opts.Add("CC", "C Compiler") opts.Add("CCFLAGS", "Custom flags for the C++ compiler"); opts.Add("CFLAGS", "Custom flags for the C compiler"); opts.Add("LINKFLAGS", "Custom flags for the linker"); 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/os/input.cpp b/core/os/input.cpp index 401ab7ffe2..4ab57a84ea 100644 --- a/core/os/input.cpp +++ b/core/os/input.cpp @@ -64,6 +64,10 @@ void Input::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_connected_joysticks"),&Input::get_connected_joysticks); ObjectTypeDB::bind_method(_MD("get_joy_vibration_strength", "device"), &Input::get_joy_vibration_strength); ObjectTypeDB::bind_method(_MD("get_joy_vibration_duration", "device"), &Input::get_joy_vibration_duration); + ObjectTypeDB::bind_method(_MD("get_joy_button_string", "button_index"), &Input::get_joy_button_string); + ObjectTypeDB::bind_method(_MD("get_joy_button_index_from_string", "button"), &Input::get_joy_button_index_from_string); + ObjectTypeDB::bind_method(_MD("get_joy_axis_string", "axis_index"), &Input::get_joy_axis_string); + ObjectTypeDB::bind_method(_MD("get_joy_axis_index_from_string", "axis"), &Input::get_joy_axis_index_from_string); ObjectTypeDB::bind_method(_MD("start_joy_vibration", "device", "weak_magnitude", "strong_magnitude", "duration"), &Input::start_joy_vibration, DEFVAL(0)); ObjectTypeDB::bind_method(_MD("stop_joy_vibration", "device"), &Input::stop_joy_vibration); ObjectTypeDB::bind_method(_MD("get_accelerometer"),&Input::get_accelerometer); @@ -90,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/input.h b/core/os/input.h index 665fb4ad99..d8f3be09df 100644 --- a/core/os/input.h +++ b/core/os/input.h @@ -96,6 +96,11 @@ public: virtual void set_custom_mouse_cursor(const RES& p_cursor,const Vector2& p_hotspot=Vector2())=0; virtual void set_mouse_in_window(bool p_in_window)=0; + virtual String get_joy_button_string(int p_button)=0; + virtual String get_joy_axis_string(int p_axis)=0; + virtual int get_joy_button_index_from_string(String p_button)=0; + virtual int get_joy_axis_index_from_string(String p_axis)=0; + Input(); }; 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); diff --git a/doc/base/classes.xml b/doc/base/classes.xml index ab4610d4f7..deed5c5cda 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -2153,6 +2153,120 @@ <constants> </constants> </class> +<class name="AStar" inherits="Reference" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="add_point"> + <argument index="0" name="id" type="int"> + </argument> + <argument index="1" name="pos" type="Vector3"> + </argument> + <argument index="2" name="weight_scale" type="float" default="1"> + </argument> + <description> + </description> + </method> + <method name="are_points_connected" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="id" type="int"> + </argument> + <argument index="1" name="to_id" type="int"> + </argument> + <description> + </description> + </method> + <method name="clear"> + <description> + </description> + </method> + <method name="connect_points"> + <argument index="0" name="id" type="int"> + </argument> + <argument index="1" name="to_id" type="int"> + </argument> + <description> + </description> + </method> + <method name="disconnect_points"> + <argument index="0" name="id" type="int"> + </argument> + <argument index="1" name="to_id" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_available_point_id" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_closest_point" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="to_pos" type="Vector3"> + </argument> + <description> + </description> + </method> + <method name="get_closest_pos_in_segment" qualifiers="const"> + <return type="Vector3"> + </return> + <argument index="0" name="to_pos" type="Vector3"> + </argument> + <description> + </description> + </method> + <method name="get_id_path"> + <return type="IntArray"> + </return> + <argument index="0" name="from_id" type="int"> + </argument> + <argument index="1" name="to_id" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_point_path"> + <return type="Vector3Array"> + </return> + <argument index="0" name="from_id" type="int"> + </argument> + <argument index="1" name="to_id" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_point_pos" qualifiers="const"> + <return type="Vector3"> + </return> + <argument index="0" name="id" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_point_weight_scale" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="id" type="int"> + </argument> + <description> + </description> + </method> + <method name="remove_point"> + <argument index="0" name="id" type="int"> + </argument> + <description> + </description> + </method> + </methods> + <constants> + </constants> +</class> <class name="AcceptDialog" inherits="WindowDialog" category="Core"> <brief_description> Base dialog for user notification. @@ -4024,7 +4138,7 @@ </argument> <argument index="2" name="area_shape" type="int"> </argument> - <argument index="3" name="area_shape" type="int"> + <argument index="3" name="self_shape" type="int"> </argument> <description> This signal triggers only once when an area enters this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering. @@ -4044,7 +4158,7 @@ </argument> <argument index="2" name="area_shape" type="int"> </argument> - <argument index="3" name="area_shape" type="int"> + <argument index="3" name="self_shape" type="int"> </argument> <description> This signal triggers only once when an area exits this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering. @@ -4366,7 +4480,7 @@ </argument> <argument index="2" name="area_shape" type="int"> </argument> - <argument index="3" name="area_shape" type="int"> + <argument index="3" name="self_shape" type="int"> </argument> <description> This signal triggers only once when an area enters this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering. @@ -4386,7 +4500,7 @@ </argument> <argument index="2" name="area_shape" type="int"> </argument> - <argument index="3" name="area_shape" type="int"> + <argument index="3" name="self_shape" type="int"> </argument> <description> This signal triggers only once when an area exits this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering. @@ -6755,6 +6869,12 @@ <description> </description> </method> + <method name="get_custom_viewport" qualifiers="const"> + <return type="Viewport"> + </return> + <description> + </description> + </method> <method name="get_drag_margin" qualifiers="const"> <return type="float"> </return> @@ -6858,6 +6978,12 @@ <description> </description> </method> + <method name="set_custom_viewport"> + <argument index="0" name="viewport" type="Viewport"> + </argument> + <description> + </description> + </method> <method name="set_drag_margin"> <argument index="0" name="margin" type="int"> </argument> @@ -7560,6 +7686,12 @@ Canvas Item layer. [CanvasItem] nodes that are direct or indirect children of a [CanvasLayer] will be drawn in that layer. The layer is a numeric index that defines the draw order. The default 2D scene renders with index 0, so a [CanvasLayer] with index -1 will be drawn below, and one with index 1 will be drawn above. This is very useful for HUDs (in layer 1+ or above), or backgrounds (in layer -1 or below). </description> <methods> + <method name="get_custom_viewport" qualifiers="const"> + <return type="Viewport"> + </return> + <description> + </description> + </method> <method name="get_layer" qualifiers="const"> <return type="int"> </return> @@ -7602,13 +7734,6 @@ Return the base transform for this layer. </description> </method> - <method name="get_viewport" qualifiers="const"> - <return type="RID"> - </return> - <description> - Return the viewport RID for this layer. - </description> - </method> <method name="get_world_2d" qualifiers="const"> <return type="World2D"> </return> @@ -7616,6 +7741,12 @@ Return the [World2D] used by this layer. </description> </method> + <method name="set_custom_viewport"> + <argument index="0" name="viewport" type="Viewport"> + </argument> + <description> + </description> + </method> <method name="set_layer"> <argument index="0" name="layer" type="int"> </argument> @@ -8678,6 +8809,28 @@ <constants> </constants> </class> +<class name="ColorFrame" inherits="Control" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="get_frame_color" qualifiers="const"> + <return type="Color"> + </return> + <description> + </description> + </method> + <method name="set_frame_color"> + <argument index="0" name="color" type="Color"> + </argument> + <description> + </description> + </method> + </methods> + <constants> + </constants> +</class> <class name="ColorPicker" inherits="BoxContainer" category="Core"> <brief_description> Color picker control. @@ -11769,6 +11922,10 @@ Return true if this is a main screen editor plugin (it goes in the main screen selector together with 2D, 3D, Script). </description> </method> + <method name="hide_bottom_panel"> + <description> + </description> + </method> <method name="inspect_object"> <argument index="0" name="object" type="Object"> </argument> @@ -11778,6 +11935,12 @@ Inspect an object in the inspector. </description> </method> + <method name="make_bottom_panel_item_visible"> + <argument index="0" name="item" type="Control"> + </argument> + <description> + </description> + </method> <method name="make_visible" qualifiers="virtual"> <argument index="0" name="visible" type="bool"> </argument> @@ -12076,7 +12239,7 @@ <return type="Array"> </return> <description> - Get the list of selected nodes, optimized for transform operations (ie, moving them, rotating, etc). This list avoids situations where a node is selected and also chid/grandchild. + Get the list of selected nodes, optimized for transform operations (ie, moving them, rotating, etc). This list avoids situations where a node is selected and also chid/grandchild. </description> </method> <method name="remove_node"> @@ -16487,6 +16650,38 @@ Returns the current value of the joystick axis at given index (see JOY_* constants in [@Global Scope]) </description> </method> + <method name="get_joy_axis_index_from_string"> + <return type="int"> + </return> + <argument index="0" name="axis" type="String"> + </argument> + <description> + </description> + </method> + <method name="get_joy_axis_string"> + <return type="String"> + </return> + <argument index="0" name="axis_index" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_joy_button_index_from_string"> + <return type="int"> + </return> + <argument index="0" name="button" type="String"> + </argument> + <description> + </description> + </method> + <method name="get_joy_button_string"> + <return type="String"> + </return> + <argument index="0" name="button_index" type="int"> + </argument> + <description> + </description> + </method> <method name="get_joy_guid" qualifiers="const"> <return type="String"> </return> @@ -40910,6 +41105,16 @@ <description> </description> </signal> + <signal name="symbol_lookup"> + <argument index="0" name="symbol" type="String"> + </argument> + <argument index="1" name="row" type="int"> + </argument> + <argument index="2" name="column" type="int"> + </argument> + <description> + </description> + </signal> <signal name="text_changed"> <description> Emitted when the text changes. @@ -44541,6 +44746,14 @@ do_property]. Returns the angle in radians between the line connecting the two points and the x coordinate. </description> </method> + <method name="clamped"> + <return type="Vector2"> + </return> + <argument index="0" name="length" type="float"> + </argument> + <description> + </description> + </method> <method name="cubic_interpolate"> <return type="Vector2"> </return> @@ -45627,6 +45840,12 @@ do_property]. Return the 3D world of the viewport. </description> </method> + <method name="get_world_2d" qualifiers="const"> + <return type="World2D"> + </return> + <description> + </description> + </method> <method name="gui_get_drag_data" qualifiers="const"> <return type="Variant"> </return> @@ -45850,6 +46069,12 @@ do_property]. Change the 3D world of the viewport. </description> </method> + <method name="set_world_2d"> + <argument index="0" name="world_2d" type="World2D"> + </argument> + <description> + </description> + </method> <method name="unhandled_input"> <argument index="0" name="local_event" type="InputEvent"> </argument> @@ -46170,12 +46395,24 @@ do_property]. <description> </description> <methods> + <method name="get_aabb" qualifiers="const"> + <return type="AABB"> + </return> + <description> + </description> + </method> <method name="get_layer_mask" qualifiers="const"> <return type="int"> </return> <description> </description> </method> + <method name="get_transformed_aabb" qualifiers="const"> + <return type="AABB"> + </return> + <description> + </description> + </method> <method name="set_base"> <argument index="0" name="base" type="RID"> </argument> diff --git a/drivers/builtin_openssl2/SCsub b/drivers/builtin_openssl2/SCsub index a28bc2922c..0c035cc4a5 100644 --- a/drivers/builtin_openssl2/SCsub +++ b/drivers/builtin_openssl2/SCsub @@ -656,7 +656,8 @@ if "platform" in env and env["platform"] == "winrt": # Workaround for compilation error with GCC/Clang when -Werror is too greedy (GH-4517) import os -if not (os.name=="nt" and os.getenv("VSINSTALLDIR")!=None): # not Windows and not MSVC +import methods +if not (os.name=="nt" and methods.msvc_is_detected() ): # not Windows and not MSVC env_drivers.Append(CFLAGS=["-Wno-error=implicit-function-declaration"]) env_drivers.add_source_files(env.drivers_sources,openssl_sources) diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 56489cf4df..80ccf9be67 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -36,6 +36,7 @@ #include "servers/visual/particle_system_sw.h" #include "gl_context/context_gl.h" #include <string.h> +#include <stdlib.h> #ifdef GLEW_ENABLED #define _GL_HALF_FLOAT_OES 0x140B @@ -7018,6 +7019,10 @@ void RasterizerGLES2::_process_glow_bloom() { void RasterizerGLES2::_process_hdr() { + if (framebuffer.luminance.empty()) { + return; + } + glBindFramebuffer(GL_FRAMEBUFFER, framebuffer.luminance[0].fbo); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, framebuffer.color ); @@ -10812,11 +10817,11 @@ void RasterizerGLES2::init() { // Check for GL 2.1 compatibility, if not bail out if (!glewIsSupported("GL_VERSION_2_1")) { ERR_PRINT("Your system's graphic drivers seem not to support OpenGL 2.1 / GLES 2.0, sorry :(\n" - "Try a drivers update, buy a new GPU or try software rendering on Linux; Godot will now crash with a segmentation fault."); + "Try a drivers update, buy a new GPU or try software rendering on Linux; Godot is now going to terminate."); OS::get_singleton()->alert("Your system's graphic drivers seem not to support OpenGL 2.1 / GLES 2.0, sorry :(\n" "Godot Engine will self-destruct as soon as you acknowledge this error message.", "Fatal error: Insufficient OpenGL / GLES drivers"); - // TODO: If it's even possible, we should stop the execution without segfault and memory leaks :) + exit(1); } #endif diff --git a/main/input_default.cpp b/main/input_default.cpp index 2020f7a5ad..92f4a6fb72 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -1159,3 +1159,61 @@ Array InputDefault::get_connected_joysticks() { } return ret; } + +static const char* _buttons[] = { + "Face Button Bottom", + "Face Button Right", + "Face Button Left", + "Face Button Top", + "L", + "R", + "L2", + "R2", + "L3", + "R3", + "Select", + "Start", + "DPAD Up", + "DPAD Down", + "DPAD Left", + "DPAD Right" +}; + +static const char* _axes[] = { + "Left Stick X", + "Left Stick Y", + "Right Stick X", + "Right Stick Y", + "", + "", + "L2", + "R2" +}; + +String InputDefault::get_joy_button_string(int p_button) { + ERR_FAIL_INDEX_V(p_button, JOY_BUTTON_MAX, ""); + return _buttons[p_button]; +} + +int InputDefault::get_joy_button_index_from_string(String p_button) { + for (int i = 0; i < JOY_BUTTON_MAX; i++) { + if (p_button == _buttons[i]) { + return i; + } + } + ERR_FAIL_V(-1); +} + +String InputDefault::get_joy_axis_string(int p_axis) { + ERR_FAIL_INDEX_V(p_axis, JOY_AXIS_MAX, ""); + return _axes[p_axis]; +} + +int InputDefault::get_joy_axis_index_from_string(String p_axis) { + for (int i = 0; i < JOY_AXIS_MAX; i++) { + if (p_axis == _axes[i]) { + return i; + } + } + ERR_FAIL_V(-1); +} diff --git a/main/input_default.h b/main/input_default.h index fbf7837b3b..2db6d28abf 100644 --- a/main/input_default.h +++ b/main/input_default.h @@ -235,6 +235,11 @@ public: virtual bool is_joy_known(int p_device); virtual String get_joy_guid(int p_device) const; + virtual String get_joy_button_string(int p_button); + virtual String get_joy_axis_string(int p_axis); + virtual int get_joy_axis_index_from_string(String p_axis); + virtual int get_joy_button_index_from_string(String p_button); + bool is_joy_mapped(int p_device); String get_joy_guid_remapped(int p_device) const; void set_fallback_mapping(String p_guid); diff --git a/main/main.cpp b/main/main.cpp index d2ba38b094..a1f62c7628 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -560,6 +560,16 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas goto error; } + } else if (I->get()=="-epid") { + if (I->next()) { + + int editor_pid=I->next()->get().to_int(); + Globals::get_singleton()->set("editor_pid",editor_pid); + N=I->next()->next(); + } else { + goto error; + + } } else { //test for game path diff --git a/methods.py b/methods.py index c28ed55dda..c4951c69bd 100755 --- a/methods.py +++ b/methods.py @@ -1516,6 +1516,12 @@ def detect_visual_c_compiler_version(tools_env): return vc_chosen_compiler_str +def msvc_is_detected() : + # looks for VisualStudio env variable + # or for Visual C++ Build Tools (which is a standalone MSVC) + return os.getenv("VSINSTALLDIR") or os.getenv("VS100COMNTOOLS") or os.getenv("VS110COMNTOOLS") or os.getenv("VS120COMNTOOLS") or os.getenv("VS140COMNTOOLS"); + + def precious_program(env, program, sources, **args): program = env.ProgramOriginal(program, sources, **args) env.Precious(program) diff --git a/modules/enet/networked_multiplayer_enet.cpp b/modules/enet/networked_multiplayer_enet.cpp index 18a4347edf..4134ed037f 100644 --- a/modules/enet/networked_multiplayer_enet.cpp +++ b/modules/enet/networked_multiplayer_enet.cpp @@ -359,7 +359,7 @@ Error NetworkedMultiplayerENet::get_packet(const uint8_t **r_buffer,int &r_buffe incoming_packets.pop_front(); *r_buffer=(const uint8_t*)(¤t_packet.packet->data[12]); - r_buffer_size=current_packet.packet->dataLength; + r_buffer_size=current_packet.packet->dataLength-12; return OK; } diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 4e395a6f9f..862709fc7d 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -132,15 +132,10 @@ void OS_Android::initialize(const VideoMode& p_desired,int p_video_driver,int p_ AudioDriverManagerSW::add_driver(&audio_driver_android); - if (true) { - RasterizerGLES2 *rasterizer_gles22=memnew( RasterizerGLES2(false,use_reload_hooks,false,use_reload_hooks ) ); - if (gl_extensions) - rasterizer_gles22->set_extensions(gl_extensions); - rasterizer = rasterizer_gles22; - } else { - //rasterizer = memnew( RasterizerGLES1(use_reload_hooks, use_reload_hooks) ); - - } + RasterizerGLES2 *rasterizer_gles22=memnew( RasterizerGLES2(false,use_reload_hooks,false,use_reload_hooks ) ); + if (gl_extensions) + rasterizer_gles22->set_extensions(gl_extensions); + rasterizer = rasterizer_gles22; rasterizer->set_force_16_bits_fbo(use_16bits_fbo); diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 0548b84cfa..12ea5a93ee 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -1,10 +1,11 @@ # -# tested on | Windows native | Linux cross-compilation -# ------------------------+-------------------+--------------------------- -# MSVS C++ 2010 Express | WORKS | n/a -# Mingw-w64 | WORKS | WORKS -# Mingw-w32 | WORKS | WORKS -# MinGW | WORKS | untested +# tested on | Windows native | Linux cross-compilation +# ----------------------------+-------------------+--------------------------- +# MSVS C++ 2010 Express | WORKS | n/a +# Visual C++ Build Tools 2015 | WORKS | n/a +# Mingw-w64 | WORKS | WORKS +# Mingw-w32 | WORKS | WORKS +# MinGW | WORKS | untested # ##### # Notes about MSVS C++ : @@ -12,6 +13,12 @@ # - MSVC2010-Express compiles to 32bits only. # ##### +# Note about Visual C++ Build Tools : +# +# - Visual C++ Build Tools is the standalone MSVC compiler : +# http://landinghub.visualstudio.com/visual-cpp-build-tools +# +##### # Notes about Mingw-w64 and Mingw-w32 under Windows : # # - both can be installed using the official installer : @@ -78,7 +85,7 @@ ##### # TODO : -# +# # - finish to cleanup this script to remove all the remains of previous hacks and workarounds # - make it work with the Windows7 SDK that is supposed to enable 64bits compilation for MSVC2010-Express # - confirm it works well with other Visual Studio versions. @@ -102,7 +109,7 @@ def can_build(): if (os.name=="nt"): #building natively on windows! - if (os.getenv("VSINSTALLDIR")): + if ( methods.msvc_is_detected() ): return True else: print("\nMSVC not detected, attempting Mingw.") @@ -197,7 +204,7 @@ def configure(env): env.Append(CPPPATH=['#platform/windows']) env['is_mingw']=False - if (os.name=="nt" and os.getenv("VSINSTALLDIR")!=None): + if (os.name=="nt" and methods.msvc_is_detected() ): #build using visual studio env['ENV']['TMP'] = os.environ['TMP'] env.Append(CPPPATH=['#platform/windows/include']) diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index cebafdabce..35d90a8308 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1312,10 +1312,13 @@ void OS_Windows::finalize_core() { void OS_Windows::vprint(const char* p_format, va_list p_list, bool p_stderr) { - char buf[16384+1]; - int len = vsnprintf(buf,16384,p_format,p_list); + const unsigned int BUFFER_SIZE = 16384; + char buf[BUFFER_SIZE+1]; // +1 for the terminating character + int len = vsnprintf(buf,BUFFER_SIZE,p_format,p_list); if (len<=0) return; + if(len >= BUFFER_SIZE) + len = BUFFER_SIZE; // Output is too big, will be truncated buf[len]=0; @@ -2154,10 +2157,15 @@ String OS_Windows::get_stdin_string(bool p_block) { } +void OS_Windows::enable_for_stealing_focus(ProcessID pid) { + + AllowSetForegroundWindow(pid); + +} + void OS_Windows::move_window_to_foreground() { SetForegroundWindow(hWnd); - BringWindowToTop(hWnd); } diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index e3e037e57b..70ef694957 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -269,6 +269,7 @@ public: virtual String get_locale() const; virtual LatinKeyboardVariant get_latin_keyboard_variant() const; + virtual void enable_for_stealing_focus(ProcessID pid); virtual void move_window_to_foreground(); virtual String get_data_dir() const; virtual String get_system_dir(SystemDir p_dir) const; diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index 71728966fd..e8954b7e98 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -650,8 +650,8 @@ void Area2D::_bind_methods() { ADD_SIGNAL( MethodInfo("body_enter",PropertyInfo(Variant::OBJECT,"body",PROPERTY_HINT_RESOURCE_TYPE,"PhysicsBody2D"))); ADD_SIGNAL( MethodInfo("body_exit",PropertyInfo(Variant::OBJECT,"body",PROPERTY_HINT_RESOURCE_TYPE,"PhysicsBody2D"))); - ADD_SIGNAL( MethodInfo("area_enter_shape",PropertyInfo(Variant::INT,"area_id"),PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area2D"),PropertyInfo(Variant::INT,"area_shape"),PropertyInfo(Variant::INT,"area_shape"))); - ADD_SIGNAL( MethodInfo("area_exit_shape",PropertyInfo(Variant::INT,"area_id"),PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area2D"),PropertyInfo(Variant::INT,"area_shape"),PropertyInfo(Variant::INT,"area_shape"))); + ADD_SIGNAL( MethodInfo("area_enter_shape",PropertyInfo(Variant::INT,"area_id"),PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area2D"),PropertyInfo(Variant::INT,"area_shape"),PropertyInfo(Variant::INT,"self_shape"))); + ADD_SIGNAL( MethodInfo("area_exit_shape",PropertyInfo(Variant::INT,"area_id"),PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area2D"),PropertyInfo(Variant::INT,"area_shape"),PropertyInfo(Variant::INT,"self_shape"))); ADD_SIGNAL( MethodInfo("area_enter",PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area2D"))); ADD_SIGNAL( MethodInfo("area_exit",PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area2D"))); diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp index a8a4122016..c1d0d1a97c 100644 --- a/scene/3d/area.cpp +++ b/scene/3d/area.cpp @@ -640,8 +640,8 @@ void Area::_bind_methods() { ADD_SIGNAL( MethodInfo("body_enter",PropertyInfo(Variant::OBJECT,"body"))); ADD_SIGNAL( MethodInfo("body_exit",PropertyInfo(Variant::OBJECT,"body"))); - ADD_SIGNAL( MethodInfo("area_enter_shape",PropertyInfo(Variant::INT,"area_id"),PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area"),PropertyInfo(Variant::INT,"area_shape"),PropertyInfo(Variant::INT,"area_shape"))); - ADD_SIGNAL( MethodInfo("area_exit_shape",PropertyInfo(Variant::INT,"area_id"),PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area"),PropertyInfo(Variant::INT,"area_shape"),PropertyInfo(Variant::INT,"area_shape"))); + ADD_SIGNAL( MethodInfo("area_enter_shape",PropertyInfo(Variant::INT,"area_id"),PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area"),PropertyInfo(Variant::INT,"area_shape"),PropertyInfo(Variant::INT,"self_shape"))); + ADD_SIGNAL( MethodInfo("area_exit_shape",PropertyInfo(Variant::INT,"area_id"),PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area"),PropertyInfo(Variant::INT,"area_shape"),PropertyInfo(Variant::INT,"self_shape"))); ADD_SIGNAL( MethodInfo("area_enter",PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area"))); ADD_SIGNAL( MethodInfo("area_exit",PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area"))); diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 89cd509fbd..f69ad8fa7e 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -959,7 +959,23 @@ void ItemList::_notification(int p_what) { shape_changed=false; } + //ensure_selected_visible needs to be checked before we draw the list. + if (ensure_selected_visible && current>=0 && current <=items.size()) { + Rect2 r = items[current].rect_cache; + int from = scroll_bar->get_val(); + int to = from + scroll_bar->get_page(); + + if (r.pos.y < from) { + scroll_bar->set_val(r.pos.y); + } else if (r.pos.y+r.size.y > to) { + scroll_bar->set_val(r.pos.y+r.size.y - (to-from)); + } + + + } + + ensure_selected_visible=false; Vector2 base_ofs = bg->get_offset(); base_ofs.y-=int(scroll_bar->get_val()); @@ -1147,25 +1163,6 @@ void ItemList::_notification(int p_what) { for(int i=0;i<separators.size();i++) { draw_line(Vector2(bg->get_margin(MARGIN_LEFT),base_ofs.y+separators[i]),Vector2(size.width-bg->get_margin(MARGIN_LEFT),base_ofs.y+separators[i]),guide_color); } - - - if (ensure_selected_visible && current>=0 && current <=items.size()) { - - Rect2 r = items[current].rect_cache; - int from = scroll_bar->get_val(); - int to = from + scroll_bar->get_page(); - - if (r.pos.y < from) { - scroll_bar->set_val(r.pos.y); - } else if (r.pos.y+r.size.y > to) { - scroll_bar->set_val(r.pos.y+r.size.y - (to-from)); - } - - - } - - ensure_selected_visible=false; - } } diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 9e58199f35..f7d74b2b49 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -639,6 +639,7 @@ void LineEdit::_notification(int p_what) { if(text.empty()) font_color.a *= placeholder_alpha; + int caret_height = font->get_height() > y_area ? y_area : font->get_height(); while(true) { //end of string, break! @@ -657,14 +658,14 @@ void LineEdit::_notification(int p_what) { bool selected=selection.enabled && char_ofs>=selection.begin && char_ofs<selection.end; if (selected) - VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs), Size2(char_width, y_area)), selection_color); + VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs), Size2(char_width, caret_height)), selection_color); font->draw_char(ci, Point2(x_ofs, y_ofs + font_ascent), cchar, next, selected ? font_color_selected : font_color); if (char_ofs==cursor_pos && draw_caret) { VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2( - Point2( x_ofs , y_ofs ), Size2( 1, y_area ) ), cursor_color ); + Point2( x_ofs , y_ofs ), Size2( 1, caret_height ) ), cursor_color ); } x_ofs+=char_width; @@ -673,7 +674,7 @@ void LineEdit::_notification(int p_what) { if (char_ofs==cursor_pos && draw_caret) {//may be at the end VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2( - Point2( x_ofs , y_ofs ), Size2( 1, y_area ) ), cursor_color ); + Point2( x_ofs , y_ofs ), Size2( 1, caret_height ) ), cursor_color ); } } break; case NOTIFICATION_FOCUS_ENTER: { diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 20794b2faa..5a614fb1b2 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -32,6 +32,7 @@ #include "os/keyboard.h" #include "globals.h" #include "os/input.h" +#include "scene/main/viewport.h" @@ -829,6 +830,8 @@ void Tree::update_cache() { cache.guide_width=get_constant("guide_width"); cache.draw_relationship_lines=get_constant("draw_relationship_lines"); cache.relationship_line_color=get_color("relationship_line_color"); + cache.scroll_border=get_constant("scroll_border"); + cache.scroll_speed=get_constant("scroll_speed"); cache.title_button = get_stylebox("title_button_normal"); cache.title_button_pressed = get_stylebox("title_button_pressed"); @@ -2681,11 +2684,17 @@ void Tree::_notification(int p_what) { if (p_what==NOTIFICATION_DRAG_END) { drop_mode_flags=0; + scrolling = false; + set_fixed_process(false); update(); } if (p_what==NOTIFICATION_DRAG_BEGIN) { single_select_defer=NULL; + if (cache.scroll_speed > 0 && get_rect().has_point(get_viewport()->get_mouse_pos() - get_global_pos())) { + scrolling = true; + set_fixed_process(true); + } } if (p_what==NOTIFICATION_FIXED_PROCESS) { @@ -2731,6 +2740,28 @@ void Tree::_notification(int p_what) { } } + + if (scrolling) { + Point2 point = get_viewport()->get_mouse_pos() - get_global_pos(); + if (point.x < cache.scroll_border) { + point.x -= cache.scroll_border; + } else if (point.x > get_size().width - cache.scroll_border) { + point.x -= get_size().width - cache.scroll_border; + } else { + point.x = 0; + } + if (point.y < cache.scroll_border) { + point.y -= cache.scroll_border; + } else if (point.y > get_size().height - cache.scroll_border) { + point.y -= get_size().height - cache.scroll_border; + } else { + point.y = 0; + } + point *= cache.scroll_speed * get_fixed_process_delta_time(); + point += get_scroll(); + h_scroll->set_val(point.x); + v_scroll->set_val(point.y); + } } if (p_what==NOTIFICATION_DRAW) { diff --git a/scene/gui/tree.h b/scene/gui/tree.h index 2124dce749..6c2f1dae40 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -390,6 +390,8 @@ friend class TreeItem; int button_margin; Point2 offset; int draw_relationship_lines; + int scroll_border; + int scroll_speed; enum ClickType { CLICK_NONE, @@ -448,6 +450,7 @@ friend class TreeItem; bool drag_touching_deaccel; bool click_handled; bool allow_rmb_select; + bool scrolling; bool force_select_on_already_selected; diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index dea612735c..0740b591c4 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -714,6 +714,8 @@ void fill_default_theme(Ref<Theme>& t, const Ref<Font> & default_font, const Ref t->set_constant("item_margin","Tree",12 *scale); t->set_constant("button_margin","Tree",4 *scale); t->set_constant("draw_relationship_lines", "Tree", 0); + t->set_constant("scroll_border", "Tree", 4); + t->set_constant("scroll_speed", "Tree", 12); // ItemList diff --git a/tools/editor/animation_editor.cpp b/tools/editor/animation_editor.cpp index 2f67df1fc3..a556031e5e 100644 --- a/tools/editor/animation_editor.cpp +++ b/tools/editor/animation_editor.cpp @@ -1933,12 +1933,20 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { if (mb.button_index==BUTTON_WHEEL_UP && mb.pressed) { - v_scroll->set_val( v_scroll->get_val() - v_scroll->get_page() / 8 ); + if (mb.mod.command) { + zoom->set_val(zoom->get_val() + zoom->get_step()); + } else { + v_scroll->set_val( v_scroll->get_val() - v_scroll->get_page() / 8 ); + } } if (mb.button_index==BUTTON_WHEEL_DOWN && mb.pressed) { - v_scroll->set_val( v_scroll->get_val() + v_scroll->get_page() / 8 ); + if (mb.mod.command) { + zoom->set_val(zoom->get_val() - zoom->get_step()); + } else { + v_scroll->set_val( v_scroll->get_val() + v_scroll->get_page() / 8 ); + } } if (mb.button_index==BUTTON_RIGHT && mb.pressed) { diff --git a/tools/editor/editor_log.cpp b/tools/editor/editor_log.cpp index 20613467d3..02af9712a8 100644 --- a/tools/editor/editor_log.cpp +++ b/tools/editor/editor_log.cpp @@ -161,7 +161,7 @@ void EditorLog::_undo_redo_cbk(void *p_self,const String& p_name) { void EditorLog::_bind_methods() { ObjectTypeDB::bind_method(_MD("_clear_request"),&EditorLog::_clear_request ); - + ObjectTypeDB::bind_method("_override_logger_styles",&EditorLog::_override_logger_styles ); //ObjectTypeDB::bind_method(_MD("_dragged"),&EditorLog::_dragged ); ADD_SIGNAL( MethodInfo("clear_request")); } @@ -193,11 +193,10 @@ EditorLog::EditorLog() { ec->set_custom_minimum_size(Size2(0,180)); ec->set_v_size_flags(SIZE_EXPAND_FILL); - - PanelContainer *pc = memnew( PanelContainer ); - pc->add_style_override("panel",get_stylebox("normal","TextEdit")); + pc = memnew( PanelContainer ); ec->add_child(pc); pc->set_area_as_parent_rect(); + pc->connect("enter_tree", this, "_override_logger_styles"); log = memnew( RichTextLabel ); log->set_scroll_follow(true); @@ -224,6 +223,11 @@ void EditorLog::deinit() { } +void EditorLog::_override_logger_styles() { + + pc->add_style_override("panel",get_stylebox("normal","TextEdit")); + +} EditorLog::~EditorLog() { diff --git a/tools/editor/editor_log.h b/tools/editor/editor_log.h index 699be710d8..bbf35b63cb 100644 --- a/tools/editor/editor_log.h +++ b/tools/editor/editor_log.h @@ -50,6 +50,7 @@ class EditorLog : public VBoxContainer { HBoxContainer *title_hb; // PaneDrag *pd; Control *ec; + PanelContainer *pc; static void _error_handler(void *p_self, const char*p_func, const char*p_file,int p_line, const char*p_error,const char*p_errorexp,ErrorHandlerType p_type); @@ -64,6 +65,7 @@ protected: static void _bind_methods(); void _notification(int p_what); + void _override_logger_styles(); public: void add_message(const String& p_msg, bool p_error=false); diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index fe97fe2881..8274272a7e 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -2678,7 +2678,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { } break; case RUN_PLAY_NATIVE: { - + bool autosave = EDITOR_DEF("run/auto_save_before_running",true); if (autosave) { _menu_option_confirm(FILE_SAVE_ALL_SCENES, false); diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index 2fae5daced..0393cd19a9 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -700,6 +700,7 @@ public: void notify_child_process_exited(); + OS::ProcessID get_child_process_id() const { return editor_run.get_pid(); } void stop_child_process(); Ref<Theme> get_editor_theme() const { return theme; } diff --git a/tools/editor/editor_run.cpp b/tools/editor/editor_run.cpp index fb0f24c084..5fbb4ae2a0 100644 --- a/tools/editor/editor_run.cpp +++ b/tools/editor/editor_run.cpp @@ -52,6 +52,9 @@ Error EditorRun::run(const String& p_scene,const String p_custom_args,const List args.push_back("localhost:"+String::num(GLOBAL_DEF("debug/debug_port", 6007))); } + args.push_back("-epid"); + args.push_back(String::num(OS::get_singleton()->get_process_ID())); + if (p_custom_args!="") { Vector<String> cargs=p_custom_args.split(" ",false); @@ -132,6 +135,7 @@ Error EditorRun::run(const String& p_scene,const String p_custom_args,const List } + if (p_breakpoints.size()) { args.push_back("-bp"); diff --git a/tools/editor/editor_run.h b/tools/editor/editor_run.h index 0b96a2c91c..5aa2adf801 100644 --- a/tools/editor/editor_run.h +++ b/tools/editor/editor_run.h @@ -53,6 +53,8 @@ public: void run_native_notify() { status=STATUS_PLAY; } void stop(); + OS::ProcessID get_pid() const { return pid; } + void set_debug_collisions(bool p_debug); bool get_debug_collisions() const; diff --git a/tools/editor/plugins/theme_editor_plugin.cpp b/tools/editor/plugins/theme_editor_plugin.cpp index 5db331ba45..84568aa8c0 100644 --- a/tools/editor/plugins/theme_editor_plugin.cpp +++ b/tools/editor/plugins/theme_editor_plugin.cpp @@ -668,7 +668,7 @@ ThemeEditor::ThemeEditor() { theme_menu = memnew( MenuButton ); - theme_menu->set_text("Theme"); + theme_menu->set_text(TTR("Theme")); theme_menu->get_popup()->add_item(TTR("Add Item"),POPUP_ADD); theme_menu->get_popup()->add_item(TTR("Add Class Items"),POPUP_CLASS_ADD); theme_menu->get_popup()->add_item(TTR("Remove Item"),POPUP_REMOVE); diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp index b2eae2f6d1..18a4e845a0 100644 --- a/tools/editor/project_manager.cpp +++ b/tools/editor/project_manager.cpp @@ -506,7 +506,7 @@ void ProjectManager::_panel_draw(Node *p_hb) { hb->draw_line(Point2(0,hb->get_size().y+1),Point2(hb->get_size().x-10,hb->get_size().y+1),get_color("guide_color","Tree")); if (selected_list.has(hb->get_meta("name"))) { - hb->draw_style_box(get_stylebox("selected","Tree"),Rect2(Point2(),hb->get_size()-Size2(10,0))); + hb->draw_style_box( gui_base->get_stylebox("selected","Tree"),Rect2(Point2(),hb->get_size()-Size2(10,0))); } } @@ -753,7 +753,7 @@ void ProjectManager::_load_recent_projects() { List<PropertyInfo> properties; EditorSettings::get_singleton()->get_property_list(&properties); - Color font_color = get_color("font_color","Tree"); + Color font_color = gui_base->get_color("font_color","Tree"); List<ProjectItem> projects; List<ProjectItem> favorite_projects; @@ -864,6 +864,7 @@ void ProjectManager::_load_recent_projects() { hb->set_meta("favorite",is_favorite); hb->connect("draw",this,"_panel_draw",varray(hb)); hb->connect("input_event",this,"_panel_input",varray(hb)); + hb->add_constant_override("separation",10*EDSCALE); VBoxContainer *favorite_box = memnew( VBoxContainer ); TextureButton *favorite = memnew( TextureButton ); @@ -885,7 +886,7 @@ void ProjectManager::_load_recent_projects() { ec->set_custom_minimum_size(Size2(0,1)); vb->add_child(ec); Label *title = memnew( Label(project_name) ); - title->add_font_override("font",get_font("large","Fonts")); + title->add_font_override("font", gui_base->get_font("large","Fonts")); title->add_color_override("font_color",font_color); vb->add_child(title); Label *fpath = memnew( Label(path) ); @@ -1205,6 +1206,7 @@ ProjectManager::ProjectManager() { gui_base = memnew( Control ); add_child(gui_base); gui_base->set_area_as_parent_rect(); + gui_base->set_theme(create_custom_theme()); Panel *panel = memnew( Panel ); gui_base->add_child(panel); @@ -1227,7 +1229,7 @@ ProjectManager::ProjectManager() { CenterContainer *ccl = memnew( CenterContainer ); Label *l = memnew( Label ); l->set_text(_MKSTR(VERSION_NAME)+String(" - ")+TTR("Project Manager")); - l->add_font_override("font",get_font("doc","EditorFonts")); + l->add_font_override("font", gui_base->get_font("doc","EditorFonts")); ccl->add_child(l); top_hb->add_child(ccl); top_hb->add_spacer(); @@ -1263,7 +1265,7 @@ ProjectManager::ProjectManager() { search_tree_vb->add_child(search_box); PanelContainer *pc = memnew( PanelContainer); - pc->add_style_override("panel",get_stylebox("bg","Tree")); + pc->add_style_override("panel", gui_base->get_stylebox("bg","Tree")); search_tree_vb->add_child(pc); pc->set_v_size_flags(SIZE_EXPAND_FILL); @@ -1392,8 +1394,6 @@ ProjectManager::ProjectManager() { last_clicked = ""; SceneTree::get_singleton()->connect("files_dropped", this, "_files_dropped"); - - gui_base->set_theme(create_custom_theme()); } diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index 1a8d373f7f..7163836f73 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -3049,7 +3049,7 @@ void PropertyEditor::update_tree() { if (E) { descr=E->get().brief_description; } - class_descr_cache[type]=descr.world_wrap(80); + class_descr_cache[type]=descr.word_wrap(80); } @@ -3142,7 +3142,7 @@ void PropertyEditor::update_tree() { if (E) { for(int i=0;i<E->get().methods.size();i++) { if (E->get().methods[i].name==setter.operator String()) { - descr=E->get().methods[i].description.strip_edges().world_wrap(80); + descr=E->get().methods[i].description.strip_edges().word_wrap(80); } } } @@ -3182,6 +3182,7 @@ void PropertyEditor::update_tree() { item->set_cell_mode( 1, TreeItem::CELL_MODE_CHECK ); item->set_text(1,TTR("On")); + item->set_tooltip(1, obj->get(p.name) ? "True" : "False"); item->set_checked( 1, obj->get( p.name ) ); if (show_type_icons) item->set_icon( 0, get_icon("Bool","EditorIcons") ); @@ -3828,6 +3829,7 @@ void PropertyEditor::_item_edited() { case Variant::BOOL: { _edit_set(name,item->is_checked(1)); + item->set_tooltip(1, item->is_checked(1) ? "True" : "False"); } break; case Variant::INT: case Variant::REAL: { diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp index e5a97fa26e..53bfe8cc57 100644 --- a/tools/editor/scene_tree_editor.cpp +++ b/tools/editor/scene_tree_editor.cpp @@ -254,7 +254,7 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item,int p_column,int p_id) String config_err = n->get_configuration_warning(); if (config_err==String()) return; - config_err=config_err.world_wrap(80); + config_err=config_err.word_wrap(80); warning->set_text(config_err); warning->popup_centered_minsize(); diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp index 7fba73ca08..c8170ca9a3 100644 --- a/tools/editor/script_editor_debugger.cpp +++ b/tools/editor/script_editor_debugger.cpp @@ -216,6 +216,8 @@ void ScriptEditorDebugger::debug_continue() { ERR_FAIL_COND(connection.is_null()); ERR_FAIL_COND(!connection->is_connected()); + OS::get_singleton()->enable_for_stealing_focus(EditorNode::get_singleton()->get_child_process_id()); + Array msg; msg.push_back("continue"); ppeer->put_var(msg); |