From e2313d7bf7f7fec25933d0711433e1e89e778dab Mon Sep 17 00:00:00 2001 From: Poobslag Date: Wed, 3 Jun 2020 20:45:22 -0400 Subject: [PATCH] Changed menu UI to utilize themes. The absence of UI styles as described in Godot issue #20320 (https://github.com/godotengine/godot/issues/20320) prevents using a universal theme across the entire menu UI. Instead, I've created four themes for buttons and labels of different sizes. Also fixed another leftover bug from renaming 'Creature' to 'Customer'. --- src/main/puzzle/Puzzle.tscn | 19 ++++++---- src/main/puzzle/PuzzleHud.tscn | 11 +++--- src/main/puzzle/ResultsHud.tscn | 4 -- src/main/puzzle/Score.tscn | 9 ++--- src/main/puzzle/results-hud.gd | 2 +- src/main/ui/FpsLabel.tscn | 5 +-- src/main/ui/HighScoreTable.tscn | 17 +-------- src/main/ui/OverworldUi.tscn | 8 ++-- src/main/ui/SettingsMenu.tscn | 9 ++--- src/main/ui/VersionLabel.tscn | 5 +-- src/main/ui/VolumeSetting.tscn | 11 +++--- src/main/ui/high-score-table.gd | 4 -- src/main/ui/menu/LoadingScreen.tscn | 5 ++- src/main/ui/menu/MainMenu.tscn | 20 +++++----- src/main/ui/menu/PracticeMenu.tscn | 35 ++++++++---------- src/main/ui/menu/SplashScreen.tscn | 9 ++--- src/main/ui/menu/SystemButtons.tscn | 6 +-- .../ui/menu/practice-difficulty-selector.gd | 4 -- .../theme/h1-font-outline.tres} | 1 - .../theme/h1-font.tres} | 0 src/main/ui/menu/theme/h1.theme | Bin 0 -> 198 bytes .../theme/h2-font-outline.tres} | 3 +- .../theme/h2-font.tres} | 1 - src/main/ui/menu/theme/h2.theme | Bin 0 -> 198 bytes .../theme/h3-font.tres} | 1 - src/main/ui/menu/theme/h3.theme | Bin 0 -> 198 bytes .../theme/h4-font.tres} | 1 - src/main/ui/menu/theme/h4.theme | Bin 0 -> 198 bytes src/main/ui/money-font.tres | 1 - 29 files changed, 74 insertions(+), 117 deletions(-) rename src/main/ui/{xolonium-48-outline.tres => menu/theme/h1-font-outline.tres} (99%) rename src/main/ui/{xolonium-48.tres => menu/theme/h1-font.tres} (100%) create mode 100644 src/main/ui/menu/theme/h1.theme rename src/main/ui/{xolonium-36-outline.tres => menu/theme/h2-font-outline.tres} (77%) rename src/main/ui/{xolonium-36.tres => menu/theme/h2-font.tres} (99%) create mode 100644 src/main/ui/menu/theme/h2.theme rename src/main/ui/{xolonium-24.tres => menu/theme/h3-font.tres} (99%) create mode 100644 src/main/ui/menu/theme/h3.theme rename src/main/ui/{xolonium-16.tres => menu/theme/h4-font.tres} (99%) create mode 100644 src/main/ui/menu/theme/h4.theme diff --git a/src/main/puzzle/Puzzle.tscn b/src/main/puzzle/Puzzle.tscn index 5fd8be5bc..5c3d46201 100644 --- a/src/main/puzzle/Puzzle.tscn +++ b/src/main/puzzle/Puzzle.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=69 format=2] +[gd_scene load_steps=70 format=2] -[ext_resource path="res://src/main/ui/xolonium-24.tres" type="DynamicFont" id=1] +[ext_resource path="res://src/main/ui/menu/theme/h3.theme" type="Theme" id=1] [ext_resource path="res://src/main/puzzle/tutorial/tutorial-hud.tscn" type="PackedScene" id=2] +[ext_resource path="res://src/main/ui/menu/theme/h3-font.tres" type="DynamicFont" id=3] [ext_resource path="res://src/main/puzzle/metaball.shader" type="Shader" id=4] [ext_resource path="res://src/main/puzzle/puzzle-trace.gd" type="Script" id=5] [ext_resource path="res://src/main/puzzle/ResultsHud.tscn" type="PackedScene" id=6] @@ -11,6 +12,8 @@ [ext_resource path="res://src/main/puzzle/piece/CornerMap.tscn" type="PackedScene" id=10] [ext_resource path="res://assets/main/ui/applause.wav" type="AudioStream" id=11] [ext_resource path="res://src/main/puzzle/PuzzleTileMap.tscn" type="PackedScene" id=12] +[ext_resource path="res://src/main/ui/menu/theme/h2-font.tres" type="DynamicFont" id=13] +[ext_resource path="res://src/main/ui/menu/theme/h4-font.tres" type="DynamicFont" id=14] [ext_resource path="res://src/main/puzzle/puzzle-music-manager.gd" type="Script" id=19] [ext_resource path="res://src/main/ui/SettingsMenu.tscn" type="PackedScene" id=20] [ext_resource path="res://src/main/puzzle/puzzle.gd" type="Script" id=21] @@ -29,13 +32,11 @@ [ext_resource path="res://src/main/puzzle/piece/states/none.gd" type="Script" id=34] [ext_resource path="res://src/main/puzzle/top-out.gd" type="Script" id=35] [ext_resource path="res://src/main/ui/font-fit-label.gd" type="Script" id=36] -[ext_resource path="res://src/main/ui/xolonium-16.tres" type="DynamicFont" id=37] [ext_resource path="res://assets/main/ui/go.wav" type="AudioStream" id=38] [ext_resource path="res://assets/main/ui/ready.wav" type="AudioStream" id=39] [ext_resource path="res://assets/main/puzzle/wood-backdrop.png" type="Texture" id=40] [ext_resource path="res://assets/main/puzzle/playfield-walls.png" type="Texture" id=41] [ext_resource path="res://assets/main/puzzle/chalkboard.png" type="Texture" id=42] -[ext_resource path="res://src/main/ui/xolonium-36.tres" type="DynamicFont" id=43] [ext_resource path="res://assets/main/world/chef/gameover-voice4.wav" type="AudioStream" id=44] [ext_resource path="res://assets/main/world/chef/gameover-voice3.wav" type="AudioStream" id=45] [ext_resource path="res://assets/main/world/chef/gameover-voice0.wav" type="AudioStream" id=46] @@ -61,6 +62,7 @@ [ext_resource path="res://src/main/puzzle/chalkboard.gd" type="Script" id=66] [ext_resource path="res://src/main/puzzle/start-end-sfx.gd" type="Script" id=67] + [sub_resource type="ShaderMaterial" id=1] shader = ExtResource( 4 ) @@ -356,7 +358,7 @@ percent_visible = false [node name="Desc" type="Label" parent="Chalkboard/MilestoneHud"] anchor_right = 1.0 margin_bottom = 30.0 -custom_fonts/font = ExtResource( 1 ) +theme = ExtResource( 1 ) text = "Goal" align = 2 __meta__ = { @@ -369,7 +371,7 @@ margin_top = 30.0 margin_right = 250.0 margin_bottom = 75.0 rect_min_size = Vector2( 100, 45 ) -custom_fonts/font = ExtResource( 1 ) +custom_fonts/font = ExtResource( 14 ) text = "10" align = 1 valign = 1 @@ -379,7 +381,7 @@ script = ExtResource( 36 ) __meta__ = { "_edit_use_anchors_": false } -fonts = [ ExtResource( 43 ), ExtResource( 1 ), ExtResource( 37 ) ] +fonts = [ ExtResource( 13 ), ExtResource( 3 ), ExtResource( 14 ) ] [node name="HudHolder" type="Node2D" parent="."] position = Vector2( 364, 28 ) @@ -465,7 +467,7 @@ margin_left = 10.0 margin_top = 10.0 margin_right = 110.0 margin_bottom = 40.0 -custom_fonts/font = ExtResource( 1 ) +theme = ExtResource( 1 ) text = "abcd" script = ExtResource( 5 ) __meta__ = { @@ -475,6 +477,7 @@ __meta__ = { [node name="ResultsHud" parent="." instance=ExtResource( 6 )] [node name="TutorialHud" parent="." instance=ExtResource( 2 )] +visible = false [node name="CheatCodeDetector" parent="." instance=ExtResource( 8 )] codes = [ "delays" ] diff --git a/src/main/puzzle/PuzzleHud.tscn b/src/main/puzzle/PuzzleHud.tscn index 1c52f2e55..a48fdac92 100644 --- a/src/main/puzzle/PuzzleHud.tscn +++ b/src/main/puzzle/PuzzleHud.tscn @@ -1,12 +1,13 @@ [gd_scene load_steps=9 format=2] -[ext_resource path="res://src/main/ui/xolonium-48-outline.tres" type="DynamicFont" id=1] +[ext_resource path="res://src/main/ui/menu/theme/h1-font-outline.tres" type="DynamicFont" id=1] [ext_resource path="res://src/main/puzzle/PuzzleHudStyleBox.tres" type="StyleBox" id=2] -[ext_resource path="res://src/main/ui/xolonium-24.tres" type="DynamicFont" id=3] -[ext_resource path="res://src/main/ui/xolonium-36.tres" type="DynamicFont" id=4] +[ext_resource path="res://src/main/ui/menu/theme/h2.theme" type="Theme" id=3] +[ext_resource path="res://src/main/ui/menu/theme/h3.theme" type="Theme" id=4] [ext_resource path="res://src/main/puzzle/puzzle-hud.gd" type="Script" id=5] [ext_resource path="res://src/main/ui/blogger-sans-medium-18.tres" type="DynamicFont" id=6] + [sub_resource type="InputEventAction" id=1] action = "ui_cancel" @@ -71,7 +72,7 @@ margin_left = -70.0 margin_top = -27.0 margin_right = 70.0 margin_bottom = 27.5 -custom_fonts/font = ExtResource( 4 ) +theme = ExtResource( 3 ) text = "Start" [node name="BackButton" type="Button" parent="."] @@ -85,7 +86,7 @@ margin_right = 50.0 margin_bottom = 79.0 size_flags_horizontal = 0 size_flags_vertical = 0 -custom_fonts/font = ExtResource( 3 ) +theme = ExtResource( 4 ) shortcut_in_tooltip = false shortcut = SubResource( 2 ) text = "Back" diff --git a/src/main/puzzle/ResultsHud.tscn b/src/main/puzzle/ResultsHud.tscn index 0d8342b65..2abdba2fb 100644 --- a/src/main/puzzle/ResultsHud.tscn +++ b/src/main/puzzle/ResultsHud.tscn @@ -9,10 +9,6 @@ [ext_resource path="res://src/main/puzzle/money-label-tween.gd" type="Script" id=7] [ext_resource path="res://assets/main/ui/cheat-enable.wav" type="AudioStream" id=8] - - - - [node name="ResultsHud" type="Control"] anchor_right = 1.0 anchor_bottom = 1.0 diff --git a/src/main/puzzle/Score.tscn b/src/main/puzzle/Score.tscn index e594483c7..0ea2ea9db 100644 --- a/src/main/puzzle/Score.tscn +++ b/src/main/puzzle/Score.tscn @@ -1,10 +1,9 @@ [gd_scene load_steps=5 format=2] [ext_resource path="res://src/main/puzzle/score-value-label.gd" type="Script" id=1] -[ext_resource path="res://src/main/ui/xolonium-24.tres" type="DynamicFont" id=2] +[ext_resource path="res://src/main/ui/menu/theme/h3.theme" type="Theme" id=2] [ext_resource path="res://src/main/puzzle/combo-score-value-label.gd" type="Script" id=3] -[ext_resource path="res://src/main/ui/xolonium-36.tres" type="DynamicFont" id=4] - +[ext_resource path="res://src/main/ui/menu/theme/h2.theme" type="Theme" id=4] [node name="Score" type="Control"] @@ -17,7 +16,7 @@ __meta__ = { [node name="ScoreValueLabel" type="Label" parent="."] margin_right = 250.0 margin_bottom = 44.0 -custom_fonts/font = ExtResource( 4 ) +theme = ExtResource( 4 ) text = "¥616" align = 2 script = ExtResource( 1 ) @@ -30,7 +29,7 @@ modulate = Color( 1, 1, 1, 0.501961 ) margin_top = 36.0 margin_right = 250.0 margin_bottom = 66.0 -custom_fonts/font = ExtResource( 2 ) +theme = ExtResource( 2 ) text = "+¥55" align = 2 script = ExtResource( 3 ) diff --git a/src/main/puzzle/results-hud.gd b/src/main/puzzle/results-hud.gd index ea3c72e76..a6ccf697c 100644 --- a/src/main/puzzle/results-hud.gd +++ b/src/main/puzzle/results-hud.gd @@ -57,7 +57,7 @@ func _append_creature_scores(rank_result: RankResult, creature_scores: Array, \ if creature_score == 0: # last entry in creature_score is always 0; ignore it continue - var left := "Creature #%s " % StringUtils.comma_sep(i + 1) + var left := "Customer #%s " % StringUtils.comma_sep(i + 1) var right := "¥%s/\n" % StringUtils.comma_sep(creature_score) var middle := "" var period_count := 50 - _period_count(left + right) diff --git a/src/main/ui/FpsLabel.tscn b/src/main/ui/FpsLabel.tscn index 02d454d20..a6906a068 100644 --- a/src/main/ui/FpsLabel.tscn +++ b/src/main/ui/FpsLabel.tscn @@ -1,10 +1,9 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://src/main/ui/xolonium-16.tres" type="DynamicFont" id=1] +[ext_resource path="res://src/main/ui/menu/theme/h4.theme" type="Theme" id=1] [ext_resource path="res://src/main/ui/fps-label.gd" type="Script" id=2] - [node name="FpsLabel" type="Label"] anchor_left = 1.0 anchor_top = 1.0 @@ -14,7 +13,7 @@ margin_left = -110.0 margin_top = -50.0 margin_right = -9.99982 margin_bottom = -20.0 -custom_fonts/font = ExtResource( 1 ) +theme = ExtResource( 1 ) text = "60.00 fps" align = 2 script = ExtResource( 2 ) diff --git a/src/main/ui/HighScoreTable.tscn b/src/main/ui/HighScoreTable.tscn index f9aaa3e69..fc721614d 100644 --- a/src/main/ui/HighScoreTable.tscn +++ b/src/main/ui/HighScoreTable.tscn @@ -1,14 +1,14 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://src/main/ui/xolonium-16.tres" type="DynamicFont" id=1] [ext_resource path="res://src/main/ui/high-score-table.gd" type="Script" id=2] - +[ext_resource path="res://src/main/ui/menu/theme/h4.theme" type="Theme" id=3] [node name="HighScoreTable" type="VBoxContainer"] margin_right = 412.0 margin_bottom = 152.0 size_flags_horizontal = 3 +theme = ExtResource( 3 ) script = ExtResource( 2 ) __meta__ = { "_edit_use_anchors_": false @@ -18,7 +18,6 @@ __meta__ = { margin_right = 412.0 margin_bottom = 20.0 size_flags_horizontal = 3 -custom_fonts/font = ExtResource( 1 ) text = "Today's Best" align = 1 __meta__ = { @@ -37,7 +36,6 @@ columns = 4 margin_right = 88.0 margin_bottom = 20.0 size_flags_horizontal = 3 -custom_fonts/font = ExtResource( 1 ) text = "08:15" [node name="Lines1" type="Label" parent="GridContainer"] @@ -45,7 +43,6 @@ margin_left = 108.0 margin_right = 196.0 margin_bottom = 20.0 size_flags_horizontal = 3 -custom_fonts/font = ExtResource( 1 ) text = "116" [node name="Overall1" type="Label" parent="GridContainer"] @@ -53,7 +50,6 @@ margin_left = 216.0 margin_right = 304.0 margin_bottom = 20.0 size_flags_horizontal = 3 -custom_fonts/font = ExtResource( 1 ) text = "5,231" [node name="Grade1" type="Label" parent="GridContainer"] @@ -61,7 +57,6 @@ margin_left = 324.0 margin_right = 412.0 margin_bottom = 20.0 size_flags_horizontal = 3 -custom_fonts/font = ExtResource( 1 ) text = "(SSS)" [node name="Time2" type="Label" parent="GridContainer"] @@ -69,7 +64,6 @@ margin_top = 24.0 margin_right = 49.0 margin_bottom = 44.0 size_flags_horizontal = 2 -custom_fonts/font = ExtResource( 1 ) text = "08:15" [node name="Lines2" type="Label" parent="GridContainer"] @@ -78,7 +72,6 @@ margin_top = 24.0 margin_right = 196.0 margin_bottom = 44.0 size_flags_horizontal = 3 -custom_fonts/font = ExtResource( 1 ) text = "116" [node name="Overall2" type="Label" parent="GridContainer"] @@ -87,7 +80,6 @@ margin_top = 24.0 margin_right = 304.0 margin_bottom = 44.0 size_flags_horizontal = 3 -custom_fonts/font = ExtResource( 1 ) text = "5,231" [node name="Grade2" type="Label" parent="GridContainer"] @@ -96,7 +88,6 @@ margin_top = 24.0 margin_right = 412.0 margin_bottom = 44.0 size_flags_horizontal = 3 -custom_fonts/font = ExtResource( 1 ) text = "(SSS)" [node name="Time3" type="Label" parent="GridContainer"] @@ -104,7 +95,6 @@ margin_top = 48.0 margin_right = 88.0 margin_bottom = 68.0 size_flags_horizontal = 3 -custom_fonts/font = ExtResource( 1 ) text = "08:15" [node name="Lines3" type="Label" parent="GridContainer"] @@ -113,7 +103,6 @@ margin_top = 48.0 margin_right = 196.0 margin_bottom = 68.0 size_flags_horizontal = 3 -custom_fonts/font = ExtResource( 1 ) text = "116" [node name="Overall3" type="Label" parent="GridContainer"] @@ -122,7 +111,6 @@ margin_top = 48.0 margin_right = 304.0 margin_bottom = 68.0 size_flags_horizontal = 3 -custom_fonts/font = ExtResource( 1 ) text = "5,231" [node name="Grade3" type="Label" parent="GridContainer"] @@ -131,5 +119,4 @@ margin_top = 48.0 margin_right = 412.0 margin_bottom = 68.0 size_flags_horizontal = 3 -custom_fonts/font = ExtResource( 1 ) text = "(SSS)" diff --git a/src/main/ui/OverworldUi.tscn b/src/main/ui/OverworldUi.tscn index f963d5b0b..e7db8aaf8 100644 --- a/src/main/ui/OverworldUi.tscn +++ b/src/main/ui/OverworldUi.tscn @@ -8,8 +8,7 @@ [ext_resource path="res://src/main/ui/CheatCodeDetector.tscn" type="PackedScene" id=7] [ext_resource path="res://src/main/ui/MoneyLabel.tscn" type="PackedScene" id=8] [ext_resource path="res://src/main/ui/SettingsMenu.tscn" type="PackedScene" id=9] -[ext_resource path="res://src/main/ui/xolonium-16.tres" type="DynamicFont" id=10] - +[ext_resource path="res://src/main/ui/menu/theme/h4.theme" type="Theme" id=10] [node name="OverworldUi" type="Control"] @@ -36,6 +35,7 @@ margin_left = -512.0 margin_top = -300.0 margin_right = -10.0 margin_bottom = -10.0 +theme = ExtResource( 10 ) alignment = 2 __meta__ = { "_edit_use_anchors_": false @@ -67,6 +67,7 @@ margin_left = 10.0 margin_top = 10.0 margin_right = 512.0 margin_bottom = 300.0 +theme = ExtResource( 10 ) __meta__ = { "_edit_use_anchors_": false } @@ -83,7 +84,6 @@ visible = false margin_top = 36.0 margin_right = 502.0 margin_bottom = 56.0 -custom_fonts/font = ExtResource( 10 ) text = "cb-----" script = ExtResource( 6 ) @@ -99,6 +99,6 @@ quit_text = "Save + Quit" [connection signal="chat_event_played" from="ChatUi" to="." method="_on_ChatUi_chat_event_played"] [connection signal="pop_out_completed" from="ChatUi" to="." method="_on_ChatUi_pop_out_completed"] [connection signal="showed_choices" from="ChatUi" to="." method="_on_ChatUi_showed_choices"] -[connection signal="cheat_detected" from="CheatCodeDetector" to="Labels/SoutheastLabels/FpsLabel" method="_on_CheatCodeDetector_cheat_detected"] [connection signal="cheat_detected" from="CheatCodeDetector" to="Labels/NorthwestLabels/TurboTrace" method="_on_CheatCodeDetector_cheat_detected"] +[connection signal="cheat_detected" from="CheatCodeDetector" to="Labels/SoutheastLabels/FpsLabel" method="_on_CheatCodeDetector_cheat_detected"] [connection signal="quit_pressed" from="SettingsMenu" to="." method="_on_SettingsMenu_quit_pressed"] diff --git a/src/main/ui/SettingsMenu.tscn b/src/main/ui/SettingsMenu.tscn index bc30673bf..bcb1930b8 100644 --- a/src/main/ui/SettingsMenu.tscn +++ b/src/main/ui/SettingsMenu.tscn @@ -1,14 +1,13 @@ [gd_scene load_steps=7 format=2] -[ext_resource path="res://src/main/ui/xolonium-16.tres" type="DynamicFont" id=1] +[ext_resource path="res://src/main/ui/menu/theme/h4.theme" type="Theme" id=1] [ext_resource path="res://src/main/puzzle/PuzzleHudStyleBox.tres" type="StyleBox" id=2] -[ext_resource path="res://src/main/ui/xolonium-24.tres" type="DynamicFont" id=3] +[ext_resource path="res://src/main/ui/menu/theme/h3.theme" type="Theme" id=3] [ext_resource path="res://src/main/ui/menu/settings-menu.gd" type="Script" id=5] [ext_resource path="res://src/main/ui/VolumeSetting.tscn" type="PackedScene" id=6] [ext_resource path="res://src/main/ui/UiCancelShortcut.tres" type="ShortCut" id=7] - [node name="SettingsMenu" type="CanvasLayer"] pause_mode = 2 script = ExtResource( 5 ) @@ -105,7 +104,7 @@ margin_bottom = 170.0 rect_min_size = Vector2( 120, 40 ) size_flags_horizontal = 4 size_flags_vertical = 4 -custom_fonts/font = ExtResource( 3 ) +theme = ExtResource( 3 ) shortcut_in_tooltip = false shortcut = ExtResource( 7 ) text = "Ok" @@ -118,7 +117,7 @@ margin_right = 80.0 rect_min_size = Vector2( 80, 30 ) size_flags_horizontal = 4 size_flags_vertical = 4 -custom_fonts/font = ExtResource( 1 ) +theme = ExtResource( 1 ) shortcut_in_tooltip = false text = "Quit" __meta__ = { diff --git a/src/main/ui/VersionLabel.tscn b/src/main/ui/VersionLabel.tscn index 389aa0264..c977a34a6 100644 --- a/src/main/ui/VersionLabel.tscn +++ b/src/main/ui/VersionLabel.tscn @@ -1,8 +1,7 @@ [gd_scene load_steps=3 format=2] [ext_resource path="res://src/main/ui/version-label.gd" type="Script" id=1] -[ext_resource path="res://src/main/ui/xolonium-16.tres" type="DynamicFont" id=2] - +[ext_resource path="res://src/main/ui/menu/theme/h4.theme" type="Theme" id=2] [node name="VersionLabel" type="Label"] @@ -13,7 +12,7 @@ anchor_bottom = 1.0 margin_left = -110.0 margin_top = -30.0 margin_right = -9.99988 -custom_fonts/font = ExtResource( 2 ) +theme = ExtResource( 2 ) text = "v1.2.3.4" align = 2 script = ExtResource( 1 ) diff --git a/src/main/ui/VolumeSetting.tscn b/src/main/ui/VolumeSetting.tscn index 44f106937..331622498 100644 --- a/src/main/ui/VolumeSetting.tscn +++ b/src/main/ui/VolumeSetting.tscn @@ -1,14 +1,11 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://src/main/ui/xolonium-16.tres" type="DynamicFont" id=1] +[ext_resource path="res://src/main/ui/menu/theme/h4.theme" type="Theme" id=1] [ext_resource path="res://src/main/ui/volume-setting-control.gd" type="Script" id=2] [ext_resource path="res://assets/main/puzzle/squish.wav" type="AudioStream" id=3] [ext_resource path="res://assets/main/world/creature/combo-voice-00.wav" type="AudioStream" id=4] - - - [node name="Control" type="Control"] anchor_left = 0.5 anchor_top = 0.5 @@ -20,6 +17,7 @@ margin_right = 200.0 margin_bottom = 10.0 rect_min_size = Vector2( 400, 20 ) size_flags_horizontal = 3 +theme = ExtResource( 1 ) script = ExtResource( 2 ) __meta__ = { "_edit_use_anchors_": false @@ -31,9 +29,11 @@ margin_bottom = 20.0 rect_min_size = Vector2( 120, 0 ) size_flags_horizontal = 3 size_flags_stretch_ratio = 0.5 -custom_fonts/font = ExtResource( 1 ) text = "Music" align = 2 +__meta__ = { +"_edit_use_anchors_": false +} [node name="Control" type="HBoxContainer" parent="."] anchor_left = 1.0 @@ -68,7 +68,6 @@ margin_left = 170.0 margin_right = 230.0 margin_bottom = 20.0 rect_min_size = Vector2( 60, 0 ) -custom_fonts/font = ExtResource( 1 ) text = "100%" [node name="SampleTimer" type="Timer" parent="."] diff --git a/src/main/ui/high-score-table.gd b/src/main/ui/high-score-table.gd index 3614541a1..34047f40c 100644 --- a/src/main/ui/high-score-table.gd +++ b/src/main/ui/high-score-table.gd @@ -5,9 +5,6 @@ A table which displays the player's high scores in practice mode. Scores are separated by mode and difficulty. We also keep daily scores separate. """ -# font to use for table cells -var _cell_font := preload("res://src/main/ui/xolonium-16.tres") - # scenario to display high scores for var _scenario: ScenarioSettings setget set_scenario @@ -108,6 +105,5 @@ func _add_row(items: Array) -> void: var item: String = item_obj var item_label := Label.new() item_label.text = item - item_label.set("custom_fonts/font", _cell_font) item_label.size_flags_horizontal = Label.SIZE_EXPAND $GridContainer.add_child(item_label) diff --git a/src/main/ui/menu/LoadingScreen.tscn b/src/main/ui/menu/LoadingScreen.tscn index 43ead1619..fca2775a9 100644 --- a/src/main/ui/menu/LoadingScreen.tscn +++ b/src/main/ui/menu/LoadingScreen.tscn @@ -1,9 +1,10 @@ [gd_scene load_steps=4 format=2] [ext_resource path="res://src/main/ui/menu/loading-screen.gd" type="Script" id=1] -[ext_resource path="res://src/main/ui/xolonium-48.tres" type="DynamicFont" id=2] +[ext_resource path="res://src/main/ui/menu/theme/h1.theme" type="Theme" id=2] [ext_resource path="res://assets/main/puzzle/wood-backdrop.png" type="Texture" id=3] + [node name="LoadingScreen" type="Control"] anchor_right = 1.0 anchor_bottom = 1.0 @@ -31,7 +32,7 @@ margin_left = -332.0 margin_top = -29.0 margin_right = 332.0 margin_bottom = 29.0 -custom_fonts/font = ExtResource( 2 ) +theme = ExtResource( 2 ) __meta__ = { "_edit_use_anchors_": false } diff --git a/src/main/ui/menu/MainMenu.tscn b/src/main/ui/menu/MainMenu.tscn index 417c2e85c..1efec54af 100644 --- a/src/main/ui/menu/MainMenu.tscn +++ b/src/main/ui/menu/MainMenu.tscn @@ -1,15 +1,13 @@ [gd_scene load_steps=9 format=2] [ext_resource path="res://src/main/ui/menu/main-menu.gd" type="Script" id=1] -[ext_resource path="res://src/main/ui/xolonium-24.tres" type="DynamicFont" id=2] -[ext_resource path="res://src/main/ui/xolonium-48-outline.tres" type="DynamicFont" id=3] +[ext_resource path="res://src/main/ui/menu/theme/h3.theme" type="Theme" id=2] +[ext_resource path="res://src/main/ui/menu/theme/h1-font-outline.tres" type="DynamicFont" id=3] [ext_resource path="res://assets/main/puzzle/wood-backdrop.png" type="Texture" id=4] [ext_resource path="res://src/main/ui/menu/SystemButtons.tscn" type="PackedScene" id=5] -[ext_resource path="res://src/main/ui/xolonium-36-outline.tres" type="DynamicFont" id=6] [ext_resource path="res://src/main/ui/VersionLabel.tscn" type="PackedScene" id=7] [ext_resource path="res://src/main/ui/SettingsMenu.tscn" type="PackedScene" id=8] - - +[ext_resource path="res://src/main/ui/menu/theme/h2-font-outline.tres" type="DynamicFont" id=9] [node name="MainMenu" type="Control"] @@ -57,7 +55,7 @@ __meta__ = { [node name="Label" type="Label" parent="Play"] margin_right = 512.0 margin_bottom = 44.0 -custom_fonts/font = ExtResource( 6 ) +custom_fonts/font = ExtResource( 9 ) text = "Play" align = 1 @@ -69,7 +67,7 @@ margin_bottom = 101.0 rect_min_size = Vector2( 193, 47 ) size_flags_horizontal = 4 size_flags_vertical = 4 -custom_fonts/font = ExtResource( 2 ) +theme = ExtResource( 2 ) text = "Continue" [node name="Practice" type="Button" parent="Play"] @@ -80,7 +78,7 @@ margin_bottom = 158.0 rect_min_size = Vector2( 193, 47 ) size_flags_horizontal = 4 size_flags_vertical = 4 -custom_fonts/font = ExtResource( 2 ) +theme = ExtResource( 2 ) text = "Practice" [node name="Create" type="VBoxContainer" parent="."] @@ -99,7 +97,7 @@ __meta__ = { [node name="Label" type="Label" parent="Create"] margin_right = 512.0 margin_bottom = 44.0 -custom_fonts/font = ExtResource( 6 ) +custom_fonts/font = ExtResource( 9 ) text = "Create" align = 1 @@ -111,7 +109,7 @@ margin_bottom = 101.0 rect_min_size = Vector2( 193, 47 ) size_flags_horizontal = 4 size_flags_vertical = 4 -custom_fonts/font = ExtResource( 2 ) +theme = ExtResource( 2 ) text = "Levels" [node name="Characters" type="Button" parent="Create"] @@ -122,7 +120,7 @@ margin_bottom = 158.0 rect_min_size = Vector2( 193, 47 ) size_flags_horizontal = 4 size_flags_vertical = 4 -custom_fonts/font = ExtResource( 2 ) +theme = ExtResource( 2 ) disabled = true text = "Characters" diff --git a/src/main/ui/menu/PracticeMenu.tscn b/src/main/ui/menu/PracticeMenu.tscn index 98bbb63f4..d24a0d252 100644 --- a/src/main/ui/menu/PracticeMenu.tscn +++ b/src/main/ui/menu/PracticeMenu.tscn @@ -5,17 +5,15 @@ [ext_resource path="res://src/main/ui/menu/practice-high-scores.gd" type="Script" id=3] [ext_resource path="res://src/main/ui/SettingsMenu.tscn" type="PackedScene" id=4] [ext_resource path="res://src/main/ui/menu/system-buttons.gd" type="Script" id=5] -[ext_resource path="res://src/main/ui/xolonium-24.tres" type="DynamicFont" id=6] -[ext_resource path="res://src/main/ui/xolonium-16.tres" type="DynamicFont" id=7] +[ext_resource path="res://src/main/ui/menu/theme/h4.theme" type="Theme" id=6] [ext_resource path="res://src/main/ui/UiCancelShortcut.tres" type="ShortCut" id=8] +[ext_resource path="res://src/main/ui/menu/theme/h3.theme" type="Theme" id=9] [ext_resource path="res://assets/main/puzzle/wood-backdrop.png" type="Texture" id=10] -[ext_resource path="res://src/main/ui/xolonium-36-outline.tres" type="DynamicFont" id=11] [ext_resource path="res://src/main/puzzle/PuzzleHudStyleBox.tres" type="StyleBox" id=12] [ext_resource path="res://src/main/ui/HighScoreTable.tscn" type="PackedScene" id=13] [ext_resource path="res://src/main/ui/menu/mode-buttongroup.tres" type="ButtonGroup" id=14] [ext_resource path="res://src/main/ui/menu/practice-mode-selector.gd" type="Script" id=15] - - +[ext_resource path="res://src/main/ui/menu/theme/h2-font-outline.tres" type="DynamicFont" id=17] [node name="PracticeMenu" type="Control"] @@ -57,7 +55,7 @@ margin_right = 984.0 margin_bottom = 44.0 size_flags_horizontal = 3 size_flags_vertical = 3 -custom_fonts/font = ExtResource( 11 ) +custom_fonts/font = ExtResource( 17 ) text = "Mode" align = 1 valign = 1 @@ -83,7 +81,7 @@ margin_bottom = 36.0 rect_min_size = Vector2( 120, 0 ) size_flags_horizontal = 3 size_flags_vertical = 3 -custom_fonts/font = ExtResource( 6 ) +theme = ExtResource( 9 ) toggle_mode = true pressed = true group = ExtResource( 14 ) @@ -96,7 +94,7 @@ margin_bottom = 36.0 rect_min_size = Vector2( 120, 0 ) size_flags_horizontal = 3 size_flags_vertical = 3 -custom_fonts/font = ExtResource( 6 ) +theme = ExtResource( 9 ) toggle_mode = true group = ExtResource( 14 ) text = "Ultra" @@ -108,7 +106,7 @@ margin_bottom = 36.0 rect_min_size = Vector2( 120, 0 ) size_flags_horizontal = 3 size_flags_vertical = 3 -custom_fonts/font = ExtResource( 6 ) +theme = ExtResource( 9 ) toggle_mode = true group = ExtResource( 14 ) text = "Sprint" @@ -120,7 +118,7 @@ margin_bottom = 36.0 rect_min_size = Vector2( 120, 0 ) size_flags_horizontal = 3 size_flags_vertical = 3 -custom_fonts/font = ExtResource( 6 ) +theme = ExtResource( 9 ) toggle_mode = true group = ExtResource( 14 ) text = "Rank" @@ -132,7 +130,7 @@ margin_bottom = 36.0 rect_min_size = Vector2( 120, 0 ) size_flags_horizontal = 3 size_flags_vertical = 3 -custom_fonts/font = ExtResource( 6 ) +theme = ExtResource( 9 ) toggle_mode = true group = ExtResource( 14 ) text = "Sandbox" @@ -143,7 +141,7 @@ margin_right = 984.0 margin_bottom = 108.0 size_flags_horizontal = 3 size_flags_vertical = 3 -custom_fonts/font = ExtResource( 7 ) +theme = ExtResource( 6 ) text = "Score 200 points as quickly as possible!" align = 1 valign = 1 @@ -163,7 +161,7 @@ margin_right = 984.0 margin_bottom = 44.0 size_flags_horizontal = 3 size_flags_vertical = 3 -custom_fonts/font = ExtResource( 11 ) +custom_fonts/font = ExtResource( 17 ) text = "Difficulty" align = 1 valign = 1 @@ -188,13 +186,13 @@ margin_right = 796.0 margin_bottom = 88.0 rect_min_size = Vector2( 608, 0 ) size_flags_horizontal = 4 +theme = ExtResource( 6 ) [node name="Normal" type="Label" parent="VBoxContainer/Difficulty/Labels"] margin_right = 99.0 margin_bottom = 20.0 size_flags_horizontal = 3 size_flags_stretch_ratio = 0.5 -custom_fonts/font = ExtResource( 7 ) text = "Normal" [node name="Hard" type="Label" parent="VBoxContainer/Difficulty/Labels"] @@ -202,7 +200,6 @@ margin_left = 103.0 margin_right = 301.0 margin_bottom = 20.0 size_flags_horizontal = 3 -custom_fonts/font = ExtResource( 7 ) text = "Hard" align = 1 @@ -211,7 +208,6 @@ margin_left = 305.0 margin_right = 503.0 margin_bottom = 20.0 size_flags_horizontal = 3 -custom_fonts/font = ExtResource( 7 ) text = "Expert" align = 1 @@ -221,7 +217,6 @@ margin_right = 608.0 margin_bottom = 20.0 size_flags_horizontal = 3 size_flags_stretch_ratio = 0.5 -custom_fonts/font = ExtResource( 7 ) text = "Master" align = 2 @@ -243,7 +238,7 @@ margin_bottom = 60.0 rect_min_size = Vector2( 180, 60 ) size_flags_horizontal = 4 size_flags_vertical = 4 -custom_fonts/font = ExtResource( 6 ) +theme = ExtResource( 9 ) text = "Start" [node name="Settings" type="Button" parent="VBoxContainer/System"] @@ -254,7 +249,7 @@ margin_bottom = 98.0 rect_min_size = Vector2( 116, 28 ) size_flags_horizontal = 4 size_flags_vertical = 4 -custom_fonts/font = ExtResource( 7 ) +theme = ExtResource( 6 ) shortcut = ExtResource( 8 ) text = "Settings" @@ -266,7 +261,7 @@ margin_bottom = 136.0 rect_min_size = Vector2( 116, 28 ) size_flags_horizontal = 4 size_flags_vertical = 4 -custom_fonts/font = ExtResource( 7 ) +theme = ExtResource( 6 ) text = "Quit" [node name="HighScores" type="Panel" parent="VBoxContainer"] diff --git a/src/main/ui/menu/SplashScreen.tscn b/src/main/ui/menu/SplashScreen.tscn index f8a502a16..168561f16 100644 --- a/src/main/ui/menu/SplashScreen.tscn +++ b/src/main/ui/menu/SplashScreen.tscn @@ -2,13 +2,11 @@ [ext_resource path="res://src/main/ui/menu/splash-screen.gd" type="Script" id=1] [ext_resource path="res://src/main/ui/VersionLabel.tscn" type="PackedScene" id=2] -[ext_resource path="res://src/main/ui/xolonium-48-outline.tres" type="DynamicFont" id=3] +[ext_resource path="res://src/main/ui/menu/theme/h1-font-outline.tres" type="DynamicFont" id=3] [ext_resource path="res://assets/main/puzzle/wood-backdrop.png" type="Texture" id=4] [ext_resource path="res://src/main/ui/menu/SystemButtons.tscn" type="PackedScene" id=5] [ext_resource path="res://src/main/ui/SettingsMenu.tscn" type="PackedScene" id=6] -[ext_resource path="res://src/main/ui/xolonium-48.tres" type="DynamicFont" id=7] - - +[ext_resource path="res://src/main/ui/menu/theme/h1.theme" type="Theme" id=7] [node name="SplashScreen" type="Control"] @@ -64,7 +62,7 @@ margin_bottom = 40.0 rect_min_size = Vector2( 193, 47 ) size_flags_horizontal = 4 size_flags_vertical = 4 -custom_fonts/font = ExtResource( 7 ) +theme = ExtResource( 7 ) text = "Play" __meta__ = { "_edit_use_anchors_": false @@ -75,7 +73,6 @@ __meta__ = { [node name="VersionLabel" parent="." instance=ExtResource( 2 )] [node name="SettingsMenu" parent="." instance=ExtResource( 6 )] -visible = false [connection signal="pressed" from="PlayHolder/Play" to="." method="_on_Play_pressed"] [connection signal="quit_pressed" from="System" to="." method="_on_System_quit_pressed"] [connection signal="settings_pressed" from="System" to="SettingsMenu" method="_on_Settings_pressed"] diff --git a/src/main/ui/menu/SystemButtons.tscn b/src/main/ui/menu/SystemButtons.tscn index 7e72737d6..c206b60b2 100644 --- a/src/main/ui/menu/SystemButtons.tscn +++ b/src/main/ui/menu/SystemButtons.tscn @@ -1,16 +1,16 @@ [gd_scene load_steps=4 format=2] -[ext_resource path="res://src/main/ui/xolonium-16.tres" type="DynamicFont" id=1] +[ext_resource path="res://src/main/ui/menu/theme/h4.theme" type="Theme" id=1] [ext_resource path="res://src/main/ui/menu/system-buttons.gd" type="Script" id=2] [ext_resource path="res://src/main/ui/UiCancelShortcut.tres" type="ShortCut" id=3] - [node name="System" type="VBoxContainer"] anchor_top = 1.0 anchor_right = 1.0 anchor_bottom = 1.0 margin_top = -86.0 +theme = ExtResource( 1 ) custom_constants/separation = 10 script = ExtResource( 2 ) __meta__ = { @@ -24,7 +24,6 @@ margin_bottom = 28.0 rect_min_size = Vector2( 116, 28 ) size_flags_horizontal = 4 size_flags_vertical = 4 -custom_fonts/font = ExtResource( 1 ) shortcut_in_tooltip = false shortcut = ExtResource( 3 ) text = "Settings" @@ -37,7 +36,6 @@ margin_bottom = 66.0 rect_min_size = Vector2( 116, 28 ) size_flags_horizontal = 4 size_flags_vertical = 4 -custom_fonts/font = ExtResource( 1 ) text = "Quit" [connection signal="pressed" from="Settings" to="." method="_on_Settings_pressed"] [connection signal="pressed" from="Quit" to="." method="_on_Quit_pressed"] diff --git a/src/main/ui/menu/practice-difficulty-selector.gd b/src/main/ui/menu/practice-difficulty-selector.gd index 5fbcf80cd..897475c26 100644 --- a/src/main/ui/menu/practice-difficulty-selector.gd +++ b/src/main/ui/menu/practice-difficulty-selector.gd @@ -5,9 +5,6 @@ User interface control which lets the player pick their difficulty in practice m signal difficulty_changed -# font used for tick mark labels -var _label_font := preload("res://src/main/ui/xolonium-16.tres") - # difficulties which appear as tick mark labels var _difficulty_names: Array setget set_difficulty_names @@ -63,7 +60,6 @@ func set_difficulty_names(names: Array) -> void: var label := Label.new() label.text = name label.align = Label.ALIGN_CENTER - label.set("custom_fonts/font", _label_font) label.size_flags_horizontal = Label.SIZE_EXPAND_FILL $Labels.add_child(label) diff --git a/src/main/ui/xolonium-48-outline.tres b/src/main/ui/menu/theme/h1-font-outline.tres similarity index 99% rename from src/main/ui/xolonium-48-outline.tres rename to src/main/ui/menu/theme/h1-font-outline.tres index fcd15ae08..8a811d777 100644 --- a/src/main/ui/xolonium-48-outline.tres +++ b/src/main/ui/menu/theme/h1-font-outline.tres @@ -2,7 +2,6 @@ [ext_resource path="res://assets/main/ui/Xolonium-Regular.ttf" type="DynamicFontData" id=1] - [resource] size = 48 outline_size = 4 diff --git a/src/main/ui/xolonium-48.tres b/src/main/ui/menu/theme/h1-font.tres similarity index 100% rename from src/main/ui/xolonium-48.tres rename to src/main/ui/menu/theme/h1-font.tres diff --git a/src/main/ui/menu/theme/h1.theme b/src/main/ui/menu/theme/h1.theme new file mode 100644 index 0000000000000000000000000000000000000000..eacb0f17f74394cc4990ff85b6826f091399922b GIT binary patch literal 198 zcmV;%06G6sQ$s@n000005C8x>0RRB50000ewJ-f(I{+mG0Ah(9A5dW`0RYL3mlP)% z;&X?wFIJnuhh%@{V&Dk@QGrkolBUx9H(r?KhzsQcVU}*&C3U)O%BDJ&nkpDoBM*vV zExCcopZEn!0R~n44@>tPB%hg_4fqvrOK$PHRS`Xjo}}J`R>Aq=!k_UMM!anoz;77* zgbxq^DjUGG0FMcCF=oT0a8;#L#+Ew A7XSbN literal 0 HcmV?d00001 diff --git a/src/main/ui/xolonium-36-outline.tres b/src/main/ui/menu/theme/h2-font-outline.tres similarity index 77% rename from src/main/ui/xolonium-36-outline.tres rename to src/main/ui/menu/theme/h2-font-outline.tres index 27cbdf19f..3b50634e5 100644 --- a/src/main/ui/xolonium-36-outline.tres +++ b/src/main/ui/menu/theme/h2-font-outline.tres @@ -2,9 +2,8 @@ [ext_resource path="res://assets/main/ui/Xolonium-Regular.ttf" type="DynamicFontData" id=1] - [resource] size = 36 outline_size = 2 -outline_color = Color( 0, 0, 0, 0.501961 ) +outline_color = Color( 0.113725, 0.101961, 0.101961, 0.752941 ) font_data = ExtResource( 1 ) diff --git a/src/main/ui/xolonium-36.tres b/src/main/ui/menu/theme/h2-font.tres similarity index 99% rename from src/main/ui/xolonium-36.tres rename to src/main/ui/menu/theme/h2-font.tres index 0f4f24260..e3902d93b 100644 --- a/src/main/ui/xolonium-36.tres +++ b/src/main/ui/menu/theme/h2-font.tres @@ -2,7 +2,6 @@ [ext_resource path="res://assets/main/ui/Xolonium-Regular.ttf" type="DynamicFontData" id=1] - [resource] size = 36 font_data = ExtResource( 1 ) diff --git a/src/main/ui/menu/theme/h2.theme b/src/main/ui/menu/theme/h2.theme new file mode 100644 index 0000000000000000000000000000000000000000..8c3b5af7ea9073dca10badd655f14d2bcaa8954a GIT binary patch literal 198 zcmV;%06G6sQ$s@n000005C8x>0RRB50000ewJ-f(I{+mG0Ah(9A5dW`0RYL3mlP)% z;&X?wFIJnu$*;e1G4OtPB%hg_4fqvrOK$PHRS`Xjo}}J`R>Aq=!k_UMM!anoz;77* zgbxq^DjUGG0FMcCF=oT0a8;#LyOZ- AumAu6 literal 0 HcmV?d00001 diff --git a/src/main/ui/xolonium-24.tres b/src/main/ui/menu/theme/h3-font.tres similarity index 99% rename from src/main/ui/xolonium-24.tres rename to src/main/ui/menu/theme/h3-font.tres index e88ab90ed..38f50f630 100644 --- a/src/main/ui/xolonium-24.tres +++ b/src/main/ui/menu/theme/h3-font.tres @@ -2,7 +2,6 @@ [ext_resource path="res://assets/main/ui/Xolonium-Regular.ttf" type="DynamicFontData" id=1] - [resource] size = 24 font_data = ExtResource( 1 ) diff --git a/src/main/ui/menu/theme/h3.theme b/src/main/ui/menu/theme/h3.theme new file mode 100644 index 0000000000000000000000000000000000000000..e357b5eee85ba26cf55b3d0d4fe16015e35b86f7 GIT binary patch literal 198 zcmV;%06G6sQ$s@n000005C8x>0RRB50000ewJ-f(I{+mG0Ah(9A5dW`0RYL3mlP)% z;&X?wFIJmDeY3xEG4OtPB%hg_4fqvrOK$PHRS`Xjo}}J`R>Aq=!k_UMM!anoz;77* zgbxq^DjUGG0FMcCF=oT0a8;#LmCH8 A=l}o! literal 0 HcmV?d00001 diff --git a/src/main/ui/xolonium-16.tres b/src/main/ui/menu/theme/h4-font.tres similarity index 99% rename from src/main/ui/xolonium-16.tres rename to src/main/ui/menu/theme/h4-font.tres index 386743d4d..fad4718af 100644 --- a/src/main/ui/xolonium-16.tres +++ b/src/main/ui/menu/theme/h4-font.tres @@ -2,6 +2,5 @@ [ext_resource path="res://assets/main/ui/Xolonium-Regular.ttf" type="DynamicFontData" id=1] - [resource] font_data = ExtResource( 1 ) diff --git a/src/main/ui/menu/theme/h4.theme b/src/main/ui/menu/theme/h4.theme new file mode 100644 index 0000000000000000000000000000000000000000..c606a11c1a164f9abb3488c261974f6e7c6c0dcc GIT binary patch literal 198 zcmV;%06G6sQ$s@n000005C8x>0RRB50000ewJ-f(I{+mG0Ah(9A5dW`0RYL3mlP)% z;&X?wFIJmDm@9wfV&Dk@QGrkolBUx9H(r?KhzsQcVU}*&C3U)O%BDJ&nkpDoBM*vV zExCcopZEn!0R~n44@>tPB%hg_4fqvrOK$PHRS`Xjo}}J`R>Aq=!k_UMM!anoz;77* zgbxq^DjUGG0FMcCF=oT0a8;#LrsiL AZvX%Q literal 0 HcmV?d00001 diff --git a/src/main/ui/money-font.tres b/src/main/ui/money-font.tres index 4e19cbd4e..89074d891 100644 --- a/src/main/ui/money-font.tres +++ b/src/main/ui/money-font.tres @@ -2,7 +2,6 @@ [ext_resource path="res://assets/main/ui/blogger-sans-bold.otf" type="DynamicFontData" id=1] - [resource] size = 24 outline_size = 3