Skip to content

Commit

Permalink
Fix font code for Godot 4 in Finite State Machine (#1027)
Browse files Browse the repository at this point in the history
This clears out some errors that happen on every load of this demo in Godot 4 onward.
It also makes the fonts actually work, as they did not before.

We probably don't strictly **need** these font settings for a demo, but they were here before.

I don't think `SourceCodePro-Black.ttf` was ever used, based on looking at history. So I removed it.

Both `.tres` files are gone too, as those are not used in Godot 4.

I have updated everything that used `SourceCodePro-Bold.ttf` to the new setup.
  • Loading branch information
chrisl8 authored Apr 1, 2024
1 parent ab9ffb7 commit 5553ecf
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 59 deletions.
6 changes: 5 additions & 1 deletion 2d/finite_state_machine/Demo.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[gd_scene load_steps=8 format=3 uid="uid://dmn8nkpogiwsf"]
[gd_scene load_steps=9 format=3 uid="uid://dmn8nkpogiwsf"]

[ext_resource type="PackedScene" uid="uid://bpdyvy2681m3i" path="res://player/Player.tscn" id="1"]
[ext_resource type="FontFile" uid="uid://b5bspum6ffekd" path="res://fonts/SourceCodePro-Bold.ttf" id="2_r1c5f"]
[ext_resource type="PackedScene" uid="uid://cvi13chv8g4hj" path="res://debug/StatesStackDiplayer.tscn" id="3"]
[ext_resource type="PackedScene" uid="uid://bq6rrfy53rfvo" path="res://debug/ControlsPanel.tscn" id="4"]

Expand Down Expand Up @@ -43,6 +44,9 @@ libraries = {
"": SubResource("AnimationLibrary_qbwwp")
}

[node name="StateNameDisplayer" parent="Player" index="5"]
theme_override_fonts/font = ExtResource("2_r1c5f")

[node name="Explanations" type="RichTextLabel" parent="."]
anchors_preset = 15
anchor_right = 1.0
Expand Down
6 changes: 5 additions & 1 deletion 2d/finite_state_machine/debug/StatesStackDiplayer.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[gd_scene load_steps=2 format=3 uid="uid://cvi13chv8g4hj"]
[gd_scene load_steps=3 format=3 uid="uid://cvi13chv8g4hj"]

[ext_resource type="Script" path="res://debug/states_stack_displayer.gd" id="1"]
[ext_resource type="FontFile" uid="uid://b5bspum6ffekd" path="res://fonts/SourceCodePro-Bold.ttf" id="2_58if7"]

[node name="StatesStackDiplayer" type="Panel"]
offset_right = 210.0
Expand All @@ -17,6 +18,7 @@ grow_vertical = 2

[node name="Title" type="Label" parent="VBoxContainer"]
layout_mode = 2
theme_override_fonts/font = ExtResource("2_58if7")
text = "StateStack"
uppercase = true

Expand All @@ -26,12 +28,14 @@ layout_mode = 2
[node name="Numbers" type="Label" parent="VBoxContainer/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
theme_override_fonts/font = ExtResource("2_58if7")
text = "1.
2."
horizontal_alignment = 2

[node name="States" type="Label" parent="VBoxContainer/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
theme_override_fonts/font = ExtResource("2_58if7")
text = "Jump
Test"
Binary file not shown.
33 changes: 0 additions & 33 deletions 2d/finite_state_machine/fonts/SourceCodePro-Black.ttf.import

This file was deleted.

12 changes: 0 additions & 12 deletions 2d/finite_state_machine/fonts/source_code_pro_explanations.tres

This file was deleted.

This file was deleted.

0 comments on commit 5553ecf

Please sign in to comment.