diff --git a/.vscode/settings.json b/.vscode/settings.json index 73d2a7a..9e5718a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,8 +5,10 @@ "autosetup", "backbuffer", "basicfont", + "bytecode", "cheggaaa", "dofile", + "dont", "Downscales", "downscaling", "DPMM", @@ -23,21 +25,33 @@ "lann", "ldflags", "linearize", + "longleg", "lowram", + "luanxml", "manifoldco", "mapcap", + "Metamethods", + "metaobject", + "Metatable", "nfnt", "Niccoli", "noita", + "Nolla", "NXML", + "pixelated", "polymorphed", "promptui", "rasterizer", + "Regen", + "respawn", "savegames", "schollz", + "screenshake", "svenstaro", "tcnksm", "tdewolff", + "unstitchable", + "upscaled", "Vogel", "Voronoi", "xmax", @@ -50,5 +64,47 @@ "Lua.format.defaultConfig": { "max_line_length": "512" }, - "Lua.workspace.ignoreSubmodules": false + "Lua.workspace.ignoreSubmodules": false, + "cSpell.enabledLanguageIds": [ + "asciidoc", + "c", + "cpp", + "csharp", + "css", + "elixir", + "erlang", + "git-commit", + "go", + "graphql", + "handlebars", + "haskell", + "html", + "jade", + "java", + "javascript", + "javascriptreact", + "json", + "jsonc", + "jupyter", + "latex", + "less", + "markdown", + "php", + "plaintext", + "python", + "pug", + "restructuredtext", + "rust", + "scala", + "scss", + "scminput", + "swift", + "text", + "typescript", + "typescriptreact", + "vue", + "yaml", + "yml", + "lua" + ] } \ No newline at end of file diff --git a/files/capture.lua b/files/capture.lua index 61ed11d..21c2eb8 100644 --- a/files/capture.lua +++ b/files/capture.lua @@ -350,7 +350,7 @@ local function captureModifyEntities(file, modify, x, y, radius) file:write(",\n\t", JSON.Marshal(rootEntity), "\n", "]") end - -- Disabling this component will prevent entites from being killed/reset when they go offscreen. + -- Disabling this component will prevent entities from being killed/reset when they go offscreen. -- If they are reset, all tags will be reset and we may capture these entities multiple times. -- This has some side effects, like longleg.xml and zombie_weak.xml will respawn every revisit, as their spawner doesn't get deleted. (Or something similar to this) local components = rootEntity:GetComponents("CameraBoundComponent") diff --git a/files/check.lua b/files/check.lua index cebca58..9968c84 100644 --- a/files/check.lua +++ b/files/check.lua @@ -47,7 +47,7 @@ function Check:Regular(interval) self.Counter = interval -- Remove some messages, so they will automatically disappear when the problem is solved. - Message:CloseAutoclose() + Message:CloseAutoClose() -- Compare Noita config and actual window resolution. local topLeft, bottomRight = ScreenCap.GetRect() -- Actual window client area. @@ -83,7 +83,7 @@ function Check:Regular(interval) if config["screenshake_intensity"] then local expected = config.screenshake_intensity if expected ~= self.StartupConfig.screenshake_intensity then - Message:ShowSetNoitaSettings(Modification.AutoSet, string.format("Screenshake intensity is %s, expected %s.", self.StartupConfig.screenshake_intensity, expected)) + Message:ShowSetNoitaSettings(Modification.AutoSet, string.format("Screen shake intensity is %s, expected %s.", self.StartupConfig.screenshake_intensity, expected)) end end diff --git a/files/libraries/coordinates.lua b/files/libraries/coordinates.lua index 9b19966..44f4e2c 100644 --- a/files/libraries/coordinates.lua +++ b/files/libraries/coordinates.lua @@ -126,7 +126,7 @@ function Coords:PixelScale() end ---Converts the given virtual/world coordinates into window/screen coordinates. ----@param world Vec2 -- World coordiante, origin is near the cave entrance. +---@param world Vec2 -- World coordinate, origin is near the cave entrance. ---@param viewportCenter Vec2|nil -- Result of `GameGetCameraPos()`. Will be queried automatically if set to nil. ---@return Vec2 window function Coords:ToWindow(world, viewportCenter) diff --git a/files/libraries/memory.lua b/files/libraries/memory.lua index 2933f32..fb11915 100644 --- a/files/libraries/memory.lua +++ b/files/libraries/memory.lua @@ -47,12 +47,12 @@ Memory.PAGE_WRITECOMBINE = 0x400 ---@param newProtect integer ---@return ffi.cdata* oldProtect function Memory.VirtualProtect(addr, size, newProtect) - local oldprotect = ffi.new('DWORD[1]') - if not ffi.C.VirtualProtect(addr, size, newProtect, oldprotect) then + local oldProtect = ffi.new('DWORD[1]') + if not ffi.C.VirtualProtect(addr, size, newProtect, oldProtect) then error(string.format("failed to call VirtualProtect(%s, %s, %s)", addr, size, newProtect)) end - return oldprotect + return oldProtect end return Memory diff --git a/files/libraries/noita-api/camera.lua b/files/libraries/noita-api/camera.lua index 9d5b70e..3cdfbaa 100644 --- a/files/libraries/noita-api/camera.lua +++ b/files/libraries/noita-api/camera.lua @@ -18,7 +18,7 @@ local CameraAPI = {} --- ---@param strength number ---@param position Vec2|nil -- Defaults to camera position if not set. -function CameraAPI.Screenshake(strength, position) +function CameraAPI.ScreenShake(strength, position) if position == nil then return GameScreenshake(strength) end diff --git a/files/libraries/noita-api/compatibility.lua b/files/libraries/noita-api/compatibility.lua index 9ad3cb9..50cb7c2 100644 --- a/files/libraries/noita-api/compatibility.lua +++ b/files/libraries/noita-api/compatibility.lua @@ -64,7 +64,7 @@ local oldRequire = require local recursionSet = {} ---Emulated require function in case the Lua API is restricted. ----It's probably good enough for most usecases. +---It's probably good enough for most use cases. --- ---We need to override the default require in any case, as only dofile and loadfile can access stuff in the virtual filesystem. ---@param modName string diff --git a/files/libraries/noita-api/component.lua b/files/libraries/noita-api/component.lua index 8b5dc92..155c9f1 100644 --- a/files/libraries/noita-api/component.lua +++ b/files/libraries/noita-api/component.lua @@ -64,7 +64,7 @@ function NoitaComponent:SetValue(fieldName, ...) return ComponentSetValue2(self.ID, fieldName, ...) -- TODO: Rework Noita API to handle vectors, and use a vector instead of shitty multi value arguments end ----Returns one or many values matching the type or subtypes of the requested field in a component subobject. +---Returns one or many values matching the type or subtypes of the requested field in a component sub-object. ---Reports error and returns nil if the field type is not supported or 'object_name' is not a metaobject. --- ---Reporting errors means that it spams the stdout with messages, instead of using the lua error handling. Thanks Nolla. @@ -75,7 +75,7 @@ function NoitaComponent:ObjectGetValue(objectName, fieldName) return ComponentObjectGetValue2(self.ID, objectName, fieldName) -- TODO: Rework Noita API to handle vectors, and return a vector instead of some shitty multi value result end ----Sets the value of a field in a component subobject. Value(s) should have a type matching the field type. +---Sets the value of a field in a component sub-object. Value(s) should have a type matching the field type. ---Reports error if the values weren't given in correct type, the field type is not supported or 'object_name' is not a metaobject. ---@param objectName string ---@param fieldName string diff --git a/files/libraries/noita-api/debug.lua b/files/libraries/noita-api/debug.lua index 78e4e7c..2dc0e68 100644 --- a/files/libraries/noita-api/debug.lua +++ b/files/libraries/noita-api/debug.lua @@ -48,7 +48,7 @@ end ---Enables the trailer mode and some other things: --- ---- - Disables ingame GUI. +--- - Disables in-game GUI. --- - Opens fog of war everywhere (Not the same as disabling it completely). --- - Enables `mTrailerMode`, whatever that does. --- diff --git a/files/libraries/noita-api/entity.lua b/files/libraries/noita-api/entity.lua index 4a60f0c..ff9527c 100644 --- a/files/libraries/noita-api/entity.lua +++ b/files/libraries/noita-api/entity.lua @@ -327,7 +327,7 @@ end ---Creates a component of type 'component_type_name' and adds it to 'entity_id'. ---'table_of_component_values' should be a string-indexed table, where keys are field names and values are field values of correct type. ----The value setting works like ComponentObjectSetValue2(), with the exception that multivalue types are not supported. +---The value setting works like ComponentObjectSetValue2(), with the exception that multi value types are not supported. ---Additional supported values are _tags:comma_separated_string and _enabled:bool, which basically work like the those fields work in entity XML files. ---Returns the created component, if creation succeeded, or nil. ---@param componentTypeName string diff --git a/files/libraries/noita-api/utils.lua b/files/libraries/noita-api/utils.lua index 429de70..e32e45c 100644 --- a/files/libraries/noita-api/utils.lua +++ b/files/libraries/noita-api/utils.lua @@ -3,7 +3,7 @@ -- This software is released under the MIT License. -- https://opensource.org/licenses/MIT --- This contains just some utilitites that may be useful to have. +-- This contains just some utilities that may be useful to have. local DebugAPI = require("noita-api.debug") diff --git a/files/message.lua b/files/message.lua index 8042e39..4bc12cb 100644 --- a/files/message.lua +++ b/files/message.lua @@ -17,13 +17,13 @@ local Coords = require("coordinates") -- Code -- ---------- ----Removes all messages with the autoclose flag. +---Removes all messages with the AutoClose flag. ---Use this before you recreate all auto closing messages. -function Message:CloseAutoclose() +function Message:CloseAutoClose() self.List = self.List or {} for k, message in pairs(self.List) do - if message.Autoclose then + if message.AutoClose then self.List[k] = nil end end @@ -64,7 +64,7 @@ function Message:ShowResetNoitaSettings() Lines = { "You requested to reset some game settings like:", "- Custom resolutions", - "- Screenshake intensity", + "- Screen-shake intensity", " ", "Press the following button to reset the settings and close Noita automatically:", }, @@ -94,7 +94,7 @@ function Message:ShowSetNoitaSettings(callback, desc) Actions = { { Name = "Setup and close (May corrupt current save!)", Hint = nil, HintDesc = nil, Callback = callback }, }, - Autoclose = true, -- This message will automatically close. + AutoClose = true, -- This message will automatically close. } end @@ -111,7 +111,7 @@ function Message:ShowRequestRestart(desc) " ", "To resolve this issue, restart the game.", }, - Autoclose = true, -- This message will automatically close. + AutoClose = true, -- This message will automatically close. } end @@ -132,7 +132,7 @@ function Message:ShowWrongResolution(callback, desc) Actions = { { Name = "Query settings again", Hint = nil, HintDesc = nil, Callback = function() Coords:ReadResolutions() end }, }, - Autoclose = true, -- This message will automatically close. + AutoClose = true, -- This message will automatically close. } end @@ -162,7 +162,7 @@ function Message:ShowGeneralSettingsProblem(...) self.List["GeneralSettingsProblem"] = { Type = "hint", Lines = { ... }, - Autoclose = true, -- This message will automatically close. + AutoClose = true, -- This message will automatically close. } end @@ -177,7 +177,7 @@ function Message:ShowGeneralInstallationProblem(...) } end ----Tell the user that some modifications couldn't be applied because it is unsupported. +---Tell the user that some modification couldn't be applied because it is unsupported. ---@param realm "config"|"magicNumbers"|"processMemory"|"filePatches" ---@param name string ---@param value any diff --git a/files/modification.lua b/files/modification.lua index f092e16..531eef6 100644 --- a/files/modification.lua +++ b/files/modification.lua @@ -213,7 +213,7 @@ function Modification.RequiredChanges() -- Capturing will not work in fullscreen. config["fullscreen"] = "0" - -- Also disable screenshake. + -- Also disable screen shake. config["screenshake_intensity"] = "0" magic["DRAW_PARALLAX_BACKGROUND"] = ModSettingGet("noita-mapcap.disable-background") and "0" or "1" diff --git a/files/ui.lua b/files/ui.lua index 4b2015a..e766c97 100644 --- a/files/ui.lua +++ b/files/ui.lua @@ -8,7 +8,7 @@ ----------------------- -- TODO: Wrap Noita utilities and wrap them into a table: https://stackoverflow.com/questions/9540732/loadfile-without-polluting-global-environment -require("utilities") -- Loads Noita's utilities from `data/scripts/lib/utilitites.lua`. +require("utilities") -- Loads Noita's utilities from `data/scripts/lib/utilities.lua`. -------------------------- -- Load library modules -- @@ -146,7 +146,7 @@ function UI:_DrawMessages(messages) end GuiLayoutEnd(gui) - if not message.Autoclose then + if not message.AutoClose then local clicked = GuiImageButton(gui, self:_GenID(), 5, 0, "", "mods/noita-mapcap/files/ui-gfx/dismiss-8x8.png") --GuiTooltip(gui, "Dismiss message", "") if clicked then messages[key] = nil end @@ -196,7 +196,7 @@ function UI:Draw() local gui = self.gui -- Skip drawing if we are asked to do so. - -- TODO: Find a way to susped UI drawing, but still being able to receive events + -- TODO: Find a way to suspend UI drawing, but still being able to receive events if self.suspendFrames and self.suspendFrames > 0 then self.suspendFrames = self.suspendFrames - 1 return end self.suspendFrames = nil diff --git a/settings.lua b/settings.lua index c5f6b61..b650f6f 100644 --- a/settings.lua +++ b/settings.lua @@ -75,7 +75,7 @@ modSettings = { { id = "capture-mode-spiral-origin", ui_name = " Origin", - ui_description = "The starting point or center of the spiral.\n- Current position: Your ingame position.\n- World origin: Near the cave entrance.\n- Custom position: Enter your own coordinates.", + ui_description = "The starting point or center of the spiral.\n- Current position: Your in-game position.\n- World origin: Near the cave entrance.\n- Custom position: Enter your own coordinates.", value_default = "current", values = { { "current", "Current position" }, { "0", "World origin" }, { "custom", "Custom position" } }, scope = MOD_SETTING_SCOPE_RUNTIME,