Skip to content

Commit

Permalink
Change to ghost data to make it ready for translations
Browse files Browse the repository at this point in the history
  • Loading branch information
tybayn committed Dec 28, 2024
1 parent 9fedd10 commit 35e258b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
};
</script>
<script src="jquery/jquery-3.6.2.min.js"></script>
<script src="scripts-v7/ghost_template-v1.js"></script>
<script src="scripts-v7/ghost_template-v2.js"></script>
<link rel="stylesheet" href="styles-v7/style-v13.css"/>
<link rel="stylesheet" href="styles-v7/style-mobile-v12.css"/>
<link rel="stylesheet" href="themes-v7/themes-v2.css"/>
Expand Down Expand Up @@ -1010,7 +1010,7 @@ <h1 id="new_offset" style="display:none;"></h1>
<script src="scripts-v7/filter-v18.js"></script>
<script src="scripts-v7/sanity-v3.js"></script>
<script src="scripts-v7/wslink-v14.js"></script>
<script src="scripts-v7/zn-v12.js"></script>
<script src="scripts-v7/zn-v13.js"></script>
<script src="events-v7/events-v1.js"></script>
<script src="models-v7/models-v1.js"></script>
<script src="feed-v7/feed-v1.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ has_los_guide = [
]

class Ghost {
constructor(data){
constructor(data,evidence){

this.ghostTemplate = `
<div class="ghost_card" id="${data.ghost}">
<div class="ghost_name">${data.ghost}</div>
<div class="ghost_name">${data.name}</div>
<div class="ghost_hunt_info">
<div class="ghost_hunt ${parseInt(data.hunt_sanity_high) > 50 ?'high':parseInt(data.hunt_sanity_high) < 50 ? 'low':'average'}">
<img src="imgs/sanity.png">
Expand All @@ -61,10 +61,10 @@ class Ghost {
</div>
</div>
<div class="ghost_evidence">
${this.build_evidence_item(data.evidence[0])}
${this.build_evidence_item(data.evidence[1])}
${this.build_evidence_item(data.evidence[2])}
${data.ghost == "The Mimic" ? this.build_evidence_item('Ghost Orbs') : ''}
${this.build_evidence_item(data.evidence[0],evidence[data.evidence[0]])}
${this.build_evidence_item(data.evidence[1],evidence[data.evidence[1]])}
${this.build_evidence_item(data.evidence[2],evidence[data.evidence[2]])}
${data.ghost == "The Mimic" ? this.build_evidence_item(evidence['Ghost Orbs']) : ''}
</div>
<div class="ghost_nightmare_evidence">${data.nightmare_evidence?data.nightmare_evidence:''}</div>
<div class="ghost_hunt_high">${data.hunt_sanity_high}</div>
Expand Down Expand Up @@ -106,8 +106,8 @@ class Ghost {
`
}

build_evidence_item(evidence){
return `<div class="ghost_evidence_item" ${evidence in evi_color ? 'style=\"color:' + evi_color[evidence] + ' !important;\"' : ''}><img src="${evi_icons[evidence]}">${evidence}</div>`
build_evidence_item(evidence,evidence_name){
return `<div class="ghost_evidence_item" ${evidence in evi_color ? 'style=\"color:' + evi_color[evidence] + ' !important;\"' : ''}><img src="${evi_icons[evidence]}">${evidence_name}</div>`
}

build_tells(tells,behavior,abilities){
Expand Down
11 changes: 5 additions & 6 deletions scripts-v7/zn-v12.js → scripts-v7/zn-v13.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,29 +181,28 @@ function loadAllAndConnect(){
var wiki = document.getElementById('wiki-0-evidence-data')
var cur_version = document.getElementById('current-version-label')
var evidence_list = document.getElementById('evidence')


evidence_list.innerHTML = "";
for(var i = 0; i < data.evidence.length; i++){
Object.entries(data.evidence).forEach(([key,value]) => {
evidence_list.innerHTML += `
<div class="evidence-row">
<img class="monkey-smudge" style="display:none;" src="imgs/smudge.png">
<button id="${data.evidence[i]}" class="tricheck white" name="evidence" onclick="tristate(this)" value="${data.evidence[i]}">
<button id="${key}" class="tricheck white" name="evidence" onclick="tristate(this)" value="${key}">
<div id="checkbox" class="neutral"><span class="icon"></span></div>
<div class="label">${data.evidence[i]}</div>
<div class="label">${value}</div>
</button>
<img class="monkey-paw-select" src="imgs/paw-icon.png" onclick="monkeyPawFilter(this)">
</div>
`
}
})

cards.innerHTML = "";
wiki.innerHTML = "";
for(var i = 0; i < data.ghosts.length; i++){
bpm_speeds.add(data.ghosts[i].min_speed)
if(data.ghosts[i].max_speed != null){bpm_speeds.add(data.ghosts[i].max_speed)}
if(data.ghosts[i].alt_speed != null){bpm_speeds.add(data.ghosts[i].alt_speed)}
var ghost = new Ghost(data.ghosts[i]);
var ghost = new Ghost(data.ghosts[i],data.evidence);
cards.innerHTML += `${ghost.ghostTemplate}`
wiki.innerHTML += (i == data.ghosts.length-1 ? `${ghost.wikiTemplate.replace("&#9500;","&#9492;")}` : `${ghost.wikiTemplate}`)
}
Expand Down

0 comments on commit 35e258b

Please sign in to comment.