diff options
| author | Juan Linietsky | 2017-01-04 01:16:14 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2017-01-04 01:16:14 -0300 |
| commit | b085c40edfac45ec1c8b866c789f6e9bab7e5e08 (patch) | |
| tree | fb53cad5fcb37fcad404805fe7330d36fcd4e905 /tools/editor/plugins | |
| parent | 3fae505128d5bfdeec42244820d0b85d0408f2b7 (diff) | |
| download | godot-b085c40edfac45ec1c8b866c789f6e9bab7e5e08.tar.gz godot-b085c40edfac45ec1c8b866c789f6e9bab7e5e08.tar.zst godot-b085c40edfac45ec1c8b866c789f6e9bab7e5e08.zip | |
-Conversion of most properties to a simpler syntax, easier to use by script
-Modified help to display properties
GDScript can still not make use of them, though.
Diffstat (limited to 'tools/editor/plugins')
| -rw-r--r-- | tools/editor/plugins/animation_player_editor_plugin.cpp | 6 | ||||
| -rw-r--r-- | tools/editor/plugins/animation_tree_editor_plugin.cpp | 38 | ||||
| -rw-r--r-- | tools/editor/plugins/canvas_item_editor_plugin.cpp | 108 | ||||
| -rw-r--r-- | tools/editor/plugins/mesh_instance_editor_plugin.cpp | 4 | ||||
| -rw-r--r-- | tools/editor/plugins/multimesh_editor_plugin.cpp | 26 | ||||
| -rw-r--r-- | tools/editor/plugins/particles_2d_editor_plugin.cpp | 4 | ||||
| -rw-r--r-- | tools/editor/plugins/polygon_2d_editor_plugin.cpp | 28 | ||||
| -rw-r--r-- | tools/editor/plugins/spatial_editor_plugin.cpp | 40 | ||||
| -rw-r--r-- | tools/editor/plugins/spatial_editor_plugin.h | 6 | ||||
| -rw-r--r-- | tools/editor/plugins/sprite_frames_editor_plugin.cpp | 2 | ||||
| -rw-r--r-- | tools/editor/plugins/texture_region_editor_plugin.cpp | 36 | ||||
| -rw-r--r-- | tools/editor/plugins/theme_editor_plugin.cpp | 2 | ||||
| -rw-r--r-- | tools/editor/plugins/tile_map_editor_plugin.cpp | 4 |
13 files changed, 152 insertions, 152 deletions
diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp index ae12ad2a6..17ed3842b 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.cpp +++ b/tools/editor/plugins/animation_player_editor_plugin.cpp @@ -77,14 +77,14 @@ void AnimationPlayerEditor::_notification(int p_what) { } } } - frame->set_val(player->get_current_animation_pos()); + frame->set_value(player->get_current_animation_pos()); key_editor->set_anim_pos(player->get_current_animation_pos()); EditorNode::get_singleton()->get_property_editor()->refresh(); } else if (last_active) { //need the last frame after it stopped - frame->set_val(player->get_current_animation_pos()); + frame->set_value(player->get_current_animation_pos()); } last_active=player->is_playing(); @@ -1108,7 +1108,7 @@ void AnimationPlayerEditor::_animation_key_editor_seek(float p_pos,bool p_drag) return; updating=true; - frame->set_val(p_pos); + frame->set_value(p_pos); updating=false; _seek_value_changed(p_pos,!p_drag); diff --git a/tools/editor/plugins/animation_tree_editor_plugin.cpp b/tools/editor/plugins/animation_tree_editor_plugin.cpp index 18753b638..d1933d328 100644 --- a/tools/editor/plugins/animation_tree_editor_plugin.cpp +++ b/tools/editor/plugins/animation_tree_editor_plugin.cpp @@ -183,20 +183,20 @@ void AnimationTreeEditor::_edit_dialog_changed() { case AnimationTreePlayer::NODE_MIX: - anim_tree->mix_node_set_amount(edited_node,edit_scroll[0]->get_val()); + anim_tree->mix_node_set_amount(edited_node,edit_scroll[0]->get_value()); break; case AnimationTreePlayer::NODE_BLEND2: - anim_tree->blend2_node_set_amount(edited_node,edit_scroll[0]->get_val()); + anim_tree->blend2_node_set_amount(edited_node,edit_scroll[0]->get_value()); break; case AnimationTreePlayer::NODE_BLEND3: - anim_tree->blend3_node_set_amount(edited_node,edit_scroll[0]->get_val()); + anim_tree->blend3_node_set_amount(edited_node,edit_scroll[0]->get_value()); break; case AnimationTreePlayer::NODE_BLEND4: - anim_tree->blend4_node_set_amount(edited_node,Point2(edit_scroll[0]->get_val(),edit_scroll[1]->get_val())); + anim_tree->blend4_node_set_amount(edited_node,Point2(edit_scroll[0]->get_value(),edit_scroll[1]->get_value())); break; @@ -265,7 +265,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { filter_button->hide(); edit_check->hide();; - Point2 pos = anim_tree->node_get_pos(edited_node)-Point2(h_scroll->get_val(),v_scroll->get_val()); + Point2 pos = anim_tree->node_get_pos(edited_node)-Point2(h_scroll->get_value(),v_scroll->get_value()); Ref<StyleBox> style = get_stylebox("panel","PopupMenu"); Size2 size = get_node_size(edited_node); Point2 popup_pos( pos.x+style->get_margin(MARGIN_LEFT), pos.y+size.y-style->get_margin(MARGIN_BOTTOM)); @@ -380,7 +380,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { edit_label[0]->show(); edit_scroll[0]->set_min(0); edit_scroll[0]->set_max(1); - edit_scroll[0]->set_val(anim_tree->mix_node_get_amount(edited_node)); + edit_scroll[0]->set_value(anim_tree->mix_node_get_amount(edited_node)); edit_scroll[0]->set_begin(Point2(15,25)); edit_scroll[0]->show(); edit_dialog->set_size(Size2(150,50)); @@ -392,7 +392,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { edit_label[0]->show(); edit_scroll[0]->set_min(0); edit_scroll[0]->set_max(1); - edit_scroll[0]->set_val(anim_tree->blend2_node_get_amount(edited_node)); + edit_scroll[0]->set_value(anim_tree->blend2_node_get_amount(edited_node)); edit_scroll[0]->set_begin(Point2(15,25)); edit_scroll[0]->show(); filter_button->set_begin(Point2(10,47)); @@ -407,7 +407,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { edit_label[0]->show(); edit_scroll[0]->set_min(-1); edit_scroll[0]->set_max(1); - edit_scroll[0]->set_val(anim_tree->blend3_node_get_amount(edited_node)); + edit_scroll[0]->set_value(anim_tree->blend3_node_get_amount(edited_node)); edit_scroll[0]->set_begin(Point2(15,25)); edit_scroll[0]->show(); edit_dialog->set_size(Size2(150,50)); @@ -420,7 +420,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { edit_label[0]->show(); edit_scroll[0]->set_min(0); edit_scroll[0]->set_max(1); - edit_scroll[0]->set_val(anim_tree->blend4_node_get_amount(edited_node).x); + edit_scroll[0]->set_value(anim_tree->blend4_node_get_amount(edited_node).x); edit_scroll[0]->set_begin(Point2(15,25)); edit_scroll[0]->show(); edit_label[1]->set_text(TTR("Blend 1:")); @@ -428,7 +428,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { edit_label[1]->show(); edit_scroll[1]->set_min(0); edit_scroll[1]->set_max(1); - edit_scroll[1]->set_val(anim_tree->blend4_node_get_amount(edited_node).y); + edit_scroll[1]->set_value(anim_tree->blend4_node_get_amount(edited_node).y); edit_scroll[1]->set_begin(Point2(15,75)); edit_scroll[1]->show(); edit_dialog->set_size(Size2(150,100)); @@ -500,7 +500,7 @@ void AnimationTreeEditor::_draw_node(const StringName& p_node) { } - pos-=Point2(h_scroll->get_val(),v_scroll->get_val()); + pos-=Point2(h_scroll->get_value(),v_scroll->get_value()); style->draw(ci,Rect2(pos,size)); @@ -644,7 +644,7 @@ AnimationTreeEditor::ClickType AnimationTreeEditor::_locate_click(const Point2& Point2 pos = anim_tree->node_get_pos(node); Size2 size = get_node_size(node); - pos-=Point2(h_scroll->get_val(),v_scroll->get_val()); + pos-=Point2(h_scroll->get_value(),v_scroll->get_value()); if (!Rect2(pos,size).has_point(p_click)) continue; @@ -709,7 +709,7 @@ Point2 AnimationTreeEditor::_get_slot_pos(const StringName& p_node,bool p_input, } - pos-=Point2(h_scroll->get_val(),v_scroll->get_val()); + pos-=Point2(h_scroll->get_value(),v_scroll->get_value()); float w = size.width-style->get_minimum_size().width; @@ -892,8 +892,8 @@ void AnimationTreeEditor::_input_event(InputEvent p_event) { } if ((p_event.mouse_motion.button_mask&4 || Input::get_singleton()->is_key_pressed(KEY_SPACE))) { - h_scroll->set_val( h_scroll->get_val() - p_event.mouse_motion.relative_x ); - v_scroll->set_val( v_scroll->get_val() - p_event.mouse_motion.relative_y ); + h_scroll->set_value( h_scroll->get_value() - p_event.mouse_motion.relative_x ); + v_scroll->set_value( v_scroll->get_value() - p_event.mouse_motion.relative_y ); update(); } @@ -1026,7 +1026,7 @@ void AnimationTreeEditor::_update_scrollbars() { v_scroll->show(); v_scroll->set_max(min.height); v_scroll->set_page(size.height - hmin.height); - offset.y=v_scroll->get_val(); + offset.y=v_scroll->get_value(); } if (min.width < size.width - vmin.width) { @@ -1038,14 +1038,14 @@ void AnimationTreeEditor::_update_scrollbars() { h_scroll->show(); h_scroll->set_max(min.width); h_scroll->set_page(size.width - vmin.width); - offset.x=h_scroll->get_val(); + offset.x=h_scroll->get_value(); } } void AnimationTreeEditor::_scroll_moved(float) { - offset.x=h_scroll->get_val(); - offset.y=v_scroll->get_val(); + offset.x=h_scroll->get_value(); + offset.y=v_scroll->get_value(); update(); } diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp index dda7fedf7..ef43992c3 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.cpp +++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -149,21 +149,21 @@ public: } void set_fields(const Point2 p_grid_offset, const Size2 p_grid_step, const float p_rotation_offset, const float p_rotation_step) { - grid_offset_x->set_val(p_grid_offset.x); - grid_offset_y->set_val(p_grid_offset.y); - grid_step_x->set_val(p_grid_step.x); - grid_step_y->set_val(p_grid_step.y); - rotation_offset->set_val(p_rotation_offset * (180 / Math_PI)); - rotation_step->set_val(p_rotation_step * (180 / Math_PI)); + grid_offset_x->set_value(p_grid_offset.x); + grid_offset_y->set_value(p_grid_offset.y); + grid_step_x->set_value(p_grid_step.x); + grid_step_y->set_value(p_grid_step.y); + rotation_offset->set_value(p_rotation_offset * (180 / Math_PI)); + rotation_step->set_value(p_rotation_step * (180 / Math_PI)); } void get_fields(Point2 &p_grid_offset, Size2 &p_grid_step, float &p_rotation_offset, float &p_rotation_step) { - p_grid_offset.x = grid_offset_x->get_val(); - p_grid_offset.y = grid_offset_y->get_val(); - p_grid_step.x = grid_step_x->get_val(); - p_grid_step.y = grid_step_y->get_val(); - p_rotation_offset = rotation_offset->get_val() / (180 / Math_PI); - p_rotation_step = rotation_step->get_val() / (180 / Math_PI); + p_grid_offset.x = grid_offset_x->get_value(); + p_grid_offset.y = grid_offset_y->get_value(); + p_grid_step.x = grid_step_x->get_value(); + p_grid_step.y = grid_step_y->get_value(); + p_rotation_offset = rotation_offset->get_value() / (180 / Math_PI); + p_rotation_step = rotation_step->get_value() / (180 / Math_PI); } }; @@ -179,7 +179,7 @@ void CanvasItemEditor::_edit_set_pivot(const Vector2& mouse_pos) { if (n2d && n2d->edit_has_pivot()) { Vector2 offset = n2d->edit_get_pivot(); - Vector2 gpos = n2d->get_global_pos(); + Vector2 gpos = n2d->get_global_position(); Vector2 local_mouse_pos = n2d->get_canvas_transform().affine_inverse().xform(mouse_pos); @@ -194,8 +194,8 @@ void CanvasItemEditor::_edit_set_pivot(const Vector2& mouse_pos) { if (!n2dc) continue; - undo_redo->add_do_method(n2dc,"set_global_pos",n2dc->get_global_pos()); - undo_redo->add_undo_method(n2dc,"set_global_pos",n2dc->get_global_pos()); + undo_redo->add_do_method(n2dc,"set_global_pos",n2dc->get_global_position()); + undo_redo->add_undo_method(n2dc,"set_global_pos",n2dc->get_global_position()); } @@ -286,7 +286,7 @@ Dictionary CanvasItemEditor::get_state() const { Dictionary state; state["zoom"]=zoom; - state["ofs"]=Point2(h_scroll->get_val(),v_scroll->get_val()); + state["ofs"]=Point2(h_scroll->get_value(),v_scroll->get_value()); // state["ofs"]=-transform.get_origin(); state["snap_offset"]=snap_offset; state["snap_step"]=snap_step; @@ -310,8 +310,8 @@ void CanvasItemEditor::set_state(const Dictionary& p_state){ if (state.has("ofs")) { _update_scrollbars(); // i wonder how safe is calling this here.. Point2 ofs=p_state["ofs"]; - h_scroll->set_val(ofs.x); - v_scroll->set_val(ofs.y); + h_scroll->set_value(ofs.x); + v_scroll->set_value(ofs.y); } if (state.has("snap_step")) { @@ -709,10 +709,10 @@ void CanvasItemEditor::_key_move(const Vector2& p_dir, bool p_snap, KeyMoveMODE if (p_move_mode == MOVE_LOCAL_WITH_ROT) { Matrix32 m; - m.rotate( node_2d->get_rot() ); + m.rotate( node_2d->get_rotation() ); drag = m.xform(drag); } - node_2d->set_pos(node_2d->get_pos() + drag); + node_2d->set_position(node_2d->get_position() + drag); } else if (Control *control = canvas_item->cast_to<Control>()) { @@ -961,7 +961,7 @@ void CanvasItemEditor::_dialog_value_changed(double) { case ZOOM_SET: { - zoom=dialog_val->get_val()/100.0; + zoom=dialog_val->get_value()/100.0; _update_scroll(0); viewport->update(); @@ -1096,8 +1096,8 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { { Point2 ofs(b.x,b.y); ofs = ofs/prev_zoom - ofs/zoom; - h_scroll->set_val( h_scroll->get_val() + ofs.x ); - v_scroll->set_val( v_scroll->get_val() + ofs.y ); + h_scroll->set_value( h_scroll->get_value() + ofs.x ); + v_scroll->set_value( v_scroll->get_value() + ofs.y ); } _update_scroll(0); viewport->update(); @@ -1114,8 +1114,8 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { { Point2 ofs(b.x,b.y); ofs = ofs/prev_zoom - ofs/zoom; - h_scroll->set_val( h_scroll->get_val() + ofs.x ); - v_scroll->set_val( v_scroll->get_val() + ofs.y ); + h_scroll->set_value( h_scroll->get_value() + ofs.x ); + v_scroll->set_value( v_scroll->get_value() + ofs.y ); } _update_scroll(0); @@ -1355,7 +1355,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { if (!pi) break; - float len=pi->get_global_transform().get_origin().distance_to(b->get_global_pos()); + float len=pi->get_global_transform().get_origin().distance_to(b->get_global_position()); b=pi->cast_to<Node2D>(); if (!b) break; @@ -1554,8 +1554,8 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { if ( (m.button_mask&BUTTON_MASK_LEFT && tool == TOOL_PAN) || m.button_mask&BUTTON_MASK_MIDDLE || (m.button_mask&BUTTON_MASK_LEFT && Input::get_singleton()->is_key_pressed(KEY_SPACE))) { - h_scroll->set_val( h_scroll->get_val() - m.relative_x/zoom); - v_scroll->set_val( v_scroll->get_val() - m.relative_y/zoom); + h_scroll->set_value( h_scroll->get_value() - m.relative_x/zoom); + v_scroll->set_value( v_scroll->get_value() - m.relative_y/zoom); } return; @@ -1604,7 +1604,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { Matrix32 rot; rot.elements[1] = (dfrom - center).normalized(); rot.elements[0] = rot.elements[1].tangent(); - node->set_rot(snap_angle(rot.xform_inv(dto-center).angle() + node->get_rot(), node->get_rot())); + node->set_rotation(snap_angle(rot.xform_inv(dto-center).angle() + node->get_rotation(), node->get_rotation())); display_rotate_to = dto; display_rotate_from = center; viewport->update(); @@ -1854,11 +1854,11 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { if (!E->prev()) { //last goes to what it was - final_xform.set_origin(n->get_global_pos()); + final_xform.set_origin(n->get_global_position()); n->set_global_transform(final_xform); } else { - Vector2 rel = (E->prev()->get().node->get_global_pos() - n->get_global_pos()).normalized(); + Vector2 rel = (E->prev()->get().node->get_global_position() - n->get_global_position()).normalized(); Vector2 rel2 = (E->prev()->get().pos - E->get().pos).normalized(); float rot = rel.angle_to(rel2); if (n->get_global_transform().basis_determinant()<0) { @@ -2147,8 +2147,8 @@ void CanvasItemEditor::_viewport_draw() { if (!pn2d) continue; - Vector2 from = transform.xform(pn2d->get_global_pos()); - Vector2 to = transform.xform(n2d->get_global_pos()); + Vector2 from = transform.xform(pn2d->get_global_position()); + Vector2 to = transform.xform(n2d->get_global_position()); E->get().from=from; E->get().to=to; @@ -2456,13 +2456,13 @@ void CanvasItemEditor::_update_scrollbars() { v_scroll->set_page(local_rect.size.y/zoom); if (first_update) { //so 0,0 is visible - v_scroll->set_val(-10); - h_scroll->set_val(-10); + v_scroll->set_value(-10); + h_scroll->set_value(-10); first_update=false; } - ofs.y=v_scroll->get_val(); + ofs.y=v_scroll->get_value(); } if (canvas_item_rect.size.width <= (local_rect.size.x/zoom)) { @@ -2475,7 +2475,7 @@ void CanvasItemEditor::_update_scrollbars() { h_scroll->set_min(canvas_item_rect.pos.x); h_scroll->set_max(canvas_item_rect.pos.x+canvas_item_rect.size.x); h_scroll->set_page(local_rect.size.x/zoom); - ofs.x=h_scroll->get_val(); + ofs.x=h_scroll->get_value(); } // transform=Matrix32(); @@ -2497,8 +2497,8 @@ void CanvasItemEditor::_update_scroll(float) { return; Point2 ofs; - ofs.x=h_scroll->get_val(); - ofs.y=v_scroll->get_val(); + ofs.x=h_scroll->get_value(); + ofs.y=v_scroll->get_value(); // current_window->set_scroll(-ofs); @@ -2611,7 +2611,7 @@ void CanvasItemEditor::_popup_callback(int p_op) { dialog_val->set_min(0.1); dialog_val->set_step(0.1); dialog_val->set_max(800); - dialog_val->set_val(zoom*100); + dialog_val->set_value(zoom*100); value_dialog->popup_centered(Size2(200,85)); updating_value_dialog=false; @@ -2833,9 +2833,9 @@ void CanvasItemEditor::_popup_callback(int p_op) { Node2D *n2d = canvas_item->cast_to<Node2D>(); if (key_pos) - AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/pos",n2d->get_pos(),existing); + AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/pos",n2d->get_position(),existing); if (key_rot) - AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/rot",Math::rad2deg(n2d->get_rot()),existing); + AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/rot",Math::rad2deg(n2d->get_rotation()),existing); if (key_scale) AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/scale",n2d->get_scale(),existing); @@ -2865,9 +2865,9 @@ void CanvasItemEditor::_popup_callback(int p_op) { for(List<Node2D*>::Element *F=ik_chain.front();F;F=F->next()) { if (key_pos) - AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/pos",F->get()->get_pos(),existing); + AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/pos",F->get()->get_position(),existing); if (key_rot) - AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/rot",Math::rad2deg(F->get()->get_rot()),existing); + AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/rot",Math::rad2deg(F->get()->get_rotation()),existing); if (key_scale) AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/scale",F->get()->get_scale(),existing); @@ -2947,8 +2947,8 @@ void CanvasItemEditor::_popup_callback(int p_op) { Node2D *n2d = canvas_item->cast_to<Node2D>(); PoseClipboard pc; - pc.pos=n2d->get_pos(); - pc.rot=n2d->get_rot(); + pc.pos=n2d->get_position(); + pc.rot=n2d->get_rotation(); pc.scale=n2d->get_scale(); pc.id=n2d->get_instance_ID(); pose_clipboard.push_back(pc); @@ -2974,8 +2974,8 @@ void CanvasItemEditor::_popup_callback(int p_op) { undo_redo->add_do_method(n2d,"set_pos",E->get().pos); undo_redo->add_do_method(n2d,"set_rot",E->get().rot); undo_redo->add_do_method(n2d,"set_scale",E->get().scale); - undo_redo->add_undo_method(n2d,"set_pos",n2d->get_pos()); - undo_redo->add_undo_method(n2d,"set_rot",n2d->get_rot()); + undo_redo->add_undo_method(n2d,"set_pos",n2d->get_position()); + undo_redo->add_undo_method(n2d,"set_rot",n2d->get_rotation()); undo_redo->add_undo_method(n2d,"set_scale",n2d->get_scale()); } undo_redo->commit_action(); @@ -2998,9 +2998,9 @@ void CanvasItemEditor::_popup_callback(int p_op) { Node2D *n2d = canvas_item->cast_to<Node2D>(); if (key_pos) - n2d->set_pos(Vector2()); + n2d->set_position(Vector2()); if (key_rot) - n2d->set_rot(0); + n2d->set_rotation(0); if (key_scale) n2d->set_scale(Vector2(1,1)); } else if (canvas_item->cast_to<Control>()) { @@ -3180,8 +3180,8 @@ void CanvasItemEditor::_focus_selection(int p_op) { center = rect.pos + rect.size/2; Vector2 offset = viewport->get_size()/2 - editor->get_scene_root()->get_global_canvas_transform().xform(center); - h_scroll->set_val(h_scroll->get_val() - offset.x/zoom); - v_scroll->set_val(v_scroll->get_val() - offset.y/zoom); + h_scroll->set_value(h_scroll->get_value() - offset.x/zoom); + v_scroll->set_value(v_scroll->get_value() - offset.y/zoom); } else { // VIEW_FRAME_TO_SELECTION @@ -3825,7 +3825,7 @@ bool CanvasItemEditorViewport::_create_instance(Node* parent, String& path, cons Point2 pos; Node2D* parent_node2d=parent->cast_to<Node2D>(); if (parent_node2d) { - pos=parent_node2d->get_global_pos(); + pos=parent_node2d->get_global_position(); } else { Control* parent_control=parent->cast_to<Control>(); if (parent_control) { @@ -3913,7 +3913,7 @@ bool CanvasItemEditorViewport::can_drop_data(const Point2& p_point,const Variant _create_preview(files); } Matrix32 trans=canvas->get_canvas_transform(); - preview->set_pos((p_point-trans.get_origin())/trans.get_scale().x); + preview->set_position((p_point-trans.get_origin())/trans.get_scale().x); label->set_text(vformat(TTR("Adding %s..."),default_type)); } return can_instance; diff --git a/tools/editor/plugins/mesh_instance_editor_plugin.cpp b/tools/editor/plugins/mesh_instance_editor_plugin.cpp index acf1a3c96..037dcf22f 100644 --- a/tools/editor/plugins/mesh_instance_editor_plugin.cpp +++ b/tools/editor/plugins/mesh_instance_editor_plugin.cpp @@ -189,7 +189,7 @@ void MeshInstanceEditor::_create_outline_mesh() { return; } - Ref<Mesh> mesho = mesh->create_outline(outline_size->get_val()); + Ref<Mesh> mesho = mesh->create_outline(outline_size->get_value()); if (mesho.is_null()) { err_dialog->set_text(TTR("Could not create outline!")); @@ -255,7 +255,7 @@ MeshInstanceEditor::MeshInstanceEditor() { outline_size->set_min(0.001); outline_size->set_max(1024); outline_size->set_step(0.001); - outline_size->set_val(0.05); + outline_size->set_value(0.05); outline_dialog_vbc->add_margin_child(TTR("Outline Size:"),outline_size); add_child(outline_dialog); diff --git a/tools/editor/plugins/multimesh_editor_plugin.cpp b/tools/editor/plugins/multimesh_editor_plugin.cpp index 22981a287..e038c83ac 100644 --- a/tools/editor/plugins/multimesh_editor_plugin.cpp +++ b/tools/editor/plugins/multimesh_editor_plugin.cpp @@ -193,16 +193,16 @@ void MultiMeshEditor::_populate() { Ref<MultiMesh> multimesh = memnew( MultiMesh ); multimesh->set_mesh(mesh); - int instance_count=populate_amount->get_val(); + int instance_count=populate_amount->get_value(); multimesh->set_transform_format(MultiMesh::TRANSFORM_3D); multimesh->set_color_format(MultiMesh::COLOR_NONE); multimesh->set_instance_count(instance_count); - float _tilt_random = populate_tilt_random->get_val(); - float _rotate_random = populate_rotate_random->get_val(); - float _scale_random = populate_scale_random->get_val(); - float _scale = populate_scale->get_val(); + float _tilt_random = populate_tilt_random->get_value(); + float _rotate_random = populate_rotate_random->get_value(); + float _scale_random = populate_scale_random->get_value(); + float _scale = populate_scale->get_value(); int axis = populate_axis->get_selected(); Transform axis_xform; @@ -283,11 +283,11 @@ void MultiMeshEditor::_menu_option(int p_option) { surface_source->set_text(".."); mesh_source->set_text(".."); populate_axis->select(1); - populate_rotate_random->set_val(0); - populate_tilt_random->set_val(0); - populate_scale_random->set_val(0); - populate_scale->set_val(1); - populate_amount->set_val(128); + populate_rotate_random->set_value(0); + populate_tilt_random->set_value(0); + populate_scale_random->set_value(0); + populate_scale->set_value(1); + populate_amount->set_value(128); _last_pp_node=node; } @@ -387,7 +387,7 @@ MultiMeshEditor::MultiMeshEditor() { populate_scale_random = memnew( SpinBox ); populate_scale_random->set_min(0); populate_scale_random->set_max(1); - populate_scale_random->set_val(0); + populate_scale_random->set_value(0); populate_scale_random->set_step(0.01); vbc->add_margin_child(TTR("Random Scale:"),populate_scale_random); @@ -395,7 +395,7 @@ MultiMeshEditor::MultiMeshEditor() { populate_scale = memnew( SpinBox ); populate_scale->set_min(0.001); populate_scale->set_max(4096); - populate_scale->set_val(1); + populate_scale->set_value(1); populate_scale->set_step(0.01); vbc->add_margin_child(TTR("Scale:"),populate_scale); @@ -407,7 +407,7 @@ MultiMeshEditor::MultiMeshEditor() { populate_amount->set_end( Point2(5,237)); populate_amount->set_min(1); populate_amount->set_max(65536); - populate_amount->set_val(128); + populate_amount->set_value(128); vbc->add_margin_child(TTR("Amount:"),populate_amount); populate_dialog->get_ok()->set_text(TTR("Populate")); diff --git a/tools/editor/plugins/particles_2d_editor_plugin.cpp b/tools/editor/plugins/particles_2d_editor_plugin.cpp index 9a6c3d445..0eda9d3c1 100644 --- a/tools/editor/plugins/particles_2d_editor_plugin.cpp +++ b/tools/editor/plugins/particles_2d_editor_plugin.cpp @@ -62,7 +62,7 @@ void Particles2DEditorPlugin::_file_selected(const String& p_file) { print_line("file: "+p_file); - int epc=epoints->get_val(); + int epc=epoints->get_value(); Image img; Error err = ImageLoader::load_image(p_file,&img); @@ -189,7 +189,7 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) { epoints->set_min(1); epoints->set_max(8192); epoints->set_step(1); - epoints->set_val(512); + epoints->set_value(512); file->get_vbox()->add_margin_child(TTR("Generated Point Count:"),epoints); } diff --git a/tools/editor/plugins/polygon_2d_editor_plugin.cpp b/tools/editor/plugins/polygon_2d_editor_plugin.cpp index deb3944ad..4ab827017 100644 --- a/tools/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/tools/editor/plugins/polygon_2d_editor_plugin.cpp @@ -567,10 +567,10 @@ void Polygon2DEditor::_uv_input(const InputEvent& p_input) { } else if (mb.button_index==BUTTON_WHEEL_UP && mb.pressed) { - uv_zoom->set_val( uv_zoom->get_val()/0.9 ); + uv_zoom->set_value( uv_zoom->get_value()/0.9 ); } else if (mb.button_index==BUTTON_WHEEL_DOWN && mb.pressed) { - uv_zoom->set_val( uv_zoom->get_val()*0.9); + uv_zoom->set_value( uv_zoom->get_value()*0.9); } } else if (p_input.type==InputEvent::MOUSE_MOTION) { @@ -580,8 +580,8 @@ void Polygon2DEditor::_uv_input(const InputEvent& p_input) { if (mm.button_mask&BUTTON_MASK_MIDDLE || Input::get_singleton()->is_key_pressed(KEY_SPACE)) { Vector2 drag(mm.relative_x,mm.relative_y); - uv_hscroll->set_val( uv_hscroll->get_val()-drag.x ); - uv_vscroll->set_val( uv_vscroll->get_val()-drag.y ); + uv_hscroll->set_value( uv_hscroll->get_value()-drag.x ); + uv_vscroll->set_value( uv_vscroll->get_value()-drag.y ); } else if (uv_drag) { @@ -668,9 +668,9 @@ void Polygon2DEditor::_uv_scroll_changed(float) { if (updating_uv_scroll) return; - uv_draw_ofs.x=uv_hscroll->get_val(); - uv_draw_ofs.y=uv_vscroll->get_val(); - uv_draw_zoom=uv_zoom->get_val(); + uv_draw_ofs.x=uv_hscroll->get_value(); + uv_draw_ofs.y=uv_vscroll->get_value(); + uv_draw_zoom=uv_zoom->get_value(); uv_edit_draw->update(); } @@ -735,13 +735,13 @@ void Polygon2DEditor::_uv_draw() { uv_hscroll->set_min(rect.pos.x); uv_hscroll->set_max(rect.pos.x+rect.size.x); uv_hscroll->set_page(uv_edit_draw->get_size().x); - uv_hscroll->set_val(uv_draw_ofs.x); + uv_hscroll->set_value(uv_draw_ofs.x); uv_hscroll->set_step(0.001); uv_vscroll->set_min(rect.pos.y); uv_vscroll->set_max(rect.pos.y+rect.size.y); uv_vscroll->set_page(uv_edit_draw->get_size().y); - uv_vscroll->set_val(uv_draw_ofs.y); + uv_vscroll->set_value(uv_draw_ofs.y); uv_vscroll->set_step(0.001); updating_uv_scroll=false; @@ -914,7 +914,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { sb_off_x->set_min(-256); sb_off_x->set_max(256); sb_off_x->set_step(1); - sb_off_x->set_val(snap_offset.x); + sb_off_x->set_value(snap_offset.x); sb_off_x->set_suffix("px"); sb_off_x->connect("value_changed", this, "_set_snap_off_x"); uv_mode_hb->add_child(sb_off_x); @@ -923,7 +923,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { sb_off_y->set_min(-256); sb_off_y->set_max(256); sb_off_y->set_step(1); - sb_off_y->set_val(snap_offset.y); + sb_off_y->set_value(snap_offset.y); sb_off_y->set_suffix("px"); sb_off_y->connect("value_changed", this, "_set_snap_off_y"); uv_mode_hb->add_child(sb_off_y); @@ -935,7 +935,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { sb_step_x->set_min(-256); sb_step_x->set_max(256); sb_step_x->set_step(1); - sb_step_x->set_val(snap_step.x); + sb_step_x->set_value(snap_step.x); sb_step_x->set_suffix("px"); sb_step_x->connect("value_changed", this, "_set_snap_step_x"); uv_mode_hb->add_child(sb_step_x); @@ -944,7 +944,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { sb_step_y->set_min(-256); sb_step_y->set_max(256); sb_step_y->set_step(1); - sb_step_y->set_val(snap_step.y); + sb_step_y->set_value(snap_step.y); sb_step_y->set_suffix("px"); sb_step_y->connect("value_changed", this, "_set_snap_step_y"); uv_mode_hb->add_child(sb_step_y); @@ -955,7 +955,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { uv_zoom = memnew( HSlider ); uv_zoom->set_min(0.01); uv_zoom->set_max(4); - uv_zoom->set_val(1); + uv_zoom->set_value(1); uv_zoom->set_step(0.01); uv_mode_hb->add_child(uv_zoom); uv_zoom->set_custom_minimum_size(Size2(200,0)); diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp index 44d3b6333..5b5de0608 100644 --- a/tools/editor/plugins/spatial_editor_plugin.cpp +++ b/tools/editor/plugins/spatial_editor_plugin.cpp @@ -2116,7 +2116,7 @@ void SpatialEditorViewport::_init_gizmo_instance(int p_idx) { move_gizmo_instance[i]=VS::get_singleton()->instance_create(); VS::get_singleton()->instance_set_base(move_gizmo_instance[i],spatial_editor->get_move_gizmo(i)->get_rid()); VS::get_singleton()->instance_set_scenario(move_gizmo_instance[i],get_tree()->get_root()->get_world()->get_scenario()); - VS::get_singleton()->instance_geometry_set_flag(move_gizmo_instance[i],VS::INSTANCE_FLAG_VISIBLE,false); + VS::get_singleton()->instance_set_visible(move_gizmo_instance[i],false); //VS::get_singleton()->instance_geometry_set_flag(move_gizmo_instance[i],VS::INSTANCE_FLAG_DEPH_SCALE,true); VS::get_singleton()->instance_geometry_set_cast_shadows_setting(move_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF); VS::get_singleton()->instance_set_layer_mask(move_gizmo_instance[i],layer); @@ -2124,7 +2124,7 @@ void SpatialEditorViewport::_init_gizmo_instance(int p_idx) { rotate_gizmo_instance[i]=VS::get_singleton()->instance_create(); VS::get_singleton()->instance_set_base(rotate_gizmo_instance[i],spatial_editor->get_rotate_gizmo(i)->get_rid()); VS::get_singleton()->instance_set_scenario(rotate_gizmo_instance[i],get_tree()->get_root()->get_world()->get_scenario()); - VS::get_singleton()->instance_geometry_set_flag(rotate_gizmo_instance[i],VS::INSTANCE_FLAG_VISIBLE,false); + VS::get_singleton()->instance_set_visible(rotate_gizmo_instance[i],false); //VS::get_singleton()->instance_geometry_set_flag(rotate_gizmo_instance[i],VS::INSTANCE_FLAG_DEPH_SCALE,true); VS::get_singleton()->instance_geometry_set_cast_shadows_setting(rotate_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF); VS::get_singleton()->instance_set_layer_mask(rotate_gizmo_instance[i],layer); @@ -2233,9 +2233,9 @@ void SpatialEditorViewport::update_transform_gizmo_view() { for(int i=0;i<3;i++) { VisualServer::get_singleton()->instance_set_transform(move_gizmo_instance[i], xform ); - VisualServer::get_singleton()->instance_geometry_set_flag(move_gizmo_instance[i],VS::INSTANCE_FLAG_VISIBLE,spatial_editor->is_gizmo_visible()&& (spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_MOVE) ); + VisualServer::get_singleton()->instance_set_visible(move_gizmo_instance[i],spatial_editor->is_gizmo_visible()&& (spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_MOVE) ); VisualServer::get_singleton()->instance_set_transform(rotate_gizmo_instance[i], xform ); - VisualServer::get_singleton()->instance_geometry_set_flag(rotate_gizmo_instance[i],VS::INSTANCE_FLAG_VISIBLE,spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_ROTATE) ); + VisualServer::get_singleton()->instance_set_visible(rotate_gizmo_instance[i],spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_ROTATE) ); } } @@ -2691,11 +2691,11 @@ void SpatialEditor::set_state(const Dictionary& p_state) { } if (d.has("zfar")) - settings_zfar->set_val(float(d["zfar"])); + settings_zfar->set_value(float(d["zfar"])); if (d.has("znear")) - settings_znear->set_val(float(d["znear"])); + settings_znear->set_value(float(d["znear"])); if (d.has("fov")) - settings_fov->set_val(float(d["fov"])); + settings_fov->set_value(float(d["fov"])); if (d.has("default_light")) { bool use = d["default_light"]; @@ -2738,7 +2738,7 @@ void SpatialEditor::set_state(const Dictionary& p_state) { if (use!=view_menu->get_popup()->is_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN))) { view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN), use ); - VisualServer::get_singleton()->instance_geometry_set_flag(origin_instance,VS::INSTANCE_FLAG_VISIBLE,use); + VisualServer::get_singleton()->instance_set_visible(origin_instance,use); } } @@ -3121,7 +3121,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { bool is_checked = view_menu->get_popup()->is_item_checked( view_menu->get_popup()->get_item_index(p_option) ); is_checked=!is_checked; - VisualServer::get_singleton()->instance_geometry_set_flag(origin_instance,VS::INSTANCE_FLAG_VISIBLE,is_checked); + VisualServer::get_singleton()->instance_set_visible(origin_instance,is_checked); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(p_option), is_checked); } break; @@ -3133,7 +3133,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { for(int i=0;i<3;++i) { if (grid_enable[i]) { - VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[i],VS::INSTANCE_FLAG_VISIBLE,grid_enabled); + VisualServer::get_singleton()->instance_set_visible(grid_instance[i],grid_enabled); grid_visible[i]=grid_enabled; } } @@ -3225,7 +3225,7 @@ void SpatialEditor::_init_indicators() { grid_visible[i]=false; grid_enable[i]=false; - VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[i],VS::INSTANCE_FLAG_VISIBLE,false); + VisualServer::get_singleton()->instance_set_visible(grid_instance[i],false); VisualServer::get_singleton()->instance_geometry_set_cast_shadows_setting(grid_instance[i], VS::SHADOW_CASTING_SETTING_OFF); VS::get_singleton()->instance_set_layer_mask(grid_instance[i], 1 << SpatialEditorViewport::GIZMO_GRID_LAYER); @@ -3252,7 +3252,7 @@ void SpatialEditor::_init_indicators() { - VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[1],VS::INSTANCE_FLAG_VISIBLE,true); + VisualServer::get_singleton()->instance_set_visible(grid_instance[1],true); grid_enable[1]=true; grid_visible[1]=true; grid_enabled=true; @@ -3721,9 +3721,9 @@ void SpatialEditor::_bind_methods() { void SpatialEditor::clear() { - settings_fov->set_val(EDITOR_DEF("3d_editor/default_fov",60.0)); - settings_znear->set_val(EDITOR_DEF("3d_editor/default_z_near",0.1)); - settings_zfar->set_val(EDITOR_DEF("3d_editor/default_z_far",1500.0)); + settings_fov->set_value(EDITOR_DEF("3d_editor/default_fov",60.0)); + settings_znear->set_value(EDITOR_DEF("3d_editor/default_z_near",0.1)); + settings_zfar->set_value(EDITOR_DEF("3d_editor/default_z_far",1500.0)); for(int i=0;i<4;i++) { viewports[i]->reset(); @@ -3733,11 +3733,11 @@ void SpatialEditor::clear() { _menu_item_pressed(MENU_VIEW_DISPLAY_NORMAL); - VisualServer::get_singleton()->instance_geometry_set_flag(origin_instance,VS::INSTANCE_FLAG_VISIBLE,true); + VisualServer::get_singleton()->instance_set_visible(origin_instance,true); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN), true); for(int i=0;i<3;++i) { if (grid_enable[i]) { - VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[i],VS::INSTANCE_FLAG_VISIBLE,true); + VisualServer::get_singleton()->instance_set_visible(grid_instance[i],true); grid_visible[i]=true; } } @@ -4045,21 +4045,21 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { settings_fov->set_max(179); settings_fov->set_min(1); settings_fov->set_step(0.01); - settings_fov->set_val(EDITOR_DEF("3d_editor/default_fov",60.0)); + settings_fov->set_value(EDITOR_DEF("3d_editor/default_fov",60.0)); settings_vbc->add_margin_child(TTR("Perspective FOV (deg.):"),settings_fov); settings_znear = memnew( SpinBox ); settings_znear->set_max(10000); settings_znear->set_min(0.1); settings_znear->set_step(0.01); - settings_znear->set_val(EDITOR_DEF("3d_editor/default_z_near",0.1)); + settings_znear->set_value(EDITOR_DEF("3d_editor/default_z_near",0.1)); settings_vbc->add_margin_child(TTR("View Z-Near:"),settings_znear); settings_zfar = memnew( SpinBox ); settings_zfar->set_max(10000); settings_zfar->set_min(0.1); settings_zfar->set_step(0.01); - settings_zfar->set_val(EDITOR_DEF("3d_editor/default_z_far",1500)); + settings_zfar->set_value(EDITOR_DEF("3d_editor/default_z_far",1500)); settings_vbc->add_margin_child(TTR("View Z-Far:"),settings_zfar); //settings_dialog->get_cancel()->hide(); diff --git a/tools/editor/plugins/spatial_editor_plugin.h b/tools/editor/plugins/spatial_editor_plugin.h index 9ccc6008c..f177dcab4 100644 --- a/tools/editor/plugins/spatial_editor_plugin.h +++ b/tools/editor/plugins/spatial_editor_plugin.h @@ -491,9 +491,9 @@ public: static SpatialEditor *get_singleton() { return singleton; } void snap_cursor_to_plane(const Plane& p_plane); - float get_znear() const { return settings_znear->get_val(); } - float get_zfar() const { return settings_zfar->get_val(); } - float get_fov() const { return settings_fov->get_val(); } + float get_znear() const { return settings_znear->get_value(); } + float get_zfar() const { return settings_zfar->get_value(); } + float get_fov() const { return settings_fov->get_value(); } Transform get_gizmo_transform() const { return gizmo.transform; } bool is_gizmo_visible() const { return gizmo.visible; } diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.cpp b/tools/editor/plugins/sprite_frames_editor_plugin.cpp index f5ff63595..7c6e2f653 100644 --- a/tools/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/tools/editor/plugins/sprite_frames_editor_plugin.cpp @@ -605,7 +605,7 @@ void SpriteFramesEditor::_update_library(bool p_skip_selector) { tree->select(tree->get_item_count()-1); } - anim_speed->set_val(frames->get_animation_speed(edited_anim)); + anim_speed->set_value(frames->get_animation_speed(edited_anim)); anim_loop->set_pressed(frames->get_animation_loop(edited_anim)); updating=false; diff --git a/tools/editor/plugins/texture_region_editor_plugin.cpp b/tools/editor/plugins/texture_region_editor_plugin.cpp index 5c2d5ccaa..4a25e636a 100644 --- a/tools/editor/plugins/texture_region_editor_plugin.cpp +++ b/tools/editor/plugins/texture_region_editor_plugin.cpp @@ -166,13 +166,13 @@ void TextureRegionEditor::_region_draw() hscroll->set_min(scroll_rect.pos.x); hscroll->set_max(scroll_rect.pos.x+scroll_rect.size.x); hscroll->set_page(edit_draw->get_size().x); - hscroll->set_val(draw_ofs.x); + hscroll->set_value(draw_ofs.x); hscroll->set_step(0.001); vscroll->set_min(scroll_rect.pos.y); vscroll->set_max(scroll_rect.pos.y+scroll_rect.size.y); vscroll->set_page(edit_draw->get_size().y); - vscroll->set_val(draw_ofs.y); + vscroll->set_value(draw_ofs.y); vscroll->set_step(0.001); updating_scroll=false; @@ -400,8 +400,8 @@ void TextureRegionEditor::_region_input(const InputEvent& p_input) if (mm.button_mask&BUTTON_MASK_MIDDLE || Input::get_singleton()->is_key_pressed(KEY_SPACE)) { Vector2 draged(mm.relative_x,mm.relative_y); - hscroll->set_val( hscroll->get_val()-draged.x ); - vscroll->set_val( vscroll->get_val()-draged.y ); + hscroll->set_value( hscroll->get_value()-draged.x ); + vscroll->set_value( vscroll->get_value()-draged.y ); } else if (drag) { @@ -500,8 +500,8 @@ void TextureRegionEditor::_scroll_changed(float) if (updating_scroll) return; - draw_ofs.x=hscroll->get_val(); - draw_ofs.y=vscroll->get_val(); + draw_ofs.x=hscroll->get_value(); + draw_ofs.y=vscroll->get_value(); edit_draw->update(); } @@ -829,7 +829,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor) sb_off_x->set_min(-256); sb_off_x->set_max(256); sb_off_x->set_step(1); - sb_off_x->set_val(snap_offset.x); + sb_off_x->set_value(snap_offset.x); sb_off_x->set_suffix("px"); sb_off_x->connect("value_changed", this, "_set_snap_off_x"); hb_grid->add_child(sb_off_x); @@ -838,7 +838,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor) sb_off_y->set_min(-256); sb_off_y->set_max(256); sb_off_y->set_step(1); - sb_off_y->set_val(snap_offset.y); + sb_off_y->set_value(snap_offset.y); sb_off_y->set_suffix("px"); sb_off_y->connect("value_changed", this, "_set_snap_off_y"); hb_grid->add_child(sb_off_y); @@ -850,7 +850,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor) sb_step_x->set_min(-256); sb_step_x->set_max(256); sb_step_x->set_step(1); - sb_step_x->set_val(snap_step.x); + sb_step_x->set_value(snap_step.x); sb_step_x->set_suffix("px"); sb_step_x->connect("value_changed", this, "_set_snap_step_x"); hb_grid->add_child(sb_step_x); @@ -859,7 +859,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor) sb_step_y->set_min(-256); sb_step_y->set_max(256); sb_step_y->set_step(1); - sb_step_y->set_val(snap_step.y); + sb_step_y->set_value(snap_step.y); sb_step_y->set_suffix("px"); sb_step_y->connect("value_changed", this, "_set_snap_step_y"); hb_grid->add_child(sb_step_y); @@ -871,7 +871,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor) sb_sep_x->set_min(0); sb_sep_x->set_max(256); sb_sep_x->set_step(1); - sb_sep_x->set_val(snap_separation.x); + sb_sep_x->set_value(snap_separation.x); sb_sep_x->set_suffix("px"); sb_sep_x->connect("value_changed", this, "_set_snap_sep_x"); hb_grid->add_child(sb_sep_x); @@ -880,7 +880,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor) sb_sep_y->set_min(0); sb_sep_y->set_max(256); sb_sep_y->set_step(1); - sb_sep_y->set_val(snap_separation.y); + sb_sep_y->set_value(snap_separation.y); sb_sep_y->set_suffix("px"); sb_sep_y->connect("value_changed", this, "_set_snap_sep_y"); hb_grid->add_child(sb_sep_y); @@ -971,22 +971,22 @@ void TextureRegionEditorPlugin::set_state(const Dictionary& p_state){ if (state.has("snap_step")) { Vector2 s = state["snap_step"]; - region_editor->sb_step_x->set_val(s.x); - region_editor->sb_step_y->set_val(s.y); + region_editor->sb_step_x->set_value(s.x); + region_editor->sb_step_y->set_value(s.y); region_editor->snap_step = s; } if (state.has("snap_offset")) { Vector2 ofs = state["snap_offset"]; - region_editor->sb_off_x->set_val(ofs.x); - region_editor->sb_off_y->set_val(ofs.y); + region_editor->sb_off_x->set_value(ofs.x); + region_editor->sb_off_y->set_value(ofs.y); region_editor->snap_offset = ofs; } if (state.has("snap_separation")) { Vector2 sep = state["snap_separation"]; - region_editor->sb_sep_x->set_val(sep.x); - region_editor->sb_sep_y->set_val(sep.y); + region_editor->sb_sep_x->set_value(sep.x); + region_editor->sb_sep_y->set_value(sep.y); region_editor->snap_separation = sep; } diff --git a/tools/editor/plugins/theme_editor_plugin.cpp b/tools/editor/plugins/theme_editor_plugin.cpp index fdd3b6156..2950a3485 100644 --- a/tools/editor/plugins/theme_editor_plugin.cpp +++ b/tools/editor/plugins/theme_editor_plugin.cpp @@ -750,7 +750,7 @@ ThemeEditor::ThemeEditor() { first_vb->add_child( memnew( HScrollBar )); first_vb->add_child( memnew( SpinBox )); ProgressBar *pb=memnew( ProgressBar ); - pb->set_val(50); + pb->set_value(50); first_vb->add_child( pb); Panel *pn=memnew( Panel ); pn->set_custom_minimum_size(Size2(40,40)*EDSCALE); diff --git a/tools/editor/plugins/tile_map_editor_plugin.cpp b/tools/editor/plugins/tile_map_editor_plugin.cpp index 8904739f0..9bdf80c31 100644 --- a/tools/editor/plugins/tile_map_editor_plugin.cpp +++ b/tools/editor/plugins/tile_map_editor_plugin.cpp @@ -221,7 +221,7 @@ void TileMapEditor::_update_palette() { palette->add_constant_override("vseparation", 8*EDSCALE); palette->set_fixed_icon_size(Size2(min_size, min_size)); - palette->set_fixed_column_width(min_size * MAX(size_slider->get_val(), 1)); + palette->set_fixed_column_width(min_size * MAX(size_slider->get_value(), 1)); String filter = search_box->get_text().strip_edges(); @@ -1449,7 +1449,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { size_slider->set_min(0.1f); size_slider->set_max(4.0f); size_slider->set_step(0.1f); - size_slider->set_val(1.0f); + size_slider->set_value(1.0f); size_slider->connect("value_changed", this, "_icon_size_changed"); add_child(size_slider); |
