From 014cba54afaedaff57412c4ce47b09504468e489 Mon Sep 17 00:00:00 2001 From: David Vogel Date: Fri, 29 Jul 2022 17:37:58 +0200 Subject: [PATCH] Add mod setting to hide UI --- files/check.lua | 2 +- files/modification.lua | 11 +++++++++++ settings.lua | 7 +++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/files/check.lua b/files/check.lua index c7f6c3b..e2d66b2 100644 --- a/files/check.lua +++ b/files/check.lua @@ -99,7 +99,7 @@ function Check:Regular(interval) end -- Request a restart if the user has changed specific mod settings. - local restartModSettings = {"disable-background", "disable-physics", "disable-postfx"} + local restartModSettings = {"disable-background", "disable-ui", "disable-physics", "disable-postfx"} for i, v in ipairs(restartModSettings) do local settingID = "noita-mapcap." .. v if ModSettingGetNextValue(settingID) ~= ModSettingGet(settingID) then diff --git a/files/modification.lua b/files/modification.lua index 45027e5..813796f 100644 --- a/files/modification.lua +++ b/files/modification.lua @@ -231,6 +231,17 @@ function Modification.RequiredChanges() memory["mTrailerMode"] = 1 -- Is necessary for chunks to correctly load when DEBUG_PAUSE_GRID_UPDATE is enabled. end + -- Disables or hides most of the UI. + -- The game is still somewhat playable this way. + if ModSettingGet("noita-mapcap.disable-ui") then + magic["INVENTORY_GUI_ALWAYS_VISIBLE"] = "0" + magic["UI_BARS2_OFFSET_X"] = "100" + else + -- Reset to default. + magic["INVENTORY_GUI_ALWAYS_VISIBLE"] = "1" + magic["UI_BARS2_OFFSET_X"] = "-40" + end + return config, magic, memory, patches end diff --git a/settings.lua b/settings.lua index 93b8d3b..a06438b 100644 --- a/settings.lua +++ b/settings.lua @@ -277,6 +277,13 @@ modSettings = { value_default = DebugAPI.IsDevBuild(), -- Defaults to true in dev build, false in regular Noita. scope = MOD_SETTING_SCOPE_RUNTIME_RESTART, }, + { + id = "disable-ui", + ui_name = " Disable UI", + ui_description = "Hides and disables some of the UI.", + value_default = false, + scope = MOD_SETTING_SCOPE_RUNTIME_RESTART, + }, { id = "disable-physics", ui_name = " Disable pixel and entity physics",