Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Date: ???
Changes:
- Fix load failure with zh-cn locale. Resolves https://github.com/pyanodon/pybugreports/issues/1347
- Added py.spoilage_enabled() which checks for the feature flag and mod setting
- Added META:hide() and META:unhide() to hide/unhide the prototype from any in-game browser and factoriopedia
---------------------------------------------------------------------------------------------------
Version: 3.0.41
Date: 2025-12-28
Expand Down
14 changes: 14 additions & 0 deletions lib/metas/metas.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ local lib = {
---@field public set_fields fun(self: data.AnyPrototype, fields: table): data.AnyPrototype
---@field public set fun(self: data.AnyPrototype, field: string, value: any): data.AnyPrototype
---@field public delete fun(self: data.AnyPrototype)
---@field public hide fun(self: data.AnyPrototype): data.AnyPrototype
---@field public unhide fun(self: data.AnyPrototype): data.AnyPrototype

for _, meta in pairs(lib) do
meta.copy = function(self, new_name)
Expand Down Expand Up @@ -50,6 +52,18 @@ for _, meta in pairs(lib) do
meta.delete = function(self)
data.raw[self.type][self.name] = nil
end

meta.hide = function(self)
self.hidden = true
self.hidden_in_factoriopedia = true
return self
end

meta.unhide = function(self)
self.hidden = nil
self.hidden_in_factoriopedia = nil
return self
end
end

local metas = {}
Expand Down