Skip to content

Commit

Permalink
Some QOL improvements
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
Dadido3 committed Jan 29, 2024
1 parent f22ef05 commit 4f3f5c5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 22 deletions.
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
20 changes: 13 additions & 7 deletions files/check.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions files/message.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 = {
Expand Down
10 changes: 5 additions & 5 deletions files/modification.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down

0 comments on commit 4f3f5c5

Please sign in to comment.