From d69177cd3b1b7b05a800819d8a4d06cc51507ab5 Mon Sep 17 00:00:00 2001 From: David Vogel Date: Mon, 17 Apr 2023 11:19:16 +0200 Subject: [PATCH] Hide "Disable mod detection" in dev build --- LICENSE | 2 +- files/modification.lua | 7 ++++--- settings.lua | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/LICENSE b/LICENSE index cdb0cc1..d15f4ae 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019-2022 David Vogel +Copyright (c) 2019-2023 David Vogel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/files/modification.lua b/files/modification.lua index 2f5b89b..1e0f896 100644 --- a/files/modification.lua +++ b/files/modification.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2022 David Vogel +-- Copyright (c) 2022-2023 David Vogel -- -- This software is released under the MIT License. -- https://opensource.org/licenses/MIT @@ -23,6 +23,7 @@ local Memory = require("memory") local NXML = require("luanxml.nxml") local Utils = require("noita-api.utils") local Vec2 = require("noita-api.vec2") +local DebugAPI = require("noita-api.debug") ---------- -- Code -- @@ -255,14 +256,14 @@ function Modification.RequiredChanges() } end - if ModSettingGet("noita-mapcap.disable-shaders-gui-ai") then + if ModSettingGet("noita-mapcap.disable-shaders-gui-ai") and DebugAPI.IsDevBuild() then memory["mPostFxDisabled"] = 1 memory["mGuiDisabled"] = 1 memory["mFreezeAI"] = 1 memory["mTrailerMode"] = 1 -- Is necessary for chunks to correctly load when DEBUG_PAUSE_GRID_UPDATE is enabled. end - if ModSettingGet("noita-mapcap.disable-mod-detection") then + if ModSettingGet("noita-mapcap.disable-mod-detection") and not DebugAPI.IsDevBuild() then memory["enableModDetection"] = 0 else -- Don't actively (re)enable mod detection. diff --git a/settings.lua b/settings.lua index b650f6f..5955a10 100644 --- a/settings.lua +++ b/settings.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2022 David Vogel +-- Copyright (c) 2022-2023 David Vogel -- -- This software is released under the MIT License. -- https://opensource.org/licenses/MIT @@ -318,6 +318,7 @@ modSettings = { id = "disable-mod-detection", ui_name = " Disable mod detection", ui_description = "If enabled, Noita will behave as if no mods are enabled.\nTherefore secrets like the cauldron will be generated.", + hidden = DebugAPI.IsDevBuild(), value_default = false, scope = MOD_SETTING_SCOPE_RUNTIME, },