From 507d5b7cb66edc0d2b3401fa9151ec7754f585d4 Mon Sep 17 00:00:00 2001 From: jbbieber1127 Date: Thu, 4 Apr 2019 12:58:36 -0400 Subject: [PATCH] differentiates b/w discovered and undiscovered shrines now --- index.html | 2 +- js/chart.js | 47 ++++++++++++++++++++++++++++++----------------- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/index.html b/index.html index 06c4808..967f265 100644 --- a/index.html +++ b/index.html @@ -17,7 +17,7 @@

(WORK IN PROGRESS) Interactive Sekiro Map by John Bieber - Inspired by: - + \ No newline at end of file diff --git a/js/chart.js b/js/chart.js index 9b271ae..3aeac35 100644 --- a/js/chart.js +++ b/js/chart.js @@ -266,23 +266,36 @@ let drawMap = () => { continue; } if(type == 'shrine'){ - let img = new Image(); - img.onload = () => { - let height = img.height; - let width = img.width; - svg.append('image') - .attr('x', x - width/2) - .attr('y', y - height/2 - 25) // 25 is an arbitrary offset for style - .attr('xlink:href', img.src); - }; - img.src = image_dir + 'shrine_discovered.png'; - svg.append('circle') - .attr('cx', x) - .attr('cy', y) - .attr('r', type_space['shrine']) - .attr('fill', 'none') - .attr('stroke-width', 5) - .attr('stroke', 'LightBlue'); + if(discovered[i]){ + let img = new Image(); + img.onload = () => { + let height = img.height; + let width = img.width; + svg.append('image') + .attr('x', x - width/2) + .attr('y', y - height/2 - 25) // 25 is an arbitrary offset for style + .attr('xlink:href', img.src); + }; + img.src = image_dir + 'shrine_discovered.png'; + svg.append('circle') + .attr('cx', x) + .attr('cy', y) + .attr('r', type_space['shrine']) + .attr('fill', 'none') + .attr('stroke-width', 5) + .attr('stroke', 'LightBlue'); + }else{ + let img = new Image(); + img.onload = () => { + let height = img.height; + let width = img.width; + svg.append('image') + .attr('x', x - width/2) + .attr('y', y - height/2 - 25) // 25 is an arbitrary offset for style + .attr('xlink:href', img.src); + }; + img.src = image_dir + 'shrine_undiscovered.png'; + } }else if(type == 'encounter'){ svg.append('circle') .attr('cx', x)