diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/3d/arvr_nodes.cpp | 3 | ||||
-rw-r--r-- | scene/gui/item_list.cpp | 6 | ||||
-rw-r--r-- | scene/gui/slider.cpp | 6 | ||||
-rw-r--r-- | scene/main/scene_tree.cpp | 2 | ||||
-rw-r--r-- | scene/main/scene_tree.h | 4 | ||||
-rw-r--r-- | scene/main/viewport.cpp | 2 |
6 files changed, 15 insertions, 8 deletions
diff --git a/scene/3d/arvr_nodes.cpp b/scene/3d/arvr_nodes.cpp index c6b6c02129..064a249190 100644 --- a/scene/3d/arvr_nodes.cpp +++ b/scene/3d/arvr_nodes.cpp @@ -204,7 +204,7 @@ void ARVRController::_notification(int p_what) { int mask = 1; // check button states for (int i = 0; i < 16; i++) { - bool was_pressed = (button_states && mask) == mask; + bool was_pressed = (button_states & mask) == mask; bool is_pressed = Input::get_singleton()->is_joy_button_pressed(joy_id, i); if (!was_pressed && is_pressed) { @@ -336,6 +336,7 @@ String ARVRController::get_configuration_warning() const { ARVRController::ARVRController() { controller_id = 0; is_active = true; + button_states = 0; }; ARVRController::~ARVRController(){ diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index a034c7224f..623a110263 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -489,7 +489,7 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) { if (mb->get_button_index() == BUTTON_RIGHT) { - emit_signal("item_rmb_selected", i, pos); + emit_signal("item_rmb_selected", i, get_local_mouse_position()); } } else { @@ -500,7 +500,7 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) { if (items[i].selected && mb->get_button_index() == BUTTON_RIGHT) { - emit_signal("item_rmb_selected", i, pos); + emit_signal("item_rmb_selected", i, get_local_mouse_position()); } else { bool selected = !items[i].selected; @@ -515,7 +515,7 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) { if (mb->get_button_index() == BUTTON_RIGHT) { - emit_signal("item_rmb_selected", i, pos); + emit_signal("item_rmb_selected", i, get_local_mouse_position()); } else if (/*select_mode==SELECT_SINGLE &&*/ mb->is_doubleclick()) { emit_signal("item_activated", i); diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp index 116e0ac354..e88742a3e3 100644 --- a/scene/gui/slider.cpp +++ b/scene/gui/slider.cpp @@ -157,6 +157,12 @@ void Slider::_notification(int p_what) { mouse_inside = false; update(); } break; + case NOTIFICATION_VISIBILITY_CHANGED: // fallthrough + case NOTIFICATION_EXIT_TREE: { + + mouse_inside = false; + grab.active = false; + } break; case NOTIFICATION_DRAW: { RID ci = get_canvas_item(); Size2i size = get_size(); diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 7a28e2a6f8..db383b5704 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -1172,7 +1172,7 @@ void SceneTree::_update_root_rect() { } } -void SceneTree::set_screen_stretch(StretchMode p_mode, StretchAspect p_aspect, const Size2 p_minsize, int p_shrink) { +void SceneTree::set_screen_stretch(StretchMode p_mode, StretchAspect p_aspect, const Size2 p_minsize, real_t p_shrink) { stretch_mode = p_mode; stretch_aspect = p_aspect; diff --git a/scene/main/scene_tree.h b/scene/main/scene_tree.h index f3e689adab..1a572abd60 100644 --- a/scene/main/scene_tree.h +++ b/scene/main/scene_tree.h @@ -147,7 +147,7 @@ private: StretchMode stretch_mode; StretchAspect stretch_aspect; Size2i stretch_min; - int stretch_shrink; + real_t stretch_shrink; void _update_root_rect(); @@ -415,7 +415,7 @@ public: void get_nodes_in_group(const StringName &p_group, List<Node *> *p_list); bool has_group(const StringName &p_identifier) const; - void set_screen_stretch(StretchMode p_mode, StretchAspect p_aspect, const Size2 p_minsize, int p_shrink = 1); + void set_screen_stretch(StretchMode p_mode, StretchAspect p_aspect, const Size2 p_minsize, real_t p_shrink = 1); //void change_scene(const String& p_path); //Node *get_loaded_scene(); diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 37a393b55b..12c8b0d89b 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -2711,7 +2711,7 @@ void Viewport::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "debug_draw", PROPERTY_HINT_ENUM, "Disabled,Unshaded,Overdraw,Wireframe"), "set_debug_draw", "get_debug_draw"); ADD_GROUP("Render Target", "render_target_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "render_target_v_flip"), "set_vflip", "get_vflip"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "render_target_clear_mode", PROPERTY_HINT_ENUM, "Always,Never,NextFrame"), "set_clear_mode", "get_clear_mode"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "render_target_clear_mode", PROPERTY_HINT_ENUM, "Always,Never,Next Frame"), "set_clear_mode", "get_clear_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "render_target_update_mode", PROPERTY_HINT_ENUM, "Disabled,Once,When Visible,Always"), "set_update_mode", "get_update_mode"); ADD_GROUP("Audio Listener", "audio_listener_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "audio_listener_enable_2d"), "set_as_audio_listener_2d", "is_audio_listener_2d"); |