Undo question

  • BloodLust
    9th Jul 2011 Member 0 Permalink
    Just curious but how far does the ctrl-z undo feature go? I ask because i have the problem that i will make a mistake on something hit ctrl-z expecting it to revert back to last click and then suddenly its gone back far enough that i have to redo entire sections of things im working on....
  • lolzy
    9th Jul 2011 Former Staff 0 Permalink
    I think it records a back-up every 30 seconds. I am probably completely wrong.
  • Teking
    9th Jul 2011 Member 0 Permalink
    It records a back-up every simulation pause-start
  • boxmein
    9th Jul 2011 Former Staff 0 Permalink
    I've seen it being before some massive change, probably a time counter. To the source!
    Edit: Here's the code..

    if (sdl_key=='z'&&(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL))) // Undo
    {
    int cbx, cby, cbi;

    for (cbi=0; cbi parts[cbi] = cb_parts[cbi];

    for (cby = 0; cby for (cbx = 0; cbx pmap[cby][cbx] = cb_pmap[cby][cbx];

    for (cby = 0; cby<(YRES/CELL); cby++)<br /> for (cbx = 0; cbx<(XRES/CELL); cbx++)<br /> {
    vx[cby][cbx] = cb_vx[cby][cbx];
    vy[cby][cbx] = cb_vy[cby][cbx];
    pv[cby][cbx] = cb_pv[cby][cbx];
    hv[cby][cbx] = cb_hv[cby][cbx];
    bmap[cby][cbx] = cb_bmap[cby][cbx];
    emap[cby][cbx] = cb_emap[cby][cbx];
    }
    }
    Edited by boxmein, 2011-07-07 18:37:43
  • jacksonmj
    9th Jul 2011 Developer 0 Permalink
    It stores one undo step, which is updated every time you do a normal click (not using ctrl/shift).
    Edited by jacksonmj, 2011-07-07 19:12:28
  • vanquish349
    9th Jul 2011 Member 0 Permalink
    @jacksonmj (View Post)
    you should make it so lines and boxes also record it
  • ief015
    9th Jul 2011 Former Staff 0 Permalink
    @jacksonmj (View Post)
    This.

    I have made Undo save the state of the game before doing anything when you click. When you undo, it returns back a previous click.