mirror of
https://github.com/Dadido3/noita-mapcap.git
synced 2024-11-22 21:17:33 +00:00
Fix some more stuff
- Rename CameraAPI.Pos to CameraAPI.GetPos - Change some EmmyLua annotations that are supposedly wrong - Remove debug printing - Other small fixes
This commit is contained in:
parent
98dfb5fbb0
commit
98370f6737
@ -76,7 +76,7 @@ end
|
|||||||
---@param viewportCenter Vec2|nil -- Result of `GameGetCameraPos()`. Will be queried automatically if set to nil.
|
---@param viewportCenter Vec2|nil -- Result of `GameGetCameraPos()`. Will be queried automatically if set to nil.
|
||||||
---@return Vec2 window
|
---@return Vec2 window
|
||||||
function Coords:ToWindow(world, viewportCenter)
|
function Coords:ToWindow(world, viewportCenter)
|
||||||
viewportCenter = viewportCenter or CameraAPI.Pos()
|
viewportCenter = viewportCenter or CameraAPI.GetPos()
|
||||||
|
|
||||||
local internalTopLeft, internalBottomRight = self:InternalRect()
|
local internalTopLeft, internalBottomRight = self:InternalRect()
|
||||||
local pixelScale = self:PixelScale()
|
local pixelScale = self:PixelScale()
|
||||||
@ -89,7 +89,7 @@ end
|
|||||||
---@param viewportCenter Vec2|nil -- Result of `GameGetCameraPos()`. Will be queried automatically if set to nil.
|
---@param viewportCenter Vec2|nil -- Result of `GameGetCameraPos()`. Will be queried automatically if set to nil.
|
||||||
---@return Vec2 world
|
---@return Vec2 world
|
||||||
function Coords:ToWorld(window, viewportCenter)
|
function Coords:ToWorld(window, viewportCenter)
|
||||||
viewportCenter = viewportCenter or CameraAPI.Pos()
|
viewportCenter = viewportCenter or CameraAPI.GetPos()
|
||||||
|
|
||||||
local internalTopLeft, internalBottomRight = self:InternalRect()
|
local internalTopLeft, internalBottomRight = self:InternalRect()
|
||||||
local pixelScale = self:PixelScale()
|
local pixelScale = self:PixelScale()
|
||||||
|
@ -47,12 +47,12 @@ function EntityRemoveComponent(entity_id, component_id) end
|
|||||||
function EntityGetAllComponents(entity_id) end
|
function EntityGetAllComponents(entity_id) end
|
||||||
---@param entity_id number
|
---@param entity_id number
|
||||||
---@param component_type_name string
|
---@param component_type_name string
|
||||||
---@param tag string ""
|
---@param tag string|nil
|
||||||
---@return number[]|nil component_id
|
---@return number[]|nil component_id
|
||||||
function EntityGetComponent(entity_id, component_type_name, tag) end
|
function EntityGetComponent(entity_id, component_type_name, tag) end
|
||||||
---@param entity_id number
|
---@param entity_id number
|
||||||
---@param component_type_name string
|
---@param component_type_name string
|
||||||
---@param tag string ""
|
---@param tag string|nil
|
||||||
---@return number|nil component_id
|
---@return number|nil component_id
|
||||||
function EntityGetFirstComponent(entity_id, component_type_name, tag) end
|
function EntityGetFirstComponent(entity_id, component_type_name, tag) end
|
||||||
---@param entity_id number
|
---@param entity_id number
|
||||||
@ -358,8 +358,8 @@ function AddMaterialInventoryMaterial(entity_id, material_name, count) end
|
|||||||
---@return number material_type
|
---@return number material_type
|
||||||
function GetMaterialInventoryMainMaterial(entity_id) end
|
function GetMaterialInventoryMainMaterial(entity_id) end
|
||||||
---@param strength number
|
---@param strength number
|
||||||
---@param x number camera_x
|
---@param x number|nil -- Defaults to camera position
|
||||||
---@param y number camera_y
|
---@param y number|nil -- Defaults to camera position
|
||||||
function GameScreenshake(strength, x, y) end
|
function GameScreenshake(strength, x, y) end
|
||||||
function GameOnCompleted() end
|
function GameOnCompleted() end
|
||||||
---@param id string
|
---@param id string
|
||||||
|
@ -28,7 +28,7 @@ end
|
|||||||
|
|
||||||
---Returns the center position of the viewport in world/virtual coordinates.
|
---Returns the center position of the viewport in world/virtual coordinates.
|
||||||
---@return Vec2
|
---@return Vec2
|
||||||
function CameraAPI.Pos()
|
function CameraAPI.GetPos()
|
||||||
return Vec2(GameGetCameraPos())
|
return Vec2(GameGetCameraPos())
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -42,10 +42,6 @@ package.loaded = package.loaded or {
|
|||||||
--os = os,
|
--os = os,
|
||||||
}
|
}
|
||||||
|
|
||||||
for k, v in pairs(package.loaded) do
|
|
||||||
print(k, v)
|
|
||||||
end
|
|
||||||
|
|
||||||
---Emulated require function in case the Lua API is restricted.
|
---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 usecases.
|
||||||
---@param modName string
|
---@param modName string
|
||||||
|
@ -92,7 +92,7 @@ end
|
|||||||
|
|
||||||
---
|
---
|
||||||
---@param componentTypeName string
|
---@param componentTypeName string
|
||||||
---@param tableOfComponentValues string[]|nil
|
---@param tableOfComponentValues string[]
|
||||||
---@return NoitaComponent|nil
|
---@return NoitaComponent|nil
|
||||||
function NoitaEntity:AddComponent(componentTypeName, tableOfComponentValues)
|
function NoitaEntity:AddComponent(componentTypeName, tableOfComponentValues)
|
||||||
local componentID = EntityAddComponent(self.ID, componentTypeName, tableOfComponentValues)
|
local componentID = EntityAddComponent(self.ID, componentTypeName, tableOfComponentValues)
|
||||||
@ -238,7 +238,7 @@ end
|
|||||||
---@return string[]
|
---@return string[]
|
||||||
function NoitaEntity:GetTags()
|
function NoitaEntity:GetTags()
|
||||||
---@type string
|
---@type string
|
||||||
local tagsString = EntityGetTags(self.ID)
|
local tagsString = EntityGetTags(self.ID) or ""
|
||||||
local result = {}
|
local result = {}
|
||||||
for tag in tagsString:gmatch('([^,]+)') do
|
for tag in tagsString:gmatch('([^,]+)') do
|
||||||
table.insert(result, tag)
|
table.insert(result, tag)
|
||||||
|
Loading…
Reference in New Issue
Block a user