diff --git a/Manager.gd b/Manager.gd index 40b0edf..901147e 100644 --- a/Manager.gd +++ b/Manager.gd @@ -28,10 +28,11 @@ var planet_names = [ # --- START --- func _ready(): - print("test sss") randomize() _initialize_sectors() print("[Manager] Initialized with %d sectors" % SECTOR_COUNT) + TranslationServer.set_locale(Settings.LANGUAGE) # wersja jezykowa + Input.set_custom_mouse_cursor(load(Settings.CURSOR)) func _process(delta): update_timer += delta diff --git a/assets/icons/buttons/button_blue.png b/assets/icons/buttons/button_blue.png index 8642ec7..0811dc6 100644 Binary files a/assets/icons/buttons/button_blue.png and b/assets/icons/buttons/button_blue.png differ diff --git a/assets/icons/buttons/button_red.png b/assets/icons/buttons/button_red.png index 06e175b..feaebee 100644 Binary files a/assets/icons/buttons/button_red.png and b/assets/icons/buttons/button_red.png differ diff --git a/assets/icons/cursors/cursor.png b/assets/icons/cursors/cursor.png new file mode 100644 index 0000000..f009a68 Binary files /dev/null and b/assets/icons/cursors/cursor.png differ diff --git a/assets/icons/cursors/cursor.png.import b/assets/icons/cursors/cursor.png.import new file mode 100644 index 0000000..4bcfdff --- /dev/null +++ b/assets/icons/cursors/cursor.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cy2skrncnaxwt" +path="res://.godot/imported/cursor.png-b3bdeeb566716971b57c0a346dfaa7ac.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/cursors/cursor.png" +dest_files=["res://.godot/imported/cursor.png-b3bdeeb566716971b57c0a346dfaa7ac.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/localization/translation.csv b/localization/translation.csv new file mode 100644 index 0000000..6ac8fc3 --- /dev/null +++ b/localization/translation.csv @@ -0,0 +1,5 @@ +key,pl,en,de +menu_start,Start,Start,Starten +menu_options,Opcje,Options,Einstellungen +menu_exit,Zamknij,Exit,Beenden +language,Język,Language,Sprache diff --git a/localization/translation.csv.import b/localization/translation.csv.import new file mode 100644 index 0000000..f8e2f60 --- /dev/null +++ b/localization/translation.csv.import @@ -0,0 +1,17 @@ +[remap] + +importer="csv_translation" +type="Translation" +uid="uid://0ien22wevy7d" + +[deps] + +files=["res://localization/translation.pl.translation", "res://localization/translation.en.translation", "res://localization/translation.de.translation"] + +source_file="res://localization/translation.csv" +dest_files=["res://localization/translation.pl.translation", "res://localization/translation.en.translation", "res://localization/translation.de.translation"] + +[params] + +compress=true +delimiter=0 diff --git a/localization/translation.de.translation b/localization/translation.de.translation new file mode 100644 index 0000000..2f5ca9b Binary files /dev/null and b/localization/translation.de.translation differ diff --git a/localization/translation.en.translation b/localization/translation.en.translation new file mode 100644 index 0000000..5dd33e5 Binary files /dev/null and b/localization/translation.en.translation differ diff --git a/localization/translation.pl.translation b/localization/translation.pl.translation new file mode 100644 index 0000000..0e63dd7 Binary files /dev/null and b/localization/translation.pl.translation differ diff --git a/project.godot b/project.godot index b8e1a08..eb4a1ec 100644 --- a/project.godot +++ b/project.godot @@ -27,3 +27,7 @@ MusicManager="*res://music_manager.gd" window/size/mode=2 window/stretch/mode="canvas_items" window/stretch/aspect="ignore" + +[internationalization] + +locale/translations=PackedStringArray("res://localization/translation.de.translation", "res://localization/translation.en.translation", "res://localization/translation.pl.translation") diff --git a/scenes/menu.tscn b/scenes/menu.tscn index 27fc7c1..5bb0e96 100644 --- a/scenes/menu.tscn +++ b/scenes/menu.tscn @@ -10,6 +10,21 @@ [ext_resource type="FontFile" uid="uid://bytgiothu0eoy" path="res://assets/fonts/Chopsic.otf" id="5_13sgg"] [ext_resource type="Texture2D" uid="uid://cm376wgq8l0n4" path="res://assets/stars/small_star.png" id="7_i6lef"] +[sub_resource type="Animation" id="Animation_mj5lg"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:modulate") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 1, 1, 0.5058824)] +} + [sub_resource type="Animation" id="Animation_70i5f"] resource_name = "blink" loop_mode = 2 @@ -26,7 +41,13 @@ tracks/0/keys = { "values": [Color(1, 1, 1, 0.5058824), Color(1, 1, 1, 1), Color(1, 1, 1, 0.5058824)] } -[sub_resource type="Animation" id="Animation_mj5lg"] +[sub_resource type="AnimationLibrary" id="AnimationLibrary_ufwb2"] +_data = { +&"RESET": SubResource("Animation_mj5lg"), +&"blink": SubResource("Animation_70i5f") +} + +[sub_resource type="Animation" id="Animation_i6lef"] length = 0.001 tracks/0/type = "value" tracks/0/imported = false @@ -38,13 +59,7 @@ tracks/0/keys = { "times": PackedFloat32Array(0), "transitions": PackedFloat32Array(1), "update": 0, -"values": [Color(1, 1, 1, 0.5058824)] -} - -[sub_resource type="AnimationLibrary" id="AnimationLibrary_ufwb2"] -_data = { -&"RESET": SubResource("Animation_mj5lg"), -&"blink": SubResource("Animation_70i5f") +"values": [Color(1, 1, 1, 0)] } [sub_resource type="Animation" id="Animation_13sgg"] @@ -63,21 +78,6 @@ tracks/0/keys = { "values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)] } -[sub_resource type="Animation" id="Animation_i6lef"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath(".:modulate") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [Color(1, 1, 1, 0)] -} - [sub_resource type="AnimationLibrary" id="AnimationLibrary_70i5f"] _data = { &"RESET": SubResource("Animation_i6lef"), @@ -118,65 +118,68 @@ autoplay = "blink" [node name="exit" type="TextureButton" parent="TextureRect"] layout_mode = 0 -offset_left = 103.00001 -offset_top = 497.00003 -offset_right = 1127.0 -offset_bottom = 1521.0 +offset_left = 7.0 +offset_top = 580.0 +offset_right = 1257.0 +offset_bottom = 810.0 scale = Vector2(0.15, 0.15) texture_normal = ExtResource("3_v86rl") texture_hover = ExtResource("4_13sgg") +stretch_mode = 0 [node name="Label" type="Label" parent="TextureRect/exit"] layout_mode = 0 -offset_left = 200.0 -offset_top = 453.333 -offset_right = 836.0 -offset_bottom = 563.333 +offset_left = 6.6666603 +offset_top = 6.6665955 +offset_right = 1246.6665 +offset_bottom = 219.99985 theme_override_colors/font_color = Color(3.008172e-09, 0.06855638, 0.14010939, 1) theme_override_colors/font_shadow_color = Color(0.7570387, 0.75415635, 0.7885611, 0) theme_override_colors/font_outline_color = Color(0.9954526, 0.93959796, 0.9103491, 1) theme_override_constants/outline_size = 23 theme_override_fonts/font = ExtResource("5_13sgg") theme_override_font_sizes/font_size = 120 -text = "ZAMKNIJ" +text = "menu_exit" horizontal_alignment = 1 vertical_alignment = 1 [node name="option" type="TextureButton" parent="TextureRect"] layout_mode = 0 -offset_left = -7.0 -offset_top = 435.0 -offset_right = 1017.0 -offset_bottom = 1459.0 +offset_left = 7.0 +offset_top = 537.0 +offset_right = 1257.0 +offset_bottom = 767.0 scale = Vector2(0.15, 0.15) texture_normal = ExtResource("3_v86rl") texture_hover = ExtResource("4_13sgg") +stretch_mode = 0 [node name="Label" type="Label" parent="TextureRect/option"] layout_mode = 0 -offset_left = 250.66675 -offset_top = 464.83325 -offset_right = 770.66675 -offset_bottom = 574.83325 +offset_left = 6.6666718 +offset_top = 6.6664734 +offset_right = 1246.6665 +offset_bottom = 226.66647 theme_override_colors/font_color = Color(3.008172e-09, 0.06855638, 0.14010939, 1) theme_override_colors/font_shadow_color = Color(0.7570387, 0.75415635, 0.7885611, 0) theme_override_colors/font_outline_color = Color(0.9954526, 0.93959796, 0.9103491, 1) theme_override_constants/outline_size = 23 theme_override_fonts/font = ExtResource("5_13sgg") theme_override_font_sizes/font_size = 120 -text = "OPCJE" +text = "menu_options" horizontal_alignment = 1 vertical_alignment = 1 [node name="start" type="TextureButton" parent="TextureRect"] layout_mode = 0 -offset_left = -7.0 -offset_top = 312.0 -offset_right = 1017.0 -offset_bottom = 1336.0 +offset_left = 7.0 +offset_top = 494.00003 +offset_right = 1257.0 +offset_bottom = 724.0 scale = Vector2(0.15, 0.15) texture_normal = ExtResource("3_v86rl") texture_hover = ExtResource("4_13sgg") +stretch_mode = 0 [node name="Label" type="Label" parent="TextureRect/start"] layout_mode = 1 @@ -185,10 +188,10 @@ anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 anchor_bottom = 0.5 -offset_left = -230.66699 -offset_top = -66.16675 -offset_right = 259.333 -offset_bottom = 43.833252 +offset_left = -618.3333 +offset_top = -108.33362 +offset_right = 621.6665 +offset_bottom = 111.66638 grow_horizontal = 2 grow_vertical = 2 theme_override_colors/font_color = Color(3.008172e-09, 0.06855638, 0.14010939, 1) @@ -197,7 +200,7 @@ theme_override_colors/font_outline_color = Color(0.9954526, 0.93959796, 0.910349 theme_override_constants/outline_size = 23 theme_override_fonts/font = ExtResource("5_13sgg") theme_override_font_sizes/font_size = 120 -text = "START" +text = "menu_start" horizontal_alignment = 1 vertical_alignment = 1 diff --git a/scenes/option_popup.tscn b/scenes/option_popup.tscn index ec73e69..eae37b7 100644 --- a/scenes/option_popup.tscn +++ b/scenes/option_popup.tscn @@ -47,6 +47,18 @@ layout_mode = 2 layout_mode = 2 text = "Pełny ekran" +[node name="Polish" type="Button" parent="VBoxContainer"] +layout_mode = 2 +text = "Polish" + +[node name="English" type="Button" parent="VBoxContainer"] +layout_mode = 2 +text = "English" + +[node name="Germany" type="Button" parent="VBoxContainer"] +layout_mode = 2 +text = "Germany" + [node name="Apply" type="Button" parent="VBoxContainer"] layout_mode = 2 text = "Zastosuj diff --git a/scenes/options.tscn b/scenes/options.tscn index 2ab17b2..fac02af 100644 --- a/scenes/options.tscn +++ b/scenes/options.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=0 format=3 uid="uid://t6cx3pwnhodp"] +[gd_scene format=3 uid="uid://t6cx3pwnhodp"] [node name="Control" type="Control"] layout_mode = 3 @@ -9,20 +9,3 @@ offset_right = -2067.0 offset_bottom = -652.0 grow_horizontal = 2 grow_vertical = 2 - -[node name="2560" type="Button" parent="."] -layout_mode = 0 -offset_left = 117.0 -offset_top = 49.0 -offset_right = 207.0 -offset_bottom = 80.0 -text = "2560x1440" - -[node name="1920" type="Button" parent="."] -layout_mode = 0 -offset_left = 115.0 -offset_top = 3.0 -offset_right = 205.0 -offset_bottom = 34.0 -text = "1920x1080 -" diff --git a/scripts/option_popup.gd b/scripts/option_popup.gd index e73dadc..18b69e5 100644 --- a/scripts/option_popup.gd +++ b/scripts/option_popup.gd @@ -5,6 +5,10 @@ extends PopupPanel @onready var apply_button = $VBoxContainer/Apply @onready var exit_button = $VBoxContainer/Exit +@onready var polish = $VBoxContainer/Polish +@onready var english = $VBoxContainer/English +@onready var german = $VBoxContainer/Germany + var resolutions = [ Vector2i(1280, 720), Vector2i(1600, 900), @@ -19,6 +23,10 @@ func _ready(): # Połączenia apply_button.pressed.connect(_on_apply_pressed) exit_button.pressed.connect(_on_close_pressed) + + polish.pressed.connect(_on_polish_pressed) + english.pressed.connect(_on_english_pressed) + german.pressed.connect(_on_german_pressed) # Wypełnienie listy rozdzielczości for res in resolutions: @@ -55,3 +63,10 @@ func _on_apply_pressed(): func _on_close_pressed(): hide() +func _on_polish_pressed(): + TranslationServer.set_locale("pl") # wersja jezykowa +func _on_german_pressed(): + TranslationServer.set_locale("de") # wersja jezykowa +func _on_english_pressed(): + TranslationServer.set_locale("en") # wersja jezykowa + diff --git a/scripts/sector.gd b/scripts/sector.gd index 4133899..a590ac6 100644 --- a/scripts/sector.gd +++ b/scripts/sector.gd @@ -115,7 +115,7 @@ func random_star_texture_path() -> String: # --- Background --- func _init_background(): var background = Sprite2D.new() - background.texture = load("res://assets/background/space1.jpg") + background.texture = load(Settings.SECTOR_BACKGROUND) background.centered = true background.position = get_viewport_rect().size / 2 var screen_size = get_viewport_rect().size diff --git a/scripts/settings.gd b/scripts/settings.gd index 9906732..a457446 100644 --- a/scripts/settings.gd +++ b/scripts/settings.gd @@ -6,7 +6,12 @@ const SECTOR_COUNT = 13 #ilość sektorów const PLANET_PER_SECTOR: Vector2 = Vector2(1, 5) const MIN_DISTANCE = 80.0 # Minimalna odległość (promień) między środkami gwiazd const MAX_ATTEMPTS = 50 # Maksymalna liczba prób znalezienia miejsca -const PLANET_NUMBER = Vector2(1, 5) +#const PLANET_NUMBER = Vector2(1, 5) #GRAFIKI const GALAXY_BACKGROUND: = "res://assets/background/galaxy_background.jpg" # Tło galaktyki +const SECTOR_BACKGROUND: = "res://assets/background/space1.jpg" # Tło sektora +const CURSOR: = "res://assets/icons/cursors/cursor.png" + + +const LANGUAGE: = "pl"