()
| 78 | } |
| 79 | |
| 80 | private clickedFileSave(): void{ |
| 81 | // Save some special variables by calling the save() methods of various objects |
| 82 | this.getGame().save(); // Various variables owned by the game object |
| 83 | this.getGame().getPlayer().save(); // The player |
| 84 | |
| 85 | // We now show the warning |
| 86 | this.showFileSaveWarning = true; |
| 87 | |
| 88 | // Reset the textarea content |
| 89 | this.fileSaveTextareaContent = ""; |
| 90 | |
| 91 | // Write bools |
| 92 | for(var str in Saving.getAllBools()){ |
| 93 | if(this.fileSaveTextareaContent != "") this.fileSaveTextareaContent += ", "; // We add a comma if we're not adding the very first variable |
| 94 | this.fileSaveTextareaContent += "bool " + str + "=" + Saving.boolToString(Saving.getAllBools()[str]); |
| 95 | } |
| 96 | |
| 97 | // Write numbers |
| 98 | for(var str in Saving.getAllNumbers()){ |
| 99 | if(this.fileSaveTextareaContent != "") this.fileSaveTextareaContent += ", "; // We add a comma if we're not adding the very first variable |
| 100 | this.fileSaveTextareaContent += "number " + str + "=" + Saving.numberToString(Saving.getAllNumbers()[str]); |
| 101 | } |
| 102 | |
| 103 | // Write strings |
| 104 | for(var str in Saving.getAllStrings()){ |
| 105 | if(this.fileSaveTextareaContent != "") this.fileSaveTextareaContent += ", "; // We add a comma if we're not adding the very first variable |
| 106 | this.fileSaveTextareaContent += "string " + str + "=" + Saving.getAllStrings()[str]; |
| 107 | } |
| 108 | |
| 109 | // Update |
| 110 | this.update(); |
| 111 | this.getGame().updatePlace(); |
| 112 | } |
| 113 | |
| 114 | private clickedSave(): void{ |
| 115 | // Save on the selected slot |
nothing calls this directly
no test coverage detected