mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-06 07:50:22 +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:
@@ -1,50 +1,42 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dqxum77awcw6u"]
|
||||
|
||||
[ext_resource path="res://script/game.gd" type="Script" id=1]
|
||||
[ext_resource type="Script" path="res://script/game.gd" id="1"]
|
||||
|
||||
[node name="Game" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
mouse_filter = 1
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
mouse_filter = 1
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="HBoxContainer"]
|
||||
offset_right = 510.0
|
||||
offset_bottom = 600.0
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer"]
|
||||
offset_left = 514.0
|
||||
offset_right = 1024.0
|
||||
offset_bottom = 600.0
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label" type="Label" parent="HBoxContainer/VBoxContainer"]
|
||||
offset_right = 510.0
|
||||
offset_bottom = 14.0
|
||||
layout_mode = 2
|
||||
text = "Players:"
|
||||
|
||||
[node name="ItemList" type="ItemList" parent="HBoxContainer/VBoxContainer"]
|
||||
offset_top = 18.0
|
||||
offset_right = 510.0
|
||||
offset_bottom = 576.0
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
same_column_width = true
|
||||
|
||||
[node name="Action" type="Button" parent="HBoxContainer/VBoxContainer"]
|
||||
offset_top = 580.0
|
||||
offset_right = 510.0
|
||||
offset_bottom = 600.0
|
||||
layout_mode = 2
|
||||
disabled = true
|
||||
text = "Do Action!"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://c240icwf4uov8"]
|
||||
|
||||
[ext_resource type="Script" path="res://script/main.gd" id="1"]
|
||||
[ext_resource type="PackedScene" path="res://scene/game.tscn" id="2"]
|
||||
[ext_resource type="PackedScene" uid="uid://dqxum77awcw6u" path="res://scene/game.tscn" id="2"]
|
||||
|
||||
[node name="Main" type="Control"]
|
||||
layout_mode = 3
|
||||
@@ -15,14 +15,14 @@ size_flags_vertical = 3
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="Panel" type="Panel" parent="."]
|
||||
anchors_preset = 15
|
||||
layout_mode = 0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Panel"]
|
||||
anchors_preset = 15
|
||||
layout_mode = 0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 20.0
|
||||
@@ -33,84 +33,55 @@ grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Panel/VBoxContainer"]
|
||||
offset_right = 1112.0
|
||||
offset_bottom = 31.0
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="Panel/VBoxContainer/HBoxContainer"]
|
||||
offset_top = 2.0
|
||||
offset_right = 369.0
|
||||
offset_bottom = 28.0
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Name"
|
||||
|
||||
[node name="NameEdit" type="LineEdit" parent="Panel/VBoxContainer/HBoxContainer"]
|
||||
offset_left = 373.0
|
||||
offset_right = 1112.0
|
||||
offset_bottom = 31.0
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 2.0
|
||||
text = "A Godot User"
|
||||
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="Panel/VBoxContainer"]
|
||||
offset_top = 35.0
|
||||
offset_right = 1112.0
|
||||
offset_bottom = 66.0
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Panel/VBoxContainer/HBoxContainer2"]
|
||||
offset_right = 369.0
|
||||
offset_bottom = 31.0
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Host" type="Button" parent="Panel/VBoxContainer/HBoxContainer2/HBoxContainer"]
|
||||
offset_right = 44.0
|
||||
offset_bottom = 31.0
|
||||
layout_mode = 2
|
||||
text = "Host"
|
||||
|
||||
[node name="Control" type="Control" parent="Panel/VBoxContainer/HBoxContainer2/HBoxContainer"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_left = 48.0
|
||||
offset_right = 273.0
|
||||
offset_bottom = 31.0
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Connect" type="Button" parent="Panel/VBoxContainer/HBoxContainer2/HBoxContainer"]
|
||||
offset_left = 277.0
|
||||
offset_right = 369.0
|
||||
offset_bottom = 31.0
|
||||
layout_mode = 2
|
||||
text = "Connect to"
|
||||
|
||||
[node name="Disconnect" type="Button" parent="Panel/VBoxContainer/HBoxContainer2/HBoxContainer"]
|
||||
visible = false
|
||||
offset_left = 68.0
|
||||
offset_right = 152.0
|
||||
offset_bottom = 24.0
|
||||
layout_mode = 2
|
||||
text = "Disconnect"
|
||||
|
||||
[node name="Hostname" type="LineEdit" parent="Panel/VBoxContainer/HBoxContainer2"]
|
||||
offset_left = 373.0
|
||||
offset_right = 1112.0
|
||||
offset_bottom = 31.0
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 2.0
|
||||
text = "localhost"
|
||||
placeholder_text = "localhost"
|
||||
|
||||
[node name="Control" type="Control" parent="Panel/VBoxContainer"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_top = 70.0
|
||||
offset_right = 1112.0
|
||||
offset_bottom = 70.0
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Game" parent="Panel/VBoxContainer" instance=ExtResource("2")]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
offset_top = 74.0
|
||||
offset_right = 1112.0
|
||||
offset_bottom = 608.0
|
||||
layout_mode = 2
|
||||
|
||||
[node name="AcceptDialog" type="AcceptDialog" parent="."]
|
||||
dialog_text = "Connection closed"
|
||||
|
||||
Reference in New Issue
Block a user