Add mod setting to hide UI

This commit is contained in:
David Vogel 2022-07-29 17:37:58 +02:00
parent 62142101fc
commit 014cba54af
3 changed files with 19 additions and 1 deletions

View File

@ -99,7 +99,7 @@ function Check:Regular(interval)
end end
-- Request a restart if the user has changed specific mod settings. -- 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 for i, v in ipairs(restartModSettings) do
local settingID = "noita-mapcap." .. v local settingID = "noita-mapcap." .. v
if ModSettingGetNextValue(settingID) ~= ModSettingGet(settingID) then if ModSettingGetNextValue(settingID) ~= ModSettingGet(settingID) then

View File

@ -231,6 +231,17 @@ function Modification.RequiredChanges()
memory["mTrailerMode"] = 1 -- Is necessary for chunks to correctly load when DEBUG_PAUSE_GRID_UPDATE is enabled. memory["mTrailerMode"] = 1 -- Is necessary for chunks to correctly load when DEBUG_PAUSE_GRID_UPDATE is enabled.
end 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 return config, magic, memory, patches
end end

View File

@ -277,6 +277,13 @@ modSettings = {
value_default = DebugAPI.IsDevBuild(), -- Defaults to true in dev build, false in regular Noita. value_default = DebugAPI.IsDevBuild(), -- Defaults to true in dev build, false in regular Noita.
scope = MOD_SETTING_SCOPE_RUNTIME_RESTART, 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", id = "disable-physics",
ui_name = " Disable pixel and entity physics", ui_name = " Disable pixel and entity physics",