Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
ac95466a
Unverified
Commit
ac95466a
authored
Apr 26, 2019
by
Yuri Roubinsky
Committed by
GitHub
Apr 26, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #28441 from Chaosus/vs_fixcolor
Fix uniform title color in visual shaders(regression)
parents
9ef46996
7a9735ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
12 deletions
+18
-12
visual_shader_editor_plugin.cpp
editor/plugins/visual_shader_editor_plugin.cpp
+17
-12
visual_shader_editor_plugin.h
editor/plugins/visual_shader_editor_plugin.h
+1
-0
No files found.
editor/plugins/visual_shader_editor_plugin.cpp
View file @
ac95466a
...
...
@@ -310,6 +310,21 @@ static Ref<StyleBoxEmpty> make_empty_stylebox(float p_margin_left = -1, float p_
return
style
;
}
void
VisualShaderEditor
::
_update_created_node
(
GraphNode
*
node
)
{
if
(
EditorSettings
::
get_singleton
()
->
get
(
"interface/theme/use_graph_node_headers"
))
{
Ref
<
StyleBoxFlat
>
sb
=
node
->
get_stylebox
(
"frame"
,
"GraphNode"
);
Color
c
=
sb
->
get_border_color
();
Color
mono_color
=
((
c
.
r
+
c
.
g
+
c
.
b
)
/
3
)
<
0.7
?
Color
(
1.0
,
1.0
,
1.0
)
:
Color
(
0.0
,
0.0
,
0.0
);
mono_color
.
a
=
0.85
;
c
=
mono_color
;
node
->
add_color_override
(
"title_color"
,
c
);
c
.
a
=
0.7
;
node
->
add_color_override
(
"close_color"
,
c
);
}
}
void
VisualShaderEditor
::
_update_graph
()
{
if
(
updating
)
...
...
@@ -374,6 +389,7 @@ void VisualShaderEditor::_update_graph() {
Ref
<
VisualShaderNodeUniform
>
uniform
=
vsnode
;
if
(
uniform
.
is_valid
())
{
graph
->
add_child
(
node
);
_update_created_node
(
node
);
LineEdit
*
uniform_name
=
memnew
(
LineEdit
);
uniform_name
->
set_text
(
uniform
->
get_uniform_name
());
...
...
@@ -529,18 +545,7 @@ void VisualShaderEditor::_update_graph() {
if
(
!
uniform
.
is_valid
())
{
graph
->
add_child
(
node
);
}
if
(
EditorSettings
::
get_singleton
()
->
get
(
"interface/theme/use_graph_node_headers"
))
{
Ref
<
StyleBoxFlat
>
sb
=
node
->
get_stylebox
(
"frame"
,
"GraphNode"
);
Color
c
=
sb
->
get_border_color
();
Color
mono_color
=
((
c
.
r
+
c
.
g
+
c
.
b
)
/
3
)
<
0.7
?
Color
(
1.0
,
1.0
,
1.0
)
:
Color
(
0.0
,
0.0
,
0.0
);
mono_color
.
a
=
0.85
;
c
=
mono_color
;
node
->
add_color_override
(
"title_color"
,
c
);
c
.
a
=
0.7
;
node
->
add_color_override
(
"close_color"
,
c
);
_update_created_node
(
node
);
}
}
...
...
editor/plugins/visual_shader_editor_plugin.h
View file @
ac95466a
...
...
@@ -179,6 +179,7 @@ class VisualShaderEditor : public VBoxContainer {
void
drop_data_fw
(
const
Point2
&
p_point
,
const
Variant
&
p_data
,
Control
*
p_from
);
bool
_is_available
(
int
p_flags
);
void
_update_created_node
(
GraphNode
*
node
);
protected
:
void
_notification
(
int
p_what
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment