Add comprehensive tests and optimizations for simulation and UI performance
- Introduced a new benchmark save script to create a stress test scenario with extreme values for simulation performance. - Added a full UI benchmark script to measure frame rates and performance metrics during UI interactions. - Implemented tests for coarse generations to ensure population transitions are handled correctly. - Created tests for extra parameters to validate the loading and application of configuration settings. - Developed simulation optimization tests to verify the efficiency of population drift and rounding mechanisms. - Added split optimization tests to ensure accurate allocation and rounding behavior in population management. - Included startup parameter tests to confirm the correct initialization of global parameters before scene readiness. - Enhanced the audit rounding ledger to compare selective and full rounding results for consistency.
This commit is contained in:
@@ -7,6 +7,8 @@ const SILENT_VOLUME_DB := -80.0
|
||||
@onready var music_button: TextureButton = $Media/Music
|
||||
@onready var sound_volume: HSlider = $Volume/SoundVolume
|
||||
@onready var music_volume: HSlider = $Volume/MusicVolume
|
||||
@onready var english_button: TextureButton = $Language/English
|
||||
@onready var russian_button: TextureButton = $Language/Russian
|
||||
@onready var effects_player: OwniverseEffectsPlayer = $"../../FXPlayer"
|
||||
@onready var music_player: OwniverseMusicPlayer = $"../../MusicPlayer"
|
||||
|
||||
@@ -17,6 +19,7 @@ func _ready() -> void:
|
||||
music_button.set_pressed_no_signal(bool(Global.Settings.music_enabled))
|
||||
sound_volume.set_value_no_signal(float(Global.Settings.sound_volume) * sound_volume.max_value)
|
||||
music_volume.set_value_no_signal(float(Global.Settings.music_volume) * music_volume.max_value)
|
||||
_update_locale_buttons()
|
||||
_apply_sound_settings()
|
||||
_apply_music_settings()
|
||||
|
||||
@@ -65,3 +68,14 @@ func _apply_bus_volume(bus_name: String, value: float) -> void:
|
||||
var normalized: float = clampf(value, 0.0, 1.0)
|
||||
var volume_db: float = SILENT_VOLUME_DB if is_zero_approx(normalized) else lerpf(MIN_VOLUME_DB, 0.0, normalized)
|
||||
AudioServer.set_bus_volume_db(bus_index, volume_db)
|
||||
|
||||
|
||||
func _on_change_locale_pressed(locale: String) -> void:
|
||||
Global.set_locale(locale)
|
||||
_update_locale_buttons()
|
||||
SaveManager.save_settings()
|
||||
|
||||
|
||||
func _update_locale_buttons() -> void:
|
||||
english_button.set_pressed_no_signal(Global.Locale == "en")
|
||||
russian_button.set_pressed_no_signal(Global.Locale == "ru")
|
||||
|
||||
Reference in New Issue
Block a user