Lots of little tweaks and fixes
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
class_name SettingsMenu extends Control
|
||||
|
||||
const TEXT_SPEED_VALUES:Array[float] = [0.2, 1.0, 2.0]
|
||||
|
||||
@export var tabs:TabBar
|
||||
@export var tabControls:Array[Control]
|
||||
@export var checkInvertX:CheckBox
|
||||
@export var checkInvertY:CheckBox
|
||||
@export var sliderControllerSpeed:HSlider
|
||||
@export var sliderMouseSpeed:HSlider
|
||||
@export var optionTextSpeed:OptionButton
|
||||
|
||||
func _ready() -> void:
|
||||
tabs.tab_changed.connect(onTabChanged)
|
||||
@@ -17,8 +20,16 @@ func _ready() -> void:
|
||||
sliderMouseSpeed.value = SETTINGS.cameraSpeedMouse
|
||||
sliderControllerSpeed.value_changed.connect(func(v:float): SETTINGS.cameraSpeedController = v)
|
||||
sliderMouseSpeed.value_changed.connect(func(v:float): SETTINGS.cameraSpeedMouse = v)
|
||||
optionTextSpeed.select(_textSpeedToIndex(SETTINGS.textSpeed))
|
||||
optionTextSpeed.item_selected.connect(func(idx:int): SETTINGS.textSpeed = TEXT_SPEED_VALUES[idx])
|
||||
onTabChanged(tabs.current_tab)
|
||||
|
||||
func _textSpeedToIndex(speed:float) -> int:
|
||||
match speed:
|
||||
0.2: return 0
|
||||
2.0: return 2
|
||||
_: return 1
|
||||
|
||||
func _notification(what:int) -> void:
|
||||
if what == NOTIFICATION_VISIBILITY_CHANGED and visible:
|
||||
tabs.grab_focus()
|
||||
|
||||
Reference in New Issue
Block a user