fix: Ensure escoria#apply_settings only called in game not editor (#543)
Co-authored-by: balloonpopper <5151242+balloonpopper@users.noreply.github.com> Co-authored-by: Julian Murgia <the.straton@gmail.com>
This commit is contained in:
@@ -179,31 +179,32 @@ func new_game():
|
|||||||
#
|
#
|
||||||
# * p_settings: Loaded settings
|
# * p_settings: Loaded settings
|
||||||
func apply_settings(p_settings: ESCSaveSettings) -> void:
|
func apply_settings(p_settings: ESCSaveSettings) -> void:
|
||||||
logger.info("******* settings loaded")
|
if not Engine.is_editor_hint():
|
||||||
if p_settings != null:
|
logger.info("******* settings loaded")
|
||||||
settings = p_settings
|
if p_settings != null:
|
||||||
else:
|
settings = p_settings
|
||||||
settings = ESCSaveSettings.new()
|
else:
|
||||||
|
settings = ESCSaveSettings.new()
|
||||||
|
|
||||||
AudioServer.set_bus_volume_db(
|
AudioServer.set_bus_volume_db(
|
||||||
AudioServer.get_bus_index(BUS_MASTER),
|
AudioServer.get_bus_index(BUS_MASTER),
|
||||||
linear2db(settings.master_volume)
|
linear2db(settings.master_volume)
|
||||||
)
|
)
|
||||||
AudioServer.set_bus_volume_db(
|
AudioServer.set_bus_volume_db(
|
||||||
AudioServer.get_bus_index(BUS_SFX),
|
AudioServer.get_bus_index(BUS_SFX),
|
||||||
linear2db(settings.sfx_volume)
|
linear2db(settings.sfx_volume)
|
||||||
)
|
)
|
||||||
AudioServer.set_bus_volume_db(
|
AudioServer.set_bus_volume_db(
|
||||||
AudioServer.get_bus_index(BUS_MUSIC),
|
AudioServer.get_bus_index(BUS_MUSIC),
|
||||||
linear2db(settings.music_volume)
|
linear2db(settings.music_volume)
|
||||||
)
|
)
|
||||||
AudioServer.set_bus_volume_db(
|
AudioServer.set_bus_volume_db(
|
||||||
AudioServer.get_bus_index(BUS_SPEECH),
|
AudioServer.get_bus_index(BUS_SPEECH),
|
||||||
linear2db(settings.speech_volume)
|
linear2db(settings.speech_volume)
|
||||||
)
|
)
|
||||||
TranslationServer.set_locale(settings.text_lang)
|
TranslationServer.set_locale(settings.text_lang)
|
||||||
|
|
||||||
game_scene.apply_custom_settings(settings.custom_settings)
|
game_scene.apply_custom_settings(settings.custom_settings)
|
||||||
|
|
||||||
|
|
||||||
# Input function to manage specific input keys
|
# Input function to manage specific input keys
|
||||||
|
|||||||
Reference in New Issue
Block a user