added main menu

when you quit the game, it basically crashes and the audio lags for now.
changable audio is still not fixed, the child spatial_audio3d still plays too loud.
This commit is contained in:
Balogh Krisztián 2026-08-16 22:38:23 +02:00
parent c1a22d43a9
commit 18d9a149a3
22 changed files with 15420 additions and 7 deletions

14989
@icons picker.html Normal file

File diff suppressed because it is too large Load diff

Binary file not shown.

View file

@ -0,0 +1,36 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://ddnuq5h5loicn"
path="res://.godot/imported/BebasNeue-Regular.ttf-7a75156d35bda4b35a4dba5fd3b7b0ab.fontdata"
[deps]
source_file="res://assets/fonts/BebasNeue-Regular.ttf"
dest_files=["res://.godot/imported/BebasNeue-Regular.ttf-7a75156d35bda4b35a4dba5fd3b7b0ab.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
modulate_color_glyphs=false
hinting=3
subpixel_positioning=4
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View file

@ -6,7 +6,7 @@ var is_playing: bool = false
func toggle():
is_playing = !is_playing
%SpatialAudio3D.do_play(3.5)
audio_player.do_play(3.5)
# Called when the node enters the scene tree for the first time.
func _ready() -> void:

View file

@ -15,7 +15,7 @@ general/updates_per_second=100
[application]
config/name="breadwinner"
run/main_scene="uid://chykk2a3opu0d"
run/main_scene="uid://cerpwmavwn8t"
config/features=PackedStringArray("4.7", "Forward Plus")
config/icon="res://icon.svg"
@ -59,9 +59,9 @@ folder_colors={
"res://classes/": "pink",
"res://concept/": "purple",
"res://maps/": "orange",
"res://resources/shaders/": "pink",
"res://scenes/": "blue",
"res://scripts/": "gray",
"res://shaders/": "pink"
"res://scripts/": "gray"
}
[filesystem]

View file

@ -0,0 +1,43 @@
[gd_resource type="Theme" format=3 uid="uid://bspxrgwuidr02"]
[ext_resource type="FontFile" uid="uid://ddnuq5h5loicn" path="res://assets/fonts/BebasNeue-Regular.ttf" id="1_wj4bu"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8sp8n"]
bg_color = Color(0.25490198, 0.25490198, 0.25490198, 0.3019608)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_m25cb"]
bg_color = Color(0.29411766, 0.29411766, 0.29411766, 0.49803922)
border_width_left = 5
border_width_top = 5
border_width_right = 5
border_width_bottom = 5
border_color = Color(1, 1, 1, 1)
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
[resource]
default_base_scale = 0.52
default_font = ExtResource("1_wj4bu")
Button/colors/font_color = Color(0.7792914, 0.7792914, 0.7792913, 1)
Button/colors/font_disabled_color = Color(0.46160597, 0.44038838, 0.44974285, 1)
Button/colors/font_focus_color = Color(0.30068555, 0.45265424, 0.73330176, 1)
Button/colors/font_hover_color = Color(1, 1, 1, 1)
Button/colors/font_hover_pressed_color = Color(0.97210664, 0.96787745, 0.96980983, 1)
Button/colors/font_outline_color = Color(0.7946597, 0, 0.26732337, 1)
Button/colors/font_pressed_color = Color(0.9287819, 0.80930334, 7.70092e-07, 1)
Button/colors/icon_normal_color = Color(0, 0, 0, 1)
Button/colors/icon_pressed_color = Color(0, 0, 0, 1)
Button/constants/align_to_largest_stylebox = 0
Button/constants/h_separation = 0
Button/constants/icon_max_width = 0
Button/constants/outline_size = 0
Button/font_sizes/font_size = 32
Button/fonts/font = ExtResource("1_wj4bu")
Button/styles/disabled = SubResource("StyleBoxFlat_8sp8n")
Button/styles/focus = SubResource("StyleBoxFlat_m25cb")
Button/styles/hover = SubResource("StyleBoxFlat_m25cb")
Button/styles/normal = null
Button/styles/pressed = null
Label/font_sizes/font_size = 32

View file

@ -0,0 +1,30 @@
extends Node3D
@onready var camera_3d: Camera3D = %Camera3D
var _camera_original_position: Vector3 = Vector3(0,0,1)
var _camera_original_rotation: Vector3 = Vector3.ZERO
func _ready() -> void:
# Release the mouse so the player can actually click things!
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
UiManager.hide()
%AnimationPlayer.play("camera_init")
func _process(delta: float) -> void:
move_camera_based_on_mouse(delta)
func move_camera_based_on_mouse(delta:float):
var mouse_pos: Vector2 = get_viewport().get_mouse_position()
var mouse_pos_normalized: Vector2 = mouse_pos - Vector2(get_viewport().get_window().size / 2)
var coord_normalizer: int = 5000
var delta_multiplier: int = 4
camera_3d.global_position.x = lerpf(camera_3d.global_position.x, _camera_original_position.x + mouse_pos_normalized.x / coord_normalizer, delta * delta_multiplier)
camera_3d.global_position.y = lerpf(camera_3d.global_position.y, _camera_original_position.y + mouse_pos_normalized.y / coord_normalizer, delta * delta_multiplier)
camera_3d.global_rotation.x = lerpf(camera_3d.global_rotation.x, _camera_original_rotation.x - mouse_pos_normalized.y / coord_normalizer, delta * delta_multiplier)
camera_3d.global_rotation.y = lerpf(camera_3d.global_rotation.y, _camera_original_rotation.y + mouse_pos_normalized.x / coord_normalizer, delta * delta_multiplier)

View file

@ -0,0 +1 @@
uid://cea0w27fp86up

View file

@ -0,0 +1,175 @@
[gd_scene format=3 uid="uid://cerpwmavwn8t"]
[ext_resource type="PackedScene" uid="uid://ct68sibtqnwd3" path="res://scenes/main_menu/main_menu_control.tscn" id="1_fsom3"]
[ext_resource type="Script" uid="uid://cea0w27fp86up" path="res://scenes/main_menu/main_menu.gd" id="1_ob46e"]
[ext_resource type="Script" uid="uid://dvbvagj78x0yf" path="res://scenes/main_menu/main_menu_mouse_handler.gd" id="2_0ebjn"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_57qmd"]
resource_local_to_scene = true
transparency = 1
shading_mode = 0
[sub_resource type="QuadMesh" id="QuadMesh_yf5fn"]
material = SubResource("StandardMaterial3D_57qmd")
size = Vector2(1.98, 1.08)
[sub_resource type="BoxShape3D" id="BoxShape3D_g4v7s"]
size = Vector3(1.98, 1.08, 0.05)
[sub_resource type="Animation" id="Animation_ob46e"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Camera3D:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0, 0, 0.99325275)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Camera3D:rotation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0, 0, 0)]
}
[sub_resource type="Animation" id="Animation_uqeha"]
resource_name = "camera_init"
length = 4.0
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Camera3D:position")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 4),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(6.7138443, 6.143976, 10.5700865), Vector3(0, 0, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Camera3D:rotation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 4),
"transitions": PackedFloat32Array(0.25000003, 1),
"update": 0,
"values": [Vector3(0, -0.73129296, 0), Vector3(0, 0, 0)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_wem23"]
_data = {
&"RESET": SubResource("Animation_ob46e"),
&"camera_init": SubResource("Animation_uqeha")
}
[sub_resource type="CapsuleMesh" id="CapsuleMesh_g4v7s"]
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_5seab"]
emission_shape_scale = Vector3(0, 0, 0)
use_rotation_3d = true
rotation_3d_min = Vector3(0, 0, 0)
rotation_3d_max = Vector3(100, 100, 100)
direction = Vector3(0, 1, 0)
spread = 18.426
flatness = 0.132
initial_velocity_min = 3.0
initial_velocity_max = 5.0
collision_mode = 1
collision_friction = 0.07
collision_bounce = 0.59
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_lqpn7"]
transparency = 1
shading_mode = 0
vertex_color_use_as_albedo = true
albedo_color = Color(0.09411765, 1, 1, 0.03529412)
heightmap_scale = 6.931
use_particle_trails = true
[sub_resource type="RibbonTrailMesh" id="RibbonTrailMesh_x2yjq"]
material = SubResource("StandardMaterial3D_lqpn7")
shape = 0
size = 0.1
sections = 12
section_length = 0.25
section_segments = 9
[sub_resource type="SphereMesh" id="SphereMesh_wem23"]
radius = 0.1
[node name="MainMenu" type="Node3D" unique_id=454586948]
script = ExtResource("1_ob46e")
[node name="Camera3D" type="Camera3D" parent="." unique_id=1477430730]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.99325275)
[node name="SubViewport" type="SubViewport" parent="." unique_id=1582925996]
unique_name_in_owner = true
transparent_bg = true
size = Vector2i(1980, 1080)
render_target_update_mode = 4
[node name="MainMenuControl" parent="SubViewport" unique_id=2137273835 instance=ExtResource("1_fsom3")]
[node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=1931956085]
unique_name_in_owner = true
mesh = SubResource("QuadMesh_yf5fn")
[node name="Area3D" type="Area3D" parent="MeshInstance3D" unique_id=436478413]
script = ExtResource("2_0ebjn")
[node name="CollisionShape3D" type="CollisionShape3D" parent="MeshInstance3D/Area3D" unique_id=1005681851]
shape = SubResource("BoxShape3D_g4v7s")
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=612949283]
unique_name_in_owner = true
libraries/ = SubResource("AnimationLibrary_wem23")
[node name="MeshInstance3D2" type="MeshInstance3D" parent="." unique_id=1337984741]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.2160761, 0, -2.1227782)
mesh = SubResource("CapsuleMesh_g4v7s")
[node name="OmniLight3D" type="OmniLight3D" parent="." unique_id=189094810]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.1375935, 0, -1.2356517)
[node name="GPUParticles3D" type="GPUParticles3D" parent="." unique_id=1347856107]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.2707429, 1.2013705, -1.9347405)
amount = 80
trail_enabled = true
trail_lifetime = 0.09999999999999999
process_material = SubResource("ParticleProcessMaterial_5seab")
draw_pass_1 = SubResource("RibbonTrailMesh_x2yjq")
[node name="GPUParticles3D2" type="GPUParticles3D" parent="." unique_id=558535751]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.2707429, 3.9486427, -1.9347405)
amount = 30
lifetime = 3.0
speed_scale = 0.8
collision_base_size = 0.1
trail_lifetime = 0.09999999999999999
process_material = SubResource("ParticleProcessMaterial_5seab")
draw_pass_1 = SubResource("SphereMesh_wem23")
[node name="GPUParticlesCollisionBox3D" type="GPUParticlesCollisionBox3D" parent="." unique_id=555535896]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.1805031, 0, -2.144844)
size = Vector3(1, 2, 1)
[node name="GPUParticlesCollisionBox3D2" type="GPUParticlesCollisionBox3D" parent="." unique_id=1483809096]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.30909133, -2.777721, -2.942525)
size = Vector3(14.569946, 3.4902344, 11.707855)

View file

@ -0,0 +1,27 @@
extends Control
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_button_pressed() -> void:
UiManager.toggle_self()
get_tree().change_scene_to_file("res://maps/procedural_map_parts_ver_premade/map_generator.tscn")
func _on_button_2_pressed() -> void:
UiManager.toggle_self()
get_tree().change_scene_to_file("res://maps/dev/dev_map.tscn")
func _on_button_3_pressed() -> void:
print("options")
func _on_button_4_pressed() -> void:
print("exit")
get_tree().quit()

View file

@ -0,0 +1 @@
uid://cpn3afv0mkf3s

View file

@ -0,0 +1,65 @@
[gd_scene format=3 uid="uid://ct68sibtqnwd3"]
[ext_resource type="Script" uid="uid://cpn3afv0mkf3s" path="res://scenes/main_menu/main_menu_control.gd" id="1_yt8vf"]
[ext_resource type="Theme" uid="uid://bspxrgwuidr02" path="res://resources/styles/menu_theme.tres" id="2_bglv6"]
[node name="MainMenuControl" type="Control" unique_id=2137273835]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_yt8vf")
[node name="VBoxContainer2" type="VBoxContainer" parent="." unique_id=16888608]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.2
anchor_top = 0.2
anchor_right = 0.8
anchor_bottom = 0.8
grow_horizontal = 2
grow_vertical = 2
[node name="Label" type="Label" parent="VBoxContainer2" unique_id=1010287729]
layout_mode = 2
size_flags_vertical = 6
theme = ExtResource("2_bglv6")
theme_override_font_sizes/font_size = 128
text = "BREADWINNER"
horizontal_alignment = 1
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer2" unique_id=477444179]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 3
[node name="Button" type="Button" parent="VBoxContainer2/VBoxContainer" unique_id=1811326054]
unique_name_in_owner = true
layout_mode = 2
theme = ExtResource("2_bglv6")
text = "Start random gen"
[node name="Button2" type="Button" parent="VBoxContainer2/VBoxContainer" unique_id=2118140035]
unique_name_in_owner = true
layout_mode = 2
theme = ExtResource("2_bglv6")
text = "Start dev"
[node name="Button3" type="Button" parent="VBoxContainer2/VBoxContainer" unique_id=331418230]
unique_name_in_owner = true
layout_mode = 2
theme = ExtResource("2_bglv6")
text = "Options"
[node name="Button4" type="Button" parent="VBoxContainer2/VBoxContainer" unique_id=1238756529]
unique_name_in_owner = true
layout_mode = 2
theme = ExtResource("2_bglv6")
text = "Exit"
[connection signal="pressed" from="VBoxContainer2/VBoxContainer/Button" to="." method="_on_button_pressed"]
[connection signal="pressed" from="VBoxContainer2/VBoxContainer/Button2" to="." method="_on_button_2_pressed"]
[connection signal="pressed" from="VBoxContainer2/VBoxContainer/Button3" to="." method="_on_button_3_pressed"]
[connection signal="pressed" from="VBoxContainer2/VBoxContainer/Button4" to="." method="_on_button_4_pressed"]

View file

@ -0,0 +1,41 @@
extends Area3D
@onready var viewport: SubViewport = %SubViewport
@onready var screen_mesh: MeshInstance3D = %MeshInstance3D
func _ready() -> void:
# 1. Wait exactly one frame to guarantee the SubViewport is fully loaded and rendering
await get_tree().process_frame
# 2. Get the material you put on your ScreenMesh
var mat = screen_mesh.get_active_material(0)
# 3. Manually pipe the live video feed from the viewport directly into the material!
if mat:
mat.albedo_texture = viewport.get_texture()
func _exit_tree() -> void:
pass
func _input_event(_camera: Camera3D, event: InputEvent, event_position: Vector3, _normal: Vector3, _shape_idx: int) -> void:
if not (event is InputEventMouse or event is InputEventScreenTouch):
return
# 1. CRITICAL FIX: Duplicate the event so we don't corrupt Godot's internal input state
var custom_event = event.duplicate()
var local_pos = screen_mesh.to_local(event_position)
var quad_size = screen_mesh.mesh.size
var percent_x = (local_pos.x / quad_size.x) + 0.5
var percent_y = 0.5 - (local_pos.y / quad_size.y)
var viewport_size = viewport.size
var final_2d_pos = Vector2(percent_x * viewport_size.x, percent_y * viewport_size.y)
custom_event.position = final_2d_pos
if custom_event is InputEventMouse:
custom_event.global_position = final_2d_pos
# 2. Push the duplicated, modified event to the viewport
viewport.push_input(custom_event)

View file

@ -0,0 +1 @@
uid://dvbvagj78x0yf

View file

@ -5,7 +5,8 @@ func toggle_menu():
visible = !visible
func _on_exit_pressed() -> void:
get_tree().quit()
get_tree().change_scene_to_file("res://scenes/main_menu/main_menu.tscn")
visible = false
func _on_options_pressed() -> void:
%Selections.visible = false

View file

@ -1,7 +1,7 @@
[gd_scene format=3 uid="uid://b6uty5ygh5202"]
[ext_resource type="Script" uid="uid://c4xrcopqmqc1u" path="res://scenes/ui/inventory/inventory_menu.gd" id="1_05ake"]
[ext_resource type="Shader" uid="uid://dfocpicc6jowx" path="res://shaders/optimized_blur.gdshader" id="1_igkbf"]
[ext_resource type="Shader" uid="uid://dfocpicc6jowx" path="res://resources/shaders/optimized_blur.gdshader" id="1_igkbf"]
[ext_resource type="PackedScene" uid="uid://bfg4q1t8s06vv" path="res://scenes/ui/optimized_blur_panel.tscn" id="2_btuyx"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_b5l5s"]

View file

@ -1,6 +1,6 @@
[gd_scene format=3 uid="uid://bfg4q1t8s06vv"]
[ext_resource type="Shader" uid="uid://dfocpicc6jowx" path="res://shaders/optimized_blur.gdshader" id="1_fuoj5"]
[ext_resource type="Shader" uid="uid://dfocpicc6jowx" path="res://resources/shaders/optimized_blur.gdshader" id="1_fuoj5"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_3ikdx"]
shader = ExtResource("1_fuoj5")

View file

@ -4,6 +4,9 @@ extends Control
@onready var debug_menu: Control = %DebugMenu
@onready var inventory_menu: Control = %InventoryMenu
func toggle_self():
visible = !visible
func toggle_debug_menu():
debug_menu.visible = !debug_menu.visible