aboutsummaryrefslogtreecommitdiff
path: root/webAO/client.js
diff options
context:
space:
mode:
authorQube <qchinious@gmail.com>2018-07-21 21:07:06 +0700
committerQube <qchinious@gmail.com>2018-07-21 21:07:06 +0700
commit4cf6fb8e8609dbf84149d0410393f9e3436fea91 (patch)
tree4feccb8bc187cdf9d0d3940e4bece27c372e2093 /webAO/client.js
parentb8f6c358d2f82153f107d4bc0beef394925b5082 (diff)
Convert all character animation name to lowercase if user use asset from default asset site.
Diffstat (limited to 'webAO/client.js')
-rw-r--r--webAO/client.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/webAO/client.js b/webAO/client.js
index bd9a840..18363aa 100644
--- a/webAO/client.js
+++ b/webAO/client.js
@@ -823,6 +823,8 @@ class Client {
let me = this.me();
let emotes = this.emotes;
let xhr = new XMLHttpRequest();
+ let isOfficialAssets = (AO_HOST == "http://assets.aceattorneyonline.com/base/");
+ xhr.withCredentials = false;
document.getElementById("client_emo").innerHTML = ""; // Clear emote box
xhr.open('GET', AO_HOST + 'characters/' + escape(this.me().name) + '/char.ini', true);
xhr.responseType = 'text';
@@ -843,14 +845,14 @@ class Client {
esfxd = pinifile.SoundT[i];
}
emotes[i] = {
- desc: emoteinfo[0],
- speaking: emoteinfo[1],
- silent: emoteinfo[2],
+ desc: (isOfficialAssets)? emoteinfo[0].toLowerCase() : emoteinfo[0],
+ speaking: (isOfficialAssets)? emoteinfo[1].toLowerCase() : emoteinfo[1],
+ silent: (isOfficialAssets)? emoteinfo[2].toLowerCase() : emoteinfo[2],
zoom: emoteinfo[3],
- sfx: esfx,
+ sfx: (isOfficialAssets)? esfx.toLowerCase() : esfx,
sfxdelay: esfxd,
- button_off: AO_HOST + 'characters/' + escape(me.name) + '/emotions/button' + i + '_off.png',
- button_on: AO_HOST + 'characters/' + escape(me.name) + '/emotions/button' + i + '_on.png'
+ button_off: AO_HOST + 'characters/' + ((isOfficialAssets)? escape(me.name).toLowerCase() : escape(me.name)) + '/emotions/button' + i + '_off.png',
+ button_on: AO_HOST + 'characters/' + ((isOfficialAssets)? escape(me.name).toLowerCase() : escape(me.name)) + '/emotions/button' + i + '_on.png'
};
document.getElementById("client_emo").innerHTML += "<img src='" + emotes[i].button_off + "' id='emo_" + i + "' alt='" + emotes[i].desc + "' class='client_button' onclick='pickemotion(" + i + ")'>";
}