diff options
22 files changed, 175 insertions, 84 deletions
diff --git a/core/input_map.cpp b/core/input_map.cpp index 3a0f9596f5..09cb7ce426 100644 --- a/core/input_map.cpp +++ b/core/input_map.cpp @@ -232,64 +232,6 @@ bool InputMap::event_is_action(const InputEvent& p_event, const StringName& p_ac return _find_event(E->get().inputs,p_event)!=NULL; } -bool InputMap::event_is_joy_motion_action_pressed(const InputEvent& p_event) const { - - ERR_FAIL_COND_V(p_event.type!=InputEvent::JOYSTICK_MOTION,false); - bool pressed=false; - - //this could be optimized by having a separate list of joymotions? - - for (Map<StringName, Action>::Element *A=input_map.front();A;A=A->next()) { - - for (List<InputEvent>::Element *E=A->get().inputs.front();E;E=E->next()) { - - const InputEvent& e=E->get(); - if(e.type!=p_event.type) - continue; - if (e.type!=InputEvent::KEY && e.device!=p_event.device) - continue; - - switch(p_event.type) { - - case InputEvent::KEY: { - - if (e.key.scancode==p_event.key.scancode && e.key.mod == p_event.key.mod) - return e.key.pressed; - - } break; - case InputEvent::JOYSTICK_BUTTON: { - - if (e.joy_button.button_index==p_event.joy_button.button_index) { - return e.joy_button.pressed; - } - - } break; - case InputEvent::MOUSE_BUTTON: { - - if (e.mouse_button.button_index==p_event.mouse_button.button_index) { - return e.mouse_button.pressed; - } - - } break; - case InputEvent::JOYSTICK_MOTION: { - - if (e.joy_motion.axis==p_event.joy_motion.axis) { - if ( - (e.joy_motion.axis_value * p_event.joy_motion.axis_value >0) && //same axis - ABS(e.joy_motion.axis_value)>0.5 && ABS(p_event.joy_motion.axis_value)>0.5 ) - pressed=true; - } - - } break; - } - - } - } - - return pressed; - -} - const Map<StringName, InputMap::Action>& InputMap::get_action_map() const { return input_map; } diff --git a/core/input_map.h b/core/input_map.h index a224765d8c..21c479588d 100644 --- a/core/input_map.h +++ b/core/input_map.h @@ -72,7 +72,6 @@ public: const List<InputEvent> *get_action_list(const StringName& p_action); bool event_is_action(const InputEvent& p_event, const StringName& p_action) const; - bool event_is_joy_motion_action_pressed(const InputEvent& p_event) const; const Map<StringName, Action>& get_action_map() const; void load_from_globals(); diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp index 9d920724e1..9982767be1 100644 --- a/core/os/input_event.cpp +++ b/core/os/input_event.cpp @@ -204,7 +204,7 @@ bool InputEvent::is_pressed() const { case MOUSE_BUTTON: return mouse_button.pressed; case JOYSTICK_BUTTON: return joy_button.pressed; case SCREEN_TOUCH: return screen_touch.pressed; - case JOYSTICK_MOTION: return InputMap::get_singleton()->event_is_joy_motion_action_pressed(*this); + case JOYSTICK_MOTION: return ABS(joy_motion.axis_value) > 0.5; case ACTION: return action.pressed; default: {} } diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 6865bb1378..f6ea8b08ee 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -11697,6 +11697,13 @@ Get the general settings for the editor (the same window that appears in the Settings menu). </description> </method> + <method name="get_editor_viewport"> + <return type="Control"> + </return> + <description> + Get the main editor control. Use this as a parent for main screens. + </description> + </method> <method name="get_name" qualifiers="virtual"> <return type="String"> </return> diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 8350fb0674..d5becc0bfc 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -4666,7 +4666,7 @@ void RasterizerGLES2::_update_shader( Shader* p_shader) const { enablers.push_back("#define USE_LIGHT_SHADER_CODE\n"); } if (light_flags.uses_shadow_color) { - enablers.push_back("#define USE_LIGHT_SHADOW_COLOR\n"); + enablers.push_back("#define USE_OUTPUT_SHADOW_COLOR\n"); } if (light_flags.uses_time || fragment_flags.uses_time || vertex_flags.uses_time) { enablers.push_back("#define USE_TIME\n"); @@ -4709,7 +4709,7 @@ void RasterizerGLES2::_update_shader( Shader* p_shader) const { enablers.push_back("#define USE_TEXPIXEL_SIZE\n"); } if (light_flags.uses_shadow_color) { - enablers.push_back("#define USE_LIGHT_SHADOW_COLOR\n"); + enablers.push_back("#define USE_OUTPUT_SHADOW_COLOR\n"); } if (vertex_flags.uses_worldvec) { diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp index 3be0fdab17..d4636ed444 100644 --- a/drivers/gles2/shader_compiler_gles2.cpp +++ b/drivers/gles2/shader_compiler_gles2.cpp @@ -904,6 +904,7 @@ ShaderCompilerGLES2::ShaderCompilerGLES2() { mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["LIGHT_VEC"]="light_vec"; mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["LIGHT_HEIGHT"]="light_height"; mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["LIGHT_COLOR"]="light"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["LIGHT_SHADOW"]="light_shadow_color"; mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["LIGHT_UV"]="light_uv"; mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["LIGHT"]="light_out"; mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["SHADOW"]="shadow_color"; diff --git a/drivers/gles2/shaders/canvas.glsl b/drivers/gles2/shaders/canvas.glsl index 285abd30ff..5f4767940d 100644 --- a/drivers/gles2/shaders/canvas.glsl +++ b/drivers/gles2/shaders/canvas.glsl @@ -244,7 +244,7 @@ FRAGMENT_SHADER_CODE vec2 light_uv = light_uv_interp.xy; vec4 light = texture2D(light_texture,light_uv) * light_color; -#if defined(USE_LIGHT_SHADOW_COLOR) +#if defined(USE_OUTPUT_SHADOW_COLOR) vec4 shadow_color=vec4(0.0,0.0,0.0,0.0); #endif @@ -380,7 +380,7 @@ LIGHT_SHADER_CODE #endif -#if defined(USE_LIGHT_SHADOW_COLOR) +#if defined(USE_OUTPUT_SHADOW_COLOR) color=mix(shadow_color,color,shadow_attenuation); #else //color*=shadow_attenuation; diff --git a/drivers/gles2/shaders/material.glsl b/drivers/gles2/shaders/material.glsl index fd778f3442..477a451f2f 100644 --- a/drivers/gles2/shaders/material.glsl +++ b/drivers/gles2/shaders/material.glsl @@ -1185,7 +1185,7 @@ FRAGMENT_SHADER_CODE vec3 mdiffuse = diffuse.rgb; vec3 light; -#if defined(USE_LIGHT_SHADOW_COLOR) +#if defined(USE_OUTPUT_SHADOW_COLOR) vec3 shadow_color=vec3(0.0,0.0,0.0); #endif @@ -1209,7 +1209,7 @@ LIGHT_SHADER_CODE #endif diffuse.rgb = const_light_mult * ambient_light *diffuse.rgb + light * attenuation * shadow_attenuation; -#if defined(USE_LIGHT_SHADOW_COLOR) +#if defined(USE_OUTPUT_SHADOW_COLOR) diffuse.rgb += light * shadow_color * attenuation * (1.0 - shadow_attenuation); #endif diff --git a/drivers/vorbis/SCsub b/drivers/vorbis/SCsub index 87805cc2d8..4afafcc4ba 100644 --- a/drivers/vorbis/SCsub +++ b/drivers/vorbis/SCsub @@ -5,7 +5,7 @@ sources = [ ] sources_lib = [ - "vorbis/analysis.c", + #"vorbis/analysis.c", #"vorbis/barkmel.c", "vorbis/bitrate.c", "vorbis/block.c", @@ -27,7 +27,7 @@ sources_lib = [ "vorbis/smallft.c", "vorbis/synthesis.c", #"vorbis/tone.c", - "vorbis/vorbisenc.c", + #"vorbis/vorbisenc.c", "vorbis/vorbisfile.c", "vorbis/window.c", ] diff --git a/main/input_default.cpp b/main/input_default.cpp index 089772edc5..2020f7a5ad 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -849,6 +849,13 @@ uint32_t InputDefault::joy_axis(uint32_t p_last_id, int p_device, int p_axis, co return p_last_id; } + if (ABS(joy.last_axis[p_axis]) > 0.5 && joy.last_axis[p_axis] * p_value.value < 0) { + //changed direction quickly, insert fake event to release pending inputmap actions + JoyAxis jx; + jx.min = p_value.min; + jx.value = p_value.value < 0 ? 0.1 : -0.1; + p_last_id = joy_axis(p_last_id, p_device, p_axis, jx); + } joy.last_axis[p_axis] = p_value.value; float val = p_value.min == 0 ? -1.0f + 2.0f * p_value.value : p_value.value; diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp index 40ae26ba5d..02faa9425d 100644 --- a/scene/resources/shader_graph.cpp +++ b/scene/resources/shader_graph.cpp @@ -1483,6 +1483,8 @@ const ShaderGraph::InOutParamInfo ShaderGraph::inout_param_info[]={ {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"LightColor","LIGHT_COLOR.rgb","",SLOT_TYPE_VEC,SLOT_IN}, {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"LightAlpha","LIGHT_COLOR.a","",SLOT_TYPE_SCALAR,SLOT_IN}, {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"LightHeight","LIGHT_HEIGHT","",SLOT_TYPE_SCALAR,SLOT_IN}, + {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"ShadowColor","LIGHT_SHADOW.rgb","",SLOT_TYPE_VEC,SLOT_IN}, + {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"ShadowAlpha","LIGHT_SHADOW.a","",SLOT_TYPE_SCALAR,SLOT_IN}, {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"TexPixelSize","vec3(TEXTURE_PIXEL_SIZE,0)","",SLOT_TYPE_VEC,SLOT_IN}, {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"Var1","VAR1.rgb","",SLOT_TYPE_VEC,SLOT_IN}, {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"Var2","VAR2.rgb","",SLOT_TYPE_VEC,SLOT_IN}, @@ -1490,6 +1492,8 @@ const ShaderGraph::InOutParamInfo ShaderGraph::inout_param_info[]={ //canvas item light out {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"LightColor","LIGHT.rgb","",SLOT_TYPE_VEC,SLOT_OUT}, {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"LightAlpha","LIGHT.a","",SLOT_TYPE_SCALAR,SLOT_OUT}, + {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"ShadowColor","SHADOW.rgb","",SLOT_TYPE_VEC,SLOT_OUT}, + {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"ShadowAlpha","SHADOW.a","",SLOT_TYPE_SCALAR,SLOT_OUT}, //end {MODE_MATERIAL,SHADER_TYPE_FRAGMENT,NULL,NULL,NULL,SLOT_TYPE_SCALAR,SLOT_OUT}, diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 09b3ada509..fdf3cb622d 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -1180,6 +1180,7 @@ const ShaderLanguage::BuiltinsDef ShaderLanguage::ci_light_builtins_defs[]={ { "LIGHT_HEIGHT", TYPE_FLOAT}, { "LIGHT_COLOR", TYPE_VEC4}, { "LIGHT_UV", TYPE_VEC2}, + { "LIGHT_SHADOW", TYPE_VEC4}, { "LIGHT", TYPE_VEC4}, { "SHADOW", TYPE_VEC4}, { "POINT_COORD", TYPE_VEC2}, diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 3b1e90a907..0e4a2fe30b 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -3016,7 +3016,7 @@ void EditorNode::remove_editor_plugin(EditorPlugin *p_editor) { for(int i=0;i<singleton->main_editor_buttons.size();i++) { - if (p_editor->get_name()==singleton->main_editor_buttons[i]->get_name()) { + if (p_editor->get_name()==singleton->main_editor_buttons[i]->get_text()) { memdelete( singleton->main_editor_buttons[i] ); singleton->main_editor_buttons.remove(i); diff --git a/tools/editor/editor_plugin.cpp b/tools/editor/editor_plugin.cpp index 55f0e52c88..4b82d5e59c 100644 --- a/tools/editor/editor_plugin.cpp +++ b/tools/editor/editor_plugin.cpp @@ -71,6 +71,11 @@ void EditorPlugin::remove_control_from_bottom_panel(Control *p_control) { } +Control * EditorPlugin::get_editor_viewport() { + + return EditorNode::get_singleton()->get_viewport(); +} + void EditorPlugin::add_control_to_container(CustomControlContainer p_location,Control *p_control) { switch(p_location) { @@ -315,6 +320,16 @@ Control *EditorPlugin::get_base_control() { return EditorNode::get_singleton()->get_gui_base(); } +void EditorPlugin::make_bottom_panel_item_visible(Control * p_item) { + + EditorNode::get_singleton()->make_bottom_panel_item_visible(p_item); +} + +void EditorPlugin::hide_bottom_panel() { + + EditorNode::get_singleton()->hide_bottom_panel(); +} + void EditorPlugin::inspect_object(Object *p_obj,const String& p_for_property) { EditorNode::get_singleton()->push_item(p_obj,p_for_property); @@ -333,6 +348,7 @@ void EditorPlugin::_bind_methods() { ObjectTypeDB::bind_method(_MD("remove_control_from_bottom_panel","control:Control"),&EditorPlugin::remove_control_from_bottom_panel); ObjectTypeDB::bind_method(_MD("add_custom_type","type","base","script:Script","icon:Texture"),&EditorPlugin::add_custom_type); ObjectTypeDB::bind_method(_MD("remove_custom_type","type"),&EditorPlugin::remove_custom_type); + ObjectTypeDB::bind_method(_MD("get_editor_viewport:Control"), &EditorPlugin::get_editor_viewport); ObjectTypeDB::bind_method(_MD("add_import_plugin","plugin:EditorImportPlugin"),&EditorPlugin::add_import_plugin); ObjectTypeDB::bind_method(_MD("remove_import_plugin","plugin:EditorImportPlugin"),&EditorPlugin::remove_import_plugin); @@ -346,6 +362,9 @@ void EditorPlugin::_bind_methods() { ObjectTypeDB::bind_method(_MD("inspect_object","object","for_property"),&EditorPlugin::inspect_object,DEFVAL(String())); ObjectTypeDB::bind_method(_MD("update_canvas"),&EditorPlugin::update_canvas); + ObjectTypeDB::bind_method(_MD("make_bottom_panel_item_visible","item:Control"), &EditorPlugin::make_bottom_panel_item_visible); + ObjectTypeDB::bind_method(_MD("hide_bottom_panel"), &EditorPlugin::hide_bottom_panel); + ObjectTypeDB::bind_method(_MD("get_base_control:Control"),&EditorPlugin::get_base_control); ObjectTypeDB::bind_method(_MD("get_undo_redo:UndoRedo"),&EditorPlugin::_get_undo_redo); ObjectTypeDB::bind_method(_MD("get_selection:EditorSelection"),&EditorPlugin::get_selection); diff --git a/tools/editor/editor_plugin.h b/tools/editor/editor_plugin.h index 5b944cc27a..2700c49a6c 100644 --- a/tools/editor/editor_plugin.h +++ b/tools/editor/editor_plugin.h @@ -100,6 +100,7 @@ public: void add_control_to_dock(DockSlot p_slot,Control *p_control); void remove_control_from_docks(Control *p_control); void remove_control_from_bottom_panel(Control *p_control); + Control* get_editor_viewport(); virtual Ref<SpatialEditorGizmo> create_spatial_gizmo(Spatial* p_spatial); virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform, const InputEvent& p_event); @@ -130,6 +131,9 @@ public: Control *get_base_control(); + void make_bottom_panel_item_visible(Control *p_item); + void hide_bottom_panel(); + void add_import_plugin(const Ref<EditorImportPlugin>& p_editor_import); void remove_import_plugin(const Ref<EditorImportPlugin>& p_editor_import); diff --git a/tools/editor/icons/2x/icon_distraction_free.png b/tools/editor/icons/2x/icon_distraction_free.png Binary files differnew file mode 100644 index 0000000000..034239a4e7 --- /dev/null +++ b/tools/editor/icons/2x/icon_distraction_free.png diff --git a/tools/editor/icons/2x/icon_remote_transform.png b/tools/editor/icons/2x/icon_remote_transform.png Binary files differindex 9ee66bc70c..dad528615a 100644 --- a/tools/editor/icons/2x/icon_remote_transform.png +++ b/tools/editor/icons/2x/icon_remote_transform.png diff --git a/tools/editor/icons/icon_distraction_free.png b/tools/editor/icons/icon_distraction_free.png Binary files differindex 5896de6044..c6f8a08874 100644 --- a/tools/editor/icons/icon_distraction_free.png +++ b/tools/editor/icons/icon_distraction_free.png diff --git a/tools/editor/icons/icon_remote_transform.png b/tools/editor/icons/icon_remote_transform.png Binary files differindex deff925b53..2a8b5f4d0e 100644 --- a/tools/editor/icons/icon_remote_transform.png +++ b/tools/editor/icons/icon_remote_transform.png diff --git a/tools/editor/icons/source/icon_distraction_free.svg b/tools/editor/icons/source/icon_distraction_free.svg new file mode 100644 index 0000000000..4ae48b2fb6 --- /dev/null +++ b/tools/editor/icons/source/icon_distraction_free.svg @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png" + inkscape:export-xdpi="45" + inkscape:export-ydpi="45" + sodipodi:docname="icon_distraction_free.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="32.000001" + inkscape:cx="10.344519" + inkscape:cy="8.9631686" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="false" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:snap-midpoints="true" + inkscape:snap-smooth-nodes="true" + inkscape:object-nodes="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 3.7578125 2.34375 L 2.34375 3.7578125 L 5.2929688 6.7070312 L 6.7070312 5.2929688 L 3.7578125 2.34375 z M 12.242188 2.34375 L 9.2929688 5.2929688 L 10.707031 6.7070312 L 13.65625 3.7578125 L 12.242188 2.34375 z M 5.2929688 9.2929688 L 2.34375 12.242188 L 3.7578125 13.65625 L 6.7070312 10.707031 L 5.2929688 9.2929688 z M 10.707031 9.2929688 L 9.2929688 10.707031 L 12.242188 13.65625 L 13.65625 12.242188 L 10.707031 9.2929688 z " + transform="translate(0,1036.3622)" + id="rect4137" /> + <path + style="fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="m 1,1051.3622 0,-5 5,5 z" + id="path4155" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccc" /> + <path + sodipodi:nodetypes="cccc" + inkscape:connector-curvature="0" + id="path4158" + d="m 15,1051.3622 0,-5 -5,5 z" + style="fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + style="fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="m 15,1037.3622 0,5 -5,-5 z" + id="path4160" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccc" /> + <path + sodipodi:nodetypes="cccc" + inkscape:connector-curvature="0" + id="path4162" + d="m 1,1037.3622 0,5 5,-5 z" + style="fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + </g> +</svg> diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 522ceba1dc..fd25843de9 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -1362,10 +1362,8 @@ struct _ScriptEditorItemData { void ScriptEditor::_update_script_colors() { - bool enabled = EditorSettings::get_singleton()->get("text_editor/script_temperature_enabled"); + bool script_temperature_enabled = EditorSettings::get_singleton()->get("text_editor/script_temperature_enabled"); bool highlight_current = EditorSettings::get_singleton()->get("text_editor/highlight_current_script"); - if (!enabled) - return; int hist_size = EditorSettings::get_singleton()->get("text_editor/script_temperature_history_size"); Color hot_color=EditorSettings::get_singleton()->get("text_editor/script_temperature_hot_color"); @@ -1379,22 +1377,25 @@ void ScriptEditor::_update_script_colors() { continue; script_list->set_item_custom_bg_color(i,Color(0,0,0,0)); - if (!n->has_meta("__editor_pass")) { - continue; - } - - int pass=n->get_meta("__editor_pass"); - int h = edit_pass - pass; - if (h>hist_size) { - continue; - } - int non_zero_hist_size = ( hist_size == 0 ) ? 1 : hist_size; - float v = Math::ease((edit_pass-pass)/float(non_zero_hist_size),0.4); bool current = tab_container->get_current_tab() == c; if (current && highlight_current) { script_list->set_item_custom_bg_color(i, EditorSettings::get_singleton()->get("text_editor/current_script_background_color")); - } else { + + } else if (script_temperature_enabled) { + + if (!n->has_meta("__editor_pass")) { + continue; + } + + int pass=n->get_meta("__editor_pass"); + int h = edit_pass - pass; + if (h>hist_size) { + continue; + } + int non_zero_hist_size = ( hist_size == 0 ) ? 1 : hist_size; + float v = Math::ease((edit_pass-pass)/float(non_zero_hist_size),0.4); + script_list->set_item_custom_bg_color(i,hot_color.linear_interpolate(cold_color,v)); } } diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp index aa66a2e0d9..3ab906f84e 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.cpp +++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp @@ -2422,6 +2422,7 @@ void ShaderGraphView::_create_node(int p_id) { colors.push_back("Color"); colors.push_back("LightColor"); colors.push_back("Light"); + colors.push_back("ShadowColor"); colors.push_back("Diffuse"); colors.push_back("Specular"); colors.push_back("Emmision"); @@ -2434,6 +2435,7 @@ void ShaderGraphView::_create_node(int p_id) { reals.push_back("ShadeParam"); reals.push_back("SpecularExp"); reals.push_back("LightAlpha"); + reals.push_back("ShadowAlpha"); reals.push_back("PointSize"); reals.push_back("Discard"); |