Skip to content

Commit

Permalink
Add help dialog for font settings
Browse files Browse the repository at this point in the history
  • Loading branch information
qrrk committed Sep 18, 2021
1 parent 3e6a099 commit ec4da47
Show file tree
Hide file tree
Showing 11 changed files with 322 additions and 32 deletions.
16 changes: 16 additions & 0 deletions icons/help.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions icons/help.svg.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/help.svg-ab0e78fdbc27e34b7b2a494b462b374b.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://icons/help.svg"
dest_files=[ "res://.import/help.svg-ab0e78fdbc27e34b7b2a494b462b374b.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Binary file added images/font-rect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions images/font-rect.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/font-rect.png-890c7bdb16b292867449fd0d1dbb3dd8.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://images/font-rect.png"
dest_files=[ "res://.import/font-rect.png-890c7bdb16b292867449fd0d1dbb3dd8.stex" ]

[params]

compress/mode=1
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Binary file added images/font-sizes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions images/font-sizes.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/font-sizes.png-5979e2fb93ab7e04e7276bb3d7a9e34d.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://images/font-sizes.png"
dest_files=[ "res://.import/font-sizes.png-5979e2fb93ab7e04e7276bb3d7a9e34d.stex" ]

[params]

compress/mode=1
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
95 changes: 64 additions & 31 deletions scenes/Catapult.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=30 format=2]
[gd_scene load_steps=32 format=2]

[ext_resource path="res://icons/info.svg" type="Texture" id=1]
[ext_resource path="res://icons/download.svg" type="Texture" id=2]
Expand Down Expand Up @@ -28,6 +28,8 @@
[ext_resource path="res://scenes/InlineIconButton.tscn" type="PackedScene" id=26]
[ext_resource path="res://scripts/FontsUI.gd" type="Script" id=27]
[ext_resource path="res://scripts/FontManager.gd" type="Script" id=28]
[ext_resource path="res://scenes/FontSizeHelpDialog.tscn" type="PackedScene" id=29]
[ext_resource path="res://icons/help.svg" type="Texture" id=30]

[sub_resource type="ButtonGroup" id=1]

Expand Down Expand Up @@ -122,11 +124,12 @@ margin_bottom = 91.0
]]
margin_top = 97.0
margin_right = 784.0
margin_bottom = 418.0
margin_bottom = 682.0
tab_align = 0
script = ExtResource( 16 )

[node name="Game" type="VBoxContainer" parent="Main/Tabs"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 7.5
Expand Down Expand Up @@ -586,7 +589,6 @@ current_dir = "/mnt/data/Godot/Catapult/Project"
current_path = "/mnt/data/Godot/Catapult/Project/"

[node name="Fonts" type="VBoxContainer" parent="Main/Tabs"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 7.5
Expand All @@ -597,11 +599,11 @@ script = ExtResource( 27 )

[node name="FontSelection" type="HBoxContainer" parent="Main/Tabs/Fonts"]
margin_right = 769.0
margin_bottom = 428.0
margin_bottom = 432.0

[node name="RightPane" type="VBoxContainer" parent="Main/Tabs/Fonts/FontSelection"]
margin_right = 299.0
margin_bottom = 428.0
margin_bottom = 432.0
size_flags_horizontal = 3
size_flags_stretch_ratio = 2.0

Expand All @@ -623,9 +625,9 @@ items = [ "Item 0", null, false, "Item 1", null, false, "Item 2", null, false, "
allow_reselect = true

[node name="Buttons" type="VBoxContainer" parent="Main/Tabs/Fonts/FontSelection/RightPane"]
margin_top = 310.0
margin_top = 312.0
margin_right = 299.0
margin_bottom = 409.0
margin_bottom = 411.0
size_flags_vertical = 6

[node name="Grid" type="GridContainer" parent="Main/Tabs/Fonts/FontSelection/RightPane/Buttons"]
Expand Down Expand Up @@ -670,12 +672,12 @@ text = "Reset All Fonts"
[node name="VSeparator" type="VSeparator" parent="Main/Tabs/Fonts/FontSelection"]
margin_left = 305.0
margin_right = 313.0
margin_bottom = 428.0
margin_bottom = 432.0

[node name="LeftPane" type="VBoxContainer" parent="Main/Tabs/Fonts/FontSelection"]
margin_left = 319.0
margin_right = 769.0
margin_bottom = 428.0
margin_bottom = 432.0
size_flags_horizontal = 3
size_flags_stretch_ratio = 3.0
custom_constants/separation = 4
Expand Down Expand Up @@ -712,19 +714,39 @@ margin_right = 450.0
margin_bottom = 230.0
custom_constants/separation = 0

[node name="Label2" type="Label" parent="Main/Tabs/Fonts/FontSelection/LeftPane"]
margin_left = 145.0
[node name="HBoxContainer" type="HBoxContainer" parent="Main/Tabs/Fonts/FontSelection/LeftPane"]
margin_top = 234.0
margin_right = 304.0
margin_bottom = 263.0
margin_right = 450.0
margin_bottom = 234.0
custom_constants/separation = 0

[node name="OtherSettings" type="HBoxContainer" parent="Main/Tabs/Fonts/FontSelection/LeftPane"]
margin_left = 152.0
margin_top = 238.0
margin_right = 298.0
margin_bottom = 267.0
size_flags_horizontal = 4
size_flags_vertical = 4

[node name="Label" type="Label" parent="Main/Tabs/Fonts/FontSelection/LeftPane/OtherSettings"]
margin_right = 120.0
margin_bottom = 29.0
size_flags_horizontal = 4
text = "Other font settings:"
text = "Other settings"
align = 1

[node name="HelpIcon" parent="Main/Tabs/Fonts/FontSelection/LeftPane/OtherSettings" instance=ExtResource( 26 )]
margin_left = 126.0
margin_top = 4.0
margin_right = 146.0
margin_bottom = 24.0
rect_min_size = Vector2( 20, 20 )
texture_normal = ExtResource( 30 )

[node name="FontSizeUI" type="HBoxContainer" parent="Main/Tabs/Fonts/FontSelection/LeftPane"]
margin_top = 267.0
margin_top = 271.0
margin_right = 450.0
margin_bottom = 296.0
margin_bottom = 300.0
size_flags_vertical = 6

[node name="Label" type="Label" parent="Main/Tabs/Fonts/FontSelection/LeftPane/FontSizeUI"]
Expand All @@ -742,9 +764,9 @@ max_value = 64.0
value = 8.0

[node name="FontSizeMap" type="HBoxContainer" parent="Main/Tabs/Fonts/FontSelection/LeftPane"]
margin_top = 300.0
margin_top = 304.0
margin_right = 450.0
margin_bottom = 329.0
margin_bottom = 333.0
size_flags_vertical = 6

[node name="Label" type="Label" parent="Main/Tabs/Fonts/FontSelection/LeftPane/FontSizeMap"]
Expand All @@ -762,9 +784,9 @@ max_value = 64.0
value = 8.0

[node name="FontSizeOvermap" type="HBoxContainer" parent="Main/Tabs/Fonts/FontSelection/LeftPane"]
margin_top = 333.0
margin_top = 337.0
margin_right = 450.0
margin_bottom = 362.0
margin_bottom = 366.0
size_flags_vertical = 6

[node name="Label" type="Label" parent="Main/Tabs/Fonts/FontSelection/LeftPane/FontSizeOvermap"]
Expand All @@ -782,29 +804,29 @@ max_value = 64.0
value = 8.0

[node name="FontBlending" type="CheckButton" parent="Main/Tabs/Fonts/FontSelection/LeftPane"]
margin_top = 366.0
margin_top = 370.0
margin_right = 450.0
margin_bottom = 395.0
margin_bottom = 399.0
text = "Font blending"

[node name="BtnSaveFontOptions" type="Button" parent="Main/Tabs/Fonts/FontSelection/LeftPane"]
margin_left = 198.0
margin_top = 399.0
margin_top = 403.0
margin_right = 251.0
margin_bottom = 428.0
margin_bottom = 432.0
size_flags_horizontal = 4
text = "Save"

[node name="HSeparator" type="HSeparator" parent="Main/Tabs/Fonts"]
margin_top = 434.0
margin_top = 438.0
margin_right = 769.0
margin_bottom = 434.0
margin_bottom = 438.0
custom_constants/separation = 0

[node name="FontConfigInfo" type="RichTextLabel" parent="Main/Tabs/Fonts"]
margin_top = 440.0
margin_top = 444.0
margin_right = 769.0
margin_bottom = 528.0
margin_bottom = 532.0
custom_fonts/bold_italics_font = ExtResource( 24 )
custom_fonts/italics_font = ExtResource( 23 )
custom_fonts/bold_font = ExtResource( 22 )
Expand All @@ -820,6 +842,13 @@ text = "Existing font configuration will be shown here.
..."
fit_content_height = true

[node name="FontSizeHelpDialog" parent="Main/Tabs/Fonts" instance=ExtResource( 29 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 538.0
margin_right = 769.0
margin_bottom = 539.0

[node name="Settings" type="VBoxContainer" parent="Main/Tabs"]
visible = false
anchor_right = 1.0
Expand Down Expand Up @@ -1088,7 +1117,7 @@ size_flags_horizontal = 4
text = "Print a random Tip of the Day"

[node name="Log" type="RichTextLabel" parent="Main"]
margin_top = 424.0
margin_top = 688.0
margin_right = 784.0
margin_bottom = 984.0
focus_mode = 2
Expand Down Expand Up @@ -1152,12 +1181,15 @@ __meta__ = {

[node name="Fonts" type="Node" parent="."]
script = ExtResource( 28 )
__meta__ = {
"_editor_description_": "Installs fonts from launcher's internal storage to the game directory, reads, manipulates and saves font-related settings."
}

[connection signal="meta_clicked" from="Main/GameInfo/Description" to="." method="_on_Description_meta_clicked"]
[connection signal="tab_changed" from="Main/Tabs" to="." method="_on_Tabs_tab_changed"]
[connection signal="tab_changed" from="Main/Tabs" to="Main/Tabs/Soundpacks" method="_on_Tabs_tab_changed"]
[connection signal="tab_changed" from="Main/Tabs" to="Main/Tabs/Fonts" method="_on_Tabs_tab_changed"]
[connection signal="tab_changed" from="Main/Tabs" to="Main/Tabs/Mods" method="_on_Tabs_tab_changed"]
[connection signal="tab_changed" from="Main/Tabs" to="Main/Tabs/Soundpacks" method="_on_Tabs_tab_changed"]
[connection signal="tab_changed" from="Main/Tabs" to="." method="_on_Tabs_tab_changed"]
[connection signal="item_selected" from="Main/Tabs/Game/Builds/BuildsList" to="." method="_on_BuildsList_item_selected"]
[connection signal="pressed" from="Main/Tabs/Game/Builds/BtnRefresh" to="." method="_on_BtnRefresh_pressed"]
[connection signal="pressed" from="Main/Tabs/Game/BtnInstall" to="." method="_on_BtnInstall_pressed"]
Expand Down Expand Up @@ -1193,6 +1225,7 @@ script = ExtResource( 28 )
[connection signal="pressed" from="Main/Tabs/Fonts/FontSelection/RightPane/Buttons/Grid/BtnSetFontAll" to="Main/Tabs/Fonts" method="_on_BtnSetFontX_pressed" binds= [ true, true, true ]]
[connection signal="pressed" from="Main/Tabs/Fonts/FontSelection/RightPane/Buttons/BtnResetFont" to="Main/Tabs/Fonts" method="_on_BtnResetFont_pressed"]
[connection signal="toggled" from="Main/Tabs/Fonts/FontSelection/LeftPane/PreviewCyrillic" to="Main/Tabs/Fonts" method="_on_PreviewCyrillic_toggled"]
[connection signal="pressed" from="Main/Tabs/Fonts/FontSelection/LeftPane/OtherSettings/HelpIcon" to="Main/Tabs/Fonts" method="_on_HelpIcon_pressed"]
[connection signal="pressed" from="Main/Tabs/Fonts/FontSelection/LeftPane/BtnSaveFontOptions" to="Main/Tabs/Fonts" method="_on_BtnSaveFontOptions_pressed"]
[connection signal="toggled" from="Main/Tabs/Settings/ShowGameDesc" to="Main/Tabs/Settings" method="_on_ShowGameDesc_toggled"]
[connection signal="toggled" from="Main/Tabs/Settings/PrintTips" to="Main/Tabs/Settings" method="_on_PrintTips_toggled"]
Expand Down
Loading

0 comments on commit ec4da47

Please sign in to comment.