Ver Fonte

Merge pull request #92874 from Chaosus/completion_color_color

Add coloring for completion of Color components
Rémi Verschelde há 1 ano atrás
pai
commit
6882a948b6
1 ficheiros alterados com 12 adições e 1 exclusões
  1. 12 1
      modules/gdscript/gdscript_parser.cpp

+ 12 - 1
modules/gdscript/gdscript_parser.cpp

@@ -137,11 +137,22 @@ GDScriptParser::GDScriptParser() {
 #endif
 #endif
 
 
 #ifdef TOOLS_ENABLED
 #ifdef TOOLS_ENABLED
-	if (theme_color_names.is_empty()) {
+	if (unlikely(theme_color_names.is_empty())) {
+		// Vectors.
 		theme_color_names.insert("x", "axis_x_color");
 		theme_color_names.insert("x", "axis_x_color");
 		theme_color_names.insert("y", "axis_y_color");
 		theme_color_names.insert("y", "axis_y_color");
 		theme_color_names.insert("z", "axis_z_color");
 		theme_color_names.insert("z", "axis_z_color");
 		theme_color_names.insert("w", "axis_w_color");
 		theme_color_names.insert("w", "axis_w_color");
+
+		// Color.
+		theme_color_names.insert("r", "axis_x_color");
+		theme_color_names.insert("r8", "axis_x_color");
+		theme_color_names.insert("g", "axis_y_color");
+		theme_color_names.insert("g8", "axis_y_color");
+		theme_color_names.insert("b", "axis_z_color");
+		theme_color_names.insert("b8", "axis_z_color");
+		theme_color_names.insert("a", "axis_w_color");
+		theme_color_names.insert("a8", "axis_w_color");
 	}
 	}
 #endif
 #endif
 }
 }