aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstonedDiscord <stoned@derpymail.org>2020-07-10 18:57:56 +0200
committerGitHub <noreply@github.com>2020-07-10 18:57:56 +0200
commit768c594b60e43fe28fb197e9ca5580edba5a5c73 (patch)
tree57193faab4172a8bde1db32bc6af3ca311e8034a
parent865c695be40d4deb9c2a506de167242e69e4f278 (diff)
parentd42e757d5ef04a39b0a1d377f99755d5a85d4550 (diff)
Merge pull request #59 from AttorneyOnline/emote_buttons
Emote buttons
-rw-r--r--webAO/client.js9
-rw-r--r--webAO/styles/client.css4
2 files changed, 8 insertions, 5 deletions
diff --git a/webAO/client.js b/webAO/client.js
index 7f80280..cab7937 100644
--- a/webAO/client.js
+++ b/webAO/client.js
@@ -1261,11 +1261,10 @@ class Client extends EventEmitter {
frame_screenshake: "",
frame_realization: "",
frame_sfx: "",
- button_off: AO_HOST + `characters/${encodeURI(me.name.toLowerCase())}/emotions/button${i}_off.png`,
- button_on: AO_HOST + `characters/${encodeURI(me.name.toLowerCase())}/emotions/button${i}_on.png`
+ button: AO_HOST + `characters/${encodeURI(me.name.toLowerCase())}/emotions/button${i}_off.png`
};
emotesList.innerHTML +=
- `<img src=${emotes[i].button_off}
+ `<img src=${emotes[i].button}
id="emo_${i}"
alt="${emotes[i].desc}"
class="emote_button"
@@ -2462,13 +2461,13 @@ window.pickChar = pickChar;
export function pickEmotion(emo) {
try {
if (client.selectedEmote !== -1) {
- document.getElementById("emo_" + client.selectedEmote).src = client.emote.button_off;
+ document.getElementById("emo_" + client.selectedEmote).classList="emote_button";
}
} catch (err) {
// do nothing
}
client.selectedEmote = emo;
- document.getElementById("emo_" + emo).src = client.emote.button_on;
+ document.getElementById("emo_" + emo).classList="emote_button dark";
}
window.pickEmotion = pickEmotion;
diff --git a/webAO/styles/client.css b/webAO/styles/client.css
index f49b395..cecba80 100644
--- a/webAO/styles/client.css
+++ b/webAO/styles/client.css
@@ -345,6 +345,10 @@
overflow-y: hidden;
}
+.emote_button.dark {
+ opacity: 0.5;
+}
+
#client_emo {
position: relative;
top: 10px;