[Plugin] UndoRedo

Post your completed addons to share with the community

Post » Mon Nov 04, 2013 2:50 am

@E13mental

rex_chess, rex_grid_move, rex_pause_dt are "behavior", not "plugin", please put them into "behaviors" folder.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Tue Dec 16, 2014 3:53 am

rexrainbow wrote:UndoRedo
(Update: 2013/04/05)

This plugin could help designer to add "undo/redo" feature more easily, it could used with canvas or chess/board (just for example).
- use "action: push" to push step into plugin
- if "condition: can undo" return true, use "expression:Undo" to get step from plugin.
- if "condition: can redo" return true, use "expression:Redo" to get step from plugin.
- set "Mode" to "Steps" if used in chess/board. "States" if used in canvas.


Used with canvas
Demo
- drag to draw circle, each touch end will be a "step"
- click undo / redo

Capx
To open this capx, user need to have
Plugin: canvas
Behavior: rex_canvasext
The "Mode" in properties table is "States"
- save/load whole image.


Used with chess/board
Demo
- click blue tile to move forward
- click undo / redo

Capx
To open this capx, user need to have
Plugin: rex_Board
Plugin: rex_board_squareTx
Plugin: rex_hash
Behavior: rex_chess
Behavior: rex_grid_move
The "Mode" in properties table is "Steps".
- Use "startLX" , "startLY" to get source logic position when undo.
- Use "endLX" , "endLY" to get target logic position when redo.



UndoRedo plugin could be used standalone, these dependence plugins/behaviors are only for opening these two sample capx.rexrainbow2013-04-05 00:37:07


Behavior: rex_canvasext
Isn't available, is there any onther way to download it?
B
5
Posts: 31
Reputation: 281

Post » Tue Dec 16, 2014 4:19 am

B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Fri Jan 16, 2015 2:10 am

awesome plugin rex, thanks :D
I have a question. How do I save it to web storage?
"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
46
S
10
G
1
Posts: 280
Reputation: 5,202

Post » Fri Jan 16, 2015 3:15 am

@puntodamar
Save:
Expression:ToString

Load:
Action:Load steps from JSON string


Edit:
Or it could be saved/loaded by official save/load feature.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Sat Jan 24, 2015 3:46 am

@rexrainbow

Can i use undo/redo plugin for total gamestate?
Rewinding the gameplay, then continue.
If so, how would it need to be set up?
B
56
S
20
G
13
Posts: 778
Reputation: 13,204

Post » Sat Jan 24, 2015 6:54 am

@Savvy001

Do you mean that using official saving feature, then push this save data into undo/redo plugin?

Edit

Here is a sample capx.
Since this plugin could not have "no save" feature, I save this plugin to webstorage temporarily.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Sat Jan 24, 2015 3:45 pm

@rexrainbow

That is exactly it.
Great sample.
Is there a way to set a limit so only the last (amount) steps get saved each time?
I want the players only to be able to go 10 steps back in time.
B
56
S
20
G
13
Posts: 778
Reputation: 13,204

Post » Sat Jan 24, 2015 3:53 pm

@Savvy001
Try to set "Max count" to 10 in properties table.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Sat Jan 24, 2015 4:41 pm

@rexrainbow

That simple :-)
Nice!!

Here is what i used the plugin for.
http://www.youtube.com/watch?v=hFu4iZP-Shc&feature=youtu.be

Thank u very much for the plugin and the support.
B
56
S
20
G
13
Posts: 778
Reputation: 13,204

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest