diff options
Diffstat (limited to 'editor/animation_bezier_editor.cpp')
-rw-r--r-- | editor/animation_bezier_editor.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp index e0839a9f27..e6a020bf41 100644 --- a/editor/animation_bezier_editor.cpp +++ b/editor/animation_bezier_editor.cpp @@ -215,20 +215,20 @@ void AnimationBezierTrackEdit::_draw_line_clipped(const Vector2 &p_from, const V void AnimationBezierTrackEdit::_notification(int p_what) { if (p_what == NOTIFICATION_THEME_CHANGED || p_what == NOTIFICATION_ENTER_TREE) { - bezier_icon = get_icon("KeyBezierPoint", "EditorIcons"); - bezier_handle_icon = get_icon("KeyBezierHandle", "EditorIcons"); - selected_icon = get_icon("KeyBezierSelected", "EditorIcons"); + bezier_icon = get_theme_icon("KeyBezierPoint", "EditorIcons"); + bezier_handle_icon = get_theme_icon("KeyBezierHandle", "EditorIcons"); + selected_icon = get_theme_icon("KeyBezierSelected", "EditorIcons"); if (handle_mode_option->get_item_count() == 0) { - handle_mode_option->add_icon_item(get_icon("BezierHandlesFree", "EditorIcons"), TTR("Free"), HANDLE_MODE_FREE); - handle_mode_option->add_icon_item(get_icon("BezierHandlesBalanced", "EditorIcons"), TTR("Balanced"), HANDLE_MODE_BALANCED); - handle_mode_option->add_icon_item(get_icon("BezierHandlesMirror", "EditorIcons"), TTR("Mirror"), HANDLE_MODE_MIRROR); + handle_mode_option->add_icon_item(get_theme_icon("BezierHandlesFree", "EditorIcons"), TTR("Free"), HANDLE_MODE_FREE); + handle_mode_option->add_icon_item(get_theme_icon("BezierHandlesBalanced", "EditorIcons"), TTR("Balanced"), HANDLE_MODE_BALANCED); + handle_mode_option->add_icon_item(get_theme_icon("BezierHandlesMirror", "EditorIcons"), TTR("Mirror"), HANDLE_MODE_MIRROR); } } if (p_what == NOTIFICATION_RESIZED) { int right_limit = get_size().width - timeline->get_buttons_width(); - int hsep = get_constant("hseparation", "ItemList"); - int vsep = get_constant("vseparation", "ItemList"); + int hsep = get_theme_constant("hseparation", "ItemList"); + int vsep = get_theme_constant("vseparation", "ItemList"); handle_mode_option->set_position(Vector2(right_limit + hsep, get_size().height - handle_mode_option->get_combined_minimum_size().height - vsep)); handle_mode_option->set_size(Vector2(timeline->get_buttons_width() - hsep * 2, handle_mode_option->get_combined_minimum_size().height)); @@ -240,15 +240,15 @@ void AnimationBezierTrackEdit::_notification(int p_what) { int limit = timeline->get_name_limit(); if (has_focus()) { - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); accent.a *= 0.7; draw_rect(Rect2(Point2(), get_size()), accent, false); } - Ref<Font> font = get_font("font", "Label"); - Color color = get_color("font_color", "Label"); - int hsep = get_constant("hseparation", "ItemList"); - int vsep = get_constant("vseparation", "ItemList"); + Ref<Font> font = get_theme_font("font", "Label"); + Color color = get_theme_color("font_color", "Label"); + int hsep = get_theme_constant("hseparation", "ItemList"); + int vsep = get_theme_constant("vseparation", "ItemList"); Color linecolor = color; linecolor.a = 0.2; @@ -258,7 +258,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { draw_line(Point2(right_limit, 0), Point2(right_limit, get_size().height), linecolor); - Ref<Texture2D> close_icon = get_icon("Close", "EditorIcons"); + Ref<Texture2D> close_icon = get_theme_icon("Close", "EditorIcons"); close_icon_rect.position = Vector2(get_size().width - close_icon->get_width() - hsep, hsep); close_icon_rect.size = close_icon->get_size(); @@ -277,7 +277,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { { NodePath path = animation->track_get_path(track); - Node *node = NULL; + Node *node = nullptr; if (root && root->has_node(path)) { node = root->get_node(path); @@ -340,7 +340,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { subtracks[i] = rect; } else { - Color ac = get_color("accent_color", "Editor"); + Color ac = get_theme_color("accent_color", "Editor"); ac.a = 0.5; draw_rect(rect, ac); } @@ -349,7 +349,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { vofs += font->get_height() + vsep; } - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); { //guides float min_left_scale = font->get_height() + vsep; @@ -391,7 +391,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { { //draw OTHER curves float scale = timeline->get_zoom_scale(); - Ref<Texture2D> point = get_icon("KeyValue", "EditorIcons"); + Ref<Texture2D> point = get_theme_icon("KeyValue", "EditorIcons"); for (Map<int, Color>::Element *E = subtrack_colors.front(); E; E = E->next()) { _draw_track(E->key(), E->get()); @@ -410,7 +410,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { } //draw edited curve - const Color highlight = get_color("highlight_color", "Editor"); + const Color highlight = get_theme_color("highlight_color", "Editor"); _draw_track(track, highlight); } @@ -540,7 +540,7 @@ void AnimationBezierTrackEdit::_play_position_draw() { int px = (-timeline->get_value() + play_position_pos) * scale + timeline->get_name_limit(); if (px >= timeline->get_name_limit() && px < (get_size().width - timeline->get_buttons_width())) { - Color color = get_color("accent_color", "Editor"); + Color color = get_theme_color("accent_color", "Editor"); play_position->draw_line(Point2(px, 0), Point2(px, h), color); } } @@ -657,9 +657,9 @@ void AnimationBezierTrackEdit::_gui_input(const Ref<InputEvent> &p_event) { menu->add_icon_item(bezier_icon, TTR("Insert Key Here"), MENU_KEY_INSERT); if (selection.size()) { menu->add_separator(); - menu->add_icon_item(get_icon("Duplicate", "EditorIcons"), TTR("Duplicate Selected Key(s)"), MENU_KEY_DUPLICATE); + menu->add_icon_item(get_theme_icon("Duplicate", "EditorIcons"), TTR("Duplicate Selected Key(s)"), MENU_KEY_DUPLICATE); menu->add_separator(); - menu->add_icon_item(get_icon("Remove", "EditorIcons"), TTR("Delete Selected Key(s)"), MENU_KEY_DELETE); + menu->add_icon_item(get_theme_icon("Remove", "EditorIcons"), TTR("Delete Selected Key(s)"), MENU_KEY_DELETE); } menu->set_as_minsize(); @@ -1076,7 +1076,7 @@ void AnimationBezierTrackEdit::duplicate_selection() { undo_redo->create_action(TTR("Anim Duplicate Keys")); - List<Pair<int, float> > new_selection_values; + List<Pair<int, float>> new_selection_values; for (Set<int>::Element *E = selection.back(); E; E = E->prev()) { @@ -1103,7 +1103,7 @@ void AnimationBezierTrackEdit::duplicate_selection() { //reselect duplicated selection.clear(); - for (List<Pair<int, float> >::Element *E = new_selection_values.front(); E; E = E->next()) { + for (List<Pair<int, float>>::Element *E = new_selection_values.front(); E; E = E->next()) { int track = E->get().first; float time = E->get().second; @@ -1162,11 +1162,11 @@ void AnimationBezierTrackEdit::_bind_methods() { } AnimationBezierTrackEdit::AnimationBezierTrackEdit() { - undo_redo = NULL; - timeline = NULL; - root = NULL; - menu = NULL; - block_animation_update_ptr = NULL; + undo_redo = nullptr; + timeline = nullptr; + root = nullptr; + menu = nullptr; + block_animation_update_ptr = nullptr; moving_selection_attempt = false; moving_selection = false; |