Redo functionality

Moderator: ickputzdirwech

Nikee
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sun Mar 04, 2018 11:41 am
Contact:

Re: Redo functionality

Post by Nikee »

NotRexButCaesar wrote: Mon Dec 21, 2020 3:52 am +1

I’ve found myself pressing control z once too many times and not having any idea what I just did, only to find a missing belt a few hours later.
Some hint to cancel undo actions: switch to map view, press shift and select with deconstruction planner all of your base. That will cancel planned deconstruction.
evg-zhabotinsky
Inserter
Inserter
Posts: 22
Joined: Wed Dec 09, 2020 3:53 pm
Contact:

Re: Redo functionality

Post by evg-zhabotinsky »

My reasons to want a "Redo" option:
1. I often habitually try to undo text edits, which results in in-world undo.
2. More rarely I try to undo other things in UIs, to the same effect.
3. Some edits are not recorded for undo, e.g. entity config changes, manually edited wires, and usually rotations. But I automatically try and undo the wrong thing.
4. To undo the "Undo" if it does something I didn't expect. And to just try instead of having to guess in advance what it would undo.
5. Just plain convenience, I change my mind sometimes.

Problem 1 is better fixed at the text field level.
Problem 2 is harder to properly fix, because many UI components (All except text fields?) lack the ability to get input focus. Even just blocking in-world undo would require implementing window focus and treating world as one of the windows.
Problem 3 is better fixed by recording everything for undo, but I suspect that is highly problematic.
Problem 4 of having to remember or guess can have other solutions than implementing "Redo", but just trying is by far the most intuitive and convenient.
And the 5th point is just a nice bonus to rendering all above be "non-problems" by implementing "Redo".

As to "how", can't the "Undo" be treated as any other edit but with its own separate "Undo history"? I can't be sure what the code looks like, but I suspect it is possible to basically instantiate most of the "undo" functionality once more without much new code.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Redo functionality

Post by eradicator »

evg-zhabotinsky wrote: Sun Aug 01, 2021 8:28 am 2. More rarely I try to undo other things in UIs, to the same effect.
3. Some edits are not recorded for undo, e.g. entity config changes, manually edited wires, and usually rotations. But I automatically try and undo the wrong thing.
4. To undo the "Undo" if it does something I didn't expect. And to just try instead of having to guess in advance what it would undo.
Yea. Things that aren't even recorded for undo are the worst. Fiddle with combinators / recipes / modules -> make an error, press undo -> undid something at the other end of the map that I changed half an hour ago and have long forgotten >_>.
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.
Sachertorte
Inserter
Inserter
Posts: 25
Joined: Wed Sep 06, 2017 2:53 pm
Contact:

Make Ctrl+Shift+Z do nothing

Post by Sachertorte »

Ctrl+Z undoes. Sometimes I'll instinctively press Ctrl+Shift+Z to redo, which obviously doesn't exist in the game. However, Factorio interprets Ctrl+Shift+Z as a superset of Ctrl+Z and undoes again, which was the opposite of my intent and may lead to me accidentally undoing lots of things. I'd love for Ctrl+Shift+Z to do nothing instead.
Koub
Global Moderator
Global Moderator
Posts: 7764
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Redo functionality

Post by Koub »

[Koub] Merged into older thread with similar suggestion.
Koub - Please consider English is not my native language.
mrvn
Smart Inserter
Smart Inserter
Posts: 5836
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Redo functionality

Post by mrvn »

ssilk wrote: Wed Mar 10, 2021 6:58 am Well, I didn’t explain it deep enough. I thought you will find it yourself after that hint.
It’s complicated, because other players can also undo/redo.

So let’s say two players. Both are building a big power plant. Player A undoes (is that a verb?) something. Player B puts something at the same location A has undone. Now A redoes it. What should happen? Just deny to “overwrite” it seems a bit too simple for me...

Now think that for more players and with blueprints and with many levels of undo/redo. It gets really confusing. :)
I think only admin should be allowed to undo/redo anything from another player and that should be an admin tool and not the standard keybinding.

If two players build in the same area then expect problems with undo/redo. There simply isn't a good way to decide when it's ok to undo/redo another players work.

That said undo/redo should still handle the case of player A placing a ghost, player B builds the ghost (personally or via bot), player A undos. So don't block an undo just because the last user of something is another player. I would say just try to undo and if something is blocking that then beep so the player has feedback that undo failed.


Also +1 of giving some visual feedback of where an undo happened. An icon on the (mini) map would be nice. An arrow pointing to it at the edge of the screen if it's off screen would be good too. An alert icon next to the toolbar would be great too. If you think you hit undo too often you can just click the alert icon and the view jumps to where the undo happened.

And then you would need a redo to undo the bad undo.

I think the two suggestions would go hand in hand really well.
Shadow_Man
Fast Inserter
Fast Inserter
Posts: 126
Joined: Fri Mar 02, 2018 2:55 pm
Contact:

Re: Redo functionality

Post by Shadow_Man »

+1
Add redo functionality with Ctrl+Shift+Z default hotkey.
FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2768
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Redo functionality

Post by FuryoftheStars »

Redo would be nice to have.

That said, as for the default hotkey being ctrl+shift+z, the default hotkey in 99% of programs I’ve used with an undo/redo use ctrl+y as redo. I’d rather that be the default key as it’s already engrained.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
mikehendi
Inserter
Inserter
Posts: 43
Joined: Sun Dec 21, 2014 4:41 pm
Contact:

add CTRL+Y [redo]

Post by mikehendi »

TL;DR
Add "redo" (CTRL+Y) to "un-undo" accidental CTRL+Z presses.

What ?
I love that the CTRL+Z hotkey was added to the copy/paste/cut arsenal a long while ago. However, not ALL operations can be undone with CTRL+Z, things like cable wiring, belt/inserter rotating, etc. However, as CTRL+Z is ingrained in the brain to undo the last change, sometimes it is accidentally pressed attempting to undo thes anyway, and after hearing the Undo sound, you experience the o-no-second... When the undo DIDN'T quite undo what you'd expect... Staring at the screen in horror, as you have NO idea what you just accidentally broke in your massive base... But you know one thing: Somewhere somehow a single belt is now missing, or a single underground pipe is now missing, or a single inserter is no longer there to feed an assembler... The bigger your factory is, the longer it will take to find the accident site (if at all), and the more "accurate" your builds are, the bigger the impact can be...

Hopefully you saved somehwere in the last 15 minutes, because reloading might be easier than tracking down the undo...

Why ?
It would be great if after an accidental CTRL+Z press, you could simply press CTRL+Y to fix whatever you accidentally just "undid", it would save a certain type of player lots of time scouring around the base in horror!
mikehendi
Inserter
Inserter
Posts: 43
Joined: Sun Dec 21, 2014 4:41 pm
Contact:

Re: add CTRL+Y [redo]

Post by mikehendi »

Sorry if this has been posted before, given the functional characters in the search command, I couldn't figure out how to search correctly (searching "CTRL+Y" returns every post containign just "CTRL", which are many)
User avatar
ickputzdirwech
Filter Inserter
Filter Inserter
Posts: 790
Joined: Sun May 07, 2017 10:16 am
Contact:

Re: Redo functionality

Post by ickputzdirwech »

[Ick] Merged into older thread with same suggestion.
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Redo functionality

Post by Qon »

ickputzdirwech wrote: Fri Oct 13, 2023 9:02 pm [Ick] Merged into older thread with same suggestion.
Move to implemented for 2.0, please?
Confirmation:
Image
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Post Reply

Return to “Implemented in 2.0”