From 4f6deaa443343d1ae973a62f897f6ba34e6b4ea3 Mon Sep 17 00:00:00 2001 From: Terry Hearst Date: Sun, 18 Feb 2024 01:13:11 -0500 Subject: [PATCH] Godot 4 automatic conversion --- .gitattributes | 2 + .gitignore | 1 + fonts/DefaultFont.tres | 4 +- .../Louis George Cafe Bold Italic.ttf.import | 33 ++ fonts/Louis George Cafe Bold.ttf.import | 33 ++ fonts/Louis George Cafe Italic.ttf.import | 33 ++ .../Louis George Cafe Light Italic.ttf.import | 33 ++ fonts/Louis George Cafe Light.ttf.import | 33 ++ fonts/Louis George Cafe.ttf.import | 33 ++ icon.png.import | 31 +- project.godot | 12 +- src/Letter.tscn | 12 +- src/Main.gd | 40 +-- src/Main.tscn | 310 +++++++++--------- src/Menu.gd | 4 +- src/Menu.tscn | 212 ++++++------ 16 files changed, 513 insertions(+), 313 deletions(-) create mode 100644 .gitattributes create mode 100644 fonts/Louis George Cafe Bold Italic.ttf.import create mode 100644 fonts/Louis George Cafe Bold.ttf.import create mode 100644 fonts/Louis George Cafe Italic.ttf.import create mode 100644 fonts/Louis George Cafe Light Italic.ttf.import create mode 100644 fonts/Louis George Cafe Light.ttf.import create mode 100644 fonts/Louis George Cafe.ttf.import diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/.gitignore b/.gitignore index 4f48ad7..3772e53 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # Godot-specific ignores +.godot/ .import/ export.cfg export_presets.cfg diff --git a/fonts/DefaultFont.tres b/fonts/DefaultFont.tres index 0551163..e590e45 100644 --- a/fonts/DefaultFont.tres +++ b/fonts/DefaultFont.tres @@ -1,6 +1,6 @@ -[gd_resource type="DynamicFont" load_steps=2 format=2] +[gd_resource type="FontFile" load_steps=2 format=2] -[ext_resource path="res://fonts/Louis George Cafe Bold.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://fonts/Louis George Cafe Bold.ttf" type="FontFile" id=1] [resource] size = 36 diff --git a/fonts/Louis George Cafe Bold Italic.ttf.import b/fonts/Louis George Cafe Bold Italic.ttf.import new file mode 100644 index 0000000..ef1cf9c --- /dev/null +++ b/fonts/Louis George Cafe Bold Italic.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://whhexn5omjmu" +path="res://.godot/imported/Louis George Cafe Bold Italic.ttf-f7950aa28833d58a127539ab39c4e54d.fontdata" + +[deps] + +source_file="res://fonts/Louis George Cafe Bold Italic.ttf" +dest_files=["res://.godot/imported/Louis George Cafe Bold Italic.ttf-f7950aa28833d58a127539ab39c4e54d.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/fonts/Louis George Cafe Bold.ttf.import b/fonts/Louis George Cafe Bold.ttf.import new file mode 100644 index 0000000..0fba1dc --- /dev/null +++ b/fonts/Louis George Cafe Bold.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://b7jasa607pvfx" +path="res://.godot/imported/Louis George Cafe Bold.ttf-b0636941e64913a7c7e3db8a2151589e.fontdata" + +[deps] + +source_file="res://fonts/Louis George Cafe Bold.ttf" +dest_files=["res://.godot/imported/Louis George Cafe Bold.ttf-b0636941e64913a7c7e3db8a2151589e.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/fonts/Louis George Cafe Italic.ttf.import b/fonts/Louis George Cafe Italic.ttf.import new file mode 100644 index 0000000..2fbc27d --- /dev/null +++ b/fonts/Louis George Cafe Italic.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://5mg12selt31r" +path="res://.godot/imported/Louis George Cafe Italic.ttf-7c4cebb6b89daf9a808df11765a72774.fontdata" + +[deps] + +source_file="res://fonts/Louis George Cafe Italic.ttf" +dest_files=["res://.godot/imported/Louis George Cafe Italic.ttf-7c4cebb6b89daf9a808df11765a72774.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/fonts/Louis George Cafe Light Italic.ttf.import b/fonts/Louis George Cafe Light Italic.ttf.import new file mode 100644 index 0000000..b5daaf0 --- /dev/null +++ b/fonts/Louis George Cafe Light Italic.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://cnj74xysjc783" +path="res://.godot/imported/Louis George Cafe Light Italic.ttf-3bc639f66fc8cc508c5f453a5e244ec8.fontdata" + +[deps] + +source_file="res://fonts/Louis George Cafe Light Italic.ttf" +dest_files=["res://.godot/imported/Louis George Cafe Light Italic.ttf-3bc639f66fc8cc508c5f453a5e244ec8.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/fonts/Louis George Cafe Light.ttf.import b/fonts/Louis George Cafe Light.ttf.import new file mode 100644 index 0000000..e0cad4a --- /dev/null +++ b/fonts/Louis George Cafe Light.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://331j6lfh1f87" +path="res://.godot/imported/Louis George Cafe Light.ttf-af51ede3c574e1f3e3444ef3ce5c11ed.fontdata" + +[deps] + +source_file="res://fonts/Louis George Cafe Light.ttf" +dest_files=["res://.godot/imported/Louis George Cafe Light.ttf-af51ede3c574e1f3e3444ef3ce5c11ed.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/fonts/Louis George Cafe.ttf.import b/fonts/Louis George Cafe.ttf.import new file mode 100644 index 0000000..d19a3a2 --- /dev/null +++ b/fonts/Louis George Cafe.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://b4ul838p47hl3" +path="res://.godot/imported/Louis George Cafe.ttf-7069fa0ad08fa81628e2f556978eb09a.fontdata" + +[deps] + +source_file="res://fonts/Louis George Cafe.ttf" +dest_files=["res://.godot/imported/Louis George Cafe.ttf-7069fa0ad08fa81628e2f556978eb09a.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/icon.png.import b/icon.png.import index a4c02e6..a7748b1 100644 --- a/icon.png.import +++ b/icon.png.import @@ -1,8 +1,9 @@ [remap] importer="texture" -type="StreamTexture" -path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" +type="CompressedTexture2D" +uid="uid://2titeekoe3fy" +path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex" metadata={ "vram_texture": false } @@ -10,26 +11,24 @@ metadata={ [deps] source_file="res://icon.png" -dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] +dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"] [params] compress/mode=0 +compress/high_quality=false compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 +compress/hdr_compression=1 compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" process/fix_alpha_border=true process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=true -svg/scale=1.0 +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/project.godot b/project.godot index 5626e6d..763e5c8 100644 --- a/project.godot +++ b/project.godot @@ -6,12 +6,13 @@ ; [section] ; section goes between [] ; param=value ; assign values to parameters -config_version=4 +config_version=5 [application] config/name="gordle" run/main_scene="res://src/Menu.tscn" +config/features=PackedStringArray("4.2") config/icon="res://icon.png" [autoload] @@ -20,11 +21,10 @@ Global="*res://src/Global.gd" [display] -window/size/width=640 -window/size/height=960 -window/handheld/orientation="portrait" +window/size/viewport_width=640 +window/size/viewport_height=960 window/stretch/mode="2d" -window/stretch/aspect="keep" +window/handheld/orientation="portrait" [gui] @@ -36,4 +36,4 @@ common/enable_pause_aware_picking=true [rendering] -environment/default_clear_color=Color( 0.129412, 0.129412, 0.215686, 1 ) +environment/defaults/default_clear_color=Color(0.129412, 0.129412, 0.215686, 1) diff --git a/src/Letter.tscn b/src/Letter.tscn index cd15ab9..0b07875 100644 --- a/src/Letter.tscn +++ b/src/Letter.tscn @@ -1,21 +1,21 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://fonts/Louis George Cafe Bold.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://fonts/Louis George Cafe Bold.ttf" type="FontFile" id=1] -[sub_resource type="DynamicFont" id=1] +[sub_resource type="FontFile" id=1] size = 52 font_data = ExtResource( 1 ) [node name="Letter" type="ColorRect"] -margin_right = 68.0 -margin_bottom = 68.0 -rect_min_size = Vector2( 68, 68 ) +offset_right = 68.0 +offset_bottom = 68.0 +custom_minimum_size = Vector2( 68, 68 ) color = Color( 0.0313726, 0.0313726, 0.0588235, 0.509804 ) [node name="Label" type="Label" parent="."] anchor_right = 1.0 anchor_bottom = 1.0 -custom_fonts/font = SubResource( 1 ) +theme_override_fonts/font = SubResource( 1 ) align = 1 valign = 1 __meta__ = { diff --git a/src/Main.gd b/src/Main.gd index 14f9637..78aba50 100644 --- a/src/Main.gd +++ b/src/Main.gd @@ -6,9 +6,9 @@ const guess_count := 6 const Letter = preload("res://src/Letter.tscn") -export var color_incorrect: Color = Color() -export var color_misplaced: Color = Color() -export var color_correct: Color = Color() +@export var color_incorrect: Color = Color() +@export var color_misplaced: Color = Color() +@export var color_correct: Color = Color() # An array of arrays of the letter nodes var letters := [] @@ -19,7 +19,7 @@ var current_guess: int var ended: bool var input_guess: String -onready var error_text_color_default = $C/V/ErrorText.get("custom_colors/font_color") +@onready var error_text_color_default = $C/V/ErrorText.get("theme_override_colors/font_color") func _ready() -> void: @@ -27,18 +27,18 @@ func _ready() -> void: for _i in range(guess_count): var letter_array := [] for _j in range(letter_count): - var letter := Letter.instance() + var letter := Letter.instantiate() letter_array.append(letter) $C/V/LetterGrid.add_child(letter) letters.append(letter_array) var random_seed = null if Global.daily_mode: - var current_time := OS.get_datetime_from_unix_time(OS.get_unix_time()) + var current_time := Time.get_datetime_dict_from_system_from_unix_time(Time.get_unix_time_from_system()) current_time["hour"] = 0 current_time["minute"] = 0 current_time["second"] = 0 - random_seed = OS.get_unix_time_from_datetime(current_time) + random_seed = Time.get_unix_time_from_system_from_datetime(current_time) $C/V/Title.text = "Daily " + $C/V/Title.text else: @@ -50,9 +50,9 @@ func _ready() -> void: for i in range(0, 26): var letter := char(ord("A") + i) - var keyboard_button: Button = $C/V/V.find_node("Button" + letter) + var keyboard_button: Button = $C/V/V.find_child("Button" + letter) keyboard_buttons[letter] = keyboard_button - var error := keyboard_button.connect("pressed", self, "type_letter", [letter]) + var error := keyboard_button.connect("pressed", Callable(self, "type_letter").bind(letter)) assert(not error) @@ -75,19 +75,19 @@ func backspace() -> void: letter_instance.get_node("Label").text = "" -func _unhandled_key_input(event: InputEventKey) -> void: +func _unhandled_key_input(event: InputEvent) -> void: if event.is_pressed(): - var scancode = event.get_scancode() - if scancode >= KEY_A and scancode <= KEY_Z: - var letter := OS.get_scancode_string(scancode) + var keycode = event.get_keycode() + if keycode >= KEY_A and keycode <= KEY_Z: + var letter := OS.get_keycode_string(keycode) type_letter(letter) - get_tree().set_input_as_handled() - elif scancode == KEY_BACKSPACE: + get_viewport().set_input_as_handled() + elif keycode == KEY_BACKSPACE: backspace() - get_tree().set_input_as_handled() - elif scancode == KEY_ENTER: + get_viewport().set_input_as_handled() + elif keycode == KEY_ENTER: guess_entered() - get_tree().set_input_as_handled() + get_viewport().set_input_as_handled() func _on_GuessButton_pressed() -> void: @@ -175,7 +175,7 @@ func show_error(text: String, color = null): $C/V/ErrorText.text = text if typeof(color) == TYPE_COLOR: $ErrorFadeOut.stop() - $C/V/ErrorText.add_color_override("font_color", color) + $C/V/ErrorText.add_theme_color_override("font_color", color) else: $ErrorFadeOut.play("ErrorFadeOut") @@ -187,7 +187,7 @@ func hide_error(): func _on_MenuButton_pressed() -> void: # TODO check if game is in progress and show confirmation popup - var error := get_tree().change_scene("res://src/Menu.tscn") + var error := get_tree().change_scene_to_file("res://src/Menu.tscn") assert(not error) diff --git a/src/Main.tscn b/src/Main.tscn index 8c0b9b2..c7fcd3f 100644 --- a/src/Main.tscn +++ b/src/Main.tscn @@ -1,35 +1,35 @@ [gd_scene load_steps=8 format=2] -[ext_resource path="res://fonts/Louis George Cafe Bold.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://fonts/Louis George Cafe Bold.ttf" type="FontFile" id=1] [ext_resource path="res://src/Main.gd" type="Script" id=2] -[sub_resource type="DynamicFont" id=1] +[sub_resource type="FontFile" id=1] size = 72 font_data = ExtResource( 1 ) -[sub_resource type="DynamicFont" id=2] +[sub_resource type="FontFile" id=2] size = 24 font_data = ExtResource( 1 ) -[sub_resource type="DynamicFont" id=5] +[sub_resource type="FontFile" id=5] size = 40 font_data = ExtResource( 1 ) -[sub_resource type="DynamicFont" id=4] +[sub_resource type="FontFile" id=4] font_data = ExtResource( 1 ) [sub_resource type="Animation" id=3] resource_name = "ErrorFadeOut" length = 6.0 tracks/0/type = "value" -tracks/0/path = NodePath("C/V/ErrorText:custom_colors/font_color") +tracks/0/path = NodePath("C/V/ErrorText:theme_override_colors/font_color") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/imported = false tracks/0/enabled = true tracks/0/keys = { -"times": PoolRealArray( 0, 5, 6 ), -"transitions": PoolRealArray( 1, 1, 1 ), +"times": PackedFloat32Array( 0, 5, 6 ), +"transitions": PackedFloat32Array( 1, 1, 1 ), "update": 0, "values": [ Color( 1, 0.31, 0.31, 1 ), Color( 1, 0.31, 0.31, 1 ), Color( 1, 0.309804, 0.309804, 0 ) ] } @@ -47,296 +47,296 @@ anchor_right = 1.0 anchor_bottom = 1.0 [node name="V" type="VBoxContainer" parent="C"] -margin_left = 52.0 -margin_top = 292.0 -margin_right = 588.0 -margin_bottom = 667.0 -custom_constants/separation = 20 +offset_left = 52.0 +offset_top = 292.0 +offset_right = 588.0 +offset_bottom = 667.0 +theme_override_constants/separation = 20 __meta__ = { "_edit_use_anchors_": false } [node name="Title" type="Label" parent="C/V"] -margin_right = 536.0 -margin_bottom = 82.0 -custom_fonts/font = SubResource( 1 ) +offset_right = 536.0 +offset_bottom = 82.0 +theme_override_fonts/font = SubResource( 1 ) text = "Gordle" align = 1 [node name="LetterGrid" type="GridContainer" parent="C/V"] -margin_left = 268.0 -margin_top = 102.0 -margin_right = 268.0 -margin_bottom = 102.0 +offset_left = 268.0 +offset_top = 102.0 +offset_right = 268.0 +offset_bottom = 102.0 grow_horizontal = 2 size_flags_horizontal = 4 -custom_constants/vseparation = 8 -custom_constants/hseparation = 8 +theme_override_constants/v_separation = 8 +theme_override_constants/h_separation = 8 columns = 5 [node name="ErrorText" type="Label" parent="C/V"] -margin_top = 122.0 -margin_right = 536.0 -margin_bottom = 150.0 -custom_colors/font_color = Color( 1, 0.31, 0.31, 1 ) -custom_fonts/font = SubResource( 2 ) +offset_top = 122.0 +offset_right = 536.0 +offset_bottom = 150.0 +theme_override_colors/font_color = Color( 1, 0.31, 0.31, 1 ) +theme_override_fonts/font = SubResource( 2 ) align = 1 [node name="V" type="VBoxContainer" parent="C/V"] -margin_top = 170.0 -margin_right = 536.0 -margin_bottom = 375.0 +offset_top = 170.0 +offset_right = 536.0 +offset_bottom = 375.0 [node name="HRow1" type="HBoxContainer" parent="C/V/V"] -margin_right = 536.0 -margin_bottom = 47.0 +offset_right = 536.0 +offset_bottom = 47.0 size_flags_horizontal = 4 [node name="ButtonQ" type="Button" parent="C/V/V/HRow1"] -margin_right = 50.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_right = 50.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "Q" [node name="ButtonW" type="Button" parent="C/V/V/HRow1"] -margin_left = 54.0 -margin_right = 104.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 54.0 +offset_right = 104.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "W" [node name="ButtonE" type="Button" parent="C/V/V/HRow1"] -margin_left = 108.0 -margin_right = 158.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 108.0 +offset_right = 158.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "E" [node name="ButtonR" type="Button" parent="C/V/V/HRow1"] -margin_left = 162.0 -margin_right = 212.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 162.0 +offset_right = 212.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "R" [node name="ButtonT" type="Button" parent="C/V/V/HRow1"] -margin_left = 216.0 -margin_right = 266.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 216.0 +offset_right = 266.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "T" [node name="ButtonY" type="Button" parent="C/V/V/HRow1"] -margin_left = 270.0 -margin_right = 320.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 270.0 +offset_right = 320.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "Y" [node name="ButtonU" type="Button" parent="C/V/V/HRow1"] -margin_left = 324.0 -margin_right = 374.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 324.0 +offset_right = 374.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "U" [node name="ButtonI" type="Button" parent="C/V/V/HRow1"] -margin_left = 378.0 -margin_right = 428.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 378.0 +offset_right = 428.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "I" [node name="ButtonO" type="Button" parent="C/V/V/HRow1"] -margin_left = 432.0 -margin_right = 482.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 432.0 +offset_right = 482.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "O" [node name="ButtonP" type="Button" parent="C/V/V/HRow1"] -margin_left = 486.0 -margin_right = 536.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 486.0 +offset_right = 536.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "P" [node name="HRow2" type="HBoxContainer" parent="C/V/V"] -margin_left = 27.0 -margin_top = 51.0 -margin_right = 509.0 -margin_bottom = 98.0 +offset_left = 27.0 +offset_top = 51.0 +offset_right = 509.0 +offset_bottom = 98.0 size_flags_horizontal = 4 [node name="ButtonA" type="Button" parent="C/V/V/HRow2"] -margin_right = 50.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_right = 50.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "A" [node name="ButtonS" type="Button" parent="C/V/V/HRow2"] -margin_left = 54.0 -margin_right = 104.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 54.0 +offset_right = 104.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "S" [node name="ButtonD" type="Button" parent="C/V/V/HRow2"] -margin_left = 108.0 -margin_right = 158.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 108.0 +offset_right = 158.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "D" [node name="ButtonF" type="Button" parent="C/V/V/HRow2"] -margin_left = 162.0 -margin_right = 212.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 162.0 +offset_right = 212.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "F" [node name="ButtonG" type="Button" parent="C/V/V/HRow2"] -margin_left = 216.0 -margin_right = 266.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 216.0 +offset_right = 266.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "G" [node name="ButtonH" type="Button" parent="C/V/V/HRow2"] -margin_left = 270.0 -margin_right = 320.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 270.0 +offset_right = 320.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "H" [node name="ButtonJ" type="Button" parent="C/V/V/HRow2"] -margin_left = 324.0 -margin_right = 374.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 324.0 +offset_right = 374.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "J" [node name="ButtonK" type="Button" parent="C/V/V/HRow2"] -margin_left = 378.0 -margin_right = 428.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 378.0 +offset_right = 428.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "K" [node name="ButtonL" type="Button" parent="C/V/V/HRow2"] -margin_left = 432.0 -margin_right = 482.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 432.0 +offset_right = 482.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "L" [node name="HRow3" type="HBoxContainer" parent="C/V/V"] -margin_left = 33.0 -margin_top = 102.0 -margin_right = 503.0 -margin_bottom = 149.0 +offset_left = 33.0 +offset_top = 102.0 +offset_right = 503.0 +offset_bottom = 149.0 size_flags_horizontal = 4 [node name="ButtonZ" type="Button" parent="C/V/V/HRow3"] -margin_right = 50.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_right = 50.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "Z" [node name="ButtonX" type="Button" parent="C/V/V/HRow3"] -margin_left = 54.0 -margin_right = 104.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 54.0 +offset_right = 104.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "X" [node name="ButtonC" type="Button" parent="C/V/V/HRow3"] -margin_left = 108.0 -margin_right = 158.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 108.0 +offset_right = 158.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "C" [node name="ButtonV" type="Button" parent="C/V/V/HRow3"] -margin_left = 162.0 -margin_right = 212.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 162.0 +offset_right = 212.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "V" [node name="ButtonB" type="Button" parent="C/V/V/HRow3"] -margin_left = 216.0 -margin_right = 266.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 216.0 +offset_right = 266.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "B" [node name="ButtonN" type="Button" parent="C/V/V/HRow3"] -margin_left = 270.0 -margin_right = 320.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 270.0 +offset_right = 320.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "N" [node name="ButtonM" type="Button" parent="C/V/V/HRow3"] -margin_left = 324.0 -margin_right = 374.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 324.0 +offset_right = 374.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "M" [node name="ButtonBksp" type="Button" parent="C/V/V/HRow3"] -margin_left = 378.0 -margin_right = 470.0 -margin_bottom = 47.0 -rect_min_size = Vector2( 50, 0 ) +offset_left = 378.0 +offset_right = 470.0 +offset_bottom = 47.0 +custom_minimum_size = Vector2( 50, 0 ) focus_mode = 0 text = "bksp" [node name="GuessButton" type="Button" parent="C/V/V"] -margin_left = 205.0 -margin_top = 153.0 -margin_right = 330.0 -margin_bottom = 205.0 +offset_left = 205.0 +offset_top = 153.0 +offset_right = 330.0 +offset_bottom = 205.0 focus_mode = 0 size_flags_horizontal = 4 -custom_fonts/font = SubResource( 5 ) +theme_override_fonts/font = SubResource( 5 ) text = "Guess" [node name="MenuButton" type="Button" parent="."] anchor_left = 1.0 anchor_right = 1.0 -margin_left = -65.0 -margin_top = 10.0 -margin_right = -10.0 -margin_bottom = 36.0 -custom_fonts/font = SubResource( 4 ) +offset_left = -65.0 +offset_top = 10.0 +offset_right = -10.0 +offset_bottom = 36.0 +theme_override_fonts/font = SubResource( 4 ) text = "Menu" __meta__ = { "_edit_use_anchors_": false diff --git a/src/Menu.gd b/src/Menu.gd index 7426ae0..9a6e843 100644 --- a/src/Menu.gd +++ b/src/Menu.gd @@ -8,13 +8,13 @@ func _ready() -> void: func _on_DailyButton_pressed() -> void: Global.daily_mode = true - var error := get_tree().change_scene("res://src/Main.tscn") + var error := get_tree().change_scene_to_file("res://src/Main.tscn") assert(not error) func _on_RandomButton_pressed() -> void: Global.daily_mode = false - var error := get_tree().change_scene("res://src/Main.tscn") + var error := get_tree().change_scene_to_file("res://src/Main.tscn") assert(not error) diff --git a/src/Menu.tscn b/src/Menu.tscn index c9783c0..e59a986 100644 --- a/src/Menu.tscn +++ b/src/Menu.tscn @@ -1,17 +1,17 @@ [gd_scene load_steps=6 format=2] -[ext_resource path="res://fonts/Louis George Cafe Bold.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://fonts/Louis George Cafe Bold.ttf" type="FontFile" id=1] [ext_resource path="res://src/Menu.gd" type="Script" id=2] -[sub_resource type="DynamicFont" id=1] +[sub_resource type="FontFile" id=1] size = 96 font_data = ExtResource( 1 ) -[sub_resource type="DynamicFont" id=2] +[sub_resource type="FontFile" id=2] size = 24 font_data = ExtResource( 1 ) -[sub_resource type="DynamicFont" id=3] +[sub_resource type="FontFile" id=3] font_data = ExtResource( 1 ) [node name="Menu" type="Control"] @@ -24,80 +24,80 @@ anchor_right = 1.0 anchor_bottom = 1.0 [node name="V" type="VBoxContainer" parent="C"] -margin_left = 165.0 -margin_top = 183.0 -margin_right = 475.0 -margin_bottom = 776.0 -custom_constants/separation = 80 +offset_left = 165.0 +offset_top = 183.0 +offset_right = 475.0 +offset_bottom = 776.0 +theme_override_constants/separation = 80 [node name="V" type="VBoxContainer" parent="C/V"] -margin_right = 310.0 -margin_bottom = 140.0 +offset_right = 310.0 +offset_bottom = 140.0 [node name="Title" type="Label" parent="C/V/V"] -margin_right = 310.0 -margin_bottom = 108.0 -custom_fonts/font = SubResource( 1 ) +offset_right = 310.0 +offset_bottom = 108.0 +theme_override_fonts/font = SubResource( 1 ) text = "Gordle" align = 1 [node name="Subtitle" type="Label" parent="C/V/V"] -margin_top = 112.0 -margin_right = 310.0 -margin_bottom = 140.0 -custom_fonts/font = SubResource( 2 ) +offset_top = 112.0 +offset_right = 310.0 +offset_bottom = 140.0 +theme_override_fonts/font = SubResource( 2 ) text = "Wordle in Godot" align = 1 [node name="V2" type="VBoxContainer" parent="C/V"] -margin_top = 220.0 -margin_right = 310.0 -margin_bottom = 593.0 -custom_constants/separation = 30 +offset_top = 220.0 +offset_right = 310.0 +offset_bottom = 593.0 +theme_override_constants/separation = 30 __meta__ = { "_edit_use_anchors_": false } [node name="V" type="VBoxContainer" parent="C/V/V2"] -margin_right = 310.0 -margin_bottom = 110.0 +offset_right = 310.0 +offset_bottom = 110.0 __meta__ = { "_edit_use_anchors_": false } [node name="DailyButton" type="Button" parent="C/V/V2/V"] -margin_right = 310.0 -margin_bottom = 47.0 +offset_right = 310.0 +offset_bottom = 47.0 text = "Daily Gordle" [node name="Label" type="Label" parent="C/V/V2/V"] -margin_top = 51.0 -margin_right = 310.0 -margin_bottom = 110.0 -custom_fonts/font = SubResource( 2 ) +offset_top = 51.0 +offset_right = 310.0 +offset_bottom = 110.0 +theme_override_fonts/font = SubResource( 2 ) text = "Changes every day at midnight GMT" align = 1 [node name="V2" type="VBoxContainer" parent="C/V/V2"] -margin_top = 140.0 -margin_right = 310.0 -margin_bottom = 219.0 -rect_min_size = Vector2( 310, 0 ) +offset_top = 140.0 +offset_right = 310.0 +offset_bottom = 219.0 +custom_minimum_size = Vector2( 310, 0 ) __meta__ = { "_edit_use_anchors_": false } [node name="RandomButton" type="Button" parent="C/V/V2/V2"] -margin_right = 310.0 -margin_bottom = 47.0 +offset_right = 310.0 +offset_bottom = 47.0 text = "Random Gordle" [node name="Label" type="Label" parent="C/V/V2/V2"] -margin_top = 51.0 -margin_right = 310.0 -margin_bottom = 79.0 -custom_fonts/font = SubResource( 2 ) +offset_top = 51.0 +offset_right = 310.0 +offset_bottom = 79.0 +theme_override_fonts/font = SubResource( 2 ) text = "Different every time" align = 1 __meta__ = { @@ -105,15 +105,15 @@ __meta__ = { } [node name="CreditsButton" type="Button" parent="C/V/V2"] -margin_top = 249.0 -margin_right = 310.0 -margin_bottom = 296.0 +offset_top = 249.0 +offset_right = 310.0 +offset_bottom = 296.0 text = "Licenses" [node name="QuitButton" type="Button" parent="C/V/V2"] -margin_top = 326.0 -margin_right = 310.0 -margin_bottom = 373.0 +offset_top = 326.0 +offset_right = 310.0 +offset_bottom = 373.0 text = "Quit" [node name="Credits" type="ColorRect" parent="."] @@ -128,55 +128,55 @@ __meta__ = { [node name="M" type="MarginContainer" parent="Credits"] anchor_right = 1.0 anchor_bottom = 1.0 -custom_constants/margin_right = 50 -custom_constants/margin_top = 50 -custom_constants/margin_left = 50 -custom_constants/margin_bottom = 50 +theme_override_constants/margin_right = 50 +theme_override_constants/margin_top = 50 +theme_override_constants/margin_left = 50 +theme_override_constants/margin_bottom = 50 __meta__ = { "_edit_use_anchors_": false } [node name="V" type="VBoxContainer" parent="Credits/M"] -margin_left = 50.0 -margin_top = 50.0 -margin_right = 590.0 -margin_bottom = 910.0 +offset_left = 50.0 +offset_top = 50.0 +offset_right = 590.0 +offset_bottom = 910.0 [node name="Panel" type="PanelContainer" parent="Credits/M/V"] -margin_right = 540.0 -margin_bottom = 809.0 +offset_right = 540.0 +offset_bottom = 809.0 size_flags_vertical = 3 [node name="ScrollContainer" type="ScrollContainer" parent="Credits/M/V/Panel"] -margin_left = 7.0 -margin_top = 7.0 -margin_right = 533.0 -margin_bottom = 802.0 +offset_left = 7.0 +offset_top = 7.0 +offset_right = 533.0 +offset_bottom = 802.0 [node name="V" type="VBoxContainer" parent="Credits/M/V/Panel/ScrollContainer"] -margin_right = 526.0 -margin_bottom = 1652.0 +offset_right = 526.0 +offset_bottom = 1652.0 size_flags_horizontal = 3 size_flags_vertical = 3 -custom_constants/separation = 32 +theme_override_constants/separation = 32 [node name="Godot" type="VBoxContainer" parent="Credits/M/V/Panel/ScrollContainer/V"] -margin_right = 514.0 -margin_bottom = 598.0 -custom_constants/separation = 10 +offset_right = 514.0 +offset_bottom = 598.0 +theme_override_constants/separation = 10 alignment = 1 [node name="Title" type="Label" parent="Credits/M/V/Panel/ScrollContainer/V/Godot"] -margin_right = 514.0 -margin_bottom = 41.0 +offset_right = 514.0 +offset_bottom = 41.0 text = "Godot Engine" align = 1 [node name="License" type="Label" parent="Credits/M/V/Panel/ScrollContainer/V/Godot"] -margin_top = 51.0 -margin_right = 514.0 -margin_bottom = 598.0 -custom_fonts/font = SubResource( 3 ) +offset_top = 51.0 +offset_right = 514.0 +offset_bottom = 598.0 +theme_override_fonts/font = SubResource( 3 ) text = "This game uses Godot Engine, available under the following license: Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. Copyright (c) 2014-2021 Godot Engine contributors. @@ -189,44 +189,44 @@ THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMP autowrap = true [node name="FreeType" type="VBoxContainer" parent="Credits/M/V/Panel/ScrollContainer/V"] -margin_top = 630.0 -margin_right = 514.0 -margin_bottom = 722.0 -custom_constants/separation = 10 +offset_top = 630.0 +offset_right = 514.0 +offset_bottom = 722.0 +theme_override_constants/separation = 10 alignment = 1 [node name="Title" type="Label" parent="Credits/M/V/Panel/ScrollContainer/V/FreeType"] -margin_right = 514.0 -margin_bottom = 41.0 +offset_right = 514.0 +offset_bottom = 41.0 text = "FreeType" align = 1 [node name="License" type="Label" parent="Credits/M/V/Panel/ScrollContainer/V/FreeType"] -margin_top = 51.0 -margin_right = 514.0 -margin_bottom = 92.0 -custom_fonts/font = SubResource( 3 ) +offset_top = 51.0 +offset_right = 514.0 +offset_bottom = 92.0 +theme_override_fonts/font = SubResource( 3 ) text = "Portions of this software are copyright © 1996-2020 The FreeType Project (www.freetype.org). All rights reserved." autowrap = true [node name="ENet" type="VBoxContainer" parent="Credits/M/V/Panel/ScrollContainer/V"] -margin_top = 754.0 -margin_right = 514.0 -margin_bottom = 1286.0 -custom_constants/separation = 10 +offset_top = 754.0 +offset_right = 514.0 +offset_bottom = 1286.0 +theme_override_constants/separation = 10 alignment = 1 [node name="Title" type="Label" parent="Credits/M/V/Panel/ScrollContainer/V/ENet"] -margin_right = 514.0 -margin_bottom = 41.0 +offset_right = 514.0 +offset_bottom = 41.0 text = "ENet" align = 1 [node name="License" type="Label" parent="Credits/M/V/Panel/ScrollContainer/V/ENet"] -margin_top = 51.0 -margin_right = 514.0 -margin_bottom = 532.0 -custom_fonts/font = SubResource( 3 ) +offset_top = 51.0 +offset_right = 514.0 +offset_bottom = 532.0 +theme_override_fonts/font = SubResource( 3 ) text = "Copyright (c) 2002-2020 Lee Salzman Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: @@ -237,23 +237,23 @@ THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMP autowrap = true [node name="MBedTLS" type="VBoxContainer" parent="Credits/M/V/Panel/ScrollContainer/V"] -margin_top = 1318.0 -margin_right = 514.0 -margin_bottom = 1652.0 -custom_constants/separation = 10 +offset_top = 1318.0 +offset_right = 514.0 +offset_bottom = 1652.0 +theme_override_constants/separation = 10 alignment = 1 [node name="Title" type="Label" parent="Credits/M/V/Panel/ScrollContainer/V/MBedTLS"] -margin_right = 514.0 -margin_bottom = 41.0 +offset_right = 514.0 +offset_bottom = 41.0 text = "MBedTLS" align = 1 [node name="License" type="Label" parent="Credits/M/V/Panel/ScrollContainer/V/MBedTLS"] -margin_top = 51.0 -margin_right = 514.0 -margin_bottom = 334.0 -custom_fonts/font = SubResource( 3 ) +offset_top = 51.0 +offset_right = 514.0 +offset_bottom = 334.0 +theme_override_fonts/font = SubResource( 3 ) text = "Copyright The Mbed TLS Contributors Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -264,10 +264,10 @@ Unless required by applicable law or agreed to in writing, software distributed autowrap = true [node name="CreditsBackButton" type="Button" parent="Credits/M/V"] -margin_left = 446.0 -margin_top = 813.0 -margin_right = 540.0 -margin_bottom = 860.0 +offset_left = 446.0 +offset_top = 813.0 +offset_right = 540.0 +offset_bottom = 860.0 size_flags_horizontal = 8 text = "Back"