options menu yakshaving

This commit is contained in:
Robin Hübner 2018-09-29 18:59:42 +02:00
parent cddc24af65
commit bb7723f541
2 changed files with 58 additions and 9 deletions

View File

@ -2,10 +2,61 @@ extends Control
var from_scene_name var from_scene_name
# game opts
onready var read_speed_slider = get_node("split/opts_panel/panels/game_opts/read_speed_slider")
# display opts
onready var window_size_menu = get_node("split/opts_panel/panels/display_opts/window_size_menu")
onready var window_mode_menu = get_node("split/opts_panel/panels/display_opts/window_mode_menu")
# audio opts
onready var master_slider = get_node("split/opts_panel/panels/sound_opts/master_vol_slider")
onready var music_slider = get_node("split/opts_panel/panels/sound_opts/music_vol_slider")
onready var sfx_slider = get_node("split/opts_panel/panels/sound_opts/sfx_vol_slider")
onready var back_btn = get_node("back_btn") onready var back_btn = get_node("back_btn")
func _ready(): func _ready():
# game opt connections
read_speed_slider.connect("changed", self, "_on_read_speed_changed")
# display opt connections
var size_popup = window_size_menu.get_popup()
size_popup.connect("id_pressed", self, "_on_window_size_menu_id_pressed")
var mode_popup = window_mode_menu.get_popup()
mode_popup.connect("id_pressed", self, "_on_window_mode_menu_id_pressed")
# music opt sliders
master_slider.value = Game.master_vol
music_slider.value = Game.music_vol
sfx_slider.value = Game.sfx_vol
master_slider.connect("changed", self, "_on_master_vol_changed")
music_slider.connect("changed", self, "_on_music_vol_changed")
sfx_slider.connect("changed", self, "_on_sfx_vol_changed")
# back to menu
back_btn.connect("pressed", self, "_on_back_pressed") back_btn.connect("pressed", self, "_on_back_pressed")
func _on_read_speed_changed(v):
pass
func _on_window_size_menu_id_pressed(id):
pass
func _on_window_mode_menu_id_pressed(id):
pass
func _on_master_vol_changed(v):
pass
func _on_music_vol_changed(v):
pass
func _on_sfx_vol_changed(v):
pass
func _on_back_pressed(): func _on_back_pressed():
Game.switch_scene_to(from_scene_name, false) Game.switch_scene_to(from_scene_name, false)

View File

@ -11,14 +11,14 @@ content_margin_right = -1.0
content_margin_top = -1.0 content_margin_top = -1.0
content_margin_bottom = -1.0 content_margin_bottom = -1.0
[sub_resource type="StyleBoxEmpty" id=3] [sub_resource type="StyleBoxEmpty" id=2]
content_margin_left = -1.0 content_margin_left = -1.0
content_margin_right = -1.0 content_margin_right = -1.0
content_margin_top = -1.0 content_margin_top = -1.0
content_margin_bottom = -1.0 content_margin_bottom = -1.0
[sub_resource type="StyleBoxFlat" id=2] [sub_resource type="StyleBoxFlat" id=3]
content_margin_left = -1.0 content_margin_left = -1.0
content_margin_right = -1.0 content_margin_right = -1.0
@ -47,7 +47,7 @@ anti_aliasing = true
anti_aliasing_size = 1 anti_aliasing_size = 1
_sections_unfolded = [ "Border", "Border Width", "Corner Radius", "Expand Margin" ] _sections_unfolded = [ "Border", "Border Width", "Corner Radius", "Expand Margin" ]
[node name="options_menu" type="Control"] [node name="options_menu" type="Control" index="0"]
anchor_left = 0.0 anchor_left = 0.0
anchor_top = 0.0 anchor_top = 0.0
@ -138,7 +138,6 @@ _sections_unfolded = [ "Size Flags" ]
[node name="game_opts" type="VBoxContainer" parent="split/opts_panel/panels" index="0"] [node name="game_opts" type="VBoxContainer" parent="split/opts_panel/panels" index="0"]
editor/display_folded = true
anchor_left = 0.0 anchor_left = 0.0
anchor_top = 0.0 anchor_top = 0.0
anchor_right = 0.0 anchor_right = 0.0
@ -274,7 +273,7 @@ mouse_filter = 0
mouse_default_cursor_shape = 0 mouse_default_cursor_shape = 0
size_flags_horizontal = 4 size_flags_horizontal = 4
size_flags_vertical = 4 size_flags_vertical = 4
custom_styles/focus = SubResource( 3 ) custom_styles/focus = SubResource( 2 )
custom_colors/font_color_disabled = Color( 0.472656, 0.472656, 0.472656, 1 ) custom_colors/font_color_disabled = Color( 0.472656, 0.472656, 0.472656, 1 )
custom_colors/font_color = Color( 1, 1, 1, 1 ) custom_colors/font_color = Color( 1, 1, 1, 1 )
custom_colors/font_color_hover = Color( 0, 0, 0, 1 ) custom_colors/font_color_hover = Color( 0, 0, 0, 1 )
@ -306,7 +305,6 @@ size_flags_vertical = 1
[node name="display_opts" type="VBoxContainer" parent="split/opts_panel/panels" index="2"] [node name="display_opts" type="VBoxContainer" parent="split/opts_panel/panels" index="2"]
editor/display_folded = true
anchor_left = 0.0 anchor_left = 0.0
anchor_top = 0.0 anchor_top = 0.0
anchor_right = 0.0 anchor_right = 0.0
@ -412,7 +410,7 @@ mouse_filter = 0
mouse_default_cursor_shape = 0 mouse_default_cursor_shape = 0
size_flags_horizontal = 1 size_flags_horizontal = 1
size_flags_vertical = 1 size_flags_vertical = 1
custom_styles/hover = SubResource( 2 ) custom_styles/hover = SubResource( 3 )
custom_styles/pressed = ExtResource( 3 ) custom_styles/pressed = ExtResource( 3 )
custom_styles/focus = ExtResource( 3 ) custom_styles/focus = ExtResource( 3 )
custom_styles/disabled = ExtResource( 3 ) custom_styles/disabled = ExtResource( 3 )
@ -483,7 +481,7 @@ mouse_filter = 0
mouse_default_cursor_shape = 0 mouse_default_cursor_shape = 0
size_flags_horizontal = 1 size_flags_horizontal = 1
size_flags_vertical = 1 size_flags_vertical = 1
custom_styles/hover = SubResource( 2 ) custom_styles/hover = SubResource( 3 )
custom_styles/pressed = ExtResource( 3 ) custom_styles/pressed = ExtResource( 3 )
custom_styles/focus = ExtResource( 3 ) custom_styles/focus = ExtResource( 3 )
custom_styles/disabled = ExtResource( 3 ) custom_styles/disabled = ExtResource( 3 )
@ -871,7 +869,7 @@ mouse_filter = 0
mouse_default_cursor_shape = 0 mouse_default_cursor_shape = 0
size_flags_horizontal = 1 size_flags_horizontal = 1
size_flags_vertical = 1 size_flags_vertical = 1
custom_styles/focus = SubResource( 3 ) custom_styles/focus = SubResource( 2 )
custom_colors/font_color_disabled = Color( 0.472656, 0.472656, 0.472656, 1 ) custom_colors/font_color_disabled = Color( 0.472656, 0.472656, 0.472656, 1 )
custom_colors/font_color = Color( 1, 1, 1, 1 ) custom_colors/font_color = Color( 1, 1, 1, 1 )
custom_colors/font_color_hover = Color( 0, 0, 0, 1 ) custom_colors/font_color_hover = Color( 0, 0, 0, 1 )