diff --git a/.luacheckrc b/.luacheckrc index 5f9253e..f1d139a 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -39,7 +39,7 @@ stds["DT"] = { "easeOutCubic", "radian_lerp", "auto_lerp", "rand_utf8_string", "point_is_inside_oobb", }}, Managers = { fields = { - "mod", "event" + "mod", "event", "ui", }}, Mods = { fields = { lua = { fields = { "debug", "io", "ffi", "os" }}, @@ -47,6 +47,6 @@ stds["DT"] = { "require_store", }}, "Crashify","Keyboard","Mouse","Application","Color","Quarternion","Vector3","Vector2","RESOLUTION_LOOKUP", - "ModManager", "Utf8", + "ModManager", "Utf8", "Main", }, } diff --git a/scripts/mods/dmf/modules/dmf_options.lua b/scripts/mods/dmf/modules/dmf_options.lua index 48626a3..ab12726 100644 --- a/scripts/mods/dmf/modules/dmf_options.lua +++ b/scripts/mods/dmf/modules/dmf_options.lua @@ -249,8 +249,12 @@ dmf.on_setting_changed = function (setting_id) end dmf.load_developer_mode_settings = function () --@TODO: maybe move it to somewhere else? - Managers.mod._settings.developer_mode = dmf:get("developer_mode") Application.set_user_setting("mod_manager_settings", Managers.mod._settings) + + local mod_manager = Managers.mod + if mod_manager and mod_manager.set_developer_mode then + mod_manager:set_developer_mode(dmf:get("developer_mode")) + end end -- #################################################################################################################### @@ -280,3 +284,9 @@ dmf.initialize_options = function() dmf:set("dmf_initialized", true) end end + +-- If we're already in the game (likely a mod reload), we +-- can run the initialization immediately. +if Main._sm:current_state_name() == "StateGame" then + dmf.initialize_options() +end