Skip to content

Commit 883df11

Browse files
committed
Upgrade to 4.5
1 parent 4ded9f8 commit 883df11

File tree

10 files changed

+148
-136
lines changed

10 files changed

+148
-136
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.godot/
2-
.DS_Store
2+
.DS_Store
3+
.vscode/

addons/anthonyec.camera_preview/plugin.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func _enter_tree() -> void:
1414
preview = preview_scene.instantiate() as CameraPreview
1515
preview.request_hide()
1616

17-
var main_screen = EditorInterface.get_editor_main_screen()
17+
var main_screen: Control = EditorInterface.get_editor_main_screen() as Control
1818
main_screen.add_child(preview)
1919

2020
func _exit_tree() -> void:
@@ -44,7 +44,7 @@ func _on_editor_selection_changed() -> void:
4444

4545
preview.visible = true
4646

47-
var selected_nodes = EditorInterface.get_selection().get_selected_nodes()
47+
var selected_nodes: Array[Node] = EditorInterface.get_selection().get_selected_nodes()
4848

4949
var selected_camera_3d: Camera3D = find_camera_3d_or_null(selected_nodes)
5050
var selected_camera_2d: Camera2D = find_camera_2d_or_null(selected_nodes)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
uid://dgq70e0pxlh61

addons/anthonyec.camera_preview/preview.gd

Lines changed: 120 additions & 118 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
uid://56ntugxskwub

addons/anthonyec.camera_preview/preview.tscn

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
[gd_scene load_steps=8 format=3 uid="uid://xybmfvufjuv"]
22

3-
[ext_resource type="Script" path="res://addons/anthonyec.camera_preview/preview.gd" id="1_6b32r"]
3+
[ext_resource type="Script" uid="uid://56ntugxskwub" path="res://addons/anthonyec.camera_preview/preview.gd" id="1_6b32r"]
44
[ext_resource type="Texture2D" uid="uid://do6d60od41vmg" path="res://addons/anthonyec.camera_preview/Pin.svg" id="2_p0pa8"]
55
[ext_resource type="Texture2D" uid="uid://btc01wc11tiid" path="res://addons/anthonyec.camera_preview/GuiResizerTopLeft.svg" id="2_t64ej"]
66
[ext_resource type="Texture2D" uid="uid://04l05jxuyt7k" path="res://addons/anthonyec.camera_preview/GuiResizerTopRight.svg" id="3_6yuab"]
77

8-
[sub_resource type="ViewportTexture" id="ViewportTexture_hchdq"]
9-
viewport_path = NodePath("Panel/SubViewport")
8+
[sub_resource type="ViewportTexture" id="ViewportTexture_m22c1"]
109

1110
[sub_resource type="Gradient" id="Gradient_11p6r"]
1211
offsets = PackedFloat32Array(0, 0.3, 0.6, 1)
@@ -55,7 +54,7 @@ anchor_top = 1.0
5554
anchor_right = 1.0
5655
anchor_bottom = 1.0
5756
offset_left = -520.0
58-
offset_top = -908.889
57+
offset_top = -301.0
5958
offset_right = -20.0
6059
offset_bottom = -20.0
6160
grow_horizontal = 0
@@ -94,7 +93,7 @@ theme_override_constants/margin_bottom = 4
9493
[node name="TextureRect" type="TextureRect" parent="Panel/ViewportMarginContainer"]
9594
unique_name_in_owner = true
9695
layout_mode = 2
97-
texture = SubResource("ViewportTexture_hchdq")
96+
texture = SubResource("ViewportTexture_m22c1")
9897
expand_mode = 1
9998

10099
[node name="Gradient" type="TextureRect" parent="Panel"]
@@ -162,6 +161,7 @@ anchor_left = 1.0
162161
anchor_right = 1.0
163162
offset_left = -60.0
164163
offset_bottom = 60.0
164+
grow_horizontal = 0
165165
pivot_offset = Vector2(60, 60)
166166
size_flags_horizontal = 8
167167
size_flags_vertical = 0
@@ -180,6 +180,7 @@ anchor_top = 1.0
180180
anchor_bottom = 1.0
181181
offset_top = -60.0
182182
offset_right = 60.0
183+
grow_vertical = 0
183184
pivot_offset = Vector2(0, 60)
184185
size_flags_horizontal = 0
185186
size_flags_vertical = 8

demo/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Godot 4+ specific ignores
22
.godot/
3+
.vscode/

demo/project.godot

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ config_version=5
1111
[application]
1212

1313
config/name="Little Camera Preview Demo"
14-
config/features=PackedStringArray("4.2", "GL Compatibility")
14+
config/features=PackedStringArray("4.5", "GL Compatibility")
15+
16+
[debug]
17+
18+
gdscript/warnings/untyped_declaration=2
1519

1620
[editor_plugins]
1721

demo/scripts/version.gd

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,39 @@ extends EditorScript
44
const plugin_config_path = "res://addons/anthonyec.camera_preview/plugin.cfg"
55

66
func _run() -> void:
7-
var plugin_config = ConfigFile.new()
7+
var plugin_config: ConfigFile = ConfigFile.new()
88

9-
var load_error = plugin_config.load(plugin_config_path)
9+
var load_error: Error = plugin_config.load(plugin_config_path)
1010
assert(load_error == OK, "Failed to load plugin config")
1111

12-
var version = plugin_config.get_value("plugin", "version") as String
12+
var version: String = plugin_config.get_value("plugin", "version") as String
1313
assert(version, "Expected version number to exist")
1414

15-
var parts = version.split(".")
15+
var parts: PackedStringArray = version.split(".")
1616
assert(parts.size() == 2, "Expected major and minor parts of version")
1717

18-
var major = int(parts[0])
19-
var minor = int(parts[1])
18+
var major: int = int(parts[0])
19+
var minor: int = int(parts[1])
2020

2121
var new_version := "%s.%s" % [str(major), str(minor + 1)]
2222
var tag_version := "v%s" % new_version
2323

2424
plugin_config.set_value("plugin", "version", new_version)
2525
plugin_config.save(plugin_config_path)
2626

27-
var commit_path = "../" + plugin_config_path.trim_prefix("res://")
27+
var commit_path: String = "../" + plugin_config_path.trim_prefix("res://")
2828

2929
var output: Array
3030

3131
# Used `git config --global gpg.program "$(which gpg)"` to ensure
3232
# commit signing works.
33-
var commit_result = OS.execute("git", ["commit", "-m", tag_version, commit_path], output, true)
33+
var commit_result: int = OS.execute("git", ["commit", "-m", tag_version, commit_path], output, true)
3434
if commit_result != 0: return print("Error: ", output)
3535
print("[✓] Created new commit")
3636

3737
output.clear()
3838

39-
var tag_result = OS.execute("git", ["tag", tag_version])
39+
var tag_result: int = OS.execute("git", ["tag", tag_version])
4040
if tag_result != 0: return print("Error: ", output)
4141
print("[✓] Tagged commit")
4242

demo/scripts/version.gd.uid

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
uid://54pmu6kcafat

0 commit comments

Comments
 (0)