Skip to content

Commit d241fbb

Browse files
authored
Merge pull request #90 from aaronfranke/script-commas-compat
Add commas and tweak scripts for better compatibility with Godot 4
2 parents ca31fb3 + 2ad30fe commit d241fbb

File tree

3 files changed

+28
-25
lines changed

3 files changed

+28
-25
lines changed

enemies/red_robot/red_robot.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func _physics_process(delta):
175175
var to_cannon_local = ray_mesh.global_transform.xform_inv(player.global_transform.origin + Vector3.UP)
176176
var h_angle = rad2deg(atan2( to_cannon_local.x, -to_cannon_local.z ))
177177
var v_angle = rad2deg(atan2( to_cannon_local.y, -to_cannon_local.z ))
178-
var blend_pos = animation_tree["parameters/aim/blend_position"]
178+
var blend_pos = animation_tree.get("parameters/aim/blend_position")
179179
var h_motion = BLEND_AIM_SPEED * delta * -h_angle
180180
blend_pos.x += h_motion
181181
blend_pos.x = clamp(blend_pos.x, -1, 1)

level/level.gd

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,19 @@ func _ready():
1717
$ReflectionProbes.show()
1818

1919
if Settings.aa_quality == Settings.AAQuality.AA_8X:
20-
get_node("/root").msaa = Viewport.MSAA_8X
20+
get_viewport().msaa = Viewport.MSAA_8X
2121
elif Settings.aa_quality == Settings.AAQuality.AA_4X:
22-
get_node("/root").msaa = Viewport.MSAA_4X
22+
get_viewport().msaa = Viewport.MSAA_4X
2323
elif Settings.aa_quality == Settings.AAQuality.AA_2X:
24-
get_node("/root").msaa = Viewport.MSAA_2X
24+
get_viewport().msaa = Viewport.MSAA_2X
2525
else:
26-
get_node("/root").msaa = Viewport.MSAA_DISABLED
26+
get_viewport().msaa = Viewport.MSAA_DISABLED
2727

2828
if Settings.ssao_quality == Settings.SSAOQuality.HIGH:
29+
world_environment.environment.ssao_enabled = true
2930
world_environment.environment.ssao_quality = world_environment.environment.SSAO_QUALITY_HIGH
3031
elif Settings.ssao_quality == Settings.SSAOQuality.LOW:
32+
world_environment.environment.ssao_enabled = true
3133
world_environment.environment.ssao_quality = world_environment.environment.SSAO_QUALITY_LOW
3234
else:
3335
world_environment.environment.ssao_enabled = false
@@ -42,16 +44,17 @@ func _ready():
4244
world_environment.environment.glow_enabled = false
4345
world_environment.environment.glow_bicubic_upscale = false
4446

47+
var window_size = OS.window_size
4548
if Settings.resolution == Settings.Resolution.NATIVE:
4649
pass
4750
elif Settings.resolution == Settings.Resolution.RES_1080:
48-
var minsize = Vector2(OS.window_size.x * 1080 / OS.window_size.y, 1080.0)
51+
var minsize = Vector2(window_size.x * 1080 / window_size.y, 1080.0)
4952
get_tree().set_screen_stretch(SceneTree.STRETCH_MODE_VIEWPORT, SceneTree.STRETCH_ASPECT_KEEP_HEIGHT, minsize)
5053
elif Settings.resolution == Settings.Resolution.RES_720:
51-
var minsize = Vector2(OS.window_size.x * 720 / OS.window_size.y, 720.0)
54+
var minsize = Vector2(window_size.x * 720 / window_size.y, 720.0)
5255
get_tree().set_screen_stretch(SceneTree.STRETCH_MODE_VIEWPORT, SceneTree.STRETCH_ASPECT_KEEP_HEIGHT, minsize)
5356
elif Settings.resolution == Settings.Resolution.RES_540:
54-
var minsize = Vector2(OS.window_size.x * 540 / OS.window_size.y, 540.0)
57+
var minsize = Vector2(window_size.x * 540 / window_size.y, 540.0)
5558
get_tree().set_screen_stretch(SceneTree.STRETCH_MODE_VIEWPORT, SceneTree.STRETCH_ASPECT_KEEP_HEIGHT, minsize)
5659

5760

menu/settings.gd

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
extends Node
22

33
enum GIQuality {
4-
DISABLED = 0
5-
LOW = 1
6-
HIGH = 2
4+
DISABLED = 0,
5+
LOW = 1,
6+
HIGH = 2,
77
}
88

99
enum AAQuality {
10-
DISABLED = 0
11-
AA_2X = 1
12-
AA_4X = 2
13-
AA_8X = 3
10+
DISABLED = 0,
11+
AA_2X = 1,
12+
AA_4X = 2,
13+
AA_8X = 3,
1414
}
1515

1616
enum SSAOQuality {
17-
DISABLED = 0
18-
LOW = 1
19-
HIGH = 2
17+
DISABLED = 0,
18+
LOW = 1,
19+
HIGH = 2,
2020
}
2121

2222
enum BloomQuality {
23-
DISABLED = 0
24-
LOW = 1
25-
HIGH = 2
23+
DISABLED = 0,
24+
LOW = 1,
25+
HIGH = 2,
2626
}
2727

2828
enum Resolution {
29-
RES_540 = 0
30-
RES_720 = 1
31-
RES_1080 = 2
32-
NATIVE = 3
29+
RES_540 = 0,
30+
RES_720 = 1,
31+
RES_1080 = 2,
32+
NATIVE = 3,
3333
}
3434

3535
var gi_quality = GIQuality.LOW

0 commit comments

Comments
 (0)