forked from aarextiaokhiao/Factor-Num-Up
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexport_save.html
More file actions
41 lines (39 loc) · 1.7 KB
/
export_save.html
File metadata and controls
41 lines (39 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<head>
<title>Factor Num Up</title>
<link href="stylesheets/theme.css" rel="stylesheet">
<script>
function export_save() {
load_theme()
var savefile=localStorage.getItem("MTUyODU5MDI3OTE5MQ==")
document.getElementById("exportText").value=savefile
savefile=atob(savefile)
document.getElementById("decodedText").value=savefile
console.log("JSON-ified save:")
console.log(JSON.parse(savefile))
}
function encode_save() {
var unencoded_save=document.getElementById("decodedText").value
document.getElementById("exportText").value=btoa(unencoded_save)
console.log("JSON-ified save (before encoding):")
console.log(JSON.parse(unencoded_save))
}
function overwrite_save() {
localStorage.setItem("MTUyODU5MDI3OTE5MQ==",btoa(JSON.stringify(JSON.parse(document.getElementById("decodedText").value))))
document.getElementById("exportText").value="Your new savefile has delivered to main game. Please (re)load the main game."
}
</script>
<link id='theme' rel="stylesheet">
<script type="text/javascript" src="src/load_theme.js"></script>
</head>
<body onload='export_save()'>
<b style='font-size:36px'>Factor Num Up</b>
<div style='font-size:24px'>Export save <text style='color:#7f7f7f'>(in another way)</text></div>
<br>
If you are having problems for exporting your save, try using this method.<br>
If you found the bug, you can share it at my Discord server.<br>
<input id='exportText' style='width:480px' readonly></input><br><br>
Decoded save:<br>
<input id='decodedText' style='width:480px'></input><br>
<button onclick='encode_save()'>Encode save</button> <button onclick='overwrite_save()'>Overwrite save</button><br><br>
JSON-ified save (check in the console)<br>
</body>