diff options
-rw-r--r-- | editor/editor_node.cpp | 2 | ||||
-rw-r--r-- | platform/windows/export/export.cpp | 29 | ||||
-rw-r--r-- | scene/2d/canvas_item.cpp | 4 | ||||
-rw-r--r-- | scene/2d/screen_button.cpp | 31 | ||||
-rw-r--r-- | scene/2d/screen_button.h | 4 | ||||
-rw-r--r-- | scene/3d/spatial.cpp | 9 | ||||
-rw-r--r-- | scene/gui/control.cpp | 2 | ||||
-rw-r--r-- | scene/gui/patch_9_rect.cpp | 8 | ||||
-rw-r--r-- | scene/gui/range.cpp | 10 | ||||
-rw-r--r-- | scene/gui/split_container.cpp | 2 |
10 files changed, 59 insertions, 42 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 18c16af5af..5b5f500178 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -5681,7 +5681,7 @@ EditorNode::EditorNode() { overridden_default_layout = -1; default_layout.instance(); default_layout->set_value(docks_section, "dock_3", TTR("FileSystem")); - default_layout->set_value(docks_section, "dock_5", TTR("Scene")); + default_layout->set_value(docks_section, "dock_5", TTR("Scene") + "," + TTR("Import")); default_layout->set_value(docks_section, "dock_6", TTR("Inspector") + "," + TTR("Node")); for (int i = 0; i < DOCK_SLOT_MAX / 2; i++) diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp index bb51474a8c..df1605ae9e 100644 --- a/platform/windows/export/export.cpp +++ b/platform/windows/export/export.cpp @@ -26,28 +26,25 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "export.h" #include "editor/editor_export.h" #include "platform/windows/logo.h" void register_windows_exporter() { -#if 0 + Ref<EditorExportPlatformPC> platform; + platform.instance(); + Image img(_windows_logo); - Ref<ImageTexture> logo = memnew( ImageTexture ); + Ref<ImageTexture> logo; + logo.instance(); logo->create_from_image(img); + platform->set_logo(logo); + platform->set_name("Windows Desktop"); + platform->set_extension("exe"); + platform->set_release_32("windows_32_release.exe"); + platform->set_debug_32("windows_32_debug.exe"); + platform->set_release_64("windows_64_release.exe"); + platform->set_debug_64("windows_64_debug.exe"); - { - Ref<EditorExportPlatformPC> exporter = Ref<EditorExportPlatformPC>( memnew(EditorExportPlatformPC) ); - exporter->set_binary_extension("exe"); - exporter->set_release_binary32("windows_32_release.exe"); - exporter->set_debug_binary32("windows_32_debug.exe"); - exporter->set_release_binary64("windows_64_release.exe"); - exporter->set_debug_binary64("windows_64_debug.exe"); - exporter->set_name("Windows Desktop"); - exporter->set_logo(logo); - EditorImportExport::get_singleton()->add_export_platform(exporter); - } - -#endif + EditorExport::get_singleton()->add_export_platform(platform); } diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index b52dd8d660..3e5bb7f572 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -206,7 +206,7 @@ void CanvasItem::show() { return; _propagate_visibility_changed(true); - _change_notify("visibility/visible"); + _change_notify("visible"); } void CanvasItem::hide() { @@ -221,7 +221,7 @@ void CanvasItem::hide() { return; _propagate_visibility_changed(false); - _change_notify("visibility/visible"); + _change_notify("visible"); } Variant CanvasItem::edit_get_state() const { diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp index db822ed306..804af7d9c6 100644 --- a/scene/2d/screen_button.cpp +++ b/scene/2d/screen_button.cpp @@ -65,12 +65,14 @@ Ref<BitMap> TouchScreenButton::get_bitmask() const { void TouchScreenButton::set_shape(const Ref<Shape2D> &p_shape) { + if (shape.is_valid()) + shape->disconnect("changed", this, "update"); + shape = p_shape; - if (!is_inside_tree()) - return; - if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) - return; + if (shape.is_valid()) + shape->connect("changed", this, "update"); + update(); } @@ -82,11 +84,17 @@ Ref<Shape2D> TouchScreenButton::get_shape() const { void TouchScreenButton::set_shape_centered(bool p_shape_centered) { shape_centered = p_shape_centered; + update(); +} - if (!is_inside_tree()) - return; - if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) - return; +bool TouchScreenButton::is_shape_visible() const { + + return shape_visible; +} + +void TouchScreenButton::set_shape_visible(bool p_shape_visible) { + + shape_visible = p_shape_visible; update(); } @@ -118,6 +126,8 @@ void TouchScreenButton::_notification(int p_what) { draw_texture(texture, Point2()); } + if (!shape_visible) + return; if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) return; if (shape.is_valid()) { @@ -375,6 +385,9 @@ void TouchScreenButton::_bind_methods() { ClassDB::bind_method(D_METHOD("set_shape_centered", "bool"), &TouchScreenButton::set_shape_centered); ClassDB::bind_method(D_METHOD("is_shape_centered"), &TouchScreenButton::is_shape_centered); + ClassDB::bind_method(D_METHOD("set_shape_visible", "bool"), &TouchScreenButton::set_shape_visible); + ClassDB::bind_method(D_METHOD("is_shape_visible"), &TouchScreenButton::is_shape_visible); + ClassDB::bind_method(D_METHOD("set_action", "action"), &TouchScreenButton::set_action); ClassDB::bind_method(D_METHOD("get_action"), &TouchScreenButton::get_action); @@ -393,6 +406,7 @@ void TouchScreenButton::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "bitmask", PROPERTY_HINT_RESOURCE_TYPE, "BitMap"), "set_bitmask", "get_bitmask"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape2D"), "set_shape", "get_shape"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shape_centered"), "set_shape_centered", "is_shape_centered"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shape_visible"), "set_shape_visible", "is_shape_visible"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "passby_press"), "set_passby_press", "is_passby_press_enabled"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "action"), "set_action", "get_action"); ADD_PROPERTY(PropertyInfo(Variant::INT, "visibility_mode", PROPERTY_HINT_ENUM, "Always,TouchScreen Only"), "set_visibility_mode", "get_visibility_mode"); @@ -408,6 +422,7 @@ TouchScreenButton::TouchScreenButton() { passby_press = false; visibility = VISIBILITY_ALWAYS; shape_centered = true; + shape_visible = true; unit_rect = Ref<RectangleShape2D>(memnew(RectangleShape2D)); unit_rect->set_extents(Vector2(0.5, 0.5)); } diff --git a/scene/2d/screen_button.h b/scene/2d/screen_button.h index 201d908bf6..2262723ed3 100644 --- a/scene/2d/screen_button.h +++ b/scene/2d/screen_button.h @@ -50,6 +50,7 @@ private: Ref<BitMap> bitmask; Ref<Shape2D> shape; bool shape_centered; + bool shape_visible; Ref<RectangleShape2D> unit_rect; @@ -85,6 +86,9 @@ public: void set_shape_centered(bool p_shape_centered); bool is_shape_centered() const; + void set_shape_visible(bool p_shape_visible); + bool is_shape_visible() const; + void set_action(const String &p_action); String get_action() const; diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index 1125a7a4d2..1698c0ffd0 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -220,9 +220,10 @@ void Spatial::set_transform(const Transform &p_transform) { data.local_transform = p_transform; data.dirty |= DIRTY_VECTORS; - _change_notify("transform/translation"); - _change_notify("transform/rotation"); - _change_notify("transform/scale"); + _change_notify("translation"); + _change_notify("rotation"); + _change_notify("rotation_deg"); + _change_notify("scale"); _propagate_transform_changed(this); if (data.notify_local_transform) { notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED); @@ -525,7 +526,7 @@ void Spatial::_propagate_visibility_changed() { notification(NOTIFICATION_VISIBILITY_CHANGED); emit_signal(SceneStringNames::get_singleton()->visibility_changed); - _change_notify("visibility/visible"); + _change_notify("visible"); #ifdef TOOLS_ENABLED if (data.gizmo.is_valid()) _update_gizmo(); diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 7f9944833a..c249d3dd64 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2158,7 +2158,7 @@ void Control::set_rotation(float p_radians) { data.rotation = p_radians; update(); _notify_transform(); - _change_notify("rect/rotation"); + _change_notify("rect_rotation"); } float Control::get_rotation() const { diff --git a/scene/gui/patch_9_rect.cpp b/scene/gui/patch_9_rect.cpp index f53036085f..e1ac2be7e6 100644 --- a/scene/gui/patch_9_rect.cpp +++ b/scene/gui/patch_9_rect.cpp @@ -102,16 +102,16 @@ void NinePatchRect::set_patch_margin(Margin p_margin, int p_size) { minimum_size_changed(); switch (p_margin) { case MARGIN_LEFT: - _change_notify("patch_margin/left"); + _change_notify("patch_margin_left"); break; case MARGIN_TOP: - _change_notify("patch_margin/top"); + _change_notify("patch_margin_top"); break; case MARGIN_RIGHT: - _change_notify("patch_margin/right"); + _change_notify("patch_margin_right"); break; case MARGIN_BOTTOM: - _change_notify("patch_margin/bottom"); + _change_notify("patch_margin_bottom"); break; } } diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp index f15f3a6078..626d1d9663 100644 --- a/scene/gui/range.cpp +++ b/scene/gui/range.cpp @@ -33,7 +33,7 @@ void Range::_value_changed_notify() { _value_changed(shared->val); emit_signal("value_changed", shared->val); update(); - _change_notify("range/value"); + _change_notify("value"); } void Range::Shared::emit_value_changed() { @@ -87,26 +87,26 @@ void Range::set_min(double p_min) { shared->min = p_min; set_value(shared->val); - shared->emit_changed("range/min"); + shared->emit_changed("min"); } void Range::set_max(double p_max) { shared->max = p_max; set_value(shared->val); - shared->emit_changed("range/max"); + shared->emit_changed("max"); } void Range::set_step(double p_step) { shared->step = p_step; - shared->emit_changed("range/step"); + shared->emit_changed("step"); } void Range::set_page(double p_page) { shared->page = p_page; set_value(shared->val); - shared->emit_changed("range/page"); + shared->emit_changed("page"); } double Range::get_value() const { diff --git a/scene/gui/split_container.cpp b/scene/gui/split_container.cpp index 5b6f17e0f7..11d068b048 100644 --- a/scene/gui/split_container.cpp +++ b/scene/gui/split_container.cpp @@ -185,7 +185,7 @@ void SplitContainer::_resort() { } update(); - _change_notify("split/offset"); + _change_notify("split_offset"); } Size2 SplitContainer::get_minimum_size() const { |