mirror of
				https://github.com/bartvdbraak/SlayerWeightCalculator.git
				synced 2025-10-31 12:19:11 +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"> |         <div class="col-6"> | ||||||
|             <p>Unlocks:</p> |             <p>Unlocks:</p> | ||||||
|             <form> |             <form> | ||||||
|                 <ul><label><input type="checkbox" name="reddrags" id="reddrags">  |                 <ul> | ||||||
|                     Seeing red (Unlocks Red Dragons)</label></ul> |                 <li><label><input type="checkbox" name="reddrags" id="reddrags">  | ||||||
|                 <ul><label><input type="checkbox" name="mithdrags" id="mithdrags">  |                     Seeing red (Unlocks Red Dragons)</label></li> | ||||||
|                     I hope you mith me (Unlocks Mithril Dragons)</label></ul> |                 <li><label><input type="checkbox" name="mithdrags" id="mithdrags">  | ||||||
|                 <ul><label><input type="checkbox" name="aviansies" id="aviansies">  |                     I hope you mith me (Unlocks Mithril Dragons)</label></li> | ||||||
|                     Watch the birdie (Unlocks Aviansies)</label></ul> |                 <li><label><input type="checkbox" name="aviansies" id="aviansies">  | ||||||
|                 <ul><label><input type="checkbox" name="tzhaar" id="tzhaar">  |                     Watch the birdie (Unlocks Aviansies)</label></li> | ||||||
|                     Hot stuff (Unlocks TzHaars)</label></ul> |                 <li><label><input type="checkbox" name="tzhaar" id="tzhaar">  | ||||||
|                 <ul><label><input type="checkbox" name="lizardmen" id="lizardmen">  |                     Hot stuff (Unlocks TzHaars)</label></li> | ||||||
|                     Reptile got ripped (Unlocks Lizardmen)</label></ul> |                 <li><label><input type="checkbox" name="lizardmen" id="lizardmen">  | ||||||
|                 <ul><label><input type="checkbox" name="bosses" id="bosses">  |                     Reptile got ripped (Unlocks Lizardmen)</label></li> | ||||||
|                     Like a boss (Unlocks Bosses)</label></ul> |                 <li><label><input type="checkbox" name="bosses" id="bosses">  | ||||||
|                 <ul><label><input type="checkbox" name="fossilwyverns" id="fossilwyverns">  |                     Like a boss (Unlocks Bosses)</label></li> | ||||||
|                     Stop the Wyvern (Disables Fossil Island Wyverns)</label></ul> |                 <li><label><input type="checkbox" name="fossilwyverns" id="fossilwyverns">  | ||||||
|  |                     Stop the Wyvern (Disables Fossil Island Wyverns)</label></li> | ||||||
|  |                 </ul> | ||||||
|             </form>  |             </form>  | ||||||
|         </div> |         </div> | ||||||
|         <div class="col-6"> |         <div class="col-6"> | ||||||
|             <p>Task blocks:</p> |             <p>Task blocks:</p> | ||||||
|             <div id="blocklist"> |             <div id="blocklist"> | ||||||
|                 <ul>None (50 QP)</ul> |                 <ol> | ||||||
|                 <ul>None (100 QP)</ul> |                 <li> <select class="blocktask"><option value=""></option></select> (50 QP)</li> | ||||||
|                 <ul>None (150 QP)</ul> |                 <li> <select class="blocktask"><option value=""></option></select> (100 QP)</li> | ||||||
|                 <ul>None (200 QP)</ul> |                 <li> <select class="blocktask"><option value=""></option></select> (150 QP)</li> | ||||||
|                 <ul>None (250 QP)</ul> |                 <li> <select class="blocktask"><option value=""></option></select> (200 QP)</li> | ||||||
|                 <ul>None (Quest Cape)</ul> |                 <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> |         </div> | ||||||
|         <div class="col-6 text-center"> |         <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 ); |     }, 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) { | function filterTasks(data) { | ||||||
|     index_list = [] |     index_list = [] | ||||||
| 
 | 
 | ||||||
|     for (i = 0; i < data.length; i++) { |     for (i = 0; i < data.length; i++) { | ||||||
|  |          | ||||||
|  |         // Unlocks
 | ||||||
|  |          | ||||||
|         switch (data[i].monster) { |         switch (data[i].monster) { | ||||||
|             case 'Red dragons': |             case 'Red dragons': | ||||||
|                 if ($("#reddrags").prop("checked") == false) { |                 if ($("#reddrags").prop("checked") == false) { | ||||||
|  | @ -51,7 +78,20 @@ function filterTasks(data) { | ||||||
|                     index_list.push(i) |                     index_list.push(i) | ||||||
|                 } |                 } | ||||||
|         } |         } | ||||||
|  | 
 | ||||||
|  |         // Slayer requirement
 | ||||||
|  | 
 | ||||||
|  |         if (data[i].slayer_req > $("#slayerlevel").val()) { | ||||||
|  |             index_list.push(i) | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         // Task blocks
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|     console.log(index_list,data) |     console.log(index_list,data) | ||||||
|     return data |     return data | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue