feat: refactor numerous areas and tokenize string literals where possible; also fixes some small bugs (#487)

Co-authored-by: Duncan Brown <duncan@bhs-consultants.com>
This commit is contained in:
Duncan Brown
2022-02-04 11:10:40 -05:00
committed by GitHub
parent 7913aadb6d
commit 99dc1e0110
50 changed files with 1103 additions and 593 deletions

View File

@@ -44,8 +44,10 @@ func set_state(p_state: String, p_force: bool = false) -> void:
resource.loop_end = resource.mix_rate * resource.get_length()
elif "loop" in resource:
resource.loop = true
if ProjectSettings.has_setting("escoria/sound/music_volume"):
stream.volume_db = ProjectSettings.get_setting("escoria/sound/music_volume")
if escoria.project_settings_manager.has_setting(escoria.project_settings_manager.MUSIC_VOLUME):
stream.volume_db = escoria.project_settings_manager.get_setting(
escoria.project_settings_manager.MUSIC_VOLUME
)
stream.play()

View File

@@ -42,9 +42,11 @@ func set_state(p_state: String, p_force: bool = false):
if resource is AudioStreamSample:
resource.loop_mode = AudioStreamSample.LOOP_DISABLED
elif "loop" in resource:
resource.loop = false
if ProjectSettings.has_setting("escoria/sound/sound_volume"):
stream.volume_db = ProjectSettings.get_setting("escoria/sound/sound_volume")
resource.loop = false
if escoria.project_settings_manager.has_setting(escoria.project_settings_manager.SFX_VOLUME):
stream.volume_db = escoria.project_settings_manager.get_setting(
escoria.project_settings_manager.SFX_VOLUME
)
stream.play()