Browse Source

Debug menu;

master
Nero Ignis 4 years ago
parent
commit
7142395a42
  1. 16
      index.html
  2. 20
      js/app.js

16
index.html

@ -155,6 +155,22 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-12">
<div class="card">
<a class="card-header" data-toggle="collapse" href="#collapseDebug" role="button" aria-expanded="true" aria-controls="collapseDebug">
<h3>Debug</h3>
</a>
<div class="card-body" id="collapseDebug">
<a class="btn btn-sm btn-danger" href="javascript:" @click="resources = {gold: 500,wood: 50,stone: 50,iron: 50,bricks: 50,corn: 50,coal: 50,planks: 50}">Reset resources</a>
<a class="btn btn-sm btn-danger" href="javascript:" @click="removeBlackSmith()">Blacksmith fix (is buggy, don't use yet)</a><br/>
<br/>
<br/>
<a class="btn btn-sm btn-danger" href="javascript:" @click="reset()">Soft reset (everything except resources)</a><br/>
<a class="btn btn-sm btn-danger" href="javascript:" @click="reset(true)">Hard reset (everything)</a><br/>
</div>
</div>
</div>
</div> </div>
</div> </div>

20
js/app.js

@ -105,6 +105,7 @@ let game = new Vue({
price: 600, price: 600,
priceMultiplicator: 2 priceMultiplicator: 2
}, },
// Wood is gone when production dies
{ {
name: 'Blacksmith', name: 'Blacksmith',
resource: 'iron', resource: 'iron',
@ -634,6 +635,25 @@ let game = new Vue({
transitionIn: 'boundInRight', transitionIn: 'boundInRight',
transitionInMobile: 'boundInRight' transitionInMobile: 'boundInRight'
}); });
},
// Debug & Testing
removeBlackSmith() {
this.buildings[5].isOwned = false;
this.saveBuildingsToStorage();
location.reload();
},
reset(hard = false) {
localStorage.removeItem('buildings' + this.version);
localStorage.removeItem('hadResource' + this.version);
localStorage.removeItem('currentQuest' + this.version);
if (hard) {
localStorage.removeItem('resources' + this.version);
}
location.reload();
} }
} }
}); });

Loading…
Cancel
Save