Page 1 of 1

Undo button does not undo landfill 0.17.62

Posted: Sun Aug 04, 2019 2:57 am
by Trebor
I misplaced a landfill then pressed the Undo button. Despite the button being labeled as 'Undo placement of landfill' it did not undo the landfill action.
Screen Shot 2019-08-03 at 10.51.51 PM.png
Screen Shot 2019-08-03 at 10.51.51 PM.png (365.31 KiB) Viewed 3240 times

Re: Undo button does not undo landfill 0.17.62

Posted: Sun Aug 04, 2019 4:29 am
by 5thHorseman
Sadly for you the bug here is that the button says that, not that it doesn't work.

"Undo" does not actually undo anything, it queues up whatever commands will cause the action to undo. There is no command to actually remove landfill, so that's why the button doesn't work.

Re: Undo button does not undo landfill 0.17.62

Posted: Sun Aug 04, 2019 5:00 am
by Optera
Before this inevitable will be flagged as "not a bug", here's my take on this as modder.

The API should allow mods like Waterfill to register actions to undo Landfills. If not this is should become an API request.

Re: Undo button does not undo landfill 0.17.62

Posted: Mon Aug 05, 2019 1:16 pm
by Trebor
Optera wrote: Sun Aug 04, 2019 5:00 am Before this inevitable will be flagged as "not a bug"
Oh, but it is a bug, even if the bug is a mislabeled button.

While I’d like the fix to be undoable landfill, I’ll except correct button text.

Re: Undo button does not undo landfill 0.17.62

Posted: Mon Aug 05, 2019 1:24 pm
by posila
Thanks for the report.
At first I was gonna change it so that if tile building can't be undone, it won't be added to the undo queue, but after experimenting with it a little bit, I decided it is not such a good idea and will move this to Minor issues instead.

The problem is, that if you expect landfill undo to work, and you hit Ctrl + Z after using landfill, an action that you did before landfilling would be undone, possibly without you noticing.
In addition to that ... if you make landfill ghosts, those can be undone until they are built to real tile, so it would have to be removed from the queue after that and it's not something the undo system can deal with at the moment.

Re: Undo button does not undo landfill 0.17.62

Posted: Wed Oct 30, 2019 7:47 pm
by eradicator
Just hit this myself trying to implement creative-style "instant undo". There being no event raised at all makes this impossible for landfill.
posila wrote: Mon Aug 05, 2019 1:24 pm The problem is, that if you expect landfill undo to work, and you hit Ctrl + Z after using landfill, an action that you did before landfilling would be undone, possibly without you noticing.
This is true, but the no-op "undo" has no feedback. Maybe a sound or flying text or big flashy icon or something could at least inform the user about what just (not) happend. And i wouldn't be too angry if some kind of event let my mod handle the situation ;).