EngineOfDarkness / Stalker-Anomaly-Ltx-Loader

A Lua Script based Solution to change Vanilla Stalker Anomaly LTX Files
GNU General Public License v3.0
4 stars 0 forks source link

Allow Changesets to be nested one level #13

Closed EngineOfDarkness closed 3 years ago

EngineOfDarkness commented 3 years ago

Allow the ChangesetLoader to handle nested Changesets (so e.g. multiple Trader Files can be modified per script)

Somethink like

local someChangeA = Change("supplies_1", "device_pda_1", nil)
local someChangeB = Change("supplies_1", "device_pda_2", nil)

local a = Changeset({someChangeA}, "Sid", "Sid.ltx")
local b = Changeset({someChangeB}, "Barman", "Barman.ltx")

return Changeset({a, b}, "Barman & Sid")
EngineOfDarkness commented 3 years ago

Instead of what I've written in the first comment I created a new Object called ChangesetCollection, so basically

local someChangeA = Change("supplies_1", "device_pda_1", nil)
local someChangeB = Change("supplies_1", "device_pda_2", nil)

local a = Changeset({someChangeA}, "Sid", "Sid.ltx")
local b = Changeset({someChangeB}, "Barman", "Barman.ltx")

return ChangesetCollection({a, b})

The ChangesetLoader will then take care of handling Changesets or ChangesetCollection returned from the scripts methods