@@ -246,17 +246,6 @@ void Application::render() const {
246246
247247void Application::initialize () {
248248
249- #if defined(_HAVE_DISCORD_SDK)
250- auto discord_instance = DiscordInstance::initialize ();
251- if (not discord_instance.has_value ()) {
252- spdlog::warn (" Error initializing the discord instance, it might not be running: {}" , discord_instance.error ());
253- } else {
254- m_discord_instance = std::move (discord_instance.value ());
255- m_discord_instance->after_setup ();
256- }
257-
258- #endif
259-
260249 try_load_settings ();
261250 load_resources ();
262251 push_scene (scenes::create_scene (*this , SceneId::MainMenu, ui::FullScreenLayout{ *m_window }));
@@ -268,6 +257,21 @@ void Application::initialize() {
268257 ui::RelativeLayout{ window (), 0.0 , 0.0 , 0.1 , 0.05 }, false
269258 );
270259#endif
260+
261+ #if defined(_HAVE_DISCORD_SDK)
262+ if (m_settings.discord ) {
263+ auto discord_instance = DiscordInstance::initialize ();
264+ if (not discord_instance.has_value ()) {
265+ spdlog::warn (
266+ " Error initializing the discord instance, it might not be running: {}" , discord_instance.error ()
267+ );
268+ } else {
269+ m_discord_instance = std::move (discord_instance.value ());
270+ m_discord_instance->after_setup ();
271+ }
272+ }
273+
274+ #endif
271275}
272276
273277void Application::try_load_settings () {
@@ -281,20 +285,23 @@ void Application::try_load_settings() {
281285 spdlog::error (" unable to load settings from \" {}\" : {}" , settings_filename, result.error ());
282286 spdlog::warn (" applying default settings" );
283287 }
288+
289+ // apply settings
290+ m_music_manager.set_volume (m_settings.volume );
284291}
285292
286293void Application::load_resources () {
287294 constexpr auto fonts_size = 128 ;
288- const std::vector<std::tuple<FontId, std::string>> fonts {
295+ const std::vector<std::tuple<FontId, std::string>> fonts{
289296#if defined(__3DS__)
290297 // TODO: debug why the other font crashed, not on loading, but on trying to render text!
291- { FontId::Default, " LeroyLetteringLightBeta01.ttf" },
298+ { FontId::Default, " LeroyLetteringLightBeta01.ttf" },
292299#else
293300 { FontId::Default, " PressStart2P.ttf" },
294301#endif
295- { FontId::Arial, " arial.ttf " }, { FontId::NotoColorEmoji, " NotoColorEmoji .ttf" }, {
296- FontId::Symbola, " Symbola .ttf"
297- }
302+ { FontId::Arial, " arial .ttf" },
303+ { FontId::NotoColorEmoji, " NotoColorEmoji .ttf" },
304+ { FontId::Symbola, " Symbola.ttf " }
298305 };
299306 for (const auto & [font_id, path] : fonts) {
300307 const auto font_path = utils::get_assets_folder () / " fonts" / path;
0 commit comments