diff --git a/menus/menu_button_normal.tres b/menus/menu_button_normal.tres new file mode 100644 index 0000000..d4ae98d --- /dev/null +++ b/menus/menu_button_normal.tres @@ -0,0 +1,31 @@ +[gd_resource type="StyleBoxFlat" format=2] + +[resource] + +content_margin_left = -1.0 +content_margin_right = -1.0 +content_margin_top = -1.0 +content_margin_bottom = -1.0 +bg_color = Color( 0, 0, 0, 0 ) +draw_center = true +border_width_left = 1 +border_width_top = 1 +border_width_right = 1 +border_width_bottom = 1 +border_color = Color( 0.713726, 0.713726, 0.713726, 1 ) +border_blend = true +corner_radius_top_left = 1 +corner_radius_top_right = 1 +corner_radius_bottom_right = 1 +corner_radius_bottom_left = 1 +corner_detail = 8 +expand_margin_left = 0.0 +expand_margin_right = 0.0 +expand_margin_top = 2.0 +expand_margin_bottom = 0.0 +shadow_color = Color( 0, 0, 0, 0.6 ) +shadow_size = 0 +anti_aliasing = true +anti_aliasing_size = 1 +_sections_unfolded = [ "Border", "Border Width", "Corner Radius", "Expand Margin" ] + diff --git a/menus/options_menu.gd b/menus/options_menu.gd index 695e45a..fdc8761 100644 --- a/menus/options_menu.gd +++ b/menus/options_menu.gd @@ -2,5 +2,10 @@ extends Control var from_scene_name +onready var back_btn = get_node("back_btn") + func _ready(): - pass + back_btn.connect("pressed", self, "_on_back_pressed") + +func _on_back_pressed(): + Game.switch_scene_to(from_scene_name, false) \ No newline at end of file diff --git a/menus/options_menu.tscn b/menus/options_menu.tscn index 527fa41..26e8e7b 100644 --- a/menus/options_menu.tscn +++ b/menus/options_menu.tscn @@ -1,15 +1,50 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=5 format=2] [ext_resource path="res://menus/options_menu.gd" type="Script" id=1] +[ext_resource path="res://menus/menu_button_normal.tres" type="StyleBox" id=2] + +[sub_resource type="StyleBoxEmpty" id=1] + +content_margin_left = -1.0 +content_margin_right = -1.0 +content_margin_top = -1.0 +content_margin_bottom = -1.0 + +[sub_resource type="StyleBoxFlat" id=2] + +content_margin_left = -1.0 +content_margin_right = -1.0 +content_margin_top = -1.0 +content_margin_bottom = -1.0 +bg_color = Color( 0, 0, 0, 0 ) +draw_center = true +border_width_left = 1 +border_width_top = 1 +border_width_right = 1 +border_width_bottom = 1 +border_color = Color( 1, 0.647059, 0, 1 ) +border_blend = true +corner_radius_top_left = 1 +corner_radius_top_right = 1 +corner_radius_bottom_right = 1 +corner_radius_bottom_left = 1 +corner_detail = 8 +expand_margin_left = 0.0 +expand_margin_right = 0.0 +expand_margin_top = 2.0 +expand_margin_bottom = 0.0 +shadow_color = Color( 0, 0, 0, 0.6 ) +shadow_size = 0 +anti_aliasing = true +anti_aliasing_size = 1 +_sections_unfolded = [ "Border", "Border Width", "Corner Radius", "Expand Margin" ] [node name="options_menu" type="Control" index="0"] anchor_left = 0.0 anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_right = 40.0 -margin_bottom = 40.0 +anchor_right = 1.0 +anchor_bottom = 1.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false mouse_filter = 0 @@ -18,4 +53,406 @@ size_flags_horizontal = 1 size_flags_vertical = 1 script = ExtResource( 1 ) +[node name="split" type="VSplitContainer" parent="." index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +split_offset = -48 +collapsed = false +dragger_visibility = 1 + +[node name="title" type="Label" parent="split" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 116.0 +margin_right = 1024.0 +margin_bottom = 130.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 2 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 6 +text = "options menu" +align = 1 +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 +_sections_unfolded = [ "Size Flags" ] + +[node name="opts_panel" type="PanelContainer" parent="split" index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 258.0 +margin_right = 1024.0 +margin_bottom = 600.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 3 +custom_styles/panel = SubResource( 1 ) +_sections_unfolded = [ "Size Flags", "custom_styles" ] + +[node name="panels" type="HBoxContainer" parent="split/opts_panel" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_right = 1024.0 +margin_bottom = 342.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 1 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +alignment = 1 + +[node name="display_opts" type="VBoxContainer" parent="split/opts_panel/panels" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 413.0 +margin_right = 510.0 +margin_bottom = 342.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 1 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +alignment = 0 +_sections_unfolded = [ "Size Flags" ] + +[node name="display_title" type="Label" parent="split/opts_panel/panels/display_opts" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_right = 97.0 +margin_bottom = 14.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 2 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 4 +text = "display options" +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 + +[node name="display_sep" type="HSeparator" parent="split/opts_panel/panels/display_opts" index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 18.0 +margin_right = 97.0 +margin_bottom = 22.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 + +[node name="window_size" type="Label" parent="split/opts_panel/panels/display_opts" index="2"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 26.0 +margin_right = 97.0 +margin_bottom = 40.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 2 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 4 +text = "window size" +align = 1 +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 + +[node name="window_size_menu" type="MenuButton" parent="split/opts_panel/panels/display_opts" index="3"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 44.0 +margin_right = 97.0 +margin_bottom = 60.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +custom_styles/hover = SubResource( 2 ) +custom_styles/pressed = ExtResource( 2 ) +custom_styles/focus = ExtResource( 2 ) +custom_styles/disabled = ExtResource( 2 ) +custom_styles/normal = ExtResource( 2 ) +toggle_mode = false +action_mode = 0 +enabled_focus_mode = 0 +shortcut = null +group = null +text = "> 1920x1080" +flat = false +align = 1 +items = [ "1920x1080", null, 0, false, false, -1, 0, null, "", false ] +_sections_unfolded = [ "custom_colors", "custom_constants", "custom_fonts", "custom_styles" ] + +[node name="sound_opts" type="VBoxContainer" parent="split/opts_panel/panels" index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 514.0 +margin_right = 611.0 +margin_bottom = 342.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 1 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +alignment = 0 + +[node name="sound_title" type="Label" parent="split/opts_panel/panels/sound_opts" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_right = 97.0 +margin_bottom = 14.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 2 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 4 +text = "sound options" +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 + +[node name="sound_sep" type="HSeparator" parent="split/opts_panel/panels/sound_opts" index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 18.0 +margin_right = 97.0 +margin_bottom = 22.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 + +[node name="master_vol_title" type="Label" parent="split/opts_panel/panels/sound_opts" index="2"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 26.0 +margin_right = 97.0 +margin_bottom = 40.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 2 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 4 +text = "master volume" +align = 1 +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 + +[node name="master_vol_slider" type="HSlider" parent="split/opts_panel/panels/sound_opts" index="3"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 44.0 +margin_right = 97.0 +margin_bottom = 60.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +focus_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 0 +min_value = 0.0 +max_value = 100.0 +step = 1.0 +page = 0.0 +value = 0.0 +exp_edit = false +rounded = false +editable = true +tick_count = 0 +ticks_on_borders = false +focus_mode = 2 + +[node name="music_vol_title" type="Label" parent="split/opts_panel/panels/sound_opts" index="4"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 64.0 +margin_right = 97.0 +margin_bottom = 78.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 2 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 4 +text = "music volume" +align = 1 +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 + +[node name="music_vol_slider" type="HSlider" parent="split/opts_panel/panels/sound_opts" index="5"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 82.0 +margin_right = 97.0 +margin_bottom = 98.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +focus_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 0 +min_value = 0.0 +max_value = 100.0 +step = 1.0 +page = 0.0 +value = 0.0 +exp_edit = false +rounded = false +editable = true +tick_count = 0 +ticks_on_borders = false +focus_mode = 2 + +[node name="sfx_vol_title" type="Label" parent="split/opts_panel/panels/sound_opts" index="6"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 102.0 +margin_right = 97.0 +margin_bottom = 116.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 2 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 4 +text = "sfx volume" +align = 1 +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 + +[node name="sfx_vol_slider" type="HSlider" parent="split/opts_panel/panels/sound_opts" index="7"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 120.0 +margin_right = 97.0 +margin_bottom = 136.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +focus_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 0 +min_value = 0.0 +max_value = 100.0 +step = 1.0 +page = 0.0 +value = 0.0 +exp_edit = false +rounded = false +editable = true +tick_count = 0 +ticks_on_borders = false +focus_mode = 2 + +[node name="back_btn" type="Button" parent="." index="1"] + +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -52.0 +margin_top = 130.0 +margin_right = 47.0 +margin_bottom = 150.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +focus_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +toggle_mode = false +enabled_focus_mode = 2 +shortcut = null +group = null +text = "back to menu" +flat = true +align = 1 +_sections_unfolded = [ "Rect", "Size Flags" ] +