1
Fork 0
mirror of https://github.com/Steffo99/nanogolf.git synced 2024-10-16 06:17:36 +00:00

Create main menu

This commit is contained in:
Steffo 2024-02-19 05:20:40 +01:00
parent c4176d0cef
commit 4ff4d8b689
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0
36 changed files with 893 additions and 2 deletions

1
.gitattributes vendored
View file

@ -1,3 +1,4 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf
*.wav filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text

View file

@ -5,3 +5,7 @@
- S: putt.wav by 170129 -- https://freesound.org/s/408260/ -- License: Creative Commons 0
- S: bonk.wav by el_boss -- https://freesound.org/s/628636/ -- License: Creative Commons 0
- S: hole.wav by inbeeld -- https://freesound.org/s/21878/ -- License: Creative Commons 0
## Fonts
- F: Outfit -- https://github.com/Outfitio/Outfit-Fonts -- License: SIL Open Font License Version 1.1

93
fonts/Outfit/OFL.txt Normal file
View file

@ -0,0 +1,93 @@
Copyright 2021 The Outfit Project Authors (https://github.com/Outfitio/Outfit-Fonts)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

View file

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:947f6b8fe5acfe6aec8a239ffee857292c3804e1daf1515b9a36bfec28bc9b8f
size 110572

View file

@ -0,0 +1,33 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://bex2vlls8xjhm"
path="res://.godot/imported/Outfit-VariableFont_wght.ttf-c0f21a18d1ce6fa9611b57569b1454c2.fontdata"
[deps]
source_file="res://fonts/Outfit/Outfit-VariableFont_wght.ttf"
dest_files=["res://.godot/imported/Outfit-VariableFont_wght.ttf-c0f21a18d1ce6fa9611b57569b1454c2.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=4.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

71
fonts/Outfit/README.txt Normal file
View file

@ -0,0 +1,71 @@
Outfit Variable Font
====================
This download contains Outfit as both a variable font and static fonts.
Outfit is a variable font with this axis:
wght
This means all the styles are contained in a single file:
Outfit-VariableFont_wght.ttf
If your app fully supports variable fonts, you can now pick intermediate styles
that arent available as static fonts. Not all apps support variable fonts, and
in those cases you can use the static font files for Outfit:
static/Outfit-Thin.ttf
static/Outfit-ExtraLight.ttf
static/Outfit-Light.ttf
static/Outfit-Regular.ttf
static/Outfit-Medium.ttf
static/Outfit-SemiBold.ttf
static/Outfit-Bold.ttf
static/Outfit-ExtraBold.ttf
static/Outfit-Black.ttf
Get started
-----------
1. Install the font files you want to use
2. Use your app's font picker to view the font family and all the
available styles
Learn more about variable fonts
-------------------------------
https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts
https://variablefonts.typenetwork.com
https://medium.com/variable-fonts
In desktop apps
https://theblog.adobe.com/can-variable-fonts-illustrator-cc
https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts
Online
https://developers.google.com/fonts/docs/getting_started
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide
https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts
Installing fonts
MacOS: https://support.apple.com/en-us/HT201749
Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux
Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows
Android Apps
https://developers.google.com/fonts/docs/android
https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts
License
-------
Please read the full license text (OFL.txt) to understand the permissions,
restrictions and requirements for usage, redistribution, and modification.
You can use them in your products & projects print or digital,
commercial or otherwise.
This isn't legal advice, please consider consulting a lawyer and see the full
license for all details.

View file

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3cabab9a353e7a1672a9a08ce83bcfa602a3a98afcf3c16c46543d4a08709b0d
size 55376

View file

@ -0,0 +1,33 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://kck1e60l5dy0"
path="res://.godot/imported/Outfit-Black.ttf-72fe65c3f7c414aef384f7dcfdd843c5.fontdata"
[deps]
source_file="res://fonts/Outfit/static/Outfit-Black.ttf"
dest_files=["res://.godot/imported/Outfit-Black.ttf-72fe65c3f7c414aef384f7dcfdd843c5.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=4.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View file

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3ee4507c6db480bf3eb8b0c9da5c0eb7e7ef671e90c5cce46e6cb73660888123
size 55396

View file

@ -0,0 +1,33 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://cexk8euui60oa"
path="res://.godot/imported/Outfit-Bold.ttf-387c049903bac208e7841aecb9d1d600.fontdata"
[deps]
source_file="res://fonts/Outfit/static/Outfit-Bold.ttf"
dest_files=["res://.godot/imported/Outfit-Bold.ttf-387c049903bac208e7841aecb9d1d600.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=4.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View file

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7f2a95dcb7c681d565ca99d41ff7299c9c9b80a3db510b6134d271b635937f9c
size 55312

View file

@ -0,0 +1,33 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://cll1u3fudt2ky"
path="res://.godot/imported/Outfit-ExtraBold.ttf-a461137ff0cb4dd45d9ce8ad5db46eda.fontdata"
[deps]
source_file="res://fonts/Outfit/static/Outfit-ExtraBold.ttf"
dest_files=["res://.godot/imported/Outfit-ExtraBold.ttf-a461137ff0cb4dd45d9ce8ad5db46eda.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=4.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View file

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:93ead84d1e9ce408cc1d5ca2182a0d5e2621be22b18b5bc746bf9d928e09327e
size 54940

View file

@ -0,0 +1,33 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://ltc2mcpskm1s"
path="res://.godot/imported/Outfit-ExtraLight.ttf-96dd3a681110404bd91ff56cc046fde9.fontdata"
[deps]
source_file="res://fonts/Outfit/static/Outfit-ExtraLight.ttf"
dest_files=["res://.godot/imported/Outfit-ExtraLight.ttf-96dd3a681110404bd91ff56cc046fde9.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=4.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View file

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9518ce3d124c8c55bead240b58ea2a8547938d462aea1751280a406abb814ee8
size 54860

View file

@ -0,0 +1,33 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://clios5m7w0bbx"
path="res://.godot/imported/Outfit-Light.ttf-7751dfdcf2398f08bbfac8c91f627a83.fontdata"
[deps]
source_file="res://fonts/Outfit/static/Outfit-Light.ttf"
dest_files=["res://.godot/imported/Outfit-Light.ttf-7751dfdcf2398f08bbfac8c91f627a83.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=4.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View file

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:33e6b2d44ab460848dacab2cdd092ca299b95acdc047ecea12888e28efeb42b9
size 54824

View file

@ -0,0 +1,33 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://21xixyexbx7q"
path="res://.godot/imported/Outfit-Medium.ttf-2420492654c5b92fcdeb460e0a61b77c.fontdata"
[deps]
source_file="res://fonts/Outfit/static/Outfit-Medium.ttf"
dest_files=["res://.godot/imported/Outfit-Medium.ttf-2420492654c5b92fcdeb460e0a61b77c.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=4.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View file

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7dd6d79759104665a9f260012f013aa0ac3d301e771d51e64352ed03e6eac30a
size 54916

View file

@ -0,0 +1,33 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://drgeagfhrwgv5"
path="res://.godot/imported/Outfit-Regular.ttf-1a569451af472914f7ad9c29e6ea0df9.fontdata"
[deps]
source_file="res://fonts/Outfit/static/Outfit-Regular.ttf"
dest_files=["res://.godot/imported/Outfit-Regular.ttf-1a569451af472914f7ad9c29e6ea0df9.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=4.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View file

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c67e289ee2d7e2ac02f3d6a1d81e9360409384840568d568d6f21cb93f92dda9
size 55496

View file

@ -0,0 +1,33 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://i41u084w8hct"
path="res://.godot/imported/Outfit-SemiBold.ttf-54bdb769a6c062d85c44352c48a5cdc3.fontdata"
[deps]
source_file="res://fonts/Outfit/static/Outfit-SemiBold.ttf"
dest_files=["res://.godot/imported/Outfit-SemiBold.ttf-54bdb769a6c062d85c44352c48a5cdc3.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=4.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View file

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:11847921646e9fdcf8945b36d36c17ae131c003e82a7f1215762e7322275b73f
size 54584

View file

@ -0,0 +1,33 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://hnb87ah6jbqe"
path="res://.godot/imported/Outfit-Thin.ttf-6820b15168a6588891e5655b59b03cc1.fontdata"
[deps]
source_file="res://fonts/Outfit/static/Outfit-Thin.ttf"
dest_files=["res://.godot/imported/Outfit-Thin.ttf-6820b15168a6588891e5655b59b03cc1.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=4.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View file

@ -11,7 +11,7 @@ config_version=5
[application]
config/name="Nanogolf"
run/main_scene="res://scenes/golf_level_2.tscn"
run/main_scene="res://scenes/main.tscn"
config/features=PackedStringArray("4.2", "Mobile")
config/icon="res://icon.svg"

View file

@ -1,7 +1,13 @@
[gd_scene load_steps=2 format=3 uid="uid://b8f5t76nfdu5h"]
[gd_scene load_steps=4 format=3 uid="uid://b8f5t76nfdu5h"]
[ext_resource type="PackedScene" uid="uid://dtwi2nyjbvr82" path="res://scenes/interface.tscn" id="1_bd856"]
[ext_resource type="Theme" uid="uid://mau3moiintkp" path="res://themes/nanogolf_theme.tres" id="2_oe7am"]
[ext_resource type="PackedScene" uid="uid://c3lhhndbdq67s" path="res://scenes/main_menu.tscn" id="3_3lx7u"]
[node name="Main" type="Node"]
[node name="Interface" parent="." instance=ExtResource("1_bd856")]
theme = ExtResource("2_oe7am")
[node name="MainMenu" parent="Interface" instance=ExtResource("3_3lx7u")]
layout_mode = 2

95
scenes/main_menu.gd Normal file
View file

@ -0,0 +1,95 @@
extends Control
class_name MainMenu
enum MenuStage {
NAME_INPUT = 1,
COLOR_PICKER = 2,
SERVER_MENU = 3,
}
var current_stage: MenuStage:
get:
return current_stage
set(value):
if value == current_stage:
return
match current_stage:
MenuStage.NAME_INPUT:
deinit_name_input()
MenuStage.COLOR_PICKER:
deinit_color_picker()
MenuStage.SERVER_MENU:
deinit_server_menu()
current_stage = value
match value:
MenuStage.NAME_INPUT:
init_name_input()
MenuStage.COLOR_PICKER:
init_color_picker()
MenuStage.SERVER_MENU:
init_server_menu()
@onready var panel_parent: Container = $"VBoxContainer"
var player_name: String = ""
const name_input_scene = preload("res://scenes/player_name_input.tscn")
var name_input_instance: PlayerNameInput = null
func init_name_input():
name_input_instance = name_input_scene.instantiate()
name_input_instance.name_confirmed.connect(_on_name_confirmed)
panel_parent.add_child(name_input_instance)
func deinit_name_input():
name_input_instance.name_confirmed.disconnect(_on_name_confirmed)
name_input_instance.queue_free()
func _on_name_confirmed(selected_name: String):
player_name = selected_name
current_stage = MenuStage.COLOR_PICKER
var player_color: Color = Color.WHITE
const color_picker_scene = preload("res://scenes/player_color_picker.tscn")
var color_picker_instance: PlayerColorPicker = null
func init_color_picker():
color_picker_instance = color_picker_scene.instantiate()
color_picker_instance.color_confirmed.connect(_on_color_confirmed)
panel_parent.add_child(color_picker_instance)
func deinit_color_picker():
color_picker_instance.color_confirmed.disconnect(_on_color_confirmed)
color_picker_instance.queue_free()
func _on_color_confirmed(selected_color: Color):
player_color = selected_color
current_stage = MenuStage.SERVER_MENU
const server_menu_scene = preload("res://scenes/server_options_menu.tscn")
var server_menu_instance: ServerOptionsMenu = null
func init_server_menu():
server_menu_instance = server_menu_scene.instantiate()
server_menu_instance.hosting_confirmed.connect(_on_hosting_confirmed)
server_menu_instance.connecting_confirmed.connect(_on_connecting_confirmed)
panel_parent.add_child(server_menu_instance)
func deinit_server_menu():
server_menu_instance.queue_free()
func _on_hosting_confirmed(port: int):
push_warning("TODO")
current_stage = MenuStage.NAME_INPUT
func _on_connecting_confirmed(address: String, port: int):
push_warning("TODO")
current_stage = MenuStage.NAME_INPUT
func _ready():
current_stage = MenuStage.NAME_INPUT

27
scenes/main_menu.tscn Normal file
View file

@ -0,0 +1,27 @@
[gd_scene load_steps=2 format=3 uid="uid://c3lhhndbdq67s"]
[ext_resource type="Script" path="res://scenes/main_menu.gd" id="1_6ex0u"]
[node name="MainMenu" type="Control"]
layout_mode = 3
anchors_preset = 0
script = ExtResource("1_6ex0u")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Title" type="RichTextLabel" parent="VBoxContainer"]
layout_mode = 2
bbcode_enabled = true
text = "[center][font_size=32px][b]Nanogolf[/b][/font_size]
Gioca a golf con gli amici![/center]"
fit_content = true
[node name="Padding" type="Control" parent="VBoxContainer"]
custom_minimum_size = Vector2(0, 16)
layout_mode = 2

View file

@ -0,0 +1,21 @@
extends PanelContainer
class_name PlayerColorPicker
signal color_confirmed(selected_color: Color)
var selected_color: Color = Color.WHITE:
get:
return selected_color
set(value):
selected_color = value
preview_texture.modulate = value
@onready var preview_texture: TextureRect = $"Layout/PreviewContainer/PreviewTexture"
func _on_color_picker_color_changed(color: Color):
selected_color = color
func _on_button_pressed():
color_confirmed.emit(selected_color)

View file

@ -0,0 +1,62 @@
[gd_scene load_steps=3 format=3 uid="uid://c4jict8rabxid"]
[ext_resource type="Script" path="res://scenes/player_color_picker.gd" id="1_eok0q"]
[ext_resource type="Texture2D" uid="uid://bxyy3bwt7a5l2" path="res://sprites/circle.svg" id="1_jbrnv"]
[node name="PlayerColorPicker" type="PanelContainer"]
script = ExtResource("1_eok0q")
[node name="Layout" type="VBoxContainer" parent="."]
layout_mode = 2
[node name="PaddingStart" type="Control" parent="Layout"]
custom_minimum_size = Vector2(0, 8)
layout_mode = 2
[node name="Title" type="RichTextLabel" parent="Layout"]
layout_mode = 2
bbcode_enabled = true
text = "[center][b]Personalizza la tua pallina[/b][/center]"
fit_content = true
[node name="ColorPicker" type="ColorPicker" parent="Layout"]
layout_mode = 2
picker_shape = 1
can_add_swatches = false
sampler_visible = false
color_modes_visible = false
sliders_visible = false
hex_visible = false
presets_visible = false
[node name="PreviewContainer" type="Control" parent="Layout"]
custom_minimum_size = Vector2(0, 16)
layout_mode = 2
[node name="PreviewTexture" type="TextureRect" parent="Layout/PreviewContainer"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -64.0
offset_top = -64.0
offset_right = 64.0
offset_bottom = 64.0
grow_horizontal = 2
grow_vertical = 2
scale = Vector2(0.125, 0.125)
pivot_offset = Vector2(64, 64)
texture = ExtResource("1_jbrnv")
[node name="PaddingEnd" type="Control" parent="Layout"]
custom_minimum_size = Vector2(0, 8)
layout_mode = 2
[node name="Button" type="Button" parent="Layout"]
layout_mode = 2
text = "Conferma"
[connection signal="color_changed" from="Layout/ColorPicker" to="." method="_on_color_picker_color_changed"]
[connection signal="pressed" from="Layout/Button" to="." method="_on_button_pressed"]

View file

@ -0,0 +1,26 @@
extends PanelContainer
class_name PlayerNameInput
signal name_confirmed(selected_name: String)
var selected_name: String = "":
get:
return selected_name
set(value):
selected_name = value
@onready var line_edit: LineEdit = $"Layout/LineEdit"
func _on_line_edit_text_changed(new_text: String):
selected_name = new_text
func _on_button_pressed():
name_confirmed.emit(selected_name)
func _on_line_edit_text_submitted(new_text: String):
selected_name = new_text
name_confirmed.emit(selected_name)

View file

@ -0,0 +1,32 @@
[gd_scene load_steps=2 format=3 uid="uid://dft2vgh1e3nwq"]
[ext_resource type="Script" path="res://scenes/player_name_input.gd" id="1_c0ws4"]
[node name="PlayerNameInput" type="PanelContainer"]
offset_right = 264.0
offset_bottom = 105.0
script = ExtResource("1_c0ws4")
[node name="Layout" type="VBoxContainer" parent="."]
layout_mode = 2
[node name="Title" type="RichTextLabel" parent="Layout"]
layout_mode = 2
bbcode_enabled = true
text = "[center][b]Inserisci il tuo nome[/b][/center]"
fit_content = true
[node name="LineEdit" type="LineEdit" parent="Layout"]
layout_mode = 2
placeholder_text = "Garasino Garasotti"
[node name="PaddingEnd" type="Control" parent="Layout"]
custom_minimum_size = Vector2(0, 8)
layout_mode = 2
[node name="Button" type="Button" parent="Layout"]
layout_mode = 2
text = "Conferma"
[connection signal="text_submitted" from="Layout/LineEdit" to="." method="_on_line_edit_text_submitted"]
[connection signal="pressed" from="Layout/Button" to="." method="_on_button_pressed"]

View file

@ -0,0 +1,27 @@
extends PanelContainer
class_name ServerOptionsMenu
@export var port: int = 27015
signal hosting_confirmed(port: int)
signal connecting_confirmed(address: String, port: int)
var selected_address: String = "":
get:
return selected_address
set(value):
selected_address = value
@onready var line_edit: LineEdit = $"Layout/LineEdit"
func _on_line_edit_text_changed(new_text):
selected_address = new_text
func _on_host_button_pressed():
hosting_confirmed.emit(port)
func _on_connect_button_pressed():
connecting_confirmed.emit(selected_address, port)

View file

@ -0,0 +1,46 @@
[gd_scene load_steps=2 format=3 uid="uid://45s3mrhd7rlr"]
[ext_resource type="Script" path="res://scenes/server_options_menu.gd" id="1_omevw"]
[node name="ServerOptionsMenu" type="PanelContainer"]
offset_right = 264.0
offset_bottom = 179.0
script = ExtResource("1_omevw")
[node name="Layout" type="VBoxContainer" parent="."]
layout_mode = 2
[node name="PaddingStart" type="Control" parent="Layout"]
custom_minimum_size = Vector2(0, 8)
layout_mode = 2
[node name="Title" type="RichTextLabel" parent="Layout"]
layout_mode = 2
bbcode_enabled = true
text = "[center][b]Connettiti ad altri giocatori[/b][/center]"
fit_content = true
[node name="PaddingMiddle1" type="Control" parent="Layout"]
custom_minimum_size = Vector2(0, 8)
layout_mode = 2
[node name="HostButton" type="Button" parent="Layout"]
layout_mode = 2
text = "Avvia server"
[node name="Label" type="Label" parent="Layout"]
layout_mode = 2
text = "oppure"
horizontal_alignment = 1
[node name="LineEdit" type="LineEdit" parent="Layout"]
layout_mode = 2
placeholder_text = "127.0.0.1"
[node name="ConnectButton" type="Button" parent="Layout"]
layout_mode = 2
text = "Connettiti al server"
[connection signal="pressed" from="Layout/HostButton" to="." method="_on_host_button_pressed"]
[connection signal="text_changed" from="Layout/LineEdit" to="." method="_on_line_edit_text_changed"]
[connection signal="pressed" from="Layout/ConnectButton" to="." method="_on_connect_button_pressed"]

View file

@ -0,0 +1,16 @@
[gd_resource type="Theme" load_steps=4 format=3 uid="uid://mau3moiintkp"]
[ext_resource type="FontFile" uid="uid://cexk8euui60oa" path="res://fonts/Outfit/static/Outfit-Bold.ttf" id="1_l20go"]
[ext_resource type="FontFile" uid="uid://clios5m7w0bbx" path="res://fonts/Outfit/static/Outfit-Light.ttf" id="2_8x3jc"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_xru3j"]
bg_color = Color(0.160784, 0.160784, 0.160784, 1)
[resource]
default_font = ExtResource("2_8x3jc")
Button/styles/normal = SubResource("StyleBoxFlat_xru3j")
MarginContainer/constants/margin_bottom = 8
MarginContainer/constants/margin_left = 8
MarginContainer/constants/margin_right = 8
MarginContainer/constants/margin_top = 8
RichTextLabel/fonts/bold_font = ExtResource("1_l20go")

View file

@ -0,0 +1,4 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://dkxdxar01m42"]
[resource]
bg_color = Color(0.160784, 0.160784, 0.160784, 1)