diff --git a/core/game_menu/assets/page_2/photocollections_text.png b/core/game_menu/assets/page_2/photocollections_text.png index 7ea0d3e..de1ff52 100644 Binary files a/core/game_menu/assets/page_2/photocollections_text.png and b/core/game_menu/assets/page_2/photocollections_text.png differ diff --git a/core/game_menu/assets/page_3/aliasing_button.png b/core/game_menu/assets/page_3/aliasing_button.png index 92db2c3..a657d82 100644 Binary files a/core/game_menu/assets/page_3/aliasing_button.png and b/core/game_menu/assets/page_3/aliasing_button.png differ diff --git a/core/game_menu/assets/page_3/buttoncircle_empty.png b/core/game_menu/assets/page_3/buttoncircle_empty.png new file mode 100644 index 0000000..8e2adcd Binary files /dev/null and b/core/game_menu/assets/page_3/buttoncircle_empty.png differ diff --git a/core/game_menu/assets/page_3/buttoncircle_empty.png.import b/core/game_menu/assets/page_3/buttoncircle_empty.png.import new file mode 100644 index 0000000..64ea635 --- /dev/null +++ b/core/game_menu/assets/page_3/buttoncircle_empty.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://srsr075e1blh" +path="res://.godot/imported/buttoncircle_empty.png-004e709955abf5a4c40270f81dd8b280.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://core/game_menu/assets/page_3/buttoncircle_empty.png" +dest_files=["res://.godot/imported/buttoncircle_empty.png-004e709955abf5a4c40270f81dd8b280.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/core/game_menu/assets/page_3/buttoncircle_fill.png b/core/game_menu/assets/page_3/buttoncircle_fill.png new file mode 100644 index 0000000..33e2e04 Binary files /dev/null and b/core/game_menu/assets/page_3/buttoncircle_fill.png differ diff --git a/core/game_menu/assets/page_3/buttoncircle_fill.png.import b/core/game_menu/assets/page_3/buttoncircle_fill.png.import new file mode 100644 index 0000000..744456d --- /dev/null +++ b/core/game_menu/assets/page_3/buttoncircle_fill.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://be26apr133ywy" +path="res://.godot/imported/buttoncircle_fill.png-c6f6e85549558b77cc4e6504b299f4c1.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://core/game_menu/assets/page_3/buttoncircle_fill.png" +dest_files=["res://.godot/imported/buttoncircle_fill.png-c6f6e85549558b77cc4e6504b299f4c1.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/core/game_menu/assets/page_3/buttonsquare_empty.png b/core/game_menu/assets/page_3/buttonsquare_empty.png new file mode 100644 index 0000000..36dd780 Binary files /dev/null and b/core/game_menu/assets/page_3/buttonsquare_empty.png differ diff --git a/core/game_menu/assets/page_3/buttonsquare_empty.png.import b/core/game_menu/assets/page_3/buttonsquare_empty.png.import new file mode 100644 index 0000000..e82786a --- /dev/null +++ b/core/game_menu/assets/page_3/buttonsquare_empty.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://hw1j3ii4eer" +path="res://.godot/imported/buttonsquare_empty.png-9813d1aa27d0cc5b635a9af58112a204.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://core/game_menu/assets/page_3/buttonsquare_empty.png" +dest_files=["res://.godot/imported/buttonsquare_empty.png-9813d1aa27d0cc5b635a9af58112a204.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/core/game_menu/assets/page_3/buttonsquare_fill.png b/core/game_menu/assets/page_3/buttonsquare_fill.png new file mode 100644 index 0000000..f97bf9c Binary files /dev/null and b/core/game_menu/assets/page_3/buttonsquare_fill.png differ diff --git a/core/game_menu/assets/page_3/buttonsquare_fill.png.import b/core/game_menu/assets/page_3/buttonsquare_fill.png.import new file mode 100644 index 0000000..13a6e0e --- /dev/null +++ b/core/game_menu/assets/page_3/buttonsquare_fill.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cq51kdp4p1jfk" +path="res://.godot/imported/buttonsquare_fill.png-bec9bdea5abb9a22113554a88b73bfb1.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://core/game_menu/assets/page_3/buttonsquare_fill.png" +dest_files=["res://.godot/imported/buttonsquare_fill.png-bec9bdea5abb9a22113554a88b73bfb1.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/core/game_menu/audio_option.tscn b/core/game_menu/audio_option.tscn index 97c40ac..b8c5edf 100644 --- a/core/game_menu/audio_option.tscn +++ b/core/game_menu/audio_option.tscn @@ -19,9 +19,9 @@ texture = ExtResource("4_hduhm") texture = ExtResource("4_hduhm") [node name="AudioOption" type="VBoxContainer" unique_id=1509773712] -custom_minimum_size = Vector2(319, 177) -offset_right = 319.0 -offset_bottom = 177.0 +custom_minimum_size = Vector2(250, 150) +offset_right = 250.0 +offset_bottom = 167.0 theme_override_constants/separation = 0 alignment = 1 script = ExtResource("1_orafl") diff --git a/core/game_menu/checkbox.gd b/core/game_menu/checkbox.gd new file mode 100644 index 0000000..a200f48 --- /dev/null +++ b/core/game_menu/checkbox.gd @@ -0,0 +1,33 @@ +@tool +extends Button + +class_name CustomCheckbox + +@export var color: Color = Color(1,1,1,1): + set(value): + color = value + if is_inside_tree() and has_node("%ToggleTexture"): + $%ToggleTexture.modulate = color + +@export var image: Texture: + set(value): + image = value + if is_inside_tree() and has_node("%Texture"): + $%Texture.texture = image + +@export var image_toggle: Texture: + set(value): + image_toggle = value + if is_inside_tree() and has_node("%ToggleTexture"): + $%ToggleTexture.texture = image_toggle + +func _ready(): + if image != null and has_node("%Texture"): + $%Texture.texture = image + if image_toggle != null and has_node("%ToggleTexture"): + $%ToggleTexture.texture = image_toggle + $%ToggleTexture.modulate = color + $%ToggleTexture.visible = button_pressed + +func _on_toggled(toggled_on: bool) -> void: + $%ToggleTexture.visible = toggled_on diff --git a/core/game_menu/checkbox.gd.uid b/core/game_menu/checkbox.gd.uid new file mode 100644 index 0000000..7591cb2 --- /dev/null +++ b/core/game_menu/checkbox.gd.uid @@ -0,0 +1 @@ +uid://bf28djpewxwai diff --git a/core/game_menu/checkbox.tscn b/core/game_menu/checkbox.tscn new file mode 100644 index 0000000..3029322 --- /dev/null +++ b/core/game_menu/checkbox.tscn @@ -0,0 +1,51 @@ +[gd_scene format=3 uid="uid://gvpxmy1bgt8h"] + +[ext_resource type="Script" uid="uid://bf28djpewxwai" path="res://core/game_menu/checkbox.gd" id="2_ma3ho"] +[ext_resource type="Texture2D" uid="uid://hw1j3ii4eer" path="res://core/game_menu/assets/page_3/buttonsquare_empty.png" id="2_p1o3r"] +[ext_resource type="Texture2D" uid="uid://cq51kdp4p1jfk" path="res://core/game_menu/assets/page_3/buttonsquare_fill.png" id="3_6138f"] + +[node name="Checkbox" type="Button" unique_id=1346986972] +custom_minimum_size = Vector2(60, 60) +anchors_preset = -1 +anchor_right = 0.03125 +anchor_bottom = 0.055555556 +pivot_offset_ratio = Vector2(0.5, 0.5) +toggle_mode = true +flat = true +script = ExtResource("2_ma3ho") +image = ExtResource("2_p1o3r") +image_toggle = ExtResource("3_6138f") +metadata/_edit_use_anchors_ = true + +[node name="Texture" type="TextureRect" parent="." unique_id=1951376393] +unique_name_in_owner = true +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +pivot_offset_ratio = Vector2(0.5, 0.5) +texture = ExtResource("2_p1o3r") +expand_mode = 1 + +[node name="ToggleTexture" type="TextureRect" parent="." unique_id=1931011536] +unique_name_in_owner = true +custom_minimum_size = Vector2(50, 50) +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -25.0 +offset_top = -26.5 +offset_right = 25.0 +offset_bottom = 23.5 +grow_horizontal = 2 +grow_vertical = 2 +pivot_offset_ratio = Vector2(0.5, 0.5) +texture = ExtResource("3_6138f") +expand_mode = 1 + +[connection signal="toggled" from="." to="." method="_on_toggled"] diff --git a/core/game_menu/page_2.tscn b/core/game_menu/page_2.tscn index 76e5faf..33671bb 100644 --- a/core/game_menu/page_2.tscn +++ b/core/game_menu/page_2.tscn @@ -19,10 +19,10 @@ mouse_filter = 2 [node name="PhotoCollectionText" type="TextureRect" parent="." index="1" unique_id=240014191] layout_mode = 0 -offset_left = 350.0 +offset_left = 260.0 offset_top = 330.0 -offset_right = 758.0 -offset_bottom = 410.0 +offset_right = 827.0 +offset_bottom = 415.0 texture = ExtResource("2_4uwhd") stretch_mode = 3 diff --git a/core/game_menu/page_3.tscn b/core/game_menu/page_3.tscn index f4ec270..6d10607 100644 --- a/core/game_menu/page_3.tscn +++ b/core/game_menu/page_3.tscn @@ -43,11 +43,14 @@ visible = false [node name="SettingsMenu" parent="." index="3" unique_id=1639777294 instance=ExtResource("4_twko7")] layout_mode = 1 -anchor_left = 0.19010417 -anchor_top = 0.28148147 -anchor_right = 0.36041668 -anchor_bottom = 0.75555557 -offset_right = 0.0 -offset_bottom = 0.0 +anchor_left = -0.0328125 +anchor_top = -0.0129629625 +anchor_right = -0.0328125 +anchor_bottom = -0.0129629625 +offset_left = 238.0 +offset_top = 328.0 +offset_right = 1117.0 +offset_bottom = 883.0 +size_flags_horizontal = 6 [editable path="OptionMenu"] diff --git a/core/game_menu/settings_menu.gd b/core/game_menu/settings_menu.gd index 6327c27..7e46ec7 100644 --- a/core/game_menu/settings_menu.gd +++ b/core/game_menu/settings_menu.gd @@ -1,11 +1,22 @@ -extends Control +extends HBoxContainer class_name SettingsMenu @onready var audio_options_container: VBoxContainer = $%AudioOptionsContainer +@onready var aliasing_checkbox: CustomCheckbox = $%AliasingCheckbox func _ready() -> void: _refresh_audio_options() + + if aliasing_checkbox: + aliasing_checkbox.button_pressed = get_viewport().use_taa or get_viewport().msaa_3d != Viewport.MSAA_DISABLED + aliasing_checkbox.toggled.connect(_on_aliasing_toggled) + +func _on_aliasing_toggled(toggled_on: bool) -> void: + get_viewport().use_taa = toggled_on + var msaa_mode = Viewport.MSAA_2X if toggled_on else Viewport.MSAA_DISABLED + get_viewport().msaa_3d = msaa_mode + get_viewport().msaa_2d = msaa_mode func _get_audio_options() -> Array[AudioOption]: var audio_options: Array[AudioOption] = [] diff --git a/core/game_menu/settings_menu.tscn b/core/game_menu/settings_menu.tscn index 429cf08..5303524 100644 --- a/core/game_menu/settings_menu.tscn +++ b/core/game_menu/settings_menu.tscn @@ -4,15 +4,15 @@ [ext_resource type="PackedScene" uid="uid://cescrovsjlwke" path="res://core/game_menu/audio_option.tscn" id="1_hwcco"] [ext_resource type="Texture2D" uid="uid://0t00kjvrw206" path="res://core/game_menu/assets/page_3/music_volume_button.png" id="3_kgdba"] [ext_resource type="Texture2D" uid="uid://dvergpy6qgggn" path="res://core/game_menu/assets/page_3/sfx_volume_button.png" id="4_ugk4n"] +[ext_resource type="Texture2D" uid="uid://c0s17sglugylc" path="res://core/game_menu/assets/page_3/aliasing_button.png" id="5_8sr5x"] [ext_resource type="PackedScene" uid="uid://dxun0jk5t0n6" path="res://core/tween/container_tween.tscn" id="5_p0gqk"] +[ext_resource type="PackedScene" uid="uid://cxkmo80ecvyal" path="res://core/game_menu/window_option_menu.tscn" id="6_ocbt2"] +[ext_resource type="PackedScene" uid="uid://gvpxmy1bgt8h" path="res://core/game_menu/checkbox.tscn" id="6_r08il"] -[node name="SettingsMenu" type="Control" unique_id=1639777294] -custom_minimum_size = Vector2(327, 512) -layout_mode = 3 -anchor_right = 0.1703125 -anchor_bottom = 0.47407407 -offset_right = -327.0 -offset_bottom = -512.0 +[node name="SettingsMenu" type="HBoxContainer" unique_id=513569488] +anchors_preset = -1 +anchor_right = 0.4578125 +anchor_bottom = 0.5138889 pivot_offset_ratio = Vector2(0.5, 0.5) script = ExtResource("1_4lekq") metadata/_edit_use_anchors_ = true @@ -20,14 +20,9 @@ metadata/_edit_use_anchors_ = true [node name="AudioOptionsContainer" type="VBoxContainer" parent="." unique_id=743642398] unique_name_in_owner = true custom_minimum_size = Vector2(327, 512) -layout_mode = 1 -anchors_preset = -1 -anchor_right = 1.0 -anchor_bottom = 1.0839844 -grow_horizontal = 2 -grow_vertical = 2 +layout_mode = 2 +size_flags_vertical = 0 theme_override_constants/separation = 12 -alignment = 1 metadata/_edit_use_anchors_ = true [node name="MasterVolume_AudioOption" parent="AudioOptionsContainer" unique_id=1509773712 instance=ExtResource("1_hwcco")] @@ -43,5 +38,42 @@ layout_mode = 2 image = ExtResource("4_ugk4n") bus_name = &"SFX" +[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=1034452799] +layout_mode = 2 + +[node name="AliasingOption" type="Control" parent="VBoxContainer" unique_id=960976098] +custom_minimum_size = Vector2(305, 115) +layout_mode = 2 +size_flags_horizontal = 4 + +[node name="TextureRect" type="TextureRect" parent="VBoxContainer/AliasingOption" unique_id=148856120] +custom_minimum_size = Vector2(250, 115) +layout_mode = 0 +offset_right = 250.0 +offset_bottom = 115.0 +texture = ExtResource("5_8sr5x") +expand_mode = 1 +stretch_mode = 5 + +[node name="AliasingCheckbox" parent="VBoxContainer/AliasingOption" unique_id=1346986972 instance=ExtResource("6_r08il")] +unique_name_in_owner = true +layout_mode = 1 +anchors_preset = 6 +anchor_left = 1.0 +anchor_top = 0.5 +anchor_right = 1.0 +anchor_bottom = 0.5 +offset_left = -40.0 +offset_top = -20.0 +offset_bottom = 20.0 +grow_horizontal = 0 +grow_vertical = 2 +color = Color(1, 0.8156863, 0.7176471, 1) + +[node name="WindowOptionMenu" parent="VBoxContainer" unique_id=1829826194 instance=ExtResource("6_ocbt2")] +custom_minimum_size = Vector2(418, 342) +layout_mode = 2 +size_flags_vertical = 3 + [node name="ContainerTween" parent="." unique_id=160227524 node_paths=PackedStringArray("targets") instance=ExtResource("5_p0gqk")] -targets = [NodePath("../AudioOptionsContainer/MasterVolume_AudioOption"), NodePath("../AudioOptionsContainer/MusicVolume_AudioOption"), NodePath("../AudioOptionsContainer/SFXVolume_AudioOption")] +targets = [NodePath("../AudioOptionsContainer/MasterVolume_AudioOption"), NodePath("../AudioOptionsContainer/MusicVolume_AudioOption"), NodePath("../AudioOptionsContainer/SFXVolume_AudioOption"), NodePath("../VBoxContainer/WindowOptionMenu")] diff --git a/core/game_menu/window_option_menu.gd b/core/game_menu/window_option_menu.gd new file mode 100644 index 0000000..a66115d --- /dev/null +++ b/core/game_menu/window_option_menu.gd @@ -0,0 +1,101 @@ +extends Control + +signal mode_changed(mode_index: int) +signal resolution_changed(resolution: Vector2i) + +@export var window_option_menu_button_scene: PackedScene + +var current_mode_index: int = 0 + +var available_resolutions: Array[Vector2i] = [ + Vector2i(1280, 720), + Vector2i(1366, 768), + Vector2i(1600, 900), + Vector2i(1920, 1080), + Vector2i(2560, 1440), + Vector2i(3840, 2160) +] + +var _valid_resolutions: Array[Vector2i] = [] + +@onready var left_arrow = $%LeftArrowButton +@onready var right_arrow = $%RightArrowButton + +@onready var buttons = [ + $%FullScreenButton, + $%BorderlessButton, + $%WindowedButton +] + +@onready var base = $%Base +@onready var resolutions_list = $%ResolutionsList + +func _ready() -> void: + left_arrow.pressed.connect(_on_left_arrow_pressed) + right_arrow.pressed.connect(_on_right_arrow_pressed) + + _populate_resolutions() + _update_ui() + +func _populate_resolutions() -> void: + var screen_size = DisplayServer.screen_get_size() + + for child in resolutions_list.get_children(): + child.queue_free() + + _valid_resolutions.clear() + + for res in available_resolutions: + if res.x <= screen_size.x and res.y <= screen_size.y: + _valid_resolutions.append(res) + + var btn = window_option_menu_button_scene.instantiate() + btn.set_option_text(str(res.x) + " x " + str(res.y)) + btn.alignment = HORIZONTAL_ALIGNMENT_CENTER + + btn.pressed.connect(func(): _on_resolution_selected(res, btn)) + + resolutions_list.add_child(btn) + +func _on_resolution_selected(res: Vector2i, btn) -> void: + var res_buttons = resolutions_list.get_children() + for button in res_buttons: + button.deselect() + + btn.select() + resolution_changed.emit(res) + +func _on_left_arrow_pressed() -> void: + current_mode_index -= 1 + if current_mode_index < 0: + current_mode_index = buttons.size() - 1 + _update_ui() + mode_changed.emit(current_mode_index) + +func _on_right_arrow_pressed() -> void: + current_mode_index += 1 + if current_mode_index >= buttons.size(): + current_mode_index = 0 + _update_ui() + mode_changed.emit(current_mode_index) + +func _update_ui() -> void: + for i in range(buttons.size()): + buttons[i].visible = (i == current_mode_index) + + var show_res = current_mode_index == 2 + var color = Color(1,1,1,1) if show_res else Color(0.2, 0.2 ,0.2, 1) + base.modulate = color + + var res_buttons = resolutions_list.get_children() + for button in res_buttons: + button.deselect() + if show_res: + button.enable() + else: + button.disable() + + var btn = res_buttons[0] + btn.select() + if show_res: + resolution_changed.emit(available_resolutions[0]) diff --git a/core/game_menu/window_option_menu.gd.uid b/core/game_menu/window_option_menu.gd.uid new file mode 100644 index 0000000..bda88e2 --- /dev/null +++ b/core/game_menu/window_option_menu.gd.uid @@ -0,0 +1 @@ +uid://8gdaotll12ug diff --git a/core/game_menu/window_option_menu.tscn b/core/game_menu/window_option_menu.tscn new file mode 100644 index 0000000..eb100f9 --- /dev/null +++ b/core/game_menu/window_option_menu.tscn @@ -0,0 +1,224 @@ +[gd_scene format=3 uid="uid://cxkmo80ecvyal"] + +[ext_resource type="Texture2D" uid="uid://bftymw7ajgb25" path="res://core/game_menu/assets/page_3/fullscreen.png" id="1_1oilv"] +[ext_resource type="Script" uid="uid://8gdaotll12ug" path="res://core/game_menu/window_option_menu.gd" id="1_6b7am"] +[ext_resource type="PackedScene" uid="uid://du4o5mms8jmrx" path="res://core/game_menu/window_option_menu_button.tscn" id="2_13nv1"] +[ext_resource type="PackedScene" uid="uid://dm3skv22c60tm" path="res://core/game_menu/arrow_button.tscn" id="2_c6wxr"] +[ext_resource type="Texture2D" uid="uid://m5llqtaj5kla" path="res://core/game_menu/assets/page_3/borderless.png" id="3_byg38"] +[ext_resource type="Texture2D" uid="uid://idvleok1gecb" path="res://core/game_menu/assets/page_3/base.png" id="3_lo8ks"] +[ext_resource type="Texture2D" uid="uid://dbcs6apfftxxw" path="res://core/game_menu/assets/page_3/windowed.png" id="4_c6wxr"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_323rd"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_264kt"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_1folt"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_tcqrg"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_kbu6n"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_dk0pr"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_f16cj"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_s4jbd"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_2ocph"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5386i"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_6pmjh"] + +[node name="WindowOptionMenu" type="Control" unique_id=891718047] +layout_mode = 3 +anchor_right = 0.21770833 +anchor_bottom = 0.31666666 +pivot_offset_ratio = Vector2(0.5, 0.5) +script = ExtResource("1_6b7am") +window_option_menu_button_scene = ExtResource("2_13nv1") +metadata/_edit_use_anchors_ = true + +[node name="Base" type="TextureRect" parent="." unique_id=1093652090] +unique_name_in_owner = true +custom_minimum_size = Vector2(255.46, 330.8) +layout_mode = 1 +anchors_preset = 5 +anchor_left = 0.5 +anchor_right = 0.5 +offset_left = -109.64252 +offset_right = 109.64252 +offset_bottom = 238.0 +grow_horizontal = 2 +size_flags_horizontal = 4 +texture = ExtResource("3_lo8ks") +expand_mode = 1 + +[node name="VBoxContainer" type="VBoxContainer" parent="Base" unique_id=416233744] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="MarginContainer" type="MarginContainer" parent="Base/VBoxContainer" unique_id=2077693765] +layout_mode = 2 +theme_override_constants/margin_left = 32 +theme_override_constants/margin_top = 100 +theme_override_constants/margin_right = 32 +theme_override_constants/margin_bottom = 32 + +[node name="ResolutionsList" type="VBoxContainer" parent="Base/VBoxContainer/MarginContainer" unique_id=633511112] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 4 +alignment = 1 + +[node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=255911279] +layout_mode = 0 +offset_right = 418.0 +offset_bottom = 100.0 +alignment = 1 + +[node name="LeftArrowButton" parent="HBoxContainer" unique_id=579258112 instance=ExtResource("2_c6wxr")] +unique_name_in_owner = true +custom_minimum_size = Vector2(50.5, 62) +layout_mode = 2 +flip_h = true + +[node name="Texture" parent="HBoxContainer/LeftArrowButton" index="0" unique_id=91599097] +custom_minimum_size = Vector2(50, 62) +anchors_preset = -1 +anchor_top = 0.19 +anchor_right = 0.990099 +anchor_bottom = 0.81 +offset_top = 31.0 +offset_right = -50.0 +offset_bottom = -31.0 +grow_horizontal = 1 +expand_mode = 1 +stretch_mode = 5 +flip_h = true +metadata/_edit_use_anchors_ = true + +[node name="FullScreenButton" type="Button" parent="HBoxContainer" unique_id=658423473] +unique_name_in_owner = true +custom_minimum_size = Vector2(310, 100) +layout_mode = 2 +theme_override_styles/normal = SubResource("StyleBoxEmpty_323rd") +theme_override_styles/normal_mirrored = SubResource("StyleBoxEmpty_264kt") +theme_override_styles/pressed = SubResource("StyleBoxEmpty_1folt") +theme_override_styles/pressed_mirrored = SubResource("StyleBoxEmpty_tcqrg") +theme_override_styles/hover = SubResource("StyleBoxEmpty_kbu6n") +theme_override_styles/hover_mirrored = SubResource("StyleBoxEmpty_dk0pr") +theme_override_styles/hover_pressed = SubResource("StyleBoxEmpty_f16cj") +theme_override_styles/hover_pressed_mirrored = SubResource("StyleBoxEmpty_s4jbd") +theme_override_styles/disabled = SubResource("StyleBoxEmpty_2ocph") +theme_override_styles/disabled_mirrored = SubResource("StyleBoxEmpty_5386i") +theme_override_styles/focus = SubResource("StyleBoxEmpty_6pmjh") +metadata/_edit_use_anchors_ = true + +[node name="Texture" type="TextureRect" parent="HBoxContainer/FullScreenButton" unique_id=1273084077] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +texture = ExtResource("1_1oilv") +expand_mode = 1 +stretch_mode = 5 + +[node name="BorderlessButton" type="Button" parent="HBoxContainer" unique_id=1930001398] +unique_name_in_owner = true +visible = false +custom_minimum_size = Vector2(310, 100) +layout_mode = 2 +theme_override_styles/normal = SubResource("StyleBoxEmpty_323rd") +theme_override_styles/normal_mirrored = SubResource("StyleBoxEmpty_264kt") +theme_override_styles/pressed = SubResource("StyleBoxEmpty_1folt") +theme_override_styles/pressed_mirrored = SubResource("StyleBoxEmpty_tcqrg") +theme_override_styles/hover = SubResource("StyleBoxEmpty_kbu6n") +theme_override_styles/hover_mirrored = SubResource("StyleBoxEmpty_dk0pr") +theme_override_styles/hover_pressed = SubResource("StyleBoxEmpty_f16cj") +theme_override_styles/hover_pressed_mirrored = SubResource("StyleBoxEmpty_s4jbd") +theme_override_styles/disabled = SubResource("StyleBoxEmpty_2ocph") +theme_override_styles/disabled_mirrored = SubResource("StyleBoxEmpty_5386i") +theme_override_styles/focus = SubResource("StyleBoxEmpty_6pmjh") +metadata/_edit_use_anchors_ = true + +[node name="Texture" type="TextureRect" parent="HBoxContainer/BorderlessButton" unique_id=2113335035] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +texture = ExtResource("3_byg38") +expand_mode = 1 +stretch_mode = 5 + +[node name="WindowedButton" type="Button" parent="HBoxContainer" unique_id=210063143] +unique_name_in_owner = true +visible = false +custom_minimum_size = Vector2(310, 100) +layout_mode = 2 +theme_override_styles/normal = SubResource("StyleBoxEmpty_323rd") +theme_override_styles/normal_mirrored = SubResource("StyleBoxEmpty_264kt") +theme_override_styles/pressed = SubResource("StyleBoxEmpty_1folt") +theme_override_styles/pressed_mirrored = SubResource("StyleBoxEmpty_tcqrg") +theme_override_styles/hover = SubResource("StyleBoxEmpty_kbu6n") +theme_override_styles/hover_mirrored = SubResource("StyleBoxEmpty_dk0pr") +theme_override_styles/hover_pressed = SubResource("StyleBoxEmpty_f16cj") +theme_override_styles/hover_pressed_mirrored = SubResource("StyleBoxEmpty_s4jbd") +theme_override_styles/disabled = SubResource("StyleBoxEmpty_2ocph") +theme_override_styles/disabled_mirrored = SubResource("StyleBoxEmpty_5386i") +theme_override_styles/focus = SubResource("StyleBoxEmpty_6pmjh") +metadata/_edit_use_anchors_ = true + +[node name="Texture" type="TextureRect" parent="HBoxContainer/WindowedButton" unique_id=873436909] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +texture = ExtResource("4_c6wxr") +expand_mode = 1 +stretch_mode = 5 + +[node name="RightArrowButton" parent="HBoxContainer" unique_id=1429974963 instance=ExtResource("2_c6wxr")] +unique_name_in_owner = true +custom_minimum_size = Vector2(50.5, 62) +layout_mode = 2 + +[node name="Texture" parent="HBoxContainer/RightArrowButton" index="0" unique_id=91599097] +custom_minimum_size = Vector2(50, 62) +anchors_preset = -1 +anchor_left = 0.00990099 +anchor_top = 0.19 +anchor_bottom = 0.81 +offset_left = 50.0 +offset_top = 31.0 +offset_bottom = -31.0 +grow_horizontal = 0 +expand_mode = 1 +stretch_mode = 5 +metadata/_edit_use_anchors_ = true + +[connection signal="mouse_entered" from="HBoxContainer/FullScreenButton" to="HBoxContainer/FullScreenButton" method="_on_mouse_entered"] +[connection signal="mouse_exited" from="HBoxContainer/FullScreenButton" to="HBoxContainer/FullScreenButton" method="_on_mouse_exited"] +[connection signal="pressed" from="HBoxContainer/FullScreenButton" to="HBoxContainer/FullScreenButton" method="_on_pressed"] +[connection signal="mouse_entered" from="HBoxContainer/BorderlessButton" to="HBoxContainer/BorderlessButton" method="_on_mouse_entered"] +[connection signal="mouse_exited" from="HBoxContainer/BorderlessButton" to="HBoxContainer/BorderlessButton" method="_on_mouse_exited"] +[connection signal="pressed" from="HBoxContainer/BorderlessButton" to="HBoxContainer/BorderlessButton" method="_on_pressed"] +[connection signal="mouse_entered" from="HBoxContainer/WindowedButton" to="HBoxContainer/WindowedButton" method="_on_mouse_entered"] +[connection signal="mouse_exited" from="HBoxContainer/WindowedButton" to="HBoxContainer/WindowedButton" method="_on_mouse_exited"] +[connection signal="pressed" from="HBoxContainer/WindowedButton" to="HBoxContainer/WindowedButton" method="_on_pressed"] + +[editable path="HBoxContainer/LeftArrowButton"] +[editable path="HBoxContainer/RightArrowButton"] diff --git a/core/game_menu/window_option_menu_button.gd b/core/game_menu/window_option_menu_button.gd new file mode 100644 index 0000000..2f36ef4 --- /dev/null +++ b/core/game_menu/window_option_menu_button.gd @@ -0,0 +1,33 @@ +extends Button + +class_name WindowOptionMenuButton + +@onready var checkbox: CustomCheckbox = $%Checkbox +@onready var label: Label = $%Label + +func _ready() -> void: + deselect() + disable() + +func set_option_text(text: String) -> void: + if label == null: + label = $%Label + label.text = text + +func select() -> void: + if checkbox == null: + checkbox = $%Checkbox + checkbox.set_pressed(true) + #texture.modulate = Color(1,1,1,1) + +func deselect() -> void: + if checkbox == null: + checkbox = $%Checkbox + checkbox.set_pressed(false) + #texture.modulate = Color(1,1,1,0) + +func disable() -> void: + disabled = true + +func enable() -> void: + disabled = false diff --git a/core/game_menu/window_option_menu_button.gd.uid b/core/game_menu/window_option_menu_button.gd.uid new file mode 100644 index 0000000..4c6cfa2 --- /dev/null +++ b/core/game_menu/window_option_menu_button.gd.uid @@ -0,0 +1 @@ +uid://i331kqurs7f4 diff --git a/core/game_menu/window_option_menu_button.tscn b/core/game_menu/window_option_menu_button.tscn new file mode 100644 index 0000000..8563093 --- /dev/null +++ b/core/game_menu/window_option_menu_button.tscn @@ -0,0 +1,49 @@ +[gd_scene format=3 uid="uid://du4o5mms8jmrx"] + +[ext_resource type="Script" uid="uid://i331kqurs7f4" path="res://core/game_menu/window_option_menu_button.gd" id="1_yyn3b"] +[ext_resource type="PackedScene" uid="uid://gvpxmy1bgt8h" path="res://core/game_menu/checkbox.tscn" id="2_ai3i2"] + +[node name="WindowOptionMenuButton" type="Button" unique_id=1649914382] +custom_minimum_size = Vector2(200, 30) +anchors_preset = -1 +anchor_right = 0.104166664 +anchor_bottom = 0.027777778 +flat = true +script = ExtResource("1_yyn3b") +metadata/_edit_use_anchors_ = true + +[node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=2089201662] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 + +[node name="Checkbox" parent="HBoxContainer" unique_id=1346986972 instance=ExtResource("2_ai3i2")] +unique_name_in_owner = true +custom_minimum_size = Vector2(30, 30) +layout_mode = 2 +size_flags_vertical = 4 +mouse_filter = 2 +color = Color(1, 0.816975, 0.71932274, 1) + +[node name="ToggleTexture" parent="HBoxContainer/Checkbox" index="1" unique_id=1931011536] +visible = false +modulate = Color(1, 0.816975, 0.71932274, 1) +custom_minimum_size = Vector2(25, 25) +offset_left = -14.0 +offset_top = -14.0 +offset_right = 14.0 +offset_bottom = 11.0 + +[node name="Label" type="Label" parent="HBoxContainer" unique_id=1910223249] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_colors/font_color = Color(0, 0, 0, 1) +text = "TEST" +horizontal_alignment = 1 + +[editable path="HBoxContainer/Checkbox"]