-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d4cc68
commit 570585b
Showing
4 changed files
with
67 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<html><head> | ||
<meta charset="UTF-8"/> | ||
<link rel="stylesheet" type="text/css" href="../../../main.css"/> | ||
<link rel="stylesheet" type="text/css" href="../../../guide.css"/> | ||
<script src="./../../../progress.js"></script> | ||
<script src="./npcpage.js"></script> | ||
<title>NPC — Interactive Oblivion Checklist</title> | ||
</head> | ||
<body> | ||
|
||
<div class="h2" id="title"></div> | ||
<div class="section" id="section_race"> | ||
<div class="sectionTitle">Race</div> | ||
<p id="racep"></p> | ||
</div> | ||
<div class="section" id="section_gameimage"> | ||
<div class="sectionTitle">In-Game Image</div> | ||
<img id="gameImage"src=""/> | ||
</div> | ||
<div class="section" id="section_schedule"> | ||
<div class="sectionTitle">Schedule</div> | ||
</div> | ||
<div class="section" id="section_uesp"> | ||
<div class="sectionTitle"><a id="uespLink" href="">UESP Link</a></div> | ||
</div> | ||
<script> | ||
document.getElementById("gameImage").addEventListener('error',fallbackIngameImage); | ||
var id = new URLSearchParams(window.location.search).get("id") | ||
loadJsonData("../../..").then(()=>generatePage(id)); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
function generatePage(npcFormId){ | ||
const npc = findOnTree(jsondata.npc, (e=>e?.formId == npcFormId), (x=>!(x?.formId == null))); | ||
|
||
document.getElementById("title").innerText = npc.name ?? "unknown"; | ||
document.getElementById("racep").innerText = npc.race ?? "unknown"; | ||
document.getElementById("gameImage").src="npc"+npcFormId+"_ingame.jpg"; | ||
|
||
var link; | ||
if(npc.link){ | ||
link = npc.link; | ||
} | ||
else{ | ||
link = "https://en.uesp.net/wiki/Oblivion:"+npc.name.replaceAll(" ","_"); | ||
} | ||
document.getElementById("uespLink").href=link; | ||
} | ||
|
||
var tries = 0; | ||
function fallbackIngameImage(eventArgs){ | ||
if(tries < 3){ | ||
eventArgs.target.src = "./../in-game-placeholder.png"; | ||
tries += 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters