mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2025-12-16 13:30:07 +01:00
Use static typing in all demos (#1063)
This leads to code that is easier to understand and runs faster thanks to GDScript's typed instructions. The untyped declaration warning is now enabled on all projects where type hints were added. All projects currently run without any untyped declration warnings. Dodge the Creeps and Squash the Creeps demos intentionally don't use type hints to match the documentation, where type hints haven't been adopted yet (given its beginner focus).
This commit is contained in:
@@ -18,6 +18,10 @@ config/features=PackedStringArray("4.2")
|
||||
run/low_processor_mode=true
|
||||
config/icon="res://icon.webp"
|
||||
|
||||
[debug]
|
||||
|
||||
gdscript/warnings/untyped_declaration=1
|
||||
|
||||
[display]
|
||||
|
||||
window/stretch/mode="canvas_items"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
extends Control
|
||||
|
||||
func _on_RichTextLabel_meta_clicked(meta):
|
||||
var err = OS.shell_open(meta)
|
||||
func _on_RichTextLabel_meta_clicked(meta: Variant) -> void:
|
||||
var err := OS.shell_open(str(meta))
|
||||
if err == OK:
|
||||
print("Opened link '%s' successfully!" % meta)
|
||||
print("Opened link '%s' successfully!" % str(meta))
|
||||
else:
|
||||
print("Failed opening the link '%s'!" % meta)
|
||||
print("Failed opening the link '%s'!" % str(meta))
|
||||
|
||||
|
||||
func _on_pause_toggled(button_pressed):
|
||||
func _on_pause_toggled(button_pressed: bool) -> void:
|
||||
get_tree().paused = button_pressed
|
||||
|
||||
Reference in New Issue
Block a user