Hiding the save button stops text being saved.
The Pixie
29 Jun 2016, 08:49Elsewhere Pertex challenged me to hide the Save button for on-line play. This is pretty easy to do, with either of these:
The game can still be saved, for example if the player types SAVE, but I was surprised to find that the game output does not get saved. The game state is saved, but not the text that has been generated during play.
I confirmed this by:
[list][*]Looking at the HTML source and establishing the text was not there, rather than merely hidden[/*:m]
[*]Putting a one second delay on the above code, so the button is present when the game loaded, and the text was still not there[/*:m]
[*]Creating a hide command that hides the save button, and confirming text is there for saves before the command is used, but not after; when reloaded the button reappears and text from that point on does get saved[/*:m][/list:u]
I thought if I showed the button, waited a second before saving, then waited another second before hidding the button that might work, but no. Changing the visibility to hidden does the same thing.
I have no idea why it does this. Is it be design? It does offer a way to control what gets saved; if an author does not want the text saved, here is a possible solution.
JS.eval ("$('#cmdSave').css('display', 'none');")
JS.eval ("$('#controlButtons').css('display', 'none');")
The game can still be saved, for example if the player types SAVE, but I was surprised to find that the game output does not get saved. The game state is saved, but not the text that has been generated during play.
I confirmed this by:
[list][*]Looking at the HTML source and establishing the text was not there, rather than merely hidden[/*:m]
[*]Putting a one second delay on the above code, so the button is present when the game loaded, and the text was still not there[/*:m]
[*]Creating a hide command that hides the save button, and confirming text is there for saves before the command is used, but not after; when reloaded the button reappears and text from that point on does get saved[/*:m][/list:u]
I thought if I showed the button, waited a second before saving, then waited another second before hidding the button that might work, but no. Changing the visibility to hidden does the same thing.
I have no idea why it does this. Is it be design? It does offer a way to control what gets saved; if an author does not want the text saved, here is a possible solution.
Alex
29 Jun 2016, 14:34That doesn't sound like intended behaviour, could you log it as a bug on GitHub?
HegemonKhan
29 Jun 2016, 22:46This might be useful too, as a lot of people complain about the long load times (which may be a bug, and already being looked at by Alex, from another thread), so maybe, it shouldn't be removed, as not having the game save and load the displayed text, might be welcomed by people, so their game loads faster, and/or they don't need to figure out (or get help from others) with dealing with the text (clearing the screen or savingloading it manually via encoding/decoding it).
Oops... should've read Pixie's last sentences, as he/she mentions this same thing.
Oops... should've read Pixie's last sentences, as he/she mentions this same thing.