mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-04 06:09:46 +03:00
Convert demos to Godot 4 using regular expressions in a script
This commit is contained in:
@@ -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