summaryrefslogtreecommitdiffstats
path: root/editor/editor_inspector.cpp
diff options
context:
space:
mode:
authorMagian <zang_magian@163.com>2024-04-26 17:48:11 +0800
committerMagian <zang_magian@163.com>2024-04-26 17:48:11 +0800
commite3a7c751f284347fe97a940af74352da65bbf8ec (patch)
tree6b054758a8ae9c63093df6e37126057209708f35 /editor/editor_inspector.cpp
parent4a0160241fd0c1e874e297f6b08676cf0761e5e8 (diff)
downloadredot-engine-e3a7c751f284347fe97a940af74352da65bbf8ec.tar.gz
Implement tooltips for shader uniform in the inspector.
using regular expressions
Diffstat (limited to 'editor/editor_inspector.cpp')
-rw-r--r--editor/editor_inspector.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 50cc89c618..41396a2ed1 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -3379,7 +3379,12 @@ void EditorInspector::update_tree() {
if (use_doc_hints) {
// `|` separators used in `EditorHelpBit`.
if (theme_item_name.is_empty()) {
- if (p.usage & PROPERTY_USAGE_INTERNAL) {
+ if (p.name.contains("shader_parameter/")) {
+ ShaderMaterial *shader_material = Object::cast_to<ShaderMaterial>(object);
+ if (shader_material) {
+ ep->set_tooltip_text("property|" + shader_material->get_shader()->get_path() + "|" + property_prefix + p.name);
+ }
+ } else if (p.usage & PROPERTY_USAGE_INTERNAL) {
ep->set_tooltip_text("internal_property|" + classname + "|" + property_prefix + p.name);
} else {
ep->set_tooltip_text("property|" + classname + "|" + property_prefix + p.name);