From 451479af96077693f712a75fe2ee0f691b758ff1 Mon Sep 17 00:00:00 2001 From: Ruslan Ignatov Date: Wed, 24 Dec 2025 17:08:41 +0300 Subject: [PATCH] Menu buttons updated --- game/menu/common/options.gd | 5 +- game/menu/common/options.tscn | 28 +++++++++--- images/menu/menu_buttons.png | 4 +- styles/menu_button.tres | 86 +++++++++++++++++++++-------------- 4 files changed, 80 insertions(+), 43 deletions(-) diff --git a/game/menu/common/options.gd b/game/menu/common/options.gd index ca57cf1..268c316 100644 --- a/game/menu/common/options.gd +++ b/game/menu/common/options.gd @@ -69,8 +69,9 @@ func _load_current_settings() -> void: func _update_window_factor_disabled() -> void: for child in window_factor_buttons.get_children(): - if child is Button: - child.disabled = SettingsManager.fullscreen + if not child is Button: continue + child.disabled = SettingsManager.fullscreen + child.focus_mode = Control.FOCUS_NONE if SettingsManager.fullscreen else Control.FOCUS_ALL func _on_fullscreen_check_button_toggled(toggled: bool) -> void: diff --git a/game/menu/common/options.tscn b/game/menu/common/options.tscn index e04d735..d858c50 100644 --- a/game/menu/common/options.tscn +++ b/game/menu/common/options.tscn @@ -47,18 +47,21 @@ columns = 2 unique_name_in_owner = true z_index = 100 layout_mode = 2 -text = "Fullscreen" +theme = ExtResource("2_1tdpy") [node name="FullscreenCheckButton" type="CheckButton" parent="MarginContainer/ScrollContainer/MarginContainer/OptionsGridContainer"] unique_name_in_owner = true z_index = 100 layout_mode = 2 mouse_filter = 2 +theme = ExtResource("2_1tdpy") +text = "Fullscreen" [node name="WindowFactorLabel" type="Label" parent="MarginContainer/ScrollContainer/MarginContainer/OptionsGridContainer"] unique_name_in_owner = true z_index = 100 layout_mode = 2 +theme = ExtResource("2_1tdpy") text = "Window Factor" [node name="WindowFactorContainer" type="HBoxContainer" parent="MarginContainer/ScrollContainer/MarginContainer/OptionsGridContainer"] @@ -68,45 +71,51 @@ layout_mode = 2 [node name="ButtonX1" type="Button" parent="MarginContainer/ScrollContainer/MarginContainer/OptionsGridContainer/WindowFactorContainer"] layout_mode = 2 mouse_filter = 2 +theme = ExtResource("2_1tdpy") toggle_mode = true button_group = SubResource("ButtonGroup_6ueaa") -text = "×1" +text = "*1" metadata/window_factor = 1 [node name="ButtonX2" type="Button" parent="MarginContainer/ScrollContainer/MarginContainer/OptionsGridContainer/WindowFactorContainer"] layout_mode = 2 mouse_filter = 2 +theme = ExtResource("2_1tdpy") toggle_mode = true button_group = SubResource("ButtonGroup_6ueaa") -text = "×2" +text = "*2" metadata/window_factor = 2 [node name="ButtonX3" type="Button" parent="MarginContainer/ScrollContainer/MarginContainer/OptionsGridContainer/WindowFactorContainer"] layout_mode = 2 mouse_filter = 2 +theme = ExtResource("2_1tdpy") toggle_mode = true button_group = SubResource("ButtonGroup_6ueaa") -text = "×3" +text = "*3" metadata/window_factor = 3 [node name="ButtonX4" type="Button" parent="MarginContainer/ScrollContainer/MarginContainer/OptionsGridContainer/WindowFactorContainer"] layout_mode = 2 mouse_filter = 2 +theme = ExtResource("2_1tdpy") toggle_mode = true button_group = SubResource("ButtonGroup_6ueaa") -text = "×4" +text = "*4" metadata/window_factor = 4 [node name="ButtonX5" type="Button" parent="MarginContainer/ScrollContainer/MarginContainer/OptionsGridContainer/WindowFactorContainer"] layout_mode = 2 mouse_filter = 2 +theme = ExtResource("2_1tdpy") toggle_mode = true button_group = SubResource("ButtonGroup_6ueaa") -text = "×5" +text = "*5" metadata/window_factor = 5 [node name="MasterLabel" type="Label" parent="MarginContainer/ScrollContainer/MarginContainer/OptionsGridContainer"] layout_mode = 2 +theme = ExtResource("2_1tdpy") text = "Menu Volume" [node name="MasterSlider" type="HSlider" parent="MarginContainer/ScrollContainer/MarginContainer/OptionsGridContainer"] @@ -114,6 +123,7 @@ unique_name_in_owner = true custom_minimum_size = Vector2(100, 0) layout_mode = 2 mouse_filter = 2 +theme = ExtResource("2_1tdpy") step = 10.0 value = 100.0 rounded = true @@ -121,6 +131,7 @@ scrollable = false [node name="UILabel" type="Label" parent="MarginContainer/ScrollContainer/MarginContainer/OptionsGridContainer"] layout_mode = 2 +theme = ExtResource("2_1tdpy") text = "UI Volume" [node name="UISlider" type="HSlider" parent="MarginContainer/ScrollContainer/MarginContainer/OptionsGridContainer"] @@ -128,6 +139,7 @@ unique_name_in_owner = true custom_minimum_size = Vector2(100, 0) layout_mode = 2 mouse_filter = 2 +theme = ExtResource("2_1tdpy") step = 10.0 value = 100.0 rounded = true @@ -135,6 +147,7 @@ scrollable = false [node name="SFXLabel" type="Label" parent="MarginContainer/ScrollContainer/MarginContainer/OptionsGridContainer"] layout_mode = 2 +theme = ExtResource("2_1tdpy") text = "SFX Volume" [node name="SFXSlider" type="HSlider" parent="MarginContainer/ScrollContainer/MarginContainer/OptionsGridContainer"] @@ -142,6 +155,7 @@ unique_name_in_owner = true custom_minimum_size = Vector2(100, 0) layout_mode = 2 mouse_filter = 2 +theme = ExtResource("2_1tdpy") step = 10.0 value = 100.0 rounded = true @@ -149,6 +163,7 @@ scrollable = false [node name="MusicLabel" type="Label" parent="MarginContainer/ScrollContainer/MarginContainer/OptionsGridContainer"] layout_mode = 2 +theme = ExtResource("2_1tdpy") text = "Music Volume" [node name="MusicSlider" type="HSlider" parent="MarginContainer/ScrollContainer/MarginContainer/OptionsGridContainer"] @@ -156,6 +171,7 @@ unique_name_in_owner = true custom_minimum_size = Vector2(100, 0) layout_mode = 2 mouse_filter = 2 +theme = ExtResource("2_1tdpy") step = 10.0 value = 100.0 rounded = true diff --git a/images/menu/menu_buttons.png b/images/menu/menu_buttons.png index f885fc2..109e93b 100644 --- a/images/menu/menu_buttons.png +++ b/images/menu/menu_buttons.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:35b93f06bd43cb501468cb9e6aea60bd281e59a06d805d4ee2e49c0e06b9da20 -size 808 +oid sha256:441e30f2b68b3090d2b787e08bae0f7f2f80bd3a06fba0c2e78189aac20877cc +size 499 diff --git a/styles/menu_button.tres b/styles/menu_button.tres index 0be28de..e656cfc 100644 --- a/styles/menu_button.tres +++ b/styles/menu_button.tres @@ -1,77 +1,95 @@ -[gd_resource type="Theme" load_steps=8 format=3 uid="uid://dtnd3tqllufey"] +[gd_resource type="Theme" load_steps=11 format=3 uid="uid://dtnd3tqllufey"] [ext_resource type="FontFile" uid="uid://bw1vqxkgbaekh" path="res://images/fonts/font16.png" id="1_5mv23"] [ext_resource type="Texture2D" uid="uid://dhmquapac0fco" path="res://images/menu/menu_buttons.png" id="2_qxsgh"] [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_6mwof"] content_margin_left = 10.0 -content_margin_top = 10.0 +content_margin_top = 16.0 content_margin_right = 10.0 -content_margin_bottom = 10.0 +content_margin_bottom = 12.0 texture = ExtResource("2_qxsgh") texture_margin_left = 8.0 -texture_margin_top = 8.0 +texture_margin_top = 12.0 texture_margin_right = 8.0 -texture_margin_bottom = 8.0 -region_rect = Rect2(96, 0, 48, 32) +texture_margin_bottom = 12.0 +region_rect = Rect2(0, 64, 32, 32) -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_hwy2u"] +[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_qxsgh"] +load_path = "res://.godot/imported/menu_buttons.png-57be3916c3bbcc2912e1eb0a800254c2.ctex" + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_wdls2"] content_margin_left = 10.0 -content_margin_top = 10.0 +content_margin_top = 14.0 content_margin_right = 10.0 -content_margin_bottom = 10.0 -texture = ExtResource("2_qxsgh") +content_margin_bottom = 14.0 +texture = SubResource("CompressedTexture2D_qxsgh") texture_margin_left = 8.0 -texture_margin_top = 8.0 +texture_margin_top = 12.0 texture_margin_right = 8.0 -texture_margin_bottom = 8.0 -region_rect = Rect2(48, 0, 48, 32) +texture_margin_bottom = 12.0 +region_rect = Rect2(32, 64, 32, 32) [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_uvn35"] content_margin_left = 10.0 content_margin_top = 10.0 content_margin_right = 10.0 -content_margin_bottom = 10.0 +content_margin_bottom = 18.0 texture = ExtResource("2_qxsgh") texture_margin_left = 8.0 -texture_margin_top = 8.0 +texture_margin_top = 12.0 texture_margin_right = 8.0 -texture_margin_bottom = 8.0 -region_rect = Rect2(0, 0, 48, 32) +texture_margin_bottom = 12.0 +region_rect = Rect2(32, 0, 32, 32) + +[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_5mv23"] +load_path = "res://.godot/imported/menu_buttons.png-57be3916c3bbcc2912e1eb0a800254c2.ctex" + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_qxsgh"] +content_margin_left = 10.0 +content_margin_top = 15.0 +content_margin_right = 10.0 +content_margin_bottom = 13.0 +texture = SubResource("CompressedTexture2D_5mv23") +texture_margin_left = 8.0 +texture_margin_top = 12.0 +texture_margin_right = 8.0 +texture_margin_bottom = 12.0 +region_rect = Rect2(32, 32, 32, 32) [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_tkt1b"] content_margin_left = 10.0 content_margin_top = 10.0 content_margin_right = 10.0 -content_margin_bottom = 10.0 +content_margin_bottom = 18.0 texture = ExtResource("2_qxsgh") texture_margin_left = 8.0 -texture_margin_top = 8.0 +texture_margin_top = 12.0 texture_margin_right = 8.0 -texture_margin_bottom = 8.0 -region_rect = Rect2(0, 0, 48, 32) +texture_margin_bottom = 12.0 +region_rect = Rect2(0, 0, 32, 32) [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_6cpu6"] content_margin_left = 10.0 -content_margin_top = 10.0 +content_margin_top = 15.0 content_margin_right = 10.0 -content_margin_bottom = 10.0 +content_margin_bottom = 13.0 texture = ExtResource("2_qxsgh") texture_margin_left = 8.0 -texture_margin_top = 8.0 +texture_margin_top = 12.0 texture_margin_right = 8.0 -texture_margin_bottom = 8.0 -region_rect = Rect2(0, 32, 48, 32) +texture_margin_bottom = 12.0 +region_rect = Rect2(0, 32, 32, 32) [resource] default_font = ExtResource("1_5mv23") -Button/colors/font_color = Color(1, 1, 1, 1) -Button/colors/font_disabled_color = Color(1, 1, 1, 1) -Button/colors/font_focus_color = Color(1, 1, 1, 1) -Button/colors/font_hover_color = Color(1, 1, 1, 1) -Button/colors/font_hover_pressed_color = Color(1, 1, 1, 1) +Button/colors/font_color = Color(0.14509805, 0.44313726, 0.4745098, 1) +Button/colors/font_disabled_color = Color(0.16078432, 0.21176471, 0.43529412, 1) +Button/colors/font_focus_color = Color(0.95686275, 0.95686275, 0.95686275, 1) +Button/colors/font_hover_color = Color(0.21960784, 0.7176471, 0.39215687, 1) +Button/colors/font_hover_pressed_color = Color(0.21960784, 0.7176471, 0.39215687, 1) Button/colors/font_outline_color = Color(0, 0, 0, 1) -Button/colors/font_pressed_color = Color(1, 1, 1, 1) +Button/colors/font_pressed_color = Color(0.14509805, 0.44313726, 0.4745098, 1) Button/colors/icon_disabled_color = Color(1, 1, 1, 1) Button/colors/icon_focus_color = Color(1, 1, 1, 1) Button/colors/icon_hover_color = Color(1, 1, 1, 1) @@ -85,7 +103,9 @@ Button/constants/outline_size = 0 Button/font_sizes/font_size = 16 Button/fonts/font = ExtResource("1_5mv23") Button/styles/disabled = SubResource("StyleBoxTexture_6mwof") -Button/styles/focus = SubResource("StyleBoxTexture_hwy2u") +Button/styles/focus = SubResource("StyleBoxTexture_wdls2") Button/styles/hover = SubResource("StyleBoxTexture_uvn35") +Button/styles/hover_pressed = SubResource("StyleBoxTexture_qxsgh") Button/styles/normal = SubResource("StyleBoxTexture_tkt1b") Button/styles/pressed = SubResource("StyleBoxTexture_6cpu6") +Label/colors/font_color = Color(0.95686275, 0.95686275, 0.95686275, 1)