Add EditorStringNames singleton
This commit is contained in:
@ -33,6 +33,7 @@
|
||||
#include "editor/audio_stream_preview.h"
|
||||
#include "editor/editor_resource_preview.h"
|
||||
#include "editor/editor_scale.h"
|
||||
#include "editor/editor_string_names.h"
|
||||
#include "editor/editor_undo_redo_manager.h"
|
||||
#include "scene/2d/animated_sprite_2d.h"
|
||||
#include "scene/2d/sprite_2d.h"
|
||||
@ -73,7 +74,7 @@ void AnimationTrackEditBool::draw_key(int p_index, float p_pixels_sec, int p_x,
|
||||
draw_texture(icon, ofs);
|
||||
|
||||
if (p_selected) {
|
||||
Color color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
Color color = get_theme_color(SNAME("accent_color"), EditorStringName(Editor));
|
||||
draw_rect_clipped(Rect2(ofs, icon->get_size()), color, false);
|
||||
}
|
||||
}
|
||||
@ -180,7 +181,7 @@ void AnimationTrackEditColor::draw_key(int p_index, float p_pixels_sec, int p_x,
|
||||
draw_rect_clipped(rect, color);
|
||||
|
||||
if (p_selected) {
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
Color accent = get_theme_color(SNAME("accent_color"), EditorStringName(Editor));
|
||||
draw_rect_clipped(rect, accent, false);
|
||||
}
|
||||
}
|
||||
@ -329,7 +330,7 @@ void AnimationTrackEditAudio::draw_key(int p_index, float p_pixels_sec, int p_x,
|
||||
RS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), points, colors);
|
||||
|
||||
if (p_selected) {
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
Color accent = get_theme_color(SNAME("accent_color"), EditorStringName(Editor));
|
||||
draw_rect(rect, accent, false);
|
||||
}
|
||||
} else {
|
||||
@ -342,7 +343,7 @@ void AnimationTrackEditAudio::draw_key(int p_index, float p_pixels_sec, int p_x,
|
||||
draw_rect_clipped(rect, color);
|
||||
|
||||
if (p_selected) {
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
Color accent = get_theme_color(SNAME("accent_color"), EditorStringName(Editor));
|
||||
draw_rect_clipped(rect, accent, false);
|
||||
}
|
||||
}
|
||||
@ -541,7 +542,7 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in
|
||||
return;
|
||||
}
|
||||
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
Color accent = get_theme_color(SNAME("accent_color"), EditorStringName(Editor));
|
||||
Color bg = accent;
|
||||
bg.a = 0.15;
|
||||
|
||||
@ -700,7 +701,7 @@ void AnimationTrackEditSubAnim::draw_key(int p_index, float p_pixels_sec, int p_
|
||||
}
|
||||
|
||||
if (p_selected) {
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
Color accent = get_theme_color(SNAME("accent_color"), EditorStringName(Editor));
|
||||
draw_rect(rect, accent, false);
|
||||
}
|
||||
} else {
|
||||
@ -713,7 +714,7 @@ void AnimationTrackEditSubAnim::draw_key(int p_index, float p_pixels_sec, int p_
|
||||
draw_rect_clipped(rect, color);
|
||||
|
||||
if (p_selected) {
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
Color accent = get_theme_color(SNAME("accent_color"), EditorStringName(Editor));
|
||||
draw_rect_clipped(rect, accent, false);
|
||||
}
|
||||
}
|
||||
@ -726,12 +727,12 @@ void AnimationTrackEditSubAnim::set_node(Object *p_object) {
|
||||
//// VOLUME DB ////
|
||||
|
||||
int AnimationTrackEditVolumeDB::get_key_height() const {
|
||||
Ref<Texture2D> volume_texture = get_theme_icon(SNAME("ColorTrackVu"), SNAME("EditorIcons"));
|
||||
Ref<Texture2D> volume_texture = get_editor_theme_icon(SNAME("ColorTrackVu"));
|
||||
return volume_texture->get_height() * 1.2;
|
||||
}
|
||||
|
||||
void AnimationTrackEditVolumeDB::draw_bg(int p_clip_left, int p_clip_right) {
|
||||
Ref<Texture2D> volume_texture = get_theme_icon(SNAME("ColorTrackVu"), SNAME("EditorIcons"));
|
||||
Ref<Texture2D> volume_texture = get_editor_theme_icon(SNAME("ColorTrackVu"));
|
||||
int tex_h = volume_texture->get_height();
|
||||
|
||||
int y_from = (get_size().height - tex_h) / 2;
|
||||
@ -742,7 +743,7 @@ void AnimationTrackEditVolumeDB::draw_bg(int p_clip_left, int p_clip_right) {
|
||||
}
|
||||
|
||||
void AnimationTrackEditVolumeDB::draw_fg(int p_clip_left, int p_clip_right) {
|
||||
Ref<Texture2D> volume_texture = get_theme_icon(SNAME("ColorTrackVu"), SNAME("EditorIcons"));
|
||||
Ref<Texture2D> volume_texture = get_editor_theme_icon(SNAME("ColorTrackVu"));
|
||||
int tex_h = volume_texture->get_height();
|
||||
int y_from = (get_size().height - tex_h) / 2;
|
||||
int db0 = y_from + (24 / 80.0) * tex_h;
|
||||
@ -777,7 +778,7 @@ void AnimationTrackEditVolumeDB::draw_key_link(int p_index, float p_pixels_sec,
|
||||
to_x = p_clip_right;
|
||||
}
|
||||
|
||||
Ref<Texture2D> volume_texture = get_theme_icon(SNAME("ColorTrackVu"), SNAME("EditorIcons"));
|
||||
Ref<Texture2D> volume_texture = get_editor_theme_icon(SNAME("ColorTrackVu"));
|
||||
int tex_h = volume_texture->get_height();
|
||||
|
||||
int y_from = (get_size().height - tex_h) / 2;
|
||||
@ -936,7 +937,7 @@ void AnimationTrackEditTypeAudio::draw_key(int p_index, float p_pixels_sec, int
|
||||
|
||||
RS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), points, colors);
|
||||
|
||||
Color cut_color = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
Color cut_color = get_theme_color(SNAME("accent_color"), EditorStringName(Editor));
|
||||
cut_color.a = 0.7;
|
||||
if (start_ofs > 0 && pixel_begin > p_clip_left) {
|
||||
draw_rect(Rect2(pixel_begin, rect.position.y, 1, rect.size.y), cut_color);
|
||||
@ -946,7 +947,7 @@ void AnimationTrackEditTypeAudio::draw_key(int p_index, float p_pixels_sec, int
|
||||
}
|
||||
|
||||
if (p_selected) {
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
Color accent = get_theme_color(SNAME("accent_color"), EditorStringName(Editor));
|
||||
draw_rect(rect, accent, false);
|
||||
}
|
||||
}
|
||||
@ -1307,7 +1308,7 @@ void AnimationTrackEditTypeAnimation::draw_key(int p_index, float p_pixels_sec,
|
||||
}
|
||||
|
||||
if (p_selected) {
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
Color accent = get_theme_color(SNAME("accent_color"), EditorStringName(Editor));
|
||||
draw_rect(rect, accent, false);
|
||||
}
|
||||
} else {
|
||||
@ -1320,7 +1321,7 @@ void AnimationTrackEditTypeAnimation::draw_key(int p_index, float p_pixels_sec,
|
||||
draw_rect_clipped(rect, color);
|
||||
|
||||
if (p_selected) {
|
||||
Color accent = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
|
||||
Color accent = get_theme_color(SNAME("accent_color"), EditorStringName(Editor));
|
||||
draw_rect_clipped(rect, accent, false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user