diff --git a/lib/control-stage.lua b/lib/control-stage.lua index c923e57..011be2d 100644 --- a/lib/control-stage.lua +++ b/lib/control-stage.lua @@ -11,7 +11,7 @@ require "compound-entities" ---@param entity LuaEntity ---@param sprite string ---@param time_to_live integer ----@param blink_interval integer +---@param blink_interval integer? py.draw_error_sprite = function(entity, sprite, time_to_live, blink_interval) return rendering.draw_sprite { sprite = sprite, diff --git a/lib/lib.lua b/lib/lib.lua index 67ff638..e3fc65b 100644 --- a/lib/lib.lua +++ b/lib/lib.lua @@ -290,11 +290,11 @@ if settings.startup["pypp-no-globals"].value then if not declaredNames[n] then if py.stage == "control" then -- temp - game.print(debug.traceback("attempt to write to undeclared global variable, please report it: " .. n, 2)) + game.print(debug.traceback("attempt to write to undeclared global variable, please report it\nIf this is intended, add it to the globals list in pypp/lib/lib.lua" .. n, 2)) -- end temp -- error("attempt to write to undeclared variable: " .. n, 2) end - log(debug.traceback("INFO: creating a new global variable: " .. n, 2)) + log(debug.traceback("INFO: creating a new global variable\nIf this is intended, add it to the globals list in pypp/lib/lib.lua" .. n, 2)) end rawset(t, n, v) -- do the actual set end, diff --git a/lib/metas/recipe.lua b/lib/metas/recipe.lua index 6891f7e..a91e3e2 100644 --- a/lib/metas/recipe.lua +++ b/lib/metas/recipe.lua @@ -18,7 +18,7 @@ local table_insert = table.insert ---@field public add_ingredient_amount fun(self: data.RecipePrototype, ingredient_name: string, increase: number): data.RecipePrototype ---@field public set_result_amount fun(self: data.RecipePrototype, result_name: string, amount: number): data.RecipePrototype ---@field public set_ingredient_amount fun(self: data.RecipePrototype, ingredient_name: string, amount: number): data.RecipePrototype ----@field public get_main_product fun(self: data.RecipePrototype, allow_multi_product: bool?): LuaItemPrototype?|LuaFluidPrototype? +---@field public get_main_product fun(self: data.RecipePrototype, allow_multi_product: boolean?): LuaItemPrototype?|LuaFluidPrototype? ---@field public get_icons fun(self: data.RecipePrototype): data.IconData local metas = {} @@ -371,6 +371,7 @@ metas.get_main_product = function(self, allow_multi_product) else -- or only result _, result = next(self.results) end + --[[@cast result data.ItemProductPrototype|data.ResearchProgressProductPrototype]] -- Special modding funtimes case: invalid spec if not (result.type == "research-progress" and result.research_item or result.name) then return end if result.type ~= nil and (result.type ~= "item" and result.type ~= "fluid" and result.type ~= "research-progress") then return end diff --git a/lib/metas/technology.lua b/lib/metas/technology.lua index 154ad5a..adbd497 100644 --- a/lib/metas/technology.lua +++ b/lib/metas/technology.lua @@ -1,9 +1,9 @@ ---@class data.TechnologyPrototype ---@field public standardize fun(): data.TechnologyPrototype ----@field public add_prereq fun(prereq_technology_name: string): data.TechnologyPrototype ----@field public remove_prereq fun(prereq_technology_name: string): data.TechnologyPrototype ----@field public remove_pack fun(science_pack_name: string): data.TechnologyPrototype ----@field public add_pack fun(science_pack_name: string): data.TechnologyPrototype +---@field public add_prereq fun(self, prereq_technology_name: string): data.TechnologyPrototype +---@field public remove_prereq fun(self, prereq_technology_name: string): data.TechnologyPrototype +---@field public remove_pack fun(self, science_pack_name: string): data.TechnologyPrototype +---@field public add_pack fun(self, science_pack_name: string): data.TechnologyPrototype ---@field dependencies string[] TECHNOLOGY = setmetatable(data.raw.technology, {