Skip to content

Commit 96b7cac

Browse files
Vastly improve the main project theme (#183)
1 parent 87dd59c commit 96b7cac

File tree

15 files changed

+242
-210
lines changed

15 files changed

+242
-210
lines changed
26.5 KB
Binary file not shown.
26.8 KB
Binary file not shown.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[gd_resource type="DynamicFont" load_steps=2 format=2]
2+
3+
[ext_resource path="res://fonts/kirifont/KiriFont.otf" type="DynamicFontData" id=1]
4+
5+
[resource]
6+
7+
size = 32
8+
extra_spacing_top = -5
9+
extra_spacing_bottom = -20
10+
font_data = ExtResource( 1 )
11+

Framework/Fonts/Kirifont/OFL.txt

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
Copyright (c) <dates>, <Copyright Holder> (<URL|email>),
2+
with Reserved Font Name <Reserved Font Name>.
3+
Copyright (c) <dates>, <additional Copyright Holder> (<URL|email>),
4+
with Reserved Font Name <additional Reserved Font Name>.
5+
Copyright (c) <dates>, <additional Copyright Holder> (<URL|email>).
6+
7+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
8+
This license is copied below, and is also available with a FAQ at:
9+
http://scripts.sil.org/OFL
10+
11+
12+
-----------------------------------------------------------
13+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
14+
-----------------------------------------------------------
15+
16+
PREAMBLE
17+
The goals of the Open Font License (OFL) are to stimulate worldwide
18+
development of collaborative font projects, to support the font creation
19+
efforts of academic and linguistic communities, and to provide a free and
20+
open framework in which fonts may be shared and improved in partnership
21+
with others.
22+
23+
The OFL allows the licensed fonts to be used, studied, modified and
24+
redistributed freely as long as they are not sold by themselves. The
25+
fonts, including any derivative works, can be bundled, embedded,
26+
redistributed and/or sold with any software provided that any reserved
27+
names are not used by derivative works. The fonts and derivatives,
28+
however, cannot be released under any other type of license. The
29+
requirement for fonts to remain under this license does not apply
30+
to any document created using the fonts or their derivatives.
31+
32+
DEFINITIONS
33+
"Font Software" refers to the set of files released by the Copyright
34+
Holder(s) under this license and clearly marked as such. This may
35+
include source files, build scripts and documentation.
36+
37+
"Reserved Font Name" refers to any names specified as such after the
38+
copyright statement(s).
39+
40+
"Original Version" refers to the collection of Font Software components as
41+
distributed by the Copyright Holder(s).
42+
43+
"Modified Version" refers to any derivative made by adding to, deleting,
44+
or substituting -- in part or in whole -- any of the components of the
45+
Original Version, by changing formats or by porting the Font Software to a
46+
new environment.
47+
48+
"Author" refers to any designer, engineer, programmer, technical
49+
writer or other person who contributed to the Font Software.
50+
51+
PERMISSION & CONDITIONS
52+
Permission is hereby granted, free of charge, to any person obtaining
53+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
54+
redistribute, and sell modified and unmodified copies of the Font
55+
Software, subject to the following conditions:
56+
57+
1) Neither the Font Software nor any of its individual components,
58+
in Original or Modified Versions, may be sold by itself.
59+
60+
2) Original or Modified Versions of the Font Software may be bundled,
61+
redistributed and/or sold with any software, provided that each copy
62+
contains the above copyright notice and this license. These can be
63+
included either as stand-alone text files, human-readable headers or
64+
in the appropriate machine-readable metadata fields within text or
65+
binary files as long as those fields can be easily viewed by the user.
66+
67+
3) No Modified Version of the Font Software may use the Reserved Font
68+
Name(s) unless explicit written permission is granted by the corresponding
69+
Copyright Holder. This restriction only applies to the primary font name as
70+
presented to the users.
71+
72+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
73+
Software shall not be used to promote, endorse or advertise any
74+
Modified Version, except to acknowledge the contribution(s) of the
75+
Copyright Holder(s) and the Author(s) or with their explicit written
76+
permission.
77+
78+
5) The Font Software, modified or unmodified, in part or in whole,
79+
must be distributed entirely under this license, and must not be
80+
distributed under any other license. The requirement for fonts to
81+
remain under this license does not apply to any document created
82+
using the Font Software.
83+
84+
TERMINATION
85+
This license becomes null and void if any of the above conditions are
86+
not met.
87+
88+
DISCLAIMER
89+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
90+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
91+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
92+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
93+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
94+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
95+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
96+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
97+
OTHER DEALINGS IN THE FONT SOFTWARE.
Lines changed: 26 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,8 @@
1-
[gd_scene load_steps=14 format=3 uid="uid://d4a5xfmaulku1"]
1+
[gd_scene load_steps=3 format=3 uid="uid://d4a5xfmaulku1"]
22

33
[ext_resource type="Script" uid="uid://ckf2hfrig7e7o" path="res://Framework/Scenes/MenuUI/MainMenu/MainMenu.cs" id="1_cqe0w"]
44
[ext_resource type="Script" uid="uid://bi551lrt82awu" path="res://Framework/Scenes/MenuUI/MainMenu/MainMenuNav.cs" id="5_sc4as"]
55

6-
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_xl3hr"]
7-
8-
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_r34gr"]
9-
bg_color = Color(0, 0, 0, 0.470588)
10-
11-
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bkoao"]
12-
bg_color = Color(0, 0, 0, 0.219608)
13-
14-
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_y51uf"]
15-
content_margin_top = 10.0
16-
content_margin_bottom = 10.0
17-
bg_color = Color(0, 0, 0, 0.219608)
18-
19-
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_dnx8c"]
20-
21-
[sub_resource type="Theme" id="Theme_xn77g"]
22-
Button/styles/focus = SubResource("StyleBoxFlat_r34gr")
23-
Button/styles/hover = SubResource("StyleBoxFlat_bkoao")
24-
Button/styles/normal = SubResource("StyleBoxFlat_y51uf")
25-
Button/styles/pressed = SubResource("StyleBoxEmpty_dnx8c")
26-
27-
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_madu2"]
28-
bg_color = Color(0, 0, 0, 0.470588)
29-
30-
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_2rw86"]
31-
bg_color = Color(0, 0, 0, 0.219608)
32-
33-
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ctxq7"]
34-
content_margin_left = 10.0
35-
content_margin_top = 10.0
36-
content_margin_right = 10.0
37-
content_margin_bottom = 10.0
38-
bg_color = Color(0, 0, 0, 0.219608)
39-
40-
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_vbaxj"]
41-
42-
[sub_resource type="Theme" id="Theme_2jf5t"]
43-
Button/styles/focus = SubResource("StyleBoxFlat_madu2")
44-
Button/styles/hover = SubResource("StyleBoxFlat_2rw86")
45-
Button/styles/normal = SubResource("StyleBoxFlat_ctxq7")
46-
Button/styles/pressed = SubResource("StyleBoxEmpty_vbaxj")
47-
486
[node name="Main Menu" type="Control"]
497
layout_mode = 3
508
anchors_preset = 15
@@ -61,69 +19,68 @@ anchor_right = 1.0
6119
anchor_bottom = 1.0
6220
grow_horizontal = 2
6321
grow_vertical = 2
64-
theme_override_styles/panel = SubResource("StyleBoxEmpty_xl3hr")
65-
66-
[node name="CenterContainer" type="CenterContainer" parent="PanelContainer"]
67-
layout_mode = 2
6822

69-
[node name="Nav" type="VBoxContainer" parent="PanelContainer/CenterContainer"]
23+
[node name="Nav" type="VBoxContainer" parent="PanelContainer"]
7024
layout_mode = 2
71-
theme = SubResource("Theme_xn77g")
25+
size_flags_horizontal = 4
26+
size_flags_vertical = 4
27+
alignment = 1
7228
script = ExtResource("5_sc4as")
7329

74-
[node name="Play" type="Button" parent="PanelContainer/CenterContainer/Nav"]
75-
custom_minimum_size = Vector2(150, 0)
30+
[node name="Play" type="Button" parent="PanelContainer/Nav"]
31+
custom_minimum_size = Vector2(175, 60)
7632
layout_mode = 2
7733
text = "PLAY"
7834

79-
[node name="Mods" type="Button" parent="PanelContainer/CenterContainer/Nav"]
80-
custom_minimum_size = Vector2(150, 0)
35+
[node name="Mods" type="Button" parent="PanelContainer/Nav"]
36+
custom_minimum_size = Vector2(175, 60)
8137
layout_mode = 2
8238
text = "MODS"
8339

84-
[node name="Options" type="Button" parent="PanelContainer/CenterContainer/Nav"]
85-
custom_minimum_size = Vector2(150, 0)
40+
[node name="Options" type="Button" parent="PanelContainer/Nav"]
41+
custom_minimum_size = Vector2(175, 60)
8642
layout_mode = 2
8743
text = "OPTIONS"
8844

89-
[node name="Credits" type="Button" parent="PanelContainer/CenterContainer/Nav"]
45+
[node name="Credits" type="Button" parent="PanelContainer/Nav"]
46+
custom_minimum_size = Vector2(175, 60)
9047
layout_mode = 2
9148
text = "CREDITS"
9249

93-
[node name="Quit" type="Button" parent="PanelContainer/CenterContainer/Nav"]
94-
custom_minimum_size = Vector2(150, 0)
50+
[node name="Quit" type="Button" parent="PanelContainer/Nav"]
51+
custom_minimum_size = Vector2(175, 60)
9552
layout_mode = 2
9653
text = "QUIT"
9754

9855
[node name="Margin" type="MarginContainer" parent="PanelContainer"]
9956
layout_mode = 2
10057
size_flags_horizontal = 0
10158
size_flags_vertical = 8
102-
theme_override_constants/margin_left = 10
103-
theme_override_constants/margin_top = 10
104-
theme_override_constants/margin_right = 10
59+
theme_override_constants/margin_left = 20
10560
theme_override_constants/margin_bottom = 10
10661

10762
[node name="Socials" type="HBoxContainer" parent="PanelContainer/Margin"]
10863
layout_mode = 2
10964
size_flags_horizontal = 0
11065
size_flags_vertical = 8
111-
theme = SubResource("Theme_2jf5t")
66+
theme_override_constants/separation = 15
11267

11368
[node name="Discord" type="Button" parent="PanelContainer/Margin/Socials"]
69+
custom_minimum_size = Vector2(100, 40)
11470
layout_mode = 2
11571
size_flags_horizontal = 0
11672
size_flags_vertical = 0
11773
text = "Discord"
11874

11975
[node name="Github" type="Button" parent="PanelContainer/Margin/Socials"]
76+
custom_minimum_size = Vector2(100, 40)
12077
layout_mode = 2
12178
text = "GitHub"
12279

123-
[connection signal="pressed" from="PanelContainer/CenterContainer/Nav/Play" to="PanelContainer/CenterContainer/Nav" method="_OnPlayPressed"]
124-
[connection signal="pressed" from="PanelContainer/CenterContainer/Nav/Mods" to="PanelContainer/CenterContainer/Nav" method="_OnModsPressed"]
125-
[connection signal="pressed" from="PanelContainer/CenterContainer/Nav/Options" to="PanelContainer/CenterContainer/Nav" method="_OnOptionsPressed"]
126-
[connection signal="pressed" from="PanelContainer/CenterContainer/Nav/Credits" to="PanelContainer/CenterContainer/Nav" method="_OnCreditsPressed"]
127-
[connection signal="pressed" from="PanelContainer/CenterContainer/Nav/Quit" to="PanelContainer/CenterContainer/Nav" method="_OnQuitPressed"]
128-
[connection signal="pressed" from="PanelContainer/Margin/Socials/Discord" to="PanelContainer/CenterContainer/Nav" method="_OnDiscordPressed"]
129-
[connection signal="pressed" from="PanelContainer/Margin/Socials/Github" to="PanelContainer/CenterContainer/Nav" method="_OnGitHubPressed"]
80+
[connection signal="pressed" from="PanelContainer/Nav/Play" to="PanelContainer/Nav" method="_OnPlayPressed"]
81+
[connection signal="pressed" from="PanelContainer/Nav/Mods" to="PanelContainer/Nav" method="_OnModsPressed"]
82+
[connection signal="pressed" from="PanelContainer/Nav/Options" to="PanelContainer/Nav" method="_OnOptionsPressed"]
83+
[connection signal="pressed" from="PanelContainer/Nav/Credits" to="PanelContainer/Nav" method="_OnCreditsPressed"]
84+
[connection signal="pressed" from="PanelContainer/Nav/Quit" to="PanelContainer/Nav" method="_OnQuitPressed"]
85+
[connection signal="pressed" from="PanelContainer/Margin/Socials/Discord" to="PanelContainer/Nav" method="_OnDiscordPressed"]
86+
[connection signal="pressed" from="PanelContainer/Margin/Socials/Github" to="PanelContainer/Nav" method="_OnGitHubPressed"]

Framework/Scenes/Options/Options.cs

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -12,59 +12,4 @@ private void Init()
1212
{
1313

1414
}
15-
16-
public override void _Ready()
17-
{
18-
ThemeUtils.Adjust(this);
19-
}
20-
}
21-
22-
public class ThemeUtils
23-
{
24-
private static readonly StringName Button = "Button";
25-
26-
public static void Adjust(Node root)
27-
{
28-
root.TraverseNodes(OnTraverseNode);
29-
}
30-
31-
private static void OnTraverseNode(Node node)
32-
{
33-
if (node is not Control control)
34-
return;
35-
36-
Theme theme = control.Theme;
37-
38-
if (theme == null)
39-
return;
40-
41-
StyleBoxFlat normalStyleBox = GetNormalStyleBox(theme);
42-
43-
StyleBoxFlat hoverStyleBox = normalStyleBox.Duplicate() as StyleBoxFlat;
44-
hoverStyleBox.BgColor = normalStyleBox.BgColor + GrayColor(10);
45-
46-
StyleBoxFlat pressedStyleBox = hoverStyleBox.Duplicate() as StyleBoxFlat;
47-
pressedStyleBox.BgColor = hoverStyleBox.BgColor + GrayColor(10);
48-
49-
StyleBoxFlat focusStyleBox = normalStyleBox;
50-
51-
theme.SetStylebox("hover", Button, hoverStyleBox);
52-
theme.SetStylebox("pressed", Button, pressedStyleBox);
53-
theme.SetStylebox("focus", Button, focusStyleBox);
54-
}
55-
56-
private static Color GrayColor(byte saturation)
57-
{
58-
return Color.Color8(saturation, saturation, saturation);
59-
}
60-
61-
private static StyleBoxFlat GetNormalStyleBox(Theme theme)
62-
{
63-
if (theme.GetStylebox("normal", Button) is StyleBoxFlat styleBox)
64-
{
65-
return styleBox;
66-
}
67-
68-
return null;
69-
}
7015
}

0 commit comments

Comments
 (0)