Collect undo-able actions from the same tick into one action.

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
Smart Inserter
Smart Inserter
Posts: 4874
Joined: Tue Jul 12, 2016 9:03 am

Collect undo-able actions from the same tick into one action.

Post by eradicator »

Working on Eradicator's Belt Planner I've hit the undo-ability wall. Almost all scripted entity de-/construction is impossible to make undo-able for the player. The only thing that seems undoable is LuaPlayer.build_from_cursor() but this creates a seperate undo-action for every entity built this way (potentially hundreds) - but the player expects them all to be undone at once like a normal batch actions (blueprint, decon, ,upgrade, rail planner).

Lacking any ability to more directly interact with undo (LuaSurface.create_entity, LuaEntity.order_deconstruction, etc) it would be nice if at least build_from_cursor would act more like the user expects it to.

Related topics:
LuaPlayer.build_history [RW]. A way to read and edit the undo queue, Allow mods BP orders to be undo-able!
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Modding interface requests”