From 4f3f5c594d3c5475b9d71cd71f48977795052294 Mon Sep 17 00:00:00 2001 From: David Vogel Date: Mon, 29 Jan 2024 16:27:06 +0100 Subject: [PATCH] Some QOL improvements - Always try to disable `application_rendered_cursor` - Only disable fullscreen when custom resolution is enabled in mod settings - Update Message:ShowWrongResolution message - Update README.md --- README.md | 8 -------- files/check.lua | 20 +++++++++++++------- files/message.lua | 3 +-- files/modification.lua | 10 +++++----- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 969e161..7ca08b3 100644 --- a/README.md +++ b/README.md @@ -189,14 +189,6 @@ This will cause fast moving objects to completely disappear, and slow moving obj To disable median blending, use the stitcher with `Blend tile limit` set to 1. This will cause the stitcher to only use the newest image tile for every resulting pixel. -### I always get the warning "The resolution changed" - -The message is to be expected when you change the resolution in the Noita settings without restarting the game. - -But it can also happen when you accidentally select the console window (using `noita_dev.exe`). -The mod uses the active/selected window of the Noita process for capturing, which in this case would make it take screenshots of the console. -This can be fixed by selecting the Noita window again, or by switching back and forth between console and the main Noita window. - ## Additional information The resulting stitched images are quite big. diff --git a/files/check.lua b/files/check.lua index 52ed657..9098b10 100644 --- a/files/check.lua +++ b/files/check.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2019-2023 David Vogel +-- Copyright (c) 2019-2024 David Vogel -- -- This software is released under the MIT License. -- https://opensource.org/licenses/MIT @@ -62,12 +62,12 @@ function Check:Regular(interval) -- Check if we have the required settings. local config, magic, patches = Modification.RequiredChanges() - --if config["fullscreen"] then - -- local expected = tonumber(config["fullscreen"]) - -- if expected ~= Coords.FullscreenMode then - -- Message:ShowSetNoitaSettings(Modification.AutoSet, string.format("Fullscreen mode %s. Expected %s.", Coords.FullscreenMode, expected)) - -- end - --end + if config["fullscreen"] then + local expected = tonumber(config["fullscreen"]) + if expected ~= Coords.FullscreenMode then + Message:ShowSetNoitaSettings(Modification.AutoSet, string.format("Fullscreen mode %s. Expected %s.", Coords.FullscreenMode, expected)) + end + end if config["window_w"] and config["window_h"] then local expected = Vec2(tonumber(config["window_w"]), tonumber(config["window_h"])) if expected ~= Coords.WindowResolution then @@ -86,6 +86,12 @@ function Check:Regular(interval) Message:ShowSetNoitaSettings(Modification.AutoSet, string.format("Screen shake intensity is %s, expected %s.", self.StartupConfig.screenshake_intensity, expected)) end end + if config["application_rendered_cursor"] then + local expected = config.application_rendered_cursor + if expected ~= self.StartupConfig.application_rendered_cursor then + Message:ShowSetNoitaSettings(Modification.AutoSet, string.format("Application rendered cursor is %s, expected %s.", self.StartupConfig.application_rendered_cursor, expected)) + end + end -- Magic numbers stuff doesn't need a forced restart, just a normal restart by the user. if magic["VIRTUAL_RESOLUTION_X"] and magic["VIRTUAL_RESOLUTION_Y"] then diff --git a/files/message.lua b/files/message.lua index 199ad71..57e254a 100644 --- a/files/message.lua +++ b/files/message.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2019-2022 David Vogel +-- Copyright (c) 2019-2024 David Vogel -- -- This software is released under the MIT License. -- https://opensource.org/licenses/MIT @@ -128,7 +128,6 @@ function Message:ShowWrongResolution(callback, desc) desc or "", " ", "To fix:", - "- Deselect and select the Noita window, or", "- restart Noita or revert the resolution change." }, Actions = { diff --git a/files/modification.lua b/files/modification.lua index a98c8cc..6f344b1 100644 --- a/files/modification.lua +++ b/files/modification.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2022-2023 David Vogel +-- Copyright (c) 2022-2024 David Vogel -- -- This software is released under the MIT License. -- https://opensource.org/licenses/MIT @@ -312,6 +312,7 @@ function Modification.RequiredChanges() config["internal_size_h"] = tostring(Vec2(ModSettingGet("noita-mapcap.internal-resolution")).y) config["backbuffer_width"] = config["window_w"] config["backbuffer_height"] = config["window_h"] + config["fullscreen"] = "0" magic["VIRTUAL_RESOLUTION_X"] = tostring(Vec2(ModSettingGet("noita-mapcap.virtual-resolution")).x) magic["VIRTUAL_RESOLUTION_Y"] = tostring(Vec2(ModSettingGet("noita-mapcap.virtual-resolution")).y) -- Set virtual offset to prevent/reduce not correctly drawn pixels at the window border. @@ -329,13 +330,12 @@ function Modification.RequiredChanges() magic["VIRTUAL_RESOLUTION_OFFSET_Y"] = "-1" end - -- Always expect a fullscreen mode of 0 (windowed). - -- Capturing will not work in fullscreen. - config["fullscreen"] = "0" - -- Also disable screen shake. config["screenshake_intensity"] = "0" + -- And disable the cursor being rendered by Noita itself, which would make it appear in screen captures. + config["application_rendered_cursor"] = "0" + magic["DRAW_PARALLAX_BACKGROUND"] = ModSettingGet("noita-mapcap.disable-background") and "0" or "1" -- These magic numbers seem only to work in the dev build.