mirror of
https://github.com/bartvdbraak/SlayerWeightCalculator.git
synced 2025-04-27 01:31:20 +00:00
functionality for unlocks, filtering and percentages
This commit is contained in:
parent
1c816c74ad
commit
c7c02b4bd1
3 changed files with 64 additions and 21 deletions
|
@ -1 +0,0 @@
|
|||
,bartvdbraak,BART-MINT,24.04.2019 02:29,file:///home/bartvdbraak/.config/libreoffice/4;
|
44
index.html
44
index.html
|
@ -30,31 +30,35 @@
|
|||
<div class="col-6">
|
||||
<p>Unlocks:</p>
|
||||
<form>
|
||||
<ul><label><input type="checkbox" name="reddrags" id="reddrags">
|
||||
Seeing red (Unlocks Red Dragons)</label></ul>
|
||||
<ul><label><input type="checkbox" name="mithdrags" id="mithdrags">
|
||||
I hope you mith me (Unlocks Mithril Dragons)</label></ul>
|
||||
<ul><label><input type="checkbox" name="aviansies" id="aviansies">
|
||||
Watch the birdie (Unlocks Aviansies)</label></ul>
|
||||
<ul><label><input type="checkbox" name="tzhaar" id="tzhaar">
|
||||
Hot stuff (Unlocks TzHaars)</label></ul>
|
||||
<ul><label><input type="checkbox" name="lizardmen" id="lizardmen">
|
||||
Reptile got ripped (Unlocks Lizardmen)</label></ul>
|
||||
<ul><label><input type="checkbox" name="bosses" id="bosses">
|
||||
Like a boss (Unlocks Bosses)</label></ul>
|
||||
<ul><label><input type="checkbox" name="fossilwyverns" id="fossilwyverns">
|
||||
Stop the Wyvern (Disables Fossil Island Wyverns)</label></ul>
|
||||
<ul>
|
||||
<li><label><input type="checkbox" name="reddrags" id="reddrags">
|
||||
Seeing red (Unlocks Red Dragons)</label></li>
|
||||
<li><label><input type="checkbox" name="mithdrags" id="mithdrags">
|
||||
I hope you mith me (Unlocks Mithril Dragons)</label></li>
|
||||
<li><label><input type="checkbox" name="aviansies" id="aviansies">
|
||||
Watch the birdie (Unlocks Aviansies)</label></li>
|
||||
<li><label><input type="checkbox" name="tzhaar" id="tzhaar">
|
||||
Hot stuff (Unlocks TzHaars)</label></li>
|
||||
<li><label><input type="checkbox" name="lizardmen" id="lizardmen">
|
||||
Reptile got ripped (Unlocks Lizardmen)</label></li>
|
||||
<li><label><input type="checkbox" name="bosses" id="bosses">
|
||||
Like a boss (Unlocks Bosses)</label></li>
|
||||
<li><label><input type="checkbox" name="fossilwyverns" id="fossilwyverns">
|
||||
Stop the Wyvern (Disables Fossil Island Wyverns)</label></li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<p>Task blocks:</p>
|
||||
<div id="blocklist">
|
||||
<ul>None (50 QP)</ul>
|
||||
<ul>None (100 QP)</ul>
|
||||
<ul>None (150 QP)</ul>
|
||||
<ul>None (200 QP)</ul>
|
||||
<ul>None (250 QP)</ul>
|
||||
<ul>None (Quest Cape)</ul>
|
||||
<ol>
|
||||
<li> <select class="blocktask"><option value=""></option></select> (50 QP)</li>
|
||||
<li> <select class="blocktask"><option value=""></option></select> (100 QP)</li>
|
||||
<li> <select class="blocktask"><option value=""></option></select> (150 QP)</li>
|
||||
<li> <select class="blocktask"><option value=""></option></select> (200 QP)</li>
|
||||
<li> <select class="blocktask"><option value=""></option></select> (250 QP)</li>
|
||||
<li> <select class="blocktask"><option value=""></option></select> (Quest Cape)</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 text-center">
|
||||
|
|
40
js/script.js
40
js/script.js
|
@ -11,10 +11,37 @@ jQuery.fn.dataTable.Api.register( 'sum()', function ( ) {
|
|||
}, 0 );
|
||||
} );
|
||||
|
||||
function setBlocklists() {
|
||||
$.getJSON( "data/monsters.json", function( data ) {
|
||||
|
||||
var content = '';
|
||||
|
||||
console.log(data)
|
||||
for (i = 0; i < data.length; i++) {
|
||||
console.log(data[i].monster)
|
||||
content += '<option value="'+data[i].monster+'">'+data[i].monster+'</option>'
|
||||
}
|
||||
|
||||
console.log(content)
|
||||
|
||||
$( ".blocktask" ).each(function( index ) {
|
||||
$(this).append(content)
|
||||
});
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
setBlocklists();
|
||||
});
|
||||
|
||||
function filterTasks(data) {
|
||||
index_list = []
|
||||
|
||||
for (i = 0; i < data.length; i++) {
|
||||
|
||||
// Unlocks
|
||||
|
||||
switch (data[i].monster) {
|
||||
case 'Red dragons':
|
||||
if ($("#reddrags").prop("checked") == false) {
|
||||
|
@ -51,7 +78,20 @@ function filterTasks(data) {
|
|||
index_list.push(i)
|
||||
}
|
||||
}
|
||||
|
||||
// Slayer requirement
|
||||
|
||||
if (data[i].slayer_req > $("#slayerlevel").val()) {
|
||||
index_list.push(i)
|
||||
}
|
||||
|
||||
// Task blocks
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
console.log(index_list,data)
|
||||
return data
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue