gfolf2/src/game/game_settings.gd

30 lines
1.2 KiB
GDScript3
Raw Normal View History

2024-12-08 23:21:05 +00:00
class_name GameSettingsType extends Node
## Container for project settings, for quick runtime access.
var free_camera_speed: float
var x_sensitivity: float
var y_sensitivity: float
var x_acceleration: float
var y_acceleration: float
var invert_pitch: bool
var enable_screen_shake: bool
var enable_hit_lag: bool
func _init() -> void:
ProjectSettings.settings_changed.connect(_read_settings)
func _read_settings() -> void:
free_camera_speed = ProjectSettings.get_setting("game/config/controls/camera/free_camera_speed")
x_sensitivity = ProjectSettings.get_setting("game/config/controls/camera/x_axis_sensitivity")
y_sensitivity = ProjectSettings.get_setting("game/config/controls/camera/y_axis_sensitivity")
x_acceleration = ProjectSettings.get_setting("game/config/controls/camera/x_axis_acceleration")
y_acceleration = ProjectSettings.get_setting("game/config/controls/camera/y_axis_acceleration")
invert_pitch = ProjectSettings.get_setting("game/config/controls/camera/invert_pitch")
enable_screen_shake = ProjectSettings.get_setting(
"game/config/accessibility/enable_screen_shake"
)
enable_hit_lag = ProjectSettings.get_setting("game/config/accessibility/enable_hit_lag")