progress on new options screen
This commit is contained in:
parent
6ed5743144
commit
69d6a4b4f7
12 changed files with 1000 additions and 39 deletions
101
objects/hud/options_screen_scholar.gd
Normal file
101
objects/hud/options_screen_scholar.gd
Normal file
|
@ -0,0 +1,101 @@
|
|||
extends Control
|
||||
|
||||
|
||||
onready var tabs: TabContainer = $"%Tabs"
|
||||
onready var select_tab: HBoxContainer = $"%SelectTab"
|
||||
# options nodes
|
||||
onready var rumble: HBoxContainer = $"%SelectRumble"
|
||||
onready var gore: HBoxContainer = $"%SelectGore"
|
||||
onready var fullscreen: HBoxContainer = $"%SelectFullscreen"
|
||||
onready var window_size: HBoxContainer = $"%SelectWindowSize"
|
||||
onready var scaling: HBoxContainer = $"%SelectScaling"
|
||||
onready var fade_speed: HBoxContainer = $"%SelectFadeSpeed"
|
||||
onready var border: Button = $"%SelectBorder"
|
||||
onready var scanlines: HBoxContainer = $"%SelectScanlines"
|
||||
onready var master_vol: HSlider = $"%SelectMasterVol"
|
||||
onready var music_vol: HSlider = $"%SelectMusicVol"
|
||||
onready var sound_vol: HSlider = $"%SelectSoundVol"
|
||||
onready var landing_sound: HBoxContainer = $"%SelectLandingSound"
|
||||
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
_init_values()
|
||||
yield(get_tree(), "idle_frame")
|
||||
$"%SelectTab".grab_focus()
|
||||
|
||||
|
||||
func _init_values() -> void:
|
||||
# game
|
||||
rumble.selection = Options.rumble
|
||||
gore.selection = Options.gore
|
||||
# video
|
||||
fullscreen.selection = 1 if Options.fullscreen else 0
|
||||
window_size.selection = int(Options.window_size) - 1
|
||||
scaling.selection = Options.scaling_mode
|
||||
fade_speed.selection = Options.transition_speed
|
||||
border._update()
|
||||
scanlines.selection = Options.scanlines
|
||||
# audio
|
||||
master_vol.value = Options.master_volume * 100.0
|
||||
music_vol.value = Options.music_volume * 100.0
|
||||
sound_vol.value = Options.sound_volume * 100.0
|
||||
landing_sound.selection = 1 if Options.landing_sound else 0
|
||||
|
||||
func _on_tab_selected(selection: int) -> void:
|
||||
tabs.current_tab = selection
|
||||
var tab = tabs.get_current_tab_control()
|
||||
var next = tab.get_node(tab.focus_next)
|
||||
if next:
|
||||
select_tab.focus_neighbour_bottom = select_tab.get_path_to(next)
|
||||
else:
|
||||
select_tab.focus_neighbour_bottom = @"."
|
||||
select_tab.update_focus_targets()
|
||||
|
||||
|
||||
#
|
||||
# GAME
|
||||
#
|
||||
func _on_Rumble_selected(selection) -> void:
|
||||
Options.rumble = selection
|
||||
|
||||
func _on_Gore_selected(selection) -> void:
|
||||
Options.gore = selection
|
||||
|
||||
|
||||
#
|
||||
# VIDEO
|
||||
#
|
||||
func _on_Fullscreen_selected(selection) -> void:
|
||||
Options.fullscreen = selection == 1 # true if 1, false otherwise
|
||||
|
||||
func _on_WindowSize_selected(selection) -> void:
|
||||
Options.window_size = float(selection + 1)
|
||||
|
||||
func _on_Scaling_selected(selection) -> void:
|
||||
Options.scaling_mode = selection
|
||||
|
||||
func _on_FadeSpeed_selected(selection) -> void:
|
||||
Options.transition_speed = selection
|
||||
|
||||
func _on_Border_selected(selection) -> void:
|
||||
Options.border = selection
|
||||
|
||||
func _on_Scanlines_selected(selection) -> void:
|
||||
Options.scanlines = selection
|
||||
|
||||
|
||||
#
|
||||
# AUDIO
|
||||
#
|
||||
func _on_MasterVol_value_changed(value: float) -> void:
|
||||
Options.master_volume = value * 0.01
|
||||
|
||||
func _on_MusicVol_value_changed(value: float) -> void:
|
||||
Options.music_volume = value * 0.01
|
||||
|
||||
func _on_SoundVol_value_changed(value: float) -> void:
|
||||
Options.sound_volume = value * 0.01
|
||||
|
||||
func _on_LandingSound_selected(selection) -> void:
|
||||
Options.landing_sound = selection == 1
|
Loading…
Add table
Add a link
Reference in a new issue