aboutsummaryrefslogtreecommitdiff
path: root/webAO/client/setEmote.js
diff options
context:
space:
mode:
authorCaleb Mabry <36182383+caleb-mabry@users.noreply.github.com>2022-07-17 00:56:15 -0400
committerCaleb Mabry <36182383+caleb-mabry@users.noreply.github.com>2022-07-17 00:56:15 -0400
commit25fe710c3b36b097502a5f3e0afb024312cbf7b9 (patch)
tree12d155c0cfa7e40972c47043949a4450988b6c8a /webAO/client/setEmote.js
parentbde7f84ccc633af051bd84d6c563a9ced3052fe3 (diff)
Moved viewport out of client
Diffstat (limited to 'webAO/client/setEmote.js')
-rw-r--r--webAO/client/setEmote.js40
1 files changed, 0 insertions, 40 deletions
diff --git a/webAO/client/setEmote.js b/webAO/client/setEmote.js
deleted file mode 100644
index f682fe5..0000000
--- a/webAO/client/setEmote.js
+++ /dev/null
@@ -1,40 +0,0 @@
-import transparentPng from '../constants/transparentPng';
-import fileExists from '../utils/fileExists';
-
-/**
- * Sets all the img tags to the right sources
- * @param {*} chatmsg
- */
-
-const setEmote = async (AO_HOST, client, charactername, emotename, prefix, pair, side) => {
- const pairID = pair ? 'pair' : 'char';
- const characterFolder = `${AO_HOST}characters/`;
- const acceptedPositions = ['def', 'pro', 'wit'];
- const position = acceptedPositions.includes(side) ? `${side}_` : '';
- const emoteSelector = document.getElementById(`client_${position}${pairID}_img`)
- const extensionsMap = [
- '.gif',
- '.png',
- '.apng',
- '.webp'
- ];
-
- for (const extension of extensionsMap) {
- // Hides all sprites before creating a new sprite
- if (client.lastChar !== client.chatmsg.name) {
- emoteSelector.src = transparentPng;
- }
- let url;
- if (extension === '.png') {
- url = `${characterFolder}${encodeURI(charactername)}/${encodeURI(emotename)}${extension}`;
- } else {
- url = `${characterFolder}${encodeURI(charactername)}/${encodeURI(prefix)}${encodeURI(emotename)}${extension}`;
- }
- const exists = await fileExists(url);
- if (exists) {
- emoteSelector.src = url;
- break;
- }
- }
-};
-export default setEmote;