mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-04 23:10:08 +01:00
Convert demos to Godot 4 using regular expressions in a script
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture2D"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dyn1ihdui7i3h"
|
||||
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
@@ -11,7 +11,7 @@ metadata={
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.png"
|
||||
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"]
|
||||
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
@@ -21,7 +21,6 @@ compress/hdr_compression=1
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
compress/streamed=false
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
@@ -29,7 +28,6 @@ roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/hdr_as_srgb=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
|
||||
@@ -148,7 +148,6 @@ offset_top = -27.0
|
||||
offset_right = -54.0
|
||||
offset_bottom = -3.0
|
||||
focus_mode = 0
|
||||
pressed = true
|
||||
text = "auto-scroll"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
@@ -159,7 +158,6 @@ offset_left = 10.0
|
||||
offset_top = 5.0
|
||||
offset_right = 418.0
|
||||
offset_bottom = 94.0
|
||||
scroll_horizontal_enabled = false
|
||||
script = ExtResource( "11" )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
@@ -179,7 +177,6 @@ offset_top = 63.0
|
||||
offset_right = 408.0
|
||||
offset_bottom = 89.0
|
||||
text = "Log start"
|
||||
valign = 2
|
||||
max_lines_visible = 5
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
|
||||
@@ -42,7 +42,6 @@ gdscript/warnings/return_value_discarded=false
|
||||
|
||||
[display]
|
||||
|
||||
window/dpi/allow_hidpi=true
|
||||
window/stretch/mode="2d"
|
||||
window/stretch/aspect="expand"
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ func start_timer(timeout):
|
||||
_timer = Timer.new()
|
||||
_timer.one_shot = true
|
||||
add_child(_timer)
|
||||
_timer.connect("timeout", Callable(self, "_on_timer_done"))
|
||||
_timer.connect(&"timeout", Callable(self, "_on_timer_done"))
|
||||
else:
|
||||
cancel_timer()
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@ func _ready():
|
||||
$Options.add_menu_item(OPTION_SHAPE_CONVEX_POLYGON, true, true)
|
||||
$Options.add_menu_item(OPTION_SHAPE_CONCAVE_POLYGON, true, true)
|
||||
|
||||
$Options.connect("option_selected", Callable(self, "_on_option_selected"))
|
||||
$Options.connect("option_changed", Callable(self, "_on_option_changed"))
|
||||
$Options.connect(&"option_selected", Callable(self, "_on_option_selected"))
|
||||
$Options.connect(&"option_changed", Callable(self, "_on_option_changed"))
|
||||
|
||||
await start_timer(0.5).timeout
|
||||
if is_timer_canceled():
|
||||
|
||||
@@ -42,8 +42,8 @@ func _ready():
|
||||
options.add_menu_item(OPTION_TEST_CASE_DESTROY_BODY, true, false)
|
||||
options.add_menu_item(OPTION_TEST_CASE_CHANGE_POSITIONS, true, false)
|
||||
|
||||
options.connect("option_selected", Callable(self, "_on_option_selected"))
|
||||
options.connect("option_changed", Callable(self, "_on_option_changed"))
|
||||
options.connect(&"option_selected", Callable(self, "_on_option_selected"))
|
||||
options.connect(&"option_changed", Callable(self, "_on_option_changed"))
|
||||
|
||||
_selected_joint = _joint_types.values()[0]
|
||||
_update_joint = true
|
||||
|
||||
@@ -55,8 +55,8 @@ func _ready():
|
||||
options.add_menu_item(OPTION_ROUGH, true, false)
|
||||
options.add_menu_item(OPTION_PROCESS_PHYSICS, true, false)
|
||||
|
||||
options.connect("option_selected", Callable(self, "_on_option_selected"))
|
||||
options.connect("option_changed", Callable(self, "_on_option_changed"))
|
||||
options.connect(&"option_selected", Callable(self, "_on_option_selected"))
|
||||
options.connect(&"option_changed", Callable(self, "_on_option_changed"))
|
||||
|
||||
_shapes[SHAPE_CAPSULE] = "Capsule"
|
||||
_shapes[SHAPE_BOX] = "Box"
|
||||
|
||||
@@ -15,7 +15,7 @@ func _ready():
|
||||
|
||||
options.add_menu_item(OPTION_TEST_CASE_HIT_FROM_INSIDE, true, false)
|
||||
|
||||
options.connect("option_changed", Callable(self, "_on_option_changed"))
|
||||
options.connect(&"option_changed", Callable(self, "_on_option_changed"))
|
||||
|
||||
_material.flags_unshaded = true
|
||||
_material.vertex_color_use_as_albedo = true
|
||||
|
||||
@@ -36,7 +36,7 @@ func _ready():
|
||||
options.add_menu_item(SHAPE_CONVEX)
|
||||
options.add_menu_item(SHAPE_BOX)
|
||||
|
||||
options.connect("option_selected", Callable(self, "_on_option_selected"))
|
||||
options.connect(&"option_selected", Callable(self, "_on_option_selected"))
|
||||
restart_scene()
|
||||
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ func _ready():
|
||||
$Options.add_menu_item(OPTION_TYPE_CAPSULE)
|
||||
$Options.add_menu_item(OPTION_TYPE_CYLINDER)
|
||||
$Options.add_menu_item(OPTION_TYPE_CONVEX)
|
||||
$Options.connect("option_selected", Callable(self, "_on_option_selected"))
|
||||
$Options.connect(&"option_selected", Callable(self, "_on_option_selected"))
|
||||
|
||||
await _start_all_types()
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ var _current_test_scene : Node = null
|
||||
|
||||
|
||||
func _ready():
|
||||
connect("option_selected", Callable(self, "_on_option_selected"))
|
||||
connect(&"option_selected", Callable(self, "_on_option_selected"))
|
||||
|
||||
|
||||
func _process(_delta):
|
||||
@@ -49,5 +49,5 @@ func _start_test(test):
|
||||
_current_test_scene = scene.instantiate()
|
||||
get_tree().root.add_child(_current_test_scene)
|
||||
|
||||
var label_test = get_node("../LabelTest")
|
||||
var label_test = get_node(^"../LabelTest")
|
||||
label_test.test_name = test.id
|
||||
|
||||
@@ -10,7 +10,7 @@ func _physics_process(delta):
|
||||
if is_on_floor():
|
||||
floor_snap_length = 0.2
|
||||
else:
|
||||
motion_velocity += Vector3.DOWN * _gravity * delta
|
||||
velocity += Vector3.DOWN * _gravity * delta
|
||||
floor_snap_length = 0.0
|
||||
|
||||
floor_stop_on_slope = _stop_on_slopes
|
||||
|
||||
@@ -7,7 +7,7 @@ var _entry_template
|
||||
|
||||
|
||||
func _enter_tree():
|
||||
Log.connect("entry_logged", Callable(self, "_on_log_entry"))
|
||||
Log.connect(&"entry_logged", Callable(self, "_on_log_entry"))
|
||||
|
||||
_entry_template = get_child(0) as Label
|
||||
remove_child(_entry_template)
|
||||
|
||||
@@ -8,7 +8,7 @@ var _attachment
|
||||
|
||||
|
||||
func _ready():
|
||||
_pos_offset = rect_position
|
||||
_pos_offset = position
|
||||
_attachment = get_parent() as Node3D
|
||||
|
||||
|
||||
@@ -27,4 +27,4 @@ func _process(_delta):
|
||||
var world_pos = world_offset + _attachment.global_transform.origin
|
||||
var screen_pos = camera.unproject_position(world_pos)
|
||||
|
||||
rect_position = _pos_offset + screen_pos - 0.5 * rect_size
|
||||
position = _pos_offset + screen_pos - 0.5 * size
|
||||
|
||||
@@ -44,7 +44,7 @@ func _add_popup(parent_popup, path, label):
|
||||
parent_popup.add_child(popup_menu)
|
||||
parent_popup.add_submenu_item(label, label)
|
||||
|
||||
popup_menu.connect("index_pressed", Callable(self, "_on_item_pressed"), [popup_menu, path])
|
||||
popup_menu.connect(&"index_pressed", Callable(self, "_on_item_pressed"), [popup_menu, path])
|
||||
|
||||
return popup_menu
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
extends ScrollContainer
|
||||
|
||||
|
||||
@export var auto_scroll = false
|
||||
@export var auto_scroll: bool = false
|
||||
|
||||
|
||||
func _process(_delta):
|
||||
if auto_scroll:
|
||||
var scrollbar = get_v_scrollbar()
|
||||
var scrollbar = get_v_scroll_bar()
|
||||
scrollbar.value = scrollbar.max_value
|
||||
|
||||
Reference in New Issue
Block a user