diff --git a/2d/finite_state_machine/debug/states_stack_displayer.gd b/2d/finite_state_machine/debug/states_stack_displayer.gd index 79f30835..325313c2 100644 --- a/2d/finite_state_machine/debug/states_stack_displayer.gd +++ b/2d/finite_state_machine/debug/states_stack_displayer.gd @@ -7,7 +7,7 @@ func _process(_delta): var numbers = "" var index = 0 for state in fsm_node.states_stack: - states_names += state.get_name() + "\n" + states_names += String(state.get_name()) + "\n" numbers += str(index) + "\n" index += 1 $States.text = states_names diff --git a/2d/finite_state_machine/player/states/debug/state_name_displayer.gd b/2d/finite_state_machine/player/states/debug/state_name_displayer.gd index ce8a98e3..e5ab70d2 100644 --- a/2d/finite_state_machine/player/states/debug/state_name_displayer.gd +++ b/2d/finite_state_machine/player/states/debug/state_name_displayer.gd @@ -11,4 +11,4 @@ func _physics_process(_delta): func _on_StateMachine_state_changed(current_state): - text = current_state.get_name() + text = String(current_state.get_name()) diff --git a/2d/navigation_astar/character.gd b/2d/navigation_astar/character.gd index 98a8eed9..b566df1d 100644 --- a/2d/navigation_astar/character.gd +++ b/2d/navigation_astar/character.gd @@ -6,7 +6,7 @@ const MASS = 10.0 const ARRIVE_DISTANCE = 10.0 export(float) var speed = 200.0 -var _state = null +var _state = States.IDLE var _path = [] var _target_point_world = Vector2() diff --git a/2d/physics_tests/tests/functional/test_collision_pairs.gd b/2d/physics_tests/tests/functional/test_collision_pairs.gd index 33effef3..77852133 100644 --- a/2d/physics_tests/tests/functional/test_collision_pairs.gd +++ b/2d/physics_tests/tests/functional/test_collision_pairs.gd @@ -92,7 +92,7 @@ func _initialize_collision_shapes(): for node in $Shapes.get_children(): var body = node as PhysicsBody2D var shape = body.shape_owner_get_shape(0, 0) - shape.resource_name = node.name.substr("RigidBody".length()) + shape.resource_name = String(node.name).substr("RigidBody".length()) _collision_shapes.push_back(shape) diff --git a/2d/physics_tests/tests/functional/test_raycasting.gd b/2d/physics_tests/tests/functional/test_raycasting.gd index 60470f38..9b19addf 100644 --- a/2d/physics_tests/tests/functional/test_raycasting.gd +++ b/2d/physics_tests/tests/functional/test_raycasting.gd @@ -25,7 +25,7 @@ func _physics_process(_delta): for node in $Shapes.get_children(): var body = node as PhysicsBody2D var space_state = body.get_world_2d().direct_space_state - var body_name = body.name.substr("RigidBody".length()) + var body_name = String(body.name).substr("RigidBody".length()) Log.print_log("* Testing: %s" % body_name) @@ -45,7 +45,7 @@ func _physics_process(_delta): res = _add_raycast(space_state, center, center + Vector2(0, 40)) Log.print_log("Raycast inside: %s" % ("HIT" if res else "NO HIT")) - if body.name.ends_with("ConcavePolygon"): + if String(body.name).ends_with("ConcavePolygon"): # Raycast inside an internal face. center.x += 20 res = _add_raycast(space_state, center, center + Vector2(0, 40)) diff --git a/2d/physics_tests/tests/performance/test_perf_contacts.gd b/2d/physics_tests/tests/performance/test_perf_contacts.gd index 726ea1a4..0a422ca2 100644 --- a/2d/physics_tests/tests/performance/test_perf_contacts.gd +++ b/2d/physics_tests/tests/performance/test_perf_contacts.gd @@ -91,7 +91,7 @@ func _on_option_selected(option): func _find_type_index(type_name): for type_index in range(_object_templates.size()): var type_node = _object_templates[type_index] - if type_node.name.find(type_name) > -1: + if String(type_node.name).find(type_name) > -1: return type_index Log.print_error("Invalid shape type: " + type_name) diff --git a/2d/pong/logic/paddle.gd b/2d/pong/logic/paddle.gd index ca8128bc..14178826 100644 --- a/2d/pong/logic/paddle.gd +++ b/2d/pong/logic/paddle.gd @@ -9,7 +9,7 @@ var _down onready var _screen_size_y = get_viewport_rect().size.y func _ready(): - var n = name.to_lower() + var n = String(name).to_lower() _up = n + "_move_up" _down = n + "_move_down" if n == "left": diff --git a/2d/pong/project.godot b/2d/pong/project.godot index 6fbe640d..be1122eb 100644 --- a/2d/pong/project.godot +++ b/2d/pong/project.godot @@ -65,7 +65,8 @@ right_move_up={ [rendering] quality/driver/driver_name="GLES2" -quality/2d/use_pixel_snap=true +2d/snapping/use_gpu_pixel_snap=true vram_compression/import_etc=true vram_compression/import_etc2=false +quality/2d/use_pixel_snap=true viewport/default_clear_color=Color( 0, 0, 0, 1 ) diff --git a/2d/screen_space_shaders/screen_shaders.gd b/2d/screen_space_shaders/screen_shaders.gd index 1fc649fc..0359b060 100644 --- a/2d/screen_space_shaders/screen_shaders.gd +++ b/2d/screen_space_shaders/screen_shaders.gd @@ -8,9 +8,9 @@ onready var pictures = $Pictures func _ready(): for c in pictures.get_children(): - picture.add_item("PIC: " + c.get_name()) + picture.add_item("PIC: " + String(c.get_name())) for c in effects.get_children(): - effect.add_item("FX: " + c.get_name()) + effect.add_item("FX: " + String(c.get_name())) func _on_picture_item_selected(ID): diff --git a/3d/material_testers/tester.gd b/3d/material_testers/tester.gd index 2311a43a..d1b2646d 100644 --- a/3d/material_testers/tester.gd +++ b/3d/material_testers/tester.gd @@ -54,7 +54,7 @@ func _unhandled_input(ev): func _process(delta): var current_tester = testers.get_child(tester_index) - material_name.text = current_tester.get_name() + material_name.text = String(current_tester.get_name()) # This code assumes CameraHolder's Y and Z coordinates are already correct. var target_position = current_tester.transform.origin.x var current_position = camera_holder.transform.origin.x diff --git a/3d/physics_tests/tests/functional/test_collision_pairs.gd b/3d/physics_tests/tests/functional/test_collision_pairs.gd index 4b3525e4..4c685721 100644 --- a/3d/physics_tests/tests/functional/test_collision_pairs.gd +++ b/3d/physics_tests/tests/functional/test_collision_pairs.gd @@ -95,7 +95,7 @@ func _initialize_collision_shapes(): for node in $Shapes.get_children(): var body = node as PhysicsBody var shape = body.shape_owner_get_shape(0, 0) - shape.resource_name = node.name.substr("RigidBody".length()) + shape.resource_name = String(node.name).substr("RigidBody".length()) _collision_shapes.push_back(shape) diff --git a/3d/physics_tests/tests/performance/test_perf_contacts.gd b/3d/physics_tests/tests/performance/test_perf_contacts.gd index b56366ff..074e39f3 100644 --- a/3d/physics_tests/tests/performance/test_perf_contacts.gd +++ b/3d/physics_tests/tests/performance/test_perf_contacts.gd @@ -87,7 +87,7 @@ func _on_option_selected(option): func _find_type_index(type_name): for type_index in range(_object_templates.size()): var type_node = _object_templates[type_index] - if type_node.name.find(type_name) > -1: + if String(type_node.name).find(type_name) > -1: return type_index Log.print_error("Invalid shape type: " + type_name) diff --git a/3d/platformer/player/follow_camera.gd b/3d/platformer/player/follow_camera.gd index 7eb86103..f83b1cc5 100644 --- a/3d/platformer/player/follow_camera.gd +++ b/3d/platformer/player/follow_camera.gd @@ -49,13 +49,13 @@ func _physics_process(dt): var col = ds.intersect_ray(target, target + delta, collision_exception) var col_right = ds.intersect_ray(target, target + Basis(Vector3.UP, deg2rad(-autoturn_ray_aperture)).xform(delta), collision_exception) - if !col.empty(): + if not col.empty(): # If main ray was occluded, get camera closer, this is the worst case scenario. delta = col.position - target - elif !col_left.empty() and col_right.empty(): + elif not col_left.empty() and col_right.empty(): # If only left ray is occluded, turn the camera around to the right. delta = Basis(Vector3.UP, deg2rad(-dt * autoturn_speed)).xform(delta) - elif col_left.empty() and !col_right.empty(): + elif col_left.empty() and not col_right.empty(): # If only right ray is occluded, turn the camera around to the left. delta = Basis(Vector3.UP, deg2rad(dt *autoturn_speed)).xform(delta) # Do nothing otherwise, left and right are occluded but center is not, so do not autoturn. diff --git a/3d/platformer/player/player.gd b/3d/platformer/player/player.gd index 18f4cbf9..602ad6a8 100644 --- a/3d/platformer/player/player.gd +++ b/3d/platformer/player/player.gd @@ -56,7 +56,7 @@ func _physics_process(delta): if is_on_floor(): var sharp_turn = hspeed > 0.1 and rad2deg(acos(dir.dot(hdir))) > SHARP_TURN_THRESHOLD - if dir.length() > 0.1 and !sharp_turn: + if dir.length() > 0.1 and not sharp_turn: if hspeed > 0.001: hdir = adjust_facing(hdir, dir, delta, 1.0 / hspeed * TURN_SPEED, Vector3.UP) else: diff --git a/3d/voxel/menu/debug.gd b/3d/voxel/menu/debug.gd index 21e4f533..8a415d4f 100644 --- a/3d/voxel/menu/debug.gd +++ b/3d/voxel/menu/debug.gd @@ -7,7 +7,7 @@ onready var voxel_world = $"../VoxelWorld" func _process(_delta): if Input.is_action_just_pressed("debug"): - visible = !visible + visible = not visible text = "Position: " + _vector_to_string_appropriate_digits(player.transform.origin) text += "\nEffective render distance: " + str(voxel_world.effective_render_distance) diff --git a/3d/voxel/menu/ingame/pause_menu.gd b/3d/voxel/menu/ingame/pause_menu.gd index 374118d2..09d9daa0 100644 --- a/3d/voxel/menu/ingame/pause_menu.gd +++ b/3d/voxel/menu/ingame/pause_menu.gd @@ -11,7 +11,7 @@ onready var voxel_world = $"../VoxelWorld" func _process(_delta): if Input.is_action_just_pressed("pause"): pause.visible = crosshair.visible - crosshair.visible = !crosshair.visible + crosshair.visible = not crosshair.visible options.visible = false if crosshair.visible: Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) diff --git a/audio/bpm_sync/bpm_sync.gd b/audio/bpm_sync/bpm_sync.gd index f9f3b7fa..b16ba010 100644 --- a/audio/bpm_sync/bpm_sync.gd +++ b/audio/bpm_sync/bpm_sync.gd @@ -27,7 +27,7 @@ func strsec(secs): func _process(_delta): - if !playing or !$Player.playing: + if not playing or not $Player.playing: return var time = 0.0 diff --git a/misc/2.5d/addons/node25d/main_screen/gizmo_25d.gd b/misc/2.5d/addons/node25d/main_screen/gizmo_25d.gd index c18de5fb..76f3743a 100644 --- a/misc/2.5d/addons/node25d/main_screen/gizmo_25d.gd +++ b/misc/2.5d/addons/node25d/main_screen/gizmo_25d.gd @@ -23,14 +23,14 @@ onready var lines_root = $Lines onready var lines = [$Lines/X, $Lines/Y, $Lines/Z] func _process(_delta): - if !lines: + if not lines: return # Somehow this node hasn't been set up yet. - if !node_25d: + if not node_25d: return # We're most likely viewing the Gizmo25D scene. # While getting the mouse position works in any viewport, it doesn't do # anything significant unless the mouse is in the 2.5D viewport. var mouse_position = get_local_mouse_position() - if !_moving: + if not _moving: # If the mouse is farther than this many pixels, it won't grab anything. var closest_distance = 20.0 dominant_axis = -1 @@ -46,9 +46,9 @@ func _process(_delta): return lines[dominant_axis].modulate.a = 1 - if !wants_to_move: + if not wants_to_move: _moving = false - elif wants_to_move and !_moving: + elif wants_to_move and not _moving: _moving = true _start_position = mouse_position @@ -90,7 +90,7 @@ func initialize(): # specialized for this script, it assumes that each segment starts at # (0, 0) and it provides a deadzone around the origin. func _distance_to_segment_at_index(index, point): - if !lines: + if not lines: return INF if point.length_squared() < 400: return INF diff --git a/misc/2.5d/addons/node25d/main_screen/viewport_25d.gd b/misc/2.5d/addons/node25d/main_screen/viewport_25d.gd index 93ac3c67..ad9e574e 100644 --- a/misc/2.5d/addons/node25d/main_screen/viewport_25d.gd +++ b/misc/2.5d/addons/node25d/main_screen/viewport_25d.gd @@ -21,7 +21,7 @@ func _ready(): yield(get_tree(), "idle_frame") yield(get_tree(), "idle_frame") var edited_scene_root = get_tree().edited_scene_root - if !edited_scene_root: + if not edited_scene_root: # Godot hasn't finished loading yet, so try loading the plugin again. editor_interface.set_plugin_enabled("node25d", false) editor_interface.set_plugin_enabled("node25d", true) @@ -34,7 +34,7 @@ func _ready(): func _process(delta): - if !editor_interface: # Something's not right... bail! + if not editor_interface: # Something's not right... bail! return # View mode polling. @@ -70,9 +70,9 @@ func _process(delta): for overlay_child in overlay_children: var contains = false for selected in selection: - if selected == overlay_child.node_25d and !view_mode_changed_this_frame: + if selected == overlay_child.node_25d and not view_mode_changed_this_frame: contains = true - if !contains: + if not contains: overlay_child.queue_free() # Add new gizmos. diff --git a/misc/2.5d/addons/node25d/node_25d.gd b/misc/2.5d/addons/node25d/node_25d.gd index d7466de1..060ca379 100644 --- a/misc/2.5d/addons/node25d/node_25d.gd +++ b/misc/2.5d/addons/node25d/node_25d.gd @@ -60,7 +60,7 @@ func get_basis(): func get_spatial_position(): - if !_spatial_node: + if not _spatial_node: _spatial_node = get_child(0) return _spatial_node.translation diff --git a/misc/2.5d/assets/player/player_math_25d.gd b/misc/2.5d/assets/player/player_math_25d.gd index f650e2d1..5b98c7a6 100644 --- a/misc/2.5d/assets/player/player_math_25d.gd +++ b/misc/2.5d/assets/player/player_math_25d.gd @@ -16,7 +16,7 @@ func _process(delta): return if Input.is_action_just_pressed("toggle_isometric_controls"): - isometric_controls = !isometric_controls + isometric_controls = not isometric_controls if Input.is_action_just_pressed("reset_position"): transform = Transform(Basis(), Vector3.UP * 10) vertical_speed = 0 diff --git a/misc/2.5d/assets/player/player_sprite.gd b/misc/2.5d/assets/player/player_sprite.gd index 34c9bb23..5b1e9398 100644 --- a/misc/2.5d/assets/player/player_sprite.gd +++ b/misc/2.5d/assets/player/player_sprite.gd @@ -103,7 +103,7 @@ func _check_movement() -> bool: # Check for isometric controls and add more to movement accordingly. # For efficiency, only check the X axis since this X axis value isn't used anywhere else. - if !_parent_math.isometric_controls and is_equal_approx(Node25D.SCALE * 0.86602540378, _parent_node25d.get_basis()[0].x): + if not _parent_math.isometric_controls and is_equal_approx(Node25D.SCALE * 0.86602540378, _parent_node25d.get_basis()[0].x): if Input.is_action_pressed("move_right"): z += 1 if Input.is_action_pressed("move_left"): diff --git a/misc/2.5d/assets/ui/control_hints.gd b/misc/2.5d/assets/ui/control_hints.gd index 5f8d21f7..e234cb40 100644 --- a/misc/2.5d/assets/ui/control_hints.gd +++ b/misc/2.5d/assets/ui/control_hints.gd @@ -2,4 +2,4 @@ extends Control func _process(_delta): if Input.is_action_just_pressed("toggle_control_hints"): - visible = !visible + visible = not visible diff --git a/misc/window_management/control.gd b/misc/window_management/control.gd index 4c803455..c1208ad1 100644 --- a/misc/window_management/control.gd +++ b/misc/window_management/control.gd @@ -16,7 +16,7 @@ func _physics_process(_delta): modetext += "Fullscreen\n" else: modetext += "Windowed\n" - if !OS.is_window_resizable(): + if not OS.is_window_resizable(): modetext += "FixedSize\n" if OS.is_window_minimized(): modetext += "Minimized\n" @@ -55,7 +55,7 @@ func _physics_process(_delta): $Label_Screen1_DPI.hide() $Button_Fullscreen.set_pressed(OS.is_window_fullscreen()) - $Button_FixedSize.set_pressed(!OS.is_window_resizable()) + $Button_FixedSize.set_pressed(not OS.is_window_resizable()) $Button_Minimized.set_pressed(OS.is_window_minimized()) $Button_Maximized.set_pressed(OS.is_window_maximized()) $Button_MouseModeVisible.set_pressed(Input.get_mouse_mode() == Input.MOUSE_MODE_VISIBLE) @@ -82,39 +82,39 @@ func _unhandled_input(event): func check_wm_api(): var s = "" - if !OS.has_method("get_screen_count"): + if not OS.has_method("get_screen_count"): s += " - get_screen_count()\n" - if !OS.has_method("get_current_screen"): + if not OS.has_method("get_current_screen"): s += " - get_current_screen()\n" - if !OS.has_method("set_current_screen"): + if not OS.has_method("set_current_screen"): s += " - set_current_screen()\n" - if !OS.has_method("get_screen_position"): + if not OS.has_method("get_screen_position"): s += " - get_screen_position()\n" - if !OS.has_method("get_screen_size"): + if not OS.has_method("get_screen_size"): s += " - get_screen_size()\n" - if !OS.has_method("get_window_position"): + if not OS.has_method("get_window_position"): s += " - get_window_position()\n" - if !OS.has_method("set_window_position"): + if not OS.has_method("set_window_position"): s += " - set_window_position()\n" - if !OS.has_method("get_window_size"): + if not OS.has_method("get_window_size"): s += " - get_window_size()\n" - if !OS.has_method("set_window_size"): + if not OS.has_method("set_window_size"): s += " - set_window_size()\n" - if !OS.has_method("set_window_fullscreen"): + if not OS.has_method("set_window_fullscreen"): s += " - set_window_fullscreen()\n" - if !OS.has_method("is_window_fullscreen"): + if not OS.has_method("is_window_fullscreen"): s += " - is_window_fullscreen()\n" - if !OS.has_method("set_window_resizable"): + if not OS.has_method("set_window_resizable"): s += " - set_window_resizable()\n" - if !OS.has_method("is_window_resizable"): + if not OS.has_method("is_window_resizable"): s += " - is_window_resizable()\n" - if !OS.has_method("set_window_minimized"): + if not OS.has_method("set_window_minimized"): s += " - set_window_minimized()\n" - if !OS.has_method("is_window_minimized"): + if not OS.has_method("is_window_minimized"): s += " - is_window_minimized()\n" - if !OS.has_method("set_window_maximized"): + if not OS.has_method("set_window_maximized"): s += " - set_window_maximized()\n" - if !OS.has_method("is_window_maximized"): + if not OS.has_method("is_window_maximized"): s += " - is_window_maximized()\n" if s.length() == 0: diff --git a/misc/window_management/observer/observer.gd b/misc/window_management/observer/observer.gd index aad79e5c..5e242cf5 100644 --- a/misc/window_management/observer/observer.gd +++ b/misc/window_management/observer/observer.gd @@ -28,7 +28,7 @@ func _input(event): if event is InputEventMouseMotion: r_pos = -event.relative - if event.is_action("ui_cancel") and event.is_pressed() and !event.is_echo(): + if event.is_action("ui_cancel") and event.is_pressed() and not event.is_echo(): if (state == STATE_GRAB): Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) state = STATE_MENU diff --git a/mobile/android_iap/iap_demo.gd b/mobile/android_iap/iap_demo.gd index ab6fb13f..f66b94f4 100644 --- a/mobile/android_iap/iap_demo.gd +++ b/mobile/android_iap/iap_demo.gd @@ -53,7 +53,7 @@ func _on_connected(): var query = payment.queryPurchases("inapp") # Use "subs" for subscriptions. if query.status == OK: for purchase in query.purchases: - if !purchase.is_acknowledged: + if not purchase.is_acknowledged: print("Purchase " + str(purchase.sku) + " has not been acknowledged. Acknowledging...") payment.acknowledgePurchase(purchase.purchase_token) else: @@ -70,7 +70,7 @@ func _on_purchases_updated(purchases): # See _on_connected for purchase in purchases: - if !purchase.is_acknowledged: + if not purchase.is_acknowledged: print("Purchase " + str(purchase.sku) + " has not been acknowledged. Acknowledging...") payment.acknowledgePurchase(purchase.purchase_token) diff --git a/mobile/multitouch_cubes/GestureArea.gd b/mobile/multitouch_cubes/GestureArea.gd index 8d350229..6ad6a0c5 100644 --- a/mobile/multitouch_cubes/GestureArea.gd +++ b/mobile/multitouch_cubes/GestureArea.gd @@ -24,8 +24,8 @@ func _ready(): func _gui_input(event): # We must start touching inside, but we can drag or unpress outside. -# if !(event is InputEventScreenDrag or -# (event is InputEventScreenTouch and (!event.pressed or get_global_rect().has_point(event.position)))): +# if not (event is InputEventScreenDrag or +# (event is InputEventScreenTouch and (not event.pressed or get_global_rect().has_point(event.position)))): # return var finger_count = base_state.size() @@ -75,7 +75,7 @@ func _gui_input(event): # Two fingers => To pinch-zoom and rotate around Z. # Accept unpress or drag. if event is InputEventScreenTouch: - if !event.pressed and base_state.has(event.index): + if not event.pressed and base_state.has(event.index): # Some known touching finger released. # Remove released finger from the base state. diff --git a/mono/2.5d/addons/node25d-cs/main_screen/viewport_25d.gd b/mono/2.5d/addons/node25d-cs/main_screen/viewport_25d.gd index 8f6766bc..a2c96810 100644 --- a/mono/2.5d/addons/node25d-cs/main_screen/viewport_25d.gd +++ b/mono/2.5d/addons/node25d-cs/main_screen/viewport_25d.gd @@ -21,7 +21,7 @@ func _ready(): yield(get_tree(), "idle_frame") yield(get_tree(), "idle_frame") var edited_scene_root = get_tree().edited_scene_root - if !edited_scene_root: + if not edited_scene_root: # Godot hasn't finished loading yet, so try loading the plugin again. editor_interface.set_plugin_enabled("node25d", false) editor_interface.set_plugin_enabled("node25d", true) @@ -34,7 +34,7 @@ func _ready(): func _process(delta): - if !editor_interface: # Something's not right... bail! + if not editor_interface: # Something's not right... bail! return # View mode polling. @@ -70,9 +70,9 @@ func _process(delta): for overlay_child in overlay_children: var contains = false for selected in selection: - if selected == overlay_child.get("node25d") and !view_mode_changed_this_frame: + if selected == overlay_child.get("node25d") and not view_mode_changed_this_frame: contains = true - if !contains: + if not contains: overlay_child.queue_free() # Add new gizmos. diff --git a/mono/2.5d/assets/ui/control_hints.gd b/mono/2.5d/assets/ui/control_hints.gd index 5f8d21f7..e234cb40 100644 --- a/mono/2.5d/assets/ui/control_hints.gd +++ b/mono/2.5d/assets/ui/control_hints.gd @@ -2,4 +2,4 @@ extends Control func _process(_delta): if Input.is_action_just_pressed("toggle_control_hints"): - visible = !visible + visible = not visible diff --git a/networking/multiplayer_bomber/player.gd b/networking/multiplayer_bomber/player.gd index e4fd4c9b..36455571 100644 --- a/networking/multiplayer_bomber/player.gd +++ b/networking/multiplayer_bomber/player.gd @@ -41,7 +41,7 @@ func _physics_process(_delta): motion = Vector2() if bombing and not prev_bombing: - var bomb_name = get_name() + str(bomb_index) + var bomb_name = String(get_name()) + str(bomb_index) var bomb_pos = position rpc("setup_bomb", bomb_name, bomb_pos, get_tree().get_network_unique_id())