Patch to enable history button for all saves

  • Sparkette
    23rd Aug 2011 Member 0 Permalink
    Seeing as the server lets you manually get the history for any save, rather than just your own (search for history:saveid) I created a patch to fix this oversight in the UI. After applying the patch and compiling, the history (calendar) button will appear next to every save in the save browser, rather than just your own. I tried to push it to github, but I got a 403 Forbidden error, so I assume I need to be an admin or something in order to push. The patch is for interface.c.

    Patch can be found here: http://pastebin.com/QwrCu44g
    This patch might work better, but I haven't tested it: http://pastebin.com/4vz8yEqd

    Information on how to use this kind of patch in case you don't know: http://jungels.net/articles/diff-patch-ten-minutes.html

    EDIT: You can find a screenshot of what this patch does at http://i.imgur.com/u3aWZ.png
    A pre-compiled binary (Mac only, sorry) is available at http://www.mediafire.com/?8ynrxnb697799yy
  • vanquish349
    23rd Aug 2011 Member 0 Permalink
    not everyone knows how to compile, so people like it better if you post binarys
  • Sparkette
    23rd Aug 2011 Member 0 Permalink
    I know, I was having trouble compiling too, but when I compiled it I had to disable some things to get it to work, like Lua and something related to gravity (though gravity still works.) Also, I have a Mac, so the binary would only work on a Mac since I don't know how to cross-compile. But in case you have a Mac, or someone else who wants a binary does, here you go: http://www.mediafire.com/?8ynrxnb697799yy
  • vanquish349
    23rd Aug 2011 Member 0 Permalink
    also would it be possible if you post the full source, i am to lazy to learn how to use the patch command
  • Sparkette
    23rd Aug 2011 Member 0 Permalink
    It's actually explained in that link I posted, but here you go: http://pastebin.com/NnV6i1Rs
  • jacksonmj
    23rd Aug 2011 Developer 0 Permalink
    Not an oversight, there's a reason why the history button isn't enabled for all saves.

    Your previous thread: https://powdertoy.co.uk/Discussions/Thread/View.html?Thread=5411

    Simon:

    History hits the server with a lot of load, the history button is hidden because it would otherwise be used a lot more, also most people aren't looking for previous versions of saves.



    Edit: the if statement a bit further up (around mp = -1; dap = pos;) also needs changing to make the button work.
  • Sparkette
    23rd Aug 2011 Member 0 Permalink
    Oh yeah, I forgot about that thread. Hadn't checked it since the post about server load was made. Sorry about that. On the bright side, I doubt enough people are going to use this patch for it to make a difference. Though if most people aren't looking for previous versions of saves, as Simon said, it probably wouldn't make much of a difference anyway, right?
  • yangbowen1
    15th May 2012 Member 0 Permalink
    @flarn2006 (View Post)

    The problem with lua is ABLE TO CORRECT
    by changing all (void*) in luaconsole.c into (typ0e*).
    For example, (particle*)

    "type" is the type of the variable following.
  • mniip
    15th May 2012 Developer 0 Permalink
    variables from luacfunctions are returned other way :I