Skip to content

Commit

Permalink
Improve main menu's look'n'feel, #65
Browse files Browse the repository at this point in the history
  • Loading branch information
Scony committed Dec 27, 2023
1 parent df68c87 commit f8211c2
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 24 deletions.
9 changes: 9 additions & 0 deletions assets/translations/main_menu.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
keys,en,pl
PLAY,Play,Gra
OPTIONS,Options,Opcje
CREDITS,Credits,Twórcy
QUIT,Quit,Wyjście
BACK,Back,Wstecz
CORE_CONTRIBUTORS,Core contributors,Kluczowi współtwórcy
ASSETS,Assets,Treści multimedialne
START,Start,Rozpocznij
17 changes: 17 additions & 0 deletions assets/translations/main_menu.csv.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[remap]

importer="csv_translation"
type="Translation"
uid="uid://dysxs8mlbjhl8"

[deps]

files=["res://assets/translations/main_menu.en.translation", "res://assets/translations/main_menu.pl.translation"]

source_file="res://assets/translations/main_menu.csv"
dest_files=["res://assets/translations/main_menu.en.translation", "res://assets/translations/main_menu.pl.translation"]

[params]

compress=true
delimiter=0
2 changes: 1 addition & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ shift_selecting={

[internationalization]

locale/translations=PackedStringArray("res://assets/translations/match.en.translation", "res://assets/translations/match.pl.translation")
locale/translations=PackedStringArray("res://assets/translations/match.en.translation", "res://assets/translations/match.pl.translation", "res://assets/translations/main_menu.en.translation", "res://assets/translations/main_menu.pl.translation")

[layer_names]

Expand Down
11 changes: 11 additions & 0 deletions source/main-menu/Credits.gd
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
extends Control

@onready var _rich_text_label = find_child("RichTextLabel")


func _ready():
_rich_text_label.text = (
_rich_text_label
. text
. replace("CORE_CONTRIBUTORS", tr("CORE_CONTRIBUTORS"))
. replace("ASSETS", tr("ASSETS"))
)


func _on_back_button_pressed():
get_tree().change_scene_to_file("res://source/main-menu/Main.tscn")
13 changes: 7 additions & 6 deletions source/main-menu/Credits.tscn
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[gd_scene load_steps=3 format=3 uid="uid://ds57esabi07np"]
[gd_scene load_steps=4 format=3 uid="uid://ds57esabi07np"]

[ext_resource type="Theme" uid="uid://c2kgsk4ffhbwo" path="res://source/resources/main_menu.theme" id="1_7ubwb"]
[ext_resource type="Script" path="res://source/main-menu/Credits.gd" id="1_33n17"]
[ext_resource type="PackedScene" uid="uid://dij5xr8swlfdx" path="res://source/main-menu/Background.tscn" id="2_txygx"]

Expand All @@ -10,6 +11,7 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_7ubwb")
script = ExtResource("1_33n17")

[node name="Background" parent="." instance=ExtResource("2_txygx")]
Expand Down Expand Up @@ -47,11 +49,12 @@ size_flags_vertical = 3

[node name="RichTextLabel" type="RichTextLabel" parent="MarginContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/normal_font_size = 20
bbcode_enabled = true
text = "[center][u]Core contributors:[/u]
text = "[center][u]CORE_CONTRIBUTORS:[/u]
- Pawel Lampe (Scony) | Lampe Games
[u]Assets:[/u]
[u]ASSETS:[/u]
- 3D Space Kit by Kenney.nl"
fit_content = true

Expand All @@ -61,9 +64,7 @@ size_flags_vertical = 3

[node name="Button" type="Button" parent="MarginContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
focus_mode = 0
text = "Back
"
text = "BACK"

[node name="Panel" type="Panel" parent="MarginContainer"]
show_behind_parent = true
Expand Down
16 changes: 7 additions & 9 deletions source/main-menu/Main.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[gd_scene load_steps=3 format=3 uid="uid://ctyd01bv020i8"]
[gd_scene load_steps=4 format=3 uid="uid://ctyd01bv020i8"]

[ext_resource type="Script" path="res://source/main-menu/Main.gd" id="1_2uj2d"]
[ext_resource type="Theme" uid="uid://c2kgsk4ffhbwo" path="res://source/resources/main_menu.theme" id="1_sc713"]
[ext_resource type="PackedScene" uid="uid://dij5xr8swlfdx" path="res://source/main-menu/Background.tscn" id="2_depxw"]

[node name="Main" type="Control"]
Expand All @@ -10,6 +11,7 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_sc713")
script = ExtResource("1_2uj2d")

[node name="Background" parent="." instance=ExtResource("2_depxw")]
Expand Down Expand Up @@ -44,23 +46,19 @@ alignment = 1

[node name="Button" type="Button" parent="MarginContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
focus_mode = 0
text = "Play"
text = "PLAY"

[node name="Button2" type="Button" parent="MarginContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
focus_mode = 0
text = "Options"
text = "OPTIONS"

[node name="Button3" type="Button" parent="MarginContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
focus_mode = 0
text = "Credits"
text = "CREDITS"

[node name="Button4" type="Button" parent="MarginContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
focus_mode = 0
text = "Quit"
text = "QUIT"

[node name="Panel" type="Panel" parent="MarginContainer"]
show_behind_parent = true
Expand Down
8 changes: 5 additions & 3 deletions source/main-menu/Options.tscn
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[gd_scene load_steps=3 format=3 uid="uid://bawu5eau3t4ek"]
[gd_scene load_steps=4 format=3 uid="uid://bawu5eau3t4ek"]

[ext_resource type="Theme" uid="uid://c2kgsk4ffhbwo" path="res://source/resources/main_menu.theme" id="1_a5uwh"]
[ext_resource type="Script" path="res://source/main-menu/Options.gd" id="1_msrcd"]
[ext_resource type="PackedScene" uid="uid://dij5xr8swlfdx" path="res://source/main-menu/Background.tscn" id="2_mgrkx"]

Expand Down Expand Up @@ -80,13 +81,14 @@ text = "Mouse movement restricted to the game window"

[node name="Button" type="Button" parent="MarginContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
focus_mode = 0
text = "Back"
theme = ExtResource("1_a5uwh")
text = "BACK"

[node name="Panel" type="Panel" parent="MarginContainer"]
show_behind_parent = true
layout_mode = 2
mouse_filter = 2
theme = ExtResource("1_a5uwh")

[connection signal="item_selected" from="MarginContainer/MarginContainer/VBoxContainer/PanelContainer/VBoxContainer/Screen" to="." method="_on_screen_item_selected"]
[connection signal="pressed" from="MarginContainer/MarginContainer/VBoxContainer/PanelContainer2/VBoxContainer/MouseMovementRestricted" to="." method="_on_mouse_movement_restricted_pressed"]
Expand Down
11 changes: 6 additions & 5 deletions source/main-menu/Play.tscn
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[gd_scene load_steps=3 format=3 uid="uid://baeshrvg30aer"]
[gd_scene load_steps=4 format=3 uid="uid://baeshrvg30aer"]

[ext_resource type="Script" path="res://source/main-menu/Play.gd" id="1_o62d3"]
[ext_resource type="PackedScene" uid="uid://dij5xr8swlfdx" path="res://source/main-menu/Background.tscn" id="2_xtk15"]
[ext_resource type="Theme" uid="uid://c2kgsk4ffhbwo" path="res://source/resources/main_menu.theme" id="3_qwd67"]

[node name="Play" type="Control"]
layout_mode = 3
Expand Down Expand Up @@ -400,22 +401,22 @@ popup/item_2/id = 2

[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
theme = ExtResource("3_qwd67")
theme_override_constants/separation = 4

[node name="StartButton" type="Button" parent="MarginContainer/MarginContainer/VBoxContainer/VBoxContainer"]
layout_mode = 2
focus_mode = 0
text = "Start"
text = "START"

[node name="BackButton" type="Button" parent="MarginContainer/MarginContainer/VBoxContainer/VBoxContainer"]
layout_mode = 2
focus_mode = 0
text = "Back"
text = "BACK"

[node name="Panel" type="Panel" parent="MarginContainer"]
show_behind_parent = true
layout_mode = 2
mouse_filter = 2
theme = ExtResource("3_qwd67")

[connection signal="item_selected" from="MarginContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer2/HBoxContainer/MapList" to="." method="_on_map_list_item_selected"]
[connection signal="pressed" from="MarginContainer/MarginContainer/VBoxContainer/VBoxContainer/StartButton" to="." method="_on_start_button_pressed"]
Expand Down
Binary file added source/resources/main_menu.theme
Binary file not shown.

0 comments on commit f8211c2

Please sign in to comment.