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 BrownandDuncan Brown authored and GitHub committed 2022-02-04 17:10:40 +01:00
1 parent 7913aadb6d
commit 99dc1e0110
50 files changed
+1103 -593

No files matched your search

@@ -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()
@@ -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()