aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstonedDiscord <stoned@derpymail.org>2019-07-18 21:40:45 +0200
committerstonedDiscord <stoned@derpymail.org>2019-07-18 21:40:45 +0200
commita9d9360faac5cce611acab620a1e4368028f5c01 (patch)
tree0246a31589a28573ba40286c73a1a3f3dd5e17de
parent5f8a02f59022a9c82eac035a0cfa148b19adc1ce (diff)
only show missingno for characters and not testimony/evidence
-rw-r--r--webAO/client.html6
-rw-r--r--webAO/client.js13
2 files changed, 15 insertions, 4 deletions
diff --git a/webAO/client.html b/webAO/client.html
index be3997e..29ff072 100644
--- a/webAO/client.html
+++ b/webAO/client.html
@@ -25,12 +25,12 @@
<div id="client_icwrapper">
<div id="client_background"></div>
<div id="client_gamewindow">
- <img id="client_court" alt="Courtroom background" onerror="imgError(this);">
- <img id="client_char" onerror="imgError(this);">
+ <img id="client_court" alt="Courtroom backdrop" onerror="imgError(this);">
+ <img id="client_char" alt="Character" onerror="charError(this);">
<img id="client_bench">
<img id="client_fg" alt="Various overlay" onerror="imgError(this);">
<img id="client_evi" src="misc/evidence_selector.png" alt="Character Evidence" onerror="imgError(this);">
- <img id="client_shout" alt="Effect overlay" src="misc/placeholder.gif" onerror="imgError(this);">
+ <img id="client_shout" alt="Shout overlay" src="misc/placeholder.gif" onerror="imgError(this);">
<div id="client_name">
<p>Dolan</p>
</div>
diff --git a/webAO/client.js b/webAO/client.js
index 8a5ddfb..f417c5b 100644
--- a/webAO/client.js
+++ b/webAO/client.js
@@ -1414,7 +1414,7 @@ window.changeCharacter = changeCharacter;
* Triggered when there was an error loading a character sprite.
* @param {HTMLImageElement} image the element containing the missing image
*/
-export function imgError(image) {
+export function charError(image) {
image.onerror = "";
image.src = "misc/placeholder.gif";
return true;
@@ -1422,6 +1422,17 @@ export function imgError(image) {
window.imgError = imgError;
/**
+ * Triggered when there was an error loading a generic sprite.
+ * @param {HTMLImageElement} image the element containing the missing image
+ */
+export function imgError(image) {
+ image.onerror = "";
+ image.src = ""; //unload so the old sprite doesn't persist
+ return true;
+}
+window.imgError = imgError;
+
+/**
* Triggered when there was an error loading a character icon.
* @param {HTMLImageElement} image the element containing the missing image
*/