diff options
Diffstat (limited to 'editor/animation_editor.cpp')
| -rw-r--r-- | editor/animation_editor.cpp | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/editor/animation_editor.cpp b/editor/animation_editor.cpp index 16606b5d12..63ed27e60c 100644 --- a/editor/animation_editor.cpp +++ b/editor/animation_editor.cpp @@ -1035,7 +1035,7 @@ void AnimationKeyEditor::_track_pos_draw() { //draw position int pixel = (timeline_pos - h_scroll->get_value()) * zoom_scale; pixel += name_limit; - track_pos->draw_line(ofs + Point2(pixel, 0), ofs + Point2(pixel, size.height), Color(1, 0.3, 0.3, 0.8)); + track_pos->draw_line(ofs + Point2(pixel, 0), ofs + Point2(pixel, size.height), get_color("animation_editor_track_pos", "Editor")); } } @@ -1089,9 +1089,8 @@ void AnimationKeyEditor::_track_editor_draw() { int sep = get_constant("vseparation", "Tree"); int hsep = get_constant("hseparation", "Tree"); Color color = get_color("font_color", "Tree"); - Color sepcolor = get_color("guide_color", "Tree"); - Color timecolor = get_color("prop_subsection", "Editor"); - timecolor = Color::html("ff4a414f"); + Color sepcolor = get_color("guide_color", "Editor"); + Color timecolor = get_color("animation_editor_time", "Editor"); Color hover_color = Color(1, 1, 1, 0.05); Color select_color = Color(1, 1, 1, 0.1); Color invalid_path_color = Color(1, 0.6, 0.4, 0.5); @@ -1155,8 +1154,9 @@ void AnimationKeyEditor::_track_editor_draw() { int settings_limit = size.width - right_separator_ofs; int name_limit = settings_limit * name_column_ratio; - te->draw_line(ofs + Point2(name_limit, 0), ofs + Point2(name_limit, size.height), color); - te->draw_line(ofs + Point2(settings_limit, 0), ofs + Point2(settings_limit, size.height), color); + Color line_color = get_color("animation_editor_line", "Editor"); + te->draw_line(ofs + Point2(name_limit, 0), ofs + Point2(name_limit, size.height), line_color); + te->draw_line(ofs + Point2(settings_limit, 0), ofs + Point2(settings_limit, size.height), line_color); te->draw_texture(hsize_icon, ofs + Point2(name_limit - hsize_icon->get_width() - hsep, (h - hsize_icon->get_height()) / 2)); te->draw_line(ofs + Point2(0, h), ofs + Point2(size.width, h), color); @@ -1483,7 +1483,7 @@ void AnimationKeyEditor::_track_editor_draw() { switch (click.click) { case ClickOver::CLICK_SELECT_KEYS: { - te->draw_rect(Rect2(click.at, click.to - click.at), Color(0.7, 0.7, 1.0, 0.5)); + te->draw_rect(Rect2(click.at, click.to - click.at), get_color("animation_editor_selection_rect", "Editor")); } break; case ClickOver::CLICK_MOVE_KEYS: { @@ -1724,7 +1724,7 @@ bool AnimationKeyEditor::_edit_if_single_selection() { curve_edit->set_transition(animation->track_get_key_transition(idx, key)); /*key_edit_dialog->set_size( Size2( 200,200) ); - key_edit_dialog->set_pos( track_editor->get_global_pos() + ofs + mpos +Point2(-100,20)); + key_edit_dialog->set_position( track_editor->get_global_position() + ofs + mpos +Point2(-100,20)); key_edit_dialog->popup();*/ } @@ -1983,7 +1983,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const InputEvent &p_input) { track_menu->add_item(TTR("Duplicate Transposed"), RIGHT_MENU_DUPLICATE_TRANSPOSE); track_menu->add_item(TTR("Remove Selection"), RIGHT_MENU_REMOVE); - track_menu->set_pos(te->get_global_pos() + mpos); + track_menu->set_position(te->get_global_position() + mpos); interp_editing = -1; cont_editing = -1; @@ -2064,7 +2064,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const InputEvent &p_input) { Rect2 area(ofs.x, ofs.y + ((int(mpos.y) / h) + 1) * h, name_limit, h); track_name->set_text(animation->track_get_path(idx)); - track_name->set_pos(te->get_global_pos() + area.pos); + track_name->set_position(te->get_global_position() + area.pos); track_name->set_size(area.size); track_name->show_modal(); track_name->grab_focus(); @@ -2214,7 +2214,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const InputEvent &p_input) { int popup_y = ofs.y + ((int(mpos.y) / h) + 2) * h; int popup_x = size.width - track_ofs[1]; - track_menu->set_pos(te->get_global_pos() + Point2(popup_x, popup_y)); + track_menu->set_position(te->get_global_position() + Point2(popup_x, popup_y)); wrap_editing = idx; interp_editing = -1; @@ -2237,7 +2237,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const InputEvent &p_input) { int popup_y = ofs.y + ((int(mpos.y) / h) + 2) * h; int popup_x = size.width - track_ofs[2]; - track_menu->set_pos(te->get_global_pos() + Point2(popup_x, popup_y)); + track_menu->set_position(te->get_global_position() + Point2(popup_x, popup_y)); interp_editing = idx; cont_editing = -1; @@ -2260,7 +2260,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const InputEvent &p_input) { int popup_y = ofs.y + ((int(mpos.y) / h) + 2) * h; int popup_x = size.width - track_ofs[3]; - track_menu->set_pos(te->get_global_pos() + Point2(popup_x, popup_y)); + track_menu->set_position(te->get_global_position() + Point2(popup_x, popup_y)); interp_editing = -1; wrap_editing = -1; @@ -2309,7 +2309,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const InputEvent &p_input) { cvi_track = idx; cvi_pos = pos; - type_menu->set_pos(get_global_pos() + mpos + ofs); + type_menu->set_position(get_global_position() + mpos + ofs); type_menu->popup(); return; } @@ -3749,10 +3749,11 @@ AnimationKeyEditor::AnimationKeyEditor() { root = NULL; //menu = memnew( MenuButton ); //menu->set_flat(true); - //menu->set_pos(Point2()); + //menu->set_position(Point2()); //add_child(menu); zoomicon = memnew(TextureRect); + zoomicon->set_stretch_mode(TextureRect::STRETCH_KEEP_CENTERED); hb->add_child(zoomicon); zoomicon->set_tooltip(TTR("Animation zoom.")); @@ -3891,7 +3892,7 @@ AnimationKeyEditor::AnimationKeyEditor() { /* l = memnew( Label ); l->set_text("Base: "); - l->set_pos(Point2(0,3)); + l->set_position(Point2(0,3)); //dr_panel->add_child(l);*/ //menu->get_popup()->connect("id_pressed",this,"_menu_callback"); |