Eigenbahn / ai-dungeon-cli

:european_castle: A cli client to play.aidungeon.io
MIT License
149 stars 33 forks source link

Feature request for undo/redo/retry... #31

Open ifdog opened 4 years ago

ifdog commented 4 years ago

Hi, shall we have the feature of "redo/undo/retry/alter_action/alter_memory" that exists in official web interface and also API lib?

p3r7 commented 4 years ago

Hi there.

I had the idea of implementing it for quite a while but I'm stuck w/ one aspect. Anyway, thanks for explicitly logging the issue.

API-wise, I guess it's pretty straightforward to do. The problem is terminal display-wise.

Initially I thought about using the curses library to remove the undone / altered action. I've started playing around with on another side-project. But one big limitation is that this library is not compatible with Windows...

A saner approach would be to use directly lower-level escape sequences to be able to redisplay at a previous position in the terminal. What I don't know is if those escape sequences are cross-platform or *nix-only...

So I need to do some more research regarding this (rather esoteric) subject.

ifdog commented 4 years ago

Hi, some time ago I come across this one.not sure if it will help. https://github.com/peterbrittain/asciimatics

p3r7 commented 4 years ago

Looks like a promising solution.