-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kv-8-save-cmd-online-fix #1203
Closed
Closed
kv-8-save-cmd-online-fix #1203
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fix setBackground() so it changes "#rgb" to "#rrggbb" The functional bit of this revised code came from ThePix. #1052 --- NOTE: I did not modify this function in Prototypes/jsrunner/ui/playercore.js or WebPlayer\Mobile\playermobile.js
The old log is still in Quest 5.8. There is even still a button for it, but it just opens a blank window. It was left that way because the plan was to deprecate the `request` script, but that ended up being a no-go due to backwards compatibility. --- - Reinstated the old log functionality - Replaced concatenated string in JS with an array. - Replaced the popup (which messed up walkthroughs) with a normal HTML element, just beneath the command input element, with buttons to hide or print the log. - Added Quest function `ClearHtmlLog()` to empty the array and the HTML and hide the log div. - `game.nohtmllog` is set to `true` by default. Change it to `false` to enable the in-game log. - `game.writelogtofile` is set to `false` by default. Change it to true to write/append directly to a file in "Documents\Quest Logs" when using the desktop player, which comes in very handy if a game freezes or crashes! - `game.useconsolelog` is set to `false` by default. Change it to `true` to have the log send messages to the HTML dev tools console log.
Log function once again uses the log window in the desktop player The HTML functionality has been completely removed, with an option to use JS.console.log() now instead (game.useconsolelog, default false) If game.useconsolelog is set to true, the Log function will pass the text along via JS.console.log() -- (useconsolelog is false by default) If game.writelogtofile is true, each entry will be written/appended to a text document in "Documents\Quest Logs\" -- (writelogtofile is false by default) Removed the log_cmd command and all of its templates from the language files. (NOTE: I only found it in Dansk, Deutsch, English, Greek, and Italiano) Removed all log-related functions and code from playercore.js, with the exception of `getTimeAndDateForLog()`, which is still used.
The error message was "DictionaryAdd: Dictionary does not exist!" when it should be "DictionaryRemove: Dictionary does not exist!"
Update numerous template files' asl version from 550 to 580. (These were somehow missed during the update to 5.8)
There is a game-crashing bug in the transcript code I submitted for Quest 5.8.0. If playing online and the transcript is enabled, the game completely crashes (because `SaveTranscript` is only in desktop.js, and is therefore undefined in the web player). If playing in the desktop and the transcript is enabled, all turn scripts stop working completely and if a walkthrough is being recorded, the recorded steps are the HTML being output to the game. ALSO, there was a JS string variable named `transcriptString` which got larger and larger when adding the current text for the transcript every time text printed to the game. This obviously slowed things down. Plus, this text was also sent by `ASLEvent` to update `game.transcriptstring` each time text printed along with everything else. Also, the updated `clearScreen()` function in playercore.js was set up to save the cleared text and hide it rather than deleting it. This also negatively effected game performance exponentially as play progressed. The JS boolean `saveClearedText` is now set to false by default. Finally, if the VIEW TRANSCRIPT command was run while recording a walkthrough, the jQuery-UI popup would break the walkthrough during playback. The in-game HTML transcript feature has now been removed. There is no VIEW TRANSCRIPT command anymore. There is no longer a `transcriptString` JS variable, nor is there a `game.transcriptstring` attribute. The only way the transcript will work now is if the game is being played in the desktop player. It will save the transcript, and append it, every time text prints to the screen, to an TXT file in "Documents\Quest Transcripts", just as in 5.8.0 except it is now TXT rather than HTML. I also fixed my error in PlayerHTML.vb to make the file save under the transcript name the player chooses when enabling the transcript. I added a "fallback" of each function I added to Player\desktopplayer.js to WebPlayer\player.js. These functions do nothing and serve no purpose except to avoid possible errors due to being undefined. Also added a bit of code in `HandleCommand` to add the player's command to the transcript if `game.echocommand` is `false`. WalkthroughRunner.vb has been modified to ignore anything starting with "event:WhereAmI" to stop the walkthrough from causing odd behaviour. Player.vb has been modified to omit the "WhereAmI" event when recording walkthrough steps. I also added code to have the walkthrough ignore any function starting with "NoEventFunc" while running or recording, just in case authors would like other calls to `ASLEvent` to be ignored by the walkthrough. Updated the transcript doc page to reflect the changes. I triple checked things every way I could imagine in the desktop build as well as using VS to test the web player and the mobile version, but I haven't had anyone else test it. So, test it out, please. --- I almost forgot: If `saveClearedText` is changed to `true`, it will save the cleared text in #divOutput rather than dumping it. The `printScrollback()` JS function is still present. Calling it will use the player's device to print the everything in #divOutput (whether via a printer or saving it to PDF). Again, the scroll back will not contain any cleared text unless `saveClearedText` is changed from `false` to `true`. The scrollback JS functions are pretty much hidden, but an author could easily add code to allow their use in their game. --- All apologies to everyone for the bugs I introduced in Quest 5.8.0. I believe I have now fixed them all. --- See issue #1054 --- For reference, the commit where the transcript feature was introduced to Quest: a665d25
Now the transcript will save to a TXT file in "Documents\Quest Transcripts\" when using the desktop player, or to localStorage when using the web player or mobile. I added a Transcripts button the web player (next to the Save button) and to the mobile player in the More menu. The test game is here: TODO: CSS for the transcripts list window TODO: Should the Transcripts button disappear when the user has no transcripts in localStorage?
I had the Save and Transcripts buttons purposefully showing to test things in the web player via VS. I forgot to change it back before the last commit.
Changed the game object's attribute name from `notranscript` to `transcriptprohibited` to make the code easier to understand. Also changed the JS counterpart `noTranscript` to `transcriptProhibited`. Added a checkbox to the Quest GUI, providing the option for the author to prohibit the player from enabling the transcript. Fixed copy and paste errors in comments for new JS functions. --- Much thanks to @Pertex for all the feedback!
These files were not updated in the last commit due to a SAVE ALL mishap.
The button is no good. The site just needs a page for people to visit. (I have the page coded already, but I'm sure it can be improved, especially the CSS.) I think the checkbox in the GUI to prohibit the use of the transcript would: A) Never be used B) Just confuse new users Plus, the attribute `game.transcriptprohibited` is defined (false by default), and an author can just change that under the game's attributes in the GUI if desired.
Also upload revised playercore.js for WebPlayer, missing from the last commit.
- Added option to overwrite the transcript or log file - Changed ShowMenu to use JS.sendCommand when clicking the option link - Added code to HandleSingleCommand to handle a comment command within multiple commands - Fixed the bit in InitInterface that sets the JS transcript variables - Added an option to force command echoes to the transcript when game.echocommand is false - Added code to add any `alt` properties from image elements to the transcript (thanks to mrangel for helping me with this!)
- Update the transcript doc - Add fallbacks to avoid errors if old code is in someone's game file
Add `isLocalStorageAvailable()` function, to (hopefully) avoid any possible errors when attempting to access localStorage.
Add `transcript_forcecommands` set to `false` on `game` object. This is to save the "command echo" to the transcript if game.echocommand is false.
Previously changed `savingTranscript` to `transcriptEnabled`, and `game.savingtranscript` to `game.transcriptenabled`. This reverses those changes for backwards compatibility. I did the same with `game.transcriptprohibited` and `transcriptProhibited`. They have both been changed back to `game.notranscript` and `noTranscript`. I added `SaveTranscript` back to PlayerHTML to forward the data to `WriteToTranscript` for backwards compatibility.
For backward compatibility with Quest 5.8.0 games
Submitted by Pertex
For compatibility with 5.8.0
This makes it so a 5.8.1 game plays in 5.8.0 with no errors
This makes the save command behave exactly like the save button in the WebPlayer app. The desktop player is not effected (in fact, I removed bloat from the save command's script which was added in 5.8.0).
Change enter_verb back to enterverb, for compatibility with existing 5.8.0 games
Stop attempting to load a game if fileManager.GetFileForID returns null
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using the save command rather than the save button online, the existing in-game text which is saved is not restored when a saved game is loaded.
This makes the save command behave the same as the button -- but only when playing online. The desktop player still saves using
request
.Closes #1200