@@ -47,6 +47,18 @@ static func printLog(message: String) -> void:
47
47
print (str ("Comedot: " , message )) # Extra space to align with "Comedock: " :)
48
48
49
49
50
+ static func printWarning (message : String ) -> void :
51
+ var warningMessage : String = str ("Comedot: WARNING: " , message )
52
+ print (warningMessage )
53
+ push_warning (warningMessage )
54
+
55
+
56
+ static func printError (message : String ) -> void :
57
+ var errorMessage : String = str ("Comedot: WARNING: " , message )
58
+ print (errorMessage )
59
+ push_error (errorMessage )
60
+
61
+
50
62
#region Custom Types
51
63
52
64
func addCustomTypes () -> void :
@@ -148,17 +160,17 @@ static func verifyAllComponents(rootPath: String = "res://Components") -> bool:
148
160
if doesFilenameEndInComponent :
149
161
# TEST 1: Does the filename end in "Component" but cannot be instantiated?
150
162
if not scene :
151
- printLog ("Cannot load Component Scene: " + file )
163
+ printError ("Cannot load Component Scene: " + file )
152
164
areAllComponentsOK = false
153
165
continue
154
166
elif not instance or not is_instance_valid (instance ):
155
- printLog ("Cannot instantiate Component Scene: " + file )
167
+ printError ("Cannot instantiate Component Scene: " + file )
156
168
areAllComponentsOK = false
157
169
continue
158
170
159
171
# TEST 2: Is the file named "…Component" but is not a Component object?
160
172
elif not is_instance_of (instance , Component ):
161
- printLog ("Filename ends in \" Component\" but Object Type is not Component: " + file )
173
+ printWarning ("Filename ends in \" Component\" but Object Type is not Component: " + file )
162
174
areAllComponentsOK = false
163
175
continue
164
176
@@ -167,11 +179,12 @@ static func verifyAllComponents(rootPath: String = "res://Components") -> bool:
167
179
168
180
# TEST 3: Is it in the "Components" Group?
169
181
if not instance .is_in_group (Global .Groups .components ):
170
- printLog ("Component root node is not in \" " + Global .Groups .components + "\" group: " + file )
182
+ printWarning ("Component root node is not in \" " + Global .Groups .components + "\" group: " + file )
171
183
areAllComponentsOK = false
172
184
continue
173
185
174
- printLog (str ("verifyAllComponents(): " , count , " components checked. All OK? " , areAllComponentsOK ))
186
+ if areAllComponentsOK : printLog (str ("verifyAllComponents(): " , count , " components checked. All OK." ))
187
+ else : printWarning (str ("verifyAllComponents(): " , count , " components checked. SOME TESTS FAILED!" ))
175
188
return areAllComponentsOK
176
189
177
190
#endregion
0 commit comments