Skip to content

Commit 42ef83e

Browse files
committedJun 30, 2020
Added Restore Point feature
1 parent 10793d5 commit 42ef83e

12 files changed

+45
-316
lines changed
 

‎dist/evolve.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/main.js

+1-304
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "evolveidle",
3-
"version": "0.9.1",
3+
"version": "0.9.2",
44
"description": "Evolve Idle",
55
"private": true,
66
"scripts": {

‎src/actions.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -15738,6 +15738,7 @@ export function bank_vault(){
1573815738
}
1573915739

1574015740
function bioseed(){
15741+
save.setItem('evolveBak',LZString.compressToUTF16(JSON.stringify(global)));
1574115742
global.lastMsg = false;
1574215743

1574315744
let god = global.race.species;
@@ -15879,6 +15880,7 @@ function cataclysm_end(){
1587915880
if (webWorker.w){
1588015881
webWorker.w.terminate();
1588115882
}
15883+
save.setItem('evolveBak',LZString.compressToUTF16(JSON.stringify(global)));
1588215884

1588315885
global.lastMsg = false;
1588415886

@@ -15975,12 +15977,13 @@ function cataclysm_end(){
1597515977

1597615978
global.race['start_cataclysm'] = 1;
1597715979
global.race['cataclysm'] = 1;
15978-
save.setItem('evolved',LZString.compressToUTF16(JSON.stringify(global)));
15980+
save.setItem('evolved',LZString.compressToUTF16(JSON.stringify(global)));
1597915981
window.location.reload();
1598015982
}
1598115983
}
1598215984

1598315985
function big_bang(){
15986+
save.setItem('evolveBak',LZString.compressToUTF16(JSON.stringify(global)));
1598415987
global.lastMsg = false;
1598515988

1598615989
unlockAchieve(`extinct_${global.race.species}`);

‎src/civics.js

+1
Original file line numberDiff line numberDiff line change
@@ -1760,6 +1760,7 @@ function defineMad(){
17601760
}
17611761

17621762
function warhead(){
1763+
save.setItem('evolveBak',LZString.compressToUTF16(JSON.stringify(global)));
17631764
global.lastMsg = false;
17641765

17651766
let god = global.race.species;

‎src/evolve.less

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ div {
3838
transition: all 200ms ease;
3939
}
4040

41+
.button.right {
42+
float: right;
43+
}
44+
4145
a {
4246
cursor: pointer;
4347
text-decoration: none;

‎src/functions.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ export function mainVue(){
2222
$('#importExport').select();
2323
document.execCommand('copy');
2424
},
25+
restoreGame(){
26+
let restore_data = save.getItem('evolveBak') || false;
27+
if (restore_data){
28+
importGame(restore_data,true);
29+
}
30+
},
2531
lChange(){
2632
global.settings.locale = $('#localization select').children("option:selected").val();
2733
save.setItem('evolved',LZString.compressToUTF16(JSON.stringify(global)));
@@ -91,6 +97,9 @@ export function mainVue(){
9197
expose(){
9298
return loc('settings8');
9399
},
100+
restoreData(){
101+
return loc('settings9');
102+
},
94103
remove(index){
95104
global.r_queue.queue.splice(index,1);
96105
}
@@ -176,8 +185,9 @@ window.exportGame = function exportGame(){
176185
return LZString.compressToBase64(JSON.stringify(global));
177186
}
178187

179-
window.importGame = function importGame(data){
180-
let saveState = JSON.parse(LZString.decompressFromBase64(data));
188+
window.importGame = function importGame(data,utf16){
189+
let saveState = JSON.parse(utf16 ? LZString.decompressFromUTF16(data) : LZString.decompressFromBase64(data));
190+
console.log(saveState);
181191
if (saveState && 'evolution' in saveState && 'settings' in saveState && 'stats' in saveState && 'plasmid' in saveState.stats){
182192
global = saveState;
183193
save.setItem('evolved',LZString.compressToUTF16(JSON.stringify(global)));

‎src/index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ export function index(){
299299
</b-field>
300300
<button class="button" @click="saveImport">{{ 'import' | label }}</button>
301301
<button class="button" @click="saveExport">{{ 'export' | label }}</button>
302+
<button class="button right" @click="restoreGame"><b-tooltip :label="restoreData()" position="is-top" size="is-large" multilined animated>{{ 'restore' | label }}</b-tooltip></button>
302303
</div>
303304
<div class="reset">
304305
<b-collapse :open="false">
@@ -309,8 +310,8 @@ export function index(){
309310
{{ 'reset_warn' | label }}
310311
</h4>
311312
<p>
312-
<button class="button" :disabled="!s.disableReset" @click="soft_reset()"><b-tooltip :label="soft()" position="is-top" size="is-small" multilined animated>{{ 'reset_soft' | label }}</b-tooltip></button>
313-
<button class="button" :disabled="!s.disableReset" @click="reset()"><b-tooltip :label="hard()" position="is-top" size="is-small" multilined animated>{{ 'reset_hard' | label }}</b-tooltip></button>
313+
<button class="button" :disabled="!s.disableReset" @click="soft_reset()"><b-tooltip :label="soft()" position="is-top" size="is-large" multilined animated>{{ 'reset_soft' | label }}</b-tooltip></button>
314+
<button class="button right" :disabled="!s.disableReset" @click="reset()"><b-tooltip :label="hard()" position="is-top" size="is-small" multilined animated>{{ 'reset_hard' | label }}</b-tooltip></button>
314315
</p>
315316
</div>
316317
</div>

‎src/vars.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ if (convertVersion(global['version']) < 8017){
429429
}
430430
}
431431

432-
global['version'] = '0.9.1';
432+
global['version'] = '0.9.2';
433433
delete global['beta'];
434434

435435
if (global.civic['cement_worker'] && global.civic.cement_worker.impact === 0.25){
@@ -1062,6 +1062,10 @@ if (global['arpa'] && global.arpa['launch_facility'] && global.arpa.launch_facil
10621062
global.tech['space'] = 1;
10631063
}
10641064

1065+
if (!(save.getItem('evolveBak'))){
1066+
save.setItem('evolveBak',LZString.compressToUTF16(JSON.stringify(global)));
1067+
}
1068+
10651069
function newGameData(){
10661070
global['race'] = { species : 'protoplasm', gods: 'none', old_gods: 'none', seeded: false };
10671071
Math.seed = Math.rand(0,10000);

‎src/wiki/change.js

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ import {} from './../vars.js';
22
import { clearElement } from './../functions.js';
33

44
const changeList = [
5+
{
6+
version: `0.9.2`,
7+
date: `6/29/2020`,
8+
changes: [
9+
`Added Restore Backup option, restores game to just before your last prestige reset.`
10+
]
11+
},
512
{
613
version: `0.9.1`,
714
date: `6/21/2020`,

‎strings/strings.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,13 @@
6363
"icons": "Prestige Icon",
6464
"settings1": "Enable Control (10x) / Shift (25x) / Alt (100x) Multiplier keys",
6565
"settings2": "Enable tab transition animations",
66-
"settings3": "A hard reset will permanently erase all your game progress",
67-
"settings4": "A soft reset will reset your current run back to the evolution stage. You will not gain any bonuses.",
66+
"settings3": "A hard reset will permanently erase all your game progress. This resets everything as if you never played.",
67+
"settings4": "A soft reset will reset your current run back to the evolution stage. You will not gain any bonuses. This only wipes out the current run, your previous progress is retained.",
6868
"settings5": "Enable City Categorization",
6969
"settings6": "Enable Add to Queue Key (Q)",
7070
"settings7": "Do not enforce queue order",
7171
"settings8": "Expose read only game data to window object for script support. May slow the game. The author of Evolve does not endorse scripting or provide any additional support for it. Use at your own risk.",
72+
"settings9": "Restore game back to your last restore point. A restore point is generated automatically after each prestige reset.",
7273
"enable_reset": "Enable Reset Buttons",
7374
"reset_warn": "Warning: This completely resets all your progress and cannot be undone. This is NOT a prestige mechanic; you are wiping out your game data. Keep this button disabled.",
7475
"reset_soft": "Soft Reset Game",
@@ -82,6 +83,7 @@
8283
"expose": "Enable Script Support",
8384
"import": "Import Game",
8485
"export": "Export Game",
86+
"restore": "Restore Backup",
8587
"new": "You are protoplasm in the primordial ooze",
8688
"star": "Star",
8789
"party": "Party Hat",
@@ -2953,7 +2955,7 @@
29532955
"trait_hyper_name": "Hyper",
29542956
"trait_skittish": "Your race is easily startled and may lose productivity when scared.",
29552957
"trait_skittish_name": "Skittish",
2956-
"trait_fragrant": "Your give off a strong oder, which while not unpleasent makes hunting harder.",
2958+
"trait_fragrant": "You give off a strong odor, which while not unpleasent makes hunting harder.",
29572959
"trait_fragrant_name": "Fragrant",
29582960
"trait_sticky": "Your sticky body traps prey reducing food requirements and giving you an edge in combat.",
29592961
"trait_sticky_name": "Sticky",

‎wiki/wiki.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.